#660889 apt: apt-cache -- Does not return correct status code

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Jari Aalto
Date:
2021-09-22 04:46:49 UTC
Severity:
normal
#660889#5
Date:
2012-02-22 17:22:30 UTC
From:
To:
Problem:

	$ apt-cache policy nothing-to-find ; echo $?
	N: Unable to locate package nothing-to-find
	0

Program should return non-zero status. The current behavior disalows
using call in shell programs:

	if ! apt-cache policy $package ; then
      	   echo "Invalid package name: $package" >&2
	   return 1
	fi

#660889#10
Date:
2021-09-22 04:26:15 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com