commit:     f7632e9c853bb0a711a14d74e40355f791c1d927
Author:     Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Fri Mar 20 18:23:10 2015 +0000
Commit:     Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Fri Mar 20 18:23:10 2015 +0000
URL:        https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=f7632e9c

Add package list script from www.g.o

 pkg_lists/distrowatch.sh | 28 ++++++++++++++++++++++++++++
 pkg_lists/pkglist.py     | 20 ++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/pkg_lists/distrowatch.sh b/pkg_lists/distrowatch.sh
new file mode 100755
index 0000000..2e165a6
--- /dev/null
+++ b/pkg_lists/distrowatch.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# $Id: distrowatch.sh,v 1.2 2008/07/12 02:02:47 robbat2 Exp $
+# this file creates a list of packages from the Portage tree for distrowatch
+#
+# $1 = web script directory
+# $2 = web site htdocs directory
+
+if ! [ -d "$1" -a -d "$2" ]; then
+       echo "You must specify the path to the web scripts and the path to the 
output directory"
+       exit 1
+fi
+
+#Note: distrowatch lists non-x86 packages like yaboot, so I'm now including 
all arches (drobbins, 04/04/2003)
+
+STABLE_ARCHES=" x86 amd64 ppc alpha arm hppa ia64 m68k mips ppc64 s390 sh 
sparc sparc-fbsd x86-fbsd"
+UNSTABLE_ARCHES=" ~x86 ~amd64 ~ppc ~alpha ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 
~s390 ~sh ~sparc ~sparc-fbsd ~x86-fbsd"
+
+tmp=$(mktemp)
+
+# gentoo_pkglist_x86.txt contains the stable branch packages
+ACCEPT_KEYWORDS="$STABLE_ARCHES" $1/pkglist.py 1> $tmp 2> /dev/null
+cat $tmp > $2/gentoo_pkglist_stable.txt
+
+# gentoo_pkglist_X86.txt contains the unstable branch packages
+ACCEPT_KEYWORDS="$STABLE_ARCHES $UNSTABLE_ARCHES" $1/pkglist.py 1> $tmp 2> 
/dev/null
+cat $tmp > $2/gentoo_pkglist_unstable.txt
+
+rm -f $tmp

diff --git a/pkg_lists/pkglist.py b/pkg_lists/pkglist.py
new file mode 100755
index 0000000..9777401
--- /dev/null
+++ b/pkg_lists/pkglist.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+# $Id: pkglist.py,v 1.1 2005/11/24 23:45:54 ramereth Exp $
+
+import portage
+
+allpkgs=portage.db["/"]["porttree"].dbapi.cp_all()
+bestpkgs={}
+mycount=0
+
+for x in allpkgs:
+       if x not in bestpkgs.keys():
+               y=portage.db["/"]["porttree"].dbapi.xmatch("bestmatch-visible", 
x)
+               bestpkgs[x]=y
+               if y=="":
+                       continue
+               xs=portage.pkgsplit(bestpkgs[x])
+               print xs[0].split("/")[1],
+               print xs[1],
+               print bestpkgs[x]
+               mycount+=1

Reply via email to