From 6ab3f17aa9cc512db8e643014cf5a3051f5587bd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 28 Sep 2018 17:39:19 +0200 Subject: lib/common-functions: append lib/PKGBUILD-appendix-for-archive-server to PKGBUILD - retrieve kernel git repository snapshot from our archive server instead of cloning the git repository --- lib/common-functions | 2 ++ misc/PKGBUILD-appendix-for-archive-server | 32 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 misc/PKGBUILD-appendix-for-archive-server diff --git a/lib/common-functions b/lib/common-functions index 34a3bf6..e9585a4 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -499,6 +499,8 @@ extract_source_directory() { tar -x --strip-components=3 -C "${output}" printf '\n' >> \ "${output}/PKGBUILD" + cat "${base_dir}/misc/PKGBUILD-appendix-for-archive-server" >> \ + "${output}/PKGBUILD" fi if [ -n "${PKGBUILD_mod}" ]; then diff --git a/misc/PKGBUILD-appendix-for-archive-server b/misc/PKGBUILD-appendix-for-archive-server new file mode 100644 index 0000000..3fcb5ba --- /dev/null +++ b/misc/PKGBUILD-appendix-for-archive-server @@ -0,0 +1,32 @@ +for ((i=0; i<${#source[@]}; i++)); do + infos=$( + printf '%s\n' "${source[${i}]}" | \ + sed -n ' + s@^\([^:]\+\)::git+\(https://git\.archlinux\.org/linux.git\)?\(signed\)#\(tag=\S\+\)$@\1 \2 \3 \4@ + T + p + ' + ) + if [ -n "${infos}" ]; then + source[${i}]=$( + printf '%s.tar.gz::https://archive-server.archlinux32.org/?p=' \ + "${infos%% *}" + printf '%s/' "${infos%% *}" | \ + base64 -w0 | \ + sed 's/=/%3D/g' + printf '&r=' + infos="${infos#* }" + printf '%s' "${infos%% *}" | \ + base64 -w0 | \ + sed 's/=/%3D/g' + infos="${infos#* }" + if [ "${infos%% *}" = 'signed' ]; then + infos="${infos#* }" + printf '&valid_keys=' + printf '%s,' "${validpgpkeys[@]}" | \ + sed 's/,$//' + fi + printf '&%s\n' "${infos}" + ) + fi +done -- cgit v1.2.3-70-g09d2 From 3e60f5296f151bb1df0757c99590ace75e6c65e4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 28 Sep 2018 19:30:05 +0200 Subject: misc/PKGBUILD-appendix-for-archive-server: replace all linux* git repositories by tarballs --- misc/PKGBUILD-appendix-for-archive-server | 64 +++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/misc/PKGBUILD-appendix-for-archive-server b/misc/PKGBUILD-appendix-for-archive-server index 3fcb5ba..b2bdf79 100644 --- a/misc/PKGBUILD-appendix-for-archive-server +++ b/misc/PKGBUILD-appendix-for-archive-server @@ -2,31 +2,63 @@ for ((i=0; i<${#source[@]}; i++)); do infos=$( printf '%s\n' "${source[${i}]}" | \ sed -n ' - s@^\([^:]\+\)::git+\(https://git\.archlinux\.org/linux.git\)?\(signed\)#\(tag=\S\+\)$@\1 \2 \3 \4@ + s@^\(\([^:]\+\)::\)\?git+\('"$( + printf '%s\|' \ + 'https://git.archlinux.org/linux.git' \ + 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git' \ + 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' \ + 'https://github.com/zen-kernel/zen-kernel' | \ + sed ' + s/\\|$// + s/[.]/[.]/g + ' + )"'\)\(?signed\)\?#\(\(tag\|commit\)=\S\+\)$@\2 \3 \4 \5@ T p ' ) if [ -n "${infos}" ]; then source[${i}]=$( - printf '%s.tar.gz::https://archive-server.archlinux32.org/?p=' \ - "${infos%% *}" - printf '%s/' "${infos%% *}" | \ - base64 -w0 | \ - sed 's/=/%3D/g' - printf '&r=' + if [ -n "${infos%% *}" ]; then + prefix="${infos%% *}" + else + prefix='' + fi + infos="${infos#* }" + repo="${infos%% *}" + repo64=$( + printf '%s' "${repo}" | \ + base64 -w0 | \ + sed 's/=/%3D/g' + ) infos="${infos#* }" - printf '%s' "${infos%% *}" | \ - base64 -w0 | \ - sed 's/=/%3D/g' + if [ "${infos%% *}" = '?signed' ]; then + key_check=$( + printf '&valid_keys=' + printf '%s,' "${validpgpkeys[@]}" | \ + sed 's/,$//' + ) + else + key_check='' + fi infos="${infos#* }" - if [ "${infos%% *}" = 'signed' ]; then - infos="${infos#* }" - printf '&valid_keys=' - printf '%s,' "${validpgpkeys[@]}" | \ - sed 's/,$//' + if [ -z "${prefix}" ]; then + prefix="${repo%.git}" + prefix="${prefix##*/}" fi - printf '&%s\n' "${infos}" + prefix_64=$( + printf '%s/' "${prefix}" | \ + base64 -w0 | \ + sed 's/=/%3D/g' + ) + + printf '%s-%s.tar.gz::https://archive-server.archlinux32.org/?p=%s&r=%s%s&%s\n' \ + "${prefix}" \ + "${pkgver}" \ + "${prefix_64}" \ + "${repo64}" \ + "${key_check}" \ + "${infos}" ) fi done -- cgit v1.2.3-70-g09d2 From 2cdc81401092caf0c70541f71b11b029e1d323cd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 28 Sep 2018 19:34:51 +0200 Subject: misc/PKGBUILD-appendix-for-archive-server: tell archive-server the type of archive (currently only "git") --- misc/PKGBUILD-appendix-for-archive-server | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/PKGBUILD-appendix-for-archive-server b/misc/PKGBUILD-appendix-for-archive-server index b2bdf79..b99268c 100644 --- a/misc/PKGBUILD-appendix-for-archive-server +++ b/misc/PKGBUILD-appendix-for-archive-server @@ -12,13 +12,15 @@ for ((i=0; i<${#source[@]}; i++)); do s/\\|$// s/[.]/[.]/g ' - )"'\)\(?signed\)\?#\(\(tag\|commit\)=\S\+\)$@\2 \3 \4 \5@ + )"'\)\(?signed\)\?#\(\(tag\|commit\)=\S\+\)$@git \2 \3 \4 \5@ T p ' ) if [ -n "${infos}" ]; then source[${i}]=$( + type="${infos%% *}" + infos="${infos#* }" if [ -n "${infos%% *}" ]; then prefix="${infos%% *}" else @@ -52,9 +54,10 @@ for ((i=0; i<${#source[@]}; i++)); do sed 's/=/%3D/g' ) - printf '%s-%s.tar.gz::https://archive-server.archlinux32.org/?p=%s&r=%s%s&%s\n' \ + printf '%s-%s.tar.gz::https://archive-server.archlinux32.org/?t=%s&p=%s&r=%s%s&%s\n' \ "${prefix}" \ "${pkgver}" \ + "${type}" \ "${prefix_64}" \ "${repo64}" \ "${key_check}" \ -- cgit v1.2.3-70-g09d2 From d91676e96f5cbf0cf6b69cc65a78bfadd2daec97 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 29 Sep 2018 11:42:57 +0200 Subject: misc/PKGBUILD-appendix-for-archive-server: add firefox hg source mangling --- misc/PKGBUILD-appendix-for-archive-server | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/PKGBUILD-appendix-for-archive-server b/misc/PKGBUILD-appendix-for-archive-server index b99268c..a968159 100644 --- a/misc/PKGBUILD-appendix-for-archive-server +++ b/misc/PKGBUILD-appendix-for-archive-server @@ -2,17 +2,18 @@ for ((i=0; i<${#source[@]}; i++)); do infos=$( printf '%s\n' "${source[${i}]}" | \ sed -n ' - s@^\(\([^:]\+\)::\)\?git+\('"$( + s@^\(\([^:]\+\)::\)\?\(git\|hg\)+\('"$( printf '%s\|' \ 'https://git.archlinux.org/linux.git' \ 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git' \ 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' \ - 'https://github.com/zen-kernel/zen-kernel' | \ + 'https://github.com/zen-kernel/zen-kernel' \ + 'https://hg.mozilla.org/mozilla-unified' | \ sed ' s/\\|$// s/[.]/[.]/g ' - )"'\)\(?signed\)\?#\(\(tag\|commit\)=\S\+\)$@git \2 \3 \4 \5@ + )"'\)\(?signed\)\?#\(\(tag\|commit\)=\S\+\)$@\3 \2 \4 \5 \6@ T p ' -- cgit v1.2.3-70-g09d2