From 3536471c4731f377bf90cca7de1e4b0f6cf6e2af Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Mon, 27 Mar 2017 21:11:43 -0600
Subject: [PATCH] Add ability to get package information

---
 cook.sh  | 11 +++++++++++
 setup.sh |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/cook.sh b/cook.sh
index 28e265d43..9d6e9123b 100755
--- a/cook.sh
+++ b/cook.sh
@@ -44,6 +44,17 @@ function op {
         unfetch)
             rm -rfv build
             ;;
+        info)
+            pushd build > /dev/null
+            if [ -e Cargo.toml ]
+            then
+                package_version="$(cargo config package.version | tr -d '"')"
+            else
+                package_version="$(git rev-parse --short HEAD)"
+            fi
+            echo "$1_${package_version}"
+            popd > /dev/null
+            ;;
         update)
             pushd build > /dev/null
             skip="0"
diff --git a/setup.sh b/setup.sh
index c6ada9c29..3396cacf5 100755
--- a/setup.sh
+++ b/setup.sh
@@ -10,6 +10,11 @@ echo "Update rust nightly"
 rustup update nightly
 echo "Downloading rust source"
 rustup component add rust-src
+if [ -z "$(which cargo-config)" ]
+then
+    echo "Installing cargo-config"
+    cargo install -f cargo-config
+fi
 if [ -z "$(which xargo)" ]
 then
     echo "Installing xargo"
-- 
GitLab