Re: [pacman-contrib] [PATCH] paccache: Skip .sig files when globbing candidates for removal
On 02/22/2018 10:05 PM, Johannes Löthberg via pacman-contrib wrote:
Thanks for the patch, but could we use "$PWD"/*.pkg.tar!(*.sig) instead of using grep for this? It makes the glob a bit more obvious to me as well.
Yes, this is way better, and I confirm that results are the same - will send out the modified patch shortly. On 02/22/2018 11:07 PM, Eli Schwartz via pacman-contrib wrote:
Sorry, this was only partially true. The patch was broken anyways because of linebreaks and other fun chars, but my issue with it being an "attachment" is because this list seems to have been configured to relay messages as message/rfc822. As Johannes pointed out, this is the technically correct way to preserve DKIM signatures when the mailing list modifies the From and Subject lines to add the list name into the subject... if only every client out there (or even most of them) actually supported it...
Yeah, the first patch was completely broken, it was the first time I sent git patches via email and I didn't know about all the problems that email clients cause to the patches :) Was the second patch good though?
Basically allow any extension after '.tar' except '.sig'. This is needed to correctly count the possible candidates for removal. Signature files are correctly considered later in the script. Fixes FS#57503 Signed-off-by: Maxim Baz <git@maximbaz.com> --- src/paccache.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/paccache.sh.in b/src/paccache.sh.in index 49680be..135954f 100644 --- a/src/paccache.sh.in +++ b/src/paccache.sh.in @@ -308,7 +308,7 @@ for cachedir in "${cachedirs[@]}"; do # note that these results are returned in an arbitrary order from awk, but # they'll be resorted (in summarize) iff we have a verbosity level set. IFS=$'\n' read -r -d '' -a cand < \ - <(printf '%s\n' "$PWD"/*.pkg.tar?(.+([^.])) | pacsort --files | + <(printf '%s\n' "$PWD"/*.pkg.tar!(*.sig) | pacsort --files | pkgfilter "$keep" "$scanarch" \ "${#whitelist[*]}" "${whitelist[@]}" \ "${#blacklist[*]}" "${blacklist[@]}") -- 2.16.2
Quoting Maxim Baz (2018-02-23 00:21:11)
Basically allow any extension after '.tar' except '.sig'. This is needed to correctly count the possible candidates for removal. Signature files are correctly considered later in the script. Fixes FS#57503
Signed-off-by: Maxim Baz <git@maximbaz.com> --- src/paccache.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/paccache.sh.in b/src/paccache.sh.in index 49680be..135954f 100644 --- a/src/paccache.sh.in +++ b/src/paccache.sh.in @@ -308,7 +308,7 @@ for cachedir in "${cachedirs[@]}"; do # note that these results are returned in an arbitrary order from awk, but # they'll be resorted (in summarize) iff we have a verbosity level set. IFS=$'\n' read -r -d '' -a cand < \ - <(printf '%s\n' "$PWD"/*.pkg.tar?(.+([^.])) | pacsort --files | + <(printf '%s\n' "$PWD"/*.pkg.tar!(*.sig) | pacsort --files | pkgfilter "$keep" "$scanarch" \ "${#whitelist[*]}" "${whitelist[@]}" \ "${#blacklist[*]}" "${blacklist[@]}") -- 2.16.2
Awesome, thanks for the patch! -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 PGP Key FP: 5134 EF9E AF65 F95B 6BB1 608E 50FB 9B27 3A9D 0BB5 https://theos.kyriasis.com/~kyrias/
On 02/22/2018 05:52 PM, Maxim Baz wrote:
On 02/22/2018 10:05 PM, Johannes Löthberg via pacman-contrib wrote:
Thanks for the patch, but could we use "$PWD"/*.pkg.tar!(*.sig) instead of using grep for this? It makes the glob a bit more obvious to me as well.
Yes, this is way better, and I confirm that results are the same - will send out the modified patch shortly.
On 02/22/2018 11:07 PM, Eli Schwartz via pacman-contrib wrote:
Sorry, this was only partially true. The patch was broken anyways because of linebreaks and other fun chars, but my issue with it being an "attachment" is because this list seems to have been configured to relay messages as message/rfc822. As Johannes pointed out, this is the technically correct way to preserve DKIM signatures when the mailing list modifies the From and Subject lines to add the list name into the subject... if only every client out there (or even most of them) actually supported it...
Yeah, the first patch was completely broken, it was the first time I sent git patches via email and I didn't know about all the problems that email clients cause to the patches :) Was the second patch good though?
The second patch was fine, yes. -- Eli Schwartz Bug Wrangler and Trusted User
participants (3)
-
Eli Schwartz
-
Johannes Löthberg
-
Maxim Baz