no error or warning shown when "dpkg --print-foreign-architectures" fails (e.g. with invalid DPkg::options)

Bug #1075260 reported by Trevor Adams on 2012-11-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Undecided
Unassigned
aptitude (Ubuntu)
Undecided
Unassigned

Bug Description

1) Release: Precise

2) aptitude 0.6.6-1ubuntu1
     and apt 0.8.16~exp12ubuntu10.5 -- not sure what the protocol is for this or if the bug is at a common dependency.

3) Command run: aptitude -o 'Dpkg::Options::="--force-confdef"' update
Command produces identical output as aptitude update with respect to amd64 and i386 or an error message detailing that the argument passed is invalid due to the extra set of quotations.

-- A separate system runs the above command, and it fails to allow us to install 32bit libraries as needed for our systems.

4) Command only downloads the package lists for the main architecture of the system.

Reproduction:

    aptitude clean
    aptitude -o 'Dpkg::Options::="anyoptioninquotes"' update | grep i386

There should be no results whereas:

    aptitude clean
    aptitude update | grep i386

Lists the i386 repositories being hit.

Trevor Adams <email address hidden> wrote:
> 3) Command run: aptitude -o 'Dpkg::Options::="--force-confdef"' update

Nested quotes are invalid here. They are shell syntax and not
interpretted by APT.

The syntax for this option is in apt.conf(5). Multiple options should
be passed using multiple "-o" arguments, for example:
# apt-get update \
    -o "DPkg::options::=--force-confdef" \
    -o "DPkg::options::=--path-exclude=/usr/share/doc/*"

 status invalid

Changed in aptitude (Ubuntu):
status: New → Invalid
Daniel Hartwig (wigs) wrote :

> […] or an error message detailing that the argument passed is invalid
> due to the extra set of quotations.

Not really possible for APT to check the validity of another programs options. However, it can check that the exit status of this call to dpkg is 0 and issue an error or warning otherwise.

summary: - aptitude update fails to handle multiarch when given quoted
- dpkg::options
+ abort on failure of "dpkg --print-foreign-architectures" (e.g. when
+ invalid DPkg::options)
summary: - abort on failure of "dpkg --print-foreign-architectures" (e.g. when
- invalid DPkg::options)
+ no error or warning shown when "dpkg --print-foreign-architectures"
+ fails (e.g. with invalid DPkg::options)
Daniel Hartwig (wigs) wrote :

> A separate system runs the above command […]

Which is broken, and I trust that you have filed a separate bug report for that system.

Trevor Adams (tra26) wrote :

Bug filed with other package.

I was aware the quotes were creating the problem but exactly how I wasn't sure. It just seemed odd that it would continue in the presence of the error with no notification and not do what was expected.

Thanks

David Kalnischkies (donkult) wrote :

The code isn't throwing errors as it doesn't know if dpkg supports this option and therefore it is a perfectly fine case to get a non-zero exit here. At the time the code was written there was simple no way of detecting it, now there is dpkg --assert-multi-arch but that isn't supported by all dpkg's which support --print-foreign-architectures, so we just don't bother to try for now as it introduces more problems than it solves.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers