Owned and added files

What do I exactly mean when I say that a file belongs to a package ? Can a file belong to more than one package ? What exactly gets uninstalled or listed then ? This section tries to answer those questions.

Which file belong to a package ?

Urpkg considers a file as belonging to a given package if one of the two conditions below is satisfied.

  1. The file has the package user as owner or group

  2. The file is listed in ${HOMEDIR}/.urpkg/added, where HOMEDIR is the path to the package's home directory.

Given this definition, it is easy to see that a file can belong to more than one package. For example, it could have a given package user as its owner , another as its group, and be listed in the added list of a third package. Most of the time though, a file will be only part of one package and you should really keep it that way.

If you use the --find command, urpkg will list you all packages the given file belongs to.

What gets removed or listed ?

When you use the --list action, urpkg will list you the files that are unique to the given package, and the files that are shared with other packages. Only the former category will be deleted when you uninstall the package. Keep in mind that you can always use --pretend to know for sure what would be removed.

What about directories ?

First, urpkg will never remove a directory that does not belong to the package you want to uninstall, even if it is empty. Second, a directory that belongs to the package you are considering must be empty (after you deleted all the other files in it belonging to the package) to be deleted. This prevents other files from other packages that are in the directory to be deleted as well. This can happen if, for example you temporarily set a directory as an install directory and then revert it to belong to the given package.

Urpkg will take no risk and only warn you that the directory is not empty. The uninstallation will not fail just because of that. You will have to remove those directories manually. If you are careful the way you manage your system, this should only happen rarely.