[pacman-dev] [PATCH] updpkgsums: Add --clean to makepkg call
Avoid makepkg to let src/ directory after updating the sums 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 7456553..cf3ce6a 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 --asroot -g -p "$buildfile") && rm -f "$buildfile" && + newsums=$(makepkg --asroot --clean -g -p "$buildfile") && rm -f "$buildfile" && exec awk -v newsums="$newsums" ' /^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ { if (!w) { -- 1.8.2
On Sat, Apr 06, 2013 at 02:27:30AM +0200, Sébastien Luttringer wrote:
Avoid makepkg to let src/ directory after updating the sums
This has potential to incur unintended/unwanted side effects... I don't think this should be the default. You could potentially look at $BUILDDIR/src beforehand and only pass -c if the dir doesn't exist beforehand, but I'm not sure we want to play that game.
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 7456553..cf3ce6a 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 --asroot -g -p "$buildfile") && rm -f "$buildfile" && + newsums=$(makepkg --asroot --clean -g -p "$buildfile") && rm -f "$buildfile" && exec awk -v newsums="$newsums" ' /^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ { if (!w) { -- 1.8.2
On Sat, Apr 6, 2013 at 2:32 AM, Dave Reisner <d@falconindy.com> wrote:
On Sat, Apr 06, 2013 at 02:27:30AM +0200, Sébastien Luttringer wrote:
Avoid makepkg to let src/ directory after updating the sums
This has potential to incur unintended/unwanted side effects... I don't think this should be the default. You could potentially look at $BUILDDIR/src beforehand and only pass -c if the dir doesn't exist beforehand, but I'm not sure we want to play that game.
I don't see what kind of unintented/unwanted side effects this can occur. Unless you speak about --asroot. Is the following code could avoid us of those effects ? export BUILDDIR=$(mktemp --directory -t updpkgsums.XXXXX) makepkg --clean Cheers, -- Sébastien "Seblu" Luttringer https://www.seblu.net GPG: 0x2072D77A
On Fri, Apr 5, 2013 at 8:42 PM, Sébastien Luttringer <seblu@seblu.net>wrote:
On Sat, Apr 6, 2013 at 2:32 AM, Dave Reisner <d@falconindy.com> wrote:
On Sat, Apr 06, 2013 at 02:27:30AM +0200, Sébastien Luttringer wrote:
Avoid makepkg to let src/ directory after updating the sums
This has potential to incur unintended/unwanted side effects... I don't think this should be the default. You could potentially look at $BUILDDIR/src beforehand and only pass -c if the dir doesn't exist beforehand, but I'm not sure we want to play that game.
I don't see what kind of unintented/unwanted side effects this can occur. Unless you speak about --asroot. Is the following code could avoid us of those effects ?
export BUILDDIR=$(mktemp --directory -t updpkgsums.XXXXX) makepkg --clean
Sorry for not being clear. My gripe is with the --clean flag. I'm strongly disagree with the idea that we should assume the user doesn't want their possibly large and already compiled build directory wiped out.
On Fri, Apr 05, 2013 at 09:09:07PM -0400, Dave Reisner wrote:
On Fri, Apr 5, 2013 at 8:42 PM, Sébastien Luttringer <seblu@seblu.net>wrote:
On Sat, Apr 6, 2013 at 2:32 AM, Dave Reisner <d@falconindy.com> wrote:
On Sat, Apr 06, 2013 at 02:27:30AM +0200, Sébastien Luttringer wrote:
Avoid makepkg to let src/ directory after updating the sums
This has potential to incur unintended/unwanted side effects... I don't think this should be the default. You could potentially look at $BUILDDIR/src beforehand and only pass -c if the dir doesn't exist beforehand, but I'm not sure we want to play that game.
I don't see what kind of unintented/unwanted side effects this can occur. Unless you speak about --asroot. Is the following code could avoid us of those effects ?
export BUILDDIR=$(mktemp --directory -t updpkgsums.XXXXX) makepkg --clean
Sorry for not being clear. My gripe is with the --clean flag. I'm strongly disagree with the idea that we should assume the user doesn't want their possibly large and already compiled build directory wiped out.
Had this come up earlier, I may have said, "Hmm. Well, the vcs sources extract on a download, so this could help", but they don't do that anymore, so there's really no need for this at all, and as Dave said, it could be unnecessarily destructive. Thanks -- William Giokas | KaiSforza GnuPG Key: 0x73CD09CF Fingerprint: F73F 50EF BBE2 9846 8306 E6B8 6902 06D8 73CD 09CF
On 06/04/13 10:42, Sébastien Luttringer wrote:
On Sat, Apr 6, 2013 at 2:32 AM, Dave Reisner <d@falconindy.com> wrote:
On Sat, Apr 06, 2013 at 02:27:30AM +0200, Sébastien Luttringer wrote:
Avoid makepkg to let src/ directory after updating the sums
This has potential to incur unintended/unwanted side effects... I don't think this should be the default. You could potentially look at $BUILDDIR/src beforehand and only pass -c if the dir doesn't exist beforehand, but I'm not sure we want to play that game.
I don't see what kind of unintented/unwanted side effects this can occur. Unless you speak about --asroot. Is the following code could avoid us of those effects ?
export BUILDDIR=$(mktemp --directory -t updpkgsums.XXXXX) makepkg --clean
Using a completely separate build directory for this is probably the best approach. But then "makepkg --clean" is not enough. Rather a "rm -r BUILDDIR" would be needed. Allan
participants (4)
-
Allan McRae
-
Dave Reisner
-
Sébastien Luttringer
-
William Giokas