From: Friedrich L. <fr...@us...> - 2004-04-12 21:49:18
|
Update of /cvsroot/devil-linux/build/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25499/scripts Modified Files: Tag: rel-1-0-patches patch-o-matic Log Message: patch-o-matic improvements (backported from 1.1.x) Index: patch-o-matic =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/patch-o-matic,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -d -r1.8.2.1 -r1.8.2.2 --- patch-o-matic 6 Apr 2004 23:33:59 -0000 1.8.2.1 +++ patch-o-matic 12 Apr 2004 21:35:10 -0000 1.8.2.2 @@ -17,27 +17,60 @@ case $1 in build ) echo "no extra patches" > $WORKDIR/netfilter.patches.lst - if [ "$CONFIG_NF_PENDING" = "y" ]; then + if [ "$CONFIG_NF_PATCHES" = "y" ]; then export KERNEL_DIR=$KERNELDIR - - # move troublesome patches away - mkdir -p submitted/tmp - mkdir -p pending/tmp - mv -f submitted/45_masq_routing_check* submitted/73_ipt_MASQUERADE-oif* submitted/tmp &> /dev/null - mv -f pending/40_nf-log* pending/tmp &> /dev/null + NETFILTERDIR=$(find_src_dir iptables) + export NETFILTERDIR PATCHES=""; - [ "$CONFIG_NF_BASE" = "y" ] && \ - PATCHES="$PATCHES base"; - [ "$CONFIG_NF_EXTRA" = "y" ] && \ + EXCLUDE_PATCHES=""; + + # patchs to exclude, eg. because of creating troubles + # (none at the moment) + # eg. EXCLUDE_PATCHES="dir/patchname" + EXCLUDE_PATCHES="${EXCLUDE_PATCHES} submitted/45_masq_routing_check" + EXCLUDE_PATCHES="${EXCLUDE_PATCHES} submitted/73_ipt_MASQUERADE-oif" + EXCLUDE_PATCHES="${EXCLUDE_PATCHES} pending/40_nf-log" + + [ "$CONFIG_NF_SUBMITTED" = "y" ] && \ + PATCHES="$PATCHES submitted" + + [ "$CONFIG_NF_PENDING" = "y" ] && [ "$CONFIG_NF_SUBMITTED" = "y" ] && \ + PATCHES="$PATCHES pending" + + [ "$CONFIG_NF_OPTIMIZATION" = "y" ] && [ "$CONFIG_NF_SUBMITTED" = "y" ] && [ "$CONFIG_NF_PENDING" = "y" ] && \ + PATCHES="$PATCHES optimizations" + + [ "$CONFIG_NF_BASE" = "y" ] && [ "$CONFIG_NF_SUBMITTED" = "y" ] && [ "$CONFIG_NF_PENDING" = "y" ] && \ + PATCHES="$PATCHES $(sed -e "/^$/d" -e "/^ \+$/d" -e "/^ \+$/d" -e "/^#/d" $MYDIR/config/config-netfilter-base)" + + [ "$CONFIG_NF_EXTRA" = "y" ] && [ "$CONFIG_NF_SUBMITTED" = "y" ] && [ "$CONFIG_NF_PENDING" = "y" ] && \ PATCHES="$PATCHES $(sed -e "/^$/d" -e "/^ \+$/d" -e "/^ \+$/d" -e "/^#/d" $MYDIR/config/config-netfilter-extra)" + + # reformat to fit as commandline option to runme + EXCLUDE=""; for P in $EXCLUDE_PATCHES; do + EXCLUDE="$EXCLUDE --exclude $P"; done - # now apply all patches at once - ./runme --batch \ - submitted \ - pending \ - optimizations \ - $PATCHES + ## create a temp file were we store the output of patch-o-matic + ## [we do not have mktemp, so do it the simple unsecure way] + #TMPFILE=$(mktemp -q /tmp/${0##*/}.XXXXXX) + #if [ $? -ne 0 ]; then + # echo "$0: Can't create temp file, exiting..." + # exit 1 + #fi + TMPFILE=/tmp/${0##*/}.$$ + + # now apply all patches at once and take care + # to exclude troublesome patches + ./runme --batch $EXCLUDE $PATCHES >$TMPFILE 2>&1 + + if ! grep -q "Kernel is now ready for compilation." $TMPFILE; then + echo "Patch-O-Matic failed applying the patches." 1>&2 + echo "See $TMPFILE for details" 1>&2 + exit 1 + fi + + cat $TMPFILE; rm -f $TMPFILE for CFG in $( grep dep_tristate $KERNELDIR/net/ipv4/netfilter/Config.in | cut -d "'" -f 3 | cut -d " " -f 2 ); do echo "$CFG=m" >> $KERNELDIR/.config |