summaryrefslogtreecommitdiff
diff options
authorAlex Tu <alex.tu@canonical.com>2019-05-29 16:39:49 +0800
committerAlex Tu <alex.tu@canonical.com>2019-06-10 12:55:46 +0800
commit43b5ee11e1fde73b81e606509c1846a34414a0f7 (patch)
tree47238cd2b0422a20f85ace913e139a3456d86ba9
parent4cca06db5e8a341415256d89a446861280cd0087 (diff)
https://trello.com/c/UbGlGxUh based on new document[1]
https://docs.google.com/document/d/1bguNqqDeRvZO0343cje5IQhS-1ajcZA8om5yjXFhkmk/edit?ts=5ce3ace0#
-rwxr-xr-xbin/platform_meta_test25
1 files changed, 16 insertions, 9 deletions
diff --git a/bin/platform_meta_test b/bin/platform_meta_test
index 99b5325..f099dd9 100755
--- a/bin/platform_meta_test
+++ b/bin/platform_meta_test
@@ -2,13 +2,20 @@
echo "Beginning Platform Metapackage Test" 1>&2
-for meta in $(ubuntu-drivers list | grep meta); do
- modaliases=$(apt-cache show "${meta}" | grep Modaliases)
- if [[ "${modaliases}" =~ ChengMing|Inspiron|Latitude|OptiPlex|Precision|Vostro|XPS ]]; then
- echo "Platform Metapackage found: ${meta}"
- exit 0
- fi
-done
-
-echo "Platform Metapackage cannot be found"
+
+failed(){
+[ -n "$1" ] && echo $1
+echo "$0 failed!!"
exit 1
+}
+
+platform_tag=$(ubuntu-report show | grep DCD | awk -F'+' '{print $2}')
+
+[ -n "${platform_tag}" ] || failed "no platform tag in ubuntu-report"
+
+dpkg -l ${platform_tag}-meta > /dev/null || failed "no platform meta be installed."
+
+grep ${platform_tag} /etc/apt/sources.list.d/* > /dev/null || failed "no platform archive in source list"
+
+echo "platform meta found"
+exit 0