Opened 4 years ago

Closed 5 months ago

#1093 closed enhancement (fixed)

chicken-uninstall should not interpret the given egg as a pattern by default

Reported by: mario Owned by:
Priority: minor Milestone: 5.0
Component: core tools Version: 4.8.x
Keywords: chicken-uninstall Cc:
Estimated difficulty: hard



$ chicken-uninstall sp                                                          

About to delete the following extensions:


Do you want to proceed? (yes/no/abort) [no] no

I think this default is rather dangerous and unnecessary. We should probably make chicken-uninstall only uninstall the exact given egg(s) and have a command line like -match which users can use to explicitly state that they want to remove all eggs matching the given pattern.

Change History (6)

comment:1 Changed 4 years ago by mario

Also, chicken-uninstall should remove whole eggs, not individual modules/command line tools, since chicken-install doesn't track dependencies of modules in the same egg.

I mean, in the ticket description, sp-runtime should not even be displayed on the output, since it's a module installed by sp.

If I run chicken-uninstall -exact sp, chicken-uninstall will remove sp but leave sp-runtime, which is installed when we chicken-install sp.

comment:2 Changed 3 years ago by sjamaan

This is rather tricky, because several eggs install multiple modules, most of which are prefixed with the egg's name. For example, you have 9p which installs 9p-client, 9p-lolevel and 9p-server. The utf8 egg installs utf8, utf8-lolevel, utf8-srfi-14, utf8-case-map and utf-srfi-13, all of which should be uninstalled when performing "chicken-uninstall utf8". But, the utf8 egg also installs unicode-char-sets, which is not uninstalled along with the egg!

So all in all this probably requires a rewrite anyway: it should match an exact egg name, which then proceeds to uninstall everything the egg installs. One problem is that setup-files can invoke arbitrary commands, so strictly speaking chicken-install *can't* know what files an egg installs. The aforementioned eggs install more than one "extension". Apparently an egg can map to multiple extensions, but this mapping is not recorded anywhere. Perhaps install-extension can record this, if chicken-install parameterises the eggname before LOADing the .setup-file?

Felix mentioned he wanted to rewrite the setup-api to be more declarative, hopefully this will help make these problems go away entirely.

comment:3 Changed 3 years ago by mario

Actually, there is a way to find what egg a "thing" belongs to. Things installed by install-extension, install-program and install-script write an egg-name form to .setup-info files. The problem is that, given an egg to uninstall, we have to scan all .setup-info files to find out all the egg's components.

comment:4 Changed 2 years ago by sjamaan

  • Milestone changed from someday to 5.0

Should be part of the CHICKEN 5 rewrite of chicken-uninstall.

comment:5 Changed 13 months ago by sjamaan

  • Estimated difficulty set to hard

comment:6 Changed 5 months ago by sjamaan

  • Resolution set to fixed
  • Status changed from new to closed

The new chicken-uninstall has an explicit -match option which causes it to treat its arguments as globs, but it won't do this by default anymore.

Note: See TracTickets for help on using tickets.