[X2Go-Commits] [buildscripts] 01/01: bin/createsusetagsrepo: symlink noarch packages into noarch directory.

git-admin at x2go.org git-admin at x2go.org
Fri Apr 21 22:57:32 CEST 2017


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

x2go pushed a commit to branch master
in repository buildscripts.

commit 88930e6020f262c100be17b6a115db1e258e703d
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Apr 21 22:57:17 2017 +0200

    bin/createsusetagsrepo: symlink noarch packages into noarch directory.
---
 bin/createsusetagsrepo | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo
index 06a2e73..ddd3050 100755
--- a/bin/createsusetagsrepo
+++ b/bin/createsusetagsrepo
@@ -58,6 +58,41 @@ cleanup_repo () {
   done
 }
 
+handle_noarch () {
+  # Create noarch directory if needed.
+  [ -d "noarch" ] || mkdir "noarch"
+
+  typeset arch=''
+  for arch in "x86_64" "i586" "i686" "armhf" "ppc64" "ppc64le"; do
+    # Skip arches not available in this repository.
+    [ -d "${arch}" ] || continue
+
+    pushd "${arch}"
+
+    typeset file=''
+    typeset nullglob="$(shopt -p nullglob)"
+    shopt -s nullglob
+    # Scan for noarch files.
+    for file in */*.noarch.rpm; do
+      typeset target="../noarch/$(basename "${file}")"
+      # If target file already exists but is no link, error out.
+      if [ -e "${target}" ] && [ ! -L "${target}" ]; then
+        echo "ERROR: ${target}"' is not a symbolic link! Packages in the noarch directory must always be symbolic links.'
+        exit 1
+      elif [ -L "${target}" ]; then
+        echo "WARNING: ${target} already is a symbolic link. Please check its target."
+        ls -ldh "${target}"
+      else
+        # Nothing exists, create the link.
+        ln -sv "../${arch}/${file}" "${target}"
+      fi
+    done
+    eval "${nullglob}"
+
+    popd
+  done
+}
+
 create_metadata () {
   rm -rf -- "media.1" "descr"
   mkdir -- "media.1" "descr"
@@ -204,6 +239,8 @@ cd "${repo_top_dir}" || error "Unable to switch to provided repository top direc
 
 cleanup_repo
 
+handle_noarch
+
 create_metadata
 
 create_descr

--
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