* README: reformat.
authorezk <ezk>
Fri, 1 Feb 2019 02:51:17 +0000 (02:51 +0000)
committerezk <ezk>
Fri, 1 Feb 2019 02:51:17 +0000 (02:51 +0000)
* wrapfs-patch-release.sh, wrapfs-fix-branch.sh: cleanups, fixes.

ChangeLog
README
wrapfs-fix-branch.sh
wrapfs-patch-release.sh

index 3562d5cc243699aba774e792683105624eef6784..b3503b4b5eaaf9216d03c783514f599f3ec65f43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-31  Erez Zadok  <ezk@fsl.cs.sunysb.edu>
+
+       * README: reformat.
+
+       * wrapfs-patch-release.sh, wrapfs-fix-branch.sh: cleanups, fixes.
+
 2018-03-21  Erez Zadok  <ezk@fsl.cs.sunysb.edu>
 
        * wrapfs-fix-branch.sh: commit initial script.
diff --git a/README b/README
index 6eb17ab9b793b1cb804c4002074441fb0424ec3a..2d0d0b5b96de890125fcd3b0f2b59efd8c828cd5 100644 (file)
--- a/README
+++ b/README
@@ -1,41 +1,38 @@
+Wrapfs follows the following branching scheme.
 
-Wrapfs follows the following branching scheme.                                      
-                                                                                    
-  There are two local branches called master and kernel. The master branch tracks 
-  the linux <latest> repository and pulls the latest code from that as remote (korg). 
-  The local branch wrapfs tracks the wrapfs <latest> repository and pushes and 
-  pulls latest code from that as remote (wrapfs). The kernel branch tracks the 
-  <git.kernel.org> as remote and fetches the latest from there. In order to setup 
-  this branching scheme please run the script - "wrapfs-fix-branch.sh"
+There are two local branches called master and kernel.  The master branch
+tracks the linux <latest> repository and pulls the latest code from that as
+remote (korg).  The local branch "wrapfs" tracks the wrapfs <latest>
+repository and pushes and pulls latest code from that as remote (wrapfs).
+The kernel branch tracks the <git.kernel.org> as remote and fetches the
+latest from there.  In order to setup this branching scheme please run the
+script - "wrapfs-fix-branch.sh"
 
 We can use "wrapfs-patch-release.sh" script for the following:
 
-  1.) Updating the kernel version to the korg latest linux version - 
-        Run it without any arguments. No patchfile will be released. For e.g.:
-        ./wrapfs-patch-release.sh 
-  2.) Updating it to a known linux release version - 
-        Use '-v' or '--version' and pass the respective linux version.
-        No patch file will be released. For e.g.:
-        
-        ./wrapfs-patch-release.sh -v 2.6.32.21
-        ./wrapfs-patch-release.sh --version 2.6.32.21
-  3.) Releasing a patch file with specific kernel version
-        Use '-r' or '--release-patch' option. For e.g. -
-        ./wrapfs-patch-release.sh --version 2.6.32.21 -r yes
-        ./wrapfs-patch-release.sh --version 2.6.32.21 --release-patch yes
-  4.) Releasing a patch file with current kernel version
-        Does a git pull to the latest kernel released version on master branch. 
-        Does a merge of master branch on wrapfs branch and then releases a
-        respective patch. Use '-r' or '--release-patch' option. For e.g. -
-        ./wrapfs-patch-release.sh -r yes
-        ./wrapfs-patch-release.sh --release-patch yes
+1. Updating the kernel version to the korg latest linux version - Run it
+   without any arguments.  No patchfile will be released.  For e.g.:
+
+$ ./wrapfs-patch-release.sh
+
+2. Updating it to a known linux release version: Use '-v' or '--version'
+   and pass the respective linux version.  No patch file will be
+   released.  For example:
+
+$ ./wrapfs-patch-release.sh -v 2.6.32.21
+$ ./wrapfs-patch-release.sh --version 2.6.32.21
+
+3. Releasing a patch file with specific kernel version.  Use '-r' or
+   '--release-patch' option.  For example:
+
+$ ./wrapfs-patch-release.sh --version 2.6.32.21 -r yes
+$ ./wrapfs-patch-release.sh --version 2.6.32.21 --release-patch yes
+
+4. Releasing a patch file with current kernel version.  Does a git pull to
+   the latest kernel released version on master branch.  Does a merge of
+   master branch on wrapfs branch and then releases a respective patch.  Use
+   '-r' or '--release-patch' option.  For example
+
+$ ./wrapfs-patch-release.sh -r yes
+$ ./wrapfs-patch-release.sh --release-patch yes
+
index ec6cc2d7a774ba4765c74eb703abe7948ae4c62d..770f050100f7479b1eb56049fca6f34c7a565e72 100755 (executable)
@@ -1,24 +1,22 @@
 #!/bin/bash
-
 set -u -e
 
 _=${LINUX_REPO:=""}
 _=${LINUX_BRANCH:=""}
-_=${LOG_FILE:="/tmp/wrapfs-fix-branch.log"}
+_=${LOG_FILE:="/tmp/wrapfs-fix-branch.$$.log"}
 _=${LOCATION:=$(pwd)}
 
-# check if the script is running for a git repository or not 
+# check if the script is running for a git repository or not
 if [ ! -d .git ]; then
     echo "Please run this script in a git directory."
-    exit
+    exit 1
 fi
 
 LINUX_PREFIX="git://git.kernel.org/pub/scm/linux/kernel/git"
 LINUX_BRANCH="master"
 
