summaryrefslogtreecommitdiff
path: root/archPackagesUpdate
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-04-04 10:02:41 +0200
committerErich Eckner <git@eckner.net>2016-04-04 10:02:41 +0200
commit02bf699c79095a15cb973c39c3b5b74cb4928be7 (patch)
tree63306f812460bbd2b766a4370e75d1dc8df2c96e /archPackagesUpdate
parent6dc373759d940181bcb2a742f1f37548a7c1cacc (diff)
downloadarchlinuxewe-02bf699c79095a15cb973c39c3b5b74cb4928be7.tar.xz
new file: archPackagesUpdate
Diffstat (limited to 'archPackagesUpdate')
-rwxr-xr-xarchPackagesUpdate23
1 files changed, 23 insertions, 0 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate
new file mode 100755
index 000000000..3d5a83888
--- /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}"