1
0
mirror of https://github.com/moparisthebest/arch-ppa synced 2024-11-24 01:22:18 -05:00

Script fixes

This commit is contained in:
Travis Burtrum 2016-11-05 01:28:10 -04:00
parent 190707f9af
commit a3c56c41af

View File

@ -96,7 +96,8 @@ sign_packages() {
set -e
cd $(dirname $1)
for pkg in "$@"; do
gpg --detach-sign --use-agent $pkg
rm -f "${pkg}.sig"
gpg -u 'ECB9B8CBAAC68C03!' --detach-sign --use-agent $pkg
done
)
}
@ -197,20 +198,27 @@ setup() {
clean() {
(
set -e
if [ "$#" -lt 1 ]; then
echo "Must specify repository names to clean"
return 1
fi
for repo in "$@"; do
# Clean repository and chroot
if [ -d $basedir/chroot/$repo ]; then
exe sudo rm -rf $basedir/chroot/$repo $basedir/chroot/$repo.lock
fi
if [ -d $basedir/$repo ]; then
exe rm -rf $basedir/$repo
fi
done
set -e
if [ "$#" -lt 1 ]; then
echo "Must specify repository names to clean"
return 1
fi
for repo in "$@"; do
# Clean repository and chroot
if [ -d $basedir/chroot/$repo ]; then
# Test if chroot uses BTRFS and remove using btrfs subvolume delete
if [ `stat --format=%i $basedir/chroot/$repo` -eq 256 ] && [ `stat -f --format=%T $basedir/chroot/$repo` ] ; then
exe sudo btrfs subvolume delete $basedir/chroot/$repo
exe sudo rm $basedir/chroot/$repo.lock
# Otherwise delete using rm
else
exe sudo rm -rf $basedir/chroot/$repo $basedir/chroot/$repo.lock
fi
fi
if [ -d $basedir/$repo ]; then
exe rm -rf $basedir/$repo
fi
done
)
}