From a6b68fe752f72fc3c5553baa6c73c6be9e9e93ca Mon Sep 17 00:00:00 2001 From: langfingaz Date: Thu, 22 Apr 2021 11:24:04 +0200 Subject: [PATCH] fix --- pkg/de-p1st-repo/PKGBUILD | 2 +- pkg/de-p1st-repo/arch-repo-push-new.sh | 5 ++++- pkg/de-p1st-repo/arch-repo-receive-new.sh | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/de-p1st-repo/PKGBUILD b/pkg/de-p1st-repo/PKGBUILD index 1e6aef1..ad2d116 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.0.3 +pkgver=0.0.4 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 55d7ff5..cda7021 100644 --- a/pkg/de-p1st-repo/arch-repo-push-new.sh +++ b/pkg/de-p1st-repo/arch-repo-push-new.sh @@ -3,6 +3,7 @@ source /etc/de-p1st-repo/arch-repo.cfg || exit + cd "${LOCAL_PKG_DIR}" || exit # get list of new packages, one package per line @@ -13,9 +14,11 @@ rsync --ignore-existing --out-format="%n" --dry-run \ rsync --ignore-existing --progress --human-readable \ ./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit + + # transfer new-pkg.txt rsync --ignore-times --checksum --progress --human-readable \ new-pkg.txt "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit # add each new package to database -ssh "${REMOTE_SSH_HOST}" "/home/yoda/arch-repo-receive-new.sh" +ssh "${REMOTE_SSH_HOST}" "/usr/bin/arch-repo-receive-new" diff --git a/pkg/de-p1st-repo/arch-repo-receive-new.sh b/pkg/de-p1st-repo/arch-repo-receive-new.sh index 4b1b251..38fd0e9 100644 --- a/pkg/de-p1st-repo/arch-repo-receive-new.sh +++ b/pkg/de-p1st-repo/arch-repo-receive-new.sh @@ -3,10 +3,13 @@ source /etc/de-p1st-repo/arch-repo.cfg || exit + # # add new packages to database # function add_to_db(){ + echo "Adding new packages to db ..." + mapfile -t PKGS < <(cat new-pkg.txt) for PKG in "${PKGS[@]}"; do repo-add -n "${REMOTE_DB_NAME}.db.tar.gz" "${PKG}" || exit @@ -14,10 +17,13 @@ function add_to_db(){ } + # # generate index.html # function generate_index(){ + echo "Generating index.html with links to all packages ..." + echo ' @@ -37,6 +43,7 @@ function generate_index(){ } + cd "${REMOTE_PKG_DIR}" || exit add_to_db generate_index