changeset 35:92e240b49e01

syntax change in merge_utils.sh
author ng0@n0.is
date Fri, 03 May 2019 15:33:35 +0000
parents f48206cfbe36
children 7be480bacd59
files merge_utils.sh
diffstat 1 files changed, 20 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/merge_utils.sh	Fri May 03 15:32:05 2019 +0000
+++ b/merge_utils.sh	Fri May 03 15:33:35 2019 +0000
@@ -9,42 +9,41 @@
 #
 # show patchset
 #
-function sps() { 
-less $PATCHSETDIR/$1.patch
+sps() { 
+    less $PATCHSETDIR/$1.patch
 }
 
 #
 # test apply patchset
 #
-function tps() { 
-cat $PATCHSETDIR/$1.patch | patch -p1 --dry-run
+tps() { 
+    cat $PATCHSETDIR/$1.patch | patch -p1 --dry-run
 }
 
 #
 # apply patchset
 #
-function aps() { 
-cat $PATCHSETDIR/$1.patch | patch -p1
+aps() { 
+    cat $PATCHSETDIR/$1.patch | patch -p1
 }
 
 #
 # commit changes as merge of patchset.
 #
-function cps() {
-LOGMSG=`cat $PATCHSETDIR/$1.patch | perl -e '$line = 0; while(<>) {
-    if ($line == 1) { if (/PatchSet ([[:digit:]]*)/) { $ps = $1; }}
-    if ($line == 2) { if (/Date: (.*)/) { $dt = $1; }}
-    if ($line == 4) { if (/Branch: (.*)/) { $br = $1; }}
-    if ($line == 7) { $lg = $_; chop($lg) }
-    $line++;
-}
-print "Merge ps:$ps date:$dt branch:$br log:$lg\n";
-'`
-echo Committing with log message "'$LOGMSG'"
-if [ "$2" != "-n" ]
-then 
-    cvs commit -m"$LOGMSG"
-fi
+cps() {
+    LOGMSG=`cat $PATCHSETDIR/$1.patch | perl -e '$line = 0; while(<>) {
+       if ($line == 1) { if (/PatchSet ([[:digit:]]*)/) { $ps = $1; }}
+       if ($line == 2) { if (/Date: (.*)/) { $dt = $1; }}
+        if ($line == 4) { if (/Branch: (.*)/) { $br = $1; }}
+    	if ($line == 7) { $lg = $_; chop($lg) }
+    	$line++;
+    }
+    print "Merge ps:$ps date:$dt branch:$br log:$lg\n";'`
+    echo Committing with log message "'$LOGMSG'"
+    if [ "$2" != "-n" ]
+    then 
+	cvs commit -m"$LOGMSG"
+    fi
 }
 
 echo "Don't forget to set \$PATCHSETDIR to the directory where you patchset diffs are"