exit if no new pkgs

This commit is contained in:
Daniel Langbein 2021-04-26 15:16:40 +02:00
parent 32c2181331
commit 2f1ed70cb1
2 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,7 @@
_pkgname=repo _pkgname=repo
_reponame=arch-pkg _reponame=arch-pkg
pkgname="de-p1st-$_pkgname" pkgname="de-p1st-$_pkgname"
pkgver=0.1.2 pkgver=0.1.3
pkgrel=1 pkgrel=1
pkgdesc="Bash script to manage remote Arch Linux repository" pkgdesc="Bash script to manage remote Arch Linux repository"
arch=('any') arch=('any')

View File

@ -10,6 +10,12 @@ cd "${LOCAL_PKG_DIR}" || exit
rsync --ignore-existing --out-format="%n" --dry-run \ rsync --ignore-existing --out-format="%n" --dry-run \
./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" > new-pkg.txt || exit ./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" > new-pkg.txt || exit
# if there are no new packages, exit
if [ ! -s new-pkg.txt ]; then
echo "No new packages.";
exit 0;
fi
# transfer new packages using rsync # transfer new packages using rsync
rsync --ignore-existing --progress --human-readable \ rsync --ignore-existing --progress --human-readable \