diff options
| -rwxr-xr-x | bin/platform_meta_test | 25 |
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 |
