Fink

Benutzerhandbuch - 6. Das fink-Tool über die Kommandozeile benutzen

6.1 Das fink-Tool benutzen

Das fink-Tool nutzt verschiedene Befehle als Suffix, um auf Pakete der Source-Distribution angewandt zu werden. Einige benötigen mindestens ein Paketname, aber können auch mit mehrere Paketnamen auf einmal umgehen. Sie können einfach den Paketnamen (z.B. gimp), einen vollständigen, zugelassenen Namen mit der Version (z.B. gimp-1.2.1) oder einen Namen mit Version und Revision (z.B. gimp-1.2.1-3) angeben. Fink wird automatisch die aktuellste, verfügbare Version und Revision aussuchen, falls sie jeweils nicht angegeben sind. Andere haben verschiedene Optionen.

Es folgt eine Auflistung der Befehl für das fink-Tool:

6.2 Global options

There are some options, which apply to all fink commands. If you type fink --help you get the list of options:

(as of fink-0.26.0)

-h, --help - displays help text.

-q, --quiet - causes fink to be less verbose, opposite of --verbose. Overrides the Verbose flag in fink.conf.

-V, --version - display version information.

-v, --verbose - causes fink to be more verbose, opposite of --quiet. Overrides the Verbose field in fink.conf.

-y, --yes - assume default answer for all interactive questions.

-K, --keep-root-dir - Causes fink not to delete the root-[name]-[version]-[revision] directory in the Buildpath after building a package. Corresponds to the KeepRootDir field in fink.conf.

-k, --keep-build-dir - Causes fink not to delete the [name]-[version]-[revision] directory in the Buildpath after building a package. Corresponds to the KeepBuildDir field in fink.conf.

-b, --use-binary-dist - download pre-compiled packages from the binary distribution if available (e.g. to reduce compile time or disk usage). Note that this mode instructs fink to download the version it wants if that version is available for download; it does not cause fink to choose a version based on its binary availability. Corresponds to the UseBinaryDist flag in fink.conf.

--no-use-binary-dist - Don't use pre-compiled binary packages from the binary distribution, opposite of the --use-binary-dist flag. This is the default unless overridden by setting UseBinaryDist: true in the fink.conf configuration file.

--build-as-nobody - Drop to a non-root user when performing the unpack, patch, compile, and install phases. Note that packages built with this option may be non-functional. You should use this mode for package development and debugging only.

-m, --maintainer - (fink-0.25 and later) Perform actions useful to package maintainers: run validation on the .info file before building and on the .deb after building a package; turn certain build-time warnings into fatal errors; (fink-0.26 and later) run the test suites as specified in the field. This sets --tests and --validate to on.

--tests[=on|off|warn] - (fink-0.26.0 and later) Causes InfoTest fields to be activated and test suites specified via TestScript to be executed (see the Fink Packaging Manual). If no argument is given to this option or if the argument is on then failures in test suites will be considered fatal errors during builds. If the argument is warn then failures will be treated as warnings.

--validate[=on|off|warn] - Causes packages to be validated during a build. If no argument is given to this option or if the argument is on then validation failures will be considered fatal errors during builds. If the argument is warn then failures will be treated as warnings.

-l, --log-output - Save a copy of the terminal output during each package building process. By default, the file is stored in /tmp/fink-build-log_[name]-[version]-[revision]_[date]-[time] but one can use the --logfile flag to specify an alternate filename.

--no-log-output - Don't save a copy of the output during package-building, opposite of the --log-output flag. This is the default.

--logfile=filename - Save package build logs to the file filename instead of the default file (see the --log-output flag, which is implicitly set by the --logfile flag). You can use percent-expansion codes to include specific package information automatically. A complete list of percent-expanions is available in the Fink Packaging Manual; some common percent-expansions are:

-t, --trees=expr - Consider only packages in trees matching expr. The format of expr is a comma-delimited list of tree specifica- tions. Trees listed in fink.conf are compared against expr. Only those which match at least one tree specification are considered by fink, in the order of the first specifications which they match. If no --trees option is used, all trees listed in fink.conf are included in order. A tree specification may contain a slash (/) character, in which case it requires an exact match with a tree. Otherwise, it matches against the first path-element of a tree. For example, --trees=unstable/main would match only the unstable/main tree, while --trees=unstable would match both unstable/main and unstable/crypto. There exist magic tree specifications which can be included in expr:

