Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116024 - the elog system custom module has problems
Summary: the elog system custom module has problems
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: REGRESSION
Depends on:
Blocks: 115839
  Show dependency tree
 
Reported: 2005-12-19 03:39 UTC by Moshe Kamensky
Modified: 2005-12-30 00:39 UTC (History)
0 users

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


Attachments
a patch to fix the first two described problems (elog_modules.patch,1.42 KB, text/plain)
2005-12-19 03:46 UTC, Moshe Kamensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moshe Kamensky 2005-12-19 03:39:43 UTC
I found three problems with the elog 'custom' module.

The first is that it tries to use the elogfilename from the 'save' module, 
which does not exist.

The second is that the replace function is used on the command to replace the 
arguments, but the return value is ignored.

I fixed the first problem by returning the log file name from the save 
module, and using it, and the second problem by not ignoring the return 
value. This is in the attached patch.

The third problem is not really a bug but a deception: the value of the 
PORTAGE_ELOG_COMMAND variable in make.conf should be given with single quotes 
to avoid the variables being expanded. This is not so in the 
make.conf.example.

I must added that the syntax is misleading. If PACKAGE and LOGFILE are not 
shell variables, they should not use that syntax (eg, I would expect $LOGFILE 
to work as well as ${LOGFILE}, but this isn't so.) A solution would be to 
export PACKAGE and LOGFILE as real shell variables prior to running the 
command, instead of using the replace function
Comment 1 Moshe Kamensky 2005-12-19 03:46:23 UTC
Created attachment 75078 [details]
a patch to fix the first two described problems
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2005-12-19 09:46:00 UTC
Ok, fixed the issues mentioned, but not going to change the syntax (it's the same as used for the FETCHCOMMAND family).
Comment 3 Moshe Kamensky 2005-12-19 11:32:22 UTC
(In reply to comment #2)
> Ok, fixed the issues mentioned, but not going to change the syntax (it's the
> same as used for the FETCHCOMMAND family).
> 

I'm not saying the syntax must be changed, I'm just saying that if this is the syntax it is more reasonable to change the implementation, so that the environment variables are actually set before calling the command, instead of replacing them syntactically. Unfortunately, I don't know any python so I can't suggest a patch, but there must be a way to set environment variables in python
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2005-12-19 12:56:04 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Ok, fixed the issues mentioned, but not going to change the syntax (it's the
> > same as used for the FETCHCOMMAND family).
> > 
> 
> I'm not saying the syntax must be changed, I'm just saying that if this is the
> syntax it is more reasonable to change the implementation, so that the
> environment variables are actually set before calling the command, instead of
> replacing them syntactically. Unfortunately, I don't know any python so I can't
> suggest a patch, but there must be a way to set environment variables in python
> 

Well, let me rephrase: I'm using exactly the same means as FETCHCOMMAND does, which does it this way, so not going to change one without also changing the other, and that's beyond this bug.
Comment 5 Jason Stubbs (RETIRED) gentoo-dev 2005-12-25 00:09:19 UTC
Released in 2.1_pre2.