Description: |
Convert Pacman optional dependencies to real dependencies. |
Latest Version: |
2013 |
Architecture: |
|
Dependencies: |
|
Arch Repositories: |
|
AUR ID: |
|
Arch Forum ID: |
|
Tags: |
Makedep modifies files in the Pacman local database to add user-defined dependencies to installed packages. The main purpose is to convert optional dependencies to true dependencies so that they can be installed as such and not appear as orphans in the output of pacman -Qdt. Usage is not limited to optional dependencies so any package can be made to depend on any other. This can be used to tie packages together so that they can be removed with a top-level package via pacman -Rc.... It may even be useful for creating empty packages to act as metapackages.
$ pacman -Qi picard chromaprint
Name : picard
Version : 1.1-1
...
Depends On : python2-pyqt mutagen libofa ffmpeg
Optional Deps : libdiscid: CD lookup
chromaprint: fingerprinting
Name : chromaprint
Version : 0.7-1
...
Required By : None
...
Install Reason : Installed as a dependency for another package
$ makedep picard -a chromaprint
updating picard-1.1-1
$ pacman -Qi picard chromaprint
Name : picard
Version : 1.1-1
...
Depends On : python2-pyqt mutagen libofa ffmpeg chromaprint
Optional Deps : libdiscid: CD lookup
chromaprint: fingerprinting
Name : chromaprint
Version : 0.7-1
...
Required By : picard
...
Install Reason : Installed as a dependency for another package
$ makedep -s
picard
chromaprint
Makedep can of course also remove added packages. See the help message for a full list of options.
When a local package is upgraded, the local database files are replaced. Makedep can re-add dependencies with makedep -u. You could use the following script as a pacman wrapper for sync operations to automate this (replace /usr/bin/pacman with the path to your favorite Pacman wrapper:
#/bin/sh
/usr/bin/pacman -S "$@"
/usr/bin/makedep -u
Save that as e.g. pacman-S and then use it as follows:
# System upgrade
pacman-S -yu
# Install package
pacman-S foo
Given that this modifies files in the local database, several precautions have been taken:
Explore the idea of metapackages further. It may be very useful in combination with a repackaging tool to maintain the same package set on different systems.
$ makedep --help
usage: makedep [-h] [--config </path/to/pacman.conf>]
[-a <pkgname> [<pkgname> ...]] [-c] [-p]
[-r <pkgname> [<pkgname> ...]] [-s] [-u] [--print-dbpath]
[<pkgname> [<pkgname> ...]]
Add custom dependencies to installed Pacman packages. This is intended mainly
for optional dependencies, but it works with any package.
positional arguments:
<pkgname> Packages the metadata of which will be modified.
optional arguments:
-h, --help show this help message and exit
--config </path/to/pacman.conf>
The path to a Pacman configuration file. This
determines the location of the database. Default:
/etc/pacman.conf
-a <pkgname> [<pkgname> ...], --add <pkgname> [<pkgname> ...]
New dependencies to add to the target packages.
-c, --clean Remove entries for packages that are no longer
installed.
-p, --purge Remove all entries and reset the local database files.
-r <pkgname> [<pkgname> ...], --remove <pkgname> [<pkgname> ...]
Dependencies to remove from the target packages. This
will only remove dependencies that have been
previously added with makedep.
-s, --show Show added dependencies for the given packages, or all
packages if none given.
-u, --update Reapply changes to local database. Run this after
upgrading packages. When this option is passed, .
--print-dbpath Print the path to the makedep database for the current
operation.