[PATCH] Fix i18n packaging scripts
by Zhou Zheng Sheng
There are some small problems in i18n packaging. Through commit bd98489
adds i18n.json.tmpl to Makefile.am, it forgets to add it to RPM spec.
This patch adds i18n.json.tmpl to RPM spec files.
Another problem is that plugin/sample/po/Makefile.in.in is linked to
po/Makefile.in.in, so it would install the sample.mo to the system by
default. This patch copies po/Makefile.in.in to plugin/sample/po, and
change the install/uninstall target to skip installing and uninstalling
the sample mo files.
The last problem is that plugins/sample/config.status is needed by
plugin/sample/po/Makefile.in.in to create the actual Makefile. In git
source code repo it is a soft link to top level config.status, but it
didn't gets distributed in the tar ball. This patch adds this soft link
file to the dist tar ball.
To test this patch, firstly run the following commands.
make && make dist
Then
./autogen && make && make rpm
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
contrib/kimchi.spec.fedora.in | 2 +-
contrib/kimchi.spec.suse.in | 2 +-
plugins/sample/Makefile.am | 2 +-
plugins/sample/po/Makefile.in.in | 401 ++++++++++++++++++++++++++++++++++++++-
4 files changed, 403 insertions(+), 4 deletions(-)
mode change 120000 => 100644 plugins/sample/po/Makefile.in.in
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 2d4699b..cb8c4c7 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -177,7 +177,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
-%{_datadir}/kimchi/ui/pages/*.html.tmpl
+%{_datadir}/kimchi/ui/pages/*.tmpl
%{_datadir}/kimchi/ui/pages/help/*/*.html
%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
%{_datadir}/kimchi/ui/pages/websockify/*.html
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 165f566..1de8804 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -99,7 +99,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
-%{_datadir}/kimchi/ui/pages/*.html.tmpl
+%{_datadir}/kimchi/ui/pages/*.tmpl
%{_datadir}/kimchi/ui/pages/help/*/*.html
%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
%{_datadir}/kimchi/ui/pages/websockify/*.html
diff --git a/plugins/sample/Makefile.am b/plugins/sample/Makefile.am
index d753ac9..876ab54 100644
--- a/plugins/sample/Makefile.am
+++ b/plugins/sample/Makefile.am
@@ -19,7 +19,7 @@
SUBDIRS = ui po
-EXTRA_DIST = API.json sample.conf.in $(wildcard *.py)
+EXTRA_DIST = API.json sample.conf.in $(wildcard *.py) config.status
all-local:
while read L && test -n "$$L"; do \
diff --git a/plugins/sample/po/Makefile.in.in b/plugins/sample/po/Makefile.in.in
deleted file mode 120000
index 44028c0..0000000
--- a/plugins/sample/po/Makefile.in.in
+++ /dev/null
@@ -1 +0,0 @@
-../../../po/Makefile.in.in
\ No newline at end of file
diff --git a/plugins/sample/po/Makefile.in.in b/plugins/sample/po/Makefile.in.in
new file mode 100644
index 0000000..0eb3dda
--- /dev/null
+++ b/plugins/sample/po/Makefile.in.in
@@ -0,0 +1,400 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper(a)gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.18
+GETTEXT_MACRO_VERSION = 0.18
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @datadir@/kimchi/mo
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(MKDIR_P).
+# This macro uses the 'mkdir -p' command if possible. Otherwise, it falls back
+# on invoking install-sh with the -d option, so your package should contain
+# install-sh as described under AC_PROG_INSTALL.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+MKDIR_P = @MKDIR_P@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in gen-pot \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: check-macro-version update-gmo all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+check-macro-version:
+ @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
+ $(srcdir)/gen-pot $(POTFILES)
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(srcdir)/$(DOMAIN).pot
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install:
+
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(MKDIR_P) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(MKDIR_P) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--
1.9.3
10 years, 6 months
[PATCH v4 0/4] Fix: Report Overwritten when Provided Name Existing
by Hongliang Wang
When user provides an existing debug report name, then the server will generate
a new debug report and overwrite the old one.
Fixed it in this patch to detect the existing name and ask the user to choose
another name.
v3 -> v4:
4a) Switched to InvalidParameter instead of new ResourceAlreadyExists
(Aline's comment)
4b) Fixed screen blink problem
(Aline's comment)
v2 -> v3:
3a) Reduced code redundant
(Wen Wang's comment)
v1 -> v2:
2a) Recovered Generate Button behavior
(Wen Wang's comment)
2b) Leveraged get_list() function to check name existence
(Aline's comment)
Hongliang Wang (4):
Add Name Existence Check for Debug Report when Create
Add License Statement in kimchi.report_add_main.js
Add progress Event Handler for Asynchronized Tasks
Keep User from Generating a Report with an Existing Name
src/kimchi/i18n.py | 1 +
src/kimchi/model/debugreports.py | 5 +-
ui/js/src/kimchi.api.js | 3 +-
ui/js/src/kimchi.report_add_main.js | 105 +++++++++++++++++++++++-------------
4 files changed, 74 insertions(+), 40 deletions(-)
--
1.8.1.4
10 years, 6 months
[PATCH] Bug fix: Display the username on the header bar
by Crístian Viana
The commit 85e3837 has introduced a bug where the username is not being
displayed on the header bar. Also, if the user hovers the mouse on the
drop down menu ("Help" - "About" - "Log out"), the element changes its
position by a few pixels.
Fix the bug mentioned above by setting the username to a browser cookie.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
ui/pages/login.html.tmpl | 1 +
1 file changed, 1 insertion(+)
diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
index 94379b7..0fa7122 100644
--- a/ui/pages/login.html.tmpl
+++ b/ui/pages/login.html.tmpl
@@ -70,6 +70,7 @@ function setLang() {
function updateBtnLabel() {
document.getElementById("login").style.display = "none";
document.getElementById("logging").style.display = "";
+ kimchi.user.setUserName(document.getElementById("username").value);
}
function setMessage() {
var err = "$getVar('data.error', '')";
--
1.9.3
10 years, 6 months
[PATCHv3 0/3] Add out of box ISO storage pool
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v2>v3,
Update documents.
v1>v2,
As libvirt has dynamic permission configuration,
we do not need watch the iso added to storage pool any more,
we just need to make sure storage pool can be accessed and
libvirt will change its own/grp to the right one.
so after found this feature,
notification is deleted and create iso pool is retained.
Royce Lv (3):
Dedicated ISO pool: create an out of box ISO pool
Store qemu user name in class attribute
Add doc and test case for dedicate iso pool
docs/README.md | 5 +++++
src/kimchi/kvmusertests.py | 23 +++++++++++++----------
src/kimchi/model/model.py | 26 +++++++++++++++-----------
tests/test_model.py | 3 +++
ui/pages/help/en_US/storage.dita | 3 ++-
ui/pages/help/en_US/templates.dita | 3 ++-
ui/pages/help/pt_BR/storage.dita | 3 ++-
ui/pages/help/pt_BR/templates.dita | 3 ++-
ui/pages/help/zh_CN/storage.dita | 3 ++-
ui/pages/help/zh_CN/templates.dita | 3 ++-
10 files changed, 48 insertions(+), 27 deletions(-)
--
1.8.3.2
10 years, 6 months
[PATCH 0/5] Out of box ISO pool support
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Out of box ISO pool is created when kimchi is started,
when file is copied to this ISO pool,
its ownership will be fixed by inotify.
Royce Lv (5):
Dedicated ISO pool: create an out of box ISO pool
Store qemu user name in class attribute
Add functionality of report qemu owner and group
Add a monitor to change iso ownership
Start monitoring iso copy on kimchi start up
docs/README.md | 6 ++++--
src/kimchi/isomonitor.py | 33 +++++++++++++++++++++++++++++++++
src/kimchi/kvmusertests.py | 22 ++++++++++++----------
src/kimchi/model/model.py | 33 ++++++++++++++++++++++-----------
src/kimchi/utils.py | 8 ++++++++
5 files changed, 79 insertions(+), 23 deletions(-)
create mode 100644 src/kimchi/isomonitor.py
--
1.8.3.2
10 years, 6 months
[PATCH] Reword isolated network description
by Christy Perez
This patch has a one-word change for a message
string. It is missing the Chinese substitution,
though.
Christy Perez (1):
Reword 'isolated' network description
po/en_US.po | 4 ++--
po/kimchi.pot | 2 +-
po/pt_BR.po | 4 ++--
po/zh_CN.po | 2 +-
ui/pages/tabs/network.html.tmpl | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
--
1.9.3
10 years, 6 months
[PATCH] Host info: Add support to Power (ppc).
by Paulo Vital
Add support to get the correct information of Power's CPU hardware,
due to differences between the content of Power's /proc/cpuinfo and x86's
/proc/cpuinfo.
Also, add IBM PowerKVM information as supported distro.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
src/kimchi/model/host.py | 49 ++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 6 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index 5844f4b..5716487 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -50,17 +50,54 @@ class HostModel(object):
self.task = TaskModel(**kargs)
self.host_info = self._get_host_info()
- def _get_host_info(self):
- res = {}
+ def _get_ppc_cpu_info(self):
+ i = 0
with open('/proc/cpuinfo') as f:
for line in f.xreadlines():
- if "model name" in line:
- res['cpu'] = line.split(':')[1].strip()
- break
+ if 'cpu' in line:
+ # Parse CPU information
+ cpu_info = line.split(':')[1].strip()
+ cpu_info = cpu_info.split('(')[0].strip()
+ i = i + 1
+ if 'revision' in line:
+ # Parse CPU's revision information
+ rev_info = line.split(':')[1].strip()
+ rev_info = rev_info.split('(')[0].strip()
+ i = i + 1
+ if 'clock' in line:
+ # Parse CPU's clock information
+ clock_info = line.split(':')[1].strip()
+ clock_info = clock_info.split('MHz')[0].strip()
+ clock_info = float(clock_info) / 1000
+ i = i + 1
+
+ # Power machines show, for each cpu/core, a block with all
+ # cpu information. Here we control the scan of the necessary
+ # information (1st block provides everything), skipping the
+ # with/for loop when find all information.
+ if i == 3:
+ return "%s (%s) @ %s GHz" % (cpu_info, rev_info, clock_info)
+
+ return ""
+
+ def _get_host_info(self):
+ res = {}
+ if platform.machine().startswith('ppc'):
+ res['cpu'] = self._get_ppc_cpu_info()
+ else:
+ with open('/proc/cpuinfo') as f:
+ for line in f.xreadlines():
+ if "model name" in line:
+ res['cpu'] = line.split(':')[1].strip()
+ break
res['memory'] = psutil.TOTAL_PHYMEM
+
+ # Include IBM PowerKVM name to supported distro names
+ _sup_distros = platform._supported_dists + ('ibm_powerkvm',)
# 'fedora' '17' 'Beefy Miracle'
- distro, version, codename = platform.linux_distribution()
+ distro, version, codename = platform.linux_distribution(
+ supported_dists=_sup_distros)
res['os_distro'] = distro
res['os_version'] = version
res['os_codename'] = unicode(codename, "utf-8")
--
1.8.3.1
10 years, 6 months
[PATCH] Disable cache for help page
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Help page cache will result backend update not reflected
to ui.
So disable cache for help page so that user can see update
if help information changed.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/config.py.in | 2 +-
tests/test_config.py.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index ae35f1a..74c8fa5 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -220,7 +220,7 @@ class KimchiConfig(dict):
'tools.staticdir.on': True,
'tools.staticdir.dir': '%s/ui/pages/help' % paths.prefix,
'tools.staticdir.index': 'en_US/index.html',
- 'tools.nocache.on': False
+ 'tools.nocache.on': True
}
}
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index f651922..a78cb04 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -172,7 +172,7 @@ class ConfigTests(unittest.TestCase):
'tools.staticdir.on': True,
'tools.staticdir.dir': '%s/ui/pages/help' % paths.prefix,
'tools.staticdir.index': 'en_US/index.html',
- 'tools.nocache.on': False
+ 'tools.nocache.on': True
}
}
--
1.8.3.2
10 years, 6 months
[PATCH v3] Create pool UI: making 'Create' button disable when forms not filled.
by Daniel Barboza
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
Making the 'Create' button in storagepool_add enable only when
all form fields are filled, just like other kimchi forms.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storagepool_add_main.js | 60 +++++++++++++++++++++-----------
ui/pages/storagepool-add.html.tmpl | 4 +--
2 files changed, 41 insertions(+), 23 deletions(-)
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 0f3df32..23c8b27 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -20,6 +20,18 @@ kimchi.storagepool_add_main = function() {
kimchi.initStorageAddPage();
$('#form-pool-add').on('submit', kimchi.addPool);
$('#pool-doAdd').on('click', kimchi.addPool);
+ // 'pool-doAdd' button starts as disabled.
+ $("#pool-doAdd").button();
+ $("#pool-doAdd").button("disable");
+ // Make any change in the form fields enables the
+ // 'pool-doAdd' button if all the visible form
+ // fields are filled, disables it otherwise.
+ $('#form-pool-add').on('input change propertychange', function() {
+ if (!kimchi.inputsNotBlank())
+ $("#pool-doAdd").button("disable");
+ else
+ $("#pool-doAdd").button("enable");
+ });
};
kimchi.initStorageAddPage = function() {
@@ -75,7 +87,7 @@ kimchi.initStorageAddPage = function() {
value : "scsi"
} ];
$('#poolTypeId').selectMenu("setData", options);
-
+
kimchi.getStorageServers('netfs', function(data) {
var serverContent = [];
if (data.length > 0) {
@@ -147,13 +159,35 @@ kimchi.initStorageAddPage = function() {
});
};
+/* Returns 'true' if all form fields were filled, 'false' if
+ * any field is left blank. The function takes into account
+ * the current poolType selected.
+ *
+ * Any 'field is blank' verification that were done in other
+ * validate functions were deleted, since we're doing it here
+ * already.
+ */
+kimchi.inputsNotBlank = function() {
+ if (!$('#poolId').val()) return false;
+ var poolType = $("#poolTypeInputId").val();
+ if (poolType === "dir") {
+ if (!$('#pathId').val()) return false;
+ } else if (poolType === "netfs") {
+ if (!$('#nfspathId').val()) return false;
+ if (!$('#nfsserverId').val()) return false;
+ } else if (poolType === "iscsi") {
+ if (!$('#iscsiserverId').val()) return false;
+ if (!$('#iscsiTargetId').val()) return false;
+ } else if (poolType === "logical") {
+ if ($("input[name=devices]:checked").length === 0)
+ return false;
+ }
+ return true;
+};
+
kimchi.validateForm = function() {
var name = $('#poolId').val();
var poolType = $("#poolTypeInputId").val();
- if ('' === name) {
- kimchi.message.error.code('KCHPOOL6001E');
- return false;
- }
if (name.indexOf("/")!=-1) {
kimchi.message.error.code('KCHPOOL6004E');
return false;
@@ -173,10 +207,6 @@ kimchi.validateForm = function() {
kimchi.validateDirForm = function () {
var path = $('#pathId').val();
- if ('' === path) {
- kimchi.message.error.code('KCHPOOL6002E');
- return false;
- }
if (!/(^\/.*)$/.test(path)) {
kimchi.message.error.code('KCHAPI6003E');
return false;
@@ -190,10 +220,6 @@ kimchi.validateNfsForm = function () {
if (!kimchi.validateServer(nfsserver)) {
return false;
}
- if ('' === nfspath) {
- kimchi.message.error.code('KCHPOOL6003E');
- return false;
- }
if (!/((\/([0-9a-zA-Z-_\.]+)))$/.test(nfspath)) {
kimchi.message.error.code('KCHPOOL6005E');
return false;
@@ -207,18 +233,10 @@ kimchi.validateIscsiForm = function() {
if (!kimchi.validateServer(iscsiServer)) {
return false;
}
- if ('' === iscsiTarget) {
- kimchi.message.error.code('KCHPOOL6007E');
- return false;
- }
return true;
};
kimchi.validateServer = function(serverField) {
- if ('' === serverField) {
- kimchi.message.error.code('KCHPOOL6008E');
- return false;
- }
if(!kimchi.isServer(serverField)) {
kimchi.message.error.code('KCHPOOL6009E');
return false;
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index e6b1fd6..fbcad74 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -29,7 +29,7 @@
<div class="close">X</div>
</header>
<div class="content">
- <form id="form-pool-addd">
+ <form id="form-pool-add">
<section class="form-section">
<h2>1. $_("Storage Pool Name")</h2>
<div class="field">
@@ -152,7 +152,7 @@
</div>
<footer>
<div class="btn-group">
- <button id="pool-doAdd" class="btn-normal">
+ <button id="pool-doAdd" class="btn-normal ui-button-primary">
<span class="text">$_("Create")</span>
</button>
</div>
--
1.8.3.1
10 years, 6 months
[PATCH V7 0/8] Issue #342: load i18n.html of the plugin
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V7 -> V8:
improve the commit message.
improve the test case skip conditional expression, remove parenthesis
V5 -> V6:
skip test, when disable plugin.
V4 -> V5:
let autoconf generate sample.conf
V3 -> V4:
rebase
V2 -> V3:
change "enable-plugins" to "enable-sample"
remove nls
improve the Portuguese translation.
V1 -> V2:
The improvement concept here is to directly generate JSON on the server
and assign it to the i18n variable, rather than inserting nodes into the DOM.
Plugins would use a plugin1.i18n= structure to keep plugin strings from
colliding with each other, or with the kimchi variables.
ShaoHe Feng (7):
Update root.py to make Cheetah render the JSON template.
Update the i18n tmpl to produce JSON
Add JS API for fetching i18n JSON
Issue #342: load i18n.html of the plugin
add an optional to toggle the sample plugin
generate the translation files for plugins/sample
skip plugins test, when sample plugin is not enabled
Zhou Zheng Sheng (1):
Add Minimal UI Page for the Sample Plugin
configure.ac | 17 ++++
plugins/sample/Makefile.am | 11 +-
plugins/sample/__init__.py | 3 +-
plugins/sample/config.status | 1 +
plugins/sample/po/LINGUAS | 1 +
plugins/sample/po/Makefile.in.in | 1 +
plugins/sample/po/Makevars | 1 +
plugins/sample/po/POTFILES.in | 2 +
plugins/sample/po/en_US.po | 21 ++++
plugins/sample/po/gen-pot | 1 +
plugins/sample/po/pt_BR.po | 24 +++++
plugins/sample/po/zh_CN.po | 24 +++++
plugins/sample/sample.conf | 7 --
plugins/sample/sample.conf.in | 12 +++
plugins/sample/ui/config/tab-ext.xml | 8 +-
plugins/sample/ui/pages/i18n.json.tmpl | 9 ++
plugins/sample/ui/pages/tab.html.tmpl | 6 ++
src/kimchi/root.py | 5 +
src/kimchi/template.py | 34 ++++---
tests/test_plugin.py | 5 +-
ui/js/src/kimchi.api.js | 18 +++-
ui/js/src/kimchi.main.js | 24 ++++-
ui/pages/i18n.html.tmpl | 178 ---------------------------------
ui/pages/i18n.json.tmpl | 165 ++++++++++++++++++++++++++++++
24 files changed, 364 insertions(+), 214 deletions(-)
create mode 120000 plugins/sample/config.status
create mode 120000 plugins/sample/po/LINGUAS
create mode 120000 plugins/sample/po/Makefile.in.in
create mode 120000 plugins/sample/po/Makevars
create mode 100644 plugins/sample/po/POTFILES.in
create mode 100644 plugins/sample/po/en_US.po
create mode 120000 plugins/sample/po/gen-pot
create mode 100644 plugins/sample/po/pt_BR.po
create mode 100644 plugins/sample/po/zh_CN.po
delete mode 100644 plugins/sample/sample.conf
create mode 100644 plugins/sample/sample.conf.in
create mode 100644 plugins/sample/ui/pages/i18n.json.tmpl
create mode 100644 plugins/sample/ui/pages/tab.html.tmpl
delete mode 100644 ui/pages/i18n.html.tmpl
create mode 100644 ui/pages/i18n.json.tmpl
--
1.9.3
10 years, 6 months