Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 190201 Details for
Bug 266996
[patch] app-portage/gentoolkit: eclean-pkg should update Packages file
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
eclean_clean_package_metadata.patch
eclean_clean_package_metadata.patch (text/plain), 1.95 KB, created by
michael@smith-li.com
on 2009-05-03 05:37:08 UTC
(
hide
)
Description:
eclean_clean_package_metadata.patch
Filename:
MIME Type:
Creator:
michael@smith-li.com
Created:
2009-05-03 05:37:08 UTC
Size:
1.95 KB
patch
obsolete
>Index: eclean >=================================================================== >--- eclean (revision 576) >+++ eclean (working copy) >@@ -1,9 +1,8 @@ >-#!/usr/bin/env python >+#!/usr/bin/python > # Copyright 2003-2005 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 > # $Header: $ > >- > ############################################################################### > # Meta: > __author__ = "Thomas de Grenier de Latour (tgl)" >@@ -22,6 +21,7 @@ > import getopt > import fpformat > import signal >+from __future__ import with_statement > try: > import portage > except ImportError: >@@ -678,7 +678,12 @@ > "Do you want to delete this " \ > + file_type+"?"): > # non-interactive mode or positive answer. >- # For each file,... >+ # For each file, try to delete the file and clean it out >+ # of Packages metadata file >+ if action == 'packages': >+ metadata = portage.getbinpkg.PackageIndex() >+ with open(os.path.join(pkgdir, 'Packages')) as metadata_file: >+ metadata.read(metadata_file) > for file in clean_dict[mykey]: > # ...get its size... > filesize = 0 >@@ -688,11 +693,21 @@ > except: eerror("Could not read size of "\ > +file, myoptions['nocolor']) > # ...and try to delete it. >- try: os.unlink(file) >- except: eerror("Could not delete "+file, \ >- myoptions['nocolor']) >+ try: >+ os.unlink(file) >+ except: >+ eerror("Could not delete "+file, \ >+ myoptions['nocolor']) > # only count size if successfully deleted >- else: clean_size += filesize >+ else: >+ clean_size += filesize >+ if action == 'packages': >+ metadata.packages[:] = [p for p in metadata.packages if 'CPV' in p and p['CPV'] != file] >+ >+ if action == 'packages': >+ with open(os.path.join(pkgdir, 'Packages'), 'w') as metadata_file: >+ metadata.write(metadata_file) >+ > # return total size of deleted or to delete files > return clean_size >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 266996
: 190201