Index: scripts/patch/bash-patch.sh
===================================================================
--- scripts/patch/bash-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/bash-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -16,5 +16,6 @@
 # Get the # of Patches
 #
-cd /usr/src
+install -d ~/tmp
+cd ~/tmp
 wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches/ --no-remove-listing
 VERSION2=$(echo ${VERSION} | sed -e 's/\.//g')
@@ -33,5 +34,5 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 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)
@@ -41,17 +42,18 @@
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf bash-${VERSION} bash-${VERSION}.orig
 tar xvf bash-${VERSION}.tar.gz
 cp -ar bash-${VERSION} bash-${VERSION}.orig
-cd bash-${VERSION}
-CURRENTDIR=$(pwd -P)
 
 # Download and Apply Patches
 #
+install -d ~/tmp/bash-${VERSION}-patches
+cd ~/tmp/bash-${VERSION}
+CURRENTDIR=$(pwd -P)
 PATCHURL=ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches
-mkdir /tmp/bash-${VERSION}
 COUNT=1
 while [ ${COUNT} -le ${FILES} ]; do
-  cd /tmp/bash-${VERSION}           
+  cd ~/tmp/bash-${VERSION}           
   DLCOUNT="${COUNT}"
   SKIPME=no
@@ -71,14 +73,15 @@
   if [ "${SKIPME}" != "yes" ]; then
     if ! [ -e ${VERSION}.${DLCOUNT} ]; then
+      cd ~/tmp/bash-${VERSION}-patches
       wget --quiet ${PATCHURL}/bash${VERSION2}-${DLCOUNT}
     fi
     cd ${CURRENTDIR}
-    patch --dry-run -s -f -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
+    patch --dry-run -s -f -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}
     if [ "$?" = "0" ]; then
       echo "Patch bash${VERSION2}-${DLCOUNT} applied"
-      patch -s -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
+      patch -s -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}
     else
      echo "Patch bash${VERSION2}-${DLCOUNT} not applied"
-     rm -f /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
+     rm -f ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}
      SKIPPED="${SKIPPED} ${DLCOUNT}"
     fi
@@ -89,7 +92,7 @@
 # Cleanup Directory
 #
-
+cd ~/tmp/bash-${VERSION}
 for dir in $(find * -type d); do
-  cd /usr/src/bash-${VERSION}/${dir}
+  cd ~/tmp/bash-${VERSION}/${dir}
   for file in $(find . -name '*~'); do
     rm -f ${file}
@@ -99,21 +102,27 @@
   done
 done
-cd /usr/src/bash-${VERSION}
+cd ~/tmp/bash-${VERSION}
 rm -f *~ *.orig
 
 # Create Patch
 #
-cd /usr/src
-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
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "             The following patches were skipped" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
-  echo "            ${SKIPPED}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "             The following patches were skipped" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
 fi
-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."
+echo "" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur bash-${VERSION}.orig bash-${VERSION} >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch."
+
+# Cleanup Directory
+#
+cd ~/tmp
+rm -rf bash-${VERSION} bash-${VERSION}.orig
Index: scripts/patch/binutils-patch.sh
===================================================================
--- scripts/patch/binutils-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/binutils-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -19,5 +19,6 @@
 # Download Binutils Source
 #
-cd /usr/src
+install -d ~/tmp
+cd ~/tmp
 if ! [ -e binutils-${SOURCEVERSION}.tar.bz2  ]; then
   wget ftp://ftp.gnu.org/gnu/binutils/binutils-${SOURCEVERSION}.tar.bz2
