From: <abe...@us...> - 2015-08-20 19:13:19
|
Revision: 7208 http://sourceforge.net/p/astlinux/code/7208 Author: abelbeck Date: 2015-08-20 19:13:16 +0000 (Thu, 20 Aug 2015) Log Message: ----------- fossil, add another helper script fossil-revert Modified Paths: -------------- branches/1.0/package/fossil/fossil.mk Added Paths: ----------- branches/1.0/package/fossil/scripts/fossil-revert Modified: branches/1.0/package/fossil/fossil.mk =================================================================== --- branches/1.0/package/fossil/fossil.mk 2015-08-20 17:55:03 UTC (rev 7207) +++ branches/1.0/package/fossil/fossil.mk 2015-08-20 19:13:16 UTC (rev 7208) @@ -32,6 +32,7 @@ $(INSTALL) -m 0755 -D package/fossil/scripts/fossil-open $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 0755 -D package/fossil/scripts/fossil-close $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 0755 -D package/fossil/scripts/fossil-update $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 0755 -D package/fossil/scripts/fossil-revert $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 0755 -D package/fossil/fossil.init $(TARGET_DIR)/etc/init.d/fossil ln -sf ../../init.d/fossil $(TARGET_DIR)/etc/runlevels/default/S75fossil ln -sf ../../init.d/fossil $(TARGET_DIR)/etc/runlevels/default/K15fossil @@ -42,6 +43,7 @@ rm -f $(TARGET_DIR)/usr/bin/fossil-open rm -f $(TARGET_DIR)/usr/bin/fossil-close rm -f $(TARGET_DIR)/usr/bin/fossil-update + rm -f $(TARGET_DIR)/usr/bin/fossil-revert rm -f $(TARGET_DIR)/etc/init.d/fossil rm -f $(TARGET_DIR)/etc/runlevels/default/S75fossil rm -f $(TARGET_DIR)/etc/runlevels/default/K15fossil Added: branches/1.0/package/fossil/scripts/fossil-revert =================================================================== --- branches/1.0/package/fossil/scripts/fossil-revert (rev 0) +++ branches/1.0/package/fossil/scripts/fossil-revert 2015-08-20 19:13:16 UTC (rev 7208) @@ -0,0 +1,48 @@ +#!/bin/sh + +REPO="/mnt/kd/fossil/astlinux.fossil" + +LOCKFILE="/var/lock/fossil-update.lock" + +revision="$1" + +file="$2" + +if [ -z "$revision" -o -z "$file" ]; then + echo "Usage: fossil-revert hex_revision_num file_name" + exit 1 +fi + +if [ ! -f $REPO ]; then + echo "Fossil repository not found: $REPO" >&2 + exit 1 +fi + +if ! cd /mnt/kd; then + exit 1 +fi + +if [ ! -f "$file" ]; then + echo "fossil-revert: file not found: /mnt/kd/${file#/mnt/kd/}" >&2 + exit 1 +fi + +if [ -f "$LOCKFILE" ]; then + echo "fossil-update: already running, lockfile \"$LOCKFILE\" exists, process id: $(cat "$LOCKFILE")." >&2 + exit 9 +fi + +fossil open $REPO --keep >/dev/null + +fossil revert -r "$revision" "$file" +rtn=$? + +if [ $rtn -eq 0 ]; then + fossil changes + fossil commit --no-warnings -m "Revert file: $file" + rtn=$? +fi + +fossil close --force + +exit $rtn Property changes on: branches/1.0/package/fossil/scripts/fossil-revert ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |