Move application of kernel config after "make mrproper" as that deletes .config ...
authorSebastian Pipping <sebastian@pipping.org>
Thu, 20 Jan 2011 00:53:37 +0000 (01:53 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Thu, 20 Jan 2011 00:56:46 +0000 (01:56 +0100)
ChangeLog
gen_configkernel.sh

index 4d3186924590cb92a0f5bbffbb452d641e3f4239..686fcc38fc77a1f4e4884f2baac1f4061d243425 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  20 Jan 2011; Sebastian Pipping <sping@gentoo.org> gen_configkernel.sh:
+  Move application of kernel config after "make mrproper" as that deletes
+  .config (whereas "make clean" does not) (bug #351906)
+
   16 Jan 2011; Sebastian Pipping <sping@gentoo.org> genkernel:
   Bump version to 3.4.11
 
index e5aa023c2cf4f8c0c7fb8d5504e2361d5709c137..f4db0e3dc899a1cd5fcc90a4e6ddff03f61e29a8 100755 (executable)
@@ -29,8 +29,8 @@ config_kernel() {
        determine_config_file
        cd "${KERNEL_DIR}" || gen_die 'Could not switch to the kernel directory!'
 
-       # Backup and replace kernel .config
-       if isTrue "${CLEAN}" || [ ! -f "${KERNEL_DIR}/.config" ]
+       # Backup current kernel .config
+       if isTrue "${MRPROPER}" || [ ! -f "${KERNEL_DIR}/.config" ]
        then
                print_info 1 "config: Using config from ${KERNEL_CONFIG}"
                if [ -f "${KERNEL_DIR}/.config" ]
@@ -40,7 +40,6 @@ config_kernel() {
                                        || gen_die "Could not backup kernel config (${KERNEL_DIR}/.config)"
                        print_info 1 "        Previous config backed up to .config${NOW}.bak"
                fi
-               cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!'
        fi
 
        if isTrue ${MRPROPER}
@@ -51,8 +50,12 @@ config_kernel() {
                print_info 1 "config: --no-mrproper is enabled; not running 'make mrproper'."
        fi
 
-       # If we're not cleaning, then we don't want to try to overwrite the configs
+       # If we're not cleaning a la mrproper, then we don't want to try to overwrite the configs
        # or we might remove configurations someone is trying to test.
+       if isTrue "${MRPROPER}" || [ ! -f "${KERNEL_DIR}/.config" ]
+       then
+               cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could not copy configuration file!'
+       fi
 
        if isTrue "${OLDCONFIG}"
        then