[X2Go-Commits] [buildscripts] 02/03: bin/createsusetagsrepo: add cleanup_repo routine for removing dangling symlinks and creating new ones.

git-admin at x2go.org git-admin at x2go.org
Thu Nov 24 08:42:08 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 76c51bf10a33b9256118a7d620de3507eb999811
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Nov 24 08:39:29 2016 +0100

    bin/createsusetagsrepo: add cleanup_repo routine for removing dangling symlinks and creating new ones.
---
 bin/createsusetagsrepo |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/bin/createsusetagsrepo b/bin/createsusetagsrepo
index 7c53d30..76c8f9c 100755
--- a/bin/createsusetagsrepo
+++ b/bin/createsusetagsrepo
@@ -30,6 +30,27 @@ error () {
   exit "1"
 }
 
+cleanup_repo () {
+  typeset arch=""
+  for arch in "SRPM" "i586" "x86_64" "armhf" "ppc64" "ppc64le"; do
+    # Skip arches not available in this repository.
+    [ -d "${arch}" ] || continue
+
+    pushd "${arch}"
+
+    # Remove broken links.
+    find -L . -name '.' -o -type 'd' -prune -o -type 'l' -execdir rm -- '{}' +
+
+    # Create new ones.
+    typeset file=""
+    for file in */*.rpm; do
+      ln -sv -- "${file}" "$(basename "${file}")"
+    done
+
+    popd
+  done
+}
+
 create_metadata () {
   rm -rf -- "media.1" "descr"
   mkdir -- "media.1" "descr"
@@ -91,6 +112,8 @@ test -z "${component}" && usage
 
 cd "${repo_top_dir}" || error "Unable to switch to provided repository top directory '${repo_top_dir}'."
 
+cleanup_repo
+
 create_metadata
 
 create_package_descr -o descr -x /dev/null

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