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