@@ -26,20 +27,23 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
 PATCH_NUM=$(cat index.html | grep binutils | grep "${SOURCEVERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
 PATCH_NUM=$(expr ${PATCH_NUM} + 1)
+PATCH_NUM2=$(cat index.html | grep binutils | grep "${SOURCEVERSION}" | grep fixes | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
+PATCH_NUM2=$(expr ${PATCH_NUM2} + 1)
 rm -f index.html
 
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
 tar xvf binutils-${SOURCEVERSION}.tar.bz2
-mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
-CURRENTDIR=$(pwd -P)
 
 # Get Current Updates from CVS
 #
-cd /usr/src
+cd ~/tmp
+mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
+CURRENTDIR=$(pwd -P)
 FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
 cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils
@@ -48,7 +52,8 @@
 # Cleanup
 #
+cd ~/tmp
 DIRS="binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig"
 for DIRECTORY in ${DIRS}; do
-  cd /usr/src/${DIRECTORY}
+  cd ~/tmp/${DIRECTORY}
   FILE_LIST=".cvsignore *.gmo"
   for files in ${FILE_LIST}; do
@@ -66,10 +71,10 @@
     cd ..
 done
-cd /usr/src/binutils-${SOURCEVERSION}
-rm -f /usr/src/binutils-${SOURCEVERSION}.orig/md5.sum
+cd ~/tmp/binutils-${SOURCEVERSION}
+rm -f ~/tmp/binutils-${SOURCEVERSION}.orig/md5.sum
 
 # Make Binutils a Release
 #
-cd /usr/src/binutils-${SOURCEVERSION}
+cd ~/tmp/binutils-${SOURCEVERSION}
 sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am
 sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in
@@ -77,7 +82,7 @@
 # Customize the version string, so we know it's patched
 #
-cd /usr/src/binutils-${SOURCEVERSION}
+cd ~/tmp/binutils-${SOURCEVERSION}
 DATE_STAMP=$(date +%Y%m%d)
-cd /usr/src/binutils-${SOURCEVERSION}
+cd ~/tmp/binutils-${SOURCEVERSION}
 sed -i "s:@PKGVERSION@:(GNU Binutils for Cross-LFS) :" bfd/Makefile.in
 sed -i "s:^[[:space:]]VERSION=\(.*\)$: VERSION=\1.${DATE_STAMP}:g" bfd/configure
@@ -85,19 +90,79 @@
 # Create Patch
 #
-cd /usr/src
-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
-echo "This patch was created on ${DATE_STAMP}" >> 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."
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${SOURCEVERSION}" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically." >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "This patch was created on ${DATE_STAMP}" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >>  ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch."
 
 # Cleanliness is the name of my game!
 #
 unset DATE_STAMP
+
+# Create Another Copy to create fixes patch
+#
+cd ~/tmp
+if [ -e ${PATCH_DIR}/${VERSION} ]; then
+  rm -rf binutils-${SOURCEVERSION}.orig
+  cp -ar binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
+
+  # Apply Patches from directories
+  #
+  cd ~/tmp/binutils-${SOURCEVERSION}
+  PATCH_FILES=$(ls ${PATCH_DIR}/${VERSION}/*.patch)
+  if [ "${PATCH_FILES}" != "" ]; then
+    for pfile in ${PATCH_FILES}; do
+      echo "Applying - ${pfile}..."
+      for pvalue in $(seq 0 5); do
+        patch --dry-run -Np${pvalue} -i ${pfile} > /dev/null 2>&1
+        if [ "${?}" = "0" ]; then
+          PVALUE=${pvalue}
+          break
+        fi
+      done
+      if [ "${PVALUE}" != "" ]; then
+        patch -Np${PVALUE} -i ${pfile}
+      else
+        echo "Patch: ${pfile} Failed to Apply..."
+        exit 255
+      fi
+    done
+  fi
+
+  # Cleanup Directory
+  #
+  cd ~/tmp/binutils-${SOURCEVERSION}
+  rm -f $(find * -name "*~")
+  rm -f $(find * -name "*.orig")
+  rm -f $(find * -name "*.rej")
+  rm -f *.orig *~ *.rej
+
+  # Create Patch
+  #
+  cd ~/tmp
+  install -d ~/patches
+  echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Date: `date +%m-%d-%Y`" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Initial Package Version: ${VERSION}" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Origin: Upstream" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Upstream Status: Applied" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Description: This Patch contains fixes for binutils-${SOURCEVERSION}, and should be" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "             rechecked periodically." >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Created ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch."
+fi
+
+# Cleanup Directory
+#
+cd ~/tmp
+rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
Index: scripts/patch/gcc-patch.sh
===================================================================
--- scripts/patch/gcc-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/gcc-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -20,5 +20,6 @@
 # Download GCC Source
 #
-cd /usr/src
+install -d ~/tmp
+cd ~/tmp
 if ! [ -e gcc-${VERSION}.tar.bz2  ]; then
   wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
@@ -27,5 +28,5 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing > /dev/null 2>&1
 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)
@@ -37,12 +38,12 @@
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf gcc-${VERSION} gcc-${VERSION}.orig
 tar xvf gcc-${VERSION}.tar.bz2
 mv gcc-${VERSION} gcc-${VERSION}.orig
-CURRENTDIR=$(pwd -P)
 
 # Get Current Updates from SVN
 #
-cd /usr/src
+cd ~/tmp
 NUM1=$(echo ${VERSION} | cut -f1 -d.)
 NUM2=$(echo ${VERSION} | cut -f2 -d.)
@@ -53,4 +54,5 @@
 # Add a custom version string
 #
+cd ~/tmp
 DATE_STAMP=$(cat gcc-${VERSION}/gcc/DATESTAMP)
 echo "${VERSION}" > gcc-${VERSION}/gcc/BASE-VER
@@ -59,53 +61,54 @@
 # Cleanup
 #
+cd ~/tmp
 DIRS="gcc-${VERSION} gcc-${VERSION}.orig"
 for DIRECTORY in ${DIRS}; do
-  cd ${DIRECTORY}
+  cd ~/tmp/${DIRECTORY}
   REMOVE="ABOUT-NLS COPYING COPYING.LIB MAINTAINERS Makefile.def
     Makefile.in Makefile.tpl README README.SCO BUGS FAQ LAST_UPDATED
     MD5SUMS NEWS bugs.html faq.html gcc/BASE-VER gcc/DEV-PHASE
-    gcc/f/BUGS gcc/f/NEWS gcc/c-parse.c gcc/gengtype-lex.c gcc/c-parse.y
-    gcc/gengtype-yacc.c gcc/gengtype-yacc.h gcc/java/parse-scan.c
-    gcc/java/parse.c gcc/objc/objc-parse.c gcc/objc/objc-parse.y
-    libjava/classpath/doc/cp-tools.info"
+    gcc/f/BUGS gcc/f/NEWS gcc/gengtype-lex.c"
   for file in ${REMOVE}; do
     rm -f $file
   done
   for file in $(find . -name "ChangeLog*" | sed -e 's@./@@'); do
-    rm -f ${file}
+    rm -fv ${file}
   done
-  rm -rf INSTALL
-  rm -f fastjar/*.{1,info} gcc/doc/*.{1,info,7} gcc/fortran/*.{1,info,7}
-  rm -f gcc/po/*.{gmo,po}  libcpp/po/*.{gmo,po} libgomp/*.{1,info,7}
-  rm -f libjava/classpath/doc/*.{1,info}
-  cd .. 
+  REMVOVE_DIRS="INSTALL"
+  for dir in ${REMOVE_DIRS}; do
+    rm -rfv ${dir}
+  done
+  rm -fv fastjar/*.{1,info} gcc/doc/*.{1,info,7} gcc/fortran/*.{1,info,7} gcc/po/*.{gmo,po}
+  rm -rf libcpp/po/*.{gmo,po} libgomp/*.{1,info,7} libjava/classpath/doc/*.{1,info}
+ cd .. 
 done
 
 # Create Patch
 #
-cd /usr/src
-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
-echo "This patch was made from Revision # ${REVISION}." >> 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."
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for gcc-${VERSION}, and should be" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically." >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "This patch was made from Revision # ${REVISION}." >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch."
 
 # Create Another Copy to create fixes patch
 #
-cd /usr/src
-rm -rf gcc-${VERSION}.orig
-cp -ar gcc-${VERSION} gcc-${VERSION}.orig
+cd ~/tmp
+if [ -e ${PATCH_DIR}/${VERSION} ]; then
+  rm -rf gcc-${VERSION}.orig
+  cp -ar gcc-${VERSION} gcc-${VERSION}.orig
 
-# Apply Patches from directories
-#
-cd /usr/src/gcc-${VERSION}
-if [ -e ${PATCH_DIR}/${VERSION} ]; then
+  # Apply Patches from directories
+  #
+  cd ~/tmp/gcc-${VERSION}
   PATCH_FILES=$(ls ${PATCH_DIR}/${VERSION}/*.patch)
   if [ "${PATCH_FILES}" != "" ]; then
@@ -127,35 +130,31 @@
     done
   fi
+
+  # Cleanup Directory
+  #
+  cd ~/tmp/gcc-${VERSION}
+  rm -f $(find * -name "*~")
+  rm -f $(find * -name "*.orig")
+  rm -f $(find * -name "*.rej")
+  rm -f *.orig *~ *.rej
+
+  # Create Patch
+  #
+  cd ~/tmp
+  install -d ~/patches
+  echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Date: `date +%m-%d-%Y`" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Initial Package Version: ${VERSION}" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Origin: Upstream" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Upstream Status: Applied" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Description: This Patch contains fixes for gcc-${VERSION}, and should be" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "             rechecked periodically." >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "" >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
+  echo "Created ~/patches/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch."
 fi
 
 # Cleanup Directory
 #
-
-for dir in $(find * -type d); do
-  cd /usr/src/gcc-${VERSION}/${dir}
-  for file in $(find . -name '*~'); do
-    rm -f ${file}
-  done
-  for file in $(find . -name '*.orig'); do
-    rm -f ${file}
-  done
-  for file in $(find . -name '*.rej'); do
-    rm -f ${file}
-  done
-done
-cd /usr/src/gcc-${VERSION}/
-rm -rf *.orig *~ *.rej
-
-# Create Patch
-#
-cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Origin: Upstream" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Upstream Status: Applied" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Description: This Patch contains fixes for gcc-${VERSION}, and should be" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "             rechecked periodically." >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
-echo "Created /usr/src/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch."
+cd ~/tmp
+rm -rf gcc-${VERSION} gcc-${VERSION}.orig
Index: scripts/patch/gcc-specs-patch.sh
===================================================================
--- scripts/patch/gcc-specs-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/gcc-specs-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -16,5 +16,5 @@
 # Download GCC Source
 #
-cd /usr/src
+cd ~/tmp
 if ! [ -e gcc-${VERSION}.tar.bz2  ]; then
   wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
@@ -23,12 +23,12 @@
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf gcc-${VERSION} gcc-${VERSION}.orig
 tar xvf gcc-${VERSION}.tar.bz2
 cp -ar gcc-${VERSION} gcc-${VERSION}.orig
-CURRENTDIR=$(pwd -P)
 
 # Modify the Data
 #
-cd /usr/src/gcc-${VERSION}
+cd ~/tmp/gcc-${VERSION}
 for file in $(find gcc/config -name "*.h"); do
   if [ "$(echo ${file} | grep -c bsd)" = "0" ]; then
@@ -53,25 +53,26 @@
 # Create Patch
 #
-cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-specs-x.patch
-echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-specs-x.patch
-echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-specs-x.patch
-echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> gcc-${VERSION}-specs-x.patch
-echo "        the Pure LFS project." >> gcc-${VERSION}-specs-x.patch
-echo "Upstream Status: Not Applied" >> gcc-${VERSION}-specs-x.patch
-echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> gcc-${VERSION}-specs-x.patch
-echo "" >> gcc-${VERSION}-specs-x.patch
-diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-specs-x.patch
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/gcc-${VERSION}-specs-x.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "        the Pure LFS project." >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "Upstream Status: Not Applied" >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> ~/patches/gcc-${VERSION}-specs-x.patch
+echo "" >> ~/patches/gcc-${VERSION}-specs-x.patch
+diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> ~/patches/gcc-${VERSION}-specs-x.patch
 
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf gcc-${VERSION} gcc-${VERSION}.orig
 tar xvf gcc-${VERSION}.tar.bz2
 cp -ar gcc-${VERSION} gcc-${VERSION}.orig
-CURRENTDIR=$(pwd -P)
 
 # Modify the Data
 #
-cd /usr/src/gcc-${VERSION}
+cd ~/tmp/gcc-${VERSION}
 for file in $(find gcc/config -name "*.h"); do
   if [ "$(echo ${file} | grep -c bsd)" = "0" ]; then
@@ -98,17 +99,19 @@
 # Create Patch
 #
-cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-pure64_specs-x.patch
-echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-pure64_specs-x.patch
-echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-pure64_specs-x.patch
-echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> gcc-${VERSION}-pure64_specs-x.patch
-echo "        the Pure LFS project." >> gcc-${VERSION}-pure64_specs-x.patch
-echo "Upstream Status: Not Applied" >> gcc-${VERSION}-pure64_specs-x.patch
-echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> gcc-${VERSION}-pure64_specs-x.patch
-echo "" >> gcc-${VERSION}-pure64_specs-x.patch
-diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-pure64_specs-x.patch
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "        the Pure LFS project." >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "Upstream Status: Not Applied" >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+echo "" >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
+diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> ~/patches/gcc-${VERSION}-pure64_specs-x.patch
 
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf gcc-${VERSION} gcc-${VERSION}.orig
 tar xvf gcc-${VERSION}.tar.bz2
@@ -118,5 +121,5 @@
 # Modify the Data
 #
-cd /usr/src/gcc-${VERSION}
+cd ~/tmp/gcc-${VERSION}
 for file in $(find gcc/config -name "*.h"); do
   if [ "$(echo ${file} | grep -c bsd)" = "0" ]; then
@@ -151,16 +154,22 @@
 # Create Patch
 #
-cd /usr/src
-echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-pure64-x.patch
-echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-pure64-x.patch
-echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-pure64-x.patch
-echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> gcc-${VERSION}-pure64-x.patch
-echo "        the Pure LFS project." >> gcc-${VERSION}-pure64-x.patch
-echo "Upstream Status: Not Applied" >> gcc-${VERSION}-pure64-x.patch
-echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> gcc-${VERSION}-pure64-x.patch
-echo "" >> gcc-${VERSION}-pure64-x.patch
-diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-pure64-x.patch
+cd ~/tmp
+install -d ~/patches
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "Origin: Idea originally developed by Ryan Oliver and Greg Schafer for" >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "        the Pure LFS project." >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "Upstream Status: Not Applied" >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "Description: This patch modifies the location of the dynamic linker for gcc-${VERSION}." >> ~/patches/gcc-${VERSION}-pure64-x.patch
+echo "" >> ~/patches/gcc-${VERSION}-pure64-x.patch
+diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> ~/patches/gcc-${VERSION}-pure64-x.patch
 
-echo "Created /usr/src/gcc-${VERSION}-specs-x.patch."
-echo "Created /usr/src/gcc-${VERSION}-pure64_specs-x.patch."
-echo "Created /usr/src/gcc-${VERSION}-pure64-x.patch."
+echo "Created ~/patches/gcc-${VERSION}-specs-x.patch."
+echo "Created ~/patches/gcc-${VERSION}-pure64_specs-x.patch."
+echo "Created ~/patches/gcc-${VERSION}-pure64-x.patch."
+
+# Cleanup Directory
+#
+cd ~/tmp
+rm -rf gcc-${VERSION} gcc-${VERSION}.orig
Index: scripts/patch/gcc/4.4.0/01-cloog-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.0/01-cloog-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
+++ scripts/patch/gcc/4.4.0/01-cloog-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -0,0 +1,173 @@
+2009-01-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* Makefile.in (BACKENDLIBS): Link against -ldl instead of -lcloog -lppl.
+	(graphite.o): Force -O, remove -fkeep-inline-functions.
+	* graphite.c: Include <dlfcn.h>.  Reference libcloog and libppl symbols
+	through pointers in cloog_pointers variable.
+	(init_cloog_pointers): New function.
+	(gcc_type_for_iv_of_clast_loop): Rename stmt_for argument to stmt_fora.
+	(graphite_transform_loops): Call init_cloog_pointers.
+
+diff -Naur gcc-4.4.0.orig/gcc/graphite.c gcc-4.4.0/gcc/graphite.c
+--- gcc-4.4.0.orig/gcc/graphite.c	2009-03-18 09:59:55.000000000 -0700
++++ gcc-4.4.0/gcc/graphite.c	2009-06-15 13:55:33.000000000 -0700
+@@ -59,6 +59,110 @@
+ #include "cloog/cloog.h"
+ #include "graphite.h"
+ 
++#include <dlfcn.h>
++#define DYNSYMS \
++  DYNSYM (cloog_block_alloc); \
++  DYNSYM (cloog_block_list_free); \
++  DYNSYM (cloog_block_list_malloc); \
++  DYNSYM (cloog_clast_create); \
++  DYNSYM (cloog_clast_free); \
++  DYNSYM (cloog_domain_free); \
++  DYNSYM (cloog_domain_matrix2domain); \
++  DYNSYM (cloog_initialize); \
++  DYNSYM (cloog_loop_malloc); \
++  DYNSYM (cloog_matrix_alloc); \
++  DYNSYM (cloog_matrix_copy); \
++  DYNSYM (cloog_matrix_free); \
++  DYNSYM (cloog_matrix_print); \
++  DYNSYM (cloog_names_malloc); \
++  DYNSYM (cloog_names_scalarize); \
++  DYNSYM (cloog_options_free); \
++  DYNSYM (cloog_options_malloc); \
++  DYNSYM (cloog_program_dump_cloog); \
++  DYNSYM (cloog_program_extract_scalars); \
++  DYNSYM (cloog_program_free); \
++  DYNSYM (cloog_program_generate); \
++  DYNSYM (cloog_program_malloc); \
++  DYNSYM (cloog_program_print); \
++  DYNSYM (cloog_program_scatter); \
++  DYNSYM (cloog_statement_alloc); \
++  DYNSYM (ppl_finalize); \
++  DYNSYM (pprint); \
++  DYNSYM (stmt_block); \
++  DYNSYM (stmt_for); \
++  DYNSYM (stmt_guard); \
++  DYNSYM (stmt_root); \
++  DYNSYM (stmt_user);
++static struct
++{
++  bool inited;
++  void *h;
++#define DYNSYM(x) __typeof (x) *p_##x
++  DYNSYMS
++#undef DYNSYM
++} cloog_pointers;
++
++#define cloog_block_alloc (*cloog_pointers.p_cloog_block_alloc)
++#define cloog_block_list_free (*cloog_pointers.p_cloog_block_list_free)
++#define cloog_block_list_malloc (*cloog_pointers.p_cloog_block_list_malloc)
++#define cloog_clast_create (*cloog_pointers.p_cloog_clast_create)
++#define cloog_clast_free (*cloog_pointers.p_cloog_clast_free)
++#define cloog_domain_free (*cloog_pointers.p_cloog_domain_free)
++#define cloog_domain_matrix2domain (*cloog_pointers.p_cloog_domain_matrix2domain)
++#define cloog_initialize (*cloog_pointers.p_cloog_initialize)
++#define cloog_loop_malloc (*cloog_pointers.p_cloog_loop_malloc)
++#define cloog_matrix_alloc (*cloog_pointers.p_cloog_matrix_alloc)
++#define cloog_matrix_copy (*cloog_pointers.p_cloog_matrix_copy)
++#define cloog_matrix_free (*cloog_pointers.p_cloog_matrix_free)
++#define cloog_matrix_print (*cloog_pointers.p_cloog_matrix_print)
++#define cloog_names_malloc (*cloog_pointers.p_cloog_names_malloc)
++#define cloog_names_scalarize (*cloog_pointers.p_cloog_names_scalarize)
++#define cloog_options_free (*cloog_pointers.p_cloog_options_free)
++#define cloog_options_malloc (*cloog_pointers.p_cloog_options_malloc)
++#define cloog_program_dump_cloog (*cloog_pointers.p_cloog_program_dump_cloog)
++#define cloog_program_extract_scalars (*cloog_pointers.p_cloog_program_extract_scalars)
++#define cloog_program_free (*cloog_pointers.p_cloog_program_free)
++#define cloog_program_generate (*cloog_pointers.p_cloog_program_generate)
++#define cloog_program_malloc (*cloog_pointers.p_cloog_program_malloc)
++#define cloog_program_print (*cloog_pointers.p_cloog_program_print)
++#define cloog_program_scatter (*cloog_pointers.p_cloog_program_scatter)
++#define cloog_statement_alloc (*cloog_pointers.p_cloog_statement_alloc)
++#define ppl_finalize (*cloog_pointers.p_ppl_finalize)
++#define pprint (*cloog_pointers.p_pprint)
++#define stmt_block (*cloog_pointers.p_stmt_block)
++#define stmt_for (*cloog_pointers.p_stmt_for)
++#define stmt_guard (*cloog_pointers.p_stmt_guard)
++#define stmt_root (*cloog_pointers.p_stmt_root)
++#define stmt_user (*cloog_pointers.p_stmt_user)
++
++#define cloog_finalize (*cloog_pointers.p_ppl_finalize)
++
++static bool
++init_cloog_pointers (void)
++{
++  void *h;
++
++  if (cloog_pointers.inited)
++    return cloog_pointers.h != NULL;
++  h = dlopen ("libcloog.so.0", RTLD_LAZY);
++  cloog_pointers.h = h;
++  if (h == NULL)
++    return false;
++#define DYNSYM(x) \
++  do \
++    { \
++      union { __typeof (cloog_pointers.p_##x) p; void *q; } u; \
++      u.q = dlsym (h, #x); \
++      if (u.q == NULL) \
++	return false; \
++      cloog_pointers.p_##x = u.p; \
++    } \
++  while (0)
++  DYNSYMS
++#undef DYNSYM
++  return true;
++}
++
+ static VEC (scop_p, heap) *current_scops;
+ 
+ /* Converts a GMP constant V to a tree and returns it.  */
+@@ -4075,10 +4179,10 @@
+    STMT.  */
+ 
+ static tree
+-gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for)
++gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_fora)
+ {
+-  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_for);
+-  const char *cloog_iv = stmt_for->iterator;
++  struct clast_user_stmt *stmt = clast_get_body_of_loop ((struct clast_stmt *) stmt_fora);
++  const char *cloog_iv = stmt_fora->iterator;
+   CloogStatement *cs = stmt->statement;
+   graphite_bb_p gbb = (graphite_bb_p) cloog_statement_usr (cs);
+ 
+@@ -6109,6 +6213,12 @@
+   if (number_of_loops () <= 1)
+     return;
+ 
++  if (!init_cloog_pointers ())
++    {
++      sorry ("Graphite loop optimizations cannot be used");
++      return;
++    }
++
+   current_scops = VEC_alloc (scop_p, heap, 3);
+   recompute_all_dominators ();
+ 
+diff -Naur gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
+--- gcc-4.4.0.orig/gcc/Makefile.in	2009-05-21 16:17:37.000000000 -0700
++++ gcc-4.4.0/gcc/Makefile.in	2009-06-15 13:55:33.000000000 -0700
+@@ -914,7 +914,7 @@
+ # How to link with both our special library facilities
+ # and the system's installed libraries.
+ LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER)
+-BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS)
++BACKENDLIBS = $(GMPLIBS) $(if $(CLOOGLIBS),-ldl)
+ # Any system libraries needed just for GNAT.
+ SYSLIBS = @GNAT_LIBEXC@
+ 
+@@ -3061,6 +3061,9 @@
+ 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
+ 		$(out_file) $(OUTPUT_OPTION)
+ 
++graphite.o : \
++  ALL_CFLAGS := -O $(filter-out -fkeep-inline-functions, $(ALL_CFLAGS))
++
+ # Build auxiliary files that support ecoff format.
+ mips-tfile: mips-tfile.o version.o $(LIBDEPS)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
Index: scripts/patch/gcc/4.4.0/05-java-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.0/05-java-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
+++ scripts/patch/gcc/4.4.0/05-java-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -0,0 +1,49 @@
+Java can only be built as 1 ABI at the moment. So this switch will all
+the disabling of only the java multilib build
+
+diff -Naur gcc-4.4.0.orig/libjava/configure gcc-4.4.0/libjava/configure
+--- gcc-4.4.0.orig/libjava/configure	2009-04-26 07:24:38.000000000 -0700
++++ gcc-4.4.0/libjava/configure	2009-06-15 13:55:33.000000000 -0700
+@@ -1021,6 +1021,8 @@
+                           default=yes
+   --enable-java-maintainer-mode
+                           allow rebuilding of .class and .h files
++  --enable-libjava-multilib
++                          build libjava as multilib
+   --disable-dependency-tracking  speeds up one-time build
+   --enable-dependency-tracking   do not reject slow dependency extractors
+   --enable-maintainer-mode  enable make rules and dependencies not useful
+@@ -1973,6 +1975,16 @@
+ fi
+ 
+ 
++# Check whether --enable-libjava-multilib was given.
++if test "${enable_libjava_multilib+set}" = set; then
++  enableval=$enable_libjava_multilib;
++fi
++
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ 
+ 
+diff -Naur gcc-4.4.0.orig/libjava/configure.ac gcc-4.4.0/libjava/configure.ac
+--- gcc-4.4.0.orig/libjava/configure.ac	2009-04-26 07:24:38.000000000 -0700
++++ gcc-4.4.0/libjava/configure.ac	2009-06-15 13:55:33.000000000 -0700
+@@ -139,6 +139,13 @@
+ 	[allow rebuilding of .class and .h files]))
+ AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
+ 
++AC_ARG_ENABLE(libjava-multilib,
++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
++if test "$enable_libjava_multilib" = no; then
++  multilib=no
++  ac_configure_args="$ac_configure_args --disable-multilib"
++fi
++
+ # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
+ GCC_NO_EXECUTABLES
+ 
Index: scripts/patch/gcc/4.4.0/10-java-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.0/10-java-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
+++ scripts/patch/gcc/4.4.0/10-java-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -0,0 +1,18 @@
+2008-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+	* omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs.
+
+diff -Naur gcc-4.4.0.orig/libgomp/omp.h.in gcc-4.4.0/libgomp/omp.h.in
+--- gcc-4.4.0.orig/libgomp/omp.h.in	2009-04-09 16:23:07.000000000 -0700
++++ gcc-4.4.0/libgomp/omp.h.in	2009-06-15 13:55:33.000000000 -0700
+@@ -39,8 +39,8 @@
+ 
+ typedef struct
+ {
+-  unsigned char _x[@OMP_NEST_LOCK_SIZE@] 
+-    __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
++  unsigned char _x[8 + sizeof (void *)] 
++    __attribute__((__aligned__(sizeof (void *))));
+ } omp_nest_lock_t;
+ #endif
+ 
Index: scripts/patch/gcc/4.4.0/15-libtool-fixes.patch
===================================================================
--- scripts/patch/gcc/4.4.0/15-libtool-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
+++ scripts/patch/gcc/4.4.0/15-libtool-fixes.patch	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -0,0 +1,29 @@
+This patch works around rpath in GCC
+
+diff -Naur gcc-4.4.0.orig/ltmain.sh gcc-4.4.0/ltmain.sh
+--- gcc-4.4.0.orig/ltmain.sh	2008-09-26 09:21:02.000000000 -0700
++++ gcc-4.4.0/ltmain.sh	2009-06-15 13:55:33.000000000 -0700
+@@ -6886,6 +6886,7 @@
+ 	  rpath="$finalize_rpath"
+ 	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
++	    case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
+ 	      if test -n "$hardcode_libdir_separator"; then
+ 		if test -z "$hardcode_libdirs"; then
+@@ -7575,6 +7576,7 @@
+       rpath=
+       hardcode_libdirs=
+       for libdir in $compile_rpath $finalize_rpath; do
++	case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	if test -n "$hardcode_libdir_flag_spec"; then
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+@@ -7626,6 +7628,7 @@
+       rpath=
+       hardcode_libdirs=
+       for libdir in $finalize_rpath; do
++	case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac
+ 	if test -n "$hardcode_libdir_flag_spec"; then
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
Index: scripts/patch/ncurses-patch.sh
===================================================================
--- scripts/patch/ncurses-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/ncurses-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -16,5 +16,5 @@
 # Get Patch Names
 #
-cd /usr/src
+cd ~/tmp
 wget ftp://invisible-island.net/ncurses/${VERSION}/ --no-remove-listing
 ROLLUP=$(cat index.html | grep bz2 | cut -f2 -d'>' | cut -f1 -d'<' | tail -n 1)
@@ -26,4 +26,5 @@
 # Download Ncurses Source
 #
+cd ~/tmp
 if ! [ -e ncurses-${VERSION}.tar.gz ]; then
   wget ftp://invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz
@@ -32,5 +33,5 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 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)
@@ -40,20 +41,22 @@
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
 tar xvf ncurses-${VERSION}.tar.gz
 cp -ar ncurses-${VERSION} ncurses-${VERSION}.orig
