From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5B33F138360 for ; Tue, 8 Jan 2013 07:32:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE6FF21C086 for ; Tue, 8 Jan 2013 07:32:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EA49321C03B for ; Tue, 8 Jan 2013 07:28:04 +0000 (UTC) Received: from [192.168.1.210] (xx250174254.cipherkey.com [205.250.174.254]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 6484433DAA6 for ; Tue, 8 Jan 2013 07:28:03 +0000 (UTC) Message-ID: <1357630057.4289.17.camel@big_daddy.dol-sen.ca> Subject: Re: [gentoo-catalyst] Catalyst tree move code changes. [1 of 4] now [1 of 2] From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Date: Mon, 07 Jan 2013 23:27:37 -0800 In-Reply-To: <1357522877.17120.9.camel@big_daddy.dol-sen.ca> References: <1357522877.17120.9.camel@big_daddy.dol-sen.ca> Organization: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Ye35t7IusfpbXWQd5Dda" X-Mailer: Evolution 3.4.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org Mime-Version: 1.0 X-Archives-Salt: 16e0e544-14cb-4c7e-86d9-e8f9895c779c X-Archives-Hash: d088e84d9ea33854ef7fd2315ce871a6 --=-Ye35t7IusfpbXWQd5Dda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 2013-01-06 at 17:41 -0800, Brian Dolbec wrote: > This is the first of some untested (but they compile without errors) > patches to catalyst for the pending default tree location changes. >=20 > My current gentoo machine is somewhat limited in capability (memory > shortage, only moderate cpu horespower) for doing proper testing. But I > will try and get it setup better to do some test runs for changes. >=20 > I can also push my catalyst git repo to my dev space for you to checkout > and do some tests on if you like. >=20 >=20 As requested. Separated whitespace cleanup. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/catalyst b/catalyst index 3d31599..c77658a 100755 @@ -66,7 +66,7 @@ def parse_config(myconfig): "portdir":"/usr/portage","options":"",\ "snapshot_cache":"/var/tmp/catalyst/snapshot_cache",\ "hash_function":"crc32"} - =09 + # first, try the one passed (presumably from the cmdline) if myconfig: if os.path.exists(myconfig): @@ -77,12 +77,12 @@ def parse_config(myconfig): print "!!! catalyst: Could not use specified configuration file "+\ myconfig sys.exit(1) -=09 + # next, try the default location elif os.path.exists("/etc/catalyst/catalyst.conf"): print "Using default Catalyst configuration file, /etc/catalyst/catalyst= .conf" config_file=3D"/etc/catalyst/catalyst.conf" -=09 + # can't find a config file (we are screwed), so bail out else: print "!!! catalyst: Could not find a suitable configuration file" @@ -93,11 +93,11 @@ def parse_config(myconfig): # execfile(config_file, myconf, myconf) myconfig =3D catalyst.config.ConfigParser(config_file) myconf.update(myconfig.get_values()) -=09 + except: print "!!! catalyst: Unable to parse configuration file, "+myconfig sys.exit(1) -=09 + # now, load up the values into conf_values so that we can use them for x in confdefaults.keys(): if myconf.has_key(x): @@ -208,9 +208,9 @@ def build_target(addlargs, targetmap): try: if not targetmap.has_key(addlargs["target"]): raise CatalystError,"Target \""+addlargs["target"]+"\" not available." - =09 + mytarget=3Dtargetmap[addlargs["target"]](conf_values, addlargs) -=09 + mytarget.run() =20 except: @@ -220,7 +220,7 @@ def build_target(addlargs, targetmap): =20 if __name__ =3D=3D "__main__": targetmap=3D{} -=09 + version() if os.getuid() !=3D 0: # catalyst cannot be run as a normal user due to chroots, mounts, etc @@ -236,11 +236,11 @@ if __name__ =3D=3D "__main__": try: opts,args =3D getopt.getopt(sys.argv[1:], "apPThvdc:C:f:FVs:", ["purge",= "purgeonly", "purgetmponly", "help", "version", "debug",\ "clear-autoresume", "config=3D", "cli=3D", "file=3D", "fetch", "verbose= ","snapshot=3D"]) -=09 + except getopt.GetoptError: usage() sys.exit(2) -=09 + # defaults for commandline opts debug=3DFalse verbose=3DFalse @@ -261,7 +261,7 @@ if __name__ =3D=3D "__main__": if o in ("-h", "--help"): usage() sys.exit(1) - =09 + if o in ("-V", "--version"): print "Catalyst version "+__version__ sys.exit(1) @@ -279,14 +279,14 @@ if __name__ =3D=3D "__main__": while x < len(sys.argv): mycmdline.append(sys.argv[x]) x=3Dx+1 - =09 + if o in ("-f", "--file"): run =3D True myspecfile=3Da =20 if o in ("-F", "--fetchonly"): conf_values["FETCH"]=3D"1" - =09 + if o in ("-v", "--verbose"): conf_values["VERBOSE"]=3D"1" =20 @@ -299,7 +299,7 @@ if __name__ =3D=3D "__main__": run =3D True mycmdline.append("target=3Dsnapshot") mycmdline.append("version_stamp=3D"+a) - =09 + if o in ("-p", "--purge"): conf_values["PURGE"] =3D "1" =20 @@ -321,7 +321,7 @@ if __name__ =3D=3D "__main__": parse_config(myconfig) sys.path.append(conf_values["sharedir"]+"/modules") from catalyst_support import * -=09 + # Start checking that digests are valid now that the hash_map was importe= d # from catalyst_support if conf_values.has_key("digests"): @@ -365,11 +365,11 @@ if __name__ =3D=3D "__main__": targetmap=3Dimport_modules() =20 addlargs=3D{} -=09 + if myspecfile: spec =3D catalyst.config.SpecParser(myspecfile) addlargs.update(spec.get_values()) -=09 + if mycmdline: try: cmdline =3D catalyst.config.ConfigParser() @@ -385,7 +385,7 @@ if __name__ =3D=3D "__main__": # everything is setup, so the build is a go try: build_target(addlargs, targetmap) - =09 + except CatalystError: print print "Catalyst aborting...." =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 Brian Dolbec --=-Ye35t7IusfpbXWQd5Dda Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABAgAGBQJQ68ppAAoJECIU2QoBTxfLhe0H/Ail5u9oRIbBJmXnJEw9G9o3 eeqDapj8CIUBifHfYw7xY1nAE3eybvBtMAPFIevLz5/1E5oN7C4RHFijbuwrbvRX ADpX2AcYzI56ThEKg19IiUjR0c2GtI98f+Rpg1kAv9VsjbiqXKhwift7FAt0clD7 5Cw9CLxNGnw5Ir2JS+ELkxuszB1LoXbRnHUDqH5zumYOAWowkANCIstsRmb8GIQm rYA9ZfeKrPGBsxSHlDLBhLHf0d0UIk9q4wNHY+2z/CV5SGjRQEIBoFA1n0xXQiN1 g+Yk3YTQxX4KElK3hpm0vCwkIfCUKviRC2Tbxhgxj7NoakMQdZvT9m6LFRoZleg= =wBgt -----END PGP SIGNATURE----- --=-Ye35t7IusfpbXWQd5Dda--