diff options
author | Dave Jones <davej@redhat.com> | 2012-03-19 17:52:11 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2012-03-19 17:52:11 -0400 |
commit | 9e294392d7bc088db0472499e3734d8676f4ae2a (patch) | |
tree | 07a8fde01fdaada264b54116dd9e0655cac8cac9 | |
parent | 1dc056eba6eca3b39ff7eb8b029cc88948b10dd0 (diff) | |
download | kernel-9e294392d7bc088db0472499e3734d8676f4ae2a.tar.gz kernel-9e294392d7bc088db0472499e3734d8676f4ae2a.tar.xz kernel-9e294392d7bc088db0472499e3734d8676f4ae2a.zip |
do the old directory cleanup before we unpack the new tree.
This removes all the old clutter of previous nvr trees.
-rw-r--r-- | kernel.spec | 23 |
1 files 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} |