Update info.sh
* Works properly on Fedora 17 now, possibly other RPM-based distros
* Add GetDistro() function taken from logic in stack.sh
* Source functions in tools/info.sh
* Use GetDistro() and get_packages() in tools/info.sh
* Report all installed pips
* Don't sort localrc output as order is important
Change-Id: I1b3e48e94786378c7313a0a6bea88d5cf9d0f0c0
diff --git a/functions b/functions
index 8cf7c74..db10463 100644
--- a/functions
+++ b/functions
@@ -223,6 +223,24 @@
}
+# Translate the OS version values into common nomenclature
+# Sets ``DISTRO`` from the ``os_*`` values
+function GetDistro() {
+ GetOSVersion
+ if [[ "$os_VENDOR" =~ (Ubuntu) ]]; then
+ # 'Everyone' refers to Ubuntu releases by the code name adjective
+ DISTRO=$os_CODENAME
+ elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
+ # For Fedora, just use 'f' and the release
+ DISTRO="f$os_RELEASE"
+ else
+ # Catch-all for now is Vendor + Release + Update
+ DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
+ fi
+ export DISTRO
+}
+
+
# git clone only if directory doesn't exist already. Since ``DEST`` might not
# be owned by the installation user, we create the directory and change the
# ownership to the proper user.