Lines 562-585
def findPackages(
Link Here
|
562 |
if stat.S_ISLNK(st[stat.ST_MODE]): |
562 |
if stat.S_ISLNK(st[stat.ST_MODE]): |
563 |
clean_me[cpv].append(os.path.realpath(path)) |
563 |
clean_me[cpv].append(os.path.realpath(path)) |
564 |
# keep only obsolete ones |
564 |
# keep only obsolete ones |
565 |
if destructive: |
565 |
if destructive and package_names: |
566 |
dbapi = var_dbapi |
566 |
cp_all = dict.fromkeys(var_dbapi.cp_all()) |
567 |
if package_names: |
|
|
568 |
cp_all = dict.fromkeys(dbapi.cp_all()) |
569 |
else: |
570 |
cp_all = {} |
571 |
else: |
567 |
else: |
572 |
dbapi = port_dbapi |
|
|
573 |
cp_all = {} |
568 |
cp_all = {} |
574 |
for cpv in list(clean_me): |
569 |
for cpv in list(clean_me): |
575 |
if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)): |
570 |
if exclDictMatchCP(exclude,portage.cpv_getkey(cpv)): |
576 |
# exclusion because of the exclude file |
571 |
# exclusion because of the exclude file |
577 |
del clean_me[cpv] |
572 |
del clean_me[cpv] |
578 |
continue |
573 |
continue |
579 |
if dbapi.cpv_exists(cpv): |
574 |
if not destructive and port_dbapi.cpv_exists(cpv): |
580 |
# exclusion because pkg still exists (in porttree or vartree) |
575 |
# exclusion because pkg still exists (in porttree) |
581 |
del clean_me[cpv] |
576 |
del clean_me[cpv] |
582 |
continue |
577 |
continue |
|
|
578 |
if destructive and var_dbapi.cpv_exists(cpv): |
579 |
buildtime = var_dbapi.aux_get(cpv, ['BUILD_TIME'])[0].encode('utf-8').strip() |
580 |
clean_me[cpv] = [path for path in clean_me[cpv] |
581 |
# only keep path if BUILD_TIME is identical with vartree |
582 |
if portage.xpak.tbz2(path).getfile('BUILD_TIME').strip() != buildtime] |
583 |
if not clean_me[cpv]: |
584 |
# nothing we can clean for this package |
585 |
del clean_me[cpv] |
586 |
continue |
583 |
if portage.cpv_getkey(cpv) in cp_all and port_dbapi.cpv_exists(cpv): |
587 |
if portage.cpv_getkey(cpv) in cp_all and port_dbapi.cpv_exists(cpv): |
584 |
# exlusion because of --package-names |
588 |
# exlusion because of --package-names |
585 |
del clean_me[cpv] |
589 |
del clean_me[cpv] |
586 |
- |
|
|