summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-12-11 21:00:53 -1000
committerSam Bingner <sam@bingner.com>2018-12-12 12:11:27 -1000
commit33cb68d9acf7ca56601d147c1ff9a81bd07e0a78 (patch)
tree53de7f96cc9af8de55a64311d09bfb19fc29d5ce
parent3284ad1eda2d23c8bdd5fcc152e69524a35700bc (diff)
Repackage if file is missing
-rwxr-xr-xpackage.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/package.sh b/package.sh
index 25db5b39b..2d683a8ba 100755
--- a/package.sh
+++ b/package.sh
@@ -44,19 +44,23 @@ fi
export PKG_HASH=$(util/catdir.sh "${PKG_DEST}" | md5sum | cut -d ' ' -f 1)
echo "hashed dest ${PKG_NAME} to: ${PKG_HASH}"
+NEED_PACK=0
-if [[ -e "${PKG_STAT}/dest-md5" && ${PKG_HASH} == $(cat "${PKG_STAT}/dest-md5" 2>/dev/null) ]]; then
- echo "skipping re-package of ${PKG_NAME}"
-else
+if [[ -z ${PKG_RVSN} || ! -e "${PKG_STAT}/dest-md5" || ${PKG_HASH} != $(cat "${PKG_STAT}/dest-md5" 2>/dev/null) ]]; then
if [[ -z ${PKG_RVSN} ]]; then
PKG_RVSN=1
else
PKG_RVSN=$((${PKG_RVSN} + 1))
fi
-
- if [[ ! -d "${PKG_BASE}/debs/${PKG_CFTARG}" ]]; then
- mkdir -p "${PKG_BASE}/debs/${PKG_CFTARG}"
- fi
+ NEED_PACK=1
+fi
+export PKG_PACK=${PKG_BASE}/debs/${PKG_CFTARG}/${PKG_NAME}_${PKG_VRSN}-${PKG_RVSN}_${PKG_ARCH}.deb
+if [[ ${NEED_PACK} == 0 && -f "${PKG_PACK}" ]]; then
+ echo "skipping re-package of ${PKG_NAME}"
+else
+ if [[ ! -d "${PKG_BASE}/debs/${PKG_CFTARG}" ]]; then
+ mkdir -p "${PKG_BASE}/debs/${PKG_CFTARG}"
+ fi
export PKG_PACK=${PKG_BASE}/debs/${PKG_CFTARG}/${PKG_NAME}_${PKG_VRSN}-${PKG_RVSN}_${PKG_ARCH}.deb
if [[ -e ${PKG_PACK} ]]; then
echo "package ${PKG_PACK} already exists..."