Skip to content

Commit 2eb072a

Browse files
committed
switchto*: fix shellcheck
1 parent 15a2161 commit 2eb072a

File tree

2 files changed

+42
-26
lines changed

2 files changed

+42
-26
lines changed

switchtoTesting

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
echo "----"
2-
echo "Patching sources.list to enable testing repository..."
3-
echo "----"
4-
for FILE in `ls /etc/apt/sources.list /etc/apt/sources.list.d/*`
5-
do
1+
#!/usr/bin/env bash
2+
3+
cat << EOF
4+
----
5+
Patching sources.list to enable testing repository...
6+
----
7+
EOF
8+
9+
readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
10+
for FILE in "${apt_files[@]}"; do
611
# (Append 'testing' at the end of lines starting with the yunohost repo..)
7-
sed -i 's@^deb.* http://forge.yunohost.org.*@& testing@' $FILE
12+
sed -i 's@^deb.* http://forge.yunohost.org.*@& testing@' "$FILE"
813
done
914

10-
echo "----"
11-
echo "Running 'apt-get update'"
12-
echo "----"
15+
cat << EOF
16+
----
17+
Running 'apt-get update'
18+
----
19+
EOF
1320
apt-get update
1421

15-
echo "----"
16-
echo "Running 'apt-get dist-upgrade'"
17-
echo "----"
22+
cat << EOF
23+
----
24+
Running 'apt-get dist-upgrade'
25+
----
26+
EOF
1827
apt-get dist-upgrade -y
19-

switchtoUnstable

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
echo "----"
2-
echo "Patching sources.list to enable testing repository..."
3-
echo "----"
4-
for FILE in `ls /etc/apt/sources.list /etc/apt/sources.list.d/*`
5-
do
1+
#!/usr/bin/env bash
2+
3+
cat << EOF
4+
----
5+
Patching sources.list to enable unstable repository...
6+
----
7+
EOF
8+
9+
readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
10+
for FILE in "${apt_files[@]}"; do
611
# (Append 'testing' at the end of lines starting with the yunohost repo..)
7-
sed -i 's@^deb http://forge.yunohost.org.*@& testing unstable@' $FILE
12+
sed -i 's@^deb http://forge.yunohost.org.*@& testing unstable@' "$FILE"
813
done
914

10-
echo "----"
11-
echo "Running 'apt-get update'"
12-
echo "----"
15+
cat << EOF
16+
----
17+
Running 'apt-get update'
18+
----
19+
EOF
1320
apt-get update
1421

15-
echo "----"
16-
echo "Running 'apt-get dist-upgrade'"
17-
echo "----"
22+
cat << EOF
23+
----
24+
Running 'apt-get dist-upgrade'
25+
----
26+
EOF
1827
apt-get dist-upgrade -y
19-

0 commit comments

Comments
 (0)