Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 641044 - app-portage/portpeek: Add option to remove comments above removed entries
Summary: app-portage/portpeek: Add option to remove comments above removed entries
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Mike Pagano
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-14 19:46 UTC by Till Schäfer
Modified: 2020-05-21 14:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Schäfer 2017-12-14 19:46:17 UTC
I miss an option to remove comments above the removed entries. An autounmask addition to package.* looks like this: 

# required by dev-java/icedtea-web-1.5.1-r1[icedtea7]
# required by dev-java/icedtea-6.1.13.5-r1[webstart]
# required by @selected
# required by @world (argument)
=dev-java/icedtea-sound-1.0.1 ~amd64

Now, if i use portpeek to clean this entry, the comments stay in the package file and I still need to clean the comments manually from time to time. 

I suggest to add an option, that removes all continuous comment lines above the removed entry. I.e., to avoid removing unrelated comments an empty line (and of course any non-comment line) should end the comment, that is related to the entry. 

Currently, I still use my own cleaning solution for this reason: 

https://wiki.gentoo.org/wiki/User:Tillschaefer/cleanup_package
-> there is also a more detailed example given.
Comment 1 Mike Pagano gentoo-dev 2017-12-15 12:42:22 UTC
Interesting.  Let me think on this.
Comment 2 Mike Pagano gentoo-dev 2020-05-20 18:58:01 UTC
I can't think of a good way to do this that would not be hokey.
Unless the comments had a tag, something like

# dev-java/icedtea-sound: required by dev-java/icedtea-web-1.5.1-r1[icedtea7]
# dev-java/icedtea-sound: required by dev-java/icedtea-6.1.13.5-r1[webstart]
# dev-java/icedtea-sound: required by @selected
# dev-java/icedtea-sound: required by @world (argument)
=dev-java/icedtea-sound-1.0.1 ~amd64

Otherwise the code would be guessing 

If you have a patch I would be interested in talking further
Comment 3 Till Schäfer 2020-05-20 20:01:35 UTC
All comment lines directly above the package that start with 

# required by 

should be directly linked to the package. Otherwise, these lines are faulty itself and may belong to a removed package in between. I --as an end user-- have not other option relate the "required by" lines to the package.

The current solution may even cause false interpretations. Example: 

# required by dev-java/icedtea-web-1.5.1-r1[icedtea7]
# required by dev-java/icedtea-6.1.13.5-r1[webstart]
# required by @selected
# required by @world (argument)
=dev-java/icedtea-sound-1.0.1 ~amd64
=dev-java/asm-5.1

After removing icedtea-sound one may think, that asm was actually required by icedtea-web. 

Therefore, I argue that NOT removing these types of comments actually causes inconsistent required-by semantics. I cannot see a practical example, where this would actually go wrong.

(A second "#required by @world" would be an indicator of a removed package, but in this case I cannot relate the lines above that second world to any package anymore. Thus, they are also useless garbage an should be removed.)


(feel free to close it again if you think otherwise :))