* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2011-03-08 8:05 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2011-03-08 8:05 UTC (permalink / raw
To: gentoo-commits
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2011-07-12 14:05 Paul Varner
0 siblings, 0 replies; 10+ messages in thread
From: Paul Varner @ 2011-07-12 14:05 UTC (permalink / raw
To: gentoo-commits
commit: 00104a648d2c713123d928ee08453d4de2192300
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 14:03:52 2011 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 14:03:52 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=00104a64
Change "Deprecated" to "unavailable" to reflect term used in portage.
Unavailable packages are packages that are installed, but do not have a
corresponding ebuild available for installation.
---
pym/gentoolkit/eclean/cli.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index 9e4bfd9..8d47cfb 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -421,14 +421,14 @@ def doAction(action,options,exclude={}, output=None):
output.einfo("Your "+action+" directory was already clean.")
if saved and not options['quiet']:
print()
- print( (pp.emph(" The following ") + yellow("Deprecated") +
+ print( (pp.emph(" The following ") + yellow("unavailable") +
pp.emph(" files were saved from cleaning due to exclusion file entries")))
output.set_colors('deprecated')
clean_size = cleaner.pretend_clean(saved)
output.total('deprecated', clean_size, len(saved), verb, action)
if deprecated and not options['quiet']:
print()
- print( (pp.emph(" The following ") + yellow("Deprecated") +
+ print( (pp.emph(" The following ") + yellow("unavailable") +
pp.emph(" installed packages were found")))
output.set_colors('deprecated')
output.list_pkgs(deprecated)
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2011-07-13 5:53 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2011-07-13 5:53 UTC (permalink / raw
To: gentoo-commits
commit: 752c3db97d11ab07b5a0ed9c5cd892cc5e610854
Author: dol-sen <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Wed Jul 13 05:34:01 2011 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Jul 13 05:34:01 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=752c3db9
fix a possibility of a None type error in exclDictMatchCP
---
pym/gentoolkit/eclean/exclude.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/exclude.py b/pym/gentoolkit/eclean/exclude.py
index 5f48cab..961bb14 100644
--- a/pym/gentoolkit/eclean/exclude.py
+++ b/pym/gentoolkit/eclean/exclude.py
@@ -199,13 +199,20 @@ def exclDictExpand(exclude):
def exclDictMatchCP(exclude,pkg):
"""Checks whether a CP matches the exclusion rules."""
+ if pkg is None:
+ return False
if 'anti-packages' in exclude and pkg in exclude['anti-packages']:
return False
if 'packages' in exclude and pkg in exclude['packages']:
return True
- cat = pkg.split('/')[0]
+ try:
+ cat = pkg.split('/')[0]
+ except:
+ dprint( "exclude", "exclDictMatchCP: Invalid package name: " +\
+ "%s, Could not determine category" %pkg)
+ cat = ''
if 'categories' in exclude and cat in exclude['categories']:
- return True
+ return True
return False
def exclDictExpandPkgname(exclude):
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2012-01-22 17:50 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2012-01-22 17:50 UTC (permalink / raw
To: gentoo-commits
commit: 0f152f27af3b758b904d257931c17da490468b8e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 22 17:48:36 2012 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jan 22 17:48:36 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=0f152f27
fix bug 398103 to properly delete broken symlinks and not abort.
---
pym/gentoolkit/eclean/clean.py | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/pym/gentoolkit/eclean/clean.py b/pym/gentoolkit/eclean/clean.py
index b2cc562..fd59976 100644
--- a/pym/gentoolkit/eclean/clean.py
+++ b/pym/gentoolkit/eclean/clean.py
@@ -125,10 +125,22 @@ class CleanUp(object):
try:
statinfo = os.stat(file_)
except EnvironmentError as er:
- print( pp.error(
- "Could not get stat info for:" + file_), file=sys.stderr)
- print( pp.error(
- "Error: %s" %str(er)), file=sys.stderr)
+ if not os.path.exists(os.readlink(file_)):
+ try:
+ os.remove(file_)
+ print( pp.error(
+ "Removed broken symbolic link " + file_), file=sys.stderr)
+ break
+ except EnvironmentError as er:
+ print( pp.error(
+ "Error deleting broken symbolic link " + file_), file=sys.stderr)
+ print( pp.error("Error: %s" %str(er)), file=sys.stderr)
+ break
+ else:
+ print( pp.error(
+ "Could not get stat info for:" + file_), file=sys.stderr)
+ print( pp.error(
+ "Error: %s" %str(er)), file=sys.stderr)
if self.controller(statinfo.st_size, key, file_, file_type):
# ... try to delete it.
try:
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2012-10-31 18:47 Mike Frysinger
0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2012-10-31 18:47 UTC (permalink / raw
To: gentoo-commits
commit: a43a42dceec55338b072344f0b18a1abfcd370d6
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 31 18:46:39 2012 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Oct 31 18:46:39 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=a43a42dc
eclean: sort pkg list shown to user
This makes it much easier to scan through and pick out packages.
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
pym/gentoolkit/eclean/output.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/gentoolkit/eclean/output.py b/pym/gentoolkit/eclean/output.py
index c8c3f78..e7ce59b 100644
--- a/pym/gentoolkit/eclean/output.py
+++ b/pym/gentoolkit/eclean/output.py
@@ -178,7 +178,9 @@ class OutputControl(object):
@param pkgs: dict. of {cat/pkg-ver: src_uri,}
"""
indent = ' ' * 12
- for key in pkgs:
+ keys = pkgs.keys()
+ keys.sort()
+ for key in keys:
if pkgs[key]:
saved = ""
else:
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2012-10-31 19:16 Paul Varner
0 siblings, 0 replies; 10+ messages in thread
From: Paul Varner @ 2012-10-31 19:16 UTC (permalink / raw
To: gentoo-commits
commit: b2a45b246323b7482d679a719b7a3f3222764f9a
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 31 19:16:00 2012 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Wed Oct 31 19:16:00 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=b2a45b24
eclean: Fix pkg sorting to work with Python3
---
pym/gentoolkit/eclean/output.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/gentoolkit/eclean/output.py b/pym/gentoolkit/eclean/output.py
index e7ce59b..ab53ab4 100644
--- a/pym/gentoolkit/eclean/output.py
+++ b/pym/gentoolkit/eclean/output.py
@@ -178,7 +178,7 @@ class OutputControl(object):
@param pkgs: dict. of {cat/pkg-ver: src_uri,}
"""
indent = ' ' * 12
- keys = pkgs.keys()
+ keys = list(pkgs.keys())
keys.sort()
for key in keys:
if pkgs[key]:
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2012-12-23 7:34 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2012-12-23 7:34 UTC (permalink / raw
To: gentoo-commits
commit: a582ad8a270af9861d5c1e0bb269012d2bd5b3f5
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 23 07:34:02 2012 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Dec 23 07:34:02 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=a582ad8a
fix bug 445904 make.conf path
---
pym/gentoolkit/eclean/search.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py
index 4992ad7..5fcb6bc 100644
--- a/pym/gentoolkit/eclean/search.py
+++ b/pym/gentoolkit/eclean/search.py
@@ -45,7 +45,7 @@ def get_distdir():
if not os.path.isdir(d):
e = pp.error("%s does not appear to be a directory.\n" % d)
e += pp.error("Please set DISTDIR to a sane value.\n")
- e += pp.error("(Check your /etc/make.conf and environment).")
+ e += pp.error("(Check your make.conf file and environment).")
print( e, file=sys.stderr)
exit(1)
return d
@@ -533,7 +533,7 @@ def findPackages(
del test
except EnvironmentError as er:
print( pp.error("Error accessing PKGDIR." ), file=sys.stderr)
- print( pp.error("(Check your /etc/make.conf and environment)."), file=sys.stderr)
+ print( pp.error("(Check your make.conf file and environment)."), file=sys.stderr)
print( pp.error("Error: %s" %str(er)), file=sys.stderr)
exit(1)
for root, dirs, files in os.walk(pkgdir):
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2013-08-11 17:21 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2013-08-11 17:21 UTC (permalink / raw
To: gentoo-commits
commit: 000580dda57439ab0bb1dab42b91edac835a6e96
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 11 15:13:38 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Aug 11 15:59:25 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=000580dd
prevent a possible unknown object "cleaner"
---
pym/gentoolkit/eclean/cli.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index e6c75d0..16f4adc 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -394,6 +394,10 @@ def doAction(action,options,exclude={}, output=None):
size_limit=options['size-limit'],
deprecate = options['deprecated']
)
+
+ # initialize our cleaner
+ cleaner = CleanUp( output.progress_controller)
+
# actually clean files if something was found
if clean_me:
# verbose pretend message
@@ -403,7 +407,6 @@ def doAction(action,options,exclude={}, output=None):
elif not options['quiet']:
output.einfo("Cleaning " + files_type +"...")
# do the cleanup, and get size of deleted files
- cleaner = CleanUp( output.progress_controller)
if options['pretend']:
clean_size = cleaner.pretend_clean(clean_me)
elif action in ['distfiles']:
@@ -419,7 +422,7 @@ def doAction(action,options,exclude={}, output=None):
# display freed space
if not options['quiet']:
output.total('normal', clean_size, len(clean_me), verb, action)
- # nothing was found, return
+ # nothing was found
elif not options['quiet']:
output.einfo("Your "+action+" directory was already clean.")
if saved and not options['quiet']:
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2013-08-11 17:21 Brian Dolbec
0 siblings, 0 replies; 10+ messages in thread
From: Brian Dolbec @ 2013-08-11 17:21 UTC (permalink / raw
To: gentoo-commits
commit: 6efec6f4867ea61e95253bdcf00adccec2fc40b9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 11 17:19:50 2013 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Aug 11 17:19:50 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=6efec6f4
eclean: simplify the sorting
---
pym/gentoolkit/eclean/output.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pym/gentoolkit/eclean/output.py b/pym/gentoolkit/eclean/output.py
index ab53ab4..d40f3bc 100644
--- a/pym/gentoolkit/eclean/output.py
+++ b/pym/gentoolkit/eclean/output.py
@@ -178,8 +178,7 @@ class OutputControl(object):
@param pkgs: dict. of {cat/pkg-ver: src_uri,}
"""
indent = ' ' * 12
- keys = list(pkgs.keys())
- keys.sort()
+ keys = sorted(pkgs)
for key in keys:
if pkgs[key]:
saved = ""
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/
@ 2013-09-04 20:59 Paul Varner
0 siblings, 0 replies; 10+ messages in thread
From: Paul Varner @ 2013-09-04 20:59 UTC (permalink / raw
To: gentoo-commits
commit: 78d245ba02619be775c20c3c8926ce1cc3d35ea6
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 4 20:55:34 2013 +0000
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Wed Sep 4 20:55:34 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=78d245ba
Change argv[0] name check to use startswith() for compatibilty with python-exec.
python-exec uses versioned scripts in the form of "script-python2.7".
This changes the check for eclean-pkg and eclean-dist to see if argv[0]
starts with those strings, instead of matching exactly.
---
pym/gentoolkit/eclean/cli.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pym/gentoolkit/eclean/cli.py b/pym/gentoolkit/eclean/cli.py
index 16f4adc..95d4c06 100644
--- a/pym/gentoolkit/eclean/cli.py
+++ b/pym/gentoolkit/eclean/cli.py
@@ -304,12 +304,12 @@ def parseArgs(options={}):
action = None
# temp print line to ensure it is the svn/branch code running, etc..
#print( "###### svn/branch/gentoolkit_eclean ####### ==> ", os.path.basename(sys.argv[0]))
- if os.path.basename(sys.argv[0]) in \
- (__productname__+'-pkg', __productname__+'-packages'):
- action = 'packages'
- elif os.path.basename(sys.argv[0]) in \
- (__productname__+'-dist', __productname__+'-distfiles'):
- action = 'distfiles'
+ if os.path.basename(sys.argv[0]).startswith(__productname__+'-pkg') or \
+ os.path.basename(sys.argv[0]).startswith(__productname__+'-packages'):
+ action = 'packages'
+ elif os.path.basename(sys.argv[0]).startswith(__productname__+'-dist') or \
+ os.path.basename(sys.argv[0]).startswith(__productname__+'distfiles'):
+ action = 'distfiles'
# prepare for the first getopt
if action:
short_opts = getopt_options['short']['global'] \
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-09-04 20:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13 5:53 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/eclean/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2013-09-04 20:59 Paul Varner
2013-08-11 17:21 Brian Dolbec
2013-08-11 17:21 Brian Dolbec
2012-12-23 7:34 Brian Dolbec
2012-10-31 19:16 Paul Varner
2012-10-31 18:47 Mike Frysinger
2012-01-22 17:50 Brian Dolbec
2011-07-12 14:05 Paul Varner
2011-03-08 8:05 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox