NetBSDfr / pkgin

pkgin's official github repository
130 stars 40 forks source link

Corner-case surprise when using `pkgin -y remove` #42

Open L2G opened 9 years ago

L2G commented 9 years ago

Let's say there is a package, git-base, that depends on another package, curl. I've installed them like so:

# pkgin -y install curl git-base
calculating dependencies... done.

nothing to upgrade.
2 packages to be installed: curl-7.38.0 git-base-2.1.0 (0B to download, 241M to install)

downloading packages...
installing packages...
installing curl-7.38.0...
installing git-base-2.1.0...
.
.
.
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
updating database: 100%
marking curl-7.38.0 as non auto-removable
marking git-base-2.1.0 as non auto-removable

Later I want to remove just curl, but it doesn't occur to me that git-base is depending on it, so in a hurry I do this:

# pkgin -y remove curl
2 packages to delete: git-base-2.1.0 curl-7.38.0
removing git-base-2.1.0...
removing curl-7.38.0...
pkg_install warnings: 0, errors: 0
reading local summary...
processing local summary...
updating database: 100%

Both have been removed, which on one hand makes sense. But they were also both marked as non-auto-removable. Since I only named curl on the command line, it seems like the right thing to do would have been to halt with an error when pkgin came to uninstall git-base and saw that it was marked.

nbyouri commented 9 years ago

which pkgin version are you using?

L2G commented 9 years ago

This is pkgin-0.6.4nb7 from Joyent's SmartOS distribution.

iMilnb commented 9 years ago

@L2G pkgin 0.8.0 is going to be available as soon as pkgsrc-2015Q1 is announced, it should fix this kind of issue. If your matter is urgent, you can fetch latest pkgin version from github or pkgsrc HEAD.

L2G commented 9 years ago

@iMilnb No urgency; I just wanted to make sure it was known. Thanks!