Skip to content

Commit

Permalink
Update srcinfo.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
oklopfer authored May 3, 2024
1 parent 42fac04 commit e2fc3a3
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/srcinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,44 @@ jobs:

- name: Fetch
run: |
wget https://raw.githubusercontent.com/oklopfer/debs/master/misc/srcinfo.sh
sudo chmod +x ./srcinfo.sh
function srcinfo() {
local CARCH='${CARCH}' DISTRO='${DISTRO}' src sum vars a_sum var ar car \
known_hashsums_src=("b2" "sha512" "sha384" "sha256" "sha224" "sha1" "md5") \
known_archs_src=("amd64" "arm64" "armel" "armhf" "i386" "mips64el" "ppc64el" "riscv64" "s390x") \
allvars=("pkgname" "gives" "pkgver" "pkgrel" "epoch" "pkgdesc" "url" "priority") \
allars=("source" "depends" "makedepends" "checkdepends" "optdepends" "pacdeps" "conflicts" "breaks" \
"replaces" "provides" "arch" "incompatible" "compatible" "backup" "mask" "noextract" "nosubmodules" "license")
source ${1}
for src in "${known_archs_src[@]}"; do
for vars in {source,depends,makedepends,optdepends,pacdeps,checkdepends,provides,conflicts,breaks,replaces}; do
allars+=("${vars}_${src}")
done
allvars+=("gives_${src}")
done
for sum in "${known_hashsums_src[@]}"; do
allars+=("${sum}sums")
for a_sum in "${known_archs_src[@]}"; do
allars+=("${sum}sums_${a_sum}")
done
done
for var in "${allvars[@]}"; do
[[ -n ${!var} ]] && echo "${var}=\"${!var}\""
done
for ar in "${allars[@]}"; do
[[ -n ${!ar} ]] && declare -p ${ar} | sed -e 's|\\||g'
done
unset "${allars[@]}" "${allvars[@]}"
}
- name: Run
run: |
for i in $(git diff HEAD~1 --name-only | grep -E '^packages/[^/]+/[^/]+\.pacscript$'); do
./srcinfo.sh "$i" | tee ${i%/*.pacscript}/.SRCINFO > /dev/null
srcinfo "$i" | tee ${i%/*.pacscript}/.SRCINFO > /dev/null
done
rm ./srcinfo.sh
- name: Push
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git add .
git commit -m "update .SRCINFO" && git push origin HEAD:master || echo "Nothing to push."
git commit -m "update \`.SRCINFO\` data" && git push origin HEAD:master || echo "Nothing to push."

0 comments on commit e2fc3a3

Please sign in to comment.