Hi,

I'm working on oscar-packager and I'm starting to understand why it doesn't 
work properly.
I understand why the package.cfg file is ignored (with the src.rpm ignored).

Though I don't know yet were to fix the problem(s).


Lets take the example of torque (the case which can enlight most issues).

What I see is that if the torque entry in 
/etc/oscar/oscar-packager/included_unstable.cfg starts with svn.

Then obviously, there is a checkout, but then, evethough the torque-oscar.cfg 
contains an rpm (and is built if not in /etc/oscar/oscar-packager/.oscar_pkgs), 
the build is ignored and the build process continues as part of the build from 
svn. (oscar-packager:365)

In details, the build.cfg is used to install dependancies then if not yet built 
torque-oscar.cfg is used to correctly build torque-oscar using rpmbuild 
--rebuild src.rpm --define from build.cfg.
Unfortunately, the build does not stop here as we are in the build from 
SVN|TARBALL if section.
Thus a "make rpm" is uselessly triggered.

What was occuring in the past is that the build.cfg had dependancies on 
torque.oscar and thus, the torque-oscar.cfg build was triggered srpm:rpmbuild 
--rebuild (done as part of prepare_prereqs).

Then the make rpm was triggered (trying to build a second time with another 
method (svn:make rpm) the torque-oscar package. The make process invoked 
build_package that again triggered the prepare_prereqs and agin rebuild the 
torque rpm from torque.cfg and finally was failing doing a rpmbuild -bb the 
spec file from svn with missing files)

If there was no mechanisme to prevend useless rebuild 
(/etc/oscar/oscar-packager/.oscar_pkgs), the build would be triggered 5 times:
1/ rpmbuild --rebuild --target noarch blah blah blah (oscar-packager: 
prepare_prereqs)
2/ rpmbuild --rebuild --target x86_64 blah blah blah (oscar-packager: 
prepare_prereqs)
3/ rpmbuild --rebuild --target noarch blah blah blah (build_package: 
prepare_prereqs)
4/ rpmbuild --rebuild --target x86_64 blah blah blah (build_package: 
prepare_prereqs)
5/ rpmbuild -bb torque.spec (no arch specified). (oscar-packager: 
create_package)

All five results would be bad.
1/2/3/4 are using the src.rpm, if the mom_conf file (specific to oscar) is 
updated in the svn, it is ignored
5/ eventhough no files are missing, the noarch build is not triggered. Though, 
it's not dramatic as since rhel-6, the BuildArch: noarch tag can be put in a 
sub package without being ignored or superceded by main package BuildArch:

Side note that the build_rpm.sh trigger could be removed because it can be put 
in the rpm: rule in the Makefile. For the moment, it is redundant, but doesn't 
trigger any problem  (not dramatic thus).

The situation:

If I take the case of torque (the most complex), oscar-packager does:
- "svn checkout" (according to 
/etc/oscar/oscar-packager/included_unstable.cfg[torque] =>OK
- "prepare_prereqs" does not build the torque-oscar rpm from the src.rpm 
anymore (don't know when it stopped doing so). => Not OK?
- "make rpm" fails and is bad for the following reasons:
   - missing files => Easy to fix, not a bug (code wise)  but should not be run 
if the torque-oscar.cfg has an srpm.
   - missing defines for the rpm. thus, even if the files are or, the resulting 
rpm will have default name (conflic with distro) and will not install in 
/opt.... =>Not OK.

So there are 2 things to fix:
1/ Understand and fix: if a torque.cfg contains a .src.rpm: build the rpm if 
version is newer even if it is in /etc/oscar/oscar-packager/.oscar_pkgs. Then 
stop here.
2/ If no torque.cfg, then build at least with correct --defines (taken from the 
build.cfg).....
    => What need fixing? Makefile? Packager.pm? oscar-packager? All of them? 
I'll investigate.

We can't systematicaly fix by putting the srpm method with url of 
torque.src.rpm in /etc/oscar/oscar-packager/included_unstable.cfg as sometimes 
we want to use the upstream src.rpm with specific --define specified in the 
build.cfg (and the build.cfg in retrieved from svn). (or we can add a 
rpm_option field (what about debian).

So if someone has a clear doc on how oscar-packager is intended to work, them, 
I'm very interrested in it. If such a doc does not exists, then I'll try to fix 
oscar-packager so we don't have quintuple build triggered (4 rpmbuild --rebuild 
followed by a rpmbuild -bb).

I'm sure I can fix things, but if I have docs, It would help me not to diverge 
to much form it.
For example, it looks like the <package>.cfg is only for rpmbuild...or at 
least, only used for rpm builds... What about debian?

Best regards.

Olivier.


--
   Olivier LAHAYE
   CEA DRT/LIST/DCSI/DIR
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to