Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 256909 - P2 mirrorApplication should have an option to set the local mirror name
Summary: P2 mirrorApplication should have an option to set the local mirror name
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Andrew Cattle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-28 11:26 EST by Baptiste Mathus CLA
Modified: 2008-12-08 11:08 EST (History)
3 users (show)

See Also:


Attachments
Allso users to set destination repository name (11.41 KB, patch)
2008-12-08 09:16 EST, Andrew Cattle CLA
dj.houghton: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Mathus CLA 2008-11-28 11:26:41 EST
Build ID: I20080617-2000 

Steps To Reproduce:
1. Mirror a repository (try with a not too big one like http://m2eclipse.sonatype.org/update/)
2. Add it to your Eclipse installation
3. It will display something like 'file:x:/local/path/to/mirror - metadata'

More information:
At the moment, the command line looks like this :
eclipsec -verbose -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source http://www.someurl.com/ -destination file:x:/local/path/to/mirror

It would be great to support an additional option like -name 'MyCompany - Local (Merged) Mirror'.

That would let us have more understandable repository names in the UI.

Thanks a lot.
Cheers.
Comment 1 Andrew Cattle CLA 2008-12-01 11:03:55 EST
Which version of the mirror application are you using?

I'm looking at my code and if a repository already exists at the destination it doesn't modify the name. If the mirror application needs to create a repository it uses the source repository's name. I remember making this change quite a while ago as well.

However, I can still see a case where simply copying the source repository's name can lead to confusion.
Comment 2 Baptiste Mathus CLA 2008-12-01 11:10:45 EST
Hi Andrew, as stated in the bug report, I'm using 3.4. Btw, am I wrong saying eclipse.exe (or eclipsec.exe) doesn't have any -version option?
Comment 3 Andrew Cattle CLA 2008-12-01 11:19:13 EST
Ah! I'm sorry I notice that you do state which build you are using.

Like I said, this problem has already been fixed to a degree. I agree that being able to specify a name for the destination might be useful but I'd be concerned about the expected behaviour. Specifically what happens if a repository exists at the destination but a repository name is specified?

We could use the existing name, overwrite the existing name, or only overwrite the existing name if the argument to remove the destination's existing content is included.

I'm unsure about the answer to your question but I can pass it on to someone who would be.
Comment 4 DJ Houghton CLA 2008-12-01 13:18:47 EST
I think there was a request for a -version command-line option at one point but I can't find it in bugzilla right now. I believe there was a question of what it would return... the version of the primary feature? the product version? And then once you install a few extra features then you're all over the place. John, do you have an opinion on this (or remember the previous discussion)?

Comment 5 John Arthorne CLA 2008-12-01 19:37:27 EST
> John, do you have an opinion on this (or remember the previous discussion)?

I think having an argument to specify the destination repository name makes sense. I think it should just overwrite the existing name if a repository already exists.

I vaguely remember the -version argument discussion. I don't think it has much value. Each feature, product, and bundle has a potentially different version, and the launcher itself has its own version.
Comment 6 Andrew Cattle CLA 2008-12-02 11:17:49 EST
Implemented and tested. Waiting for overlapping changes for Bug 255685 to be released before I can make the patch.

Currently I use the argument "-name <repository name>" to get the destination name. Any suggestions for a better argument? "-destinationName" perhaps?
Comment 7 John Arthorne CLA 2008-12-02 13:16:01 EST
-destinationName would be more descriptive.
Comment 8 Baptiste Mathus CLA 2008-12-02 17:04:48 EST
Or -repositoryName or even (but a bit long) -destinationRepositoryName, or shorted -destinationRepoName... Sorry about that :-).
Cheers.
Comment 9 Andrew Cattle CLA 2008-12-03 08:11:08 EST
(In reply to comment #8)
> Or -repositoryName or even (but a bit long) -destinationRepositoryName, or
> shorted -destinationRepoName... Sorry about that :-).
> Cheers.
> 

-repositoryName I think is a bit vague (which repository). The other 3 are a bit long.

That said, do we think -destinationName is descriptive enough to let the user know we're renaming the destination? Of course I think this problem is also shared by -destinationRepositoryName and -destinationRepoName. But arguments like -desiredDestinationName are a bit awkward...

-nameDestintion perhaps? In this case I think most users will read "name" as a verb and know we are "naming the destination" to whatever they set.
Comment 10 John Arthorne CLA 2008-12-05 10:53:42 EST
I think you're over-analyzing this. -destinationName is fine. If a user isn't sure what this does they can read the doc.
Comment 11 Andrew Cattle CLA 2008-12-08 09:16:52 EST
Created attachment 119784 [details]
Allso users to set destination repository name

Includes test cases. Uses the argument "-destinationName"
Comment 12 DJ Houghton CLA 2008-12-08 11:08:31 EST
Released to HEAD.