Parsing using sed 's/.*: *//' cuts off the filename before the epoch
causing invalid
filenames in the $pkg/deltas file.

Patch attached fixing the issue.

-N

commit f197a7e6e4eb941a5dcd658f4f54ba5fb4c0d6eb
Author: Nigel Kukard <[email protected]>
Date:   Thu Dec 27 22:45:07 2018 +0000

    Fix parsing xdelta output with epoch in version
    
    sed 's/.*: *//' cuts off the filename before the epoch causing invalid
    filenames in the $pkg/deltas file.
    
    Signed-off-by: Nigel Kukard <[email protected]>

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index bccf2f37..ca0106f8 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" | grep "XDELTA filename (source)" | awk '{ print $4 }')
+	newfile=$(xdelta3 printhdr "$deltafile" | grep "XDELTA filename (output)" | awk '{ print $4 }')
 
 	if grep -q "$oldfile.*$newfile" "$deltas"; then
 		sed -i.backup "/$oldfile.*$newfile/d" "$deltas" && rm -f "$deltas.backup"

Reply via email to