Exclusion of (or failure to include) these magic trees is currently only supported for operations which do not install or remove packages.

-T, --exclude-trees=expr Consider only packages in trees not matching expr. The syntax of expr is the same as for --trees, including the magic tree specifications. However, matching trees are here excluded rather than included. Note that trees matching both --trees and --exclude-trees are excluded.

Examples of --trees and --exclude-trees:

Most of these options are self-explanatory. Many can also be set in the Fink configuration file (fink.conf) if you want to set them permanently and not just for that invocation of fink.

6.3 install

Der install-Befehl wird verwendet, um Pakete zu installieren. Es lädt, konfiguriert, erstellt und installiert die Pakete, die Sie angeben. Es installiert auch vorausgesetzte Pakete automatisch, fragt Sie aber davor nach einer Bestätigung. Beispiel:

fink install nedit

Reading package info...
Information about 131 packages read.
The following additional package will be installed:
 lesstif
Do you want to continue? [Y/n]

Use of the --use-binary-dist option with fink install can speed the build process for complicated packages by quite a lot.

Aliases für den Befehl install: update, enable, activate, use (die meisten aus historischen Gründen).

6.4 remove

Der remove-Befehl entfernt Pakete von Ihrem System, wenn Sie 'dpkg --remove' aufrufen. Die aktuelle Implementation hat einige Schwachstellen: es überprüft nicht die Abhängigkeiten selbst, sondern überlässt dies dem dpkg-Tool (allerdings sollte das kein Problem darstellen).

Der remove-Befehl entfernt nur die eigentlichen Dateien, lässt aber die .deb-Datei der komprimierten Pakete unberührt. Das bedeutet, dass Sie die Pakete später wieder installieren können, ohne diese neu kompilieren zu müssen. Wenn Sie den Plattenplatz benötigen, können Sie die .deb-Datei vom /sw/fink/dists-Baum löschen.

These flags can be used with the fink remove command

-h,--help             - Show the options which are available.
-r,--recursive        - Also remove packages that depend on the package(s) to
                        be removed (i.e. overcome the above-mentioned flaw).

Aliases: disable, deactivate, unuse, delete.

6.5 purge

The purge command purges packages from the system. This is the same as the remove command except that it removes configuration files as well.

This command takes the:

-h,--help
-r,--recursive

options.

6.6 update-all

This command updates all installed packages to the latest version. It does not need a package list, so you just type:

fink update-all

--use-binary-dist is also useful with this command.

6.7 list

Dieser Befehl erstellt eine Liste aller verfügbarer Pakete, mit dem Stand der Installation, die aktuellste Version und eine kurze Beschreibung. Wenn Sie den Befehl ohne Parameter aufrufen, listet fink alle verfügbaren Pakete auf. Sie können auch einen Namen oder eine Shell-Strukur (pattern) übergeben, und fink wird alle passenden Pakete auflisten.

Die erste Spalte zeigt den Installationszustand mit den folgenden Bedeutungen:

    nicht installiert
 i   aktuellste Version ist installiert
(i)  installiert, es ist aber eine aktuellere Version verfügbar
 p  a virtual package provided by a package that is installed

Es gibt auch einige Parameter (flags) für den fink list-Befehl

-h,--help
	  Zeigt die verfügbaren Optionen.
-t,--tab
	  Gibt die Liste in einem durch Tabs getrennten Format aus,
	  was nützlich ist, wenn Sie die Ausgabe durch ein Skript
	  verarbeiten lassen wollen.
-i,--installed
	  Zeigt nur die Pakete, die aktuell installiert sind.
-o,--outdated
	  Zeigt nur die Pakete, die veraltet sind.
-u,--uptodate
	  Zeigt nur die Pakete, die up to date sind.
-n,--notinstalled
	  Zeigt die Pakete, die nicht installiert sind.
-s expr,--section=expr
	  Zeigt nur die Pakete in den Rubriken, die auf den
	  regulären Ausdruck passen.
-m expr,--maintainer=expr
          Show only packages with the maintainer  matching the
          regular expression expr.
-w=xyz,--width=xyz
	  Stellt die Breite der dann so formatierten Ausgabe ein.
	  xyz ist entweder ein numerischer Wert oder auto.
	  auto setzt die Breite auf die Breite des Terminalfensters.
	  Standard ist auto.

