From 2e5d85ab88f78283ed64f6168f7f9ccbb3b3dec7 Mon Sep 17 00:00:00 2001 From: karltk Date: Fri, 2 Apr 2004 12:14:14 +0000 Subject: [PATCH] Updated to 0.4 svn path=/; revision=100 --- trunk/src/epkgmove/ChangeLog | 3 +++ trunk/src/epkgmove/README | 2 +- trunk/src/epkgmove/epkgmove | 34 ++++++++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/trunk/src/epkgmove/ChangeLog b/trunk/src/epkgmove/ChangeLog index e69de29..30f1664 100644 --- a/trunk/src/epkgmove/ChangeLog +++ b/trunk/src/epkgmove/ChangeLog @@ -0,0 +1,3 @@ +2004-04-02 Karl Trygve Kalleberg + * Updated epkgmove to 0.4, as availble on + http://dev.gentoo.org/~port001/DevTools/epkgmove/epkgmove-0.4.py diff --git a/trunk/src/epkgmove/README b/trunk/src/epkgmove/README index e58b92a..18946e0 100644 --- a/trunk/src/epkgmove/README +++ b/trunk/src/epkgmove/README @@ -1,6 +1,6 @@ Package : epkgmove -Version : 0.3 +Version : 0.4 Author : See AUTHORS MOTIVATION diff --git a/trunk/src/epkgmove/epkgmove b/trunk/src/epkgmove/epkgmove index e06d66e..08cb33b 100644 --- a/trunk/src/epkgmove/epkgmove +++ b/trunk/src/epkgmove/epkgmove @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright 1999-2003 Gentoo Technologies, Inc. +# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header$ # @@ -8,6 +8,10 @@ # # ChangeLog: # +# 12 Feb 2004 - epkgmove-0.4, +# - Set PORTDIR to pwd if not in PORTDIR +# - Formatting fixes +# # 02 Jan 2004 - epkgmove-0.3, # - Check exit status of commands, die if non zero # - Check if PORTDIR is a CVS repository @@ -28,14 +32,24 @@ # 28 Dec 2003 - pkgmove-0.1, # - 0.1 Beta Release # +# TODO: +# +# - A complete rewrite. This was my first ever Python script and although I believe it to be safe to use, +# it is not well structured at all. +# -import os, re, portage, signal +import os +import re +import sys +import signal + +import portage from output import * __author__ = "Ian Leitch" __email__ = "port001@gentoo.org" __productname__ = "epkgmove" -__version__ = "0.3" +__version__ = "0.4" __description__ = "A simple tool for moving packages in CVS" def main(): @@ -67,6 +81,7 @@ def main(): AddUpdate() CleanUp() print "%s %s successfully moved to %s." % (green(" *"), turquoise(location), yellow(destination)) + sys.exit(0) def help(): @@ -101,9 +116,12 @@ def sighandler(signal_number=None, stack_frame=None): def Checkcwd(): - if os.getcwd() != portdir: - err("I'm not in PORTDIR, take me there!") - sys.exit(1) + global portdir + + if os.getcwd() != portdir: + print "%s Not in PORTDIR!" % yellow(" *") + print "%s Setting to: %s" % (yellow(" *"), os.getcwd()) + portdir = os.getcwd() files = os.listdir(portdir) @@ -117,7 +135,7 @@ def Checkcwd(): def UpdateCats(): - print "%s Updating %s & %s..." % (green(" *"), locategory, decategory) + print "%s Updating %s & %s..." % (green(" *"), locategory, decategory) os.chdir(os.path.join(portdir, locategory)) docmd(cvsupcmd) @@ -224,7 +242,7 @@ def AddPackage(): print "%s Running 'echangelog 'Moved from %s to %s.''..." % (green(" *"), location, destination) docmd("echangelog 'Moved from %s to %s.' %s" % (location, destination, devnull)) - print "%s Running '%s'..." % (green(" *"), cvscommitcmd) + print "%s Running '%s 'Moved from %s to %s.''..." % (green(" *"), cvscommitcmd, location, destination) docmd("%s 'Moved from %s to %s.' %s" % (cvscommitcmd, location, destination, devnull)) print "%s %s successfully added to CVS." % (green(" *"), turquoise(destination)) -- 2.26.2