This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository buildscripts. from fdf5ad7 bin/build-rpm-package: sign susetags metadata (at least the content file.) new c8cc913 bin/build-rpm-package: correctly extract SuSE major version (or else nothing at all.) new 9ff77d2 bin/createsusetagsrepo: add gpg-key and sha256 parameters. new 48ba9d0 bin/build-rpm-package: pass gpg-key and sha256 parameter to createsusetags (remote) script. new 3ac7977 bin/createsusetagsrepo: also create SHA sums of metadata - otherwise zypper won't be able to refresh the repository. new 0d5b8c1 bin/{build-rpm-package,createsusetagsrepo}: move package signing to createsusetagsrepo script. new b161e0d bin/createsusetagsrepo: create RPM gpg key file (or really copy content.key) if not available yet. The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: bin/build-rpm-package | 18 +++++++++------ bin/createsusetagsrepo | 60 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 9 deletions(-) -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 9ff77d2468338d76ace3a9f722af3095b64a42e2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 04:31:23 2016 +0100 bin/createsusetagsrepo: add gpg-key and sha256 parameters. --- bin/createsusetagsrepo | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo index 917b61e..c1dcf93 100755 --- a/bin/createsusetagsrepo +++ b/bin/createsusetagsrepo @@ -20,8 +20,12 @@ export PATH="${HOME}/bin:${PATH}" # ${CDPATH} could lead to some very nasty problems. Better unset it. unset CDPATH +typeset script_path="$(dirname "$(readlink -e "${BASH_SOURCE}")")" + +. "${script_path}/common.sh" + usage () { - echo "Usage: $(basename "${0}") <top-directory-of-repository> <distro> <component>" >&2 + echo "Usage: $(basename "${0}") <top-directory-of-repository> <distro> <component> <gpg-key> <boolean_sha256>" >&2 exit "1" } @@ -108,10 +112,19 @@ set -e repo_top_dir="${1}" distro="${2}" component="${3}" +gpg_key="${4}" +boolean_sha256="${5}" test -z "${repo_top_dir}" && usage test -z "${distro}" && usage test -z "${component}" && usage +test -z "${gpg_key}" && usage + +if [ -z "${boolean_sha256}" ]; then + boolean_sha256="1" +fi + +boolean_sha256="$(make_boolean "${boolean_sha256}")" cd "${repo_top_dir}" || error "Unable to switch to provided repository top directory '${repo_top_dir}'." -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 48ba9d0fa40845801b88fabeec311f187c5bef66 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 04:32:35 2016 +0100 bin/build-rpm-package: pass gpg-key and sha256 parameter to createsusetags (remote) script. --- bin/build-rpm-package | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 15633cc..611b4b6 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -1004,12 +1004,15 @@ upload_packages() { # For *SUSE, we only need to run the repo generation once, since all architectures are part of one repository. if [ "${l_DIST}" = "opensuse" ] || [ "${l_DIST}" = "sle" ]; then + typeset use_sha256="1" typeset distro_string="" if [ "${l_DIST}" = "opensuse" ]; then distro_string="OpenSuSE:" typeset -i tmp_suse_major_version="0" + typeset -i tmp_suse_minor_version="-1" tmp_suse_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${l_CODENAME}")" + tmp_suse_minor_version="$(sed -e '/^[0-9][0-9]*\.\([0-9][0-9]*\)$/!d;s//\1/' <<< "${l_CODENAME}")" if [ "x${tmp_suse_major_version}" = "x0" ]; then echo "Unable to extract SUSE version." @@ -1018,6 +1021,11 @@ upload_packages() { [ "${tmp_suse_major_version}" -gt "13" ] && distro_string="${distro_string}Leap:" distro_string="${distro_string}${l_CODENAME}" + + # 11.1 and below only support SHA1 checksums (or at least the upstream repositories exclusively use SHA1 checksums.) + if [ "${tmp_suse_major_version}" -lt "11" ] || { [ "${tmp_suse_major_version}" -eq "11" ] && [ "${tmp_suse_minor_version}" -le "1" ]; }; then + use_sha256="0" + fi else distro_string="SLE:" @@ -1054,7 +1062,7 @@ upload_packages() { [ -n "${other}" ] && distro_string="${distro_string}${other}" fi - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${l_CODENAME}'" + 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${l_CODENAME}' '${gpg_sign_with}' '${use_sha256}'" # Sign repository data, otherwise zypper will fail adding the repository. 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && rm -f -- 'content.asc' && gpg -a -u '${gpg_sign_with}' --detach-sign 'content'" 1>/dev/null 2>/dev/null -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit c8cc91374ae455561fd74ab541bbc373e36686ef Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 04:20:56 2016 +0100 bin/build-rpm-package: correctly extract SuSE major version (or else nothing at all.) --- bin/build-rpm-package | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 371b1c0..15633cc 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -752,7 +752,7 @@ build_packages() { BUILD_RESULT="/home/abuild/rpmbuild/" typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(sed -e 's/\([0-9]*\).*/\1/' <<< "${l_CODENAME}")" + tmp_suse_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${l_CODENAME}")" if [ "x${tmp_suse_major_version}" = "x0" ]; then echo "Unable to extract SUSE version." @@ -1009,7 +1009,7 @@ upload_packages() { distro_string="OpenSuSE:" typeset -i tmp_suse_major_version="0" - tmp_suse_major_version="$(sed -e 's/\([0-9]*\).*/\1/' <<< "${l_CODENAME}")" + tmp_suse_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${l_CODENAME}")" if [ "x${tmp_suse_major_version}" = "x0" ]; then echo "Unable to extract SUSE version." -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 3ac797700f8e5b68b822cad54d371fa770d2b327 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 04:56:51 2016 +0100 bin/createsusetagsrepo: also create SHA sums of metadata - otherwise zypper won't be able to refresh the repository. --- bin/createsusetagsrepo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo index c1dcf93..8850a67 100755 --- a/bin/createsusetagsrepo +++ b/bin/createsusetagsrepo @@ -98,6 +98,13 @@ EOF printf '%s\n' "${tmp_str}" > "content" } +create_descr () { + typeset create_package_descr_sha256="" + [ "${boolean_sha256}" -eq "1" ] && create_package_descr_sha256="-D" + + create_package_descr -o descr -x /dev/null -C ${create_package_descr_sha256} +} + create_directory () { typeset prefix='./descr/' typeset file='directory.yast' @@ -132,7 +139,7 @@ cleanup_repo create_metadata -create_package_descr -o descr -x /dev/null +create_descr create_directory -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 0d5b8c145c95a1388fa006a45748712b8befa602 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 05:04:16 2016 +0100 bin/{build-rpm-package,createsusetagsrepo}: move package signing to createsusetagsrepo script. Makes manually refreshing repositories easier. --- bin/build-rpm-package | 4 ---- bin/createsusetagsrepo | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 611b4b6..10383fb 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -1063,10 +1063,6 @@ upload_packages() { fi 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${l_CODENAME}' '${gpg_sign_with}' '${use_sha256}'" - - # Sign repository data, otherwise zypper will fail adding the repository. - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && rm -f -- 'content.asc' && gpg -a -u '${gpg_sign_with}' --detach-sign 'content'" 1>/dev/null 2>/dev/null - 0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && test -e 'content.key' || gpg -a --output 'content.key' --export '${gpg_sign_with}'" fi done done diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo index 8850a67..6401673 100755 --- a/bin/createsusetagsrepo +++ b/bin/createsusetagsrepo @@ -114,6 +114,11 @@ create_directory () { find "${prefix}" -print | sed -e "s#${prefix}##" | grep -vE '^$' | grep -v "^${file}$" > "${prefix}/${file}" } +sign_metadata () { + rm -f -- 'content.asc' && gpg -a -u "${gpg_key}" --detach-sign 'content' + test -e 'content.key' || gpg -a --output 'content.key' --export "${gpg_key}" +} + set -e repo_top_dir="${1}" @@ -143,4 +148,7 @@ create_descr create_directory +# Sign repository metadata, otherwise zypper will fail to refresh the repository. +sign_metadata + exit "0" -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit b161e0d9ef2088ad09e712c796f8ee15f789982a Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Dec 4 06:54:19 2016 +0100 bin/createsusetagsrepo: create RPM gpg key file (or really copy content.key) if not available yet. --- bin/createsusetagsrepo | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo index 6401673..4a862c2 100755 --- a/bin/createsusetagsrepo +++ b/bin/createsusetagsrepo @@ -117,6 +117,34 @@ create_directory () { sign_metadata () { rm -f -- 'content.asc' && gpg -a -u "${gpg_key}" --detach-sign 'content' test -e 'content.key' || gpg -a --output 'content.key' --export "${gpg_key}" + + typeset rpm_key_file_name="gpg-pubkey-" + typeset key_id_short="" + key_id_short="$(gpg --keyid-format=short 'content.key' | grep -Em 1 '^pub' | sed -e '/^pub.*\/\([0-9a-fA-F]\{8\}\) .*$/!d;s//\1/')" + + if [ -z "${key_id_short}" ]; then + echo "Unable to get the short key ID of pub key ${gpg_key}." >&2 + exit "1" + fi + + typeset key_creation_date="" + key_creation_date="$(gpg --list-packets --verbose < 'content.key' 2>/dev/null | grep -Em 1 'created [0-9][0-9]*,' | sed -e '/.*created \([0-9][0-9]*\), .*/!d;s//\1/')" + + if [ -z "${key_creation_date}" ]; then + echo "Unable to get the key creation date of pub key ${gpg_key}." >&2 + exit "1" + fi + + key_creation_date="$(printf '%x' "${key_creation_date}")" + + if [ "$?" -ne "0" ]; then + echo "Unable to convert decimal key creation date of pub key ${gpg_key} to hexadecimal." >&2 + exit "1" + fi + + rpm_key_file_name="${rpm_key_file_name}${key_id_short}-${key_creation_date}.asc" + + test -e "${rpm_key_file_name}" || cp -av 'content.key' "${rpm_key_file_name}" } set -e -- Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git