Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 273889

Summary: [director] provide commandline syntax help
Product: [Eclipse Project] Equinox Reporter: Nick Boldt <nboldt>
Component: p2Assignee: Thomas Hallgren <thomas>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: irbull, thomas
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 274470    
Bug Blocks:    

Description Nick Boldt CLA 2009-04-27 11:39:47 EDT
Compare:

a) unzipping an SDK into dropins:

1. unzip -help

2. unzip foo-SDK-someversion.zip -d eclipse/dropins/foo

b) installing an update site into eclipse:

1. Google for http://wiki.eclipse.org/Equinox_p2_director_application/Examples/Install_into_eclipse_using_SDKProfile, then:

2. ./eclipse -vm /path/to/bin/java -nosplash \
  -data ~/workspace -consolelog -clean \
  -application org.eclipse.equinox.p2.director.app.application \
  -metadataRepository http://download.eclipse.org/releases/ganymede \
  -artifactRepository http://download.eclipse.org/releases/ganymede \
  -installIU org.eclipse.foo.feature.group \
  -destination . \
  -bundlepool . \
  -profile SDKProfile
  -profileProperties org.eclipse.update.install.features=true \
  -p2.os linux -p2.ws gtk -p2.arch x86 \
  -vmargs \
    -Declipse.p2.data.area=eclipse/p2 \
    -Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M 

--------

Wouldn't it be kickass if I could just do this:

1. p2director -help

2. p2director org.eclipse.foo -d eclipse/

Wouldn't that take the 'p2 is scary, I want to keep using dropins' fears away?
Comment 1 John Arthorne CLA 2009-04-27 12:14:16 EDT
There is work going on to simplify the director app in bug 268138.
Comment 2 Thomas Hallgren CLA 2009-04-27 14:17:43 EDT
Regarding packaging of the director app, see bug 267623 - Ship a headless director product.

I'd like it to be shipped from the Equinox download page but for now, you'll find one here: http://www.eclipse.org/buckminster/downloads.html (the link "director_1.0.0.r10104.zip" in the "Headless Product" section).

It doesn't have an executable since it's completely platform independent. Instead it's shipped with a 'director' shell script and a windows 'director.bat'.

Excellent idea about the -help option. I'll change this bugzilla to cover that since the rest is covered by other bugs.

Comment 3 Nick Boldt CLA 2009-04-27 15:05:29 EDT
http://www.eclipse.org/buckminster/downloads.html shows usage, with 

  -ar <url to headless repo>
  -mr <url to headless repo>

I would suggest you give an example and clarify that one url points to artifacts, the other metadata. Took me a second to grok "ar" vs "mr", and I've been using p2 for over a year now. :) As you know, these may not be the same value, and can also be multiple values. For example:

  -metadataRepository file:${p2.director.input.repo},file:${p2.director.destination}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile
  -artifactRepository file:${p2.director.input.repo},file:${p2.director.destination}

(http://wiki.eclipse.org/Equinox_p2_director_application/Examples/Install_into_eclipse_using_SDKProfile)  

Looking in the director shell script, I notice a few things:

a) the script is not executable (use AntZip instead of pure Zip when bundling it so you can set permissions) - http://ant.apache.org/manual/CoreTypes/zipfileset.html

b) I see no mention of the director app, only the equinox.launcher_*.jar. How does the script know to run the director? Doesn't that jar have a number of Main classes? Is the director the default one? (http://wiki.eclipse.org/Starting_Eclipse_Commandline_With_Equinox_Launcher)

c) The script can be run w/o options, and it does... not much.

$ ./director 
Operation completed in 1 ms.

Better output to explain what happened would be useful here.

d) in place of director and director.bat, why not bundle the app as an executable jar? Thus `java -jar director.jar` would be functionally equivalent to `./director`, and on Windows, double-clicking the jar would run it (and hopefully throw some information into a log next to the jar in the same folder, or pop a dialog w/ the results). As an added bonus, you need not maintain the same script in multiple languages (have you tested this on Mac, for example?)

Comment 4 Thomas Hallgren CLA 2009-04-27 17:08:51 EDT
(In reply to comment #3)
> http://www.eclipse.org/buckminster/downloads.html shows usage, with 
> 
>   -ar <url to headless repo>
>   -mr <url to headless repo>
> 
> I would suggest you give an example and clarify that one url points to
> artifacts, the other metadata.
>
The <headless repo> in this case is the one referenced in the previous sentence so I don't see the need for that. This is supposed to be a short instruction to get Bucky Headless up and running with no ambitions beyond that. I'll add a link to more comprehensive director docs.

> Looking in the director shell script, I notice a few things:
> 
> a) the script is not executable
> 
Oops, that's a bug. I'll check (and yes, ant zip is used in the assembly).

> b) I see no mention of the director app, only the equinox.launcher_*.jar. How
> does the script know to run the director?
> 
The director is the default application. Have a look at configuration/config.ini

> c) The script can be run w/o options, and it does... not much.
> 
> $ ./director 
> Operation completed in 1 ms.
> 
Yes, that's not very nice. The director app should check what 'action' (i.e. -installIU, -uninstallIU, -list -help) to perform. If none is given, it should default to the -help. Well, as soon as that option exists of course.

> d) in place of director and director.bat, why not bundle the app as an
> executable jar? Thus `java -jar director.jar` would be functionally equivalent
> to `./director`
>
It would, but it's more typing :-)

I agree with you that a standard Java entry point would be a good thing. Not just for the director. I was not overly enthusiastic when they decided to remove the startup.jar (bug 173742) without a proper replacement.

> and on Windows, double-clicking the jar would run it (and hopefully
> throw some information into a log next to the jar in the same
> folder, or pop a dialog w/ the results).
>
I've seen more then one system where a double-click on a jar opens up winzip (my own is one example) or winrar. Not sure I see the value of this.

> As an added bonus, you need not maintain the
> same script in multiple languages (have you tested this on Mac, for example?)
> 
Yes, it's tested on a Mac and at present, that just about covers all platforms that we support.
Comment 5 Nick Boldt CLA 2009-04-27 18:16:18 EDT
(In reply to comment #4)
> > does the script know to run the director?
> configuration/config.ini

/me smacks forehead. Of course!
 
> I've seen more then one system where a double-click on a jar opens up winzip
> (my own is one example) or winrar. Not sure I see the value of this.

Fair enough; hadn't considered that scenario / file association. 
 
> Yes, it's tested on a Mac and at present, that just about covers all platforms
> that we support.

Yep, the trio of mac/win/lin (+/- the 64-bit flavours) is about all you need. The couple people out there trying to use Eclipse on Solaris (Solipse project @ code.google.com) can roll their own. :)

Comment 6 Thomas Hallgren CLA 2009-05-06 02:13:09 EDT
Fixed in the new director app.