Bug 229913 - Generate p2 Metadata
Summary: Generate p2 Metadata
Status: RESOLVED FIXED
Alias: None
Product: Modeling
Classification: Modeling
Component: Releng (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nick Boldt CLA
QA Contact:
URL: http://wiki.eclipse.org/Equinox_p2_Me...
Whiteboard:
Keywords:
Depends on: 229916
Blocks: 212203
  Show dependency tree
 
Reported: 2008-05-02 00:32 EDT by Nick Boldt CLA
Modified: 2008-05-07 17:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Boldt CLA 2008-05-02 00:32:17 EDT
Modeling Update sites should also include p2 metadata.

http://wiki.eclipse.org/Equinox_p2_Metadata_Generator
Comment 1 Nick Boldt CLA 2008-05-02 02:39:30 EDT
Well, that was relatively easy. 

7 interim sites updated w/ p2 metadata (content.jar, artifacts.jar). 

http://download.eclipse.org/modeling/emf/updates/interim/
http://download.eclipse.org/modeling/emft/updates/interim/

http://download.eclipse.org/modeling/mdt/updates/interim/
http://download.eclipse.org/modeling/m2t/updates/interim/
http://download.eclipse.org/modeling/m2m/updates/interim/

http://download.eclipse.org/modeling/gmf/updates/interim/
http://download.eclipse.org/tools/gef/updates/interim/

Running on build.eclipse.org w/ JDK 5, generation time varies from about a half a minute to over 3 minutes, depending on how much site content there is to process.

Tomorrow, I'll test them out. Pascal, feel free to do the same.
Comment 2 Pascal Rapicault CLA 2008-05-02 16:11:40 EDT
Site looks good. I added them all and tried to install GMF and it worked without a problem. The only "problem" is the name of the site that seems to be prefixed with a double quote when looking at the content of the site in the site view mode.
Comment 3 Nick Boldt CLA 2008-05-02 17:37:34 EDT
Re comment 2: looks like a bug in the generator. 

Per the example in the wiki, I'm running like this:

Input:

/opt/sun-java2-5.0/bin/java
  -cp /home/www-data/build/equinox-p2-agent/plugins/org.eclipse.equinox.launcher_1.0.100.v20080501.jar:/home/www-data/build/equinox-p2-agent/plugins/org.eclipse.equinox.p2.metadata.generator_1.0.0.v20080501-1238.jar:/home/www-data/build/equinox-p2-agent/plugins org.eclipse.equinox.launcher.Main
  -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator
  -updateSite /var/www/html/modeling/m2t/updates/interim/
  -site file:/var/www/html/modeling/m2t/updates/interim/site.xml
  -metadataRepository file:/var/www/html/modeling/m2t/updates/interim/
  -metadataRepositoryName "M2T Update Site"
  -artifactRepository file:/var/www/html/modeling/m2t/updates/interim/
  -artifactRepositoryName "M2T Artifacts"
  -compress
  -reusePack200Files
  -vmargs
  -Xmx128M

Output:

Generating metadata for /var/www/html/modeling/m2t/updates/interim.
Generation completed with success [0 seconds].

And I end up with this in the content.xml:

<repository name='&quot;M2T' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>

I've tried other variations:

"M2T Update Site"   ==> '&quot;M2T'
'M2T Update Site'   ==> '&apos;M2T'
\"M2T Update Site\" ==> '\&quot;M2T'
M2T%20Update%20Site ==> 'M2T%20Update%20Site'
M2T+Update+Site     ==> 'M2T+Update+Site'
M2T&nbsp;Update&nbsp;Site ==> 'M2T&nbsp;Update&nbsp;Site'
M2T&#160;Update&#160;Site ==> 'M2T&#160;Update&#160;Site'

But I can't get the Available Software view to show the label I want -- M2T Update Site -- nor get that to appear as 'M2T Update Site' in the content.xml.

Whatever's collecting the commandline args in org.eclipse.equinox.p2.metadata.generator.EclipseGenerator must be truncating after the first space, regardless of single or double quote wrapping.
Comment 4 Pascal Rapicault CLA 2008-05-06 11:17:41 EDT
We don't do any funny processing. I think that the problem you are seeing result from the shell expansion which may remove the double quotes and then the argument splitting code (common to all apps) would see the words of your repository name as as many arguments.
Try with replacing the double quotes by single quotes.
Comment 5 Nick Boldt CLA 2008-05-06 15:10:13 EDT
(In reply to comment #4)
> Try with replacing the double quotes by single quotes.

I did. See comment 3. That doesn't work either. Nor do various escape chars for spaces, because instead of being rendered as spaces, they get rendered as "+", "%20" or "&#nbsp;". 

Something is wack at your end when used on Linux and when run via java instead of eclipse executable. 

Note also that http://wiki.eclipse.org/Equinox_p2_Metadata_Generator implies that double-quotes are perfectly legal, but they don't work here.
Comment 6 Pascal Rapicault CLA 2008-05-06 16:03:45 EDT
Andrew, could you please look into this?
Comment 7 Andrew Overholt CLA 2008-05-07 09:00:31 EDT
(In reply to comment #6)
> Andrew, could you please look into this?

Yup.
Comment 8 Andrew Overholt CLA 2008-05-07 14:47:47 EDT
I can't duplicate generating for the SDK.  The handling of -updateSite looks like it may be responsible.  Nick:  can you point me to a zip of an update site I can use?

FWIW, I used this script:

#!/bin/sh

M7=/home/overholt/eclipse/binary/M7/eclipse

# /usr/bin/java is OpenJDK 6
JAVA=/usr/bin/java
#JAVA=/home/overholt/.bin/jres/ibm-java2-i386-50/bin/java
#JAVA=/home/overholt/.bin/jres/jdk1.6.0/bin/java
#JAVA=/home/overholt/.bin/jres/jdk1.5.0_09/bin/java

REPO=/tmp/repo

rm -rf $REPO/*

$JAVA -cp \
$M7/plugins/org.eclipse.equinox.launcher_1.0.100.v20080501.jar:$M7/plugins/org.eclipse.equinox.p2.metadata.generator_1.0.0.v20080501-1238.jar:$M7/plugins \
org.eclipse.equinox.launcher.Main \
-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator \
-metadataRepository file:$REPO \
-metadataRepositoryName "Test with spaces" \
-artifactRepository file:$REPO \
-artifactRepositoryName "Test with spaces" \
-source $M7 \
-root sdk \
-rootVersion 3.4.0.M7 \
-flavor tooling \
-publishArtifacts \
-append

grep repository\ name $REPO/content.xml

and got these results:

[blingbling:tmp]$ sh ./generateRepo.sh 
Generating metadata for /home/overholt/eclipse/binary/M7/eclipse.
Generation completed with success [7 seconds].
<repository name='Test with spaces' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>

<change to IBM 1.5>

[blingbling:tmp]$ sh ./generateRepo.sh 
Generating metadata for /home/overholt/eclipse/binary/M7/eclipse.
Generation completed with success [9 seconds].
<repository name='Test with spaces' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>

<change to Sun 1.6>

[blingbling:tmp]$ sh ./generateRepo.sh 
Generating metadata for /home/overholt/eclipse/binary/M7/eclipse.
Generation completed with success [8 seconds].
<repository name='Test with spaces' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>

<change to Sun 1.5>

[blingbling:tmp]$ sh ./generateRepo.sh 
Generating metadata for /home/overholt/eclipse/binary/M7/eclipse.
Generation completed with success [10 seconds].
<repository name='Test with spaces' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
Comment 9 Andrew Overholt CLA 2008-05-07 16:05:59 EDT
I just re-tried with a modelling update site that Nick gave me and with this script:

#!/bin/sh

M7=/home/overholt/eclipse/binary/M7/eclipse

JAVA=/usr/bin/java
#JAVA=/home/overholt/.bin/jres/ibm-java2-i386-50/bin/java
#JAVA=/home/overholt/.bin/jres/jdk1.6.0/bin/java
#JAVA=/home/overholt/.bin/jres/jdk1.5.0_09/bin/java

REPO=/tmp/repo

rm -rf $REPO/*

$JAVA -cp \
$M7/plugins/org.eclipse.equinox.launcher_1.0.100.v20080501.jar:$M7/plugins/org.eclipse.equinox.p2.metadata.generator_1.0.0.v20080501-1238.jar:$M7/plugins \
org.eclipse.equinox.launcher.Main \
-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator \
-updateSite /tmp/site/ \
-site file:/tmp/site/site.xml \
-metadataRepository file:$REPO \
-metadataRepositoryName "Test with spaces" \
-artifactRepository file:$REPO \
-artifactRepositoryName "Test with spaces" \
-source $M7 \
-root sdk \
-rootVersion 3.4.0.M7 \
-flavor tooling \
-publishArtifacts \
-compress \
-reusePack200Files \
-append

unzip $REPO/content.jar
grep repository\ name content.xml

and it still works for me.
Comment 10 Nick Boldt CLA 2008-05-07 17:15:46 EDT
Seems to only be reproduceable when I assemble the command as a string, then run it.

If I run the command w/o first assembling it (to aid optional debugging) then it works fine.

And I've switched over to use M7_34 basebuilder instead of the p2-agent zip, which works too (bug 229916).

Closing -- not a p2 issue.