1
0
Fork 0
mirror of https://github.com/Luzifer/archrepo.git synced 2024-12-30 01:41:23 +00:00

Add a "build-cache" not to re-build packages on every run

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-07-20 00:49:49 +02:00
parent e0dd7dc6ca
commit 4ffb9da917
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 13 additions and 0 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
*.db.sig *.db.sig
*.files *.files
*.files.sig *.files.sig
.repo_cache
*.tar.xz *.tar.xz
*.tar.xz.sig *.tar.xz.sig
*.tar.zst *.tar.zst

View file

@ -8,6 +8,13 @@ REPO_DIR=${REPO_DIR:-$(pwd)}
REPO=${1:-} REPO=${1:-}
[ -z "${REPO}" ] && fail "No repo given as CLI argument" [ -z "${REPO}" ] && fail "No repo given as CLI argument"
step "Checking for changes from last build"
last_remote_hash=$(git ls-remote ${REPO} master | awk '{print $1}')
grep "${REPO}#${last_remote_hash}" .repo_cache && {
warn "Remote has no changes from last build, skipping..."
exit 0
} || true
# Create working dir # Create working dir
TMPDIR="/tmp/aur2repo_$(basename ${REPO})" TMPDIR="/tmp/aur2repo_$(basename ${REPO})"
mkdir -p "${TMPDIR}/cfg" mkdir -p "${TMPDIR}/cfg"
@ -32,3 +39,8 @@ docker run --rm -ti \
-v "$(pwd)/scripts/pacman.conf:/etc/pacman.conf:ro" \ -v "$(pwd)/scripts/pacman.conf:/etc/pacman.conf:ro" \
luzifer/arch-repo-builder \ luzifer/arch-repo-builder \
"${REPO}" "${REPO}"
step "Updating cache entry"
grep -v "^${REPO}#" .repo_cache >.repo_cache.tmp || true
echo "${REPO}#${last_remote_hash}" >>.repo_cache.tmp
mv .repo_cache.tmp .repo_cache