Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageManager -dir does not alter installation directory #1070

Closed
tgvaughan opened this issue Dec 13, 2022 · 6 comments
Closed

PackageManager -dir does not alter installation directory #1070

tgvaughan opened this issue Dec 13, 2022 · 6 comments

Comments

@tgvaughan
Copy link
Contributor

The following line from the packagemanager usage

-dir Install/uninstall package in directory <DIR>. This overrides the useAppDir option

seems to suggest that by writing

packagemanager -dir ./my_app_dir -add feast

I should be able to install feast in ./my_app_dir instead of the default location.

Instead, the packagemanager ignores the argument and proceeds to try to install in the standard user package directory:

Packages user path : /Users/vaughant/Library/Application Support/BEAST/2.7
Access URL : https://raw.githubusercontent.com/CompEvol/CBAN/master/packages2.7.xml
Access URL : https://tgvaughan.github.io/remaster/package.xml
Getting list of packages ...Done!

Installation aborted: feast is already installed.

Looking at the source, the -dir argument seems to add the provided path to a path list which is then assigned to the property with the hard-coded name "BEAST_PACKAGE_DIR". This property doesn't seem to be referenced at all by the getPackageUserDir() method, which instead references the "beast.user.package.dir" property.

Is this a bug? Or am I misunderstanding the purpose of -dir? For what it's worth, adding -Dbeast.user.package.dir=./my_app_dir when running packagemanager produces the expected behaviour, so I can work around this. The documentation seems wrong to me though.

@rbouckaert
Copy link
Member

Just tried

packagemanager -dir /tmp/ -add ClaDS

and it ends with the message Package ClaDS is installed in /tmp//ClaDS., and indeed the directory /tmp/ClaDS/ is created and contains the ClaDS package files, and it is not in the default user directory.

Before installing a package, the package manager checks if the package is already installed somewhere, including in the user directory. If the package is already installed, it stops with the installation in order not to end up with several versions of a package in different directories. Is there a better way to do this?

@tgvaughan
Copy link
Contributor Author

Sorry Remco, it seems I misunderstood the point of the -dir option (I thought it was meant to use an alternative user directory), and I should be using -Dbeast.user.package.dir= instead. Thanks for the clarification.

Just out of curiosity, what's the true intended use case for the -dir option?

@tgvaughan tgvaughan closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2022
@rbouckaert
Copy link
Member

It actually makes more sense to treat it as a user defined user directory, so when this directory is specified, the beast.users.package.dir property is set, and any packages installed in the default user package directory are ignored. 206ad74 does this. This way you won't have to set the java directive explicitly. Perhaps BEAST and BEAuti should have matching command line options?

@tgvaughan
Copy link
Contributor Author

Looks great! Will you also add this option to PackageManager?

@rbouckaert
Copy link
Member

206ad74 makes packagemanager set the beast.user.package.dir property when specifying the -dir option, thus ignoring packages installed in the default user package location. I think it behaves now more like you expected and should work in combination with the BEAST and BEAUti options as well.

@tgvaughan
Copy link
Contributor Author

Ah, sorry - I only looked at the commit referencing this issue and assumed this was the same one linked in your text. Thanks, yes this seems much more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants