aboutsummaryrefslogtreecommitdiffstats
path: root/main/xe-guest-utilities/identify_alpine.patch
diff options
context:
space:
mode:
authorCedric Schieli <cschieli@gmail.com>2010-03-21 12:32:03 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-03-31 08:31:54 +0000
commit29027806d47fb26652308bb1265765a8db82c76f (patch)
treed6532423c12c4a6fa651e387cddc50d32e2c21e3 /main/xe-guest-utilities/identify_alpine.patch
parent95e8811c0c11689b0a75ab12313dc5c45d0204b9 (diff)
downloadaports-29027806d47fb26652308bb1265765a8db82c76f.tar.bz2
aports-29027806d47fb26652308bb1265765a8db82c76f.tar.xz
main/xe-guest-utilities: new aport
Signed-off-by: Cedric Schieli <cschieli@gmail.com>
Diffstat (limited to 'main/xe-guest-utilities/identify_alpine.patch')
-rw-r--r--main/xe-guest-utilities/identify_alpine.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/main/xe-guest-utilities/identify_alpine.patch b/main/xe-guest-utilities/identify_alpine.patch
new file mode 100644
index 0000000000..d645c139ab
--- /dev/null
+++ b/main/xe-guest-utilities/identify_alpine.patch
@@ -0,0 +1,43 @@
+--- xe-guest-utilities-5.5.0.orig/xe-linux-distribution
++++ xe-guest-utilities-5.5.0/xe-linux-distribution
+@@ -248,6 +248,32 @@
+ write_to_output "${distro}" "${major}" "${minor}" "${description}"
+ }
+
++identify_alpine()
++{
++ alpine_release="$1"
++ local major
++ local minor
++
++ if [ ! -f "${alpine_release}" ] ; then
++ return 1
++ fi
++
++ eval $(sed -n \
++ -e 's/^.*-\([0-9]*\)\.\([0-9]*\)\.[0-9]* .*$/major=\1;minor=\2/gp;' \
++ -e 's/^.*-\([0-9]*\) .*$/major=\1;minor=/gp;' \
++ "${alpine_release}")
++
++ if [ -z "${major}" ] ; then
++ return 1
++ fi
++
++ if [ -z "${minor}" ] ; then
++ minor=0
++ fi
++
++ write_to_output "alpine" "${major}" "${minor}" "Alpinelinux $(head -n 1 $alpine_release)"
++}
++
+ if [ $# -eq 1 ] ; then
+ exec 1>"$1"
+ fi
+@@ -257,6 +283,7 @@
+ identify_sles /etc/SuSE-release && exit 0
+ identify_lsb lsb_release && exit 0
+ identify_debian /etc/debian_version && exit 0
++ identify_alpine /etc/alpine-release && exit 0
+
+ if [ $# -eq 1 ] ; then
+ rm -f "$1"