Einige Anwendungsbeispiele:

fink list                 - listet alle Packete auf.
fink list bash            - überprüft ob bash in welcher version verfübar ist.
fink list --tab --outdated | cut -f 2 
                          - listet alle die Pakete auf, die veraltet sind.
fink list --section=kde   - listet alle Pakete in der kde-Rubrik auf.
fink list --maintainer=fink-devel
                          - list the packages with no maintainer
fink --trees=unstable list --maintainer=fink-devel
                          - list the packages with no maintainer, but only in the unstable tree.
fink list "gnome*"        - listet alle die Pakete auf, die mit 'gnome' beginnen.

Die Anführungsstriche im letzten Beispiel sind notwendig, um die Shell davon abzuhalten, die Struktur selber zu interpretieren.

6.8 apropos

Dieser Befehl verhält sich fast identisch wie fink list. Der größte merkliche Unterschied ist, dass fink apropos auch die Paketbeschreibungen durchsucht, um Pakete zu finden. Der zweite Unterschied ist, dass der Suchstring angegeben werden muss und nicht optional ist.

fink apropos irc          - listet alle Pakete auf, in denen 'irc' im Namen oder
                            in der Beschreibung vorkommt.
fink apropos -s=kde irc   - wie oben aber auf die kde-Rubrik beschränkt.

6.9 describe

Dieser Befehl gibt eine Beschreibung für das Paket an, welches Sie per Kommandozeile angeben. Beachten Sie, dass nur ein kleiner Teil der Pakete zur Zeit eine Beschreibung hat.

Aliases: desc, description, info

6.10 plugins

List the (optional) plugins available to the fink program. Currently lists the notification mechanisms and the source-tarball checksum algorithms.

6.11 fetch

Lädt die angegebenen Pakete herunter, installiert sie aber nicht. Dieser Befehl lädt die Tarball-Dateien, sogar wenn Sie zuvor heruntergeladen wurden.

The following flags can be used with the fetch command:

-h,--help		Show the options which are available.
-i,--ignore-restrictive	Do not fetch packages that are "License: Restrictive".
                      	Useful for mirrors, because some restrictive packages
                      	do not allow source mirroring.
-d,--dry-run		Just display information about the file(s) that would
			be downloaded for the package(s) to be fetched; do not
			actually download anything.
-r,--recursive		Also fetch packages that are dependencies of the
			package(s) to be fetched.

6.12 fetch-all

Lädt alle Quelldateien herunter. Wie fetch lädt es die Tarball-Dateien auch herunter, sollten sie zuvor schon heruntergeladen worden sein.

These flags can be used with the fink fetch-all command:

-h,--help
-i,--ignore-restrictive
-d,--dry-run

6.13 fetch-missing

Lädt all fehlenden Quelldateien herunter. Dieser Befehl lädt nur die Dateien heruntern, die nicht auf dem Computer vorhanden sind.

These flags can be used with the fink fetch-missing command:

-h,--help
-i,--ignore-restrictive
-d,--dry-run

6.14 build

Erstellt ein Paket, aber installiert es nicht. Wie gewöhnlich werden die Quell-Tarballs heruntergeladen, wenn Sie nicht gefunden werden können. Das Resultat des Befehls ist ein installierbares -deb-Paket, welches Sie später schnell mit dem install-Befehl installieren können. Dieser Befehl wird nichts tun, wenn die .deb-Datei bereits existiert. Beachten Sie, dass die vorausgesetzten Pakete dennoch installiert und nicht nur erstellt werden.

6.15 rebuild

Erstellt ein Paket (wie der build-Befehl), ignoriert und überschreibt aber die vorhandene .deb-Datei. Wenn Sie ein Paket installieren, wird die neu erstellte .deb-Datei auch via dpkg auf Ihr System installiert. Sehr nützlich während der Paketentwicklung.

The --use-binary-dist option is applicable here.

6.16 reinstall

Wie der Befehl install installiert reinstall ein Paket. Allerdings tut es dies via dpkg, auch wenn es schon installiert ist. Sie können diesen Befehl nutzen, wenn Sie Paketdateien aus Versehen gelöscht haben, und Sie die Standardeinstellungen zurück haben wollen.

