[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#169125: dpkg ignore-depends error

Package:  dpkg
Version:  1.9.21
Severity: Normal

According to my reading of the help for dpkg, I should be able to inform
dpkg to ignore dependencies for more than one package by separating them
with a comma.  From `dpkg --help`:  "--ignore-depends=<package>,..."  
Attempting to run a dpkg -r operation with more than one package to ignore
yields the following result:

debian:~# dpkg --ignore-depends=snort,tcpdump -r libpcap0 
dpkg: --ignore-depends requires a legal package name. `snort,tcpdump' is
not; character `,' not allowed - only letters, digits and -+._ allowed:

Looking through the source, in lib/parsehelp.c it appears that the only
valid characters are in the constant alsoallowed which allows -+._ (also
evidenced by the error message).

Adding a comma to that constant doesn't correct the problem though.  
Looking into the ignoredepends function in main/main.c, the call to
findpackage sends the entire contents of 'value'.  However, if there is
more than one package called, the contents of value contain the entire
string.  In the example above, the contents of value is 'snort,tcpdump'.  
By changing the variable passed to findpackage to p instead of value, I
can make dpkg ignore the two dependencies and remove the package.

With all that said, I'm not sure of the following:
- If calling more than one dependency is truly supposed to be supported.
- If my syntax is correct for the command line that yielded the error.
- What side effects could be caused by adding a comma to the constant
- If the fix in main.c is correct or if it just happens to work for this

I did some searching in the bug reports and deja and didn't see anything
indicating that this is a known bug which leads me to believe that my
syntax is incorrect or it's truly a bug.

Here are some diffs:

diff lib/parsehelp.c lib/parsehelp.c.new
<   static const char alsoallowed[]= "-+._"; /* _ is deprecated */
>   static const char alsoallowed[]= "-+._,"; /* _ is deprecated */

diff main/main.c main/main.c.new
<     ni->pkg= findpackage(value);
>     ni->pkg= findpackage(p);


Reply to: