Univention Bugzilla – Bug 48512
/usr/share/univention-lib/ldap.sh ucs_registerLDAPExtension does not accept --packagename and --packageversion parameters
Last modified: 2021-05-14 16:38:14 CEST
Created attachment 9815 [details] variables need to be + PKG=univention-ldap-server + dpkg-query -f ${Version} -W univention-ldap-server + VER=14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec + ucs_registerLDAPExtension --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema + local SH_FUNCNAME + SH_FUNCNAME=ucs_registerLDAPExtension + package_options_are_passed --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema + local opttemp + getopt -q -o --longoptions packagename:,packageversion: --name ucs_registerLDAPExtension -- --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec --schema /usr/share/univention-ldap/schema/univention-translog.schema + opttemp= --packagename 'univention-ldap-server' --packageversion '14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec' -- '/usr/share/univention-ldap/schema/univention-translog.schema' + eval set -- --packagename 'univention-ldap-server' --packageversion '14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec' -- '/usr/share/univention-ldap/schema/univention-translog.schema' + set -- --packagename univention-ldap-server --packageversion 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec -- /usr/share/univention-ldap/schema/univention-translog.schema + local package_name + local package_version + [ 6 -gt 0 ] + package_name=univention-ldap-server + shift 2 + [ 4 -gt 0 ] + package_version=14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec + shift 2 + [ 2 -gt 0 ] + shift + break + [ -n univention-ldap-server ] + [ -n 14.0.2-35A~~2019-01-22-62202.577245ceba749c3342591405d1bd34c510d250ec ] + return 0 + local rc /usr/share/univention-ldap/setup-translog: 395: /usr/share/univention-ldap/setup-translog: package_name: parameter not set
Hmm, I used it jesterday and also there is this test case which uses it: ucs-test/tests/71_udm-settings/51_register_data We usually only use these two options for test purposes. When ucs_registerLDAPExtensio is called from a join or postinst script it will detect the values automatically. But the patch is good anyways.
(In reply to Arvid Requate from comment #1) > Hmm, I used it jesterday and also there is this test case which uses it: > > ucs-test/tests/71_udm-settings/51_register_data ldap.sh is not "set -u" safe. It works by shear luck as "$@" is still passed on with contains those 2 parameters. > We usually only use these two options for test purposes. They are documented as the stable API at <http://docs.software-univention.de/developer-reference-4.3.html#join:libraries:shell> > When > ucs_registerLDAPExtensio is called from a join or postinst script it will > detect the values automatically. but fails if the code is not in the join script itself, but in another shell script being called from the join script and debian/$pkg.postinst
This issue has been filed against UCS 4.3. UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.