Index: scripts/patch/bash-patch.sh
===================================================================
--- scripts/patch/bash-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/bash-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -30,4 +30,12 @@
   wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}.tar.gz
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep bash | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -97,15 +105,15 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > bash-${VERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> bash-${VERSION}-branch_update-x.patch
-echo "Initial Package Version: ${VERSION}" >> bash-${VERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> bash-${VERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> bash-${VERSION}-branch_update-x.patch
-echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> bash-${VERSION}-branch_update-x.patch
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "             The following patches were skipped" >> bash-${VERSION}-branch_update-x.patch
-  echo "            ${SKIPPED}" >> bash-${VERSION}-branch_update-x.patch
+  echo "             The following patches were skipped" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
 fi
-echo "" >> bash-${VERSION}-branch_update-x.patch
-diff -Naur bash-${VERSION}.orig bash-${VERSION} >> bash-${VERSION}-branch_update-x.patch
-echo "Created /usr/src/bash-${VERSION}-branch_update-x.patch."
+echo "" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur bash-${VERSION}.orig bash-${VERSION} >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created /usr/src/bash-${VERSION}-branch_update-${PATCH_NUM}.patch."
Index: scripts/patch/binutils-patch.sh
===================================================================
--- scripts/patch/binutils-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/binutils-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -23,4 +23,12 @@
   wget ftp://ftp.gnu.org/gnu/binutils/binutils-${SOURCEVERSION}.tar.bz2
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep binutils | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -70,12 +78,12 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Initial Package Version: ${SOURCEVERSION}" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "             rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "" >> binutils-${SOURCEVERSION}-branch_update-x.patch
-diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-x.patch
-echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-x.patch."
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${SOURCEVERSION}" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch."
Index: scripts/patch/gcc-patch.sh
===================================================================
--- scripts/patch/gcc-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/gcc-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -20,4 +20,12 @@
   wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep gcc | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -57,12 +65,12 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-branch_update-x.patch
-echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> gcc-${VERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> gcc-${VERSION}-branch_update-x.patch
-echo "Description: This is a branch update for gcc-${VERSION}, and should be" >> gcc-${VERSION}-branch_update-x.patch
-echo "             rechecked periodically." >> gcc-${VERSION}-branch_update-x.patch
-echo "" >> gcc-${VERSION}-branch_update-x.patch
-diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-x.patch
-echo "Created /usr/src/gcc-${VERSION}-branch_update-x.patch."
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for gcc-${VERSION}, and should be" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created /usr/src/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch."
Index: scripts/patch/ncurses-patch.sh
===================================================================
--- scripts/patch/ncurses-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/ncurses-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -29,4 +29,12 @@
   wget ftp://invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep ncurses | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -94,12 +102,12 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ncurses-${VERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> ncurses-${VERSION}-branch_update-x.patch
-echo "Initial Package Version: ${VERSION}" >> ncurses-${VERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> ncurses-${VERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> ncurses-${VERSION}-branch_update-x.patch
-echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ncurses-${VERSION}-branch_update-x.patch
-echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ncurses-${VERSION}-branch_update-x.patch
-echo "" >> ncurses-${VERSION}-branch_update-x.patch
-diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ncurses-${VERSION}-branch_update-x.patch
-echo "Created /usr/src/ncurses-${VERSION}-branch_update-x.patch."
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created /usr/src/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
Index: scripts/patch/readline-patch.sh
===================================================================
--- scripts/patch/readline-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/readline-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -30,4 +30,12 @@
   wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}.tar.gz
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep readline | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -98,15 +106,15 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > readline-${VERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> readline-${VERSION}-branch_update-x.patch
-echo "Initial Package Version: ${VERSION}" >> readline-${VERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> readline-${VERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> readline-${VERSION}-branch_update-x.patch
-echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> readline-${VERSION}-branch_update-x.patch
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "            Thee following patches were skipped" >> readline-${VERSION}-branch_update-x.patch
-  echo "            ${SKIPPED}" >> readline-${VERSION}-branch_update-x.patch
+  echo "            Thee following patches were skipped" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
 fi
-echo "" >> readline-${VERSION}-branch_update-x.patch
-diff -Naur readline-${VERSION}.orig readline-${VERSION} >> readline-${VERSION}-branch_update-x.patch
-echo "Created /usr/src/readline-${VERSION}-branch_update-x.patch."
+echo "" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur readline-${VERSION}.orig readline-${VERSION} >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created /usr/src/readline-${VERSION}-branch_update-${PATCH_NUM}.patch."
Index: scripts/patch/vim-patch.sh
===================================================================
--- scripts/patch/vim-patch.sh	(revision 61a83e8eea29f1fdbd46ac97ff3d14896d262f89)
+++ scripts/patch/vim-patch.sh	(revision c7ef53480789ff4be07dfc301944402a013d3bee)
@@ -30,4 +30,12 @@
   wget ftp://ftp.vim.org/pub/vim/unix/vim-${VERSION}.tar.bz2
 fi
+
+# Set Patch Number
+#
+cd /usr/src
+wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
+PATCH_NUM=$(cat index.html | grep vim | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+rm -f index.html
 
 # Cleanup Directory
@@ -76,5 +84,5 @@
     fi
    fi
-   COUNT=`expr ${COUNT} + 1`
+   COUNT=$(expr ${COUNT} + 1)
 done
 
@@ -96,15 +104,15 @@
 #
 cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > vim-${VERSION}-branch_update-x.patch
-echo "Date: `date +%m-%d-%Y`" >> vim-${VERSION}-branch_update-x.patch
-echo "Initial Package Version: ${VERSION}" >> vim-${VERSION}-branch_update-x.patch
-echo "Origin: Upstream" >> vim-${VERSION}-branch_update-x.patch
-echo "Upstream Status: Applied" >> vim-${VERSION}-branch_update-x.patch
-echo "Description: Contains all upstream patches up to ${VERSION}.${FILES}" >> vim-${VERSION}-branch_update-x.patch
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Origin: Upstream" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}.${FILES}" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "             The following patches were skipped" >> vim-${VERSION}-branch_update-x.patch
-  echo "            ${SKIPPED}" >> vim-${VERSION}-branch_update-x.patch
+  echo "             The following patches were skipped" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
 fi
-echo "" >> vim-${VERSION}-branch_update-x.patch
-diff -Naur vim${SERIES}.orig vim${SERIES} >> vim-${VERSION}-branch_update-x.patch
-echo "Created /usr/src/vim-${VERSION}-branch_update-x.patch."
+echo "" >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+diff -Naur vim${SERIES}.orig vim${SERIES} >> vim-${VERSION}-branch_update-$(PATCH_NUM}.patch
+echo "Created /usr/src/vim-${VERSION}-branch_update-$(PATCH_NUM}.patch."
