Commit 7caf4643 authored by Arnout Vandecappelle's avatar Arnout Vandecappelle Committed by Peter Korsgaard
Browse files

apply-patches.sh: use everything from the series file



When a series file exists, we should use every file mentioned in it,
not just the ones ending with .patch or .diff. Also, there's no need
to uncompress anything if it's mentioned in a series file (the tools
that manipulate series files don't support compressed patches).

Signed-off-by: default avatarArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Doug Kehn <rdkehn@yahoo.com>
Tested-by: default avatarDoug Kehn <rdkehn@yahoo.com>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent b3f7f949
Loading
Loading
Loading
Loading
+30 −25
Original line number Diff line number Diff line
@@ -16,8 +16,9 @@
# '*'. Pattern(s) describing the patch names you want to apply.
#
# The script will look recursively for patches from the patch directory. If a
# file is named 'series' then only patches mentionned into it will be applied.
# If not, the script will look for file names matching pattern(s). If the name
# file named 'series' exists then the patches mentioned in it will be applied
# as plain patches, regardless of their file name. If no 'series' file exists,
# the script will look for file names matching pattern(s). If the name
# ends with '.tar.*', '.tbz2' or '.tgz', the file is considered as an archive
# and will be uncompressed into a directory named
# '.patches-name_of_the_archive-unpacked'. It's the turn of this directory to
@@ -64,6 +65,9 @@ find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print0 | \
function apply_patch {
    path=$1
    patch=$2
    if [ "$3" ]; then
        type="series"; uncomp="cat"
    else
        case "$patch" in
	    *.gz)
	    type="gzip"; uncomp="gunzip -dc"; ;;
@@ -86,6 +90,7 @@ function apply_patch {
	    return 0
	    ;;
        esac
    fi
    if [ -z "$silent" ] ; then
	echo ""
	echo "Applying $patch using ${type}: "
@@ -111,7 +116,7 @@ function scan_patchdir {
    # to apply patches. Skip line starting with a dash.
    if [ -e "${path}/series" ] ; then
        for i in `grep -Ev "^#" ${path}/series 2> /dev/null` ; do
            apply_patch "$path" "$i"
            apply_patch "$path" "$i" series
        done
    else
        for i in `cd $path; ls -d $patches 2> /dev/null` ; do