Browse Source

minor changes

Chia-Che Tsai 8 years ago
parent
commit
8baad18f4a
3 changed files with 42 additions and 0 deletions
  1. 0 0
      LibOS/shim/src/.packed/shim.sha384
  2. BIN
      LibOS/shim/src/.packed/shim.tar.gz
  3. 42 0
      Scripts/pack_binaries.sh

File diff suppressed because it is too large
+ 0 - 0
LibOS/shim/src/.packed/shim.sha384


BIN
LibOS/shim/src/.packed/shim.tar.gz


+ 42 - 0
Scripts/pack_binaries.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+
+hash_method=sha384
+
+mkdir -p .packed
+
+file=$1
+shift
+dir=.packed
+packfile=$dir/${file}.tar.gz
+
+hash="$(echo $(for f in $@; do echo $f; done | sort))"
+
+src=$(for f in $@; do
+	prev_f=
+	while [ "$f" != "$prev_f" ]; do
+		for ext in c cpp S; do
+			[ ! -f ${f}.${ext} ] || echo ${f}.${ext}
+		done
+		prev_f=$f
+		f=${f%.*}
+	done
+done | sort)
+
+git rev-parse --show-toplevel 1>/dev/null 2>/dev/null || not_in_git=1
+
+hashfile=$dir/${file}.${hash_method}
+
+[ "$src" == "" ] || hash="$hash $(cat ${src} | ${hash_method}sum | awk '{ print $1 }')"
+
+if [ -f $hashfile ] && [ "$FORCE_PACK" != "1" ]; then
+	if [ "$(cat $hashfile)" = "$hash" ]; then
+		echo "Packed files are up-to-date, no need to repack the file."
+		exit 0
+	fi
+fi
+
+echo -n $hash > $hashfile
+[ "$not_in_git" = "1" ] || git add $hashfile
+
+tar -chzvvf $packfile $@
+[ "$not_in_git" = "1" ] || git add $packfile

Some files were not shown because too many files changed in this diff