Browse Source

kek

master
Fleshless Builder 4 years ago
parent
commit
c2b5d134a4
4 changed files with 52 additions and 9 deletions
  1. +2
    -7
      post-receive
  2. +2
    -1
      repo-clean
  3. +48
    -0
      repo-maintenance
  4. +0
    -1
      repo-sign

+ 2
- 7
post-receive View File

@ -8,10 +8,5 @@ self_url="https://pkg.fleshless.org/$self"
spark_repo=$(<spark.repo)
spark_repo_path="$HOME/public/$spark_repo"
suex makepkg-overlay "$self_url" "$spark_repo_path"
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"
suex makepkg-overlay "$self_url" "$spark_repo_path/import"
repo-maintenance "$spark_repo"

+ 2
- 1
repo-clean View File

@ -34,6 +34,7 @@ _pacsort() {
while (( $# )); do
case "$1" in
-r) flag_rm=1;;
-d) flag_debug=1;;
esac
shift
done
@ -59,7 +60,7 @@ done
for f in ${package_files[@]}; do
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
printf 'Removing: %s\n' "$f"


+ 48
- 0
repo-maintenance 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

+ 0
- 1
repo-sign View File

@ -11,5 +11,4 @@ done
for i in "${unsigned_pkgs[@]}"; do
echo $i
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

Loading…
Cancel
Save