[dpkg] 80/200: dpkg-maintscript-helper: Validate versions in all commands

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:17:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository dpkg.

commit f1d072c9bd4db4e31fcf573fb8414011da2c2aa5
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Dec 18 12:23:16 2016 +0100

    dpkg-maintscript-helper: Validate versions in all commands
    
    The symlink_to_dir and dir_to_symlink commands were not validating the
    versions, be consistent.
---
 debian/changelog                   | 2 ++
 scripts/dpkg-maintscript-helper.sh | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f623e13..2168b33 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ dpkg (1.18.17) UNRELEASED; urgency=medium
   [ Guillem Jover ]
   * Handle empty versions on validation in dpkg-maintscript-helper as they
     are optional. Regression introduced in dpkg 1.18.16. Closes: #848422
+  * Validate versions too in dpkg-maintscript-helper symlink_to_dir and
+    dir_to_symlink commands.
   * Documentation:
     - Clarify that dpkg-buildpackage does not run «dpkg-source --before-build»
       when using the -T option. Closes: #649531
diff --git a/scripts/dpkg-maintscript-helper.sh b/scripts/dpkg-maintscript-helper.sh
index 81d32e0..2366dcb 100755
--- a/scripts/dpkg-maintscript-helper.sh
+++ b/scripts/dpkg-maintscript-helper.sh
@@ -270,6 +270,7 @@ symlink_to_dir() {
 		error "symlink pathname ends with a slash"
 	[ -n "$SYMLINK_TARGET" ] || error "original symlink target is missing"
 	[ -n "$1" ] || error "maintainer script parameters are missing"
+	validate_optional_version "$LASTVERSION"
 
 	debug "Executing $0 symlink_to_dir in $DPKG_MAINTSCRIPT_NAME" \
 	      "of $DPKG_MAINTSCRIPT_PACKAGE"
@@ -345,6 +346,7 @@ dir_to_symlink() {
 		error "directory parameter is not an absolute path"
 	[ -n "$SYMLINK_TARGET" ] || error "new symlink target is missing"
 	[ -n "$1" ] || error "maintainer script parameters are missing"
+	validate_optional_version "$LASTVERSION"
 
 	debug "Executing $0 dir_to_symlink in $DPKG_MAINTSCRIPT_NAME" \
 	      "of $DPKG_MAINTSCRIPT_PACKAGE"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list