aboutsummaryrefslogtreecommitdiffstats
path: root/community/apt-dater-host
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2018-03-17 18:29:56 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-03-31 17:40:23 +0200
commitae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5 (patch)
tree07fa54bbfda19bd6269aeae7c6c5c64fcc8e4c8f /community/apt-dater-host
parenta7a19674bec66451f937eb018091c4b132323b53 (diff)
downloadaports-ae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5.tar.bz2
aports-ae72fb1bb7becb1a2f2fce03b6b4eaf28ff692f5.tar.xz
community/apt-dater-host: improve-Machine-Type-reporting
See https://github.com/DE-IBH/apt-dater-host/pull/24
Diffstat (limited to 'community/apt-dater-host')
-rw-r--r--community/apt-dater-host/APKBUILD6
-rw-r--r--community/apt-dater-host/apk-improve-Machine-Type-reporting.patch62
2 files changed, 66 insertions, 2 deletions
diff --git a/community/apt-dater-host/APKBUILD b/community/apt-dater-host/APKBUILD
index 5997903c1c..c5b14356f1 100644
--- a/community/apt-dater-host/APKBUILD
+++ b/community/apt-dater-host/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=apt-dater-host
pkgver=1.0.1
-pkgrel=0
+pkgrel=1
pkgdesc="Host helper application for apt-dater"
url="https://github.com/DE-IBH/apt-dater-host"
arch="noarch"
@@ -11,6 +11,7 @@ checkdepends="bats checkbashisms"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/DE-IBH/$pkgname/archive/v$pkgver.tar.gz
apt-dater-host-fix-bashisms.patch
+ apk-improve-Machine-Type-reporting.patch
"
builddir="$srcdir/$pkgname-$pkgver"
@@ -31,4 +32,5 @@ package() {
install -m0644 "$pkgname".1 "$pkgdir"/usr/share/man/man1
}
sha512sums="52d48ade6758cb1150be2f21ed4c9831b4254ccc749ae865321abea077737a49ff7aeefb4e643aa289d953d2847dcf83e94837fe510fa8f8bfe19cfda0fd9dbc apt-dater-host-1.0.1.tar.gz
-6f695e1b1785f88217b5a32c509b5cb3c7a3f70069b042ad9770a4c1e86c4477abab2763579130f65e0c880976eb9f292bed3b42dda0d25e801696db479e55e8 apt-dater-host-fix-bashisms.patch"
+6f695e1b1785f88217b5a32c509b5cb3c7a3f70069b042ad9770a4c1e86c4477abab2763579130f65e0c880976eb9f292bed3b42dda0d25e801696db479e55e8 apt-dater-host-fix-bashisms.patch
+f56c38f9f8af119517965da8fe65a8d55f1e489ae8b3402cb72c55a7b876a658ee6dd7042342922fac3e5e59e872555914ca8e2f8dd723e98566ce6b16c341ce apk-improve-Machine-Type-reporting.patch"
diff --git a/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch b/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
new file mode 100644
index 0000000000..021436aeb5
--- /dev/null
+++ b/community/apt-dater-host/apk-improve-Machine-Type-reporting.patch
@@ -0,0 +1,62 @@
+From f90d99ca8c4a04396d94ef42abe794d6ce75173b Mon Sep 17 00:00:00 2001
+From: Henrik Riomar <henrik.riomar@gmail.com>
+Date: Sat, 27 Jan 2018 19:50:38 +0100
+Subject: [PATCH] apk: improve Machine Type reporting
+
+Report Xen-PV, xen-dom0 or xen-domU to apt-dater (instead of just xen).
+---
+ apk/apt-dater-host | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/apk/apt-dater-host b/apk/apt-dater-host
+index 25c9fb8..3bd8829 100755
+--- a/apk/apt-dater-host
++++ b/apk/apt-dater-host
+@@ -4,13 +4,13 @@
+ #
+ # Implementation of the protocol described in
+ # https://github.com/DE-IBH/apt-dater-host/blob/master/doc/ADP-0.6
+-# using Busybox ash, awk and sed for use with Alpine Linux
++# using Busybox ash, awk, sed, and tr for use with Alpine Linux
+ #
+ # Author:
+ # Henrik Riomar <henrik.riomar@gmail.com>
+ #
+ # Copyright Holder:
+-# 2016, 2017 (C) Henrik Riomar
++# 2016-2018 (C) Henrik Riomar
+ #
+ # License:
+ # This program is free software; you can redistribute it and/or modify
+@@ -32,6 +32,7 @@ ADP_VERSION="0.6"
+ ROOT_CMD="sudo"
+ APK_CMD="/sbin/apk"
+ VIRT_WHAT_CMD="/usr/sbin/virt-what --test-root=/"
++DMESG_CMD="dmesg"
+
+ err=255 # exit code returned by Perl from die()
+
+@@ -94,16 +95,16 @@ get_pkg_stat()
+ # VIRT: ${Name}
+ get_virt()
+ {
+- virt=$(dmesg | awk '/Hypervisor detected:/ {print $NF}')
++ virt=$($DMESG_CMD | awk -F': ' '/Hypervisor detected:/ {print $NF}')
+ if [ -n "$virt" ]; then
+- echo "VIRT: $virt"
++ echo "VIRT: $(echo "$virt" | tr -s ' ' '-')"
+ else
+- virt=$($VIRT_WHAT_CMD 2> /dev/null)
++ virt=$($VIRT_WHAT_CMD 2> /dev/null | tail -1)
+ ret=$?
+ if [ -z "$virt" ]; then
+ [ $ret -eq 0 ] && echo "VIRT: Physical" || echo "VIRT: Unknown"
+ else
+- echo "VIRT: $(echo $virt | awk '{print $1}')"
++ echo "VIRT: $(echo "$virt" | tr -s ' ' '-')"
+ fi
+ fi
+ }
+--
+2.11.0
+