-cd ncurses-${VERSION}
 
 # Download and Apply Rollup Patch
 #
+cd ~/tmp/ncurses-${VERSION}
 CURRENTDIR=$(pwd -P)
-mkdir /tmp/ncurses-${VERSION}
-cd /tmp/ncurses-${VERSION}
+mkdir ~/tmp/ncurses-${VERSION}-patches
+cd ~/tmp/ncurses-${VERSION}
 if [ "${ROLLUP}" != "" ]; then
   echo "Getting Rollup ${ROLLUP} Patch..."
+  cd ~/tmp/ncurses-${VERSION}-patches
   wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${ROLLUP}
   cd ${CURRENTDIR}
   echo "Applying Rollup ${ROLLUP} Patch..."
-  cp /tmp/ncurses-${VERSION}/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
+  cp ~/tmp/ncurses-${VERSION}-patches/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
   bunzip2 ${ROLLUP}
   ROLLUP2=$(echo ${ROLLUP} | sed -e 's/.bz2//g')
@@ -63,4 +66,7 @@
 # Download and Apply Patches
 #
+install -d ~/tmp/ncurses-${VERSION}-patches
+cd ~/tmp/ncurses-${VERSION}
+CURRENTDIR=$(pwd -P)
 for file in ${FILES}; do
   if [ "${ROLLPATCH}" != "" ]; then
