Gentoo Archives: gentoo-commits

From: Markus Meier <maekke@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/maekke:master commit in: scripts/
Date: Sun, 01 Jun 2014 16:13:52
Message-Id: 1401639415.c37580cd2ae38a5995a28a4e20f1867fb47d594a.maekke@gentoo
1 commit: c37580cd2ae38a5995a28a4e20f1867fb47d594a
2 Author: Markus Meier <maekke <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 1 16:16:55 2014 +0000
4 Commit: Markus Meier <maekke <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 1 16:16:55 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/maekke.git;a=commit;h=c37580cd
7
8 replace subslotted-packages.sh with a python version
9
10 ---
11 scripts/subslotted-packages.py | 15 +++++++++++++++
12 scripts/subslotted-packages.sh | 16 ----------------
13 2 files changed, 15 insertions(+), 16 deletions(-)
14
15 diff --git a/scripts/subslotted-packages.py b/scripts/subslotted-packages.py
16 new file mode 100755
17 index 0000000..7d660cd
18 --- /dev/null
19 +++ b/scripts/subslotted-packages.py
20 @@ -0,0 +1,15 @@
21 +#!/usr/bin/python
22 +
23 +from portage.dbapi.porttree import portdbapi
24 +import subprocess
25 +
26 +TREE = "/usr/portage/"
27 +
28 +dbapi = portdbapi()
29 +pkgs = dbapi.cp_all(categories=None, trees=[TREE])
30 +
31 +for pkg in pkgs:
32 + res = subprocess.call("egrep -q \"SLOT=\\\"?[0-9]*\/\" %s/%s/*.ebuild" % (TREE, pkg), shell=True)
33 + if res == 0:
34 + print("%s" % pkg)
35 +
36
37 diff --git a/scripts/subslotted-packages.sh b/scripts/subslotted-packages.sh
38 deleted file mode 100755
39 index c34ced2..0000000
40 --- a/scripts/subslotted-packages.sh
41 +++ /dev/null
42 @@ -1,16 +0,0 @@
43 -#!/bin/bash
44 -# find packages with subslots
45 -
46 -PORTDIR="${HOME}/cvs/gentoo-x86"
47 -
48 -pushd "${PORTDIR}" > /dev/null
49 -
50 -for pkg in $(find . -mindepth 2 -maxdepth 2 -type d | sort) ; do
51 - pushd ${pkg} > /dev/null
52 - if [[ -n $(find . -name '*.ebuild') ]] ; then
53 - [[ -n $(egrep "SLOT=\"?[0-9]*\/" *.ebuild) ]] && echo ${pkg/\.\//}
54 - fi
55 - popd > /dev/null # ${pkg}
56 -done
57 -
58 -popd > /dev/null # ${PORTDIR}