Univention Bugzilla – Bug 32678
Update languages.json location and remove file from univention-management-console-frontend
Last modified: 2013-11-19 06:43:09 CET
Bug 32677 moved languages.json to /var/www/ucs-overview. The new location has to be adapted in UMC. In addition, the file template has to be removed from univention-management-console-frontend +++ This bug was initially created as a clone of Bug #32677 +++
language specific information should be removed from /var/www/ucs-overview/entries.json and languages.json be used instead.
The UCRV umc/server/languages/.* has been renamed to ucs/server/languages/.* to point out that it is not umc specific. When removing the file from univention-management-console-frontend take note that the original variable description somehow ended up in the package univention-management-console/debian/univention-management-console-server.univention-config-registry-variables
- removed UCRV from univention-management-console - defaults for umc/server/languages/.* will not be set in umc frontend postinst anymore - when updating from a version below 6.0.7-3, umc/server/languages/.* values will be adopted for ucs/server/languages/.* in univention-apache postinst (defaults will still be on new installations) - removed locales field from entries.json template - UCS overview has been adopted to use languages.json Added changelog entry for ucs-3.2 svn r44905: =========== univention-apache (6.0.7-3) univention-management-console (6.0.15-4) univention-management-console-frontend (3.0.90-2)
With the current changes we maintain two languages.json files. The file residing in usr/share/univention-management-console-frontend/languages.json should be removed, as mentioned in Comment 0.
Template removed.
univention-apache.postinst: 127 if dpkg --compare-versions "$2" le-nl 6.0.7-2 128 echo "we are in" 129 then → remove that wrong echo → code is not executed when updating 141 else … → remove the "else" code. This should be executed in every case. The variables are only set if they doesn't exists.
No ucs/server/languages exist on a freshly installed UCS system.
(In reply to Alexander Kläser from comment #7) > No ucs/server/languages exist on a freshly installed UCS system. As a result only English can be selected in the UMC.
(In reply to Moritz Muehlenhoff from comment #8) > (In reply to Alexander Kläser from comment #7) > > No ucs/server/languages exist on a freshly installed UCS system. > > As a result only English can be selected in the UMC. as i already said, this is caused by the wrong postinst "127 if dpkg --compare-versions "$2" le-nl 6.0.7-2" da müsste greather than (gt) oder so sein...
The new ucs/server/languages/.* variables will now be set when updating AND when making a fresh installation. The dpkg-version comparison is correct: we want the old variables to be removed once when updating from a version less than or equal to (but not null) 6.0.7-2.
before: umc/server/languages/de_DE: Deutsch umc/server/languages/en_US: English after: ucs/server/languages/de: Deutsch ucs/server/languages/en: English umc/server/languages/de_DE: Deutsch umc/server/languages/en_US: English IFS=_ is a problem when the key contains "_" → s/unset/ucr unset/
(In reply to Florian Best from comment #11) > before: > umc/server/languages/de_DE: Deutsch > umc/server/languages/en_US: English > > after: > ucs/server/languages/de: Deutsch > ucs/server/languages/en: English > umc/server/languages/de_DE: Deutsch > umc/server/languages/en_US: English > > IFS=_ is a problem when the key contains "_" > → s/unset/ucr unset/ Fixed that, UCRVs will now be unset correctly.
You are calling ucr set and ucr unset for every variable again. This triggers always some ucr commits. Could you set them all at once? Or is this OK (@Alex/any other)? + langs=($(ucr search umc/server/languages/ | cut -d: -f 1)) + for lang in ${langs[@]}; do + newLang="ucs/${lang#umc/}" + ucr set $newLang="$(ucr get "$lang")" + ucr unset "$lang" + done
(In reply to Florian Best from comment #13) > You are calling ucr set and ucr unset for every variable again. This > triggers always some ucr commits. Could you set them all at once? Or is this > OK (@Alex/any other)? > > + langs=($(ucr search umc/server/languages/ | cut -d: -f 1)) > + for lang in ${langs[@]}; do > + newLang="ucs/${lang#umc/}" > + ucr set $newLang="$(ucr get "$lang")" > + ucr unset "$lang" > + done Ok, I've change this so that all UCRVs will be (un)set at once.
ucr set umc/server/languages/de_AT="Deutsch 'Österreich" → xargs: unmatched doppelte quote; by default quotes are special to xargs unless you use the -0 option → I don't think this will occur, if a customer has this his values will not be adopted. Also if the string "umc/server/languages/" occurs anywhere this would fail. → -ucr --keys-only search umc/server/languages/ +ucr --keys-only search ^umc/server/languages/ (Do it for both)
(In reply to Florian Best from comment #15) > ucr set umc/server/languages/de_AT="Deutsch 'Österreich" > → > xargs: unmatched doppelte quote; by default quotes are special to xargs > unless you use the -0 option > → I don't think this will occur, if a customer has this his values will not > be adopted. > > Also if the string "umc/server/languages/" occurs anywhere this would fail. > → > -ucr --keys-only search umc/server/languages/ > +ucr --keys-only search ^umc/server/languages/ > (Do it for both) OK, xarg will be called with "-0" when migrating the old UCRVs. key search will be more exact (using "^" as suggested), though "umc/server/languages/" most likely would never appear in a UCRV value.
(In reply to Florian Best from comment #13) > You are calling ucr set and ucr unset for every variable again. This > triggers always some ucr commits. Could you set them all at once? Or is this > OK (@Alex/any other)? OK for me, this should not be a real performance problem. But maybe I am wrong.
The UMC-Frontend is now only available in English. This is because the old language.json still exists and is in use but contains no languages.
univention-management-console-frontend (3.0.129-1) unstable; urgency=low * use new languages.json file for UMC i18n * remove old languages.json file when updating from a version below 3.0.129-1 (Bug #32678) svn 45575
The old template still exists… /etc/univention/templates/files/usr/share/univention-management-console-frontend/languages.json If this would be correctly unregistered this is probably not neccessary (not sure): +if dpkg --compare-versions "$2" le-nl 3.0.129-1 +then + rm -f /usr/share/univention-management-console-frontend/languages.json +fi
Old template will be removed correctly now, as well as the legacy UCR info file. svn 45635: univention-management-console-frontend (3.0.133-1)
before: umc/server/languages/de_AT: Deutsch 'Österreich' umc/server/languages/de_AU: Deutsch (Österreich) umc/server/languages/de_CH: Deutsch (Schweiz) umc/server/languages/de_DE: Deutsch umc/server/languages/en_GB: English (United Kingdom) umc/server/languages/en_US: English after: ucs/server/languages/de_AT: 'Deutsch 'Österreich''ucs/server/languages/de_AU='Deutsch (Österreich)'ucs/server/languages/de_CH='Deutsch (Schweiz)'ucs/server/languages/de_DE='Deutsch'ucs/server/languages/en_GB='English (United Kingdom)'ucs/server/languages/en_US='English' [+defaults] The unused "conffiles/usr/share/univention-management-console-frontend" still exists in SVN.
Created attachment 5535 [details] use real json Please also apply this patch (so that the output is real JSON, not broken strings).
svn 45671: univention-apache (6.0.13-2) unstable; urgency=low * do not call xargs with "-0" in postinst (leads to some UCRVs with invalid values) * use json module in languages.json template instead of joining a list to a string (Bug #32678) Update/new installation work for me with that.
(In reply to Florian Best from comment #15) > ucr set umc/server/languages/de_AT="Deutsch 'Österreich" > → > xargs: unmatched doppelte quote; by default quotes are special to xargs > unless you use the -0 option NO: xargs' handling of quotes is broken when "s are mixed with 's. The "-0" changes xargs to split on '\0' characters instead of blanks. Since regular ucr doesn't output any such characters, the full output of the previous ucr search command is passed as _one_ argument to "ucr set". Use "ucr search ... | xargs -r -d '\n' ucr set" instead: 1. Since UCR can't store any newlines, it's safe to use it as a separator of multiple values. 2. The "-r" makes xargs skip the invocation of ucr if no argument is given. Otherwise you get the following error message: # ucr set E: too few arguments for command [set] try `univention-config-registry --help` for more information
(In reply to Philipp Hahn from comment #25) > (In reply to Florian Best from comment #15) > > ucr set umc/server/languages/de_AT="Deutsch 'Österreich" > > → > > xargs: unmatched doppelte quote; by default quotes are special to xargs > > unless you use the -0 option > > NO: xargs' handling of quotes is broken when "s are mixed with 's. The "-0" > changes xargs to split on '\0' characters instead of blanks. Since regular > ucr doesn't output any such characters, the full output of the previous ucr > search command is passed as _one_ argument to "ucr set". > > Use "ucr search ... | xargs -r -d '\n' ucr set" instead: > 1. Since UCR can't store any newlines, it's safe to use it as a separator of > multiple values. > 2. The "-r" makes xargs skip the invocation of ucr if no argument is given. > Otherwise you get the following error message: > > # ucr set > E: too few arguments for command [set] > try `univention-config-registry --help` for more information OK, I've adapted this.
OK
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".