summaryrefslogtreecommitdiff
path: root/cut-n-paste-code/libegg/update-from-egg.sh
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-01 22:24:23 -0300
committerPerberos <[email protected]>2011-12-01 22:24:23 -0300
commit0e004c696b0e68b2cff37a4c3315b022a35eaf43 (patch)
tree43261e815529cb9518ed7be37af13b846af8b26b /cut-n-paste-code/libegg/update-from-egg.sh
downloadcaja-0e004c696b0e68b2cff37a4c3315b022a35eaf43.tar.bz2
caja-0e004c696b0e68b2cff37a4c3315b022a35eaf43.tar.xz
moving from https://github.com/perberos/mate-desktop-environment
Diffstat (limited to 'cut-n-paste-code/libegg/update-from-egg.sh')
-rwxr-xr-xcut-n-paste-code/libegg/update-from-egg.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/cut-n-paste-code/libegg/update-from-egg.sh b/cut-n-paste-code/libegg/update-from-egg.sh
new file mode 100755
index 00000000..9be68a9b
--- /dev/null
+++ b/cut-n-paste-code/libegg/update-from-egg.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+function die() {
+ echo $*
+ exit 1
+}
+
+if test -z "$EGGDIR"; then
+ echo "Must set EGGDIR"
+ exit 1
+fi
+
+if test -z "$EGGFILES"; then
+ echo "Must set EGGFILES"
+ exit 1
+fi
+
+for FILE in $EGGFILES; do
+ if cmp -s $EGGDIR/$FILE $FILE; then
+ echo "File $FILE is unchanged"
+ else
+ cp $EGGDIR/$FILE $FILE || die "Could not move $EGGDIR/$FILE to $FILE"
+ echo "Updated $FILE"
+ fi
+done