Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285101 - ecleankw doesn't understand tabs
Summary: ecleankw doesn't understand tabs
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-15 15:46 UTC by Jeremy Olexa (darkside) (RETIRED)
Modified: 2009-09-29 18:38 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 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-15 15:46:39 UTC
$host :: .../app-arch/xz-utils %% ekeyword ~amd64-linux xz-utils-9999.ebuild 
xz-utils-9999.ebuild

$host :: .../app-arch/xz-utils %% ekeyword amd64 xz-utils-9999.ebuild 
xz-utils-9999.ebuild
  -     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux"
  +     KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux"

*Something* is weird with ekeyword. Try "ecopy app-arch/xz-utils" to see the behavior.
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-15 15:50:08 UTC
Oh, ecleankw can't handle: "^\tKEYWORDS=" - works fine without a tab...
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-15 17:54:37 UTC
ah, I cannot understand why there is ^KEYWORDS in ecleankw. This patch tests fine for me in both cases:

%% svn di
Index: ecleankw
===================================================================
--- ecleankw    (revision 50848)
+++ ecleankw    (working copy)
@@ -32,7 +32,7 @@
 for f in $files ; do
        echo -n "Processing $f ... "
        newkw=""
-       eval $(egrep "^KEYWORDS=" "$f")
+       eval $(egrep "KEYWORDS=" "$f")
        for kw in $KEYWORDS ; do
                for mkw in $my_keywords ; do
                        kw=${kw/-fbsd/-freebsd}
@@ -45,7 +45,7 @@
                done
        done
        sed -i \
-               -e "s|^KEYWORDS=.*$|KEYWORDS=\"${newkw:1}\"|" \
+               -e "s|KEYWORDS=.*$|KEYWORDS=\"${newkw:1}\"|" \
                "$f"
        echo "${newkw:1}"
 done

Please enlighten me on why it anchors the variable to the beginning of the line only. :)
Comment 3 Fabian Groffen gentoo-dev 2009-09-15 18:14:30 UTC
I suggest changing the pattern to only match whitespace, e.g. '[ \t]*KEYWORDS' in the right regexp dialect
Comment 4 Fabian Groffen gentoo-dev 2009-09-25 15:34:02 UTC
you don't want to match ACCEPT_KEYWORDS="bla"

what's the problem here to continue and fix the bug?
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-09-25 15:40:44 UTC
No problem, I just need to do it :)
Comment 6 Fabian Groffen gentoo-dev 2009-09-29 18:38:44 UTC
He who fixes this must decide what to do with multiple KEYWORDS= lines.  It is easy to support indented KEYWORDS=, but this happens IMO only when it is in an if-construct (for live-ebuilds) in which case we never know what line to touch.