aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Meier <maekke@gentoo.org>2014-06-01 18:16:55 +0200
committerMarkus Meier <maekke@gentoo.org>2014-06-01 18:16:55 +0200
commitc37580cd2ae38a5995a28a4e20f1867fb47d594a (patch)
treef9eeafb1068fd20ac7f0bf612b0b5a9081cb86c0 /scripts
parentignore all .txt files (diff)
downloadmaekke-c37580cd2ae38a5995a28a4e20f1867fb47d594a.tar.gz
maekke-c37580cd2ae38a5995a28a4e20f1867fb47d594a.tar.bz2
maekke-c37580cd2ae38a5995a28a4e20f1867fb47d594a.zip
replace subslotted-packages.sh with a python version
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/subslotted-packages.py15
-rwxr-xr-xscripts/subslotted-packages.sh16
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}