From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
Date: Tue, 8 Mar 2011 08:05:54 +0000 (UTC) [thread overview]
Message-ID: <37f12041c349d6cff5d5d5f4ca5934edc47b06f2.dol-sen@gentoo> (raw)
commit: 37f12041c349d6cff5d5d5f4ca5934edc47b06f2
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Tue Mar 8 08:05:36 2011 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Mar 8 08:05:36 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=37f12041
add a dotfile check and only delete hidden (.dotfile's) during a destructive search.
---
pym/gentoolkit/eclean/search.py | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index e29bbfc..4992ad7 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -124,7 +124,7 @@ class DistfilesSearch(object):
self.output("...checking limits for %d ebuild sources"
%len(pkgs))
- checks = self._get_default_checks(size_limit, time_limit, exclude)
+ checks = self._get_default_checks(size_limit, time_limit, exclude, destructive)
checks.extend(extra_checks)
clean_me = self._check_limits(_distdir, checks, clean_me)
# remove any protected files from the list
@@ -140,7 +140,7 @@ class DistfilesSearch(object):
####################### begin _check_limits code block
- def _get_default_checks(self, size_limit, time_limit, excludes):
+ def _get_default_checks(self, size_limit, time_limit, excludes, destructive):
#checks =[(self._isreg_check_, "is_reg_check")]
checks =[self._isreg_check_]
if 'filenames' in excludes:
@@ -159,6 +159,10 @@ class DistfilesSearch(object):
checks.append(partial(self._time_check_, time_limit))
else:
self.output(" - skipping time limit check")
+ if destructive:
+ self.output(" - skipping dot files check")
+ else:
+ checks.append(self._dotfile_check_)
return checks
@@ -234,6 +238,14 @@ class DistfilesSearch(object):
return True, False
return False, True
+ @staticmethod
+ def _dotfile_check_(file_stat, file):
+ """check if file is a regular file."""
+ head, tail = os.path.split(file)
+ if tail:
+ is_dot_file = tail.startswith('.')
+ return is_dot_file, not is_dot_file
+
####################### end _check_limits code block
@staticmethod
next reply other threads:[~2011-03-08 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-08 8:05 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-07-12 14:05 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/ Paul Varner
2011-07-13 5:53 Brian Dolbec
2012-01-22 17:50 Brian Dolbec
2012-10-31 18:47 Mike Frysinger
2012-10-31 19:16 Paul Varner
2012-12-23 7:34 Brian Dolbec
2013-08-11 17:21 Brian Dolbec
2013-08-11 17:21 Brian Dolbec
2013-09-04 20:59 Paul Varner
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=37f12041c349d6cff5d5d5f4ca5934edc47b06f2.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