summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-12-28 00:15:48 +0100
committerAllan McRae <allan@archlinux.org>2019-01-04 02:15:16 +0100
commit984492b92f1b35534adddc24c2439fcdcb9885af (patch)
treee3bbfa066e12768c6a78acb0903b3804a6085612 /scripts
parent4778f1318853ac9fc1f838d836dbe017fb6cbddc (diff)
downloadpacman-984492b92f1b35534adddc24c2439fcdcb9885af.tar.gz
pacman-984492b92f1b35534adddc24c2439fcdcb9885af.tar.xz
repo-add: don't break if delta package sources contain epoch
Our sed parser for xdelta3 headers will greedily match on ":" which coincidentally is also the character we use to define a version with an epoch. While we are at it, simply use sed for the whole pipeline, rather than using both grep and sed. Fixes FS#61195 Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/repo-add.sh.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 1c7fb2f6..21a5ea8e 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -159,8 +159,8 @@ db_write_delta() {
md5sum=${md5sum%% *}
csize=$(wc -c "$deltafile" | cut -d' ' -f1)
- oldfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (source)" | sed 's/.*: *//')
- newfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (output)" | sed 's/.*: *//')
+ oldfile=$(xdelta3 printhdr "$deltafile" | sed -n 's/XDELTA filename (source):\s\+\(\.*\)/\1/p')
+ newfile=$(xdelta3 printhdr "$deltafile" | sed -n 's/XDELTA filename (output):\s\+\(\.*\)/\1/p')
if grep -q "$oldfile.*$newfile" "$deltas"; then
sed -i.backup "/$oldfile.*$newfile/d" "$deltas" && rm -f "$deltas.backup"