Control: retitle -1 dpkg-maintscript-helper: Version comparison fails for supposedly valid versions Control: severity -1 serious
Hi! On Fri, 2016-11-18 at 14:02:39 +0530, shirish शिरीष wrote: > Package: dpkg > Version: 1.18.14 > Severity: normal > It seems the bug is in dpkg 1.18.11 and above. I was suffering from > some sort of broken packages. I shared my issue at > http://unix.stackexchange.com/questions/323817/debian-strech-update-broken-seems-buggy-dpkg > . It took quite some time but it seems that dpkg at least 1.18.14 is > somewhat broken/buggy in its implementation. In dpkg 1.18.10 I am able > to fix the broken packages. These happened a few more times. I did run > a few checks > http://unix.stackexchange.com/questions/324151/how-to-find-out-half-configured-broken-packages-in-debian > but found nothing untoward. Please include your reports inline, instead of referencing outside resources, because this means those details might disappear (in the future) in case those sites are shutdown, or it requires maintainers to be online to check them. Ok, so this is about the dpkg-maintscript-helper failing on the version validation check for supposedly valid versions. This was recently reported on IRC too, but we were unable to reproduce it. If you can still reproduce it, I'd appreciate if you could apply the attached patch to your installed dpkg-maintscript-helper script (from a dpkg version > 1.18.11) and rerun the failing package. Oh, I think I know what's wrong now, the attached patch should in principle fix that. Thanks, Guillem
diff --git i/scripts/dpkg-maintscript-helper.sh w/scripts/dpkg-maintscript-helper.sh index f20d82647..8db4a4088 100755 --- i/scripts/dpkg-maintscript-helper.sh +++ w/scripts/dpkg-maintscript-helper.sh @@ -49,8 +49,9 @@ rm_conffile() { [ "${CONFFILE}" != "${CONFFILE#/}" ] || \ error "conffile '$CONFFILE' is not an absolute path" # Use --compare-versions to validate the version number. - [ -z "$(dpkg --compare-versions -- "$LASTVERSION" eq '0' 2>&1)" ] || \ - error "version '$LASTVERSION' is not valid" + VERSIONCHECK="$(dpkg --compare-versions -- "$LASTVERSION" eq '0' 2>&1 || true)" + [ -z "$VERSIONCHECK" ] || \ + error "version '$LASTVERSION' is not valid: $VERSIONCHECK" debug "Executing $0 rm_conffile in $DPKG_MAINTSCRIPT_NAME" \ "of $DPKG_MAINTSCRIPT_PACKAGE" @@ -163,8 +164,9 @@ mv_conffile() { [ "${NEWCONFFILE}" != "${NEWCONFFILE#/}" ] || \ error "new-conffile '$NEWCONFFILE' is not an absolute path" # Use --compare-versions to validate the version number. - [ -z "$(dpkg --compare-versions -- "$LASTVERSION" eq '0' 2>&1)" ] || \ - error "version '$LASTVERSION' is not valid" + VERSIONCHECK="$(dpkg --compare-versions -- "$LASTVERSION" eq '0' 2>&1 || true)" + [ -z "$VERSIONCHECK" ] || \ + error "version '$LASTVERSION' is not valid: $VERSIONCHECK" debug "Executing $0 mv_conffile in $DPKG_MAINTSCRIPT_NAME" \ "of $DPKG_MAINTSCRIPT_PACKAGE"