uhd/images/make_zip.sh
Martin Braun 174bde6cc1 images: Update scripts for new release model
- populate_images.py: Made Py3k safe
- uhdimgs.py: Make Py3k-safe
- create_imgs_package.py: Rewrote to build release images packages
- make_zip.sh: Skip CMake, just zip up the files
- Updated README to reflect all the changes
2018-05-17 14:09:47 -07:00

41 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Automatically run the make-zip-file process
# Check we're in the right directory and all is set:
if [ ! -e 'make_zip.sh' ]; then
echo '[ERROR] Are you running this from the images/ directory?'
exit 1
fi
if [ ! -e 'images' ]; then
echo 'images subdirectory does not exist. Please create it and put all the images you want to package in there.'
exit 1
fi
# Remove cruft before proceeding:
TAGFILES=`ls images/*.tag 2>/dev/null`
if [ -n "$TAGFILES" ]; then
rm $TAGFILES
fi
# Copy LICENSE file
cp ../host/LICENSE images/
ARCHIVE_SUFFIX=$1
ARCHIVE_NAME="uhd-images_${ARCHIVE_SUFFIX}"
echo "Creating images archive: ${ARCHIVE_NAME}"
cp -r images $ARCHIVE_NAME
# Now zip 'em up:
echo "Creating ZIP archive..."
zip -r $ARCHIVE_NAME.zip $ARCHIVE_NAME
echo "Creating tar.gz archive..."
tar zcvf $ARCHIVE_NAME.tar.gz $ARCHIVE_NAME
echo "Creating tar.xz archive..."
tar Jcvf $ARCHIVE_NAME.tar.xz $ARCHIVE_NAME
ALL_ARCHIVES=`ls $ARCHIVE_NAME.*`
sha256sum $ALL_ARCHIVES > $ARCHIVE_NAME.sha256
md5sum $ALL_ARCHIVES > $ARCHIVE_NAME.md5
# Clean up archive directory
rm -r $ARCHIVE_NAME