From: "Arfrever Frehtes Taifersar Arahesis" <arfrever@apache.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/_emirrordist/
Date: Sun, 2 Feb 2014 03:15:05 +0000 (UTC) [thread overview]
Message-ID: <1391310806.d2c0a27401ad6d2ccdb6e5af293c830c7abf0ad0.arfrever@gentoo> (raw)
commit: d2c0a27401ad6d2ccdb6e5af293c830c7abf0ad0
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Feb 2 03:13:26 2014 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Feb 2 03:13:26 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2c0a274
Bug #500030: emirrordist: Support directory in --whitelist-from argument.
---
pym/portage/_emirrordist/main.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/pym/portage/_emirrordist/main.py b/pym/portage/_emirrordist/main.py
index f28aad7..139f24f 100644
--- a/pym/portage/_emirrordist/main.py
+++ b/pym/portage/_emirrordist/main.py
@@ -1,4 +1,4 @@
-# Copyright 2013 Gentoo Foundation
+# Copyright 2013-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import logging
@@ -6,7 +6,7 @@ import sys
import portage
from portage import os
-from portage.util import normalize_path, writemsg_level
+from portage.util import normalize_path, writemsg_level, _recursive_file_list
from portage.util._argparse import ArgumentParser
from portage.util._async.run_main_scheduler import run_main_scheduler
from portage.util._async.SchedulerInterface import SchedulerInterface
@@ -414,10 +414,17 @@ def emirrordist_main(args):
normalized_paths = []
for x in options.whitelist_from:
path = normalize_path(os.path.abspath(x))
- normalized_paths.append(path)
- if not (os.access(path, os.R_OK) and os.path.isfile(path)):
- parser.error(
- "--whitelist-from '%s' is not a readable file" % x)
+ if not os.access(path, os.R_OK):
+ parser.error("--whitelist-from '%s' is not readable" % x)
+ if os.path.isfile(path):
+ normalized_paths.append(path)
+ elif os.path.isdir(path):
+ for file in _recursive_file_list(path):
+ if not os.access(file, os.R_OK):
+ parser.error("--whitelist-from '%s' directory contains not readable file '%s'" % (x, file))
+ normalized_paths.append(file)
+ else:
+ parser.error("--whitelist-from '%s' is not a regular file or a directory" % x)
options.whitelist_from = normalized_paths
if options.strict_manifests is not None:
next reply other threads:[~2014-02-02 3:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-02 3:15 Arfrever Frehtes Taifersar Arahesis [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-04-28 23:08 [gentoo-commits] proj/portage:master commit in: pym/portage/_emirrordist/ Zac Medico
2018-04-28 21:57 Zac Medico
2018-04-28 14:01 Zac Medico
2018-04-26 8:46 Zac Medico
2018-04-25 7:30 Zac Medico
2017-03-24 20:33 Zac Medico
2017-03-24 20:33 Zac Medico
2016-01-07 16:50 Zac Medico
2013-08-12 23:09 Zac Medico
2013-08-02 23:27 Zac Medico
2013-06-20 1:23 Zac Medico
2013-01-10 10:35 Zac Medico
2013-01-10 9:40 Zac Medico
2013-01-10 9:18 Zac Medico
2013-01-10 9:05 Zac Medico
2013-01-10 8:41 Zac Medico
2013-01-10 7:54 Zac Medico
2013-01-10 3:57 Zac Medico
2013-01-09 22:23 Zac Medico
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=1391310806.d2c0a27401ad6d2ccdb6e5af293c830c7abf0ad0.arfrever@gentoo \
--to=arfrever@apache.org \
--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