summaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authorantarus <antarus@gentoo.org>2007-04-01 05:13:21 +0000
committerantarus <antarus@gentoo.org>2007-04-01 05:13:21 +0000
commit9a327677f6984ca6e2ec73846e10549fd81595e2 (patch)
treec6209b99a2e616cc9091185ab99df1cf5701b035 /trunk/src
parented8b48359ddb4b2723433cb732b59811bd921cc0 (diff)
downloadgentoolkit-9a327677f6984ca6e2ec73846e10549fd81595e2.tar.gz
Add support for new-style imports while keeping support for old imports as a fallback
svn path=/; revision=382
Diffstat (limited to 'trunk/src')
-rw-r--r--trunk/src/dep-clean/dep-clean5
-rw-r--r--trunk/src/eclean/eclean5
-rw-r--r--trunk/src/epkgmove/epkgmove5
-rwxr-xr-xtrunk/src/etcat/etcat5
-rw-r--r--trunk/src/genpkgindex/genpkgindex18
-rwxr-xr-xtrunk/src/gensync/gensync6
-rw-r--r--trunk/src/gentoolkit/pprinter.py11
-rw-r--r--trunk/src/glsa-check/glsa-check7
8 files changed, 48 insertions, 14 deletions
diff --git a/trunk/src/dep-clean/dep-clean b/trunk/src/dep-clean/dep-clean
index b64edb9..2f2bde0 100644
--- a/trunk/src/dep-clean/dep-clean
+++ b/trunk/src/dep-clean/dep-clean
@@ -7,7 +7,10 @@
import sys
import gentoolkit
-from output import *
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
__author__ = "Karl Trygve Kalleberg, Brandon Low, Jerry Haltom"
__email__ = "karltk@gentoo.org, lostlogic@gentoo.org, ssrit@larvalstage"
diff --git a/trunk/src/eclean/eclean b/trunk/src/eclean/eclean
index 5c5f117..00be5e9 100644
--- a/trunk/src/eclean/eclean
+++ b/trunk/src/eclean/eclean
@@ -24,7 +24,10 @@ import fpformat
import signal
sys.path.insert(0,'/usr/lib/portage/pym')
import portage
-from output import *
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
listdir = portage.listdir
diff --git a/trunk/src/epkgmove/epkgmove b/trunk/src/epkgmove/epkgmove
index 8ce0ae0..42b6e7d 100644
--- a/trunk/src/epkgmove/epkgmove
+++ b/trunk/src/epkgmove/epkgmove
@@ -17,7 +17,10 @@ from random import randint
from optparse import OptionParser
import portage
-from output import *
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
__author__ = "Ian Leitch"
__email__ = "port001@gentoo.org"
diff --git a/trunk/src/etcat/etcat b/trunk/src/etcat/etcat
index 3ffa35d..5137683 100755
--- a/trunk/src/etcat/etcat
+++ b/trunk/src/etcat/etcat
@@ -93,7 +93,10 @@ sys.path.insert(0, "/usr/lib/gentoolkit/pym")
import gentoolkit
from stat import *
-from output import *
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
__author__ = "Alastair Tse"
__email__ = "liquidx@gentoo.org"
diff --git a/trunk/src/genpkgindex/genpkgindex b/trunk/src/genpkgindex/genpkgindex
index ffbc6c2..2259fb9 100644
--- a/trunk/src/genpkgindex/genpkgindex
+++ b/trunk/src/genpkgindex/genpkgindex
@@ -12,12 +12,20 @@ if getattr(__builtins__, "set", None) is None:
for x in ['CFLAGS','CXXFLAGS', 'LDFLAGS','USE']:
os.environ[x]=''
-import xpak
import portage
-import portage_checksum
-import portage_dep
-import portage_util
-import portage_const
+
+try:
+ import portage.xpak as xpak
+ import portage.checksum as portage_checksum
+ import portage.dep as portage_dep
+ import portage.util as portage_util
+ import portage.const as portage_const
+except ImportError:
+ import xpak
+ import portage_checksum
+ import portage_dep
+ import portage_util
+ import portage_const
argc=len(sys.argv)
diff --git a/trunk/src/gensync/gensync b/trunk/src/gensync/gensync
index 493ccb8..52f25ed 100755
--- a/trunk/src/gensync/gensync
+++ b/trunk/src/gensync/gensync
@@ -22,7 +22,11 @@ import fileinput
sys.path.insert(0, "/usr/lib/portage/pym")
import portage
-from output import *
+
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
class ConfigDefaults:
def __init__(self):
diff --git a/trunk/src/gentoolkit/pprinter.py b/trunk/src/gentoolkit/pprinter.py
index 66a45f2..255c6d8 100644
--- a/trunk/src/gentoolkit/pprinter.py
+++ b/trunk/src/gentoolkit/pprinter.py
@@ -6,9 +6,14 @@
#
# $Header$
-import gentoolkit
-import output
import sys
+import gentoolkit
+
+try:
+ import portage.output as output
+except ImportError:
+ import output
+
def print_error(s):
"""Prints an error string to stderr."""
@@ -108,4 +113,4 @@ def subsection(s):
def emph(s):
"""Print a string as emphasized."""
- return output.white(s) \ No newline at end of file
+ return output.white(s)
diff --git a/trunk/src/glsa-check/glsa-check b/trunk/src/glsa-check/glsa-check
index fedba47..6d2a11b 100644
--- a/trunk/src/glsa-check/glsa-check
+++ b/trunk/src/glsa-check/glsa-check
@@ -7,7 +7,12 @@ import os
import sys
sys.path.insert(0, "/usr/lib/gentoolkit/pym")
sys.path.insert(0, "/usr/lib/portage/pym")
-from output import *
+
+try:
+ from portage.output import *
+except ImportError:
+ from output import *
+
from getopt import getopt,GetoptError
__program__ = "glsa-check"