@@ -70,12 +76,12 @@
   fi
   if [ "${TEST}" = "0" ]; then
-    cd /tmp/ncurses-${VERSION}
+    cd ~/tmp/ncurses-${VERSION}-patches
     echo "Getting Patch ${file}..."
     wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${file}
     cd ${CURRENTDIR}
-    gunzip -c /tmp/ncurses-${VERSION}/${file} | patch --dry-run -s -f -Np1
+    gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch --dry-run -s -f -Np1
     if [ "$?" = "0" ]; then
       echo "Apply Patch ${file}..."
-      gunzip -c /tmp/ncurses-${VERSION}/${file} | patch -Np1
+      gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch -Np1
       LASTFILE=$(echo ${file} | cut -f2 -d. | cut -f2 -d-)
     fi
@@ -85,8 +91,8 @@
 # Cleanup Directory
 #
-# Cleanup Directory
-#
+cd ~/tmp
+cd ncurses-${VERSION}
 for dir in $(find * -type d); do
-  cd /usr/src/ncurses-${VERSION}/${dir}
+  cd ~/tmp/ncurses-${VERSION}/${dir}
   for file in $(find . -name '*~'); do
     rm -f ${file}
@@ -96,18 +102,23 @@
   done
 done
-cd /usr/src/ncurses-${VERSION}
+cd ~/tmp/ncurses-${VERSION}
 rm -f *~ *.orig
 
 # Create Patch
 #
