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

Pkg add with url overwrites existing files #614

Closed
KristofferC opened this issue Aug 11, 2018 · 4 comments · Fixed by #970
Closed

Pkg add with url overwrites existing files #614

KristofferC opened this issue Aug 11, 2018 · 4 comments · Fixed by #970
Assignees
Labels

Comments

@KristofferC
Copy link
Member

Reprduce with add url twice.

@KristofferC KristofferC self-assigned this Aug 11, 2018
@00vareladavid
Copy link
Contributor

Which files get overwritten?

@KristofferC
Copy link
Member Author

This might not happen anymore (with your refactoring), but from what I remember, the files in .julia/packages/.... got replaced by the ones from .julia/clones even if they already existed when you added with a url twice.

@00vareladavid
Copy link
Contributor

Ok, thanks. It might still be happening (not sure), but I figured I would check for this too while working on #951

@00vareladavid
Copy link
Contributor

Just checked, it is still happening

bors bot added a commit that referenced this issue Jan 8, 2019
970: Fix repo handling r=KristofferC a=00vareladavid

I started off just trying to break down `handle_repos_add` (it was a beast!) but the refactoring allowed two bugs to be fixed along the way.

Fixes #951. In the first stage (`resolve_repo_add!`) we make sure certain fields of the `PackageSpec` are filled out (`name`, `uuid`, `repo.url`, `repo.rev`). This means we can have more consistent logic for the rest of the operation. In particular, once we have the UUID, it is simple to check if the package is pinned.

Fixes #614. I added a test which simply makes sure that the `mtime` for the source is the same after an `add` by URL.

In terms of refactoring, moving all git-heavy operations into their own functions helps to clarify the `add`-specific logic. Also, `handle_repos_add!` was being called from many places. It turns out those calls just needed some more limited functionality which is now in `instantiate_pkg_repo!`.

Co-authored-by: David Varela <00.varela.david@gmail.com>
@bors bors bot closed this as completed in #970 Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants