arch/pkg/de-p1st-repo/arch-repo-push-new.sh

25 lines
691 B
Bash
Raw Normal View History

2021-04-22 11:06:27 +02:00
#!/bin/bash
2021-04-22 11:11:46 +02:00
source /etc/de-p1st-repo/arch-repo.cfg || exit
2021-04-22 11:06:27 +02:00
2021-04-22 11:24:04 +02:00
2021-04-22 11:06:27 +02:00
cd "${LOCAL_PKG_DIR}" || exit
# get list of new packages, one package per line
rsync --ignore-existing --out-format="%n" --dry-run \
./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" > new-pkg.txt || exit
# transfer new packages using rsync
rsync --ignore-existing --progress --human-readable \
./*.pkg.tar.{xz,zst} "${REMOTE_SSH_HOST}":"${REMOTE_PKG_DIR}" || exit
2021-04-22 11:24:04 +02:00
2021-04-22 11:06:27 +02:00
# 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
2021-04-22 11:24:04 +02:00
ssh "${REMOTE_SSH_HOST}" "/usr/bin/arch-repo-receive-new"