-cd /usr/src
-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."
+cd ~/tmp
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
+
+# Cleanup Directory
+#
+cd ~/tmp
+rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
Index: scripts/patch/readline-patch.sh
===================================================================
--- scripts/patch/readline-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/readline-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -16,5 +16,5 @@
 # Get the # of Patches
 #
-cd /usr/src
+cd ~/tmp
 wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches/ --no-remove-listing
 VERSION2=$(echo ${VERSION} | sed -e 's/\.//g')
@@ -27,4 +27,5 @@
 # Download Readline Source
 #
+cd ~/tmp
 if ! [ -e readline-${VERSION}.tar.gz ]; then
   wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}.tar.gz
@@ -33,5 +34,5 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 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)
@@ -41,17 +42,19 @@
 # Cleanup Directory
 #
+cd ~/tmp
 rm -rf readline-${VERSION} readline-${VERSION}.orig
 tar xvf readline-${VERSION}.tar.gz
 cp -ar readline-${VERSION} readline-${VERSION}.orig
-cd readline-${VERSION}
-CURRENTDIR=$(pwd -P)
 
 # Download and Apply Patches
 #
+install -d ~/tmp/readline-${VERSION}-patches
+cd ~/tmp/readline-${VERSION}
+CURRENTDIR=$(pwd -P)
 PATCHURL=ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches
 mkdir /tmp/readline-${VERSION}
 COUNT=1
 while [ ${COUNT} -le ${FILES} ]; do
