Permalink
Browse files

Get rid of the rhpl dependency

  • Loading branch information...
1 parent 736c07a commit dcb75a796ff942a689818494595e45cc6dc940fb @dagwieers committed Sep 1, 2011
View
@@ -21,7 +21,6 @@ BuildRequires: /usr/bin/python2
Requires: createrepo
Requires: python >= 2.0
Requires: pyOpenSSL
-Requires: rhpl
Obsoletes: yam <= %{version}
%description
@@ -13,8 +13,6 @@
import string
-from rhpl.translate import _, N_
-
neededCaps = {"caneatCheese": {'version':"21"},
"supportsAutoUp2dateOption": {'version': "1"},
"registration.finish_message": {'version': "1"},
@@ -89,8 +87,8 @@ def parseCapVersion(self, versionString):
def validateCap(self, cap, capvalue):
if not self.data.has_key(cap):
- errstr = _("This client requires the server to support %s, which the current " \
- "server does not support") % cap
+ errstr = "This client requires the server to support %s, which the current " \
+ "server does not support" % cap
self.missingCaps[cap] = None
else:
data = self.data[cap]
@@ -9,8 +9,6 @@
import string
import sys
-from rhpl.translate import _, N_
-
import capabilities
import config
import up2dateErrors
@@ -17,8 +17,6 @@
import string
import sys
-from rhpl.translate import _, N_
-
#cfg = None
# XXX: This could be moved in a more "static" location if it is too
@@ -188,7 +186,7 @@ def save(self):
# and fails (see #130391)
if not os.access(self.fileName, os.R_OK):
if not os.access(os.path.dirname(self.fileName), os.R_OK):
- print _("%s was not found" % os.path.dirname(self.fileName))
+ print "%s was not found" % os.path.dirname(self.fileName)
return
f = open(self.fileName, "w")
@@ -334,7 +332,7 @@ def initUp2dateConfig(file = "/etc/sysconfig/rhn/up2date"):
uuidCfg = UuidConfig()
uuidCfg.load()
if uuidCfg['rhnuuid'] == None or uuidCfg['rhnuuid'] == "UNSPECIFIED":
- print _("No rhnuuid config option found in /etc/sysconfig/rhn/up2date-uuid.")
+ print "No rhnuuid config option found in /etc/sysconfig/rhn/up2date-uuid."
sys.exit(1)
cfg['rhnuuid'] = uuidCfg['rhnuuid']
@@ -22,8 +22,6 @@
from up2date_client import rpcServer
from up2date_client import up2dateUtils
-from rhpl.translate import _, N_
-
import genericRepo
import urlUtils
import genericSolveDep
@@ -106,7 +104,7 @@ def getHeader(self, package, msgCallback = None, progressCallback = None):
hdr['release'])] = hdr
nohdr = 0
except:
- print _("There was an error downloading:"), "%s" % url
+ print "There was an error downloading:", "%s" % url
nohdr = 1
return hdr
@@ -17,7 +17,6 @@
from rhn import rpclib
-from rhpl.translate import _, N_
@@ -183,7 +182,7 @@ def getChannels(force=None, label_whitelist=None):
selected_channels.addChannel(channel)
if len(selected_channels.list) == 0:
- raise up2dateErrors.NoChannelsError(_("This system may not be updated until it is associated with a channel."))
+ raise up2dateErrors.NoChannelsError("This system may not be updated until it is associated with a channel.")
return selected_channels
@@ -6,7 +6,6 @@
sys.path.insert(0, "/usr/share/rhn/")
sys.path.insert(1,"/usr/share/rhn/up2date_client")
-from rhpl.translate import _, N_
import up2dateErrors
import up2dateMessages
import rpmUtils
@@ -22,8 +22,6 @@
#import wrapperUtils
from rhn import rpclib
-from rhpl.translate import _, N_
-
def stdoutMsgCallback(msg):
print msg
@@ -197,7 +195,7 @@ def getServer(refreshCallback=None):
# require RHNS-CA-CERT file to be able to authenticate the SSL connections
for rhns_ca_cert in rhns_ca_certs:
if not os.access(rhns_ca_cert, os.R_OK):
- msg = "%s: %s" % (_("ERROR: can not find RHNS CA file:"),
+ msg = "%s: %s" % ("ERROR: can not find RHNS CA file:",
rhns_ca_cert)
log.log_me("%s" % msg)
print msg
@@ -235,8 +233,8 @@ def doCall(method, *args, **kwargs):
try:
ret = apply(method, args, kwargs)
except KeyboardInterrupt:
- raise up2dateErrors.CommunicationError(_(
- "Connection aborted by the user"))
+ raise up2dateErrors.CommunicationError(
+ "Connection aborted by the user")
# if we get a socket error, keep tryingx2
except (socket.error, socket.sslerror), e:
log.log_me("A socket error occurred: %s, attempt #%s" % (
@@ -279,7 +277,7 @@ def doCall(method, *args, **kwargs):
# the servers are being throttle to pay users only, catch the
# exceptions and display a nice error message
if abs(errCode) == 51:
- log.log_me(_("Server has refused connection due to high load"))
+ log.log_me("Server has refused connection due to high load")
raise up2dateErrors.CommunicationError(e.errmsg)
# if we get a 404 from our server, thats pretty
# fatal... no point in retrying over and over. Note that
@@ -41,7 +41,6 @@
from rhn import rpclib
-from rhpl.translate import _, N_
BUFFER_SIZE = 8092
@@ -346,7 +345,7 @@ def getHeader(self, pkg, msgCallback = None, progressCallback = None):
except:
os.close(fd)
self.ts.popVSFlags()
- raise up2dateErrors.RpmError(_("Error reading header"))
+ raise up2dateErrors.RpmError("Error reading header")
self.ts.popVSFlags()
os.close(fd)
self.headerCache[up2dateUtils.pkgToStringArch(pkg)] = hdr
@@ -384,8 +383,7 @@ def getHeader(self, pkg, msgCallback = None, progressCallback = None):
hdr = self.ts.hdrFromFdno(fd)
except:
os.close(fd)
- raise up2dateErrors.RpmError(_(
- "Error reading header"))
+ raise up2dateErrors.RpmError("Error reading header")
os.close(fd)
self.log.log_me("Reading header from: %s" % fileNames)
self.headerCache[up2dateUtils.pkgToStringArch(pkg)] = hdr
@@ -457,7 +455,7 @@ def __readHeaderFromRpm(self, fileNames, pkg):
except:
os.close(fd)
self.ts.popVSFlags()
- raise up2dateErrors.RpmError(_("Error reading header"))
+ raise up2dateErrors.RpmError("Error reading header")
self.ts.popVSFlags()
os.close(fd)
self.log.log_me("Reading header from: %s" % fileNames)
@@ -640,8 +638,7 @@ def getHeader(self, pkg, lite = None,
try:
ret = self.s.up2date.header(up2dateAuth.getSystemId(), pkg)
except KeyboardInterrupt:
- raise up2dateErrors.CommunicationError(_(
- "Connection aborted by the user"))
+ raise up2dateErrors.CommunicationError("Connection aborted by the user")
except (socket.error, socket.sslerror), e:
if len(e.args) > 1:
raise up2dateErrors.CommunicationError(e.args[1])
@@ -650,8 +647,7 @@ def getHeader(self, pkg, lite = None,
except rpclib.ProtocolError, e:
raise up2dateErrors.CommunicationError(e.errmsg)
except rpclib.ResponseError:
- raise up2dateErrors.CommunicationError(
- "Broken response from the server.");
+ raise up2dateErrors.CommunicationError("Broken response from the server.");
except rpclib.Fault, f:
raise up2dateErrors.CommunicationError(f.faultString)
@@ -9,7 +9,6 @@
import glob
from rhn import rpclib
-from rhpl.translate import _, N_
def factory(aClass, *args, **kwargs):
@@ -30,7 +30,6 @@
import string
-from rhpl.translate import _, N_
from up2date_client import up2dateLog
# mainly here to make conflicts resolution cleaner
@@ -255,7 +254,7 @@ def checkHeaderForFileConfigExcludes(h,package,ts):
if fnmatch.fnmatch(fileNames[f_i],pattern):
# got to get a better string to use here
- removedList.append((package, _("File Name/pattern")))
+ removedList.append((package, "File Name/pattern"))
fflag = 1
break
# if we found a matching file, no need to
@@ -280,7 +279,7 @@ def checkHeaderForFileConfigExcludes(h,package,ts):
# check if config file and if so, if modified
if checkModified(f_i, fileNames, fileMD5s,
installedFileNames, installedFileMD5s):
- removedList.append((package, _("Config modified")))
+ removedList.append((package, "Config modified"))
fflag = 1
break
@@ -455,7 +454,7 @@ def getInstalledPackageList(msgCallback = None, progressCallback = None,
if msgCallback != None:
- msgCallback(_("Getting list of packages installed on the system"))
+ msgCallback("Getting list of packages installed on the system")
_ts = transaction.initReadOnlyTransaction()
count = 0
@@ -505,9 +504,9 @@ def runTransaction(ts, rpmCallback, transdir=None):
transdir = cfg['storageDir']
deps = ts.check()
if deps:
- raise up2dateErrors.DependencyError(_(
+ raise up2dateErrors.DependencyError(
"Dependencies should have already been resolved, "\
- "but they are not."), deps)
+ "but they are not.", deps)
rc = ts.run(rpmCallback, transdir)
if rc:
errors = "\n"
@@ -516,13 +515,13 @@ def runTransaction(ts, rpmCallback, transdir=None):
errors = errors + e[1] + "\n"
except:
errors = errors + str(e) + "\n"
- raise up2dateErrors.TransactionError(_(
- "Failed running transaction of packages: %s") % errors, deps=rc)
+ raise up2dateErrors.TransactionError(
+ "Failed running transaction of packages: %s" % errors, deps=rc)
elif type(rc) == type([]) and not len(rc):
# let the user know whats wrong
log = up2dateLog.initLog()
log.log_me("Failed running rpm transaction - %pre %pro failure ?.")
- raise up2dateErrors.RpmError(_("Failed running rpm transaction"))
+ raise up2dateErrors.RpmError("Failed running rpm transaction")
def readHeader(filename):
if not os.access(filename, os.R_OK):
@@ -549,9 +548,9 @@ def readHeaderBlob(blob, filename=None):
hdr = rpm.headerLoad(blob)
except:
if filename:
- print _("rpm was unable to load the header: %s" % filename)
+ print "rpm was unable to load the header: %s" % filename
else:
- print _("rpm was unable to load a header")
+ print "rpm was unable to load a header"
return None
# Header successfully read
#print hdr['name']
@@ -19,17 +19,15 @@
import up2dateLog
import wrapperUtils
-from rhpl.translate import _, N_
-
# The format for sources v1 is stupid. each entry can only be one line
# each different source type has different info (aieee!) # comment stuff out (duh)
SOURCESFILE="/etc/sysconfig/rhn/sources"
def showError(line):
- print _("Error parsing %s") % SOURCESFILE
- print _("at line: %s") % line
+ print "Error parsing %s" % SOURCESFILE
+ print "at line: %s" % line
class SourcesConfigFile:
"class for parsing out the up2date/apt/yum src repo info"
@@ -223,7 +221,7 @@ def parseRepomd(self, line):
try:
from repoBackends import yumBaseRepo
except ImportError:
- self.log.log_me(_("Unable to import repomd so repomd support will not be available"))
+ self.log.log_me("Unable to import repomd so repomd support will not be available")
return
yb = yumBaseRepo.initYumRepo()
Oops, something went wrong.

0 comments on commit dcb75a7

Please sign in to comment.