From 96d7f3e7e678a8ac9919ce628c2f792d4cb57955 Mon Sep 17 00:00:00 2001 From: Ján ONDREJ Date: Wed, 4 Jun 2008 06:38:02 +0000 Subject: 2008-06-04 Ján ONDREJ (via ondrejj@fedoraproject.org) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * po/sk.po: Typo fix. --- anaconda | 182 +++++++----------------- anaconda.spec | 77 +++++++++- autopart.py | 15 +- backend.py | 4 +- bootloader.py | 4 +- cmdline.py | 3 +- constants.py | 4 +- dispatch.py | 2 - exception.py | 20 +-- firewall.py | 4 +- fsset.py | 64 ++++++--- gui.py | 9 +- image.py | 11 +- installclass.py | 298 ++++----------------------------------- installclasses/fedora.py | 10 +- installclasses/rhel.py | 14 +- instdata.py | 18 +-- iscsi.py | 5 +- isys/isys.py | 13 +- iutil.py | 123 ++++++++++++++-- iw/GroupSelector.py | 61 ++------ iw/account_gui.py | 6 +- iw/autopart_type.py | 9 +- iw/blpasswidget.py | 4 +- iw/bootloader_main_gui.py | 5 +- iw/congrats_gui.py | 10 +- iw/examine_gui.py | 4 +- iw/iw_gui.py | 4 +- iw/language_gui.py | 5 +- iw/lvm_dialog_gui.py | 5 +- iw/netconfig_dialog.py | 4 +- iw/network_gui.py | 5 +- iw/osbootwidget.py | 3 +- iw/package_gui.py | 5 +- iw/partition_dialog_gui.py | 4 +- iw/partition_gui.py | 9 +- iw/partition_ui_helpers_gui.py | 4 +- iw/partmethod_gui.py | 5 +- iw/pixmapRadioButtonGroup_gui.py | 3 +- iw/progress_gui.py | 1 - iw/raid_dialog_gui.py | 5 +- iw/task_gui.py | 8 +- iw/timezone_gui.py | 9 +- iw/upgrade_bootloader_gui.py | 5 +- iw/upgrade_migratefs_gui.py | 6 +- iw/upgrade_swap_gui.py | 4 +- iw/welcome_gui.py | 5 +- iw/zipl_gui.py | 4 +- kickstart.py | 205 +++++++++++++++++++-------- lang-table | 7 +- language.py | 7 +- livecd.py | 28 +++- loader2/init.c | 74 +--------- loader2/loader.c | 48 +++++++ loader2/loader.h | 1 + loader2/method.c | 1 - loader2/method.h | 1 + loader2/urlinstall.c | 3 + network.py | 4 +- packages.py | 46 +----- partErrors.py | 18 +-- partIntfHelpers.py | 3 +- partRequests.py | 4 +- partedUtils.py | 43 +++--- partitions.py | 30 +++- po/sk.po | 2 +- rescue.py | 4 +- scripts/buildinstall | 20 +++ scripts/getlangnames.py | 6 +- scripts/mk-images | 3 +- scripts/upd-instroot | 7 +- text.py | 108 +------------- textw/bootloader_text.py | 4 +- textw/complete_text.py | 3 +- textw/constants_text.py | 2 +- textw/grpselect_text.py | 37 +---- textw/keyboard_text.py | 4 +- textw/language_text.py | 4 +- textw/network_text.py | 4 +- textw/partition_text.py | 5 +- textw/partmethod_text.py | 4 +- textw/progress_text.py | 4 +- textw/task_text.py | 6 +- textw/timezone_text.py | 7 +- textw/upgrade_bootloader_text.py | 5 +- textw/upgrade_text.py | 4 +- textw/userauth_text.py | 5 +- textw/welcome_text.py | 3 +- textw/zipl_text.py | 5 +- upgrade.py | 16 ++- vnc.py | 10 +- xsetup.py | 81 ----------- yuminstall.py | 189 ++++++++++++++++--------- zfcp.py | 4 +- 94 files changed, 1014 insertions(+), 1147 deletions(-) delete mode 100644 xsetup.py diff --git a/anaconda b/anaconda index f5842ac61..9d3071d70 100755 --- a/anaconda +++ b/anaconda @@ -94,8 +94,9 @@ def startMiniWM(root='/'): return childpid # function to handle X startup special issues for anaconda -def doStartupX11Actions(): +def doStartupX11Actions(runres="800x600"): global miniwm_pid + import gtk if not flags.test and flags.setupFilesystems: setupGraphicalLinks() @@ -105,7 +106,6 @@ def doStartupX11Actions(): miniwm_pid = startMiniWM() log.info("Started mini-wm") - import gtk i = gtk.Invisible() i.selection_owner_set("_ANACONDA_MINI_WM_RUNNING") except: @@ -116,6 +116,17 @@ def doStartupX11Actions(): # we open and close an X connection in the xutils calls # the X server will exit since this is the first X # connection (if miniwm isnt running) + current_res = "%sx%s" %(gtk.gdk.screen_width(), gtk.gdk.screen_height()) + if runres != current_res and miniwm_pid is not None: + try: + isys.vtActivate(6) + iutil.execWithRedirect("xrandr", ["-s", runres], + stdout="/dev/tty5", stderr="/dev/tty5") + time.sleep(5) + except: + pass + + if miniwm_pid is not None: import xutils @@ -201,9 +212,7 @@ def setupPythonUpdates(): def parseOptions(): def resolution_cb (option, opt_str, value, parser): - global runres_override parser.values.runres = value - runres_override = True def rootpath_cb (option, opt_str, value, parser): if value.startswith("cd:"): @@ -351,14 +360,26 @@ def setupPythonPath(): sys.path.append('/usr/share/system-config-date') +def addPoPath(dir): + """ Looks to see what translations are under a given path and tells + the gettext module to use that path as the base dir """ + for d in os.listdir(dir): + if not os.path.isdir("%s/%s" %(dir,d)): + continue + if not os.path.exists("%s/%s/LC_MESSAGES" %(dir,d)): + continue + for basename in os.listdir("%s/%s/LC_MESSAGES" %(dir,d)): + if not basename.endswith(".mo"): + continue + log.info("setting %s as translation source for %s" %(dir, basename[:-3])) + gettext.bindtextdomain(basename[:-3], dir) + def setupTranslations(): if os.path.isdir("/mnt/source/RHupdates/po"): - log.info("adding RHupdates/po") addPoPath("/mnt/source/RHupdates/po") if os.path.isdir("/tmp/updates/po"): - log.info("adding /tmp/updates/po") addPoPath("/tmp/updates/po") - textdomain("anaconda") + gettext.textdomain("anaconda") def setupEnvironment(): # Silly GNOME stuff @@ -402,13 +423,13 @@ def expandFTPMethod(opts): opts.method = opts.method[:len(opts.method) - 1] os.unlink(filename) -def runVNC(vncStartedCB=None): +def runVNC(): # dont run vncpassword if in test mode global vncS if flags.test: vncS.password = "" - vncS.startServer(vncStartedCB=vncStartedCB) + vncS.startServer() child = os.fork() if child == 0: @@ -447,25 +468,6 @@ def checkMemory(opts): opts.display_mode = 't' time.sleep(2) -def probeHW(opts, x_already_set, xserver): - if not opts.isHeadless: - # - # Probe what is available for X and setup a hardware state - # - # try to probe interesting hw - xserver.probeHW(forceDriver=opts.xdriver) - - # if the len(videocards) is zero, then let's assume we're isHeadless - if len(xserver.videohw.videocards) == 0: - stdoutLog.info (_("No video hardware found, assuming headless")) - opts.isHeadless = 1 - else: - # setup a X hw state for use later with configuration. - try: - xserver.setHWState() - except Exception, e: - stdoutLog.error (_("Unable to instantiate a X hardware state object.")) - def setupGraphicalLinks(): for i in ( "imrc", "im_palette.pal", "gtk-2.0", "pango", "fonts", "fb.modes"): @@ -475,23 +477,6 @@ def setupGraphicalLinks(): except: pass -def badEDID(logfile): - retval = False - f = open(logfile, "r") - pattern = re.compile("^.*Monitor name: .*KVM.*$") - - while True: - line = f.readline() - if line == "": - break - - if pattern.match(line): - retval = True - break - - f.close() - return retval - class Anaconda: def __init__(self): self.intf = None @@ -619,14 +604,15 @@ if __name__ == "__main__": from exception import handleException import dispatch import warnings - import rhpl import vnc import users import kickstart from flags import flags - from rhpl.translate import _, textdomain, addPoPath - if rhpl.getArch() != "s390" and os.access("/dev/tty3", os.W_OK): + import gettext + _ = lambda x: gettext.ldgettext("anaconda", x) + + if not iutil.isS390() and os.access("/dev/tty3", os.W_OK): logger.addFileHandler ("/dev/tty3", log) warnings.showwarning = AnacondaShowWarning @@ -644,12 +630,10 @@ if __name__ == "__main__": iutil.writeRpmPlatform() extraModules = [] # XXX: this would be better as a callback - runres_override = False graphical_failed = 0 instClass = None # the install class to use vncS = vnc.VncServer() # The vnc Server object. xserver_pid = None - got_bad_edid = False (opts, args) = parseOptions() @@ -721,7 +705,7 @@ if __name__ == "__main__": flags.virtpconsole = opts.virtpconsole # probing for hardware on an s390 seems silly... - if rhpl.getArch() == "s390": + if iutil.isS390(): opts.isHeadless = True if not flags.test and not flags.rootpath: @@ -828,14 +812,6 @@ if __name__ == "__main__": import instdata - if not opts.isHeadless: - try: - import xsetup - import rhpxl.xhwstate - import rhpxl.xserver - import rhpxl.monitor - except ImportError: - opts.isHeadless = 1 import rhpl.keyboard as keyboard log.info("anaconda called with cmdline = %s" %(sys.argv,)) @@ -860,32 +836,11 @@ if __name__ == "__main__": else: x_already_set = 0 - if not opts.isHeadless: - xserver = rhpxl.xserver.XServer() - xserver.resolution = opts.runres - # hack for PS3 video (#236510) - if rhpl.getArch() == "ppc": - try: - (x, y, bpp) = isys.fbinfo() - if x < 800 or y < 600: - xserver.resolution = "640x480" - except Exception, e: - log.debug("error getting fbinfo: %s" %(e,)) - else: - xserver = None - - probeHW(opts, x_already_set, xserver) - - # - # delay to let use see status of attempt to probe hw - # - time.sleep(3) - # # now determine if we're going to run in GUI or TUI mode # # if no X server, we have to use text mode - if not (flags.test or flags.rootpath or x_already_set) and (rhpl.getArch() != "s390" and not os.access("/usr/bin/Xorg", os.X_OK)): + if not (flags.test or flags.rootpath or x_already_set) and (not iutil.isS390() and not os.access("/usr/bin/Xorg", os.X_OK)): stdoutLog.warning(_("Graphical installation not available... " "Starting text mode.")) time.sleep(2) @@ -902,31 +857,21 @@ if __name__ == "__main__": # if DISPLAY not set either vnc server failed to start or we're not # running on a redirected X display, so start local X server if opts.display_mode == 'g' and not os.environ.has_key('DISPLAY') and not flags.usevnc: - rhpxl.xhwstate.get_valid_resolution(xserver) - - xserver.logfile = "/tmp/X.log" - try: - xserver.generateConfig() - xserver.addExtraScreen("Anaconda") - xserver.display = ":1" - xserver.serverflags.extend(["-screen", "Anaconda", "-dpi", "96", "-br", "-extension", "GLX", "-ardelay", "500", "-arinterval", "50"]) - xserver_pid = xserver.startX(xStartedCB=doStartupX11Actions) - except RuntimeError: + xout = open("/dev/tty5", "w") + proc = subprocess.Popen(["Xorg", "-br", "-logfile", "/tmp/X.log", ":1", "vt6", "-s", "1440", "-ac", "-nolisten", "tcp"], close_fds=True, stdout=xout, stderr=xout) + time.sleep(5) + if proc.poll() is not None: + raise OSError + os.environ["DISPLAY"] = ":1" + doStartupX11Actions(opts.runres) + xserver_pid = proc.pid + except OSError: stdoutLog.warning(" X startup failed, falling back to text mode") opts.display_mode = 't' graphical_failed = 1 time.sleep(2) - # If we got bad EDID information from the X server, that means X was - # unable to probe the monitor correctly. This can happen with lots of - # crappy KVMs. For now, switch to text mode and display an error message - # so the user knows to run s-c-display after installation. - if xserver_pid is not None and badEDID(xserver.logfile): - os.kill(xserver_pid, signal.SIGTERM) - got_bad_edid = True - opts.display_mode = 't' - if opts.display_mode == 't' and graphical_failed and not anaconda.isKickstart: ret = vnc.askVncWindow() if ret != -1: @@ -937,42 +882,17 @@ if __name__ == "__main__": # if they want us to use VNC do that now if opts.display_mode == 'g' and flags.usevnc: - runVNC(doStartupX11Actions) + runVNC() + doStartupX11Actions(opts.runres) anaconda.setInstallInterface(opts.display_mode) - if got_bad_edid: - msg = "anaconda was unable to detect your monitor, possibly due to the presence of a KVM. The installation will proceed in text mode. Please run system-config-display after installation to configure your monitor." - if anaconda.isKickstart: - log.warning(msg) - else: - anaconda.intf.messageWindow("Unknown monitor", msg) - anaconda.setBackend(instClass) anaconda.id = instClass.installDataClass(anaconda, extraModules, anaconda.methodstr, opts.display_mode, anaconda.backend) anaconda.id.x_already_set = x_already_set - if xserver: - if xserver.videohw: - anaconda.id.setVideoCard(xserver.videohw) - - if xserver.monitorhw: - anaconda.id.setMonitor(xserver.monitorhw) - - # not sure what to do here - somehow we didn't detect anything - if xserver.hwstate is None and not opts.isHeadless: - try: - xserver.setHWState() - except Exception, e: - stdoutLog.error (_("Unable to instantiate a X hardware state object.")) - xserver.hwstate = None - - if xserver.hwstate is not None: - xsetup = xsetup.XSetup(xserver, anaconda) - anaconda.id.setXSetup(xsetup) - anaconda.id.setDisplayMode(opts.display_mode) instClass.setInstallData(anaconda) @@ -1014,13 +934,13 @@ if __name__ == "__main__": # this is lame, but make things match what we expect (#443408) opts.lang = opts.lang.replace(".utf8", ".UTF-8") anaconda.dispatch.skipStep("language", permanent = 1) - instClass.setLanguage(anaconda.id, opts.lang) - instClass.setLanguageDefault(anaconda.id, opts.lang) + anaconda.id.instLanguage.setRuntimeLanguage(opts.lang) + anaconda.id.instLanguage.setDefault(opts.lang) anaconda.id.timezone.setTimezoneInfo(anaconda.id.instLanguage.getDefaultTimeZone()) if opts.keymap: anaconda.dispatch.skipStep("keyboard", permanent = 1) - instClass.setKeyboard(anaconda.id, opts.keymap) + anaconda.id.keyboard.set(opts.keymap) anaconda.id.keyboard.activate() if anaconda.isKickstart: @@ -1048,7 +968,7 @@ if __name__ == "__main__": # set up the headless case if opts.isHeadless == 1: anaconda.id.setHeadless(opts.isHeadless) - instClass.setAsHeadless(anaconda.dispatch, opts.isHeadless) + anaconda.dispatch.skipStep("keyboard", permanent = 1) if not anaconda.isKickstart: instClass.setSteps(anaconda) diff --git a/anaconda.spec b/anaconda.spec index bdfd7b566..252185c4e 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -2,7 +2,7 @@ Summary: Graphical system installer Name: anaconda -Version: 11.4.0.78 +Version: 11.4.1.2 Release: 1 License: GPLv2+ Group: Applications/System @@ -106,6 +106,7 @@ Requires: rhpxl >= %{rhpxlver} Requires: system-config-keyboard %endif Requires: hal, dbus-python +Requires: cracklib-python %ifarch %livearches Requires: usermode Requires: zenity @@ -207,6 +208,80 @@ desktop-file-install --vendor="" --dir=%{buildroot}%{_datadir}/applications %{bu /sbin/chkconfig --del reconfig >/dev/null 2>&1 || : %changelog +* Thu May 29 2008 Chris Lumens - 11.4.1.2-1 +- Allow ext4 migration again for testing at least (katzj) +- Remount filesystems after migration (#440055) (katzj) +- Add blkid to the keepfiles list so jkeating will whine less (pjones) +- Don't allow vfat /boot (katzj) +- Use the base yum doConfigSetup method. (clumens) +- Include the yum repo files from fedora-release in stage2. (clumens) +- No longer maintain our own list of extra repos. (clumens) +- Sort the repos in the UI. (clumens) +- Add cost, includepkgs, and excludepkgs to the ks repo + objects (#448501). (clumens) +- Stop pretending to support Greek text mode (#208841) (katzj) +- Make it clear you need to reboot to use the installed + system (#238297) (katzj) +- Activate LVM for when we do meta-resizing (#441706) (katzj) +- List Norweigian as Bokmål (#437355) (katzj) +- Simplify the install classes. (clumens) +- Don't show the EFI filesystem unless we're on an EFI platform (katzj) +- Add nfsv4 so that we don't nuke them on upgrades (#448145) (katzj) +- When there are errors reading the live CD, offer a retry. (clumens) +- Can't recover from buildTransaction errors on a per-repo + basis (#447796). (clumens) +- Set default partition size to 200 MB in the custom partitioning + UI. (clumens) +- Limit the size of things in exception dumps to 1k. (clumens) +- Catch IOErrors one place they seem to happen most. (clumens) +- Add a unique user agent for anaconda's grabbing in stage2 (katzj) +- Remove text mode help support as well. (clumens) +- Check for all the non-mkfs utilities required for each filesystem + type. (clumens) +- More partitioning error handling fixes (#446453). (clumens) +- Require cracklib-python for the rootpassword screen. (notting) +- Use pykickstart's deprecated versions of the xconfig and monitor + classes. (clumens) +- Fix tyop in upgrade migrate screen (#446363) (katzj) + +* Tue May 13 2008 Jeremy Katz - 11.4.1.1-1 +- Just call the XStartupCB() function directly and randr to the + desired resolution (katzj) +- Stop writing out an xorg.conf (katzj) +- Make the "dump to removable device" option work in anaconda. (jgranado) + +* Mon May 12 2008 Jeremy Katz - 11.4.0.79-1 +- Stop neutering DRI (notting) +- make scripts/buildinstall take multiple repos (wwoods) +- Don't worry about telling people that interactive text mode is in + wrong lang (katzj) +- Allow cpio updates.img in the tree for URL installs. (dlehman) +- Declare unpackCpioBall for use from within urlinstall.c. (dlehman) +- Don't unlink an image we retrieved but could not mount as it + could be .cgz. (dlehman) +- Don't run lspci with an explicit path (katzj) +- Include lspci on all images (#445974) (katzj) +- Add support for attaching gdbserver to the loader early on. (clumens) +- Add virtio max partition count (markmc) +- Sort virtio devices first (markmc) +- Merge branch 'master' of ssh://git.fedorahosted.org/git/anaconda (andrewm) +- 2008-05-08 Andrew Martynov - 11.4.0.78-1 - Write per-interface DNS info to ifcfg files (#443244) (dcantrell) - Clean up sanityCheckHostname() in network.py (dcantrell) diff --git a/autopart.py b/autopart.py index 4e624fd7d..1028b5de4 100644 --- a/autopart.py +++ b/autopart.py @@ -26,7 +26,6 @@ import string, sys import fsset import lvm import logging -import rhpl from anaconda_log import logger, logFile import cryptodev import partedUtils @@ -34,13 +33,15 @@ import partRequests from constants import * from partErrors import * -from rhpl.translate import _, N_ - import iutil import isys log = logging.getLogger("anaconda") +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + + PARTITION_FAIL = -1 PARTITION_SUCCESS = 0 @@ -80,7 +81,7 @@ def bootRequestCheck(req, diskset): elif req.mountpoint == "/boot/efi": if not part.fs_type.name in ["fat16", "fat32"]: return BOOTEFI_NOT_VFAT - elif rhpl.getArch() == "alpha": + elif iutil.isAlpha(): return bootAlphaCheckRequirements(part) elif (iutil.getPPCMachine() == "pSeries" or iutil.getPPCMachine() == "iSeries"): @@ -272,7 +273,7 @@ def fitConstrained(diskset, requests, primOnly=0, newParts = None): disk.add_partition (newp, constraint) except parted.error, msg: - raise PartitioningError, msg + raise PartitioningError, str(msg) for flag in request.fstype.getPartedPartitionFlags(): if not newp.is_flag_available(flag): disk.delete_partition(newp) @@ -412,7 +413,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): startSec = freeStartSec # For alpha reserve space at the begining of disk - if rhpl.getArch() == "alpha" and startSec < long((1024L * 1024L)/disk.dev.sector_size): + if iutil.isAlpha() and startSec < long((1024L * 1024L)/disk.dev.sector_size): startSec = long((2 * 1024L * 1024L)/disk.dev.sector_size) endSec = startSec + long(((request.requestSize * 1024L * 1024L) / disk.dev.sector_size)) - 1 @@ -475,7 +476,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): try: disk.add_partition (newp, constraint) except parted.error, msg: - raise PartitioningError, msg + raise PartitioningError, str(msg) for flag in request.fstype.getPartedPartitionFlags(): if not newp.is_flag_available(flag): disk.delete_partition(newp) diff --git a/backend.py b/backend.py index c59ac4cb5..6acb67d9f 100644 --- a/backend.py +++ b/backend.py @@ -30,11 +30,13 @@ from constants import * import kickstart import packages -from rhpl.translate import _ from flags import flags log = logging.getLogger("anaconda") +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class NoSuchGroup(Exception): def __init__ (self, value): self.value = value diff --git a/bootloader.py b/bootloader.py index 5d603fccd..1a60b9d12 100644 --- a/bootloader.py +++ b/bootloader.py @@ -26,11 +26,11 @@ import partedUtils import os, sys import iutil import string -import rhpl from flags import flags from constants import * -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/cmdline.py b/cmdline.py index ecafc7c26..de14ada32 100644 --- a/cmdline.py +++ b/cmdline.py @@ -26,7 +26,8 @@ import parted from constants import * from flags import flags -from rhpl.translate import _, cat, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/constants.py b/constants.py index 0209bdc66..bc18519ec 100644 --- a/constants.py +++ b/constants.py @@ -19,7 +19,9 @@ # Author(s): Erik Troan # -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) +N_ = lambda x: x BETANAG = 1 diff --git a/dispatch.py b/dispatch.py index b9f67bb36..2e6a5bcb5 100644 --- a/dispatch.py +++ b/dispatch.py @@ -23,7 +23,6 @@ import string from types import * from constants import * -from packages import writeXConfiguration from packages import writeKSConfiguration, turnOnFilesystems from packages import doMigrateFilesystems from packages import doPostAction @@ -109,7 +108,6 @@ installSteps = [ ("writeconfig", writeConfiguration, ), ("firstboot", firstbootConfiguration, ), ("instbootloader", writeBootloader, ), - ("writexconfig", writeXConfiguration, ), ("writeksconfig", writeKSConfiguration, ), ("writeregkey", writeRegKey, ), ("setfilecon", setFileCons, ), diff --git a/exception.py b/exception.py index 080a60647..86ff6c9cb 100644 --- a/exception.py +++ b/exception.py @@ -33,19 +33,19 @@ import iutil import types import bdb import partedUtils -import rhpl from string import joinfields from cPickle import Pickler -from rhpl.translate import _ from flags import flags import kickstart +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") dumpHash = {} -# XXX do length limits on obj dumps. def dumpClass(instance, fd, level=0, parentkey="", skipList=[]): # protect from loops try: @@ -86,10 +86,12 @@ def dumpClass(instance, fd, level=0, parentkey="", skipList=[]): fd.write(", ") else: first = 0 + if type(item) == types.InstanceType: dumpClass(item, fd, level + 1, skipList=skipList) else: - fd.write("%s" % (item,)) + s = str(item) + fd.write("%s" % s[:1024]) fd.write("]\n") elif type(value) == types.DictType: fd.write("%s%s: {" % (pad, curkey)) @@ -99,20 +101,24 @@ def dumpClass(instance, fd, level=0, parentkey="", skipList=[]): fd.write(", ") else: first = 0 + if type(k) == types.StringType: fd.write("'%s': " % (k,)) else: fd.write("%s: " % (k,)) + if type(v) == types.InstanceType: dumpClass(v, fd, level + 1, parentkey = curkey, skipList=skipList) else: - fd.write("%s" % (v,)) + s = str(v) + fd.write("%s" % s[:1024]) fd.write("}\n") elif type(value) == types.InstanceType: fd.write("%s%s: " % (pad, curkey)) dumpClass(value, fd, level + 1, parentkey=curkey, skipList=skipList) else: - fd.write("%s%s: %s\n" % (pad, curkey, value)) + s = str(value) + fd.write("%s%s: %s\n" % (pad, curkey, s[:1024])) def dumpException(out, text, tb, anaconda): skipList = [ "anaconda.backend.ayum", @@ -135,8 +141,6 @@ def dumpException(out, text, tb, anaconda): "anaconda.id.keyboard.modelDict", "anaconda.id.rootPassword", "anaconda.id.tmpData", - "anaconda.id.xsetup.xserver.hwstate.monitor.monlist", - "anaconda.id.xsetup.xserver.hwstate.monitor.monids", "anaconda.intf.icw.buff", "anaconda.intf.icw.stockButtons", "dispatch.sack.excludes", diff --git a/firewall.py b/firewall.py index 8f870c91c..89ec4a21c 100644 --- a/firewall.py +++ b/firewall.py @@ -22,8 +22,10 @@ import iutil from flags import flags +from constants import * -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/fsset.py b/fsset.py index 4b99f7fda..26a02c68d 100644 --- a/fsset.py +++ b/fsset.py @@ -37,11 +37,12 @@ import partitions import partedUtils import raid import lvm +import time import types from flags import flags -import rhpl -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -57,7 +58,7 @@ class ResizeError(Exception): defaultMountPoints = ['/', '/boot', '/home', '/tmp', '/usr', '/var', '/usr/local', '/opt'] -if rhpl.getArch() == "s390": +if iutil.isS390(): # Many s390 have 2G DASDs, we recomment putting /usr/share on its own DASD defaultMountPoints.insert(5, '/usr/share') @@ -187,7 +188,7 @@ class FileSystemType: self.extraFormatArgs = [] self.maxLabelChars = 16 self.packages = [] - self.needProgram = None + self.needProgram = [] self.resizable = False self.supportsFsProfiles = False self.fsProfileSpecifier = None @@ -306,9 +307,8 @@ class FileSystemType: def isSupported(self): # check to ensure we have the binaries they need - if self.needProgram: - if len(filter(lambda d: os.path.exists("%s/%s" %(d, - self.needProgram)), + for p in self.needProgram: + if len(filter(lambda d: os.path.exists("%s/%s" %(d, p)), os.environ["PATH"].split(":"))) == 0: return False @@ -374,7 +374,7 @@ class reiserfsFileSystem(FileSystemType): self.name = "reiserfs" self.packages = [ "reiserfs-utils" ] - self.needProgram = "mkreiserfs" + self.needProgram = [ "mkreiserfs", "reiserfstune" ] self.maxSizeMB = 8 * 1024 * 1024 @@ -423,7 +423,7 @@ class xfsFileSystem(FileSystemType): self.supported = 0 self.packages = [ "xfsprogs" ] - self.needProgram = "mkfs.xfs" + self.needProgram = [ "mkfs.xfs", "xfs_admin" ] def formatDevice(self, entry, progress, chroot='/'): devicePath = entry.device.setupDevice(chroot) @@ -468,7 +468,7 @@ class jfsFileSystem(FileSystemType): self.name = "jfs" self.packages = [ "jfsutils" ] - self.needProgram = "mkfs.jfs" + self.needProgram = [ "mkfs.jfs", "jfs_tune" ] self.maxSizeMB = 8 * 1024 * 1024 @@ -511,7 +511,7 @@ class gfs2FileSystem(FileSystemType): self.name = "gfs2" self.packages = [ "gfs2-utils" ] - self.needProgram = "mkfs.gfs2" + self.needProgram = [ "mkfs.gfs2" ] self.maxSizeMB = 8 * 1024 * 1024 @@ -724,7 +724,7 @@ class ext3FileSystem(extFileSystem): self.name = "ext3" self.extraFormatArgs = [ "-j" ] self.partedFileSystemType = parted.file_system_type_get("ext3") - if 0: + if flags.cmdline.has_key("ext4"): self.migratetofs = ['ext4dev'] def formatDevice(self, entry, progress, chroot='/'): @@ -985,6 +985,8 @@ class EFIFileSystem(FATFileSystem): self.partedPartitionFlags = [ parted.PARTITION_BOOT ] self.maxSizeMB = 256 self.defaultOptions = "umask=0077,shortname=winnt" + if not iutil.isEfi(): + self.supported = 0 def getMountName(self, quoted = 0): return "vfat" @@ -1066,7 +1068,7 @@ class hfsFileSystem(FileSystemType): self.checked = 0 self.name = "hfs" self.supported = 0 - self.needProgram = "hformat" + self.needProgram = [ "hformat" ] def isMountable(self): return 0 @@ -1150,6 +1152,18 @@ class networkFileSystem(FileSystemType): fileSystemTypeRegister(networkFileSystem()) +class nfsv4FileSystem(FileSystemType): + def __init__(self): + FileSystemType.__init__(self) + self.formattable = 0 + self.checked = 0 + self.name = "nfs4" + + def isMountable(self): + return 0 + +fileSystemTypeRegister(nfsv4FileSystem()) + class ForeignFileSystem(FileSystemType): def __init__(self): FileSystemType.__init__(self) @@ -1391,7 +1405,16 @@ class FileSystemSet: def fstab (self): format = "%-23s %-23s %-7s %-15s %d %d\n" - fstab = "" + fstab = """ +# +# /etc/fstab +# Created by anaconda on %s +# +# Accessible filesystems, by reference, are maintained under '/dev/disk' +# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info +# +""" % time.asctime() + for entry in self.entries: if entry.mountpoint: if entry.getUuid() and entry.device.doLabel is not None: @@ -1583,7 +1606,7 @@ MAILADDR root # active if iutil.isEfi() \ or iutil.getPPCMachine() in ("pSeries", "iSeries", "PMac") \ - or (rhpl.getArch() in ("i386", "x86_64") \ + or iutil.isX86() \ and partedUtils.hasGptLabel(diskset, drive)): if part and part.is_flag_available(parted.PARTITION_BOOT): part.set_flag(parted.PARTITION_BOOT, 1) @@ -1894,7 +1917,7 @@ MAILADDR root def haveMigratedFilesystems(self): return self.migratedfs - def migrateFilesystems (self, chroot='/'): + def migrateFilesystems (self, anaconda): if self.migratedfs: return @@ -1906,7 +1929,7 @@ MAILADDR root continue try: entry.origfsystem.migrateFileSystem(entry, self.messageWindow, - chroot) + anaconda.rootPath) except SystemError: if self.messageWindow: self.messageWindow(_("Error"), @@ -1918,6 +1941,13 @@ MAILADDR root % (entry.device.getDevice(),)) sys.exit(0) + # we need to unmount and remount so that we're mounted as the + # new fstype as we want to use the new filesystem type during + # the upgrade for ext3->ext4 migrations + if self.isActive(): + self.umountFilesystems(anaconda.rootPath, swapoff = False) + self.mountFilesystems(anaconda) + self.migratedfs = 1 def mountFilesystems(self, anaconda, raiseErrors = 0, readOnly = 0, skiprootfs = 0): diff --git a/gui.py b/gui.py index a9fc7c7f8..6f95ba2af 100755 --- a/gui.py +++ b/gui.py @@ -32,6 +32,7 @@ if flags.cmdline.has_key("dogtail"): import string import time import isys +import iutil import sys import parted import shutil @@ -42,11 +43,11 @@ import gettext from language import expandLangs from constants import * from network import hasActiveNetDev -import rhpl import xutils import imputil -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -80,7 +81,7 @@ stepToClass = { "complete" : ("congrats_gui", "CongratulationWindow"), } -if rhpl.getArch() == 's390': +if iutil.isS390(): stepToClass["bootloader"] = ("zipl_gui", "ZiplWindow") # @@ -764,7 +765,7 @@ class SaveExceptionWindow: elif len(dests) > 0: for d in dests: iter = store.append(None) - store[iter] = (d[0], "/dev/%s - %s" % (d[0], d[1])) + store[iter] = ("/dev/%s" % d[0], "/dev/%s - %s" % (d[0], d[1])) self.diskCombo.set_model(store) self.diskCombo.set_active(0) diff --git a/image.py b/image.py index 681cf9825..38de72c5b 100644 --- a/image.py +++ b/image.py @@ -21,18 +21,13 @@ import isys import os, os.path, stat, string, sys, sets from constants import * -import rhpl -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") -# this sucks, but we want to consider s390x as s390x in here but generally -# don't. *sigh* -if os.uname()[4] == "s390x": - _arch = "s390x" -else: - _arch = rhpl.getArch() +_arch = iutil.getArch() def findIsoImages(path, messageWindow): flush = os.stat(path) diff --git a/installclass.py b/installclass.py index 00ff5e593..8fda4b98f 100644 --- a/installclass.py +++ b/installclass.py @@ -25,14 +25,16 @@ import os, sys, iutil import isys import string import language -import rhpl import imputil import types from instdata import InstallData from autopart import getAutopartitionBoot, autoCreatePartitionRequests, autoCreateLVMPartitionRequests -from rhpl.translate import _, N_ +from constants import * + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -57,9 +59,6 @@ class BaseInstallClass(object): # list of of (txt, grplist) tuples for task selection screen tasks = [] - # dict of repoid: (baseurl, mirrorurl) tuples for additional repos - repos = {} - # don't select this class by default default = 0 @@ -88,58 +87,6 @@ class BaseInstallClass(object): def postAction(self, anaconda): anaconda.backend.postAction(anaconda) - def setBootloader(self, id, location=None, forceLBA=0, password=None, - md5pass=None, appendLine="", driveorder = [], - timeout=None): - if appendLine: - id.bootloader.args.set(appendLine) - - id.bootloader.setForceLBA(forceLBA) - - if password: - id.bootloader.setPassword(password, isCrypted = 0) - - if md5pass: - id.bootloader.setPassword(md5pass) - - if location != None: - id.bootloader.defaultDevice = location - else: - id.bootloader.defaultDevice = -1 - - if timeout: - id.bootloader.timeout = timeout - - # XXX throw out drives specified that don't exist. anything else - # seems silly - if driveorder and len(driveorder) > 0: - new = [] - for drive in driveorder: - if drive in id.bootloader.drivelist: - new.append(drive) - else: - log.warning("requested drive %s in boot drive order " - "doesn't exist" %(drive,)) - id.bootloader.drivelist = new - - def setIgnoredDisks(self, id, drives): - diskset = id.diskset - for drive in drives: - if not drive in diskset.skippedDisks: - diskset.skippedDisks.append(drive) - - def setExclusiveDisks(self, id, drives): - diskset = id.diskset - for drive in drives: - if not drive in diskset.exclusiveDisks: - diskset.exclusiveDisks.append(drive) - - def setClearParts(self, id, clear, drives = None, initAll = False): - id.partitions.autoClearPartType = clear - id.partitions.autoClearPartDrives = drives - if initAll: - id.partitions.reinitializeDisks = initAll - def setSteps(self, anaconda): dispatch = anaconda.dispatch dispatch.setStepList( @@ -177,7 +124,6 @@ class BaseInstallClass(object): "instbootloader", "dopostaction", "postscripts", - "writexconfig", "writeksconfig", "writeregkey", "methodcomplete", @@ -189,7 +135,7 @@ class BaseInstallClass(object): if not BETANAG: dispatch.skipStep("betanag", permanent=1) - if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": + if not iutil.isX86(): dispatch.skipStep("bootloader", permanent=1) # allow backends to disable interactive package selection @@ -215,16 +161,6 @@ class BaseInstallClass(object): if len(availableClasses()) < 2: dispatch.skipStep("installtype", permanent=1) - # called from anaconda so that we can skip steps in the headless case - # in a perfect world, the steps would be able to figure this out - # themselves by looking at instdata.headless. but c'est la vie. - def setAsHeadless(self, dispatch, isHeadless = 0): - if isHeadless == 0: - pass - else: - dispatch.skipStep("keyboard", permanent = 1) - dispatch.skipStep("writexconfig", permanent = 1) - # modifies the uri from installmethod.getMethodUri() to take into # account any installclass specific things including multiple base # repositories. takes a string or list of strings, returns a dict @@ -242,177 +178,8 @@ class BaseInstallClass(object): pass def setGroupSelection(self, anaconda): - pass - - def setZeroMbr(self, id, zeroMbr): - id.partitions.zeroMbr = zeroMbr - - def setKeyboard(self, id, kb): - id.keyboard.set(kb) - - def setHostname(self, id, hostname, override = False): - id.network.setHostname(hostname); - id.network.overrideDHCPhostname = override - - def setNameserver(self, id, nameserver): - id.network.setDNS(nameserver) - - def setGateway(self, id, gateway): - id.network.setGateway(gateway) - - def setTimezoneInfo(self, id, timezone, asUtc = 0): - id.timezone.setTimezoneInfo(timezone, asUtc) - - def setAuthentication(self, id, authStr): - id.auth = authStr - - def setNetwork(self, id, bootProto, ip, netmask, ethtool, device = None, onboot = 1, dhcpclass = None, essid = None, wepkey = None): - if bootProto: - devices = id.network.netdevices - firstdev = id.network.getFirstDeviceName() - if (devices and bootProto): - if not device: - if devices.has_key(firstdev): - device = firstdev - else: - list = devices.keys () - list.sort() - device = list[0] - dev = devices[device] - dev.set (("bootproto", bootProto)) - dev.set (("dhcpclass", dhcpclass)) - if onboot: - dev.set (("onboot", "yes")) - else: - dev.set (("onboot", "no")) - if bootProto == "static": - if (ip): - dev.set (("ipaddr", ip)) - if (netmask): - dev.set (("netmask", netmask)) - if ethtool: - dev.set (("ethtool_opts", ethtool)) - if isys.isWireless(device): - if essid: - dev.set(("essid", essid)) - if wepkey: - dev.set(("wepkey", wepkey)) - - def setLanguageDefault(self, id, default): - id.instLanguage.setDefault(default) - - def setLanguage(self, id, nick): - id.instLanguage.setRuntimeLanguage(nick) - - def setDesktop(self, id, desktop): - id.desktop.setDefaultDesktop (desktop) - - def setSELinux(self, id, sel): - id.security.setSELinux(sel) - - def setFirewall(self, id, enable = 1, trusts = [], ports = []): - id.firewall.enabled = enable - id.firewall.trustdevs = trusts - - for port in ports: - id.firewall.portlist.append (port) - - def setMiscXSettings(self, id, depth = None, resolution = None, - desktop = None, runlevel = None): - if depth: - id.xsetup.xserver.hwstate.set_colordepth(depth) - - if resolution: - id.xsetup.xserver.hwstate.set_resolution(resolution) - - if desktop is not None: - id.desktop.setDefaultDesktop(desktop) - if runlevel is not None: - id.desktop.setDefaultRunLevel(runlevel) - - def setMonitor(self, id, hsync = None, vsync = None, monitorName = None): - if monitorName: - usemon = monitorName - elif id.monitor.getMonitorID() != "Unprobed Monitor": - usemon = id.monitor.getMonitorName() - else: - usemon = None - - setmonitor = 0 - if usemon: - monname = usemon - try: - (model, eisa, vert, horiz) = id.monitor.lookupMonitorByName(usemon) - if id.monitor.getMonitorID() != "DDCPROBED": - useid = model - else: - useid = "DDCPROBED" - - if not vsync: - vsync = vert - if not hsync: - hsync = horiz - - id.monitor.setSpecs(hsync, vsync, id=useid, name=model) - setmonitor = 1 - except: - log.warning("Couldnt lookup monitor type %s." % usemon) - pass - else: - monname = "Unprobed Monitor" - - if not setmonitor and hsync and vsync: - id.monitor.setSpecs(hsync, vsync) - setmonitor = 1 - - if not setmonitor: - # fall back to standard VGA - log.warning("Could not probe monitor, and no fallback specified.") - log.warning("Falling back to Generic VGA monitor") - - try: - hsync = "31.5-37.9" - vsync = "50.0-61.0" - monname = "Unprobed Monitor" - id.monitor.setSpecs(hsync, vsync) - except: - raise RuntimeError, "Could not probe monitor and fallback failed." - - # shove into hw state object, force it to recompute available modes - id.xsetup.xserver.hwstate.monitor = id.monitor - id.xsetup.xserver.hwstate.set_monitor_name(monname) - id.xsetup.xserver.hwstate.set_hsync(hsync) - id.xsetup.xserver.hwstate.set_vsync(vsync) - id.xsetup.xserver.hwstate.recalc_mode() - - def setVideoCard(self, id, driver = None, videoRam = None): - if not id.videocard: - log.warning("Skipping video configuration because there's no videocard") - return - - primary = id.videocard.primaryCard() - - # rhpxl no longer gives us a list of drivers, so always just trust - # what the user gave us. - if driver: - log.info("Setting video card driver to user value of %s" % driver) - primary.setDriver(driver) - id.xsetup.xserver.hwstate.set_videocard_name(primary.getDescription()) - id.xsetup.xserver.hwstate.set_videocard_driver(driver) - - if videoRam: - # FIXME: this required casting is ugly - primary.setVideoRam(str(videoRam)) - id.xsetup.xserver.hwstate.set_videocard_ram(int(videoRam)) - - def configureX(self, id, driver = None, videoRam = None, resolution = None, depth = None, startX = 0): - self.setVideoCard(id, driver, videoRam) - - if startX: - rl = 5 - else: - rl = 3 - self.setMiscXSettings(id, depth, resolution, runlevel = rl) + grps = anaconda.backend.getDefaultGroups(anaconda) + map(lambda x: anaconda.backend.selectGroup(x), grps) def getBackend(self, methodstr): # this should be overriden in distro install classes @@ -444,21 +211,6 @@ class BaseInstallClass(object): anaconda.id.reset() anaconda.id.instClass = self - # Classes should call these on __init__ to set up install data - #id.setKeyboard() - #id.setLanguage() - #id.setNetwork() - #id.setFirewall() - #id.setLanguageDefault() - #id.setTimezone() - #id.setAuthentication() - #id.setHostname() - #id.setDesktop() - - # These are callbacks used to let classes configure packages - #id.setPackageSelection() - #id.setGroupSelection() - def __init__(self, expert): pass @@ -470,6 +222,22 @@ def availableClasses(showHidden=0): global allClasses global allClasses_hidden + def _ordering(first, second): + ((name1, obj, logo), priority1) = first + ((name2, obj, logo), priority2) = second + + if priority1 < priority2: + return -1 + elif priority1 > priority2: + return 1 + + if name1 < name2: + return -1 + elif name1 > name2: + return 1 + + return 0 + if not showHidden: if allClasses: return allClasses else: @@ -520,7 +288,7 @@ def availableClasses(showHidden=0): sortOrder = 0 if obj.__dict__.has_key('arch'): - if obj.arch != rhpl.getArch (): + if obj.arch != iutil.getArch(): obj.hidden = 1 if obj.hidden == 0 or showHidden == 1: @@ -530,7 +298,7 @@ def availableClasses(showHidden=0): if flags.debug: raise else: continue - list.sort(ordering) + list.sort(_ordering) for (item, priority) in list: if showHidden: allClasses_hidden.append(item) @@ -542,22 +310,6 @@ def availableClasses(showHidden=0): else: return allClasses -def ordering(first, second): - ((name1, obj, logo), priority1) = first - ((name2, obj, logo), priority2) = second - - if priority1 < priority2: - return -1 - elif priority1 > priority2: - return 1 - - if name1 < name2: - return -1 - elif name1 > name2: - return 1 - - return 0 - def getBaseInstallClass(): # figure out what installclass we should base on. allavail = availableClasses(showHidden = 1) diff --git a/installclasses/fedora.py b/installclasses/fedora.py index eec67a039..f140139ba 100644 --- a/installclasses/fedora.py +++ b/installclasses/fedora.py @@ -18,11 +18,13 @@ # from installclass import BaseInstallClass -from rhpl.translate import N_,_ from constants import * import os, types import iutil +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import installmethod import yuminstall @@ -45,8 +47,6 @@ class InstallClass(BaseInstallClass): (N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],), (N_("Web server"), ["web-server"])] - repos = { "Additional Fedora Software": (None, "http://mirrors.fedoraproject.org/mirrorlist?repo=%s&arch=%s" %(productVersion, rpmUtils.arch.getBaseArch())) } - def getPackagePaths(self, uri): if not type(uri) == types.ListType: uri = [uri,] @@ -60,10 +60,6 @@ class InstallClass(BaseInstallClass): BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, CLEARPART_TYPE_LINUX) - def setGroupSelection(self, anaconda): - grps = anaconda.backend.getDefaultGroups(anaconda) - map(lambda x: anaconda.backend.selectGroup(x), grps) - def setSteps(self, anaconda): BaseInstallClass.setSteps(self, anaconda); anaconda.dispatch.skipStep("partition") diff --git a/installclasses/rhel.py b/installclasses/rhel.py index 94f61ff59..d1b00eed5 100644 --- a/installclasses/rhel.py +++ b/installclasses/rhel.py @@ -18,8 +18,6 @@ # from installclass import BaseInstallClass -import rhpl -from rhpl.translate import N_ from constants import * from flags import flags import os @@ -31,6 +29,9 @@ try: except ImportError: instnum = None +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") @@ -88,10 +89,6 @@ class InstallClass(BaseInstallClass): anaconda.id.partitions, CLEARPART_TYPE_LINUX) - def setGroupSelection(self, anaconda): - grps = anaconda.backend.getDefaultGroups(anaconda) - map(lambda x: anaconda.backend.selectGroup(x), grps) - def setSteps(self, anaconda): dispatch = anaconda.dispatch BaseInstallClass.setSteps(self, dispatch); @@ -141,9 +138,8 @@ class InstallClass(BaseInstallClass): # virt is only supported on i386/x86_64. so, let's nuke it # from our repo list on other arches unless you boot with # 'linux debug' - if name.lower() == "virt" and ( \ - rhpl.getArch() not in ("x86_64","i386") - and not flags.debug): + if name.lower() == "virt" and \ + (not iutil.isX86() and not flags.debug): continue self.repopaths[name.lower()] = path log.info("Adding %s repo" % (name,)) diff --git a/instdata.py b/instdata.py index 1ae678855..4b22e8a9e 100644 --- a/instdata.py +++ b/instdata.py @@ -38,7 +38,6 @@ import zfcp import urllib import iutil import users -import rhpl import shlex from flags import * from constants import * @@ -85,7 +84,7 @@ class InstallData: self.rootParts = None self.upgradeSwapInfo = None - if rhpl.getArch() == "s390" or self.anaconda.isKickstart: + if iutil.isS390() or self.anaconda.isKickstart: self.firstboot = FIRSTBOOT_SKIP else: self.firstboot = FIRSTBOOT_DEFAULT @@ -116,18 +115,6 @@ class InstallData: def setKeyboard(self, keyboard): self.keyboard = keyboard - # expects a VideoCardInfo object - def setVideoCard(self, video): - self.videocard = video - - # expects a Monitor object - def setMonitor(self, monitor): - self.monitor = monitor - - # expects an XSetup object - def setXSetup(self, xsetup): - self.xsetup = xsetup - # expects 0/1 def setHeadless(self, isHeadless): self.isHeadless = isHeadless @@ -183,6 +170,7 @@ class InstallData: self.network.write (self.anaconda.rootPath) self.firewall.write (self.anaconda.rootPath) self.security.write (self.anaconda.rootPath) + self.desktop.write(self.anaconda.rootPath) self.users = users.Users() @@ -245,7 +233,6 @@ class InstallData: self.instLanguage.writeKS(f) if not self.isHeadless: self.keyboard.writeKS(f) - self.xsetup.writeKS(f, self.desktop, self.ksdata) self.network.writeKS(f) self.zfcp.writeKS(f) @@ -298,7 +285,6 @@ class InstallData: self.monitor = None self.videocard = None - self.xsetup = None self.isHeadless = 0 self.extraModules = extraModules self.fsset = fsset.FileSystemSet() diff --git a/iscsi.py b/iscsi.py index ea34e8568..da60d7615 100644 --- a/iscsi.py +++ b/iscsi.py @@ -18,6 +18,7 @@ # along with this program. If not, see . # +from constants import * import os import string import signal @@ -29,7 +30,9 @@ import time import md5, random log = logging.getLogger("anaconda") -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + # Note that stage2 copies all files under /sbin to /usr/sbin ISCSID="/usr/sbin/iscsid" diff --git a/isys/isys.py b/isys/isys.py index bfd379250..887843d25 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -34,7 +34,6 @@ import iutil import warnings import resource import re -import rhpl import struct import block import minihal @@ -448,14 +447,14 @@ def driveDict(klassArg): model = peddev.model # blacklist *STMF on power5 iSeries boxes - if rhpl.getArch() == "ppc" and \ + if iutil.isPPC() and \ model.find("IBM *STMF KERNEL") != -1: log.info("%s looks like STMF, ignoring" % (device,)) del peddev continue # blacklist PS3 flash - if rhpl.getArch() == "ppc" and \ + if iutil.isPPC() and \ model.find("SCEI Flash-5") != -1: log.info("%s looks like PS3 flash, ignoring" % \ (device,)) @@ -630,7 +629,7 @@ def inet_calcNetBroad (ip, nm): return (nw, bc) def doProbeBiosDisks(): - if rhpl.getArch() not in ("i386", "x86_64"): + if not iutil.isX86(): return None return _isys.biosDiskProbe() @@ -659,7 +658,7 @@ def compareDrives(first, second): type1 = 0 elif first.startswith("sd"): type1 = 1 - elif first.startswith("xvd"): + elif (first.startswith("vd") or first.startswith("xvd")): type1 = -1 else: type1 = 2 @@ -668,7 +667,7 @@ def compareDrives(first, second): type2 = 0 elif second.startswith("sd"): type2 = 1 - elif second.startswith("xvd"): + elif (second.startswith("vd") or second.startswith("xvd")): type2 = -1 else: type2 = 2 @@ -976,7 +975,7 @@ def isPaeAvailable(): return isPAE isPAE = False - if rhpl.getArch() not in ("i386", "x86_64"): + if not iutil.isX86(): return isPAE try: diff --git a/iutil.py b/iutil.py index f7c0d2c66..d0f14af4b 100644 --- a/iutil.py +++ b/iutil.py @@ -299,7 +299,7 @@ def copyDeviceNode(src, dest): # @return 1 if so, 0 otherwise. def hasiSeriesNativeStorage(): # this is disgusting and I feel very dirty - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return f = open("/proc/modules", "r") @@ -317,23 +317,61 @@ def hasiSeriesNativeStorage(): ## Get the PPC machine variety type. # @return The PPC machine type, or 0 if not PPC. def getPPCMachine(): - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return 0 - machine = rhpl.getPPCMachine() - if machine is None: + ppcMachine = None + + # ppc machine hash + ppcType = { 'Mac' : 'PMac', + 'Book' : 'PMac', + 'CHRP IBM' : 'pSeries', + 'Pegasos' : 'Pegasos', + 'Efika' : 'Efika', + 'iSeries' : 'iSeries', + 'pSeries' : 'pSeries', + 'PReP' : 'PReP', + 'CHRP' : 'pSeries', + 'Amiga' : 'APUS', + 'Gemini' : 'Gemini', + 'Shiner' : 'ANS', + 'BRIQ' : 'BRIQ', + 'Teron' : 'Teron', + 'AmigaOne' : 'Teron', + 'Maple' : 'pSeries', + 'Cell' : 'pSeries', + 'Momentum' : 'pSeries', + 'PS3' : 'PS3' + } + + f = open('/proc/cpuinfo', 'r') + lines = f.readlines() + f.close() + for line in lines: + if line.find('machine') != -1: + machine = line.split(':')[1] + elif line.find('platform') != -1: + platform = line.split(':')[1] + + for part in (machine, platform): + if ppcMachine is None and part is not None: + for type in ppcType.items(): + if part.find(type[0]) != -1: + ppcMachine = type[1] + + if ppcMachine is None: log.warning("Unable to find PowerPC machine type") - elif machine == 0: - log.warning("Unknown PowerPC machine type: %s" %(machine,)) + elif ppcMachine == 0: + log.warning("Unknown PowerPC machine type: %s" %(ppcMachine,)) - return machine + return ppcMachine ## Get the powermac machine ID. # @return The powermac machine id, or 0 if not PPC. def getPPCMacID(): machine = None - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return 0 if getPPCMachine() != "PMac": return 0 @@ -356,7 +394,7 @@ def getPPCMacGen(): # XXX: should NuBus be here? pmacGen = ['OldWorld', 'NewWorld', 'NuBus'] - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return 0 if getPPCMachine() != "PMac": return 0 @@ -383,7 +421,7 @@ def getPPCMacGen(): ## Determine if the hardware is an iBook or PowerBook # @return 1 if so, 0 otherwise. def getPPCMacBook(): - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return 0 if getPPCMachine() != "PMac": return 0 @@ -406,7 +444,7 @@ def isCell(): return cell cell = False - if rhpl.getArch() != "ppc": + if not iutil.isPPC(): return cell f = open('/proc/cpuinfo', 'r') @@ -427,7 +465,7 @@ def isMactel(): if mactel is not None: return mactel - if rhpl.getArch() not in ("x86_64", "i386"): + if not iutil.isX86(): mactel = False elif not os.path.exists("/usr/sbin/dmidecode"): mactel = False @@ -449,7 +487,7 @@ def isEfi(): return efi efi = False - if rhpl.getArch() in ("ia64", "i386", "x86_64"): + if iutil.isX86(): # XXX need to make sure efivars is loaded... if os.path.exists("/sys/firmware/efi"): efi = True @@ -459,7 +497,7 @@ def isEfi(): ## Extract the CPU feature flags from /proc/cpuinfo # @return A list of CPU feature flags, or an empty list on error. def cpuFeatureFlags(): - if rhpl.getArch() not in ("i386", "x86_64"): + if not iutil.isX86(): return False f = open("/proc/cpuinfo", "r") lines = f.readlines() @@ -538,7 +576,62 @@ def inXen(): ## Check to see if we are in a vmware environment. # def inVmware(): - out = execWithCapture("/usr/sbin/lspci", ["-vvv"]) + out = execWithCapture("lspci", ["-vvv"]) if "VMware" in out: return True return False + +# Architecture checking functions + +def isX86(bits=None): + arch = os.uname()[4] + + # x86 platforms include: + # i*86 + # athlon* + # x86_64 + # amd* + # ia32e + if bits is None: + if (arch.startswith('i') and arch.endswith('86')) or \ + arch.startswith('athlon') or arch.startswith('amd') or \ + arch == 'x86_64' or arch == 'ia32e': + return True + elif bits == 32: + if arch.startswith('i') and arch.endswith('86'): + return True + elif bits == 64: + if arch.startswith('athlon') or arch.startswith('amd') or \ + arch == 'x86_64' or arch == 'ia32e': + return True + + return False + +def isPPC(): + return os.uname()[4].startswith('ppc') + +def isS390(): + return os.uname()[4].startswith('s390') + +def isIA64(): + return os.uname()[4] == 'ia64': + +def isAlpha(): + return os.uname()[4].startswith('alpha') + +def isSparc(): + return os.uname()[4].startswith('sparc') + +def getArch(): + if isX86(bits=32): + return 'i386' + elif isX86(bits=64): + return 'x86_64' + elif isPPC(): + return 'ppc' + elif isAlpha(): + return 'alpha' + elif isSparc(): + return 'sparc' + else: + return os.uname()[4] diff --git a/iw/GroupSelector.py b/iw/GroupSelector.py index a1bb88749..eb1e7e523 100644 --- a/iw/GroupSelector.py +++ b/iw/GroupSelector.py @@ -31,6 +31,7 @@ try: except ImportError: # yum 2.9.x mdErrors = yum.Errors from yum.constants import * +import yuminstall I18N_DOMAIN="anaconda" @@ -88,52 +89,6 @@ def _getgladefile(fn): t = gettext.translation(I18N_DOMAIN, "/usr/share/locale", fallback = True) _ = t.lgettext -def getDefaultLangs(): - languages = [] - for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'): - val = os.environ.get(envar) - if val: - languages = val.split(':') - break - if 'C' not in languages: - languages.append('C') - - # now normalize and expand the languages - nelangs = [] - for lang in languages: - for nelang in gettext._expand_lang(lang): - if nelang not in nelangs: - nelangs.append(nelang) - return nelangs - - -# kind of lame caching of translations so we don't always have -# to do all the looping -strs = {} -def _xmltrans(base, thedict): - if strs.has_key(base): - return strs[base] - - langs = getDefaultLangs() - for l in langs: - if thedict.has_key(l): - strs[base] = thedict[l] - return strs[base] - strs[base] = base - return base - -def _ui_comps_sort(one, two): - if one.display_order > two.display_order: - return 1 - elif one.display_order < two.display_order: - return -1 - elif _xmltrans(one.name, one.translated_name) > \ - _xmltrans(two.name, two.translated_name): - return 1 - elif _xmltrans(one.name, one.translated_name) < \ - _xmltrans(two.name, two.translated_name): - return -1 - return 0 def _deselectPackage(ayum, group, pkg): grpid = group.groupid @@ -208,7 +163,7 @@ class OptionalPackageSelector: if parent: self.window.set_transient_for(parent) self.window.set_title(_("Packages in %s") % - _xmltrans(group.name, group.translated_name)) + yuminstall.xmltrans(group.name, group.translated_name)) self.window.set_position(gtk.WIN_POS_CENTER_ON_PARENT) self.window.set_size_request(600, 400) self._createStore() @@ -412,11 +367,11 @@ class GroupSelector: def _populateGroups(self, groups, defaultpix = None): grps = map(lambda x: self.ayum.comps.return_group(x), filter(lambda x: self.ayum.comps.has_group(x), groups)) - grps.sort(_ui_comps_sort) + grps.sort(yuminstall.ui_comps_sort) for grp in grps: if not _groupHasPackages(grp, self.ayum): continue - s = "%s" % _xmltrans(grp.name, grp.translated_name) + s = "%s" % yuminstall.xmltrans(grp.name, grp.translated_name) fn = "/usr/share/pixmaps/comps/%s.png" % grp.groupid if os.access(fn, os.R_OK): @@ -456,9 +411,9 @@ class GroupSelector: return if grp.description: - txt = _xmltrans(grp.description, grp.translated_description) + txt = yuminstall.xmltrans(grp.description, grp.translated_description) else: - txt = _xmltrans(grp.name, grp.translated_name) + txt = yuminstall.xmltrans(grp.name, grp.translated_name) inst = 0 cnt = 0 @@ -512,11 +467,11 @@ class GroupSelector: def populateCategories(self): self.catstore.clear() cats = self.ayum.comps.categories - cats.sort(_ui_comps_sort) + cats.sort(yuminstall.ui_comps_sort) for cat in cats: if not _catHasGroupWithPackages(cat, self.ayum): continue - s = "%s" % _xmltrans(cat.name, cat.translated_name) + s = "%s" % yuminstall.xmltrans(cat.name, cat.translated_name) self.catstore.append(None, [s, cat]) # select the first category diff --git a/iw/account_gui.py b/iw/account_gui.py index a3860bb09..d44bd0ce2 100644 --- a/iw/account_gui.py +++ b/iw/account_gui.py @@ -23,10 +23,13 @@ import gtk import string import gui from iw_gui import * -from rhpl.translate import _ from flags import flags +from constants import * import cracklib +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class AccountWindow (InstallWindow): def getScreen(self, anaconda): self.rootPassword = anaconda.id.rootPassword @@ -117,6 +120,7 @@ class AccountWindow (InstallWindow): msg = cracklib.FascistCheck(pw) if msg is not None: + msg = gettext.ldgettext("cracklib", msg) ret = self.intf.messageWindow(_("Weak Password"), _("Weak password provided: %s" "\n\n" diff --git a/iw/autopart_type.py b/iw/autopart_type.py index e158d02b1..1573e7c51 100644 --- a/iw/autopart_type.py +++ b/iw/autopart_type.py @@ -24,8 +24,6 @@ import gobject import math import autopart -import rhpl -from rhpl.translate import _, N_ from constants import * import gui from partition_ui_helpers_gui import * @@ -37,6 +35,9 @@ import network import partitions import iscsi +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + def whichToResize(partitions, diskset, intf): def getActive(combo): act = combo.get_active_iter() @@ -323,7 +324,7 @@ class PartitionTypeWindow(InstallWindow): (dxml, dialog) = gui.getGladeWidget("adddrive.glade", "addDriveDialog") gui.addFrame(dialog) dialog.show_all() - if rhpl.getArch() not in ("s390", "s390x"): + if not iutil.isS390(): dxml.get_widget("zfcpRadio").hide() dxml.get_widget("zfcpRadio").set_group(None) @@ -452,7 +453,7 @@ class PartitionTypeWindow(InstallWindow): self.xml.get_widget("bootDriveCombo").set_sensitive(False) self.xml.get_widget("encryptButton").set_sensitive(False) - if rhpl.getArch() not in ["s390", "s390x"] and not iscsi.has_iscsi(): + if not iutil.isS390() and not iscsi.has_iscsi(): self.xml.get_widget("addButton").set_sensitive(False) sigs = { "on_partitionTypeCombo_changed": self.comboChanged, diff --git a/iw/blpasswidget.py b/iw/blpasswidget.py index 80932bde6..e9f7a8934 100644 --- a/iw/blpasswidget.py +++ b/iw/blpasswidget.py @@ -21,8 +21,10 @@ import gtk import gui -from rhpl.translate import _, N_ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class BootloaderPasswordWidget: def __init__(self, anaconda, parent): diff --git a/iw/bootloader_main_gui.py b/iw/bootloader_main_gui.py index 8ab9c5e14..11cb7601b 100644 --- a/iw/bootloader_main_gui.py +++ b/iw/bootloader_main_gui.py @@ -24,7 +24,10 @@ import gobject import partedUtils import gui from iw_gui import * -from rhpl.translate import _, N_ +from constants import * + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) from osbootwidget import OSBootWidget from blpasswidget import BootloaderPasswordWidget diff --git a/iw/congrats_gui.py b/iw/congrats_gui.py index 79c9215e5..515cb5fea 100644 --- a/iw/congrats_gui.py +++ b/iw/congrats_gui.py @@ -20,12 +20,13 @@ import gtk import gui -import rhpl from iw_gui import * -from rhpl.translate import _, N_ from constants import * import os +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class CongratulationWindow (InstallWindow): windowTitle = N_("Congratulations") @@ -65,8 +66,9 @@ class CongratulationWindow (InstallWindow): hbox.pack_start (a, False, False, 36) bootstr = "" - if rhpl.getArch() == "s390" or os.path.exists("/dev/live-osimg"): - floppystr = "" + if iutil.isS390() or os.path.exists("/dev/live-osimg"): + floppystr = _("Please reboot the system to use the installed " + "system.\n\n") else: floppystr = _("Press the \"Reboot\" button to reboot your system." "\n\n") diff --git a/iw/examine_gui.py b/iw/examine_gui.py index 58b2d8def..94cabad5b 100644 --- a/iw/examine_gui.py +++ b/iw/examine_gui.py @@ -22,11 +22,13 @@ import gtk import gui from iw_gui import * from pixmapRadioButtonGroup_gui import pixmapRadioButtonGroup -from rhpl.translate import _, N_ from constants import * import upgrade from flags import flags +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + UPGRADE_STR = "upgrade" REINSTALL_STR = "reinstall" diff --git a/iw/iw_gui.py b/iw/iw_gui.py index f22969d0e..6cdeaa9fe 100644 --- a/iw/iw_gui.py +++ b/iw/iw_gui.py @@ -17,7 +17,9 @@ # along with this program. If not, see . # -from rhpl.translate import _ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class InstallWindow: diff --git a/iw/language_gui.py b/iw/language_gui.py index 36e79fd8b..fdb4993c8 100644 --- a/iw/language_gui.py +++ b/iw/language_gui.py @@ -21,7 +21,10 @@ import gobject import gtk import gui from iw_gui import * -from rhpl.translate import _, N_ +from constants import * + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) from gui import setupTreeViewFixupIdleHandler diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py index 84e83a92d..5c996a1a9 100644 --- a/iw/lvm_dialog_gui.py +++ b/iw/lvm_dialog_gui.py @@ -26,8 +26,6 @@ import gobject import gtk import datacombo -from rhpl.translate import _, N_ - import gui from fsset import * from partRequests import * @@ -36,6 +34,9 @@ from constants import * import lvm from cryptodev import LUKSDevice +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") diff --git a/iw/netconfig_dialog.py b/iw/netconfig_dialog.py index dd5554e1a..954b299cf 100644 --- a/iw/netconfig_dialog.py +++ b/iw/netconfig_dialog.py @@ -23,7 +23,9 @@ import gtk import gobject import gui -from rhpl.translate import _, N_ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import gui import network diff --git a/iw/network_gui.py b/iw/network_gui.py index 95a6c1e5e..3da933364 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -27,10 +27,13 @@ import gobject from iw_gui import * import isys import gui -from rhpl.translate import _, N_ import network import checklist +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + global_options = [_("Gateway"), _("Primary DNS"), _("Secondary DNS")] global_option_labels = [_("_Gateway"), _("_Primary DNS"), _("_Secondary DNS")] diff --git a/iw/osbootwidget.py b/iw/osbootwidget.py index acda638b2..d4a294277 100644 --- a/iw/osbootwidget.py +++ b/iw/osbootwidget.py @@ -26,9 +26,10 @@ import parted import partedUtils import gui import datacombo -from rhpl.translate import _, N_ from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class OSBootWidget: """Widget to display OSes to boot and allow adding new ones.""" diff --git a/iw/package_gui.py b/iw/package_gui.py index 844ffee54..133dcbf94 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -25,7 +25,10 @@ from GroupSelector import GroupSelector import gui from iw_gui import * -from rhpl.translate import _, N_ + +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class GroupSelectionWindow (InstallWindow): def getScreen(self, anaconda): diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py index 839807840..0b5e52d34 100644 --- a/iw/partition_dialog_gui.py +++ b/iw/partition_dialog_gui.py @@ -25,8 +25,6 @@ import copy import gobject import gtk -from rhpl.translate import _, N_ - import gui from fsset import * from cryptodev import LUKSDevice @@ -34,6 +32,8 @@ from partRequests import * from partition_ui_helpers_gui import * from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class PartitionEditor: def sizespinchangedCB(self, widget, fillmaxszsb): diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 7014a17ae..b1b1534c6 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -43,7 +43,6 @@ import lvm_dialog_gui import raid_dialog_gui import partition_dialog_gui -from rhpl.translate import _, N_ from partIntfHelpers import * from partedUtils import * from fsset import * @@ -51,6 +50,9 @@ from partRequests import * from constants import * from partition_ui_helpers_gui import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") @@ -968,8 +970,7 @@ class PartitionWindow(InstallWindow): self.diskStripeGraph.selectSlice(partition) def newCB(self, widget): - # create new request of size 1M - request = NewPartitionSpec(fileSystemTypeGetDefault(), size = 100) + request = NewPartitionSpec(fileSystemTypeGetDefault(), size = 200) self.editPartitionRequest(request, isNew = 1) @@ -1322,7 +1323,7 @@ class PartitionWindow(InstallWindow): # see which option they choose if createRAIDpart.get_active(): - rdrequest = NewPartitionSpec(fileSystemTypeGet("software RAID"), size = 100) + rdrequest = NewPartitionSpec(fileSystemTypeGet("software RAID"), size = 200) rc = self.editPartitionRequest(rdrequest, isNew = 1, restrictfs=["software RAID"]) elif createRAIDdev.get_active(): self.editRaidRequest(request, isNew=1) diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py index 08e997625..bda091406 100644 --- a/iw/partition_ui_helpers_gui.py +++ b/iw/partition_ui_helpers_gui.py @@ -33,8 +33,8 @@ from partIntfHelpers import * from partRequests import * from partedUtils import * -import rhpl -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) def istruefalse(val): if val is None or not val: diff --git a/iw/partmethod_gui.py b/iw/partmethod_gui.py index 6547dba0c..8aa7bf542 100644 --- a/iw/partmethod_gui.py +++ b/iw/partmethod_gui.py @@ -22,9 +22,12 @@ import gtk from gui import WrappingLabel from iw_gui import * -from rhpl.translate import _ from autopart import PARTMETHOD_TYPE_DESCR_TEXT +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class PartitionMethodWindow(InstallWindow): def __init__(self, ics): InstallWindow.__init__(self, ics) diff --git a/iw/pixmapRadioButtonGroup_gui.py b/iw/pixmapRadioButtonGroup_gui.py index bb72220db..89c4bb4e0 100644 --- a/iw/pixmapRadioButtonGroup_gui.py +++ b/iw/pixmapRadioButtonGroup_gui.py @@ -19,7 +19,6 @@ # import gtk -from rhpl.translate import _, N_ from constants import * class pixmapRadioButtonGroup: @@ -200,7 +199,7 @@ if __name__ == "__main__": else: opts = ['8.0 - /dev/hda1'] - label = _("The following installed system will be upgraded:") + label = "The following installed system will be upgraded:" upgradeoption = gtk.OptionMenu() upgradeoptionmenu = gtk.Menu() for lev in opts: diff --git a/iw/progress_gui.py b/iw/progress_gui.py index b0f15fa35..4b3499f43 100644 --- a/iw/progress_gui.py +++ b/iw/progress_gui.py @@ -27,7 +27,6 @@ import pango import gui from flags import flags from iw_gui import * -from rhpl.translate import _, N_ from constants import * import language diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py index d62e368fd..63c9f2ee8 100644 --- a/iw/raid_dialog_gui.py +++ b/iw/raid_dialog_gui.py @@ -27,8 +27,6 @@ import gobject import gtk import datacombo -from rhpl.translate import _, N_ - import gui from fsset import * from raid import availRaidLevels @@ -37,6 +35,9 @@ from partRequests import * from partition_ui_helpers_gui import * from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class RaidEditor: def createAllowedRaidPartitionsList(self, allraidparts, reqraidpart, diff --git a/iw/task_gui.py b/iw/task_gui.py index e7a8e3a70..243415eac 100644 --- a/iw/task_gui.py +++ b/iw/task_gui.py @@ -22,10 +22,12 @@ import gtk.glade import gobject import gui from iw_gui import * -from rhpl.translate import _, N_ -from constants import productName +from constants import * import isys +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + from netconfig_dialog import NetworkConfigurator import network @@ -371,6 +373,8 @@ class TaskWindow(InstallWindow): store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT) + store.set_sort_column_id(1, gtk.SORT_ASCENDING) + tl = self.xml.get_widget("repoList") tl.set_model(store) diff --git a/iw/timezone_gui.py b/iw/timezone_gui.py index e1135304a..2b6290901 100644 --- a/iw/timezone_gui.py +++ b/iw/timezone_gui.py @@ -28,18 +28,19 @@ import pango import sys from timezone_map_gui import TimezoneMap, Enum -from rhpl.translate import _, textdomain from iw_gui import * from bootloaderInfo import dosFilesystems from bootloader import hasWindows +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + try: import gnomecanvas except ImportError: import gnome.canvas as gnomecanvas -textdomain("system-config-date") - class TimezoneWindow(InstallWindow): def __init__(self, ics): InstallWindow.__init__(self, ics) @@ -134,7 +135,7 @@ class AnacondaTZMap(TimezoneMap): # York as the default. self.fallbackEntry = entry - iter = self.tzStore.insert_after(iter, [_(entry.tz), entry.tz, entry]) + iter = self.tzStore.insert_after(iter, [gettext.ldgettext("system-config-date", entry.tz), entry.tz, entry]) def timezone_list_init (self, default): self.hbox = gtk.HBox() diff --git a/iw/upgrade_bootloader_gui.py b/iw/upgrade_bootloader_gui.py index 84c16dc22..63ebb9d64 100644 --- a/iw/upgrade_bootloader_gui.py +++ b/iw/upgrade_bootloader_gui.py @@ -23,9 +23,12 @@ from iw_gui import * import gtk -from rhpl.translate import _, N_ import checkbootloader +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") diff --git a/iw/upgrade_migratefs_gui.py b/iw/upgrade_migratefs_gui.py index 27c82d7d2..bd683b68e 100644 --- a/iw/upgrade_migratefs_gui.py +++ b/iw/upgrade_migratefs_gui.py @@ -20,7 +20,6 @@ # from iw_gui import * -from rhpl.translate import _, N_ from constants import * import string import isys @@ -28,6 +27,9 @@ import iutil from fsset import * import gtk +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class UpgradeMigrateFSWindow (InstallWindow): windowTitle = N_("Migrate File Systems") @@ -60,7 +62,7 @@ class UpgradeMigrateFSWindow (InstallWindow): box.set_border_width (5) text = (_("This release of %s supports " - "the an updated file system, which has several " + "an updated file system, which has several " "benefits over the file system traditionally shipped " "in %s. This installation program can migrate " "formatted partitions without data loss.\n\n" diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py index f16ce5222..83e27c6dd 100644 --- a/iw/upgrade_swap_gui.py +++ b/iw/upgrade_swap_gui.py @@ -27,7 +27,9 @@ import gtk from iw_gui import * from flags import flags -from rhpl.translate import _, N_ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class UpgradeSwapWindow (InstallWindow): windowTitle = N_("Upgrade Swap Partition") diff --git a/iw/welcome_gui.py b/iw/welcome_gui.py index c386d87be..a12a2e104 100644 --- a/iw/welcome_gui.py +++ b/iw/welcome_gui.py @@ -20,7 +20,10 @@ import gtk import gui from iw_gui import * -from rhpl.translate import _, N_ + +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class WelcomeWindow (InstallWindow): diff --git a/iw/zipl_gui.py b/iw/zipl_gui.py index c27d4ad0e..b90eaae2b 100644 --- a/iw/zipl_gui.py +++ b/iw/zipl_gui.py @@ -23,7 +23,9 @@ import isys import gtk import string from iw_gui import * -from rhpl.translate import _, N_ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class ZiplWindow (InstallWindow): checkMark = None diff --git a/kickstart.py b/kickstart.py index 3c267774d..954287e4f 100644 --- a/kickstart.py +++ b/kickstart.py @@ -40,7 +40,9 @@ from pykickstart.constants import * from pykickstart.errors import * from pykickstart.parser import * from pykickstart.version import * -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -179,9 +181,38 @@ class Bootloader(commands.bootloader.F8_Bootloader): self.handler.permanentSkipSteps.extend(["bootloadersetup", "instbootloader"]) else: self.handler.showSteps.append("bootloader") - self.handler.id.instClass.setBootloader(self.handler.id, location, self.forceLBA, - self.password, self.md5pass, - self.appendLine, self.driveorder, self.timeout) + + if self.appendLine: + self.handler.id.bootloader.args.set(self.appendLine) + + self.handler.id.bootloader.setForceLBA(self.forceLBA) + + if self.password: + self.handler.id.bootloader.setPassword(self.password, isCrypted = 0) + + if self.md5pass: + self.handler.id.bootloader.setPassword(self.md5pass) + + if location != None: + self.handler.id.bootloader.defaultDevice = location + else: + self.handler.id.bootloader.defaultDevice = -1 + + if self.timeout: + self.handler.id.bootloader.timeout = self.timeout + + # XXX throw out drives specified that don't exist. anything else + # seems silly + if self.driveorder and len(self.driveorder) > 0: + new = [] + for drive in self.driveorder: + if drive in self.handler.id.bootloader.drivelist: + new.append(drive) + else: + log.warning("requested drive %s in boot drive order " + "doesn't exist" %(drive,)) + + self.handler.id.bootloader.drivelist = new self.handler.permanentSkipSteps.extend(["upgbootloader", "bootloader"]) @@ -197,15 +228,19 @@ class ClearPart(commands.clearpart.FC3_ClearPart): if disk not in hds: raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in clearpart command" % disk) - self.handler.id.instClass.setClearParts(self.handler.id, self.type, - drives=self.drives, initAll=self.initAll) + self.handler.id.partitions.autoClearPartType = self.type + self.handler.id.partitions.autoClearPartDrives = self.drives + if self.initAll: + self.handler.id.partitions.reinitializeDisks = self.initAll class Firewall(commands.firewall.FC3_Firewall): def parse(self, args): commands.firewall.FC3_Firewall.parse(self, args) + self.handler.id.firewall.enabled = self.enabled + self.handler.id.firewall.trustdevs = self.trusts - self.handler.id.instClass.setFirewall(self.handler.id, self.enabled, - self.trusts, self.ports) + for port in self.ports: + self.handler.id.firewall.portlist.append (port) class Firstboot(commands.firstboot.FC3_Firstboot): def parse(self, args): @@ -215,8 +250,16 @@ class Firstboot(commands.firstboot.FC3_Firstboot): class IgnoreDisk(commands.ignoredisk.F8_IgnoreDisk): def parse(self, args): commands.ignoredisk.F8_IgnoreDisk.parse(self, args) - self.handler.id.instClass.setIgnoredDisks(self.handler.id, self.ignoredisk) - self.handler.id.instClass.setExclusiveDisks(self.handler.id, self.onlyuse) + + diskset = self.handler.id.diskset + for drive in self.ignoredisk: + if not drive in diskset.skippedDisks: + diskset.skippedDisks.append(drive) + + diskset = self.handler.id.diskset + for drive in self.onlyuse: + if not drive in diskset.exclusiveDisks: + diskset.exclusiveDisks.append(drive) class Iscsi(commands.iscsi.FC6_Iscsi): def parse(self, args): @@ -241,14 +284,14 @@ class IscsiName(commands.iscsiname.FC6_IscsiName): class Keyboard(commands.keyboard.FC3_Keyboard): def parse(self, args): commands.keyboard.FC3_Keyboard.parse(self, args) - self.handler.id.instClass.setKeyboard(self.handler.id, self.keyboard) + self.handler.id.keyboard.set(self.keyboard) self.handler.id.keyboard.beenset = 1 self.handler.skipSteps.append("keyboard") class Lang(commands.lang.FC3_Lang): def parse(self, args): commands.lang.FC3_Lang.parse(self, args) - self.handler.id.instClass.setLanguage(self.handler.id, self.lang) + self.handler.id.instLanguage.setRuntimeLanguage(self.lang) self.handler.skipSteps.append("language") class LogVol(commands.logvol.F9_LogVol): @@ -330,34 +373,63 @@ class Logging(commands.logging.FC6_Logging): elif self.host != "": logger.addSysLogHandler(log, self.host) -class Monitor(commands.monitor.FC6_Monitor): - def parse(self, args): - commands.monitor.FC6_Monitor.parse(self, args) - self.handler.skipSteps.extend(["monitor", "checkmonitorok"]) - self.handler.id.instClass.setMonitor(self.handler.id, self.hsync, - self.vsync, self.monitor) - class Network(commands.network.F8_Network): def parse(self, args): commands.network.F8_Network.parse(self, args) nd = self.network[-1] - try: - self.handler.id.instClass.setNetwork(self.handler.id, nd.bootProto, nd.ip, - nd.netmask, nd.ethtool, nd.device, - nd.onboot, nd.dhcpclass, nd.essid, nd.wepkey) - except KeyError: - raise KickstartValueError, formatErrorMsg(self.lineno, msg="The provided network interface %s does not exist" % nd.device) + if nd.bootProto: + devices = self.handler.id.network.netdevices + firstdev = self.handler.id.network.getFirstDeviceName() + if (devices and bootProto): + if not nd.device: + if devices.has_key(firstdev): + device = firstdev + else: + list = devices.keys () + list.sort() + device = list[0] + else: + device = nd.device + + try: + dev = devices[device] + except KeyError: + raise KickstartValueError, formatErrorMsg(self.lineno, msg="The provided network interface %s does not exist" % device) + + dev.set (("bootproto", nd.bootProto)) + dev.set (("dhcpclass", nd.dhcpclass)) + + if nd.onboot: + dev.set (("onboot", "yes")) + else: + dev.set (("onboot", "no")) + + if nd.bootProto == "static": + if (nd.ip): + dev.set (("ipaddr", nd.ip)) + if (nd.netmask): + dev.set (("netmask", nd.netmask)) + + if nd.ethtool: + dev.set (("ethtool_opts", nd.ethtool)) + + if isys.isWireless(device): + if nd.essid: + dev.set(("essid", nd.essid)) + if nd.wepkey: + dev.set(("wepkey", nd.wepkey)) if nd.hostname != "": - self.handler.id.instClass.setHostname(self.handler.id, nd.hostname, override=True) + self.handler.id.network.setHostname(nd.hostname) + self.handler.id.network.overrideDHCPhostname = True if nd.nameserver != "": - self.handler.id.instClass.setNameserver(self.handler.id, nd.nameserver) + self.handler.id.network.setDNS(nd.nameserver) if nd.gateway != "": - self.handler.id.instClass.setGateway(self.handler.id, nd.gateway) + self.handler.id.network.setGateway(nd.gateway) class MultiPath(commands.multipath.FC6_MultiPath): def parse(self, args): @@ -606,6 +678,46 @@ class Raid(commands.raid.F9_Raid): addPartRequest(self.handler.anaconda, request) self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"]) +class Repo(commands.repo.F8_Repo): + def parse(self, args): + commands.repo.F8_Repo.parse(self, args) + repo = self.repoList[-1] + repoid = repo.name.replace(" ", "-") + + buf = """ +[%(repoid)s] +name=%(name)s +enabled=1 +gpgcheck=0 +""" % {"repoid": repoid, "name": repo.name} + + # pykickstart enforces that only one of these options may be specified + if repo.mirrorlist: + buf += "\nmirrorlist=%s" % repo.mirrorlist + else: + buf += "\nbaseurl=%s" % repo.baseurl + + if repo.priority: + buf += "\ncost=%s" % repo.priority + + if repo.excludepkgs: + s = "" + for pkg in repo.excludepkgs: + s += "%s," % pkg + + buf += "\nexclude=%s" % s[:-1] + + if repo.includepkgs: + s = "" + for pkg in repo.includepkgs: + s += "%s," % pkg + + buf += "\nincludepkgs=%s" % s[:-1] + + fd = open("/etc/yum.repos.d/%s.repo" % repoid, "w") + fd.write(buf) + fd.close() + class RootPw(commands.rootpw.F8_RootPw): def parse(self, args): commands.rootpw.F8_RootPw.parse(self, args) @@ -618,23 +730,22 @@ class RootPw(commands.rootpw.F8_RootPw): class SELinux(commands.selinux.FC3_SELinux): def parse(self, args): commands.selinux.FC3_SELinux.parse(self, args) - self.handler.id.instClass.setSELinux(self.handler.id, self.selinux) + self.handler.id.security.setSELinux(self.selinux) class SkipX(commands.skipx.FC3_SkipX): def parse(self, args): commands.skipx.FC3_SkipX.parse(self, args) - self.handler.skipSteps.extend(["checkmonitorok", "setsanex", "videocard", - "monitor", "xcustom", "writexconfig"]) + self.handler.skipSteps.extend(["setsanex", "videocard", "xcustom"]) - if self.handler.id.xsetup is not None: - self.handler.id.xsetup.skipx = 1 + if self.handler.id.desktop is not None: + self.handler.id.desktop.setDefaultRunLevel(3) class Timezone(commands.timezone.FC6_Timezone): def parse(self, args): commands.timezone.FC6_Timezone.parse(self, args) - self.handler.id.instClass.setTimezoneInfo(self.handler.id, self.timezone, self.isUtc) + self.handler.id.timezone.setTimezoneInfo(self.timezone, self.isUtc) self.handler.skipSteps.append("timezone") class Upgrade(commands.upgrade.FC3_Upgrade): @@ -674,21 +785,10 @@ class VolGroup(commands.volgroup.FC3_VolGroup): request.uniqueID = uniqueID addPartRequest(self.handler.anaconda, request) -class XConfig(commands.xconfig.FC6_XConfig): - def parse(self, args): - commands.xconfig.FC6_XConfig.parse(self, args) - - self.handler.id.instClass.configureX(self.handler.id, self.driver, self.videoRam, - self.resolution, self.depth, - self.startX) - self.handler.id.instClass.setDesktop(self.handler.id, self.defaultdesktop) - self.handler.skipSteps.extend(["videocard", "monitor", "xcustom", - "checkmonitorok", "setsanex"]) - class ZeroMbr(commands.zerombr.FC3_ZeroMbr): def parse(self, args): commands.zerombr.FC3_ZeroMbr.parse(self, args) - self.handler.id.instClass.setZeroMbr(self.handler.id, 1) + self.handler.id.partitions.zeroMbr = 1 class ZFCP(commands.zfcp.FC3_ZFCP): def parse(self, args): @@ -734,7 +834,7 @@ commandMap = { "logging": Logging, "logvol": LogVol, "mediacheck": commands.mediacheck.FC4_MediaCheck, - "monitor": Monitor, + "monitor": commands.monitor.F10_Monitor, "multipath": MultiPath, "network": Network, "nfs": commands.method.FC6_Method, @@ -743,7 +843,7 @@ commandMap = { "poweroff": Reboot, "raid": Raid, "reboot": Reboot, - "repo": commands.repo.F8_Repo, + "repo": Repo, "rootpw": RootPw, "selinux": SELinux, "services": commands.services.FC6_Services, @@ -757,7 +857,7 @@ commandMap = { "user": commands.user.F8_User, "vnc": commands.vnc.FC6_Vnc, "volgroup": VolGroup, - "xconfig": XConfig, + "xconfig": commands.xconfig.F10_XConfig, "zerombr": ZeroMbr, "zfcp": ZFCP } @@ -1058,13 +1158,6 @@ def setSteps(anaconda): dispatch.skipStep("installtype") dispatch.skipStep("bootdisk") - # because these steps depend on the monitor being probed - # properly, and will stop you if you have an unprobed monitor, - # we should skip them for autostep - if flags.autostep: - dispatch.skipStep("monitor") - return - dispatch.skipStep("bootdisk") dispatch.skipStep("betanag") dispatch.skipStep("regkey") diff --git a/lang-table b/lang-table index 9570f5604..f28a35f5a 100644 --- a/lang-table +++ b/lang-table @@ -1,5 +1,5 @@ Afrikaans af latarcyrheb-sun16 af_ZA.UTF-8 us Africa/Johannesburg -Arabic ar latarcyrheb-sun16 ar_SA.UTF-8 us Asia/Riyadh +Arabic ar none ar_SA.UTF-8 us Asia/Riyadh Assamese as none as_IN.UTF-8 us Asia/Calcutta Bengali bn none bn_BD.UTF-8 us Asia/Dhaka Bengali(India) bn none bn_IN.UTF-8 us Asia/Calcutta @@ -16,8 +16,9 @@ Estonian et latarcyrheb-sun16 et_EE.UTF-8 et Europe/Tallinn Finnish fi latarcyrheb-sun16 fi_FI.UTF-8 fi Europe/Helsinki French fr latarcyrheb-sun16 fr_FR.UTF-8 fr-latin9 Europe/Paris German de latarcyrheb-sun16 de_DE.UTF-8 de-latin1-nodeadkeys Europe/Berlin -Greek el iso07u-16 el_GR.UTF-8 gr Europe/Athens +Greek el none el_GR.UTF-8 gr Europe/Athens Gujarati gu none gu_IN.UTF-8 us Asia/Calcutta +Hebrew he none he_IL.UTF-8 us Asia/Jerusalem Hindi hi none hi_IN.UTF-8 us Asia/Calcutta Hungarian hu latarcyrheb-sun16 hu_HU.UTF-8 hu Europe/Budapest Icelandic is latarcyrheb-sun16 is_IS.UTF-8 is-latin1 Atlantic/Reykjavik @@ -31,7 +32,7 @@ Macedonian mk latarcyrheb-sun16 mk_MK.UTF-8 mk Europe/Skopje Malay ms latarcyrheb-sun16 ms_MY.UTF-8 us Asia/Kuala_Lumpur Malayalam ml none ml_IN.UTF-8 us Asia/Calcutta Marathi mr none mr_IN.UTF-8 us Asia/Calcutta -Norwegian nb latarcyrheb-sun16 nb_NO.UTF-8 no Europe/Oslo +Norwegian(Bokmål) nb latarcyrheb-sun16 nb_NO.UTF-8 no Europe/Oslo Northern Sotho nso latarcyrheb-sun16 nso_ZA.UTF-8 us Africa/Johannesburg Oriya or none or_IN.UTF-8 us Asia/Calcutta Persian fa none fa_IR.UTF-8 us Asia/Tehran diff --git a/language.py b/language.py index 908b3f2df..64ecca2fb 100644 --- a/language.py +++ b/language.py @@ -24,7 +24,7 @@ import os import string import locale -from rhpl.translate import cat +import gettext from rhpl.simpleconfig import SimpleConfigFile import logging @@ -213,7 +213,10 @@ class Language: except locale.Error: pass - cat.setlangs(expandLangs(os.environ["LANG"])) + # XXX: oh ick. this is the sort of thing which you should never do... + # but we switch languages at runtime and thus need to invalidate + # the set of languages/mofiles which gettext knows about + gettext._translations = {} def write(self, instPath): f = open(instPath + "/etc/sysconfig/i18n", "w") diff --git a/livecd.py b/livecd.py index b99b0fffa..58c66ca0f 100644 --- a/livecd.py +++ b/livecd.py @@ -32,11 +32,12 @@ import subprocess import selinux -from rhpl.translate import _, N_ - from flags import flags from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import backend import isys import iutil @@ -188,8 +189,27 @@ class LiveCDCopyBackend(backend.AnacondaBackend): size = self._getLiveSize() copied = 0 while copied < size: - buf = os.read(osfd, readamt) - written = os.write(rootfd, buf) + try: + buf = os.read(osfd, readamt) + written = os.write(rootfd, buf) + except: + rc = anaconda.intf.messageWindow(_("Error"), + _("There was an error installing the live image to " + "your hard drive. This could be due to bad media. " + "Please verify your installation media.\n\nIf you " + "exit, your system will be left in an inconsistent " + "state that will require reinstallation."), + type="custom", custom_icon="error", + custom_buttons=[_("_Exit installer"), _("_Retry")]) + + if rc == 0: + sys.exit(0) + else: + os.lseek(osfd, 0, 0) + os.lseek(rootfd, 0, 0) + copied = 0 + continue + if (written < readamt) and (written < len(buf)): raise RuntimeError, "error copying filesystem!" copied += written diff --git a/loader2/init.c b/loader2/init.c index 158a3cf18..ce4cff50f 100644 --- a/loader2/init.c +++ b/loader2/init.c @@ -78,24 +78,6 @@ #define ENV_MALLOC_CHECK 7 #define ENV_MALLOC_PERTURB 8 -/* - * Snakes On A Plane... - * - * Define this macro if you want init to launch /bin/bash instead of loader. - * You will want to populate initrd.img with bash, libraries, other commands - * like strace or something, and whatever else you want. This is purely for - * debugging loader. Things you will likely want in a debugging initrd: - * /lib/libc.so.6 - * /lib/libtermcap.so.2 - * /lib/ld-linux.so.2 - * /lib/libdl.so.2 - * /bin/bash - * /bin/strace - * You get the idea. Be creative. Be imaginative. Be bold. - */ -#undef SNAKES_ON_A_PLANE -/* #define SNAKES_ON_A_PLANE 1 */ - char * env[] = { "PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sysimage/bin:" "/mnt/sysimage/usr/bin:/mnt/sysimage/usr/sbin:/mnt/sysimage/sbin:" @@ -135,28 +117,6 @@ void shutDown(int noKill, int doReboot, int doPowerOff); static int getNoKill(void); struct termios ts; -static int mystrstr(char *str1, char *str2) { - char *p; - int rc=0; - - for (p=str1; *p; p++) { - if (*p == *str2) { - char *s, *t; - - rc = 1; - for (s=p, t=str2; *s && *t; s++, t++) - if (*s != *t) { - rc = 0; - p++; - } - - if (rc) - return rc; - } - } - return rc; -} - static void printstr(char * string) { int ret; ret = write(1, string, strlen(string)); @@ -364,7 +324,7 @@ static int setupTerminal(int fd) { if ((fdn = open("/proc/cmdline", O_RDONLY, 0)) != -1) { len = read(fdn, buf, sizeof(buf) - 1); close(fdn); - if (len > 0 && mystrstr(buf, "utf8")) + if ((len > 0) && strstr(buf, "utf8")) env[ENV_TERM] = "TERM=vt100"; } @@ -449,7 +409,7 @@ static int getNoKill(void) { if ((fd = open("/proc/cmdline", O_RDONLY,0)) > 0) { len = read(fd, buf, sizeof(buf) - 1); close(fd); - if (len > 0 && mystrstr(buf, "nokill")) + if ((len > 0) && strstr(buf, "nokill")) return 1; } return 0; @@ -674,14 +634,10 @@ int main(int argc, char **argv) { #endif /* disable Ctrl+Z, Ctrl+C, etc ... but not in rescue mode */ -#ifdef SNAKES_ON_A_PLANE - disable_keys = 0; -#else disable_keys = 1; if (argc > 1) - if (mystrstr(argv[1], "rescue")) + if (strstr(argv[1], "rescue")) disable_keys = 0; -#endif if (disable_keys) { tcgetattr(0, &ts); @@ -752,32 +708,8 @@ int main(int argc, char **argv) { setsid(); -#ifdef SNAKES_ON_A_PLANE - printf("> Snakes on a Plane <\n"); - - /* hack to load core modules for debugging mode */ - char * modvc[15]; - char ** modvp = modvc; - *modvp++ = "/bin/modprobe"; - *modvp++ = "ehci-hcd"; - *modvp++ = "uhci-hcd"; - *modvp++ = "ohci-hcd"; - *modvp++ = NULL; - pid_t blah = fork(); - int qux; - if (blah == 0) { - printf("loading core debugging modules...\n"); - execve(modvc[0], modvc, env); - } else { - waitpid(blah, &qux, WNOHANG); - } -#endif - if (!(installpid = fork())) { /* child */ -#ifdef SNAKES_ON_A_PLANE - *argvp++ = "/bin/strace"; -#endif *argvp++ = "/sbin/loader"; if (isSerial == 3) { diff --git a/loader2/loader.c b/loader2/loader.c index 0be05db2c..56b227db2 100644 --- a/loader2/loader.c +++ b/loader2/loader.c @@ -147,6 +147,49 @@ void doShell(void) { newtResume(); } +void doGdbserver(struct loaderData_s *loaderData) { + int child, rc, fd; + char *pid; + struct networkDeviceConfig netCfg; + + /* If gdbserver is found, go ahead and run it on the loader process now + * before anything bad happens. + */ + if (loaderData->gdbServer && !access("/usr/bin/gdbserver", X_OK)) { + pid_t loaderPid = getpid(); + + if (kickstartNetworkUp(loaderData, &netCfg)) { + logMessage(ERROR, "can't run gdbserver due to no network"); + return; + } + + rc = asprintf(&pid, "%d", loaderPid); + + if (!(child = fork())) { + logMessage(INFO, "starting gdbserver: %s %s %s %s", + "/usr/bin/gdbserver", "--attach", loaderData->gdbServer, + pid); + + fd = open("/dev/null", O_RDONLY); + close(STDIN_FILENO); + dup2(fd, STDIN_FILENO); + close(fd); + fd = open("/dev/null", O_WRONLY); + close(STDOUT_FILENO); + dup2(fd, STDOUT_FILENO); + close(STDERR_FILENO); + dup2(fd, STDERR_FILENO); + close(fd); + + if (execl("/usr/bin/gdbserver", "/usr/bin/gdbserver", "--attach", + loaderData->gdbServer, pid, NULL) == -1) + logMessage(ERROR, "error running gdbserver: %s", strerror(errno)); + + _exit(1); + } + } +} + void startNewt(void) { if (!newtRunning) { char *buf; @@ -904,6 +947,8 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData, flags &= ~LOADER_FLAGS_SELINUX; else if (!strncasecmp(argv[i], "selinux", 7)) flags |= LOADER_FLAGS_SELINUX; + else if (!strncasecmp(argv[i], "gdb=", 4)) + loaderData->gdbServer = strdup(argv[i] + 4); else if (numExtraArgs < (MAX_EXTRA_ARGS - 1)) { /* go through and append args we just want to pass on to */ /* the anaconda script, but don't want to represent as a */ @@ -1712,6 +1757,9 @@ int main(int argc, char ** argv) { busProbe(FL_NOPROBE(flags)); + /* can't run gdbserver until after network modules are loaded */ + doGdbserver(&loaderData); + /* JKFIXME: we'd really like to do this before the busprobe, but then * we won't have network devices available (and that's the only thing * we support with this right now */ diff --git a/loader2/loader.h b/loader2/loader.h index 8bd9e5f92..1c6d2730b 100644 --- a/loader2/loader.h +++ b/loader2/loader.h @@ -134,6 +134,7 @@ struct loaderData_s { char * logLevel; char * updatessrc; char * dogtailurl; + char * gdbServer; pid_t fw_loader_pid; char *fw_search_pathz; diff --git a/loader2/method.c b/loader2/method.c index 26f360ccb..bd5426f8a 100644 --- a/loader2/method.c +++ b/loader2/method.c @@ -582,7 +582,6 @@ int copyFileAndLoopbackMount(int fd, char * dest, /* JKFIXME: this used to be fatal, but that seems unfriendly */ logMessage(ERROR, "Error mounting %s on %s (%s)", device, mntpoint, strerror(errno)); - unlink(dest); return 1; } diff --git a/loader2/method.h b/loader2/method.h index a29828c2b..03fc529ee 100644 --- a/loader2/method.h +++ b/loader2/method.h @@ -54,6 +54,7 @@ int mountStage2(char *stage2path, char *imageDir); int copyFileAndLoopbackMount(int fd, char *dest, char *device, char *mntpoint); int getFileFromBlockDevice(char *device, char *path, char * dest); +int unpackCpioBall(char * ballPath, char * rootDir); void copyUpdatesImg(char * path); void copyProductImg(char * path); diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c index fd942fec4..55b7c3dad 100644 --- a/loader2/urlinstall.c +++ b/loader2/urlinstall.c @@ -133,6 +133,9 @@ static int loadUrlImages(struct iurlinfo * ui) { umountLoopback("/tmp/update-disk", "/dev/loop7"); unlink("/tmp/updates-disk.img"); unlink("/tmp/update-disk"); + } else if (!access("/tmp/updates-disk.img", R_OK)) { + unpackCpioBall("/tmp/updates-disk.img", "/tmp/updates"); + unlink("/tmp/updates-disk.img"); } free(buf); diff --git a/network.py b/network.py index ecbbb9ef5..1947da674 100644 --- a/network.py +++ b/network.py @@ -31,9 +31,11 @@ import minihal import rhpl from flags import flags -from rhpl.translate import _, N_ from rhpl.simpleconfig import SimpleConfigFile +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") diff --git a/packages.py b/packages.py index 8bc767f84..e27217b34 100644 --- a/packages.py +++ b/packages.py @@ -39,13 +39,12 @@ from flags import flags from product import * from constants import * -import rhpl -from rhpl.translate import _ -import rhpl.arch - import logging log = logging.getLogger("anaconda") +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + def doPostAction(anaconda): anaconda.id.instClass.postAction(anaconda) @@ -88,41 +87,6 @@ def copyAnacondaLogs(anaconda): except: pass -def writeXConfiguration(anaconda): - testmode = flags.test - -# comment out to test - if testmode: - return -# end code to comment to test -# uncomment to test writing X config in test mode -# try: -# os.mkdir("/tmp/etc") -# except: -# pass -# try: -# os.mkdir("/tmp/etc/X11") -# except: -# pass -# instPath = '/' -# end code for test writing - - if anaconda.id.xsetup.skipx: - return - - card = anaconda.id.videocard.primaryCard() - if not card: - return - - log.info("Writing X configuration") - if not testmode: - fn = anaconda.rootPath - else: - fn = "/tmp/" - - anaconda.id.xsetup.write(fn+"/etc/X11", anaconda.id.keyboard) - anaconda.id.desktop.write(anaconda.rootPath) - def doMigrateFilesystems(anaconda): if anaconda.dir == DISPATCH_BACK: return DISPATCH_NOOP @@ -130,7 +94,7 @@ def doMigrateFilesystems(anaconda): if anaconda.id.fsset.haveMigratedFilesystems(): return DISPATCH_NOOP - anaconda.id.fsset.migrateFilesystems (anaconda.rootPath) + anaconda.id.fsset.migrateFilesystems (anaconda) if anaconda.id.upgrade: # if we're upgrading, we may need to do lvm device node hackery @@ -228,7 +192,7 @@ def setupTimezone(anaconda): except OSError, (errno, msg): log.error("Error copying timezone (from %s): %s" %(tzfile, msg)) - if rhpl.getArch() == "s390": + if iutil.isS390(): return args = [ "--hctosys" ] if anaconda.id.timezone.utc: diff --git a/partErrors.py b/partErrors.py index 395b0add1..ed6f16f41 100644 --- a/partErrors.py +++ b/partErrors.py @@ -26,24 +26,24 @@ class PartitioningError(Exception): """A critical error which must be resolved to continue the installation.""" - def __init__ (self, value): - self.value = value + def __init__(self, message=""): + self.message = str(message) def __str__ (self): - return self.value + return self.message class PartitioningWarning(Exception): """A warning which may be ignored and still complete the installation.""" - def __init__ (self, value): - self.value = value + def __init__(self, message=""): + self.message = str(message) def __str__ (self): - return self.value + return self.message class LabelError(Exception): """The device could not be labeled.""" - def __init__(self, value): - self.value = value + def __init__(self, message=""): + self.message = str(message) def __str__(self): - return self.value + return self.message diff --git a/partIntfHelpers.py b/partIntfHelpers.py index 9deb4cf09..d57b20889 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -32,7 +32,8 @@ import fsset import iutil import partRequests -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) def sanityCheckVolumeGroupName(volname): """Make sure that the volume group name doesn't contain invalid chars.""" diff --git a/partRequests.py b/partRequests.py index cf83b2540..b43f5037a 100644 --- a/partRequests.py +++ b/partRequests.py @@ -32,7 +32,9 @@ import os, sys, math from constants import * from flags import * -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import fsset import raid diff --git a/partedUtils.py b/partedUtils.py index 573bf4c80..81d78c787 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -34,19 +34,20 @@ import exception import fsset import iutil, isys import raid -import rhpl import dmraid import block import lvm import traceback from flags import flags from partErrors import * - -from rhpl.translate import _ +from constants import * import logging log = logging.getLogger("anaconda") +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + fsTypes = {} fs_type = parted.file_system_type_get_next () @@ -281,19 +282,19 @@ def getDefaultDiskType(): """Get the default partition table type for this architecture.""" if iutil.isEfi(): return parted.disk_type_get("gpt") - elif rhpl.getArch() == "i386": + elif iutil.isX86(): return parted.disk_type_get("msdos") - elif rhpl.getArch() == "s390": + elif iutil.isS390(): # the "default" type is dasd, but we don't really do dasd # formatting with parted and use dasdfmt directly for them # so if we get here, it's an fcp disk and we should write # an msdos partition table (#144199) return parted.disk_type_get("msdos") - elif rhpl.getArch() == "alpha": + elif iutil.isAlpha(): return parted.disk_type_get("bsd") - elif rhpl.getArch() == "sparc": + elif iutil.isSparc(): return parted.disk_type_get("sun") - elif rhpl.getArch() == "ppc": + elif iutil.isPPC(): ppcMachine = iutil.getPPCMachine() if ppcMachine == "PMac": @@ -333,7 +334,7 @@ def labelDisk(deviceFile, forceLabelType=None): else: if label.name == 'msdos' and \ dev.length > (2L**41) / dev.sector_size and \ - 'gpt' in archLabels[rhpl.getArch()]: + 'gpt' in archLabels[iutil.getArch()]: label = parted.disk_type_get('gpt') disk = dev.disk_new_fresh(label) @@ -343,7 +344,7 @@ def labelDisk(deviceFile, forceLabelType=None): # this is kind of crappy, but we don't really want to allow LDL formatted # dasd to be used during the install def checkDasdFmt(disk, intf): - if rhpl.getArch() != "s390": + if not iutil.isS390(): return 0 if disk.type.name != "dasd": @@ -383,7 +384,7 @@ def checkDasdFmt(disk, intf): def checkDiskLabel(disk, intf): """Check that the disk label on disk is valid for this machine type.""" - arch = rhpl.getArch() + arch = iutil.getArch() if arch in archLabels.keys(): if disk.type.name in archLabels[arch]: # this is kind of a hack since we don't want LDL to be used @@ -610,7 +611,7 @@ class DiskSet: def startDmRaid(self): """Start all of the dmraid devices associated with the DiskSet.""" - if rhpl.getArch() in ('s390', 's390x'): + if iutil.isS390(): return if not DiskSet.dmList is None: return @@ -628,14 +629,14 @@ class DiskSet: (self.driveList(),)) def renameDmRaid(self, rs, name): - if rhpl.getArch() in ('s390', 's390x'): + if iutil.isS390(): return dmraid.renameRaidSet(rs, name) def stopDmRaid(self): """Stop all of the dmraid devices associated with the DiskSet.""" - if rhpl.getArch() in ('s390', 's390x'): + if iutil.isS390(): return if DiskSet.dmList: dmraid.stopAllRaid(DiskSet.dmList) @@ -652,7 +653,7 @@ class DiskSet: disk = m.split('/')[-1] testList.append(disk) - if not rhpl.getArch() in ('s390','s390x'): + if not iutil.isS390(): for rs in DiskSet.dmList or []: for m in rs.members: if isinstance(m, block.RaidDev): @@ -950,8 +951,7 @@ class DiskSet: continue # FIXME: this belongs in parted itself, but let's do a hack... - if rhpl.getArch() in ("i386", "x86_64") \ - and disk.type.name == "gpt" and not iutil.isEfi(): + if iutil.isX86() and disk.type.name == "gpt" and not iutil.isEfi(): log.debug("syncing gpt to mbr for disk %s" % (disk.dev.path,)) iutil.execWithRedirect("gptsync", [disk.dev.path,], stdout="/tmp/gptsync.log", @@ -1096,7 +1096,7 @@ class DiskSet: "Would you like to initialize this drive, " "erasing ALL DATA?") % (drive,) - if rhpl.getArch() == "s390" \ + if iutil.isS390() \ and drive[:4] == "dasd" \ and isys.getDasdState(drive): devs = isys.getDasdDevPort() @@ -1126,7 +1126,7 @@ class DiskSet: try: try: # FIXME: need the right fix for z/VM formatted dasd - if rhpl.getArch() == "s390" \ + if iutil.isS390() \ and drive[:4] == "dasd": if self.dasdFmt(drive): raise LabelError, drive @@ -1199,7 +1199,7 @@ class DiskSet: initAll = self.anaconda.id.ksdata.clearpart.initAll # FIXME: need the right fix for z/VM formatted dasd - if rhpl.getArch() == "s390" \ + if iutil.isS390() \ and drive[:4] == "dasd" \ and isys.getDasdState(drive): try: @@ -1362,7 +1362,7 @@ class DiskSet: drives = [] for d in isys.removableDriveDict().items(): - func = lambda p: not p.get_flag(parted.PARTITION_RAID) and not p.get_flag(parted.PARTITION_LVM) and p.fs_type.name in ["ext3", "ext2", "fat16", "fat32"] + func = lambda p: p.is_active() and not p.get_flag(parted.PARTITION_RAID) and not p.get_flag(parted.PARTITION_LVM) and p.fs_type.name in ["ext3", "ext2", "fat16", "fat32"] disk = self.disks[d[0]] parts = filter_partitions(disk, func) @@ -1462,4 +1462,5 @@ max_logical_partition_count = { "ida/": 11, "sx8/": 11, "xvd": 11, + "vd": 11, } diff --git a/partitions.py b/partitions.py index 29c4844ad..d65c86a81 100644 --- a/partitions.py +++ b/partitions.py @@ -43,8 +43,8 @@ import partedUtils import partRequests import cryptodev -import rhpl -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -1111,7 +1111,7 @@ class Partitions: bootreq.getActualSize(self, diskset) < 10: errors.append(_("You must create an EFI System Partition of " "at least 10 megabytes.")) - elif rhpl.getArch() in ("i386", "x86_64"): + elif iutil.isX86(): if iutil.isMactel(): # mactel checks bootreqs = self.getBootableRequest() or [] @@ -1242,7 +1242,7 @@ class Partitions: # most arches can't have boot on RAID if (isinstance(bootreq, partRequests.RaidRequestSpec) and - rhpl.getArch() not in raid.raidBootArches): + iutil.getArch() not in raid.raidBootArches): errors.append(_("Bootable partitions cannot be on a RAID " "device.")) @@ -1253,6 +1253,12 @@ class Partitions: errors.append(_("Bootable partitions cannot be on an %s " "filesystem.")%(bootreq.fstype.getName(),)) + # vfat /boot is insane. + if (bootreq.mountpoint and bootreq.mountpoint == "/" and + bootreq.fstype and bootreq.fstype.getName() == "vfat"): + errors.append(_("Bootable partitions cannot be on an %s " + "filesystem.")%(bootreq.fstype.getName(),)) + if (bootreq.isEncrypted(self)): errors.append(_("Bootable partitions cannot be on an " "encrypted block device")) @@ -1652,7 +1658,14 @@ class Partitions: def doMetaResizes(self, diskset): """Does resizing of non-physical volumes.""" - # NOTE: this should be called with volumes active + + # have to have lvm on, which requires raid to be started + diskset.startMPath() + diskset.startDmRaid() + diskset.startMdRaid() + for luksDev in self.encryptedDevices.values(): + luksDev.openDevice() + lvm.vgactivate() # we only support resizing LVM of these types of things currently for lv in self.getLVMLVRequests(): @@ -1668,6 +1681,13 @@ class Partitions: lvm.lvresize(lv.logicalVolumeName, vg.volumeGroupName, lv.targetSize) + lvm.vgdeactivate() + for luksDev in self.encryptedDevices.values(): + luksDev.closeDevice() + diskset.stopMdRaid() + diskset.stopDmRaid() + diskset.stopMPath() + def deleteDependentRequests(self, request): """Handle deletion of this request and all requests which depend on it. diff --git a/po/sk.po b/po/sk.po index b2b6db848..52410cd18 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1847,7 +1847,7 @@ msgid "" "The partitioning options you have selected will now be written to disk. Any " "data on deleted or reformatted partitions will be lost" msgstr "" -"Vami zvolené možnosti rozdelenia busú teraz zapísané na disk. Všetky údaje " +"Vami zvolené možnosti rozdelenia budú teraz zapísané na disk. Všetky údaje " "na zmazaných alebo preformátovaných oddieloch budú stratené." #: ../partitions.py:119 diff --git a/rescue.py b/rescue.py index f31eabb4e..f9e6a74f1 100644 --- a/rescue.py +++ b/rescue.py @@ -22,6 +22,7 @@ import upgrade from snack import * +from constants import * from constants_text import * from text import WaitWindow, OkCancelWindow, ProgressWindow, PassphraseEntryWindow, stepToClasses from flags import flags @@ -33,7 +34,8 @@ import fsset import shutil import time -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/scripts/buildinstall b/scripts/buildinstall index a5001a9c5..4266d8301 100755 --- a/scripts/buildinstall +++ b/scripts/buildinstall @@ -69,7 +69,11 @@ while [ $# -gt 0 ]; do ;; *) + if [ -z "$REPO" ]; then REPO=$1 + else + EXTRA_REPOS="$EXTRA_REPOS $1" + fi shift ;; esac @@ -123,6 +127,22 @@ baseurl=$REPO enabled=1 EOF +n=1 +for r in $EXTRA_REPOS; do + if [[ $r =~ ^/ ]]; then + r="file://$r" + fi + cat >> $yumconf < width: - width = len(line) - - bb = ButtonBar(screen, [TEXT_OK_BUTTON]) - t = Textbox(width, height, stream, scroll=scroll) - - g = GridFormHelp(screen, title, "helponhelp", 1, 2) - g.add(t, 0, 0, padding=(0, 0, 0, 1)) - g.add(bb, 0, 1, growx=1) - - g.runOnce() - self.showingHelpOnHelp = 0 - except: - import traceback - (type, value, tb) = sys.exc_info() - from string import joinfields - list = traceback.format_exception(type, value, tb) - text = joinfields(list, "") - win = MainExceptionWindow(text, "/tmp/anacdump.txt", screen=screen) - win.run() - rc = win.getrc() - if rc == 1: - import pdb - pdb.post_mortem(tb) - os._exit(1) - def progressWindow(self, title, text, total, updpct = 0.05, pulse = False): return ProgressWindow(self.screen, title, text, total, updpct, pulse) @@ -565,10 +476,7 @@ class InstallInterface: else: self.screen.drawRootText (0, 0, _("Welcome to %s") % productName) - if (os.access("/usr/share/anaconda/help/C/s1-help-screens-lang.txt", os.R_OK)): - self.screen.pushHelpLine(_(" for help | between elements | selects | next screen")) - else: - self.screen.pushHelpLine(_(" / between elements | selects | next screen")) + self.screen.pushHelpLine(_(" / between elements | selects | next screen")) def setScreen(self, screen): self.screen = screen @@ -581,7 +489,6 @@ class InstallInterface: signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGTSTP, signal.SIG_IGN) self.screen = SnackScreen() - self.showingHelpOnHelp = 0 def __del__(self): if self.screen: @@ -604,18 +511,13 @@ class InstallInterface: instLang = anaconda.id.instLanguage if instLang.getFontFile(instLang.getCurrent()) == "none": - if anaconda.isKickstart and not anaconda.id.instClass.ksdata.interactive: - log.warning("%s display is unavailable in text mode. The " - "installation will continue in English.") - else: + if not anaconda.isKickstart: ButtonChoiceWindow(self.screen, "Language Unavailable", "%s display is unavailable in text mode. " "The installation will continue in " "English." % (instLang.getCurrent(),), buttons=[TEXT_OK_BUTTON]) - self.screen.helpCallback(self.helpWindow) - if not self.isRealConsole(): self.screen.suspendCallback(spawnShell, self.screen) diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py index ec4ca4bfc..ba02c53d9 100644 --- a/textw/bootloader_text.py +++ b/textw/bootloader_text.py @@ -20,9 +20,9 @@ from snack import * from constants import * from constants_text import * -from rhpl.translate import _ from flags import flags -import string +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class BootloaderChoiceWindow: diff --git a/textw/complete_text.py b/textw/complete_text.py index dc52f9546..c6ab30a2d 100644 --- a/textw/complete_text.py +++ b/textw/complete_text.py @@ -20,8 +20,9 @@ from snack import * from constants_text import * -from rhpl.translate import _ from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class FinishedWindow: diff --git a/textw/constants_text.py b/textw/constants_text.py index 8a283b620..f5448338b 100644 --- a/textw/constants_text.py +++ b/textw/constants_text.py @@ -17,7 +17,7 @@ # along with this program. If not, see . # -from rhpl.translate import _, N_ +from constants import * INSTALL_OK = 0 INSTALL_BACK = -1 diff --git a/textw/grpselect_text.py b/textw/grpselect_text.py index 9e082c5fc..fd33892c6 100644 --- a/textw/grpselect_text.py +++ b/textw/grpselect_text.py @@ -22,38 +22,15 @@ import yum.Errors from snack import * from constants_text import * -from rhpl.translate import _, N_, getDefaultLangs +import yuminstall + +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") -# kind of lame caching of translations so we don't always have -# to do all the looping -strs = {} -def _xmltrans(base, thedict): - if strs.has_key(base): - return strs[base] - - langs = getDefaultLangs() - for l in langs: - if thedict.has_key(l): - strs[base] = thedict[l] - return strs[base] - strs[base] = base - return base - -def _ui_comps_sort(one, two): - if one.display_order > two.display_order: - return 1 - elif one.display_order < two.display_order: - return -1 - elif _xmltrans(one.name, one.translated_name) > \ - _xmltrans(two.name, two.translated_name): - return 1 - elif _xmltrans(one.name, one.translated_name) < \ - _xmltrans(two.name, two.translated_name): - return -1 - return 0 class GroupSelectionWindow: def __deselectPackage(self, grp, pkg): @@ -98,10 +75,10 @@ class GroupSelectionWindow: # FIXME: this is very yum backend specific... groups = filter(lambda x: x.user_visible, anaconda.backend.ayum.comps.groups) - groups.sort(_ui_comps_sort) + groups.sort(yuminstall.ui_comps_sort) ct = CheckboxTree(height = 6, scroll = (len(groups) > 6)) for grp in groups: - ct.append(_xmltrans(grp.name, grp.translated_name), + ct.append(yuminstall.xmltrans(grp.name, grp.translated_name), grp, grp.selected) g.add(ct, 0, 2, (0, 0, 0, 1)) diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py index 4bf8e7770..52ecffb2c 100644 --- a/textw/keyboard_text.py +++ b/textw/keyboard_text.py @@ -22,7 +22,9 @@ from snack import * from constants_text import * from flags import flags -from rhpl.translate import _ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/textw/language_text.py b/textw/language_text.py index 644eb2e39..8b920b5e6 100644 --- a/textw/language_text.py +++ b/textw/language_text.py @@ -21,7 +21,9 @@ from snack import * from constants_text import * -from rhpl.translate import _ +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/textw/network_text.py b/textw/network_text.py index 4f46ef652..517a10a72 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -29,7 +29,9 @@ import socket from snack import * from constants_text import * from constants import * -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/textw/partition_text.py b/textw/partition_text.py index e59a496bf..40831077b 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -38,7 +38,8 @@ from snack import * from constants_text import * from constants import * -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") @@ -1628,7 +1629,7 @@ class PartitionTypeWindow: import iscsi if iscsi.has_iscsi(): newdrv.append("Add iSCSI target") - if rhpl.getArch() in ("s390", "s390x"): + if iutil.isS390(): newdrv.append( "Add zFCP LUN" ) if len(newdrv) == 0: diff --git a/textw/partmethod_text.py b/textw/partmethod_text.py index 677f6542c..85d07ef6a 100644 --- a/textw/partmethod_text.py +++ b/textw/partmethod_text.py @@ -21,10 +21,12 @@ # from snack import * -from rhpl.translate import _, cat, N_ from constants_text import * from autopart import PARTMETHOD_TYPE_DESCR_TEXT +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class PartitionMethod: def __call__(self, screen, partitions, instclass): rc = ButtonChoiceWindow(screen, _("Disk Partitioning Setup"), diff --git a/textw/progress_text.py b/textw/progress_text.py index d35832646..069107e8d 100644 --- a/textw/progress_text.py +++ b/textw/progress_text.py @@ -21,7 +21,9 @@ from constants import * from snack import * from constants_text import * -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") diff --git a/textw/task_text.py b/textw/task_text.py index cafc1e90c..470053df6 100644 --- a/textw/task_text.py +++ b/textw/task_text.py @@ -19,8 +19,10 @@ from snack import * from constants_text import * -from rhpl.translate import _, N_ -from constants import productName +from constants import * + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class TaskWindow: def groupsInstalled(self, lst): diff --git a/textw/timezone_text.py b/textw/timezone_text.py index 228b5d65a..f12ea7870 100644 --- a/textw/timezone_text.py +++ b/textw/timezone_text.py @@ -24,10 +24,11 @@ import iutil from time import * from snack import * from constants_text import * -from rhpl.translate import _, textdomain from bootloader import hasWindows -textdomain("system-config-date") +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) sys.path.append("/usr/share/system-config-date") @@ -84,7 +85,7 @@ class TimezoneWindow: self.l = Listbox(5, scroll = 1, returnExit = 0) for tz in timezones: - self.l.append(_(tz), tz) + self.l.append(gettext.ldgettext("system-config-date", tz), tz) self.l.setCurrent(default.replace("_", " ")) # self.l.setCallback(self.updateClock) diff --git a/textw/upgrade_bootloader_text.py b/textw/upgrade_bootloader_text.py index a7cfd6c23..636d78998 100644 --- a/textw/upgrade_bootloader_text.py +++ b/textw/upgrade_bootloader_text.py @@ -21,11 +21,14 @@ from snack import * from constants_text import * -from rhpl.translate import _ from flags import flags import string import checkbootloader +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py index 2810877ef..df79148f6 100644 --- a/textw/upgrade_text.py +++ b/textw/upgrade_text.py @@ -17,7 +17,6 @@ # along with this program. If not, see . # -import string import isys import iutil import upgrade @@ -27,7 +26,8 @@ from fsset import * from flags import flags from constants import * -from rhpl.translate import _ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class UpgradeMigrateFSWindow: def __call__ (self, screen, anaconda): diff --git a/textw/userauth_text.py b/textw/userauth_text.py index fff5f9f64..c0ed6dd4f 100644 --- a/textw/userauth_text.py +++ b/textw/userauth_text.py @@ -19,9 +19,12 @@ from snack import * from constants_text import * -from rhpl.translate import _ import cracklib +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + class RootPasswordWindow: def __call__ (self, screen, anaconda): toplevel = GridFormHelp(screen, _("Root Password"), "rootpw", 1, 3) diff --git a/textw/welcome_text.py b/textw/welcome_text.py index ac5e805ca..c5fce5c70 100644 --- a/textw/welcome_text.py +++ b/textw/welcome_text.py @@ -19,8 +19,9 @@ from snack import * from constants_text import * -from rhpl.translate import _ from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class WelcomeWindow: def __call__(self, screen, anaconda): diff --git a/textw/zipl_text.py b/textw/zipl_text.py index 9472e2b6f..b112e0b5b 100644 --- a/textw/zipl_text.py +++ b/textw/zipl_text.py @@ -22,7 +22,10 @@ import isys import string from snack import * from constants_text import * -from rhpl.translate import _ + +from constants import * +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) class ZiplWindow: def __call__(self, screen, anaconda): diff --git a/upgrade.py b/upgrade.py index 78a50522f..d95609d03 100644 --- a/upgrade.py +++ b/upgrade.py @@ -36,7 +36,9 @@ from constants import * from product import productName import rhpl -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import rpm @@ -51,12 +53,12 @@ upgrade_remove_blacklist = [("system-config-mouse",), ("dev",)] # multilib package removed. the new -libs package will then get pulled in # automatically by dependencies splitpkgs = ("e2fsprogs", "hal", "mysql", "esound", "mkinitrd", "dbus", "kdeaccessibility", "kdebase", "kdeedu", "kdegraphics", "kdemultimedia", "kdemultimedia-extras","kdenetwork", "kdesdk", "kdeutils", "kdewebdev", "gdb", "kmymoney2", "gnome-applets", "geomview", "gnome-panel", "nas") -if rhpl.getArch() == "x86_64": +if iutil.isX86(bits=64): upgrade_remove_blacklist.extend(map(lambda x: (x, "i386"), splitpkgs)) -if rhpl.getArch() == "ppc": +if iutil.isPPC(): upgrade_remove_blacklist.extend(map(lambda x: (x, "ppc64"), splitpkgs)) -if rhpl.getArch() == "x86_64": +if iutil.isX86(bits=64): upgrade_remove_blacklist.extend( [("perl","i386")] ) def guessGuestArch(rootdir): @@ -439,7 +441,7 @@ def upgradeMountFilesystems(anaconda): for entry in newfsset.entries: anaconda.id.fsset.add(entry) if flags.setupFilesystems: - if rhpl.getArch() == "ppc": + if iutil.isPPC(): anaconda.id.fsset.formatSwap(anaconda.rootPath, forceFormat=True) anaconda.id.fsset.turnOnSwap(anaconda.rootPath, upgrading=True) anaconda.id.fsset.mkDevRoot(anaconda.rootPath) @@ -489,8 +491,8 @@ def setSteps(anaconda): "complete" ) - if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": + if not iutil.isX86(): dispatch.skipStep("bootloader") - if rhpl.getArch() != "i386" and rhpl.getArch() != "x86_64": + if not iutil.isX86(): dispatch.skipStep("upgbootloader") diff --git a/vnc.py b/vnc.py index 1af9752bf..8b9ee4af6 100644 --- a/vnc.py +++ b/vnc.py @@ -22,8 +22,8 @@ import os, sys, string import time from snack import * +from constants import * from constants_text import * -from rhpl.translate import _, N_ import network import isys import product @@ -31,6 +31,9 @@ import iutil import socket import subprocess +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) + import logging log = logging.getLogger("anaconda") @@ -207,7 +210,7 @@ class VncServer: else: self.log.info(_("Please manually connect your vnc client to begin the install.")) - def startServer(self, vncStartedCB=None): + def startServer(self): self.log.info(_("Starting VNC...")) # Lets call it from here for now. @@ -270,9 +273,6 @@ class VncServer: os.environ["DISPLAY"]=":%s" % self.display - if vncStartedCB: - vncStartedCB() - def changeVNCPasswdWindow(self): """ Change the password to a sane parameter. diff --git a/xsetup.py b/xsetup.py deleted file mode 100644 index 60d159317..000000000 --- a/xsetup.py +++ /dev/null @@ -1,81 +0,0 @@ -# -# xsetup.py - handles anaconda specific XFree86 needs -# -# Copyright (C) 2002, 2003 Red Hat, Inc. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# Author(s): Michael Fulbright -# - -# -# should probably go in rhpl -# -import string -import rhpl -from rhpl.translate import _ - -class XSetup: - def __init__(self, xserver, anaconda): - self.skipx = 0 - self.xserver = xserver - self.anaconda = anaconda - - def write(self, fn, keyboard): - self.xserver.keyboard = keyboard - self.xserver.generateConfig() - - if self.anaconda.isKickstart: - res = self.anaconda.id.ksdata.xconfig.resolution - - if res: - import xf86config - screen = xf86config.getPrimaryScreen(self.xserver.config) - screen.display[0].modes.insert(xf86config.XF86Mode(res)) - - self.xserver.writeConfig(filename=fn+"/xorg.conf") - - def writeKS(self, f, desktop, ksconfig): - if self.skipx: - f.write("skipx\n") - return - - # We don't want to write out the X config arguments unless they - # were previously specified in kickstart. - args = [] - if desktop: - rl = desktop.getDefaultRunLevel() - if rl and str(rl) == '5': - args += ['--startxonboot'] - gui = desktop.getDefaultDesktop() - if gui: - args += ['--defaultdesktop', string.lower(gui)] - - # We don't want anything else on s390. - if rhpl.getArch() == "s390" and args != []: - f.write("xconfig %s\n" % string.join(args, " ")) - return - - if ksconfig: - s = ksconfig.xconfig.__str__().rstrip() - f.write(s) - - for arg in args: - if s.find(arg) == -1: - f.write(" %s" % arg) - - f.write("\n") - f.write(ksconfig.monitor.__str__()) - elif args != []: - f.write("xconfig %s\n" % string.join(args, " ")) diff --git a/yuminstall.py b/yuminstall.py index 9303607ca..dcc080cdd 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -36,7 +36,6 @@ import urlgrabber.grabber from urlgrabber.grabber import URLGrabber, URLGrabError import yum import iniparse -import rhpl from yum.constants import * from yum.Errors import RepoError, YumBaseError, PackageSackError from yum.yumRepo import YumRepository @@ -46,12 +45,15 @@ from sortedtransaction import SplitMediaTransactionData from constants import * from image import * import packages -from rhpl.translate import _ + +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import network # specspo stuff rpm.addMacro("_i18ndomains", "redhat-dist") +textdomain("redhat-dist") import logging log = logging.getLogger("anaconda") @@ -59,6 +61,7 @@ log = logging.getLogger("anaconda") import urlparse urlparse.uses_fragment.append('media') +urlgrabber.grabber.default_grabber.opts.user_agent = "%s (anaconda)/%s" %(productName, productVersion) import iutil import isys @@ -81,6 +84,52 @@ def size_string (size): else: return _("%s Bytes") %(number_format(size),) +def _getDefaultLangs(): + languages = [] + for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'): + val = os.environ.get(envar) + if val: + languages = val.split(':') + break + if 'C' not in languages: + languages.append('C') + + # now normalize and expand the languages + nelangs = [] + for lang in languages: + for nelang in gettext._expand_lang(lang): + if nelang not in nelangs: + nelangs.append(nelang) + return nelangs + +# kind of lame caching of translations so we don't always have +# to do all the looping +strs = {} +def xmltrans(base, thedict): + if strs.has_key(base): + return strs[base] + + langs = _getDefaultLangs() + for l in langs: + if thedict.has_key(l): + strs[base] = thedict[l] + return strs[base] + strs[base] = base + return base + +def ui_comps_sort(one, two): + if one.display_order > two.display_order: + return 1 + elif one.display_order < two.display_order: + return -1 + elif _xmltrans(one.name, one.translated_name) > \ + _xmltrans(two.name, two.translated_name): + return 1 + elif _xmltrans(one.name, one.translated_name) < \ + _xmltrans(two.name, two.translated_name): + return -1 + return 0 + class AnacondaCallback: def __init__(self, ayum, anaconda, instLog, modeText): @@ -157,7 +206,7 @@ class AnacondaCallback: sum = hdr['summary'] or "" if type(sum) != unicode: sum = unicode(sum, encoding='utf-8') - s += sum + s += gettext.ldgettext("redhat-dist", sum.strip()) self.progress.set_label(s) self.instLog.write(self.modeText % pkgStr) @@ -173,6 +222,8 @@ class AnacondaCallback: self.openfile = f except yum.Errors.NoMoreMirrorsRepoError: self.ayum._handleFailure(po) + except IOError: + self.ayum._handleFailure(po) except yum.Errors.RepoError, e: continue self.inProgressPo = po @@ -222,8 +273,8 @@ class AnacondaCallback: self.progress.processEvents() class AnacondaYumRepo(YumRepository): - def __init__( self, uri=None, mirrorlist=None, - repoid='anaconda%s' % productStamp, + def __init__( self, repoid='anaconda%s' % productStamp, + uri=None, mirrorlist=None, root = "/mnt/sysimage/", addon=True): YumRepository.__init__(self, repoid) conf = yum.config.RepoConf() @@ -485,16 +536,49 @@ class AnacondaYum(YumSorter): text=kwargs["text"], range=kwargs["range"], copy_local=1) return kwargs["local"] - def doConfigSetup(self, fn='/etc/yum.conf', root='/'): - self.conf = yum.config.YumConf() - self.conf.installroot = root - self.conf.reposdir=["/tmp/repos.d"] - self.conf.logfile="/tmp/yum.log" - self.conf.obsoletes=True - self.conf.cache=0 - self.conf.cachedir = "%s/var/cache/yum" % self.anaconda.rootPath - self.conf.metadata_expire = 0 + # XXX: This is straight out of yum, but we need to override it here in + # order to use our own repo class. + def readRepoConfig(self, parser, section): + '''Parse an INI file section for a repository. + + @param parser: ConfParser or similar to read INI file values from. + @param section: INI file section to read. + @return: YumRepository instance. + ''' + repo = AnacondaYumRepo(section) + repo.populate(parser, section, self.conf) + + # Ensure that the repo name is set + if not repo.name: + repo.name = section + self.logger.error(_('Repository %r is missing name in configuration, ' + 'using id') % section) + + # Set attributes not from the config file + repo.basecachedir = self.conf.cachedir + repo.yumvar.update(self.conf.yumvar) + repo.cfg = parser + + return repo + + # We need to make sure $releasever gets set up before .repo files are + # read. Since there's no redhat-release package in /mnt/sysimage (and + # won't be for quite a while), we need to do our own substutition. + def getReposFromConfig(self): + def _getReleasever(): + from ConfigParser import ConfigParser + c = ConfigParser() + ConfigParser.read(c, "%s/.treeinfo" % self.tree) + return c.get("general", "version") + + self.yumvar["releasever"] = _getReleasever() + YumSorter.getReposFromConfig(self) + + # Override this method so yum doesn't nuke our existing logging config. + def doLoggingSetup(self, debuglevel, errorlevel): + pass + def doConfigSetup(self, fn='/etc/yum.conf', root='/'): if self.anaconda.methodstr.startswith("nfs:"): if os.path.isdir(self.anaconda.methodstr[4:]): self.tree = self.anaconda.methodstr[4:] @@ -511,7 +595,9 @@ class AnacondaYum(YumSorter): elif self.anaconda.methodstr.startswith("ftp:") or self.anaconda.methodstr.startswith("http:"): methodstr = self.anaconda.methodstr - # set up logging to log to our logs + YumSorter.doConfigSetup(self, fn=fn, root=root) + + # override default logging to use our logs ylog = logging.getLogger("yum") map(lambda x: ylog.addHandler(x), log.handlers) @@ -519,7 +605,7 @@ class AnacondaYum(YumSorter): # add default repos for (name, uri) in self.anaconda.id.instClass.getPackagePaths(methodstr).items(): rid = name.replace(" ", "") - repo = AnacondaYumRepo(uri, addon=False, + repo = AnacondaYumRepo(uri=uri, addon=False, repoid="anaconda-%s-%s" %(rid, productStamp), root = root) repo.name = name @@ -547,19 +633,6 @@ class AnacondaYum(YumSorter): repo.enable() self.repos.add(repo) - extraRepos = [] - - # add some additional not enabled by default repos. - # FIXME: this is a hack and should probably be integrated - # with the above - for (name, (uri, mirror)) in self.anaconda.id.instClass.repos.items(): - rid = name.replace(" ", "") - repo = AnacondaYumRepo(uri=uri, mirrorlist=mirror, repoid=rid, - root=root) - repo.name = name - repo.disable() - extraRepos.append(repo) - if self.anaconda.id.extraModules: for d in glob.glob("/tmp/DD-*/rpms"): dirname = os.path.basename(os.path.dirname(d)) @@ -569,33 +642,8 @@ class AnacondaYum(YumSorter): root=root, addon=False) repo.name = "Driver Disk %s" % dirname.split("-")[1] repo.enable() - extraRepos.append(repo) - - if self.anaconda.isKickstart: - for ksrepo in self.anaconda.id.ksdata.repo.repoList: - repo = AnacondaYumRepo(uri=ksrepo.baseurl, - mirrorlist=ksrepo.mirrorlist, - repoid=ksrepo.name) - repo.name = ksrepo.name - repo.enable() - extraRepos.append(repo) - - for repo in extraRepos: - try: - self.repos.add(repo) - log.info("added repository %s with URL %s" % (repo.name, repo.mirrorlist or repo.baseurl)) - except yum.Errors.DuplicateRepoError, e: - log.warning("ignoring duplicate repository %s with URL %s" % (repo.name, repo.mirrorlist or repo.baseurl)) - self.doPluginSetup(searchpath=["/usr/lib/yum-plugins", - "/tmp/updates/yum-plugins", - "/mnt/source/RHupdates/yum-plugins"], - confpath=["/etc/yum/pluginconf.d", - "/tmp/updates/pluginconf.d", - "/mnt/source/RHupdates/pluginconf.d"]) - self.plugins.run('init') - - self.repos.setCacheDir("%s/var/cache/yum" % self.anaconda.rootPath) + self.repos.setCacheDir("%s/var/cache/yum" % self.conf.cachedir) def downloadHeader(self, po): while True: @@ -879,6 +927,23 @@ class YumBackend(AnacondaBackend): AnacondaBackend.__init__(self, anaconda) self.supportsPackageSelection = True + buf = """ +[main] +cachedir=%s/var/cache/yum +installroot=%s +keepcache=0 +logfile=/tmp/yum.log +metadata_expire=0 +obsoletes=True +pluginpath=/usr/lib/yum-plugins,/tmp/updates/yum-plugins,/mnt/source/RHupdates/yum-plugins +pluginconfpath=/etc/yum/pluginconf.d,/tmp/updates/pluginconf.d,/mnt/source/RHupdates/pluginconf.d +reposdir=/etc/yum.repos.d,/tmp/updates/yum.repos.d,/mnt/source/RHupdates/yum.repos.d,/tmp/product/yum.repos.d +""" % (anaconda.rootPath, anaconda.rootPath) + + fd = open("/etc/yum.conf", "w") + fd.write(buf) + fd.close() + def complete(self, anaconda): try: isys.umount(self.ayum.tree) @@ -1196,14 +1261,14 @@ class YumBackend(AnacondaBackend): self.selectPackage("kernel-devel.%s" % (kpkg.arch,)) def selectBootloader(self): - if rhpl.getArch() in ("i386", "x86_64"): + if iutil.isX86(): self.selectPackage("grub") - elif rhpl.getArch() == "s390": + elif iutil.isS390(): self.selectPackage("s390utils") - elif rhpl.getArch() == "ppc": + elif iutil.isPPC(): self.selectPackage("yaboot") # XXX this needs to become grub, and we need an upgrade path... - elif rhpl.getArch() == "ia64": + elif iutil.isIA64(): self.selectPackage("elilo") def selectFSPackages(self, fsset, diskset): @@ -1270,11 +1335,11 @@ class YumBackend(AnacondaBackend): try: (code, msgs) = self.ayum.buildTransaction() except Exception, e: - buttons = [_("_Exit installer"), "gtk-edit", _("_Retry")] + buttons = [_("_Exit installer"), _("_Retry")] else: break - # FIXME: this message isn't ideal, but it'll do for now + # FIXME: would be nice to be able to recover here rc = anaconda.intf.messageWindow(_("Error"), _("Unable to read package metadata. This may be " "due to a missing repodata directory. Please " @@ -1284,8 +1349,6 @@ class YumBackend(AnacondaBackend): custom_buttons=buttons) if rc == 0: sys.exit(0) - elif rc == 1: - anaconda.intf.editRepoWindow(anaconda, repo) else: continue diff --git a/zfcp.py b/zfcp.py index c8419b4d2..cc77a2491 100644 --- a/zfcp.py +++ b/zfcp.py @@ -24,8 +24,10 @@ import os import iutil import isys import shutil +from constants import * -from rhpl.translate import _, N_ +import gettext +_ = lambda x: gettext.ldgettext("anaconda", x) import logging log = logging.getLogger("anaconda") -- cgit