Subject: Re: everything is a dependency and preventing removal
To: Jeremy C. Reed <reed@reedmedia.net>
From: Alistair Crooks <agc@wasabisystems.com>
List: tech-pkg
Date: 01/10/2003 10:01:17
On Thu, Jan 09, 2003 at 12:20:32PM -0800, Jeremy C. Reed wrote:
> I am using pkgsrc as a complete operating system, in other words, it
> provides a kernel, glibc (and other libs), gcc, binutils, important shell
> utils, tar (or alternative), ftp client, et cetera.
> 
> Can anyone share an ideas, experiences or examples of other operating
> system packaging tools for preventing accidental removal of important
> packages?
> 
> For example, pkg_add may need tar, maybe gzip libs, maybe ftp, and maybe
> some basic shell utils.
> 
> I guess a few packages could use some identifier indicating that they
> should never be permanently removed, but only updated.
> 
> In my particular case, I could have some .mk definition to set
> DEPENDS+= to a few packages to apply for all packages. That way deleting
> sh-utils (for example) couldn't be removed until all other packages were
> removed first -- which would become impossible.
> 
> So then how to update sh-utils in this case?
> 
> I guess I should also look at the syspkg tools to see what it does to
> prevent accidental removal of /bin/cat or /bin/sh for example.
> 
> Any ideas or pointers would be appriciated.

Not sure about appriciation, but I've been wondering for a while now
if we shouldn't add some kind of analogy of an immutable flag to
packages, which would prevent pkg_delete from deleting a package if it
was present.  This might be in the form of yet another variable that
gets sprinkled around package Makefiles, and stored in the package
metadata in ${PKG_DBDIR}, or maybe just a simple chmod in/on the
package metadata dirs, although, as operations on there are done by
root, this may not be as immutable as people would want. 
Unfortunately, chflags isn't portable across all the operating systems
that pkgsrc supports.

This would replace the clunky ways we have of doing things at the
moment - see the pkg_install package, and also have the side-benefit
of allowing us to make binary packages of these "non-removable" ones.

Anyway, "we're working on it".

Take care,
Alistair