File tree Expand file tree Collapse file tree 3 files changed +88
-25
lines changed
Expand file tree Collapse file tree 3 files changed +88
-25
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- cat << EOF
3+ SOURCES_FILE=/etc/apt/sources.list.d/yunohost.sources
4+ LEVEL=" stable"
5+ COMPONENTS=" stable"
6+
7+ set_sources_components () {
8+ cat << EOF
9+ ----
10+ Patching $SOURCES_FILE to use $LEVEL repository...
11+ ----
12+ EOF
13+ sed -i ' s|^\(Components: \).*$|\1' " $COMPONENTS " " $SOURCES_FILE "
14+ }
15+
16+ set_lists_components () {
17+ cat << EOF
418----
519Patching sources.list to disable testing repository...
620----
721EOF
822
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
11- # Remove 'testing' and 'unstable' in lines using the yunohost repo
12- sed -i ' s|^\(deb.*yunohost.org.*\) testing\(.*\)$|\1\2|' " $FILE "
13- sed -i ' s|^\(deb.*yunohost.org.*\) unstable\(.*\)$|\1\2|' " $FILE "
14- done
23+ readarray -d ' ' apt_files < <( find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
24+ for FILE in " ${apt_files[@]} " ; do
25+ # Remove 'testing' and 'unstable' in lines using the yunohost repo
26+ sed -i ' s|^\(deb.*yunohost.org.*\) testing\(.*\)$|\1\2|' " $FILE "
27+ sed -i ' s|^\(deb.*yunohost.org.*\) unstable\(.*\)$|\1\2|' " $FILE "
28+ done
29+ }
30+
31+ if [[ -f " $SOURCES_FILE " ]]; then
32+ set_sources_components
33+ else
34+ set_lists_components
35+ fi
1536
1637cat << EOF
1738----
@@ -22,7 +43,7 @@ apt-get update
2243
2344cat << EOF
2445----
25- Running 'apt-get dist -upgrade'
46+ Running 'apt-get full -upgrade'
2647----
2748EOF
28- apt-get dist -upgrade -y
49+ apt-get full -upgrade -y
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- cat << EOF
3+ SOURCES_FILE=/etc/apt/sources.list.d/yunohost.sources
4+ LEVEL=" testing"
5+ COMPONENTS=" stable testing"
6+
7+ set_sources_components () {
8+ cat << EOF
9+ ----
10+ Patching $SOURCES_FILE to use $LEVEL repository...
11+ ----
12+ EOF
13+ sed -i ' s|^\(Components: \).*$|\1' " $COMPONENTS " " $SOURCES_FILE "
14+ }
15+
16+ set_lists_components () {
17+ cat << EOF
418----
519Patching sources.list to enable testing repository...
620----
721EOF
822
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
11- # (Append 'testing' at the end of lines starting with the yunohost repo..)
12- sed -i ' s@^deb.* http://forge.yunohost.org.*@& testing@' " $FILE "
13- done
23+ readarray -d ' ' apt_files < <( find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
24+ for FILE in " ${apt_files[@]} " ; do
25+ # (Append 'testing' at the end of lines starting with the yunohost repo..)
26+ sed -i ' s@^deb.* http://forge.yunohost.org.*@& testing@' " $FILE "
27+ done
28+ }
29+
30+ if [[ -f " $SOURCES_FILE " ]]; then
31+ set_sources_components
32+ else
33+ set_lists_components
34+ fi
1435
1536cat << EOF
1637----
@@ -21,7 +42,7 @@ apt-get update
2142
2243cat << EOF
2344----
24- Running 'apt-get dist -upgrade'
45+ Running 'apt-get full -upgrade'
2546----
2647EOF
27- apt-get dist -upgrade -y
48+ apt-get full -upgrade -y
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- cat << EOF
3+ SOURCES_FILE=/etc/apt/sources.list.d/yunohost.sources
4+ LEVEL=" unstable"
5+ COMPONENTS=" stable testing unstable"
6+
7+ set_sources_components () {
8+ cat << EOF
9+ ----
10+ Patching $SOURCES_FILE to use $LEVEL repository...
11+ ----
12+ EOF
13+ sed -i ' s|^\(Components: \).*$|\1' " $COMPONENTS " " $SOURCES_FILE "
14+ }
15+
16+ set_lists_components () {
17+ cat << EOF
418----
519Patching sources.list to enable unstable repository...
620----
721EOF
822
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
11- # (Append 'testing' at the end of lines starting with the yunohost repo..)
12- sed -i ' s@^deb http://forge.yunohost.org.*@& testing unstable@' " $FILE "
13- done
23+ readarray -d ' ' apt_files < <( find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0)
24+ for FILE in " ${apt_files[@]} " ; do
25+ # (Append 'testing' at the end of lines starting with the yunohost repo..)
26+ sed -i ' s@^deb http://forge.yunohost.org.*@& testing unstable@' " $FILE "
27+ done
28+ }
29+
30+ if [[ -f " $SOURCES_FILE " ]]; then
31+ set_sources_components
32+ else
33+ set_lists_components
34+ fi
1435
1536cat << EOF
1637----
@@ -21,7 +42,7 @@ apt-get update
2142
2243cat << EOF
2344----
24- Running 'apt-get dist -upgrade'
45+ Running 'apt-get full -upgrade'
2546----
2647EOF
27- apt-get dist -upgrade -y
48+ apt-get full -upgrade -y
You can’t perform that action at this time.
0 commit comments