-  cd /tmp/readline-${VERSION}           
+  cd ~/tmp/readline-${VERSION}           
   DLCOUNT="${COUNT}"
   SKIPME=no
@@ -71,14 +74,15 @@
   if [ "${SKIPME}" != "yes" ]; then
     if ! [ -e ${VERSION}.${DLCOUNT} ]; then
+      cd ~/tmp/readline-${VERSION}-patches
       wget --quiet ${PATCHURL}/readline${VERSION2}-${DLCOUNT}
     fi
     cd ${CURRENTDIR}
-    patch --dry-run -s -f -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
+    patch --dry-run -s -f -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
     if [ "$?" = "0" ]; then
       echo "Patch readline${VERSION2}-${DLCOUNT} applied"
-      patch -s -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
+      patch -s -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
     else
       echo "Patch readline${VERSION2}-${DLCOUNT} not applied"
-      rm -f /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
+      rm -f ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
       SKIPPED="${SKIPPED} ${DLCOUNT}"
      fi
@@ -92,5 +96,5 @@
 #
 for dir in $(find * -type d); do
-  cd /usr/src/readline-${VERSION}/${dir}
+  cd ~/tmp/readline-${VERSION}/${dir}
   for file in $(find . -name '*~'); do
     rm -f ${file}
@@ -100,21 +104,26 @@
   done
 done
