Lines 19-25
Link Here
|
19 |
import time |
19 |
import time |
20 |
import string |
20 |
import string |
21 |
import types |
21 |
import types |
22 |
|
22 |
from time import localtime, strftime |
23 |
# portage (output module) and gentoolkit need special path modifications |
23 |
# portage (output module) and gentoolkit need special path modifications |
24 |
sys.path.insert(0, "/usr/lib/portage/pym") |
24 |
sys.path.insert(0, "/usr/lib/portage/pym") |
25 |
sys.path.insert(0, "/usr/lib/gentoolkit/pym") |
25 |
sys.path.insert(0, "/usr/lib/gentoolkit/pym") |
Lines 933-939
Link Here
|
933 |
(query, opts) = self.parseArgs(args) |
933 |
(query, opts) = self.parseArgs(args) |
934 |
|
934 |
|
935 |
matches = gentoolkit.find_packages(query, opts["includeMasked"]) |
935 |
matches = gentoolkit.find_packages(query, opts["includeMasked"]) |
936 |
matches = gentoolkit.sort_package_list(matches) |
936 |
if Config[time_sort]: |
|
|
937 |
matches = gentoolkit.sort_package_list_by_time(matches) |
938 |
else: |
939 |
matches = gentoolkit.sort_package_list(matches) |
937 |
|
940 |
|
938 |
if matches: |
941 |
if matches: |
939 |
print_info(0, os.path.normpath(matches[-1].get_ebuild_path())) |
942 |
print_info(0, os.path.normpath(matches[-1].get_ebuild_path())) |
Lines 1249-1257
Link Here
|
1249 |
newmatches += dups[mykey] |
1252 |
newmatches += dups[mykey] |
1250 |
|
1253 |
|
1251 |
matches = newmatches |
1254 |
matches = newmatches |
1252 |
|
1255 |
if Config.has_key("time_sort") and Config["time_sort"]: |
1253 |
matches = gentoolkit.sort_package_list(matches) |
1256 |
matches = gentoolkit.sort_package_list_by_time(matches) |
1254 |
|
1257 |
else: |
|
|
1258 |
matches = gentoolkit.sort_package_list(matches) |
1255 |
# If no version supplied, fix regular expression |
1259 |
# If no version supplied, fix regular expression |
1256 |
if ver == ".*": ver = "[0-9]+[^-]*" |
1260 |
if ver == ".*": ver = "[0-9]+[^-]*" |
1257 |
|
1261 |
|
Lines 1302-1308
Link Here
|
1302 |
if Config["piping"]: |
1306 |
if Config["piping"]: |
1303 |
print_info(0, pkg.get_cpv()) |
1307 |
print_info(0, pkg.get_cpv()) |
1304 |
else: |
1308 |
else: |
1305 |
print_info(0, "[" + pp.installedflag(pfxmodes[status]) + "] [" + pp.maskflag(maskmodes[pkgmask]) + "] " + pp.cpv(pkg.get_cpv()) + " (" + pp.slot(slot) + ")") |
1309 |
print_info(0, "[" + pp.installedflag(pfxmodes[status]) + "] [" + pp.maskflag(maskmodes[pkgmask]) + "] [ "+strftime("%c",localtime(os.stat("/var/db/pkg/"+ pkg.get_cpv() + "/" + pkg.get_cpv().split('/',1)[1] + ".ebuild").st_mtime)) + " ]" + pp.cpv(pkg.get_cpv()) + " (" + pp.slot(slot) + ")") |
1306 |
|
1310 |
|
1307 |
def _print_overlay(self, matches, rx): |
1311 |
def _print_overlay(self, matches, rx): |
1308 |
self._generic_print( |
1312 |
self._generic_print( |
Lines 1561-1566
Link Here
|
1561 |
print_info(0, pp.globaloption(" -h, --help") + " - this help screen") |
1565 |
print_info(0, pp.globaloption(" -h, --help") + " - this help screen") |
1562 |
print_info(0, pp.globaloption(" -V, --version") + " - display version info") |
1566 |
print_info(0, pp.globaloption(" -V, --version") + " - display version info") |
1563 |
print_info(0, pp.globaloption(" -N, --no-pipe") + " - turn off pipe detection") |
1567 |
print_info(0, pp.globaloption(" -N, --no-pipe") + " - turn off pipe detection") |
|
|
1568 |
print_info(0, pp.globaloption(" -t, --time-sort") + " - sort by time") |
1564 |
|
1569 |
|
1565 |
print_info(0, "where " + pp.command("command") + "(" + pp.command("short") + ") is one of") |
1570 |
print_info(0, "where " + pp.command("command") + "(" + pp.command("short") + ") is one of") |
1566 |
keys = Known_commands.keys() |
1571 |
keys = Known_commands.keys() |
Lines 1618-1623
Link Here
|
1618 |
Config["piping"] = False |
1623 |
Config["piping"] = False |
1619 |
elif x in ["-q","--quiet"]: |
1624 |
elif x in ["-q","--quiet"]: |
1620 |
Config["verbosityLevel"] = 0 |
1625 |
Config["verbosityLevel"] = 0 |
|
|
1626 |
elif x in ["-t","--time-sort"]: |
1627 |
Config["time_sort"] = 1 |
1621 |
elif expand(x) in Known_commands.keys(): |
1628 |
elif expand(x) in Known_commands.keys(): |
1622 |
command = Known_commands[expand(x)] |
1629 |
command = Known_commands[expand(x)] |
1623 |
local_opts = args[i+1:] |
1630 |
local_opts = args[i+1:] |