6.17 configure

Führt den Konfigurationsprozess nochmal aus. So können Sie Ihre Mirror-Server und Proxy-Einstellungen unter anderen ändern.

New in fink-0.26.0: This command will also let you turn on the unstable trees if desired.

6.18 selfupdate

Dieser Befehl automatisiert die Aktualisierung von Fink auf eine neues Release. Es überprüft die Fink-Webseite, um zu sehen, ob eine neue Version verfügbar ist. Wenn dies so ist, lädt es die Paketbeschreibungen und Updates der core-Pakete einschließlich von fink selber. Dieser Befehl kann auf reguläre Releases aktualisieren, es kann aber auch Ihren /sw/fink/dists-Verzeichnisbaum für direktes CVS einrichten. Das bedeutet, dass Sie dann auf die aktuellsten Versionen aller Pakete zugreifen können.

If the --use-binary-dist option is enabled, the list of available packages in the binary distribution is also updated.

6.19 selfupdate-rsync

Use this command to make fink selfupdate use rsync to update its package list.

This is the recommended way to update Fink when building from source.

Note: rsync updates only update the active trees (e.g. if unstable isn't turned on in fink.conf the list of unstable packages won't be updated.

6.20 selfupdate-cvs

Use this command to make fink selfupdate use CVS access to update its package list.

CVS updating is deprecated, except for developers and those people who are behind firewalls that disallow rsync.

6.21 index

Erneuert den Paket-Zwischenspeicher (Cache). Sie brauchen diesen Befehl normalerweise nicht ausführen, da fink automatisch kontrolliert, wann es aktualisert werden muss.

6.22 validate

Dieser Befehl führt verschiedene Kontrollen über die .info- und .deb-Dateien durch. Paket-Maintainer sollten ihre Paketbeschreibungen und die korrespondierenden Pakete vor dem Hochladen damit überprüfen.

The following optional options may be used:

-h,--help            - Show the options which are available.
-p,--prefix          - Simulate an alternate Fink basepath prefix (%p) within
                      the files being validated.
--pedantic, --no-pedantic
                     - Control the display of nitpicky formatting warnings.
                      --pedantic is the default.

Aliases: check

6.23 scanpackages

Updates the apt-get database of debs; defaults to updating all of the trees, but may be restricted to a set of one or more trees given as arguments.

6.24 cleanup

Removes obsolete and temporary files. This can reclaim large amounts of disk space. One or more modes may be specified:

--debs               - Delete .deb files (compiled binary package archives)
                       corresponding to versions of packages that are neither
                       described by a package description (.info) file in the
                       currently-active trees nor presently installed.
--sources,--srcs     - Delete sources (tarballs, etc.) that are not used by
                       any package description (.info) file in the currently-
                       active trees.
--buildlocks, --bl   - Delete stale buildlock packages.
--dpkg-status        - Remove entries for packages that are not installed from
                       the dpkg "status" database.
--obsolete-packages  - Attempt to uninstall all installed packges that are
                       obsolete. (new in fink-0.26.0)
--all                - All of the above modes. (new in fink-0.26.0)

If no mode is specified, --debs --sources is the default action.

In addition, the following options may be used:

-k,--keep-src        - Move old source files to /sw/src/old/ instead of deleting them.
-d,--dry-run         - Print the names of the files that would be deleted, but
                       do not actually delete them.
-h,--help            - Show the modes and options which are available.

6.25 dumpinfo

Only available in fink newer than version 0.21.0

Zeigt wie fink die Teile einer .info-Datei analysiert. Verschiedene Felder und Prozentangaben werden gemäß der folgenden Optionen angezeigt:

-h, --help           - Zeigt die verfügbaren Optionen an.
-a, --all            - Zeigt alle Felder der Paketbeschreibungen.
                       Das ist der Standardmodus wenn keine --field
                       oder --percent-Parameter angegeben sind.
-f fieldname,        - Zeigt die angegebenen Feldnamen,
  --field=fieldname    in der gelisteten Reihenfolge.
-p key,              - Zeigt die angegebenen Prozentschlüssel
   --percent=key       in der gelisteten Reihenfolge.
      

6.26 show-deps

Only available in fink-0.23-6 and later.

Displays a human-readable list of the compile-time (build) and run- time (installation) dependencies of the listed package(s).