Update of /cvsroot/devil-linux/build/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23826/scripts
Modified Files:
patch-o-matic
Log Message:
patch-o-matic improvements
Index: patch-o-matic
===================================================================
RCS file: /cvsroot/devil-linux/build/scripts/patch-o-matic,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- patch-o-matic 11 Apr 2004 11:58:52 -0000 1.21
+++ patch-o-matic 12 Apr 2004 21:27:15 -0000 1.22
@@ -26,7 +26,7 @@
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
NETFILTERDIR=$(find_src_dir iptables)
export NETFILTERDIR
@@ -36,29 +36,47 @@
# patchs to exclude, eg. because of creating troubles
# (none at the moment)
- # eg. EXCLUDE_PATCHES="dir/patchname"
+ # eg. EXCLUDE_PATCHES="${EXCLUDE_PATCHES} dir/patchname.patch"
- if [ "$CONFIG_NF_BASE" = "y" ]; then
- EXCLUDE_PATCHES="$EXCLUDE_PATCHES base/set" # breaks iptables totally
- EXCLUDE_PATCHES="$EXCLUDE_PATCHES base/dstlimit" # extension is broken
- EXCLUDE_PATCHES="$EXCLUDE_PATCHES base/osf" # extension is broken
- PATCHES="$PATCHES base";
- fi
- [ "$CONFIG_NF_EXTRA" = "y" ] && \
- PATCHES="$PATCHES $(sed -e "/^$/d" -e "/^ \+$/d" -e "/^ \+$/d" -e "/^#/d" $MYDIR/config/config-netfilter-extra)"
+ [ "$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 and taking care
+ ## 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 \
- submitted \
- pending \
- optimizations \
- $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 tristate $KERNELDIR/net/ipv4/netfilter/Config.in | cut -d "'" -f 3 | cut -d " " -f 2 ); do
set_kernel_option $CFG m
|