# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/support.py, modules/catalyst/target/stage1.py,
+ modules/catalyst/target/stage2.py, modules/catalyst/util.py:
+ Move list_to_string() from catalyst.support to catalyst.util
+
11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/output.py, modules/catalyst/support.py,
modules/catalyst/target/generic_stage.py, modules/catalyst/target/grp.py,
verbosity=1
-def list_to_string(mylist):
- if type(mylist)==types.StringType:
- mypack=[mylist]
- else:
- mypack=mylist[:]
- for x in range(0,len(mypack)):
- # surround args with quotes for passing to bash,
- # allows things like "<" to remain intact
- mypack[x]=mypack[x]
- mypack=string.join(mypack)
- return mypack
-
class CatalystError(Exception):
def __init__(self, message):
if message:
from catalyst.support import *
from generic_stage import *
+import catalyst.util
class stage1_target(generic_stage_target):
def __init__(self,spec,addlargs):
def override_chost(self):
if "chost" in self.settings:
- self.settings["CHOST"]=list_to_string(self.settings["chost"])
+ self.settings["CHOST"] = catalyst.util.list_to_string(self.settings["chost"])
def override_cflags(self):
if "cflags" in self.settings:
- self.settings["CFLAGS"]=list_to_string(self.settings["cflags"])
+ self.settings["CFLAGS"] = catalyst.util.list_to_string(self.settings["cflags"])
def override_cxxflags(self):
if "cxxflags" in self.settings:
- self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"])
+ self.settings["CXXFLAGS"] = catalyst.util.list_to_string(self.settings["cxxflags"])
def override_ldflags(self):
if "ldflags" in self.settings:
- self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
+ self.settings["LDFLAGS"] = catalyst.util.list_to_string(self.settings["ldflags"])
def set_portage_overlay(self):
generic_stage_target.set_portage_overlay(self)
from catalyst.support import *
from generic_stage import *
+import catalyst.util
class stage2_target(generic_stage_target):
def __init__(self,spec,addlargs):
def override_chost(self):
if "chost" in self.settings:
- self.settings["CHOST"]=list_to_string(self.settings["chost"])
+ self.settings["CHOST"] = catalyst.util.list_to_string(self.settings["chost"])
def override_cflags(self):
if "cflags" in self.settings:
- self.settings["CFLAGS"]=list_to_string(self.settings["cflags"])
+ self.settings["CFLAGS"] = catalyst.util.list_to_string(self.settings["cflags"])
def override_cxxflags(self):
if "cxxflags" in self.settings:
- self.settings["CXXFLAGS"]=list_to_string(self.settings["cxxflags"])
+ self.settings["CXXFLAGS"] = catalyst.util.list_to_string(self.settings["cxxflags"])
def override_ldflags(self):
if "ldflags" in self.settings:
- self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
+ self.settings["LDFLAGS"] = catalyst.util.list_to_string(self.settings["ldflags"])
def set_portage_overlay(self):
generic_stage_target.set_portage_overlay(self)
mypack = "".join(mypack)
return mypack
+def list_to_string(mylist):
+ if isinstance(mylist, str):
+ mypack=[mylist]
+ else:
+ mypack=mylist[:]
+ mypack = " ".join(mypack)
+ return mypack
+