From: <abe...@us...> - 2015-08-19 18:13:30
|
Revision: 7203 http://sourceforge.net/p/astlinux/code/7203 Author: abelbeck Date: 2015-08-19 18:13:28 +0000 (Wed, 19 Aug 2015) Log Message: ----------- fossil, helper script improvements Modified Paths: -------------- branches/1.0/package/fossil/scripts/fossil-close branches/1.0/package/fossil/scripts/fossil-open branches/1.0/package/fossil/scripts/fossil-update Modified: branches/1.0/package/fossil/scripts/fossil-close =================================================================== --- branches/1.0/package/fossil/scripts/fossil-close 2015-08-18 23:58:06 UTC (rev 7202) +++ branches/1.0/package/fossil/scripts/fossil-close 2015-08-19 18:13:28 UTC (rev 7203) @@ -1,5 +1,7 @@ #!/bin/sh -cd /mnt/kd +if ! cd /mnt/kd; then + exit 1 +fi fossil close --force Modified: branches/1.0/package/fossil/scripts/fossil-open =================================================================== --- branches/1.0/package/fossil/scripts/fossil-open 2015-08-18 23:58:06 UTC (rev 7202) +++ branches/1.0/package/fossil/scripts/fossil-open 2015-08-19 18:13:28 UTC (rev 7203) @@ -1,6 +1,15 @@ #!/bin/sh -cd /mnt/kd +REPO="/mnt/kd/fossil/astlinux.fossil" -fossil open /mnt/kd/fossil/astlinux.fossil --keep >/dev/null +if [ ! -f $REPO ]; then + echo "Fossil repository not found: $REPO" >&2 + exit 1 +fi + +if ! cd /mnt/kd; then + exit 1 +fi + +fossil open $REPO --keep >/dev/null fossil status Modified: branches/1.0/package/fossil/scripts/fossil-update =================================================================== --- branches/1.0/package/fossil/scripts/fossil-update 2015-08-18 23:58:06 UTC (rev 7202) +++ branches/1.0/package/fossil/scripts/fossil-update 2015-08-19 18:13:28 UTC (rev 7203) @@ -4,9 +4,31 @@ message="${1:-auto commit via cron}" -cd /mnt/kd +REPO="/mnt/kd/fossil/astlinux.fossil" -fossil open /mnt/kd/fossil/astlinux.fossil --keep >/dev/null +if [ ! -f $REPO ]; then + echo "Fossil repository not found: $REPO" >&2 + exit 1 +fi + +if ! cd /mnt/kd; then + exit 1 +fi + +fossil open $REPO --keep >/dev/null fossil status + +## Check for locally added files, add them to the repo +fossil ls | sed 's:/.*$::' | sort | uniq | xargs fossil add --force + +## Check for locally deleted files, remove them from the repo +if fossil changes | grep -q '^MISSING'; then + fossil changes | awk '/^MISSING/ { print $2; }' | xargs fossil forget +fi + fossil commit --no-warnings -m "$message" +rtn=$? + fossil close --force + +exit $rtn This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |