From: fuzzyray Date: Tue, 5 May 2009 17:39:24 +0000 (-0000) Subject: Rearrange trunk to support gentoolkit version 0.3. Split into gentoolkit, gentoolkit... X-Git-Tag: gentoolkit-0.3.0_rc5~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c819d146be6bce86d97019494173253e71b85d2f;p=gentoolkit.git Rearrange trunk to support gentoolkit version 0.3. Split into gentoolkit, gentoolkit-dev, and deprecated. Import djanderson's work on the gentoolkit library and equery svn path=/trunk/gentoolkit/; revision=589 --- diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..fa210a6 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,28 @@ +* gentoolkit + Original author: Karl Trygve Kalleberg + Further additions: Douglas Anderson + Current maintainer: Paul Varner + +* eclean + Original author: Thomas de Grenier de Latour (tgl) + +* epkginfo + Author: Ned Ludd + earch: Eldad Zack + metadata: Olinger + +* equery + Original author: Karl Trygve Kalleberg + Modular redesign: Douglas Anderson + +* eread + Original author: Donnie Berkholz + Updated by: Uwe Klosa + +* euse + Original perl version: Arun Bhanu + New bash version: Marius Mauch + +* revdep-rebuild + Original author: Stanislav Brabec + Rewrite author: Michael A. Smith diff --git a/trunk/COPYING b/COPYING similarity index 100% rename from trunk/COPYING rename to COPYING diff --git a/trunk/ChangeLog b/ChangeLog similarity index 100% rename from trunk/ChangeLog rename to ChangeLog diff --git a/trunk/NEWS b/NEWS similarity index 100% rename from trunk/NEWS rename to NEWS diff --git a/trunk/README b/README similarity index 100% rename from trunk/README rename to README diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..d958556 --- /dev/null +++ b/THANKS @@ -0,0 +1,8 @@ +* eclean + The starting point ideas were found here: + http://forums.gentoo.org/viewtopic.php?t=3011 + + Thanks to eswanson and far for their contributions, and to wolf31o2 for his + support. Thanks also to karltk, some of this code was at some point inspired + by his "equery" tool. And thanks to people who had a look on bug #33877: + Benjamin Braatz, fuzzyray, genone, etc. diff --git a/trunk/TODO b/TODO similarity index 100% rename from trunk/TODO rename to TODO diff --git a/bin/eclean b/bin/eclean new file mode 100644 index 0000000..8b473f9 --- /dev/null +++ b/bin/eclean @@ -0,0 +1,802 @@ +#!/usr/bin/env python +# Copyright 2003-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + + +############################################################################### +# Meta: +__author__ = "Thomas de Grenier de Latour (tgl)" +__email__ = "degrenier@easyconnect.fr" +__version__ = open('/etc/gentoolkit-version').read().strip() +__productname__ = "eclean" +__description__ = "A cleaning tool for Gentoo distfiles and binaries." + + +############################################################################### +# Python imports: +import sys +import os, stat +import re +import time +import getopt +import fpformat +import signal + +import portage +from portage.output import * + +listdir = portage.listdir + +############################################################################### +# Misc. shortcuts to some portage stuff: +port_settings = portage.settings +distdir = port_settings["DISTDIR"] +pkgdir = port_settings["PKGDIR"] + + +############################################################################### +# printVersion: +def printVersion(): + print "%s (%s) - %s" \ + % (__productname__, __version__, __description__) + print + print "Author: %s <%s>" % (__author__,__email__) + print "Copyright 2003-2009 Gentoo Foundation" + print "Distributed under the terms of the GNU General Public License v2" + + +############################################################################### +# printUsage: print help message. May also print partial help to stderr if an +# error from {'options','actions'} is specified. +def printUsage(error=None,help=None): + out = sys.stdout + if error: out = sys.stderr + if not error in ('actions', 'global-options', \ + 'packages-options', 'distfiles-options', \ + 'merged-packages-options', 'merged-distfiles-options', \ + 'time', 'size'): + error = None + if not error and not help: help = 'all' + if error == 'time': + eerror("Wrong time specification") + print >>out, "Time specification should be an integer followed by a"+ \ + " single letter unit." + print >>out, "Available units are: y (years), m (months), w (weeks), "+ \ + "d (days) and h (hours)." + print >>out, "For instance: \"1y\" is \"one year\", \"2w\" is \"two"+ \ + " weeks\", etc. " + return + if error == 'size': + eerror("Wrong size specification") + print >>out, "Size specification should be an integer followed by a"+ \ + " single letter unit." + print >>out, "Available units are: G, M, K and B." + print >>out, "For instance: \"10M\" is \"ten megabytes\", \"200K\" "+ \ + "is \"two hundreds kilobytes\", etc." + return + if error in ('global-options', 'packages-options', 'distfiles-options', \ + 'merged-packages-options', 'merged-distfiles-options',): + eerror("Wrong option on command line.") + print >>out + elif error == 'actions': + eerror("Wrong or missing action name on command line.") + print >>out + print >>out, white("Usage:") + if error in ('actions','global-options', 'packages-options', \ + 'distfiles-options') or help == 'all': + print >>out, " "+turquoise(__productname__), \ + yellow("[global-option] ..."), \ + green(""), \ + yellow("[action-option] ...") + if error == 'merged-distfiles-options' or help in ('all','distfiles'): + print >>out, " "+turquoise(__productname__+'-dist'), \ + yellow("[global-option, distfiles-option] ...") + if error == 'merged-packages-options' or help in ('all','packages'): + print >>out, " "+turquoise(__productname__+'-pkg'), \ + yellow("[global-option, packages-option] ...") + if error in ('global-options', 'actions'): + print >>out, " "+turquoise(__productname__), \ + yellow("[--help, --version]") + if help == 'all': + print >>out, " "+turquoise(__productname__+"(-dist,-pkg)"), \ + yellow("[--help, --version]") + if error == 'merged-packages-options' or help == 'packages': + print >>out, " "+turquoise(__productname__+'-pkg'), \ + yellow("[--help, --version]") + if error == 'merged-distfiles-options' or help == 'distfiles': + print >>out, " "+turquoise(__productname__+'-dist'), \ + yellow("[--help, --version]") + print >>out + if error in ('global-options', 'merged-packages-options', \ + 'merged-distfiles-options') or help: + print >>out, "Available global", yellow("options")+":" + print >>out, yellow(" -C, --nocolor")+ \ + " - turn off colors on output" + print >>out, yellow(" -d, --destructive")+ \ + " - only keep the minimum for a reinstallation" + print >>out, yellow(" -e, --exclude-file=")+ \ + " - path to the exclusion file" + print >>out, yellow(" -i, --interactive")+ \ + " - ask confirmation before deletions" + print >>out, yellow(" -n, --package-names")+ \ + " - protect all versions (when --destructive)" + print >>out, yellow(" -p, --pretend")+ \ + " - only display what would be cleaned" + print >>out, yellow(" -q, --quiet")+ \ + " - be as quiet as possible" + print >>out, yellow(" -t, --time-limit=