-cd /usr/src/readline-${VERSION}
+cd ~/tmp/readline-${VERSION}
 rm -f *~ *.orig
 
 # Create Patch
 #
-cd /usr/src
-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
+cd ~/tmp
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "            Thee following patches were skipped" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
-  echo "            ${SKIPPED}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            Thee following patches were skipped" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
 fi
-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."
+echo "" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur readline-${VERSION}.orig readline-${VERSION} >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch."
+
+# Cleanup Directory
+#
+cd ~/tmp
+rm -rf readline-${VERSION} readline-${VERSION}.orig
Index: scripts/patch/vim-patch.sh
===================================================================
--- scripts/patch/vim-patch.sh	(revision 38201478074455bc6e6bde377a5c9bcb52ac29a8)
+++ scripts/patch/vim-patch.sh	(revision d8a9d8b002b091b22f607f9787cf4fb59f49a3f6)
@@ -16,5 +16,5 @@
 # Get the # of Patches
 #
-cd /usr/src
+cd ~/tmp
 wget ftp://ftp.vim.org/pub/vim/patches/${VERSION}/ --no-remove-listing
 FILES=$(cat index.html | grep "${VERSION}" | cut -f6 -d. | cut -f1 -d'"' | sed '/^$/d' | tail -n 1)
