Skip to content

Commit a57dbe5

Browse files
committed
Use source instead of eval
1 parent 6abf489 commit a57dbe5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

templates/update_had_no_effect.sh.epp

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
Integer $timeout = 30,
44
Integer $tries = 1,
55
| -%>
6-
eval "$(apt-config shell DIR Dir::Cache || echo "DIR='var/cache/apt'")"
6+
7+
DIR='var/cache/apt'
8+
EVAL="$(mktemp)"
9+
apt-config shell DIR Dir::Cache > "$EVAL" && . "$EVAL"
710
cd "/$DIR" || exit 0
811
OLD="$(mktemp -p "/$DIR")"
9-
eval "$(apt-config shell CUR Dir::Cache::pkgcache || echo "CUR='pkgcache.bin'")"
12+
CUR=pkgcache.bin
13+
apt-config shell CUR DIR::Cache::pkgcache >"$EVAL" && . "$EVAL"
14+
rm -f "$EVAL"
1015
ln -f "$CUR" "$OLD"
1116
TRIES=<%= $tries %>
1217
while true; do

0 commit comments

Comments
 (0)