public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/mirrorselect:master commit in: /
Date: Sun, 11 Nov 2012 23:47:27 +0000 (UTC)	[thread overview]
Message-ID: <1352673436.79d5fb82b2d78e8f931d5759ec1c7ce747eb9edf.dol-sen@gentoo> (raw)

commit:     79d5fb82b2d78e8f931d5759ec1c7ce747eb9edf
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 11 22:24:22 2012 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Nov 11 22:37:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=79d5fb82

update for the new make.conf location as well as the old.

---
 main.py |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/main.py b/main.py
index a70272f..1d01e6d 100755
--- a/main.py
+++ b/main.py
@@ -655,7 +655,7 @@ def write_config(hosts, out, path, sync=False):
 
 
 	output.write('\n')
-	output.print_info('Modifying make.conf with new mirrors...\n')
+	output.print_info('Modifying %s with new mirrors...\n' % path)
 	try:
 		config = open(path, 'r')
 		output.write('\tReading make.conf\n')
@@ -673,7 +673,7 @@ def write_config(hosts, out, path, sync=False):
 
 	lines.append(mirror_string)
 
-	output.write('\tWriting new make.conf\n')
+	output.write('\tWriting new %s\n' % path)
 	config = open(path, 'w')
 	for line in lines:
 		config.write(line)
@@ -732,7 +732,7 @@ def get_filesystem_mirrors(out, path, sync=False):
 
 	return fsmirrors
 
-def parse_args(argv):
+def parse_args(argv, config_path):
 	"""
 	Does argument parsing and some sanity checks.
 	Returns an optparse Options object.
@@ -745,7 +745,7 @@ def parse_args(argv):
 			"",
 			output.white("	 automatic:"),
 			"		 # mirrorselect -s5",
-			"		 # mirrorselect -s3 -b10 -o >> /mnt/gentoo/etc/make.conf",
+			"		 # mirrorselect -s3 -b10 -o >> /mnt/gentoo/etc/portage/make.conf",
 			"		 # mirrorselect -D -s4",
 			"",
 			output.white("	 interactive:"),
@@ -792,7 +792,7 @@ def parse_args(argv):
 		"-o", "--output", action="store_true", default=False,
 		help="Output Only Mode, this is especially useful "
 		"when being used during installation, to redirect "
-		"output to a file other than /etc/make.conf")
+		"output to a file other than %s" % config_path)
 	group.add_option(
 		"-b", "--blocksize", action="store", type="int",
 		help="This is to be used in automatic mode "
@@ -849,7 +849,7 @@ def parse_args(argv):
 			'You must use the -D flag')
 
 	if (os.getuid() != 0) and not options.output:
-		output.print_err('Must be root to write to /etc/make.conf!\n')
+		output.print_err('Must be root to write to %s!\n' % config_path)
 
 	if args:
 		output.print_err('Unexpected arguments passed.')
@@ -858,14 +858,20 @@ def parse_args(argv):
 	return options
 
 
-output = Output()	#the only FUCKING global. Damnit.
+output = Output()  #the only FUCKING global. Damnit.
 def main(argv):
 	"""Lets Rock!"""
-	config_path = '/etc/make.conf'
-
+	# start with the new location
+	config_path = '/etc/portage/make.conf'
+	if not os.access(config_path, os.F_OK):
+		# check if the old location is what is used
+		if os.access('/etc/make.conf', os.F_OK):
+			config_path = '/etc/make.conf'
+
+	#output.print_info("config_path set to :", config_path)
 	signal.signal(signal.SIGINT, handler)
 
-	options = parse_args(argv)
+	options = parse_args(argv, config_path)
 	output.verbosity = options.verbosity
 
 	fsmirrors = get_filesystem_mirrors(options.output, config_path, options.rsync)


             reply	other threads:[~2012-11-11 23:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-11 23:47 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-11 23:47 [gentoo-commits] proj/mirrorselect:master commit in: / Brian Dolbec
2012-11-12  0:50 Brian Dolbec
2012-11-12  7:46 Brian Dolbec
2012-11-12 15:56 Brian Dolbec
2012-11-12 21:41 Brian Dolbec
2012-11-14 18:06 Paul Varner
2012-11-14 18:18 Paul Varner
2012-11-14 18:25 Paul Varner
2012-12-15 20:26 Brian Dolbec
2012-12-15 22:31 Brian Dolbec
2012-12-16  4:48 Brian Dolbec
2012-12-16  6:02 Brian Dolbec
2013-03-10 13:07 Brian Dolbec
2013-10-18 14:26 Brian Dolbec
2014-01-31 15:44 [gentoo-commits] proj/mirrorselect:ssl " Brian Dolbec
2014-03-02  7:44 ` [gentoo-commits] proj/mirrorselect:master " Brian Dolbec
2014-05-05  2:04 Brian Dolbec
2014-05-29 16:32 Brian Dolbec
2019-02-13  8:43 Zac Medico
2022-05-31  4:08 Brian Dolbec
2022-05-31 18:56 Brian Dolbec
2022-07-10 21:16 Brian Dolbec
2023-08-07  0:14 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352673436.79d5fb82b2d78e8f931d5759ec1c7ce747eb9edf.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox