From cde4b583e0be0dcfde7bb25abd7c015f48711166 Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Sun, 5 Dec 1999 17:59:21 +0000 Subject: [PATCH] dpkg-divert manpage added --- ChangeLog | 2 +- scripts/Makefile.in | 3 +- scripts/dpkg-divert.8 | 83 ++++++++++++++++++++++++++++++++++++++++++ scripts/dpkg-divert.pl | 47 +++++++++++++++--------- 4 files changed, 115 insertions(+), 20 deletions(-) create mode 100644 scripts/dpkg-divert.8 diff --git a/ChangeLog b/ChangeLog index 42b9a567..8876cff4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ Sun Dec 5 18:09:36 CET 1999 Wichert Akkerman * Add manpages from Josip Rodin for - cleanup-info + cleanup-info and dpkg-divert * New dpkg-scansources from Roderick to allow trailing blanks on lines * Correct generation of manual-version diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 0ac7cddd..a9d1c29e 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -14,7 +14,8 @@ SBIN_SCRIPTS = update-rc.d update-alternatives install-info \ MAN1PAGES = dpkg-name.1 dpkg-source.1 822-date.1 dpkg-architecture.1 MAN8PAGES = update-rc.d.8 update-alternatives.8 install-info.8 \ - cleanup-info.8 dpkg-scanpackages.8 dpkg-scansources.8 + cleanup-info.8 dpkg-scanpackages.8 dpkg-scansources.8 \ + dpkg-divert.8 CHANGELOG_PARSERS = cl-debian diff --git a/scripts/dpkg-divert.8 b/scripts/dpkg-divert.8 new file mode 100644 index 00000000..30f282d1 --- /dev/null +++ b/scripts/dpkg-divert.8 @@ -0,0 +1,83 @@ +.TH DPKG-DIVERT 8 "December 1999" "Debian Project" "dpkg utilities" +.SH NAME +dpkg-divert -- override a package's version of a file +.SH SYNOPSIS +.B dpkg-divert +[options] [--add] +.I +.br +.B dpkg-divert +[options] --remove +.I +.br +.B dpkg-divert +[options] +--list +.I +.SH DESCRIPTION +File `diversions' are a way of forcing dpkg not to install a file into its +location, but to a `diverted' location. Diversions can be used through the +package maintainer scripts to move a file away when it causes a conflict. +System administrators can also use it to override some package's +configuration file, or whenever some files (which aren't marked as +'conffiles') need to be preserved by dpkg, when installing a newer version +of a package which contains those files. +.sp +.B dpkg-divert +is the utility used to set up and update the list of diversions. It +functions in three basic modes - adding, removing, and listing diversions. +The options are --add, --remove, and --list, respectively. Other options +(listed below) may also be specified. +.SH OPTIONS +.TP +.I --admindir +Set the dpkg data directory to (default: /var/lib/dpkg). +.TP +.I --divert + is the name used by other packages' versions. +.TP +.I --help +Output the version and the short usage instructions, and exit successfully. +.TP +.I --local +Specifies that all packages' versions are diverted. +.TP +.I --package + is the name of a package whose copy of will not be diverted. +.TP +.I --quiet +Quiet mode, i.e. no verbose output. +.TP +.I --rename +Actually move the file aside (or back). dpkg-divert will abort operation +in case the destination file already exists. +.TP +.I --test +Test mode, i.e. don't actually perform any changes, just demonstrate. +.TP +.I --version +Output program name and version and exit successfully. +.SH NOTES +When adding, default is --local and --divert .distrib. +When removing, --package or --local and --divert must match if specified. +.br +Directories can't be diverted with dpkg-divert. +.SH FILES +.TP +.I /var/lib/dpkg/diversions +File which contains the current list of diversions of the system. It is +located in the dpkg administration directory, along with other files +important to dpkg, such as `status' or `available'. +.br +Note: dpkg-divert preserves the old copy of this file, with extension +"-old", before replacing it with the new one. +.SH SEE ALSO +.BR dpkg (8). +.sp +Please read the Debian Packaging Manual, section 11., "Diversions - +overriding a package's version of a file" for more information. +.SH AUTHOR +Copyright (C) 1995 Ian Jackson. +.sp +This is free software; see the GNU General Public Licence +version 2 or later for copying conditions. There is NO warranty. diff --git a/scripts/dpkg-divert.pl b/scripts/dpkg-divert.pl index bc5de590..80edae54 100755 --- a/scripts/dpkg-divert.pl +++ b/scripts/dpkg-divert.pl @@ -5,24 +5,33 @@ sub ENOENT { 2; } # Sorry about this, but the errno-part of POSIX.pm isn't in perl-*-base $version= '1.0.11'; # This line modified by Makefile -sub usageversion { - print(STDERR < - dpkg-divert [options] --remove - dpkg-divert [options] --list [] +sub usage { + &showversion; + print(STDOUT < | --local --divert --rename - --quiet --test --help|--version --admindir +Usage: - is the name of a package whose copy of will not be diverted. - is the name used by other packages' versions. ---local specifies that all packages' versions are diverted. ---rename causes dpkg-divert to actually move the file aside (or back). + dpkg-divert [options] [--add] - add a diversion + dpkg-divert [options] --remove - remove the diversion + dpkg-divert [options] --list [] - show file diversions + +Options: + --package name of the package whose copy of + will not be diverted. + --local all packages' versions are diverted. + --divert the name used by other packages' versions. + --rename actually move the file aside (or back). + --quiet quiet operation, minimal output + --test don't do anything, just demonstrate + --help print this help screen and exit + --version output version and exit + --admindir set the directory with the diversions file When adding, default is --local and --divert .distrib. When removing, --package or --local and --divert must match if specified. @@ -48,8 +57,10 @@ while (@ARGV) { last if m/^--$/; if (!m/^-/) { unshift(@ARGV,$_); last; - } elsif (m/^--(help|version)$/) { - &usageversion; exit(0); + } elsif (m/^--help$/) { + &usage; exit(0); + } elsif (m/^--version$/) { + &showversion; exit(0); } elsif (m/^--test$/) { $testmode= 1; } elsif (m/^--rename$/) { @@ -232,5 +243,5 @@ sub infoa { &infol($file,$divertto,$package); } sub infon { &infol($contest[$i],$altname[$i],$package[$i]); } sub quit { print STDERR "dpkg-divert: @_\n"; exit(2); } -sub badusage { print STDERR "dpkg-divert: @_\n\n"; &usageversion; exit(2); } +sub badusage { print STDERR "dpkg-divert: @_\n\n"; print("You need --help.\n"); exit(2); } sub badfmt { &quit("internal error: $admindir/diversions corrupt: $_[0]"); } -- 2.39.5