diff options
author | Erich Eckner <git@eckner.net> | 2016-04-04 10:02:41 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-04-04 10:02:41 +0200 |
commit | 02bf699c79095a15cb973c39c3b5b74cb4928be7 (patch) | |
tree | 63306f812460bbd2b766a4370e75d1dc8df2c96e | |
parent | 6dc373759d940181bcb2a742f1f37548a7c1cacc (diff) | |
download | archlinuxewe.git.save-02bf699c79095a15cb973c39c3b5b74cb4928be7.tar.xz |
new file: archPackagesUpdate
-rwxr-xr-x | archPackagesUpdate | 23 |
1 files changed, 23 insertions, 0 deletions
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}" |