1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Package: backup2l
Subject: allow filenames with special char
Author: Henning Bopp <henning.bopp@gmail.com>
Origin: upstream, https://github.com/gkiefer/backup2l/commit/eb951cac73b1e68c4904178cdec74f08c979a215
Forwarded: not needed
Last-Update: 2018-11-25
Allow handling of weird file names containing special characters.
---
diff -urN s21/backup2l s22/backup2l
--- s21/backup2l 2019-11-08 22:23:37.854619846 +0100
+++ s22/backup2l 2019-11-08 22:29:36.570051277 +0100
@@ -48,7 +48,7 @@
# sed command for extracting ownerships and names from .list files
FILTER_CHMOD="sed 's#^\( *[^ ]\+\)\{4\} *\([0-9]\{4\}\) \+/\(.*\)\$#\2 \"\3\"#'"
# sed command for extracting permissions and names from .list files
-FILTER_UNIFY_NAME="sed 's#\\\\[0-7]\{3\}#?#g; s#[^a-zA-Z0-9_ .$%:~/=+\#\-]#?#g'"
+FILTER_UNIFY_NAME="sed 's#\\\\[0-7]\{3\}#?#g; s#[^a-zA-Z0-9_ .$%:~/=+\#\-]#?#g; s#\\\\\\\\#\\\\#g'"
# replaces special and escaped characters by '?';
# only used when checking TOCs of fresh backup archives in order to avoid false alarms
@@ -1019,11 +1019,9 @@
BID=${ARCH#$VOLNAME.}
DRIVER=${ARCH_AND_DRIVER##*:}
SUFFIX=`$DRIVER -suffix`
-
grep -a "^$ARCH:" $BACKUP_DIR/$TMP.located \
- | sed -e "s#^$ARCH: /##" -e 's#\([*]\)#\\\1#g' \
+ | sed "s#^$ARCH: /##" \
> $BACKUP_DIR/$TMP.curlist
- # The second sed expression some escapes special glob(7) characters (*).
FILES=`wc -l < $BACKUP_DIR/$TMP.curlist`
echo " $ARCH.$SUFFIX:" $FILES "file(s) using '"$DRIVER"'"
$DRIVER -extract $BID $BACKUP_DIR/$ARCH.$SUFFIX $BACKUP_DIR/$TMP.curlist | sed "s/^/ /"
|