summaryrefslogtreecommitdiff
path: root/util/make_release.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/make_release.py')
-rwxr-xr-xutil/make_release.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/util/make_release.py b/util/make_release.py
index d1161166d..f07bafe3b 100755
--- a/util/make_release.py
+++ b/util/make_release.py
@@ -80,18 +80,31 @@ if len(sys.argv) != 3:
destdir = sys.argv[1]
releasename = sys.argv[2]
+release_dest = joinpath(destdir, 'release')
+encumbered_dest = joinpath(destdir, 'encumbered')
+release_dir = joinpath(release_dest, releasename)
+encumbered_dir = joinpath(encumbered_dest, releasename)
if exists(destdir):
if not isdir(destdir):
raise AttributeError, '%s exists, but is not a directory' % destdir
- rmtree(destdir)
-
-release_dir = joinpath(destdir, 'release', releasename)
-encumbered_dir = joinpath(destdir, 'encumbered', releasename)
-
-mkdir(destdir)
-mkdir(destdir, 'release')
-mkdir(destdir, 'encumbered')
+else:
+ mkdir(destdir)
+
+if exists(release_dest):
+ if not isdir(release_dest):
+ raise AttributeError, \
+ '%s exists, but is not a directory' % release_dest
+ rmtree(release_dest)
+
+if exists(encumbered_dest):
+ if not isdir(encumbered_dest):
+ raise AttributeError, \
+ '%s exists, but is not a directory' % encumbered_dest
+ rmtree(encumbered_dest)
+
+mkdir(release_dest)
+mkdir(encumbered_dest)
mkdir(release_dir)
mkdir(encumbered_dir)
@@ -109,7 +122,6 @@ rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.cc')
rmtree(release_dir, 'src/mem/cache/prefetch/ghb_*.hh')
rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.cc')
rmtree(release_dir, 'src/mem/cache/prefetch/stride_*.hh')
-rmtree(release_dir, 'src/oldmem')
rmtree(release_dir, 'configs/fullsys')
rmtree(release_dir, 'configs/test')
rmtree(release_dir, 'configs/splash2')