From 39f8311c496a781502c476a2abd93b8f2286a77e Mon Sep 17 00:00:00 2001 From: genone Date: Thu, 28 Feb 2008 13:57:04 +0000 Subject: [PATCH] fix imports for portage-2.2 svn path=/; revision=475 --- trunk/src/equery/equery | 11 ++++++++--- trunk/src/gentoolkit/helpers.py | 5 ++++- trunk/src/glsa-check/glsa-check | 7 ++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index a8be5e3..1e00307 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -28,8 +28,13 @@ try: except ImportError: sys.path.insert(0, "/usr/lib/portage/pym") import portage -import portage_checksum -from portage_util import unique_array + +try: + import portage.checksum as checksum + from portage.util import unique_array +except ImportError: + import portage_checksum as checksum + from portage_util import unique_array import gentoolkit.pprinter as pp from gentoolkit.pprinter import print_info, print_error, print_warn, die @@ -924,7 +929,7 @@ class CmdCheckIntegrity(Command): return (query, opts) def getMD5sum(self, file): - return portage_checksum.perform_md5(file, calc_prelink=1) + return checksum.perform_md5(file, calc_prelink=1) def perform(self, args): (query, opts) = self.parseArgs(args) diff --git a/trunk/src/gentoolkit/helpers.py b/trunk/src/gentoolkit/helpers.py index 7220a7d..2680fef 100644 --- a/trunk/src/gentoolkit/helpers.py +++ b/trunk/src/gentoolkit/helpers.py @@ -10,7 +10,10 @@ import portage from gentoolkit import * from package import * -from portage_util import unique_array +try: + from portage.util import unique_array +except ImportError: + from portage_util import unique_array def find_packages(search_key, masked=False): """Returns a list of Package objects that matched the search key.""" diff --git a/trunk/src/glsa-check/glsa-check b/trunk/src/glsa-check/glsa-check index 07d1005..241d3cb 100644 --- a/trunk/src/glsa-check/glsa-check +++ b/trunk/src/glsa-check/glsa-check @@ -306,7 +306,12 @@ if mode == "test": # mail mode as requested by solar if mode == "mail": - import portage_mail, socket + try: + import portage.mail as portage_mail + except ImportError: + import portage_mail + + import socket from StringIO import StringIO from email.mime.text import MIMEText -- 2.26.2