Index: contrib/jhalfs-paco.patch
===================================================================
--- contrib/jhalfs-paco.patch	(revision 9b095185527c4af9e3cfad7e98cff7a30034fd53)
+++ contrib/jhalfs-paco.patch	(revision 8715be159b2c9e2ad432dc4f5f523e7481715c5c)
@@ -1,5 +1,5 @@
 Index: LFS/master.sh
 ===================================================================
---- LFS/master.sh	(revision 2861)
+--- LFS/master.sh	(revision 2864)
 +++ LFS/master.sh	(working copy)
 @@ -173,6 +173,11 @@
@@ -83,5 +83,5 @@
 Index: LFS/lfs.xsl
 ===================================================================
---- LFS/lfs.xsl	(revision 2861)
+--- LFS/lfs.xsl	(revision 2864)
 +++ LFS/lfs.xsl	(working copy)
 @@ -32,6 +32,9 @@
@@ -148,7 +148,7 @@
 Index: common/config
 ===================================================================
---- common/config	(revision 2861)
+--- common/config	(revision 2864)
 +++ common/config	(working copy)
-@@ -86,6 +86,14 @@
+@@ -86,6 +86,23 @@
  #--- Run farce testing 0(no)/1(yes)
  RUN_FARCE=0
@@ -160,10 +160,19 @@
 +
 +#--- Name of the Paco source package
-+PACO_FILE=paco-$PACO_VERSION.tar.*
++PACO_FILE=paco-$PACO_VERSION.tar.bz2   # (use .tar.gz if preferred)
++
++#--- Sourceforge mirror to use for Paco source download
++# Europe: heanet, belnet, puzzle, surfnet, switch, kent
++# North America: superb-east, superb-west, umn, easynews
++# South America: ufpr
++# Asia: nchc, jaist
++# Australia: optusnet
++PACO_MIRROR1=heanet
++PACO_MIRROR2=kent
 +
  #==== INTERNAL VARIABLES ====
  # Don't edit it unless you know what you are doing
  
-@@ -103,3 +111,9 @@
+@@ -103,3 +120,9 @@
  
  #--- farce report log directory
@@ -177,5 +186,5 @@
 Index: common/func_validate_configs.sh
 ===================================================================
---- common/func_validate_configs.sh	(revision 2861)
+--- common/func_validate_configs.sh	(revision 2864)
 +++ common/func_validate_configs.sh	(working copy)
 @@ -86,10 +86,10 @@
@@ -206,5 +215,5 @@
 --- common/paco-functions	(revision 0)
 +++ common/paco-functions	(revision 0)
-@@ -0,0 +1,209 @@
+@@ -0,0 +1,251 @@
 +#!/bin/bash
 +
@@ -416,4 +425,46 @@
 +esac
 +}
++
++#----------------------------------#
++get_paco_src() {                   #
++#----------------------------------#
++# Download the paco sources
++# We don't do any MD5SUM checking as of yet
++# http://jaist.dl.sourceforge.net/sourceforge/paco/paco-1.10.10.tar.bz2
++
++local PACO_URL1="http://$PACO_MIRROR1.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
++local PACO_URL2="http://$PACO_MIRROR2.dl.sourceforge.net/sourceforge/paco/$PACO_FILE"
++
++# Test if paco is to be used
++[ ! "$USE_PACO" = "1" ] && return
++
++# If the file exists in the archive copy it to the $BUILDDIR/sources dir.
++if [ ! -z ${SRC_ARCHIVE} ] &&
++   [   -d ${SRC_ARCHIVE} ] &&
++   [   -f ${SRC_ARCHIVE}/$PACO_FILE ]; then
++  cp ${SRC_ARCHIVE}/$PACO_FILE .
++  echo "$PACO_FILE: -- copied from $SRC_ARCHIVE"
++  fromARCHIVE=1
++else
++  echo "${BOLD}${YELLOW}$PACO_FILE: not found in ${SRC_ARCHIVE}${OFF}"
++  fromARCHIVE=0
++  # If the file does not exist yet in /sources download a fresh one
++  if [ ! -f $PACO_FILE ] ; then
++    if ! wget $PACO_URL1 && ! wget $PACO_URL2 ; then
++      gs_wrt_message "$PACO_FILE not found in the SRC_ARCHIVE or on any server..SKIPPING"
++      continue
++    fi
++  fi
++fi
++
++# Copy the freshly downloaded file to the source archive.
++if [ ! -z ${SRC_ARCHIVE}  ] &&
++   [   -d ${SRC_ARCHIVE}  ] &&
++   [   -w ${SRC_ARCHIVE}  ] &&
++   [ "$fromARCHIVE" = "0" ] ; then
++     echo "Storing file:<$PACO_FILE> in the package archive"
++     cp -f $PACO_FILE ${SRC_ARCHIVE}
++fi
++}
 Index: common/paco-build-lfs.sh
 ===================================================================
@@ -433,5 +484,5 @@
 Index: common/common-functions
 ===================================================================
---- common/common-functions	(revision 2861)
+--- common/common-functions	(revision 2864)
 +++ common/common-functions	(working copy)
 @@ -69,6 +69,9 @@
@@ -461,7 +512,17 @@
        ;;
      *) exit 1 ;;
+@@ -836,6 +841,9 @@
+     # Generate URLs file
+   create_urls
+ 
++    # If Paco is to be used, then download the sources
++  get_paco_src
++
+   IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
+   for line in `cat urls.lst`; do
+     IFS=$saveIFS  # Restore the system defaults
 Index: HLFS/hlfs.xsl
 ===================================================================
---- HLFS/hlfs.xsl	(revision 2861)
+--- HLFS/hlfs.xsl	(revision 2864)
 +++ HLFS/hlfs.xsl	(working copy)
 @@ -39,6 +39,9 @@
@@ -516,5 +577,5 @@
 Index: HLFS/master.sh
 ===================================================================
---- HLFS/master.sh	(revision 2861)
+--- HLFS/master.sh	(revision 2864)
 +++ HLFS/master.sh	(working copy)
 @@ -76,7 +76,9 @@
@@ -608,5 +669,5 @@
 Index: master.sh
 ===================================================================
---- master.sh	(revision 2861)
+--- master.sh	(revision 2864)
 +++ master.sh	(working copy)
 @@ -149,6 +149,8 @@
