Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321475 - app-portage/gentoolkit-dev: ekeyword shouldn't touch KEYWORDS lines prefixed with ${PV} = *9999*
Summary: app-portage/gentoolkit-dev: ekeyword shouldn't touch KEYWORDS lines prefixed ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 326651
  Show dependency tree
 
Reported: 2010-05-25 18:46 UTC by Samuli Suominen (RETIRED)
Modified: 2014-07-31 12:20 UTC (History)
3 users (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 Samuli Suominen (RETIRED) gentoo-dev 2010-05-25 18:46:22 UTC
I'm not sure what exactly happened here, so adding x86@ to verify since they made the commit.

if [[ ${PV} == *9999* ]] ; then
KEYWORDS="x86"

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-p2p/ktorrent/ktorrent-3.3.4.ebuild?r1=1.3&r2=1.4
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-05-25 23:56:11 UTC
if [[ ${PV} == *9999* ]] ; then
-	KEYWORDS="x86"
+	KEYWORDS="amd64 x86"

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-p2p/ktorrent/ktorrent-3.3.4.ebuild?r1=1.4&r2=1.5
Comment 2 Pacho Ramos gentoo-dev 2010-05-26 08:35:39 UTC
I have dropped keywords from *9999* again.

Seems that ekeyword changes keywords in both places (I can reproduce it always)

Thanks Samuli for CCing us
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-05-27 13:05:12 UTC
Confirmed, I was also using ekeyword. :(

Good catch.
Comment 4 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-06-13 14:18:35 UTC
An alternative solution would be to disallow more than one occurrence of KEYWORDS in an ebuild (via a mandatory repoman check for example).
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2010-06-13 14:40:07 UTC
(In reply to comment #4)
> An alternative solution would be to disallow more than one occurrence of
> KEYWORDS in an ebuild (via a mandatory repoman check for example).
> 

It's perfectly legal to have second set of KEYWORDS behind if -statement and ${PV} because it doesn't break metadata cache. 

That would also make maintaining -9999 (scm ebuilds) more cumbersome[1]

[1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-video/ffmpeg/ffmpeg-9999-r1.ebuild?r1=1.36&r2=1.37

"Make KEYWORDS depend on PV to make it easier to bump."

The only option here is to either fix ekeyword or delete it entirely.
Comment 6 Christian Ruppert (idl0r) gentoo-dev 2010-06-19 11:05:01 UTC
So in my opinion we have two options:
1) check for four nines (9999) in the version string (filename) and don't touch KEYWORD variables at all in case it matches. But that means that live ebuilds without any 9999 would be touched anyway.
2) Skip the empty KEYWORDS variable in case of more than two KEYWORD variables has been detected (Thanks to Sebastian Pipping for pointing that out)
Comment 7 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2010-06-19 11:14:59 UTC
(In reply to comment #6)
> So in my opinion we have two options:
> 1) check for four nines (9999) in the version string (filename) and don't touch
> KEYWORD variables at all in case it matches. But that means that live ebuilds
> without any 9999 would be touched anyway.

Please note that in this case the file did not match -9999 pattern. Each ebuild had the conditional logic for this -9999 version.

> 2) Skip the empty KEYWORDS variable in case of more than two KEYWORD variables
> has been detected (Thanks to Sebastian Pipping for pointing that out)

Please also consider:

3) Refuse to do anything if there is more than one KEYWORDS line in the ebuild. (I'd prefer this)

4) Refuse to touch KEYWORDS line that is indented (which suggest a conditional statement).

Also, it would be nice to print all changes to the file. It seems ekeyword only prints one. Could it save the original version of the file, and print the out of "diff -u original changed"? We're unlikely to prevent all possible gotchas, but printing the diff will make us detect the mistake quickly.

By the way, since this bug got reported, I always run cvs diff after running ekeyword. Implementing the change above would save me a bunch of keystrokes and cvs server roundtrips. :)
Comment 8 Christian Faulhammer (RETIRED) gentoo-dev 2010-06-19 19:58:01 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > So in my opinion we have two options:
> > 1) check for four nines (9999) in the version string (filename) and don't touch
> > KEYWORD variables at all in case it matches. But that means that live ebuilds
> > without any 9999 would be touched anyway.
> 
> Please note that in this case the file did not match -9999 pattern. Each ebuild
> had the conditional logic for this -9999 version.
> 
> > 2) Skip the empty KEYWORDS variable in case of more than two KEYWORD variables
> > has been detected (Thanks to Sebastian Pipping for pointing that out)

 And don't go from <none> to <stable> directly.
 
> Please also consider:
> 
> 3) Refuse to do anything if there is more than one KEYWORDS line in the ebuild.
> (I'd prefer this)

 Maybe make behaviour controlled by a switch for automated scripts.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2010-06-21 17:36:01 UTC
fauli, you just committed the change to uzbl:

$ grep KEY uzbl-2010.04.03.ebuild 
	KEYWORDS="x86"
	KEYWORDS="~amd64 x86"

please, everyone stop using ekeyword until this is solved :-(
Comment 10 Christian Faulhammer (RETIRED) gentoo-dev 2010-06-21 17:40:35 UTC
(In reply to comment #9)
> fauli, you just committed the change to uzbl:
> 
> $ grep KEY uzbl-2010.04.03.ebuild 
>         KEYWORDS="x86"
>         KEYWORDS="~amd64 x86"
> 
> please, everyone stop using ekeyword until this is solved :-(

 I rely on scripts for proper operation, so I will check more thoroughly the output, but going without ekeyword is not an option.
Comment 11 Christian Ruppert (idl0r) gentoo-dev 2010-07-04 09:19:50 UTC
Please test gentoolkit-dev-9999.
Comment 12 Christian Faulhammer (RETIRED) gentoo-dev 2010-07-09 13:44:44 UTC
(In reply to comment #11)
> Please test gentoolkit-dev-9999.

  Works as expected.  Thanks a lot.
Comment 13 Christian Ruppert (idl0r) gentoo-dev 2010-07-19 20:14:27 UTC
This has been fixed in gentoolkit-dev-0.2.7.
Comment 14 William Hubbs gentoo-dev 2014-07-31 12:20:49 UTC
According to pms, keywords is optional, so it is completely legit to leave keywords out f the live portion of an ebuild like this:

if [[ ${PV} = "9999" ]]; then
    ...
else
    # for releases
    KEYWORDS="~amd64"
fi

Hopefully the fix in this bug accommodates that.