[pacman-dev] [PATCH] updpkgsums: Allow checksums upgrade with root
Add --asroot into the makepkg call to allow package upgrade when running as root. Signed-off-by: Sébastien Luttringer <seblu@seblu.net> --- contrib/updpkgsums.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index ffea96b..7456553 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -75,7 +75,7 @@ fi # Generate the new sums and try to unlink the file before writing stdin back # into it. This final precaution shouldn't fail based on the previous checks, # but it's better to be extra careful before unlinking files. - newsums=$(makepkg -g -p "$buildfile") && rm -f "$buildfile" && + newsums=$(makepkg --asroot -g -p "$buildfile") && rm -f "$buildfile" && exec awk -v newsums="$newsums" ' /^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ { if (!w) { -- 1.8.2
On 06/04/13 10:18, Sébastien Luttringer wrote:
Add --asroot into the makepkg call to allow package upgrade when running as root.
Um... and break this for every person that is not stupidly running this as root?
Signed-off-by: Sébastien Luttringer <seblu@seblu.net> --- contrib/updpkgsums.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index ffea96b..7456553 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -75,7 +75,7 @@ fi # Generate the new sums and try to unlink the file before writing stdin back # into it. This final precaution shouldn't fail based on the previous checks, # but it's better to be extra careful before unlinking files. - newsums=$(makepkg -g -p "$buildfile") && rm -f "$buildfile" && + newsums=$(makepkg --asroot -g -p "$buildfile") && rm -f "$buildfile" && exec awk -v newsums="$newsums" ' /^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ { if (!w) {
On 06.04.2013 02:18, Sébastien Luttringer wrote:
Add --asroot into the makepkg call to allow package upgrade when running as root.
Now why would you want to do that? NACK unless you have a very good reason and make that an option rather than a default.
On Sat, Apr 6, 2013 at 11:39 AM, Florian Pritz <bluewind@xinu.at> wrote:
On 06.04.2013 02:18, Sébastien Luttringer wrote:
Add --asroot into the makepkg call to allow package upgrade when running as root.
Now why would you want to do that?
To be able to update checksum in a chroot and in a building vm. Also because the script fail in an ugly manner, asking to add --asroot with no way to do it.
NACK unless you have a very good reason and make that an option rather than a default.
Ya and Allan point that it break when you're non-root... really bad patch :/ I see 4 options: 1) Forbid to be run as root with a dedicated message. I think we should let the user do what they want. There is really few cases where a makepkg -g can broke thing ran as root. 2) Automatically add the option --asroot when user is root This allow to update checksum in all case. 3) Update makepkg --asroot to work don't bother us if we are not root. 4) Add getopt to updpkgsums, to handle a new --asroot option. If we can avoid this and keep the script simple... Two, seems to me the better one. What do you think? -- Sébastien "Seblu" Luttringer https://www.seblu.net GPG: 0x2072D77A
On 07.04.2013 04:26, Sébastien Luttringer wrote:
On Sat, Apr 6, 2013 at 11:39 AM, Florian Pritz <bluewind@xinu.at> wrote:
On 06.04.2013 02:18, Sébastien Luttringer wrote:
Add --asroot into the makepkg call to allow package upgrade when running as root.
Now why would you want to do that?
To be able to update checksum in a chroot and in a building vm.
"sudo -u nobody updpkgsums", but personally I always run it outside the chroot since I don't see any added value in running it inside.
participants (3)
-
Allan McRae
-
Florian Pritz
-
Sébastien Luttringer