This commit is contained in:
Fleshless Builder 2017-11-20 05:45:42 +03:00
parent 8d262d67be
commit c2b5d134a4
4 changed files with 52 additions and 9 deletions

View File

@ -8,10 +8,5 @@ self_url="https://pkg.fleshless.org/$self"
spark_repo=$(<spark.repo) spark_repo=$(<spark.repo)
spark_repo_path="$HOME/public/$spark_repo" spark_repo_path="$HOME/public/$spark_repo"
suex makepkg-overlay "$self_url" "$spark_repo_path" suex makepkg-overlay "$self_url" "$spark_repo_path/import"
repo-maintenance "$spark_repo"
cd "$spark_repo_path"
"$HOME/scripts/repo-sign" &> "$HOME/log/repo-sign.$spark_repo.log"
"$HOME/scripts/repo-clean" &> "$HOME/log/repo-clean.$spark_repo.log"
repo-add -n "$spark_repo.db.tar.gz" *.pkg.tar.xz &> "$HOME/log/repo-add.$spark_repo.log"

View File

@ -34,6 +34,7 @@ _pacsort() {
while (( $# )); do while (( $# )); do
case "$1" in case "$1" in
-r) flag_rm=1;; -r) flag_rm=1;;
-d) flag_debug=1;;
esac esac
shift shift
done done
@ -59,7 +60,7 @@ done
for f in ${package_files[@]}; do for f in ${package_files[@]}; do
if is_latest "$f"; then if is_latest "$f"; then
printf '%s is the latest version available\n' "$f" (( flag_debug )) && printf '%s is the latest version available\n' "$f"
else else
printf 'Removing: %s\n' "$f" printf 'Removing: %s\n' "$f"

48
repo-maintenance Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
shopt -s nullglob
lockfile='.mainenance.lock'
usage() { echo "$0 <repo_name>"; }
spark_repo=$1
[[ "$spark_repo" ]] || {
usage
exit 1
}
cleanup() { rm -f "$lockfile"; }
lock() {
[[ -f "$lockfile" ]] && {
printf 'Lockfile found: %s\n' "$lockfile" >&2
return 1
}
echo $$ > "$lockfile"
lock_pid=$(<"$lockfile")
[[ $$ == "$lock_pid" ]] || return 1
}
cd "$HOME/public/$spark_repo" || exit $?
lock || exit 1
trap cleanup EXIT
for f in import/*; do
f_name="${f##*/}"
if [[ -f "$f_name" ]]; then
printf 'Package already exists: %s, not overwriting\n' "$f_name" >&2
else
mv -vf "$f" ./
new_pkgs+=( "$f_name" )
fi
done
repo-sign
repo-clean
for p in "${new_pkgs[@]}"; do
repo-add -n "$spark_repo.db.tar.gz" "$p"
done

View File

@ -11,5 +11,4 @@ done
for i in "${unsigned_pkgs[@]}"; do for i in "${unsigned_pkgs[@]}"; do
echo $i echo $i
gpg --pinentry-mode loopback --passphrase-fd 0 --batch --no-tty --detach-sign --no-armor "$i" < ~/.gnupg/passphrase gpg --pinentry-mode loopback --passphrase-fd 0 --batch --no-tty --detach-sign --no-armor "$i" < ~/.gnupg/passphrase
#gpg --batch --no-tty --detach-sign --no-armor "$i"
done done