Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#7189 - return code incorrect for removing missing packages

Attached to Project: Pacman
Opened by james meyer (jams) - Thursday, 17 May 2007, 16:39 GMT
Last edited by Dan McGee (toofishes) - Thursday, 31 May 2007, 05:25 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Aaron Griffin (phrakture)
Architecture i686
Severity Low
Priority Normal
Reported Version 3.0.4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
With pacman 2.9.8 an attempt to remove a package that is not on the system would give a return value of non 0.
Pacman 3.0.4 will give an return code of 0.




#####pacman 2.9.8
[root@fireball ~]# pacman -Q mysql-clientsa
Package "mysql-clientsa" was not found.

[root@fireball ~]# echo $?
2


######pacman 3.0.4

[root@Gluttony ~]# pacman -Q mysql-clientsa
error: package "mysql-clientsa" not found
[root@Gluttony ~]# echo $?
0



Steps to Reproduce:
This task depends upon

Closed by  Dan McGee (toofishes)
Thursday, 31 May 2007, 05:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in GIT
Comment by Aaron Griffin (phrakture) - Friday, 18 May 2007, 04:11 GMT
Did you mean to have -R in the example, or did you actually mean 'query' instead of 'remove' ?
Comment by james meyer (jams) - Friday, 18 May 2007, 13:14 GMT
Sorry I meant Query instead of remove.

Part of my script does a query to see if the package is installed before it attempts to remove it. Apparently i was thinking of the end result vs the actually problem.

Comment by Aaron Griffin (phrakture) - Friday, 18 May 2007, 15:16 GMT
Ok, here's the reason that was changed.

"pacman -Q existingA existingB nonexistent existingC"

would output the first two, then fail, and never output the third. What should be the return code in this case? return non-0 is ANY failed? Does that seem right?
Comment by james meyer (jams) - Saturday, 19 May 2007, 15:42 GMT
I see your point, but returning non 0 when all the queries fail doesn't seem correct either.
Comment by Dan McGee (toofishes) - Thursday, 31 May 2007, 05:25 GMT
pacman now returns a non-0 code whenever a query fails. For those who really care, it is the sum of the failed lookups.

Loading...