Browse Source

dpkg-maintscript-helper: Validate versions in all commands

The symlink_to_dir and dir_to_symlink commands were not validating the
versions, be consistent.
Guillem Jover 7 years ago
parent
commit
f1d072c9bd
2 changed files with 4 additions and 0 deletions
  1. 2 0
      debian/changelog
  2. 2 0
      scripts/dpkg-maintscript-helper.sh

+ 2 - 0
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

+ 2 - 0
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"