File:  [Local Repository] / SSHFS-Mountlet / create_dmg
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Wed May 15 01:42:19 2024 UTC (6 weeks, 5 days ago) by adi
Branches: MAIN
CVS tags: HEAD
automate deleting of CVS dirs and .DS_Store

#!/bin/bash

# go home
PWD="$(pwd)"
cd "$(dirname "${BASH_SOURCE[0]}")"
if [ $? -ne 0 ]; then echo "Can't go home." && exit 1; fi

# set DMG name
sshfs_mountlet_dmg="sshfs-mountlet_v$(grep -m 1 "VERSION=" SSHFS-Mountlet/src/sshfs-mountlet | sed -e "s/^.*VERSION=\"//" -e "s/\"$//").dmg"

# create dist directory
if [ ! -e dist ]; then
	mkdir dists
fi

# remove existing DMG of same version
if [ -e "dist/$sshfs_mountlet_dmg" ]; then
	rm "dist/$sshfs_mountlet_dmg"
fi

# delete CVS dirs
if [ ! -e .orig ]; then
    find SSHFS-Mountlet -type d -name CVS -exec rm -fr {} \;
    find SSHFS-Mountlet -type f -name .DS_Store -delete
fi

# create DMG
hdiutil create "dist/$sshfs_mountlet_dmg" -volname SSHFS-Mountlet -fs HFS+ -srcfolder SSHFS-Mountlet

# relink
cd dist
rm changelog README license.txt
ln ../SSHFS-Mountlet/changelog
ln ../SSHFS-Mountlet/README
ln ../SSHFS-Mountlet/license.txt

# calculate sha256 sums
if [ -e "sha256" ]; then
	rm sha256
fi
shasum -a 256 * > sha256

cd "$PWD"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>