Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 202068 - sys-apps/portage-2.1.4_rc9: Deletes line of code from eclass function
Summary: sys-apps/portage-2.1.4_rc9: Deletes line of code from eclass function
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 200044
  Show dependency tree
 
Reported: 2007-12-12 18:15 UTC by Matthias Schwarzott
Modified: 2007-12-14 01:19 UTC (History)
0 users

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


Attachments
detect bash here-documents and leave them intact (here_docs.patch,2.79 KB, patch)
2007-12-13 08:55 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Schwarzott gentoo-dev 2007-12-12 18:15:25 UTC
sys-apps/portage-2.1.4_rc9 does remove one line of code from vdr-plugin.eclass function.

This is the relevant code:
   cat <<-EOT > "${D}/${DB_FILE}"
       VDRPLUGIN_DB=1
       CREATOR=ECLASS
       EBUILD=${CATEGORY}/${PN}
       EBUILD_V=${PVR}
   EOT

The EBUILD= line gets removed so the created file will miss it.
Comment 1 Zac Medico gentoo-dev 2007-12-12 21:39:12 UTC
We're currently using grep -v to filter out any variable assignments that cause problems. Filtering of variable assignments is required in order to solve bug 190128, and also to solve bug 56408 (to discard saved variables that can cause interference, such as EBUILD).

We can stop using grep and use some more complex parser that recognizes bash's here-documents, but I'm not sure what we're going to use yet. It would be a lot simpler if we didn't have to support here-documents containing variable assignments like that.
Comment 2 Zac Medico gentoo-dev 2007-12-12 22:05:45 UTC
I think what I'll probably do is write a python script that behaves very similar to grep -v but also recognizes bash here-documents and allows them to pass through unchanged. The script can be kept in /usr/lib/portage/bin/, like check-implicit-pointer-usage.py is now.
Comment 3 Matthias Schwarzott gentoo-dev 2007-12-12 22:23:34 UTC
For your info: I did change the code to this to make it work:

    {
        echo "VDRPLUGIN_DB=1"
        echo "CREATOR=ECLASS"
        echo "EBUILD=${CATEGORY}/${PN}"
        echo "EBUILD_V=${PVR}"
    } > "${D}/${DB_FILE}"
Comment 4 Matthias Schwarzott gentoo-dev 2007-12-13 08:28:18 UTC
(In reply to comment #2)
> I think what I'll probably do is write a python script that behaves very
> similar to grep -v but also recognizes bash here-documents and allows them to
> pass through unchanged. The script can be kept in /usr/lib/portage/bin/, like
> check-implicit-pointer-usage.py is now.
> 
Wouldn't it be easier to just detect and ignore bash functions. That does not require detecting different end-of-text markers.
Comment 5 Zac Medico gentoo-dev 2007-12-13 08:55:15 UTC
Created attachment 138384 [details, diff]
detect bash here-documents and leave them intact



(In reply to comment #4)
> Wouldn't it be easier to just detect and ignore bash functions. That does not
> require detecting different end-of-text markers.

I'm not sure what's easier but I've got a working patch that detects here-documents.
Comment 6 Zac Medico gentoo-dev 2007-12-14 00:39:45 UTC
Thinking about filter functions, we'd still have to detect here-documents anyway in order to distinguish a } character in a here-document from the end of a function. So, I think our patch is on the right track.
Comment 7 Zac Medico gentoo-dev 2007-12-14 01:19:10 UTC
This has been released in 2.1.4_rc10.