Karl Trygve Kalleberg <karltk@gentoo.org>
- - Maintenance
+ * Maintenance
+
+See the AUTHOR file in the various src/<foo> subdirectories for a full
+log of who's done what with whome and when.
+
+2002-11-21 Karl Trygve Kalleberg <karltk@gentoo.org>
+ * Renamed pkg-size to gentool-package-size
+ * Renamed pst-package-count to gentool-package-count
+ * Retired rest of pst-* stuff
+
2002-08-06 Karl Trygve Kalleberg <karltk@gentoo.org>
* Created separate CVS module for Gentoolkit
* Restructured directory hierarchy
-- Merge emerge-webrsync with emerge-rsync
+
Dan Armak <danarmak@gentoo.org>
- - Basic idea
- - Initial version
+ * Basic idea
+ * Initial version
Karl Trygve Kalleberg <karltk@gentoo.org>
- - Gentoolkit-specific changes
+ * Gentoolkit-specific changes
-
José Fonseca <j_r_fonseca@yahoo.co.uk>
- - Wrote all of it.
+ * Wrote the script
+
+Karl Trygve Kalleberg <karltk@gentoo.org>
+ * Wrote the man page.
+Currently unknown, if anybody remembers, mail karltk@gentoo.org.
--- /dev/null
+Karl Trygve Kalleberg <karltk@gentoo.org>
+ * Initial version
+
--- /dev/null
+2002-11-22 Karl Trygve Kalleberg <karltk@gentoo.org>
+ * Fixed the nasty thinko whereby the old revisions were removed
+ from CVS.
+ * Imported pkg-size as gentool-package-size.
+ * Importet pst-package-count as gentool-package-count.
+ * Added a man page for gentool-bump-revision.
+ * Added a man page for gentool-package-size.
+ * Added a man page for gentool-package-count.
--- /dev/null
+#! /bin/sh
+# Copyright (c) 2002, Gentoo Technologies, Inc.
+# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
+# $Header$
+
+if [ ! -f $HOME/.gentoo/gentool-env ] ; then
+ echo "You must make a $HOME/.gentoo/gentool-env file that contains"
+ echo "AUTHORNAME=\"Your name\""
+ echo "AUTHOREMAIL=\"Your @gentoo.org mail address\""
+fi
+
+. $HOME/.gentoo/gentool-env
+
+dn="`dirname $1`"
+bn="`basename $1`"
+ebuild=`echo $bn | sed "s/\.ebuild//"`
+
+ver=`echo $ebuild | sed "s/\(.*\)-\([0-9].*\)/\2/"`
+name=`echo $ebuild | sed "s/\(.*\)-\([0-9].*\)/\1/"`
+rev=`echo $ver | grep "\-r[0-9]*" | sed "s/.*-r\([0-9]*\)/\1/"`
+basever=`echo $ver | sed "s/-r[0-9]*//"`
+
+oldver=$ebuild
+newver=""
+if [ -z "$rev" ] ; then
+ newver=${ebuild}-r1
+else
+ newrev=$[rev + 1]
+ newver=${name}-${basever}-r${newrev}
+fi
+
+echo "# Directory : $dn"
+echo "# Old version : $oldver"
+echo "# New version : $newver"
+echo
+
+cd ${dn}
+
+echo "Updating revisions for ebuilds digests"
+mv ${oldver}.ebuild ${newver}.ebuild
+mv files/digest-${oldver} files/digest-${newver}
+
+echo "Adding new revisions to CVS"
+cvs add ${newver}.ebuild
+cvs add files/digest-${newver}
+
+if [ ! -f ChangeLog ] ; then
+ echo "!!! Cannot fix ChangeLog, does not exist" > /dev/stderr
+ exit -1
+fi
+
+echo "Adding new entry in ChangeLog"
+
+lns=`cat ChangeLog | wc -l | tr -d ' '`
+mv ChangeLog ChangeLog.orig
+(head -n 3 ChangeLog.orig ;
+ echo ""
+ echo "*$newver (`date +\"%d %b %Y\"`)" ;
+ echo "" ;
+ echo " `date +\"%d %b %Y\"`; $AUTHORNAME <$AUTHOREMAIL> ${newver}.ebuild files/digest-${newver}:" ;
+ echo "" ;
+ echo " # INSERT COMMENT HERE" ;
+ echo "" ;
+ echo " Removed ${oldver}.ebuild files/digest-${oldver}" ;
+ echo "" ;
+ tail -n $[lns-4] ChangeLog.orig
+) > ChangeLog
--- /dev/null
+.TH gentool-bump-revision "1" "Nov 2002" "gentoolkit"
+.SH NAME
+gentool-bump-revision \- Bumps the revision number of a given package
+.SH SYNOPSIS
+.B gentool-bump-revision
+\fIebuild\fR
+.SH DESCRIPTION
+The \fBgentool-bump-revision\fR utility bumps the revision of an existing
+ebuild in the Portage tree. It does this by copying the specified ebuild
+file to a new filename with an increased revision number. It takes care
+of the digest file, adding both to CVS, and it also adds an entry in the
+ChangeLog for you to fill in. After the revision bump, should always make
+certain any auxiliary files like scripts, etc, are installed properly.
+.SH AUTHOR
+Karl Trygve Kalleberg <karltk@gentoo.org>, 2002
+.SH SEE ALSO
+change(1)
+.TP
+See \fI/usr/share/doc/gentoolkit-<version>/\fR for documentation on other gentoolkit utilities.
+
--- /dev/null
+.TH gentool-package-count "1" "Nov 2002" "gentoolkit"
+.SH NAME
+gentool-package-count\- Counts the number of packages available in the tree.
+.SH SYNOPSIS
+.B gentool-package-revision
+.SH DESCRIPTION
+The \fBgentool-package-count\fR utility counts the number of packages
+available for installation in your local Portage tree. It will inform of
+total package count, total category count, and total unique packages. It
+is completely useless.
+.SH AUTHOR
+Karl Trygve Kalleberg <karltk@gentoo.org>, 2002
+.SH SEE ALSO
+gentool-package-size(1)
+.TP
+See \fI/usr/share/doc/gentoolkit-<version>/\fR for documentation on other gentoolkit utilities.
+
--- /dev/null
+#! /usr/bin/env python
+#
+# Copyright(c) 2002, Gentoo Technologies, Inc
+# Copyright(c) 2002, Karl Trygve Kalleberg <karltk@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+#
+
+import sys
+import string
+import os
+import os.path
+
+base = "/var/db/pkg"
+
+def getdirs(path):
+ files = os.listdir(path)
+ dirs = []
+ for i in files:
+ if os.path.isdir(path + "/" + i):
+ dirs.append(i)
+ return dirs
+
+def findContentFile(spec):
+ k = string.split(spec,"/")
+
+ if len(k) == 2:
+ cat = k[0]
+ pnm = k[1]
+ else:
+ cat = ""
+ pnm = k[0]
+
+ if cat:
+ dirlist = os.listdir(base + "/" + cat)
+ for pkg in dirlist:
+ if string.find(pkg, pnm) == 0:
+ return (cat, pkg, base + "/" + cat + "/" + pkg + "/CONTENTS")
+ else:
+ cats = getdirs(base)
+ for cat in cats:
+ pkgs = getdirs(base + "/" + cat)
+ for pkg in pkgs:
+ if string.find(pkg, pnm) == 0:
+ return (cat, pkg, base + "/" + cat + "/" + pkg + "/CONTENTS")
+ return None
+
+def main():
+ spec=sys.argv[1]
+
+ try:
+ (cat, pkg, contents) = findContentFile(spec)
+ except:
+ print "No package resembling '" + spec + "' found"
+ sys.exit(-1)
+
+ ins = open(contents)
+
+ files = []
+ inaccurate = 0
+ total = 0
+ for i in ins.readlines():
+ k = string.split(i)
+ if len(k) and k[0] == "obj":
+ files.append(k[1])
+ for i in files:
+ try:
+ total+=os.path.getsize(i)
+ except os.error:
+ inaccurate=1
+ k = str(total) + " (" + str(total/1024) + "kiB)"
+ if inaccurate:
+ k += " ~"
+ print cat + "/" + pkg + " " + k
+
+if __name__ == "__main__":
+ main()
+
+"""
+#!/bin/sh
+
+# Copyright(c) 2002, Gentoo Technologies, Inc
+# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
+
+spec=$1
+
+name=`echo $1 | sed "s/\([^/]*\)\///"`
+category=`echo $1 | sed "s/\/.*//"`
+
+if [ "$category" == "$name" ] ; then
+ category=
+fi
+
+function tryfile() {
+ local foo
+ foo=/var/db/pkg/$1/CONTENTS
+ bar=`ls $foo 2> /dev/null`
+ for i in $bar ; do
+ if [ -f "$i" ] ; then
+ echo $i
+ break
+ fi
+ done
+}
+
+file=`tryfile "${category}/${name}"`
+if [ -z $file ] ; then
+ file=`tryfile "${category}/${name}*"`
+ if [ -z $file ] ; then
+ file=`tryfile "${category}*/${name}"`
+ if [ -z $file ] ; then
+ file=`tryfile "${category}*/${name}*"`
+ if [ -z $file ] ; then
+ echo "!!! Package resembling ${category}/${name} not found"
+ exit 1
+ fi
+ fi
+ fi
+fi
+
+pkgname=`echo $file | sed -e "s:\/var\/db\/pkg\/::" -e "s:\/CONTENTS::"`
+
+filelist=`cat $file|grep "obj"|awk '{ print $2 }' | sed "s/ /\\ /"`
+
+size=0
+for i in $filelist ; do
+ if [ -e $i ] ; then
+ s=`du -s $i | cut -f1`
+ size=$[size + s]
+ fi
+done
+#size=0
+#for i in $totals ; do
+# size=$[size+i]
+#done
+
+echo "$pkgname $size ($[size/1024]KB)"
+
+"""
--- /dev/null
+.TH gentool-package-size "1" "Nov 2002" "gentoolkit"
+.SH NAME
+gentool-package-size \- Calculates the diskspace occupied by a package
+.SH SYNOPSIS
+.B gentool-package-revision
+\fIpackage-name\fR
+.SH DESCRIPTION
+The \fBgentool-package-revision\fR utility calculates the actual diskspace
+taken by a given package. It will not consider the parition block size. The
+package name need not be absolute, the closest match is sought.
+.SH EXAMPLE
+.LP
+To look for the first package with a name starting with \fImozilla\fR:
+.RS
+.nf
+\fBgentool-package-revision mozilla\fP
+.fi
+.RE
+
+.LP
+To look for the first package in category \fInet-www\fR starting with
+\fImozilla\fR:
+.RS
+.nf
+\fBgentool-package-revision net-www/mozilla\fP
+.fi
+.RE
+
+.LP
+To only match a very specific version of \fImozilla\fR in the
+\fInet-www\fR category:
+.RS
+.nf
+\fBgentool-package-revision net-www/mozilla-1.0.1-r3\fP
+.fi
+.RE
+
+.SH AUTHOR
+Karl Trygve Kalleberg <karltk@gentoo.org>, 2002
+.SH SEE ALSO
+gentool-package-count(1)
+.TP
+See \fI/usr/share/doc/gentoolkit-<version>/\fR for documentation on other gentoolkit utilities.
+
+++ /dev/null
-#!/bin/sh
-
-# Copyright(c) 2002, Gentoo Technologies, Inc
-# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
-
-spec=$1
-
-name=`echo $1 | sed "s/\([^/]*\)\///"`
-category=`echo $1 | sed "s/\/.*//"`
-
-if [ "$category" == "$name" ] ; then
- category=
-fi
-
-function tryfile() {
- local foo
- foo=/var/db/pkg/$1/CONTENTS
- bar=`ls $foo 2> /dev/null`
- for i in $bar ; do
- if [ -f "$i" ] ; then
- echo $i
- break
- fi
- done
-}
-
-file=`tryfile "${category}/${name}"`
-if [ -z $file ] ; then
- file=`tryfile "${category}/${name}*"`
- if [ -z $file ] ; then
- file=`tryfile "${category}*/${name}"`
- if [ -z $file ] ; then
- file=`tryfile "${category}*/${name}*"`
- if [ -z $file ] ; then
- echo "!!! Package resembling ${category}/${name} not found"
- exit 1
- fi
- fi
- fi
-fi
-
-pkgname=`echo $file | sed -e "s:\/var\/db\/pkg\/::" -e "s:\/CONTENTS::"`
-
-totals=`cat $file|grep "obj"|awk '{ print $2 }' | sed "s/ /\\ /" | xargs du -scb | grep total | cut -f 1`
-
-size=0
-for i in $totals ; do
- size=$[size+i]
-done
-
-echo "$pkgname $size ($[size/1024]KB)"
-
+++ /dev/null
-2002-03-22 Karl Trygve Kalleberg <karltk@gentoo.org>
- * Threw away the coverage scripts, replaced with this.
+++ /dev/null
-{
- match($0, "<([A-Za-z0-9.-]+@[A-Za-z0-9.-]+)>")
- val=substr($0, RSTART, RLENGTH)
- arr[val]++
- total++
-}
-
-END {
- for (x in arr) {
- printf("%35s: %-4d of %-4d (%-4.2f%)\n",x,arr[x],total,arr[x]*100/total)
- mytot += arr[x]
- }
- printf("%35s: %-4d of %-4d (%-4.2f%)\n","TOTAL",mytot, total,mytot*100/total)
-}
\ No newline at end of file
+++ /dev/null
-#! /bin/sh
-
-if [ -z "$1" ] ; then
- echo "Usage: $1 <author@site.tld>"
- exit 1
-fi
-
-numebuilds=`find /usr/portage/ -name "*.ebuild" | wc -l`
-numebuildsfor=`find /usr/portage/ -name "*.ebuild" | xargs grep "$1" | wc -l`
-
-pct=`echo "scale=2 ; $numebuildsfor*100/$numebuilds" | bc`
-printf "%25s: %-4d of %-4d (%-4.2f)\n" $1 $numebuildsfor $numebuilds $pct
+++ /dev/null
-#! /bin/sh
-
-
-find /usr/portage/ -name "*.ebuild" | \
- xargs egrep -i "<[a-z]+@[a-z\.]+>" | \
- awk -f /usr/share/gentoolkit/histogram.awk | \
- sort -n +1 -r