[racket-dev] Updating dependency packages from other sources
At Thu, 15 Aug 2013 11:07:07 -0400, Asumu Takikawa wrote:
> On 2013-08-15 08:19:06 -0600, Jay McCarthy wrote:
> > As for what we could do going forward, I think either of these
> > approaches could be 'automated'.
>
> Yes, that'd be great.
>
> > For instance, we could add a command like
> >
> > $ raco pkg replace x11 new-x11-source
> >
> > This would behave like either of those (which would be invisible to the user).
> >
> > Do you have any opinions about how you'd want to do this replacement?
>
> Maybe `raco pkg install` can have an additional flag that lets you
> replace existing packages? Or maybe it should allow conflicts if the
> package has the same name as an already installed package (possibly
> prompting/warning the user)?
How about allowing a package source as an argument to `raco pkg update`?
After all, removing an old package implementation and installing a new
one is already the job of `raco pkg update`, not `raco pkg install`.
Then again, dealing with package sources and recording a new
name->source mapping is already the job of `raco pkg install`, not
`raco pkg update`.
I lean toward changing `raco pkg update`, because I think it's
reasonable to treat a package source other than a package name as a
"replace" request by default. In contrast, I don't think `raco pkg
install` should ever overwrite an existing package implementation by
default.
For example, I can imagine
raco pkg install stuff.zip
... get a new "stuff.zip" ...
raco pkg update stuff.zip
and that seems better to me than
raco pkg install stuff.zip
... get a new "stuff.zip" ...
raco pkg install --replace stuff.zip
I have in mind that `raco pkg update` would treat as package name as it
does now, instead of like other package sources. That is, it would
update based on how the package was previously installed. There's a
difference only if the package was installed from a package source
other than a package name, though.
Naturally, the special treatment of package names would necessitate a
new flag for consistent treatment of package sources. Specifically, if
you wanted to replace an existing package installation with a catalog
reference, then you'd have to use a flag to `raco pkg update'.