Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:

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

FS#8905 - Sp (--print-uris) can't be run as user

Attached to Project: Pacman
Opened by Roman Kyrylych (Romashka) - Wednesday, 12 December 2007, 13:07 GMT
Last edited by Xavier (shining) - Wednesday, 03 June 2009, 11:55 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 3.2.2
Due in Version 3.3.0
Due Date Undecided
Percent Complete 100%
Votes 10
Private No


Summary and Info:
with pacman 3.0 I can get -Sp output as non-root user, while 3.1 says I must be root for this.

Steps to Reproduce:
just run pacman -Sp somepackage as non-root
This task depends upon

Closed by  Xavier (shining)
Wednesday, 03 June 2009, 11:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in git by commit f4ecc908eccc3ace2e40b15be837e4fa44ecf0a0
Comment by Xavier (shining) - Wednesday, 12 December 2007, 15:51 GMT
Reference : .

I don't really understand neither the quick hack, nor the proper fix. So I hoped Dan or Aaron could do something about it.
Comment by Aaron Griffin (phrakture) - Wednesday, 12 December 2007, 16:46 GMT
Ugh. -Sp.

I think Dan and I informally agreed that this is a minor issue for now. PRINTURIs is a big freaking mess. There is _no reason_ to do that as part of a transaction. The *best* thing to do would be to use something similar to get all targets (-Sup or -Sp) and call something like alpm_pkg_get_url from the frontend.

Roman: Please let Dan and I manage what bugs go into the 3.1 release. We need to fix this one, but it is not critical for the release. Requiring root for -Sp is annoying, sure, but not a deal-breaker
Comment by Dan McGee (toofishes) - Wednesday, 12 December 2007, 16:48 GMT
Wow, I brought this up a few times ML before someone decided to file a bug. :)

I personally don't use this operation at all, so I have no impetus to fix it. Thoughts in no particular order:
* Running -Sp fires up the whole dependency machinery, which is now all-but-impossible to do without starting a transaction.
* Can we just run pacman -Qu | alpm_pkg_get_url()? That won't cover all bases though, as stated here:  bug 7884 .
* The existing PRINTURI stuff is a crock of shit.
Comment by Roman Kyrylych (Romashka) - Thursday, 13 December 2007, 10:42 GMT
> Roman: Please let Dan and I manage what bugs go into the 3.1 release. We need to fix this one, but it is not critical for the release. Requiring root for -Sp is annoying, sure, but not a deal-breaker
OK, no problems. :-)
Sure it isn't critical issue for 3.1, I just added it because it's a clear regression from 3.0.x. I didn't know (I forgot about ML threads) it was not easy to fix.

Comment by Nagy Gabor (combo) - Friday, 14 December 2007, 23:34 GMT
Oh, I've created a duplicate of this bug, sorry (I've searched for -Sp or root):  FS#8930  <- You can read my preferred fix there with reasoning (which is much more general[sry], but a possible easy fix)
Comment by Aaron Griffin (phrakture) - Friday, 14 December 2007, 23:37 GMT
Not a problem, I had trouble finding this one too, I just knew it was there
Comment by Stefan O. (hybrid) - Sunday, 27 January 2008, 14:56 GMT
I'm surprised there's not more votes on this one (only 2 votes on this report and another 2 on duplicate  FS#9154  = 4 votes for this bug) since it pretty much breaks (non-root-)frontends to pacman like yaourt.
Anyhow, I know you guys are working on it and I'm grateful for that. Just wanted to bring it up again, that even though it's not critical this (should) affect way more ppl than the 4 that have voted for the bug reports.
Comment by Dan McGee (toofishes) - Tuesday, 29 January 2008, 01:41 GMT
I won't lie- we aren't working at all on this.
Comment by Nagy Gabor (combo) - Tuesday, 29 January 2008, 07:06 GMT
But we are thinking about it ;-)
The main problem is, that currently -Sp needs a transaction, which induces a database lock per definition [which requires root permission]. My preferred possible solution to introduce a new need_lock parameter to trans_init to indicate whether the "transaction" needs a db lock or not [+  FS#9154  ;-)].

I can go further with this audacious idea:
See also -Sy. This is an other operation where currently transaction is needed, but imho this is not a transaction at all, we just must do trans_init and release to lock/unlock the database.

That's why I suggest move out db lock from back-end to front-end (my real preferred sol. ;-). Dan, thoughts? [I know, that my idea needs more attention from front-ends, but currently pacman is the only(?) front-end, and the current rule is just a restriction to ourself]
Comment by Aaron Griffin (phrakture) - Tuesday, 29 January 2008, 19:18 GMT
One bug per report please.
Comment by Stefan O. (hybrid) - Saturday, 08 March 2008, 13:04 GMT
"Due in Version: 3.1.1"
"$ pacman -V
Pacman v3.1.3 - libalpm v2.3.0"

Is there any news from the front, as to when "-Sp" will be accessible for regular users again?
*nag* :>
Comment by Nagy Gabor (combo) - Saturday, 08 March 2008, 13:33 GMT
I'm pretty sure that this won't be fixed in 3.1.x, since we are in API freeze. However, I will look at the problem today again and try to create a fix for this (to 3.2).
Comment by Nagy Gabor (combo) - Saturday, 08 March 2008, 17:42 GMT
So if Dan accepts this, the issue can be fixed soon.
Comment by Stefan O. (hybrid) - Saturday, 05 April 2008, 16:52 GMT
Great, one month ago you were hurrying to get it done, now almost a month later a new pacman version is out - and it doesn't include your fix.
Thank you very much anyways for your work, nagy :>
Comment by Aaron Griffin (phrakture) - Wednesday, 09 April 2008, 19:32 GMT
Last I read, Nagy's patch was denied because it was against the wrong get branch and was never resubmitted against the maint branch. Correct me if I'm wrong.
Comment by Nagy Gabor (combo) - Friday, 11 April 2008, 12:29 GMT
Aaron, you're right. But it wasn't resubmitted, because first I wanted to implement needs_root() function and <- and this led to the pending "argument handling" TODO.
Comment by Stefan O. (hybrid) - Tuesday, 24 June 2008, 23:06 GMT
Soooo, what's the status on this one now? :>
Comment by Allan McRae (Allan) - Wednesday, 25 June 2008, 03:35 GMT
Status is the bug is known but fixing is still a low priority... Can you give a case when you would want to use -Sp on a system that you don't have root access on? I can't think of any but I guess that would bump the priority a bit.
Comment by Stefan O. (hybrid) - Wednesday, 25 June 2008, 22:05 GMT
Well the proper use of yaourt would be one in my opinion. As of right now you can't use yaourt to install stuff from AUR as a user. You can run it as root but then the whole building process will be run as root. Sure I can build packages myself the conventional way, so it's nothing critical, but I liked the comfort in having yaourt do it for me :>
Comment by Allan McRae (Allan) - Thursday, 26 June 2008, 07:05 GMT
yaourt and building from AUR needs -Sp? Weird...
Comment by Aaron Griffin (phrakture) - Thursday, 26 June 2008, 17:47 GMT
Yeah, good point... why does that make use of -Sp?

Additionally, I'm sure yaourt could be easily changed to drop root before running makepkg (it probably should do this anyway, to be on the safe side)