commit:     c37580cd2ae38a5995a28a4e20f1867fb47d594a
Author:     Markus Meier <maekke <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  1 16:16:55 2014 +0000
Commit:     Markus Meier <maekke <AT> gentoo <DOT> org>
CommitDate: Sun Jun  1 16:16:55 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=dev/maekke.git;a=commit;h=c37580cd

replace subslotted-packages.sh with a python version

---
 scripts/subslotted-packages.py | 15 +++++++++++++++
 scripts/subslotted-packages.sh | 16 ----------------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/scripts/subslotted-packages.py b/scripts/subslotted-packages.py
new file mode 100755
index 0000000..7d660cd
--- /dev/null
+++ b/scripts/subslotted-packages.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+
+from portage.dbapi.porttree import portdbapi
+import subprocess
+
+TREE = "/usr/portage/"
+
+dbapi = portdbapi()
+pkgs = dbapi.cp_all(categories=None, trees=[TREE])
+
+for pkg in pkgs:
+       res = subprocess.call("egrep -q \"SLOT=\\\"?[0-9]*\/\" %s/%s/*.ebuild" 
% (TREE, pkg), shell=True)
+       if res == 0:
+               print("%s" % pkg)
+

diff --git a/scripts/subslotted-packages.sh b/scripts/subslotted-packages.sh
deleted file mode 100755
index c34ced2..0000000
--- a/scripts/subslotted-packages.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-# find packages with subslots
-
-PORTDIR="${HOME}/cvs/gentoo-x86"
-
-pushd "${PORTDIR}" > /dev/null
-
-for pkg in $(find . -mindepth 2 -maxdepth 2 -type d | sort) ; do
-       pushd ${pkg} > /dev/null
-       if [[ -n $(find . -name '*.ebuild') ]] ; then
-               [[ -n $(egrep "SLOT=\"?[0-9]*\/" *.ebuild) ]] && echo 
${pkg/\.\//}
-       fi
-       popd > /dev/null # ${pkg}
-done
-
-popd > /dev/null # ${PORTDIR}

Reply via email to