From 02bf699c79095a15cb973c39c3b5b74cb4928be7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 4 Apr 2016 10:02:41 +0200 Subject: new file: archPackagesUpdate --- archPackagesUpdate | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 archPackagesUpdate diff --git a/archPackagesUpdate b/archPackagesUpdate new file mode 100755 index 00000000..3d5a8388 --- /dev/null +++ b/archPackagesUpdate @@ -0,0 +1,23 @@ +#!/bin/bash + +cd $(dirname $0)/archPackages + +tmpDir="$(mktemp -d /tmp/archive.XXXXXX)" + +# extract git HEAD + +git archive --format tar HEAD | \ + tar -x -C "${tmpDir}" -f - + +cd "${tmpDir}" + +# update $0 +if [ -e "$(basename $0)" ] && ! diff -q "$(basename $0)" "$0" &> /dev/null +then + cp "$(basename $0)" "$0" + $0 + exit $? +fi + + +rm -rf "${tmpDir}" -- cgit v1.2.3-70-g09d2