Skip to content

Commit 55eee3e

Browse files
committed
Workaround if apt-config shell returns an empty string
1 parent f193f8a commit 55eee3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/update_had_no_effect.sh.epp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Integer $tries = 1,
55
| -%>
66

7-
DIR='var/cache/apt'
87
EVAL="$(mktemp)" || EVAL=/tmp/aptdir
98
apt-config shell DIR Dir::Cache > "$EVAL" && . "$EVAL"
9+
[ "$DIR" ] || DIR='var/cache/apt'
1010
cd "/$DIR" || exit 0
1111
export TMPDIR="/$DIR"
12-
CUR=pkgcache.bin
1312
apt-config shell CUR DIR::Cache::pkgcache >"$EVAL" && . "$EVAL"
13+
[ "$CUR" ] || CUR=pkgcache.bin
1414
OLD="$(mktemp)" || OLD="/${DIR}/${CUR}.old"
1515
rm -f "$EVAL"
1616
ln -f "$CUR" "$OLD"

0 commit comments

Comments
 (0)