From 43b5ee11e1fde73b81e606509c1846a34414a0f7 Mon Sep 17 00:00:00 2001 From: Alex Tu Date: Wed, 29 May 2019 16:39:49 +0800 Subject: https://trello.com/c/UbGlGxUh based on new document[1] https://docs.google.com/document/d/1bguNqqDeRvZO0343cje5IQhS-1ajcZA8om5yjXFhkmk/edit?ts=5ce3ace0# --- bin/platform_meta_test | 25 ++++++++++++++++--------- 1 file 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 -- cgit v1.2.3