@@ -33,5 +33,5 @@
 # Set Patch Number
 #
-cd /usr/src
+cd ~/tmp
 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)
@@ -44,14 +44,14 @@
 tar xvf vim-${VERSION}.tar.bz2
 cp -ar vim${SERIES} vim${SERIES}.orig
-cd vim${SERIES}
-CURRENTDIR=$(pwd -P)
 
 # Download and Apply Patches
 #
+install -d ~/tmp/vim-${VERSION}-patches
+cd ~/tmp/vim${SERIES}
+CURRENTDIR=$(pwd -P)
 PATCHURL=ftp://ftp.vim.org/pub/vim/patches/${VERSION}
-mkdir /tmp/vim-${VERSION}
 COUNT=1
 while [ ${COUNT} -le ${FILES} ]; do
-  cd /tmp/vim-${VERSION}            
+  cd ~/tmp/vim${SERIES}
   DLCOUNT="${COUNT}"
   SKIPME=no
@@ -71,14 +71,14 @@
   if [ "${SKIPME}" != "yes" ]; then
     if ! [ -e ${VERSION}.${DLCOUNT} ]; then
+      cd ~/tmp/vim-${VERSION}-patches
       wget --quiet $PATCHURL/${VERSION}.${DLCOUNT}
     fi
     cd $CURRENTDIR
-    patch --dry-run -s -f -Np0 -i /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
+    patch --dry-run -s -f -Np0 -i ~/tmp/vim-${VERSION}-patches/${VERSION}.${DLCOUNT}
     if [ "$?" = "0" ]; then
       echo "Patch ${VERSION}.${DLCOUNT} applied"
-      patch -s -Np0 -i /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
+      patch -s -Np0 -i ~/tmp/vim-${VERSION}-patches/${VERSION}.${DLCOUNT}
     else
       echo "Patch ${VERSION}.${DLCOUNT} not applied"
-      rm -f /tmp/vim-${VERSION}/${VERSION}.${DLCOUNT}
       SKIPPED="${SKIPPED} ${DLCOUNT}"
     fi
@@ -90,5 +90,5 @@
 #
 for dir in $(find * -type d); do
-  cd /usr/src/vim${SERIES}
+  cd ~/tmp/vim${SERIES}
   for file in $(find . -name '*~'); do
     rm -f ${file}
@@ -98,21 +98,25 @@
   done
 done
-cd /usr/src/vim${SERIES}
+cd ~/tmp/vim${SERIES}
 rm -f *~ *.orig
 
 # Create Patch
 #
-cd /usr/src
-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
+cd ~/tmp
+echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Date: `date +%m-%d-%Y`" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Initial Package Version: ${VERSION}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Origin: Upstream" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Upstream Status: Applied" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Description: Contains all upstream patches up to ${VERSION}.${FILES}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
 if [ -n "${SKIPPED}" ]; then
-  echo "             The following patches were skipped" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
-  echo "            ${SKIPPED}" >> vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "             The following patches were skipped" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+  echo "            ${SKIPPED}" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
 fi
-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."
+echo "" >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+diff -Naur vim${SERIES}.orig vim${SERIES} >> ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch
+echo "Created ~/patches/vim-${VERSION}-branch_update-${PATCH_NUM}.patch."
+
+# Cleanup Directory
+#
+rm -rf vim${SERIES} vim${SERIES}.orig