-# fetch the wrapfs url from .git/config 
+# fetch the wrapfs url from .git/config
 WRAPFS_URL=`git config --get-regexp remote.origin.url wrapfs | cut -f 2 -d ' '`
-
 if [ -z "${WRAPFS_URL:+x}" ]; then
     echo "Wrapfs url missing .git/config"
     exit 1
@@ -26,7 +24,6 @@ fi
 
 # fetch the wrapfs repository name from the wrapfs-url
 WRAPFS_REPO=`git config --get-regexp remote.origin.url wrapfs | sed 's/.*\///g'`
-
 if [ -z "${WRAPFS_REPO:+x}" ]; then
     echo "Missing repository name in url $WRAPFS_URL"
     exit 1
@@ -35,7 +32,7 @@ fi
 # Log info in a file
 LOG_FILE="/tmp/log-${WRAPFS_REPO}"
 
-# function to execute commands 
+# function to execute commands
 runcmd() {
     echo "----------------------------------------------------------------------" 2>&1 | tee -a $LOG_FILE
     echo "CMD: $@" 2>&1 | tee -a $LOG_FILE
@@ -52,7 +49,7 @@ trim() {
     # remove leading whitespace characters
     var="${var#"${var%%[![:space:]]*}"}"
     # remove trailing whitespace characters
-    var="${var%"${var##*[![:space:]]}"}"   
+    var="${var%"${var##*[![:space:]]}"}"
     echo -n "$var"
 }
 
@@ -86,7 +83,7 @@ case "$WRAPFS_REPO" in
        LINUX_REPO="torvalds/linux.git"
         LINUX_BRANCH="korg/master"
        ;;
-    wrapfs-2.* | wrapfs-3.* | wrapfs-4.* ) 
+    wrapfs-2.* | wrapfs-3.* | wrapfs-4.* )
        LINUX_REPO="stable/linux-stable.git"
         LINUX_BRANCH=$(get_linux_version $LOCATION/Makefile)
         LINUX_BRANCH="v$LINUX_BRANCH"
index 2c1f24be71e6a1eeec07d9f44600cfe7c5d34b56..02be6ab228781bd11908b8612bd64a085a0b15be 100755 (executable)
@@ -9,7 +9,7 @@ _=${PATCH_FILE:=""}
 _=${RELEASE_PATCH:=""}
 _=${PATCH_VERSION:=""}
 
-# check if the script is running for a git repository or not 
+# check if the script is running for a git repository or not
 if [ ! -d .git ]; then
     echo "Please run this script in a git directory."
     exit
@@ -20,17 +20,17 @@ eval set -- "$TEMP"
 
 while true; do
   case "$1" in
-    -v | --version ) LINUX_VERSION=$2; shift 2;;
-    -r | --release-patch ) RELEASE_PATCH=$2; shift 2;;
-    -- ) shift;break;;
-    * ) echo $1; break;;
+    -v | --version ) LINUX_VERSION=$2; shift 2 ;;
+    -r | --release-patch ) RELEASE_PATCH=$2; shift 2 ;;
+    -- ) shift; break ;;
+    * ) echo $1; break ;;
   esac
 done
 
-# function to execute commands 
+# function to execute commands
 runcmd() {
     echo "----------------------------------------------------------------------"
-    echo "CMD: $@" 
+    echo "CMD: $@"
     $@
     ret=$?
     if [ $ret -ne 0 ] ; then
@@ -52,7 +52,7 @@ trim() {
     # remove leading whitespace characters
     var="${var#"${var%%[![:space:]]*}"}"
     # remove trailing whitespace characters
-    var="${var%"${var##*[![:space:]]}"}"   
+    var="${var%"${var##*[![:space:]]}"}"
     echo -n "$var"
 }
 
@@ -82,7 +82,7 @@ get_linux_version() {
   echo -n $ret
 }
 
-# fetch the wrapfs url from .git/config 
+# fetch the wrapfs url from .git/config
 WRAPFS_URL=`git config --get-regexp remote.origin.url wrapfs | cut -f 2 -d ' '`
 
 if [ -z "${WRAPFS_URL:+x}" ]; then
@@ -102,7 +102,7 @@ case "$WRAPFS_REPO" in
     wrapfs-latest*)
         LINUX_BRANCH="master"
        ;;
-    wrapfs-2.* | wrapfs-3.* | wrapfs-4.* ) 
+    wrapfs-2.* | wrapfs-3.* | wrapfs-4.* )
         LINUX_BRANCH=$(echo $WRAPFS_REPO | sed s/wrapfs/linux/g | sed s/\.git//g)
        ;;
     * )
@@ -118,7 +118,7 @@ runcmd git fetch korg --tags $LINUX_BRANCH
 
 if [[ "$LINUX_VERSION" != "" ]]; then
   runcmd git reset --hard "v$LINUX_VERSION"
-else 
+else
   runcmd git pull korg ${LINUX_BRANCH}
 fi
 
@@ -145,7 +145,7 @@ if [ "${RELEASE_PATCH}" == "yes" ]; then
   if [[ "$LINUX_VERSION" != "" ]]; then
     PATCH_VERSION="v${LINUX_VERSION}"
     patch $PATCH_VERSION $PATCH_FILE
-  else 
+  else
     PATCH_VERSION=$(get_linux_version $LOCATION/Makefile )
     PATCH_VERSION="v$PATCH_VERSION"
     patch $PATCH_VERSION $PATCH_FILE