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

Apt-cache show returns exit code 0 when version not found for a package



Hello!

 

Using apt `2.3.9ubuntu0.1` (impish) and earlier, I’m getting the exit code 100 for both, non-existent package, and non-existent version:

```

$ apt-cache show badpackage=badversion; echo $?

N: Unable to locate package badpackage

E: No packages found

100

$ apt-cache show bash=badversion; echo $?

E: Version 'badversion' for 'bash' was not found

E: No packages found

100

```

But using apt version `2.4.13` (jammy), I’m getting exit code 0 for a non-existent version:

```

$ apt-cache show badpackage=badversion; echo $?

N: Unable to locate package badpackage

E: No packages found

100

$ apt-cache show bash=badversion; echo $?

N: Version 'badversion' for 'bash' was not found

N: No packages found

0

```

Is this an intended change in behaviour? Why would we consider package not found an error, but version not found a success?

 

Best regards,

Ewa

IMPORTANT NOTICE: The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, addressees should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments.

Reply to: