소스 검색

dpkg-name: Print correct error message on unknown options before --

Do not interpret unknown options as filenames, to then try to move them
and fail when not found. If the user wants to use a filename starting
with a dash, these should be passed after --.
Guillem Jover 14 년 전
부모
커밋
37934782af
2개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      debian/changelog
  2. 2 0
      scripts/dpkg-name.pl

+ 1 - 0
debian/changelog

@@ -102,6 +102,7 @@ dpkg (1.17.0) UNRELEASED; urgency=low
     $SIG{__WARN__} to call usageerr() on option parse errors.
   * Move the exit call out from usage() in dpkg-scansources so that usageerr()
     gives a correct exit code. Thanks to Bernhard R. Link <brlink@debian.org>.
+  * Print correct error message on unknown dpkg-name options before --.
 
   [ Updated programs translations ]
   * Fix typo in Spanish translation of update-alternatives.

+ 2 - 0
scripts/dpkg-name.pl

@@ -243,6 +243,8 @@ while (@ARGV) {
             move($_);
         }
         exit 0;
+    } elsif (m/^-/) {
+        usageerr(_g("unknown option \`%s'"), $_);
     } else {
         move($_);
     }