From 2f1ed70cb14b08188f7c51a65d9fd1a62c84192b Mon Sep 17 00:00:00 2001 From: langfingaz Date: Mon, 26 Apr 2021 15:16:40 +0200 Subject: [PATCH] exit if no new pkgs --- pkg/de-p1st-repo/PKGBUILD | 2 +- pkg/de-p1st-repo/arch-repo-push-new.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/de-p1st-repo/PKGBUILD b/pkg/de-p1st-repo/PKGBUILD index 9c3ab00..40b9974 100644 --- a/pkg/de-p1st-repo/PKGBUILD +++ b/pkg/de-p1st-repo/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=repo _reponame=arch-pkg pkgname="de-p1st-$_pkgname" -pkgver=0.1.2 +pkgver=0.1.3 pkgrel=1 pkgdesc="Bash script to manage remote Arch Linux repository" arch=('any') diff --git a/pkg/de-p1st-repo/arch-repo-push-new.sh b/pkg/de-p1st-repo/arch-repo-push-new.sh index 8332a3e..df7b7ed 100644 --- a/pkg/de-p1st-repo/arch-repo-push-new.sh +++ b/pkg/de-p1st-repo/arch-repo-push-new.sh @@ -10,6 +10,12 @@ cd "${LOCAL_PKG_DIR}" || exit rsync --ignore-existing --out-format="%n" --dry-run \ ./*.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 rsync --ignore-existing --progress --human-readable \