From 9e294392d7bc088db0472499e3734d8676f4ae2a Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 19 Mar 2012 17:52:11 -0400 Subject: [PATCH] do the old directory cleanup before we unpack the new tree. This removes all the old clutter of previous nvr trees. --- kernel.spec | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/kernel.spec b/kernel.spec index c0c7c00ce..1e28ba9cb 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1171,6 +1171,21 @@ ApplyOptionalPatch() sharedirs=$(find "$PWD" -maxdepth 1 -type d -name 'kernel-3.*' \ | grep -x -v "$PWD"/kernel-%{kversion}%{?dist}) ||: +# Delete all old stale trees. +if [ -d kernel-%{kversion}%{?dist} ]; then + cd kernel-%{kversion}%{?dist} + for i in linux-* + do + # Just in case we ctrl-c'd a prep already + rm -rf deleteme.%{_target_cpu} + # Move away the stale away, and delete in background. + mv $i deleteme-$i + rm -rf deleteme* & + done + cd .. +fi + +# Generate new tree if [ ! -d kernel-%{kversion}%{?dist}/vanilla-%{vanillaversion} ]; then if [ -d kernel-%{kversion}%{?dist}/vanilla-%{kversion} ]; then @@ -1247,14 +1262,6 @@ else fi # Now build the fedora kernel tree. -if [ -d linux-%{KVERREL} ]; then - # Just in case we ctrl-c'd a prep already - rm -rf deleteme.%{_target_cpu} - # Move away the stale away, and delete in background. - mv linux-%{KVERREL} deleteme.%{_target_cpu} - rm -rf deleteme.%{_target_cpu} & -fi - cp -rl vanilla-%{vanillaversion} linux-%{KVERREL} cd linux-%{KVERREL}