• Bug#255529: dpatch-bootstrap script

    From Gergely Nagy@1:229/2 to All on Sun Aug 15 16:20:04 2004
    From: [email protected]

    Hi!

    I started to work on this, and so far, I came up with the attached
    scriptlet. Unfortunately, the time I allowed myself to hack on dpatch is already up, so the script is not even near close to finished. It might
    serve as a base, though.

    Anyway, I'm posting it here in case you, or someone else feels like
    finishing it O:)

    Cheers,
    --
    Gergely Nagy

    #! /bin/sh

    set -e

    if [ ! -e /usr/bin/filterdiff ]; then
    echo "dpatch-convert-diffgz: filterdiff not found, aborting!" >&2
    echo " (consider installing patchutils)" >&2
    exit 1
    fi

    if [ -z "$1" ]; then
    cat <<EOF
    dpatch-bootstrap [options] diff
    EOF
    fi

    IFS_SAVE="${IFS}"
    IFS='
    '

    DPB_PATCHNO=0
    DPB_PATCHDIR=debian/patches

    for f in $(zcat $1 | filterdiff -x '*/debian/*' | lsdiff --strip 1); do
    patch_name="$(printf "%03d" ${DPB_PATCHNO})_$(echo $f | sed -e "s,/,_,g" -e "s, ,_,g")"
    echo "Generating dpatch for $f in ${DPB_PATCHDIR}/${patch_name} ..."

    zcat $1 | filterdiff -p1 -i $f | dpatch patch-template --prepend ${patch_name} \
    "New patch generated for $f" \
    > "${DPB_PATCHDIR}/${DPB_PATCHNO}_${patch_name}.dpatch"
    DPB_PATCHNO=$(expr ${DPB_PATCHNO} + 1)
    done

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)