Explorar o código

dpkg: Use badusage() on illegal package names in --ignore-depends

Guillem Jover %!s(int64=12) %!d(string=hai) anos
pai
achega
25d6273c1a
Modificáronse 2 ficheiros con 5 adicións e 3 borrados
  1. 2 0
      debian/changelog
  2. 3 3
      src/main.c

+ 2 - 0
debian/changelog

@@ -58,6 +58,8 @@ dpkg (1.17.10) UNRELEASED; urgency=low
   * Do not assume that sensible-editor is present on «dpkg-source --commit»,
   * Do not assume that sensible-editor is present on «dpkg-source --commit»,
     as that command is very Debian specific. Fallback to try VISUAL, EDITOR,
     as that command is very Debian specific. Fallback to try VISUAL, EDITOR,
     or vi, if the previous commands are either unset or not found.
     or vi, if the previous commands are either unset or not found.
+  * Use badusage() instead of ohshit() on dpkg --ignore-depends argument
+    parsing errors.
 
 
   [ Updated programs translations ]
   [ Updated programs translations ]
   * Catalan (Guillem Jover).
   * Catalan (Guillem Jover).

+ 3 - 3
src/main.c

@@ -3,7 +3,7 @@
  * main.c - main program
  * main.c - main program
  *
  *
  * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
  * Copyright © 1994,1995 Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2006-2014 Guillem Jover <guillem@debian.org>
  * Copyright © 2010 Canonical Ltd.
  * Copyright © 2010 Canonical Ltd.
  *   written by Martin Pitt <martin.pitt@canonical.com>
  *   written by Martin Pitt <martin.pitt@canonical.com>
  *
  *
@@ -375,8 +375,8 @@ set_ignore_depends(const struct cmdinfo *cip, const char *value)
 
 
     pkg = pkg_spec_parse_pkg(p, &err);
     pkg = pkg_spec_parse_pkg(p, &err);
     if (pkg == NULL)
     if (pkg == NULL)
-      ohshit(_("--%s needs a valid package name but '%.250s' is not: %s"),
-              cip->olong, p, err.str);
+      badusage(_("--%s needs a valid package name but '%.250s' is not: %s"),
+               cip->olong, p, err.str);
 
 
     pkg_list_prepend(&ignoredependss, pkg);
     pkg_list_prepend(&ignoredependss, pkg);