if USE have digit at end of name, then '#' works as switch example: media-libs/libvpx have use sse4_1 =============== package.use: media-libs/libvpx sse4_1# ====== equery -NCq u "media-libs/libvpx": .... -sse4_1 ======= package.use: media-libs/libvpx sse4_1 # ====== equery -NCq u "media-libs/libvpx" .... +sse4_1 =============== app-portage/gentoolkit-0.3.0.6-r3 Reproducible: Always
Portage requires a space before # in order for it to be treated as a comment. I believe this is how most things that support # comments work. The portage code is visible in this commit: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3ad5122a80f741119b48cb7f0f5107e64e2e3b11
(In reply to comment #1) > Portage requires a space before # in order for it to be treated as a > comment. I believe this is how most things that support # comments work. The > portage code is visible in this commit: > > http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit; > h=3ad5122a80f741119b48cb7f0f5107e64e2e3b11 ok. but this isn't good idea anyway
Portage does not support the comment character immediately after a value without a space. See the example below. One of the primary reasons for it is that the lines are split into individual values at the space breaks. Equery uses portage to get the values to display. So: media-libs/libvpx sse4_1# some-comment is broken up into: ['media-libs/libvpx', 'sse4_1#', 'some-comment'] however if you put a space before '#' then it and anything after the '#' will be trimmed. ['media-libs/libvpx', 'sse4_1', '#', 'some-comment'] yields: ['media-libs/libvpx', 'sse4_1'] actual test example: big_daddy brian # emerge -vp libvpx These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-libs/libvpx-1.1.0 USE="mmx sse sse2 sse3 threads (-altivec) -debug -doc -postproc -sse4_1 -ssse3 -static-libs" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB big_daddy brian # cat /etc/portage/package.use/test | grep libvpx media-libs/libvpx sse4_1# big_daddy brian # scite /etc/portage/package.use/test big_daddy brian # emerge -vp libvpx These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-libs/libvpx-1.1.0 USE="mmx sse sse2 sse3 sse4_1* threads (-altivec) -debug -doc -postproc -ssse3 -static-libs" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB big_daddy brian # cat /etc/portage/package.use/test | grep libvpx media-libs/libvpx sse4_1 # some-comment big_daddy brian #
(In reply to comment #3) > Portage does not support the comment character immediately after a value > without a space. o_O what? example: x11-libs/qt-webkit exceptions icu jit#ololo no digits - no troubles may be just fix it for more flexibility!?
Nope, still doesn't work. eg: big_daddy brian # emerge -vp libvpx These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] media-libs/libvpx-1.1.0 USE="mmx sse sse2 sse3 sse4_1* threads (-altivec) -debug -doc -postproc -ssse3 -static-libs" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB big_daddy brian # cat /etc/portage/package.use/test | grep libvpx media-libs/libvpx sse4_1 -mmx# some-comment big_daddy brian # Here is some of the code Zac gave you the link to. myline=x.split() mylinetemp = [] for item in myline: if not item.startswith('#'): mylinetemp.append(item) else: break myline = mylinetemp NOTE the line ==> if not item.startswith('#'): The keyword there is startswith So in the test I did above, the -mmx flag is read as -mmx# and translates to disable the mmx# flag which does not match a flag in IUSE for the ebuild. Portage then ignores it. The "some-comment" is also read as a flag since it did not find the '#' as the first character of any of the items on the line. media-libs/libvpx sse4_1 -mmx #some-comment <== this will work correctly since '#' is the first character of '#some-comment' So, again, no, it is and will remain invalid.