[patch] preserve symlinked .configs

Andrew Morton (andrewm@uow.edu.au)
Thu, 17 May 2001 22:01:33 +1000


When one has several machines it is nice to keep each
machine's .config under revision control. Then, on
each machine,

ln [-s] .config-$(hostname -s) .config

Problem is, `make menuconfig/oldconfig/config' goes and
removes your link, causing much irritation.

--- linux-2.4.4-ac9/scripts/Configure Sun Dec 31 13:16:13 2000
+++ ac/scripts/Configure Sun May 6 09:40:25 2001
@@ -566,9 +566,10 @@

rm -f .config.old
if [ -f .config ]; then
- mv .config .config.old
+ cp .config .config.old
fi
-mv .tmpconfig .config
+cp .tmpconfig .config
+rm .tmpconfig
mv .tmpconfig.h include/linux/autoconf.h

echo
--- linux-2.4.4-ac9/scripts/Menuconfig Tue May 15 14:11:09 2001
+++ ac/scripts/Menuconfig Wed May 9 11:33:30 2001
@@ -1290,12 +1290,12 @@

if [ -f "$DEF_CONFIG" ]
then
- rm -f ${DEF_CONFIG}.old
- mv $DEF_CONFIG ${DEF_CONFIG}.old
+ cp $DEF_CONFIG ${DEF_CONFIG}.old
fi

- mv $CONFIG $DEF_CONFIG
-
+ cp $CONFIG $DEF_CONFIG
+ rm $CONFIG
+
return 0
else
return 1

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/