* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/imlate/
@ 2022-03-16 19:02 Matt Turner
0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2022-03-16 19:02 UTC (permalink / raw
To: gentoo-commits
commit: fa1b6d8bab551576d0d493176c8dbac2cf81db48
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 16 18:22:58 2022 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 16 18:22:58 2022 +0000
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=fa1b6d8b
imlate: Remove 'experimental' code
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
pym/gentoolkit/imlate/imlate.py | 5 -----
1 file changed, 5 deletions(-)
diff --git a/pym/gentoolkit/imlate/imlate.py b/pym/gentoolkit/imlate/imlate.py
index 87b8ef1..b553849 100755
--- a/pym/gentoolkit/imlate/imlate.py
+++ b/pym/gentoolkit/imlate/imlate.py
@@ -521,10 +521,6 @@ def main():
default=None,
)
- # # EXPERIMENTAL
- # parser.add_option( "-e", "--experimental", dest = "experimental", action = "store_true", default = False,
- # help = "enables experimental functions/features (have a look for # EXPERIMENTAL comments in the source) [default: %default]" )
-
parser.add_option(
"-C",
"--category",
@@ -577,7 +573,6 @@ def main():
conf["STABLE"] = options.stable
conf["KEYWORD"] = options.keyword
- # conf["EXPERIMENTAL"] = options.experimental
conf["CATEGORIES"] = options.categories
conf["MAINTAINER"] = options.maintainer
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/imlate/
@ 2020-01-03 4:31 Matt Turner
0 siblings, 0 replies; 3+ messages in thread
From: Matt Turner @ 2020-01-03 4:31 UTC (permalink / raw
To: gentoo-commits
commit: 059b8857c2114f2ca0cec3ec5408d28ecc38ee62
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 2 17:50:31 2020 +0000
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Jan 2 21:24:54 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=059b8857
imlate: Dynamically calculate column width in report
Also print categories on the line with the package name for much simpler
consumption by external tools.
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
pym/gentoolkit/imlate/imlate.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/pym/gentoolkit/imlate/imlate.py b/pym/gentoolkit/imlate/imlate.py
index 86d1a7e..40e2914 100755
--- a/pym/gentoolkit/imlate/imlate.py
+++ b/pym/gentoolkit/imlate/imlate.py
@@ -67,11 +67,18 @@ def _fill( width, line, fill = " " ):
# create a hopefully pretty result
def show_result( conf, pkgs ):
# X - len(colX) = space to fill
- col1 = 40
- col2 = 20
+ col1 = -1
+ col2 = -1
+ for cat in pkgs:
+ for pkg in pkgs[cat]:
+ col1 = max(col1, len(("%s/%s" % (cat, pkg))))
+ col2 = max(col2, len(pkgs[cat][pkg][1]))
+ col1 += 1
+ col2 += 1
_header = "%s candidates for 'gentoo' on '%s'"
- _helper = "category/package[:SLOT] our version best version"
+ _helper = "%s%s%s" % (_fill(col1, "category/package[:SLOT])"),
+ _fill(col2, "our version"), "best version")
_cand = ""
header = ""
@@ -102,11 +109,10 @@ def show_result( conf, pkgs ):
print(_fill( len( _helper ), "", "-" ), file=out)
for cat in sorted( pkgs.keys() ):
- print("%s/" % cat, file=out)
for pkg in sorted( pkgs[cat].keys() ):
- print("%s%s%s" % ( _fill( col1, ( " %s" % pkg ) ),
- _fill( col2, pkgs[cat][pkg][1] ),
- pkgs[cat][pkg][0] ), file=out)
+ print("%s%s%s" % (_fill(col1, ("%s/%s" % (cat, pkg))),
+ _fill(col2, pkgs[cat][pkg][1]),
+ pkgs[cat][pkg][0] ), file=out)
if conf["FILE"] != "stdout":
out.close()
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/imlate/
@ 2017-03-22 12:51 Brian Dolbec
0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2017-03-22 12:51 UTC (permalink / raw
To: gentoo-commits
commit: 4b4345c108361c5728e2e20a69f47421113fbddc
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 12:31:20 2017 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 12:49:59 2017 +0000
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=4b4345c1
imlate.py: Whitespace cleanup
pym/gentoolkit/imlate/imlate.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/pym/gentoolkit/imlate/imlate.py b/pym/gentoolkit/imlate/imlate.py
index f38949f..86d1a7e 100755
--- a/pym/gentoolkit/imlate/imlate.py
+++ b/pym/gentoolkit/imlate/imlate.py
@@ -189,7 +189,7 @@ def is_herd(herd, metadata):
return True
if hd.startswith(hd2):
return True
-
+
return False
@@ -224,7 +224,7 @@ def get_packages( conf ):
if not slot in slots:
slots[slot] = []
slots[slot].append(cpvr)
-
+
for slot in sorted(slots):
cpvr = portage.versions.best( slots[slot] )
@@ -265,25 +265,25 @@ def get_imlate( conf, pkgs ):
our_ver = ""
mtime = 0
slot = 0
-
+
# 0 = none(default), 1 = testing(~arch), 2 = stable(arch),
# 3 = exclude(-arch), 4 = exclude_all(-*)
# -* would be overridden by ~arch or arch
kwd_type = 0
cpvr = "%s/%s-%s" % ( cat, pkg, vr )
-
+
# absolute ebuild path for mtime check
abs_pkg = join( conf["PORTDIR"], cat, pkg, basename( cpvr ) )
abs_pkg = "%s.ebuild" % str( abs_pkg )
-
+
kwds = conf["portdb"].dbapi.aux_get( cpvr, ["KEYWORDS"] )[0]
-
+
# FIXME: %s is bad.. maybe even cast it, else there are issues because its unicode
slot = ":%s" % conf["portdb"].dbapi.aux_get( cpvr, ["SLOT"] )[0]
if slot == ":0":
slot = ""
-
+
# sorted() to keep the right order
# e.g. -* first, -arch second, arch third and ~arch fourth
# -* -foo ~arch
@@ -300,7 +300,7 @@ def get_imlate( conf, pkgs ):
elif kwd == testing:
kwd_type = 1
break
-
+
# ignore -arch and already stabilized packages
if kwd_type == 3 or kwd_type == 2:
continue
@@ -314,7 +314,7 @@ def get_imlate( conf, pkgs ):
mtime = int( ( time() - stat( abs_pkg ).st_mtime ) / 60 / 60 / 24 )
if mtime < conf["MTIME"]:
continue
-
+
# look for an existing stable version
our = portage.versions.best( conf["portdb"].dbapi.match( "%s/%s%s" % ( cat, pkg, slot ) ) )
if our:
@@ -324,12 +324,12 @@ def get_imlate( conf, pkgs ):
our_ver = "%s-%s" % ( our_ver, _foo[2] )
else:
our_ver = ""
-
+
# we just need the version if > our_ver
if our_ver:
if portage.versions.vercmp( our_ver, vr ) >= 0:
continue
-
+
if kwd_type == 1 and conf["STABLE"]:
imlate = _add_ent( imlate, cat, ("%s%s" % (pkg, slot)), vr, our_ver )
conf["STABLE_SUM"] += 1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-16 19:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16 19:02 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/imlate/ Matt Turner
-- strict thread matches above, loose matches on Subject: below --
2020-01-03 4:31 Matt Turner
2017-03-22 12:51 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox