aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-01-09 10:49:31 +0100
committerMartin Braun <martin.braun@ettus.com>2015-01-09 10:49:31 +0100
commit6460ac1c3c3bf82e16f70dadff5e01211832c3ed (patch)
tree8c4c93990c91aa0b6287cc18de35e8cb5c382a29
parent1cc94c31ab990b667f572ef5ec2c6a9157bb16b6 (diff)
downloaduhd-6460ac1c3c3bf82e16f70dadff5e01211832c3ed.tar.gz
uhd-6460ac1c3c3bf82e16f70dadff5e01211832c3ed.tar.bz2
uhd-6460ac1c3c3bf82e16f70dadff5e01211832c3ed.zip
images: Updated image creation scripts to include .tar.gz and .tar.xz
-rwxr-xr-ximages/create_imgs_package.py8
-rwxr-xr-ximages/make_zip.sh22
2 files changed, 27 insertions, 3 deletions
diff --git a/images/create_imgs_package.py b/images/create_imgs_package.py
index 6b1d5580e..bdd4e7644 100755
--- a/images/create_imgs_package.py
+++ b/images/create_imgs_package.py
@@ -49,6 +49,10 @@ def parse_args():
help='Supply a commit message to the changes to host/CMakeLists.txt.')
parser.add_argument('-r', '--release-mode', default=None,
help='Specify UHD_RELEASE_MODE. Typically "release" or "rc1" or similar.')
+ parser.add_argument('--skip-edit', default=False, action='store_true',
+ help='Do not edit the CMakeLists.txt file.')
+ parser.add_argument('--skip-move', default=False, action='store_true',
+ help='Do not move the archives after creating them.')
return parser.parse_args()
def move_zip_to_repo(base_url, zipfilename):
@@ -69,7 +73,7 @@ def main():
os.chdir(uhdimgs.get_images_dir())
print "== Clearing out the images directory..."
clear_img_dir(img_root_dir)
- print "== Creating ZIP file..."
+ print "== Creating archives..."
cpack_cmd = ["./make_zip.sh",]
if args.release_mode is not None:
cpack_cmd.append(args.release_mode)
@@ -84,7 +88,7 @@ def main():
md5 = uhdimgs.md5_checksum(zipfilename)
print 'MD5: ', md5
base_url = uhdimgs.get_base_url()
- if uhdimgs.base_url_is_local(base_url) and os.access(base_url, os.W_OK):
+ if not args.skip_move and uhdimgs.base_url_is_local(base_url) and os.access(base_url, os.W_OK):
print "== Moving ZIP file to {0}...".format(base_url)
move_zip_to_repo(base_url, zipfilename)
print "== Updating CMakeLists.txt..."
diff --git a/images/make_zip.sh b/images/make_zip.sh
index f07507a94..19695ef3f 100755
--- a/images/make_zip.sh
+++ b/images/make_zip.sh
@@ -23,14 +23,34 @@ if [ -n "$TAGFILES" ]; then
rm $TAGFILES
fi
-# Run the CPack process:
+# Enter build dir
mkdir build
cd build
+
+# Run the CPack process (ZIP file)
cmake .. -DCPACK_GENERATOR=ZIP -DUHD_RELEASE_MODE="$1" ..
make package
mv uhd-images*.zip ..
+# Run the CPack process (tarball)
+cmake .. -DCPACK_GENERATOR=TGZ -DUHD_RELEASE_MODE="$1" ..
+make package
+mv uhd-images*.tar.gz ..
+
# Move images to here and clean up after us:
cd ..
rm -r build
rm images/*.tag
+
+TGZ_ARCHIVE_NAME=`ls *.tar.gz | tail -n1`
+
+# CMake can't do xz, so do it by hand if possible
+XZ_EXECUTABLE=`which xz`
+if [ $? -eq 0 ]; then
+ XZ_ARCHIVE_NAME=`echo $TGZ_ARCHIVE_NAME | sed "s/gz\>/xz/"`
+ echo "Writing .xz tarball to $XZ_ARCHIVE_NAME ..."
+ gunzip --to-stdout $TGZ_ARCHIVE_NAME | xz - > $XZ_ARCHIVE_NAME
+fi
+
+MD5_FILE_NAME=`echo $TGZ_ARCHIVE_NAME | sed "s/tar.gz\>/md5/"`
+md5sum uhd-images* > $MD5_FILE_NAME