[X2Go-Commits] [buildscripts] 01/01: bin/createsusetagsrepo: actually create metadata hashes in content file...

git-admin at x2go.org git-admin at x2go.org
Sun Dec 4 07:45:52 CET 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository buildscripts.

commit 5518d3e00eba69abcd64925ee85df6519040d84c
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sun Dec 4 07:45:23 2016 +0100

    bin/createsusetagsrepo: actually create metadata hashes in content file...
---
 bin/createsusetagsrepo |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo
index 4a862c2..92ce6dd 100755
--- a/bin/createsusetagsrepo
+++ b/bin/createsusetagsrepo
@@ -147,6 +147,34 @@ sign_metadata () {
   test -e "${rpm_key_file_name}" || cp -av 'content.key' "${rpm_key_file_name}"
 }
 
+generate_content_hashes () {
+  typeset shasum_binary="sha1sum"
+  typeset shasum_string="SHA1"
+
+  if [ "${boolean_sha256}" -eq "1" ]; then
+    shasum_binary="sha256sum"
+    shasum_string="SHA256"
+  fi
+
+  pushd descr
+
+  find . -type 'f' -not -iname 'directory.yast' -printf '%f\0' | while read -r -d '' file; do
+    typeset shasum=""
+    shasum="$("${shasum_binary}" "${file}")"
+
+    printf "META ${shasum_string} ${shasum}\n" >> ../content
+  done
+
+  popd
+
+  find . -type 'f' -iname 'gpg-pubkey-*.asc' -printf '%f\0' | while read -r -d '' file; do
+    typeset shasum=""
+    shasum="$("${shasum_binary}" "${file}")"
+
+    printf "KEY ${shasum_string}  ${shasum}\n" >> ../content
+  done
+}
+
 set -e
 
 repo_top_dir="${1}"
@@ -179,4 +207,6 @@ create_directory
 # Sign repository metadata, otherwise zypper will fail to refresh the repository.
 sign_metadata
 
+generate_content_hashes
+
 exit "0"

--
Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git


More information about the x2go-commits mailing list