mirror of
https://github.com/Luzifer/archrepo.git
synced 2024-12-20 13:11:17 +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:
parent
e0dd7dc6ca
commit
4ffb9da917
2 changed files with 13 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
*.db.sig
|
||||
*.files
|
||||
*.files.sig
|
||||
.repo_cache
|
||||
*.tar.xz
|
||||
*.tar.xz.sig
|
||||
*.tar.zst
|
||||
|
|
|
@ -8,6 +8,13 @@ REPO_DIR=${REPO_DIR:-$(pwd)}
|
|||
REPO=${1:-}
|
||||
[ -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
|
||||
TMPDIR="/tmp/aur2repo_$(basename ${REPO})"
|
||||
mkdir -p "${TMPDIR}/cfg"
|
||||
|
@ -32,3 +39,8 @@ docker run --rm -ti \
|
|||
-v "$(pwd)/scripts/pacman.conf:/etc/pacman.conf:ro" \
|
||||
luzifer/arch-repo-builder \
|
||||
"${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
|
||||
|
|
Loading…
Reference in a new issue