mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
fix
This commit is contained in:
parent
63605427bb
commit
1e30814614
@ -2,8 +2,8 @@
|
||||
_pkgname=repo
|
||||
_reponame=arch
|
||||
pkgname="de-p1st-$_pkgname"
|
||||
pkgver=0.2.0
|
||||
pkgrel=2
|
||||
pkgver=0.2.1
|
||||
pkgrel=1
|
||||
pkgdesc="Bash script to manage remote Arch Linux repository"
|
||||
arch=('any')
|
||||
url="https://codeberg.org/privacy1st/${_reponame}"
|
||||
|
@ -3,7 +3,7 @@
|
||||
source /etc/de-p1st-repo/arch-repo.cfg || exit
|
||||
|
||||
function main() {
|
||||
cd "${LOCAL_PKG_DIR}" || exit
|
||||
cd "${LOCAL_PKG_DIR}" || return $?
|
||||
|
||||
# check if at least one matching file exists
|
||||
match="0"
|
||||
@ -17,7 +17,7 @@ function main() {
|
||||
|
||||
if [ "$match" = "0" ]; then
|
||||
echo "There are no local packages"
|
||||
exit 0
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
@ -25,26 +25,26 @@ function main() {
|
||||
# Enable nullglob for the case that e.g. just *.zst but not *.xz packages exist.
|
||||
shopt -s nullglob
|
||||
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 || return $?
|
||||
|
||||
# if there are no new packages to push/synchronize, then exit
|
||||
# if there are no new packages to push/synchronize, then return
|
||||
if [ ! -s new-pkg.txt ]; then
|
||||
echo "No new packages.";
|
||||
exit 0;
|
||||
return 0;
|
||||
fi
|
||||
|
||||
|
||||
# transfer new packages using rsync
|
||||
rsync --ignore-existing --progress --human-readable \
|
||||
./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit
|
||||
./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || return $?
|
||||
|
||||
# transfer new-pkg.txt
|
||||
rsync --ignore-times --checksum --progress --human-readable \
|
||||
new-pkg.txt "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit
|
||||
new-pkg.txt "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || return $?
|
||||
|
||||
|
||||
# add each new package to database
|
||||
ssh "${REMOTE_SSH_HOST}" "/usr/bin/arch-repo-receive-new" || exit
|
||||
ssh "${REMOTE_SSH_HOST}" "/usr/bin/arch-repo-receive-new" || return $?
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user