@@ -23,36 +23,6 @@ cleanup() {
23
23
}
24
24
trap cleanup EXIT
25
25
26
- if command -v lsb_release; then
27
- get_host () {
28
- lsb_release -i -s
29
- }
30
- get_codename () {
31
- lsb_release -c -s
32
- }
33
- get_release () {
34
- lsb_release -r -s
35
- }
36
- elif -f /etc/os-release; then
37
- sel_grep () {
38
- # Discard everything up to \K and make sure line ends with '"'.
39
- grep -oP ' ^${1}="\K.*(?=")' /etc/os_release
40
- }
41
- get_host () {
42
- sel_grep " NAME"
43
- }
44
- get_codename () {
45
- sel_gep " VERSION_CODENAME"
46
- }
47
- get_release () {
48
- echo " Please install ` lsb_release` ."
49
- exit 1
50
- }
51
- else
52
- echo " Please install ` lsb_release` ."
53
- exit 1
54
- fi
55
-
56
26
# Default directory where to build the chroot tree:
57
27
CHROOTDIR=" @judgehost_chrootdir@"
58
28
@@ -65,14 +35,15 @@ DEBIAN_ARCHLIST="amd64,arm64,armel,armhf,i386,mips,mips64el,mipsel,ppc64el,s390x
65
35
UBUNTU_ARCHLIST=" amd64,arm64,armhf,i386,powerpc,ppc64el,s390x"
66
36
67
37
# If host system is Debian or Ubuntu, use its release and architecture by default
68
- if [ " $( get_host) " = ' Debian' ] || [ " $( get_host) " = ' Ubuntu' ]; then
69
- DISTRO=" $( get_host) "
70
- RELEASE=" $( get_codename) "
71
- if [ " $( get_host) " = ' Debian' ]; then
72
- if [ " $( get_codename) " = " sid" ]; then
38
+ if [ " $( lsb_release -i -s || true) " = ' Debian' ] || \
39
+ [ " $( lsb_release -i -s || true) " = ' Ubuntu' ]; then
40
+ DISTRO=" $( lsb_release -i -s) "
41
+ RELEASE=" $( lsb_release -c -s) "
42
+ if [ " $( lsb_release -i -s) " = ' Debian' ]; then
43
+ if [ " $( lsb_release -c -s) " = " sid" ]; then
73
44
RELEASE=' unstable'
74
45
fi
75
- if [ " $( get_release ) " = ' testing' ]; then
46
+ if [ " $( lsb_release -r -s ) " = ' testing' ]; then
76
47
RELEASE=' testing'
77
48
fi
78
49
fi
0 commit comments