# HG changeset patch # User Geoff Salmon # Date 1447380482 18000 # Node ID 5ff5fea0ad7a7e6ef26539ea2b877cf5559960c0 # Parent db11c049b66b7a067027061268f59affde458de9 Add EXTERNAL_PATCH_DIR option for applying patches from outside aboriginal diff -r db11c049b66b -r 5ff5fea0ad7a config --- a/config Thu Nov 12 07:56:16 2015 -0600 +++ b/config Thu Nov 12 21:08:02 2015 -0500 @@ -152,3 +152,14 @@ # export CROSS_COMPILER_PATH=/path/to/cross-compiler/bin # export CC_PREFIX=thingy- + +# If you have patches you want patch files outside the aboriginal +# patch directory to be applied, supply the path here. Paths to the +# patches are built using the pattern +# ${EXTERNAL_PATCH_DIR}/${PACKAGE}/*.patch +# So one or more patches to apply to linux could be in the +# ${EXTERNAL_PATCH_DIR}/linux directory and will be applied in sorted +# order. The path is either absolute or relative to the aboriginal +# topdir. + +# export EXTERNAL_PATCH_DIR=/path/to/external/patches \ No newline at end of file diff -r db11c049b66b -r 5ff5fea0ad7a sources/download_functions.sh --- a/sources/download_functions.sh Thu Nov 12 07:56:16 2015 -0600 +++ b/sources/download_functions.sh Thu Nov 12 21:08:02 2015 -0500 @@ -50,10 +50,33 @@ echo "$1" | sed -e "$LOGRUS" } +gather_patches() +{ + ls "$PATCHDIR/${PACKAGE}"-*.patch 2> /dev/null | sort | while read i + do + if [ -f "$i" ] + then + echo "$i" + fi + done + + # gather external package patches sorted by filename + if [ ! -z "$EXTERNAL_PATCH_DIR" ] && [ -d "${EXTERNAL_PATCH_DIR}/${PACKAGE}" ] + then + for i in "${EXTERNAL_PATCH_DIR}/${PACKAGE}/"*.patch + do + if [ -f "$i" ] + then + echo "$i" + fi + done + fi +} + # Apply any patches to this package patch_package() { - ls "$PATCHDIR/${PACKAGE}"-*.patch 2> /dev/null | sort | while read i + gather_patches | while read i do if [ -f "$i" ] then @@ -151,7 +174,7 @@ SHALIST=$(cat "$SHA1FILE" 2> /dev/null) if [ ! -z "$SHALIST" ] then - for i in "$SHA1TAR" $(sha1file "$PATCHDIR/$PACKAGE"-*.patch 2>/dev/null) + for i in "$SHA1TAR" $(sha1file $(gather_patches)) do # Is this sha1 in the file? if [ -z "$(echo "$SHALIST" | grep "$i")" ] diff -r db11c049b66b -r 5ff5fea0ad7a sources/variables.sh --- a/sources/variables.sh Thu Nov 12 07:56:16 2015 -0600 +++ b/sources/variables.sh Thu Nov 12 21:08:02 2015 -0500 @@ -53,6 +53,11 @@ export_if_blank HOSTTOOLS="$BUILD/host" export_if_blank WRAPDIR="$BUILD/record-commands" +if [ ! -z "$EXTERNAL_PATCH_DIR" ] +then + export EXTERNAL_PATCH_DIR=$(readlink -e "$EXTERNAL_PATCH_DIR") +fi + # Set a default non-arch export WORK="${BUILD}/host-temp"