From: Ian Jackson Date: Mon, 10 Jun 1996 02:52:01 +0000 (+0100) Subject: dpkg (1.2.4); priority=MEDIUM X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f48836f8589e17fabed7bddcc402422b394e1820;p=dpkg dpkg (1.2.4); priority=MEDIUM * New dpkg-name from Erick (__.deb convention). * Disappeared packages can't own conffiles any more ! (Bug#3214.) * install-info creates Miscellaneous sections with a newline following the heading. (Bug#3218.) * cleanup-info script installed in /usr/sbin; called as appropriate by postinst. Thanks to Kim-Minh Kaplan. (Bug#3125.) * Allow superseded Essential packages to be purged after they've been removed (clear the Essential flag on removal, and ignore it on packages that are in stat_configfiles). * dselect disk methods understand `y' as well as `yes' for using development tree. * dselect doesn't make packages appear as `new' again if update of available packages fails. * dselect places method selection cursor over option last selected. * dpkg-scanpackages doesn't die when repeated packages are found. * dpkg-scanpackages allows many old maintainers (`//'-separated). * `Version' field is now mandatory (some operations already wouldn't work right anyway if it was't there). * update-rc.d(8) now says you must remove the script. (Bug#3215.) * dpkg --force-help says that --force-overwrite is on by default. * dpkg-deb manpage rewritten. * debian.README (= /usr/doc/copyright/dpkg) edited slightly. * Some database parsing grunge removed (pdb_preferversion, &c). * Source tree doc/sgml contains some embryonic manuals. * Leftover files in lib directory in source tree deleted. -- Ian Jackson Mon, 10 Jun 1996 03:52:01 +0100 --- diff --git a/debian.Changelog b/debian.Changelog index 4d81e6da..1ab52334 100644 --- a/debian.Changelog +++ b/debian.Changelog @@ -1,3 +1,38 @@ +dpkg (1.2.4); priority=MEDIUM + + * New dpkg-name from Erick (__.deb convention). + * Disappeared packages can't own conffiles any more ! (Bug#3214.) + * install-info creates Miscellaneous sections with a newline + following the heading. (Bug#3218.) + * cleanup-info script installed in /usr/sbin; called as appropriate + by postinst. Thanks to Kim-Minh Kaplan. (Bug#3125.) + * Allow superseded Essential packages to be purged after they've + been removed (clear the Essential flag on removal, and ignore it + on packages that are in stat_configfiles). + + * dselect disk methods understand `y' as well as `yes' for using + development tree. + * dselect doesn't make packages appear as `new' again if update + of available packages fails. + * dselect places method selection cursor over option last selected. + + * dpkg-scanpackages doesn't die when repeated packages are found. + * dpkg-scanpackages allows many old maintainers (`//'-separated). + + * `Version' field is now mandatory (some operations already + wouldn't work right anyway if it was't there). + + * update-rc.d(8) now says you must remove the script. (Bug#3215.) + * dpkg --force-help says that --force-overwrite is on by default. + * dpkg-deb manpage rewritten. + * debian.README (= /usr/doc/copyright/dpkg) edited slightly. + + * Some database parsing grunge removed (pdb_preferversion, &c). + * Source tree doc/sgml contains some embryonic manuals. + * Leftover files in lib directory in source tree deleted. + + -- Ian Jackson Mon, 10 Jun 1996 03:52:01 +0100 + dpkg (1.2.3); priority=HIGH * install-info doesn't replicate section headings (Bug#3125, #2973). diff --git a/debian.README b/debian.README index 027735c9..d72471bf 100644 --- a/debian.README +++ b/debian.README @@ -1,17 +1,17 @@ -This is Debian/GNU Linux's package maintenance system. +This is Debian Linux's package maintenance system. For an example of how to construct packages see the `hello' package which is part of Debian. -[ Note for users of GCC 2.7.0: you must compile at least - `dselect/main.cc' with only -O2, due to a bug in GCC. ] - Copyright (C) 1994,1995,1996 Ian Jackson +Copyright (C) 1995,1996 Erick Branderhorst +Copyright (C) 1996 Kim-Minh Kaplan Copyright (C) 1995 Bruce Perens Copyright (C) 1994 Carl Streeter Copyright (C) 1994 Matt Welsh Copyright (C) 1994 Ian Murdock -Copyright (C) 1995,1996 Erick Branderhorst +Parts written by Colin Plumb and Branko Lankester in 1993. + This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff --git a/debian.postinst b/debian.postinst index aa1fd3aa..e5ef4d2d 100755 --- a/debian.postinst +++ b/debian.postinst @@ -21,56 +21,97 @@ them by hand later. END } -if [ "x$1" = xconfigure ]; then case "$2" in 0.* | 1.0.* | 1.1.0 | 1.1.0[^0-9]* | '' ) - for f in 0 1 2 3 4 5 6 - do - cd /etc/rc$f.d - for g in K[0-9][0-9]* +if [ "x$1" = xconfigure ]; then + case "$2" in + 0.* | 1.0.* | 1.1.0 | 1.1.0[^0-9]* | '' ) + for f in 0 1 2 3 4 5 6 do - if [ -n "`echo \"x$g\" | tr -d 0-9A-Za-z_-`" ] - then - continue - fi - h="`echo $g | sed -e 's/^K/S/'`" - if ! [ -L $h -a -L $g ] \ - || [ "`ls -Li $g 2>/dev/null | awk '{print $1}'`" != \ - "`ls -Li $h 2>/dev/null | awk '{print $1}'`" ] - then - continue - fi - removes="$removes rc$f.d/$g" + cd /etc/rc$f.d + for g in K[0-9][0-9]* + do + if [ -n "`echo \"x$g\" | tr -d 0-9A-Za-z_-`" ] + then + continue + fi + h="`echo $g | sed -e 's/^K/S/'`" + if ! [ -L $h -a -L $g ] \ + || [ "`ls -Li $g 2>/dev/null | awk '{print $1}'`" != \ + "`ls -Li $h 2>/dev/null | awk '{print $1}'`" ] + then + continue + fi + removes="$removes rc$f.d/$g" + done done - done - if [ -n "$removes" ] - then - cd /etc - dupdaemonhelp - while [ -n "$removes" ] - do - echo -n 'y=remove, n=leave, l=list, h=help ? ' + if [ -n "$removes" ] + then + cd /etc + dupdaemonhelp + while [ -n "$removes" ] + do + echo -n 'y=remove, n=leave, l=list, h=help ? ' + read response + case "$response" in + [Yy]*) + echo "Removing duplicate K links ..." + rm -v $removes + removes="" + ;; + [Nn]*) + echo -e "OK, leaving them.\n" + removes="" + ;; + [Ll]*) + echo + echo $removes + echo + ;; + [Hh]*) + dupdaemonhelp + ;; + esac + done + fi + ;; + 1.1.6 | 1.1.6elf | 1.2.[0123] | 1.2.[0123]elf ) + response='' + while [ -z "$response" ]; do + echo -n ' +The version of dpkg you'\''re upgrading from had a problem with the +install-info program used to maintain the /usr/info/dir file. It may +have corrupted the file, for example by placing new entries for the +menu in it before the `* Menu'\'' line (thus making them ineffective) or +by creating several identical sections. + +I can try to sort these problems out, but beware that this process is +not guaranteed not to mess up a dir file which has things that look +like menu entries in the introductory paragraphs. The distributed dir +files do not do this, so if you haven'\''t edited /usr/info/dir it'\''s +almost certainly safe to say `yes'\'' to the next question. + +If you say `no'\'' you may wish to check and/or edit /usr/info/dir yourself. + +Try to check/repair /usr/info/dir automatically ? [y/n] ' read response case "$response" in - [Yy]*) - echo "Removing duplicate K links ..." - rm -v $removes - removes="" - ;; - [Nn]*) - echo -e "OK, leaving them.\n" - removes="" - ;; - [Ll]*) - echo - echo $removes - echo - ;; - [Hh]*) - dupdaemonhelp - ;; + [Yy]* | '') response=yes ;; + [Nn]*) response=no ;; + *) response='' ;; esac done - fi -;; esac ; fi + if [ "$response" = yes ]; then + echo " +Checking/repairing /usr/info/dir ..." + cleanup-info --unsafe + echo + else + echo " +OK. +" + fi + ;; + esac +fi cd /var/lib/dpkg if ! test -f diversions diff --git a/debian.rules b/debian.rules index 95a1efcd..849bcc6b 100755 --- a/debian.rules +++ b/debian.rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f package=dpkg -version=1.2.3 +version=1.2.4 archi=$(shell dpkg --print-architecture) DIR:=$(shell pwd) diff --git a/doc/sgml/programmer.sgml b/doc/sgml/programmer.sgml new file mode 100644 index 00000000..f6130826 --- /dev/null +++ b/doc/sgml/programmer.sgml @@ -0,0 +1,1089 @@ + + + + +
+ +<tt/dpkg/ Programmers' manual +<author>Ian Jackson, <tt/ijackson@gnu.ai.mit.edu/ +<date>1st June 1996 +<abstract> +This manual describes the technical aspects of creating Debian binary +packages. It describes how to use utilities like <tt/install-info/. +It also documents the interface between <tt/dselect/ and its access +method scripts. It does not deal with the Debian Project policy +requirements, and it assumes familiarity with <tt/dpkg/'s functions +from the system administrator's perspective. +</abstract> + +<toc> + +<!-- Describes the technical interface between a package and dpkg. +Control file fields and their syntax and semantics. How to use +update-rc.d, diversions, update-alternatives, install-info in a +package. How to safely put shared libraries in a package. Details of +dpkg's handling of individual files. Semantics of virtual packages. +Sections on when to use which feature (eg Replaces +vs. Replaces/Conflicts vs. update-alternatives vs. diversions) +Cross-references to the policy document (see below) where appropriate. +Description of the interface between dselect and its access methods. +Hints on where to start with a new package (ie, the hello package). +--> + +<sect>Scope of this manual + +This manual describes the technical aspects of creating Debian binary +packages (<tt/.deb/ files.). It documents the behaviour of the +package management programs <tt/dpkg/, <tt/dselect/ et al and and the +way they interact with packages. +<p> + +It documents the utility programs which are provided with <tt/dpkg/ +for managing various system configuration and similar issues (such as +<tt/update-rc.d/ and <tt/install-info/. +<p> + +It also documents the interaction between <tt/dselect/'s core and the +access method scripts it uses to actually install the selected +packages, and describes how to create a new access method. +<p> + +It does <em/not/ describe the policy requirements imposed on Debian +packages, such as the permissions on files and directories, +documentation requirements, upload procedure, and so on. You should +see the Debian packaging policy manual for these details. (Many of +them will probably turn out to be helpful even if you don't plan to +upload your package and make it available as part of the +distribution.) +<p> + +It is assumed that the reader is reasonably familiar with the +<tt/dpkg/ System Administrators' manual. +<p> + +The Debian version of the FSF's GNU hello program is provided as an +example for people wishing to create Debian packages. +<p> + +<em>Note that this document is not yet complete !</em> + +<sect>Binary package format + +<tt/dpkg/ is a suite of programs for creating binary package files and +installing and removing them on Unix systems.<footnote><tt/dpkg/ is +targetted primarily at Debian Linux, but may work or be ported to +other systems.</footnote> +<p> + +The binary package files' contents may be architecture-independent, +but they usually aren't. They aren't designed for the management of +program source code (though examples of this are provided as part of +some packages by way of documentation). +<p> + +The binary package has two main sections: the first part consists of +various control information files and scripts used by <tt/dpkg/ when +installing and removing, and the second part is an archive (currently +a <tt/tar/ archive) containing files and directories to be installed. +In the future binary packages may also contain other components, such +as checksums and digital signatures. +<p> + +The control information files are described in <ref id="controlarea" +name="the control information section">. + +<sect1>Creating package files -- <tt/dpkg-deb/ + +All manipulation of binary package files is done by <tt/dpkg-deb/; +it's the only program that has knowledge of the format. +(<tt/dpkg-deb/ may be invoked by calling <tt/dpkg/, as <tt/dpkg/ will +spot that the options requested are appropriate to <tt/dpkg-deb/ and +invoke that instead with the same arguments.) +<p> + +In order to create a binary package you must make a directory tree +which contains all the files and directories you want to have in the +filesystem data part of the package. +<p> + +They should have the locations (relative to the root of the directory +tree you're constructing) ownerships and permissions which you want +them to have on the system when they are installed. +<p> + +With current versions of <tt/dpkg/ the uid/username and gid/groupname +mappings for the users and groups being used should be the same on the +system where the package is built and the one where it is installed. +<p> + +You need to add one special directory to the root of the miniature +filesystem tree you're creating: <tt/DEBIAN/. It should contain the +control information files, notably the main package control file (see +<ref id="controlarea" name="later"> for details of what files to put +here. +<p> + +The <tt/DEBIAN/ directory will not appear in the filesystem archive of +the package, and so won't be installed by <tt/dpkg/ when the package +is installed. +<p> + +When you've prepared the package, you should invoke:<!--var--> +<tscreen><verb> +dpkg --build <it/directory/ +</verb></tscreen> +<p> + +This will build the package in <var/directory/<tt/.deb/. +(<tt/dpkg/ knows that <tt/--build/ is a <tt/dpkg-deb/ option, so it +invokes <tt/dpkg-deb/ with the same arguments to build the package.) +<p> + +See the manpage for <tt/dpkg-deb/ for details of how to examine the +contents of this newly-created file. You may find the output of +following commands enlightening: +<tscreen><verb> +dpkg-deb --info <var/filename/<tt/.deb/ +dpkg-deb --contents <var/filename/<tt/.deb/ +</verb></tscreen> + +<sect1>Package control information files<label id="controlarea"> + +The control information portion of a binary package is a collection of +files with names known to <tt/dpkg/. It will treat the contents of +these files specially - some of them contain information used by +<tt/dpkg/ when installing or removing the package; others are scripts +which the package maintainer wants <tt/dpkg/ to run. +<p> + +It is possible to put other files in the package control area, but +this is not generally a good idea (though they will largely be +ignored). +<p> + +Here is a brief list of the control info files supported by <tt/dpkg/ +and a summary of what they're used for. + +<descrip> + +<tag/<tt/control// + +This is the key description file used by <tt/dpkg/. It specifies the +package's name and version, gives its description for the user, states +its relationships with other packages, and so forth. Its format is +described in more detail in <ref id="controlfile" +name="its own section">. + +<tag><tt/postinst/, <tt/preinst/, <tt/postrm/, <tt/prerm/</tag> + +These are exectuable files (usually scripts) which <tt/dpkg/ runs +during installation, upgrade and removal of packages. They allow the +package to deal with matters which are particular to that package or +require more complicated processing than that provided by <tt/dpkg/. +Details of when and how they are called are in <ref +id="maintainerscripts">. + +<tag/<tt/conffiles// + +This file contains a list of configuration files which are to be +handled automatically by <tt/dpkg/. Details of this mechanism are in +<ref id="conffiles" name="a separate section">. Note that not all a +package's configuration files should be listed here. + +</descrip> + +<sect1>The main control information file: <tt/control/<label id="controlfile"> + +The most important control information file used by <tt/dpkg/ when it +installs a package is <tt/control/. It contains all the package's +`vital statistics'. +<p> + +It is a series of fields and values; each field consists of a name, +followed by a colon and the value. It ends at the end of the line. +Horizontal whitespace (spaces and tabs) may occur before or after the +value and is ignored there; it is conventional to put a single space +after the colon. Many of the fields have a syntax where whitespace is +not significant. +<p> + +Some fields' values may span several lines; in this case each +continuation line <em/must/ start with a space or tab. Any trailing +spaces or tabs at the end of individual lines of a field value are +ignored. +<p> + +Field names are not case-sensitive, but it is usual to capitalise the +fields as shown below (usually using a form of mixed case). +<p> + +Blank lines, or lines consisting only of spaces and tabs, are not allowed. +<p> + + +Here is a list of the fields which are permitted in packages, together +with a description of the purposes and syntax of each and or a pointer +to further information if appropriate. +<p> + +It is important to note that there are several fields which are +optional as far as <tt/dpkg/ is concerned, but which must appear in +every Debian package, or whose omission may cause problems. When +writing the control file for a Debian package you <em/must/ read the +Debian policy manual in conjuction with the list below. + +<sect2>List of package control file fields +<p> + +<descrip> + +<tag/<tt/Package// + +The name of the package. Package names consist of the alphanumerics, +plus, minus and dot. They must be at least two characters and must +start with an alphanumeric. In current versions of dpkg they are sort +of case-sensitive; use lowercase package names unless the package +you're building (or referring to, in other fields) is already using +uppercase. +<p> + +This field is mandatory. + +<tag/<tt/Version// + +This lists the package's version number. See the section on version +numbers <ref id="versions" name="later"> for details. + +This field is mandatory. + +<tag/<tt/Architecture// + +This is the architecture string; it is a single word for the CPU +architecture, and <tt/dpkg/ will check it against its own compiled-in +value before it installs a package. The special value <tt/all/ +indicates that the package is architecture-independent. +<p> + +The value for this field can be obtained using +<tscreen><verb> +dpkg --print-architecture +</verb></tscreen> +This actually invokes +<tscreen><verb> +gcc --print-libgcc-file-name +</verb></tscreen> +and parses and decomposes the output and looks the CPU type from the +GCC configuration in a table in <tt/dpkg/. This is so that it will +work if you're cross-compiling. +<p> + +There is a separate option, <tt/--print-installation-architecture/, +for finding out what architecture <tt/dpkg/ is willing to install. +This information is also in the output of <tt/dpkg --version/. +<p> + +This field should appear in all packages, though <tt/dpkg/ doesn't +require it yet so that old packages can still be installed. + +<tag/<tt/Maintainer// + +The package maintainer's name and email address. The name should come +first, then the email address inside angle brackets <tt/<>/ (in +RFC822 format). +<p> + +If the maintainer's name contains a full stop then the whole field +will not work directly as an email address due to a misfeature in the +syntax for addresses; a program using this field as an address must +check for this and reverse the components if necessary (for example by +putting the name in round brackets or quotes, and perhaps moving it to +the end). + +This feature is optional as far as <tt/dpkg/ is concerned, but +<tt/dpkg-deb/ will warn if it is missing. + +<tag><tt/Depends/, <tt/Pre-Depends/, <tt/Recommends/, <tt/Suggests/ +<tt/Conflicts/, <tt/Provides/, <tt/Replaces/</tag> + +These fields describe the package's relationships with other packages. +Their syntax and semantics are described in the package relationships +section <ref id="depconoverwr" name="later">. + +<tag/<tt/Source// + +This field identifies the source package name, primarily for the +benefit of humans reading the control file rather than <tt/dpkg/. It +consists solely of the source package name; it may be omitted when the +source package has the same name as the binary package. + +This field is optional as far as <tt/dpkg/ is concerned. + +<tag/<tt/Description// + +This field contains a description of the package, in a special format. +<p> + +It is very important that you read the section <ref id="descriptions" +name="later"> on how to write a description. + +<tag/<tt/Essential// + +This is a boolean field. If set to <tt/yes/ then <tt/dpkg/ and +<tt/dselect/ will refuse to remove the package (though it can be +upgraded and/or replaced). The other possible value is <tt/no/, which +is the same as not having the field at all. +<p> + +This field is optional. + +<tag/<tt/Priority// + +This specifies the `priority' of the package; this represents how +important that it is that the user have it installed. +<p> + +This value isn't used by <tt/dpkg/, but only by <tt/dselect/ when it +sorts packages and selects defaults. See the <tt/dpkg/ System +Administrator's Manual for details of the values it can take, and the +Debian Policy Manual for the criteria for selecting the priority for a +Debian package. +<p> + +<tt/dpkg/ and <tt/dselect/ will only use the value from a <tt/.deb/ +file if they have no other information; a priority value listed in a +<tt/Packages/ file will always take precedence. This field is +optional as far as <tt/dpkg/ is concerned. + +<tag/<tt/Section// + +This specifies the `section' of the package, namely the application +area or group of packages which contain it. The value is a simple +string, usually from a set chosen by the distribution maintainers. +<p> + +The section isn't used at all except by <tt/dselect/, which only uses +it for sorting packages in the selection display and not even for +choosing defaults. +<p> + +Just as with <tt/Priority/, this field is optional as far as <tt/dpkg/ +is concerned, and the value from a package file is used only as a last +resort. + +</descrip> + +<sect2>List of other control fields + +There are several other fields which are used elsewhere by parts of +the system. These should not appear in package control files. + +<sect3>Status fields + +These fields appear in <tt/dpkg/'s internal status file; they are also +printed by <tt/dpkg --status/ and can be seen in <tt/dselect/ by +selecting the installed control info display. + +<p> + +<descrip> + +<tag/<tt/Status// + +This field in <tt/dpkg/'s status file records whether the user wants a +package installed, removed or left alone, whether it is broken +(requiring reinstallation) or not and what its current state on the +system is. Each of these pieces of information is a single word. + +<tag/<tt/Config-Version// + +If a package is not installed or not configured, this field in +<tt/dpkg/'s status file records the last version of the package which +was successfully configured. + +<tag/<tt/Conffiles// + +This field in <tt/dpkg/'s status file contains information about the +automatically-managed configuration files held by a package. Let me +emphasise that this field should <em/not/ appear in a package ! + +</descrip> + +<sect4><tt/Packages/ file (available package) fields + +These fields are found in <tt/Packages/ files (lists of packages +available for installation, which are generated by the distribution +maintainers and used principally by <tt/dselect/) and in <tt/dpkg/'s +database of available packages (which can be inspected using +<tt/dpkg --print-avail/ or by selecting the `available control +information' in <tt/dselect/. + +<p> + +<descrip> + +<tag><tt/Filename/, <tt/MSDOS-Filename/</tag> + +These fields in <tt/Packages/ files give the filename(s) of (the parts +of) a package in the distribution directories, relative to the root of +the Debian hierarchy. If the package has been split into several +parts the parts are all listed in order, separated by spaces. + +<tag><tt/Size/, <tt/MD5sum/</tag> + +These fields in <tt/Packages/ files give the size (in bytes, expressed +in decimal) and MD5 checksum of the file(s) which make(s) up a binary +package in the distribution. If the package is split into several +parts the values for the parts are listed in order, separated by +spaces. + +</descrip> + +<sect4>Obsolete fields + +These are still recognised by <tt/dpkg/ but should not appear anywhere +any more. + +<p><descrip> + +<tag><tt/Revision/, <tt/Package-Revision/, <tt/Package_Revision/</tag> + +The Debian revision part of the package version was at one point in a +separate control file field. This field went through several names. + +<tag/Recommended/ Old name for <tt/Recommends/. +<tag/Optional/ Old name for <tt/Suggests/. +<tag/Class/ Old name for <tt/Priority/. + +</descrip> + +<sect1>Version numbering<label id="versions"> + +Every package has a version number, in its <tt/Version/ control file +field. +<p> + +<tt/dpkg/ imposes an ordering on version numbers, so that it can tell +whether packages are being up- or downgraded and so that <tt/dselect/ +can tell whether a package it finds available is newer than the one +installed on the system. The version number format has the most +significant parts (as far as comparison is concerned) at the +beginning. +<p> + +The version number format is: +&lsqb<var/epoch/<tt/:/]<var/upstream-version/[<tt/-/<var/debian-revision/]. +<p> + +The three components here are: + +<descrip> + +<tag/<var/epoch// + +This is a single unsigned integer, which should usually be small. It +may be omitted, in which case it defaults to zero. If it is omitted +then the <var/upstream-version/ may not contain any colons. +<p> + +It is provided to allow mistakes in the version numbers of older +versions of a package, and also a package's previous version numbering +schemes, to be left behind. +<p> + +<tt/dpkg/ will not usually display the epoch unless it is essential +(non-zero, or if the <var/upstream-version/ contains a colon); +<tt/dselect/ does not display epochs at all in the main part of the +package selection display. + +<tag/<var/upstream-version// + +This is the main part of the version. It is usually version number of +the original (`upstream') package of which the <tt/.deb/ file has been +made, if this is applicable. Usually this will be in the same format +as that specified by the upstream author(s); however, it may need to +be reformatted to fit into <tt/dpkg/'s format and comparison scheme. +<p> + +The comparison behaviour of <tt/dpkg/ with respect to the +<var/upstream-version/ is described below. The <var/upstream-version/ +portion of the version number is mandatory. + +<tag/<var/debian-revision// + +This part of the version represents the version of the modifications +that were made to the package to make it a Debian binary package. It +is in the same format as the <var/upstream-version/ and <tt/dpkg/ +compares it in the same way. +<p> + +It is optional; if it isn't present then the <var/upstream-version/ +should not contain a hyphen. This format represents the case where a +piece of software was written specifically to be turned into a Debian +binary package, and so there is only one `debianization' of it and +therefore no version indication is require there. +<p> + +It is conventional to restart the <var/debian-revision/ at <tt/1/ each +time the <var/upstream-version/ is increased. +<p> + +<tt/dpkg/ will break the <var/upstream-version/ and +<var/debian-revision/ apart at the last hyphen in the string. The +absence of a <var/debian-revision/ compares earlier than the presence +of one (but note that the <var/debian-revision/ is the least +significant part of the version number). + +</descrip> + +The <var/upstream-version/ and <var/debian-revision/ parts are +compared by <tt/dpkg/ using the same algorithm: +<p> + +The strings are compared from left to right. +<p> + +First the initial part of each string consisting entirely of non-digit +characters is determined. These two parts (one of which may be empty) +are compared lexically. If a difference is found it is returned. The +lexical comparison is a comparison of ASCII values modified so that +all the letters sort earlier than all the non-letters. +<p> + +Then the initial part of the remainder of each string which consists +entirely of digit characters is determined. The numerical values of +these two parts are compared, and any difference found is returned as +the result of the comparison. For these purposes an empty string +(which can only occur at the end of one or both version strings being +compared) counts as zero. +<p> + +These two steps are repeated (chopping initial non-digit strings and +initial digit strings off from the start) until a difference is found +or both strings are exhausted. +<p> + +Note that the purpose of epochs is to allow us to leave behind +mistakes in version numbering, and to cope with situations where the +version numbering changes. It is <em/not/ there to cope with version +numbers containing strings of letters which <tt/dpkg/ cannot interpret +(such as <tt/ALPHA/ or <tt/pre-/), or with silly orderings (the author +of this manual has heard of a package whose versions went <tt/1.1/, +<tt/1.2/, <tt/1.3/, <tt/1/, <tt/2.1/, <tt/2.2/, <tt/2/ and so forth). +<p> + +If an upstream package has problematic version numbers they should be +converted to a sane form for use in the <tt/Version/ field. + +<sect1>Package maintainer scripts run by <tt/dpkg/<label id="maintainerscripts"> + +It is possible supply scripts as part of a package which <tt/dpkg/ +will run for you when your package is installed, upgraded or removed. +<p> + +These scripts should be the files <tt/preinst/, <tt/postinst/, +<tt/prerm/ and <tt/postrm/ in the control area of the package. They +should be proper exectuable files, so that if they are scripts (which +is to be recommended) they must start with the usual <tt/#!/ +convention. They should be readable and executable to anyone, and not +world-writeable. +<p> + +<tt/dpkg/ looks at the exit status from these scripts. It is +important that they exit with a non-zero status if there is an error, +so that <tt/dpkg/ can stop its processing. For shell scripts this +means that you <em/almost always/ need to use <tt/set -e/ (this is +usually true when writing shell scripts, in fact). It is also +important, of course, that they don't exit with a non-zero status if +everything went well. +<p> + +It is necessary for the error recovery procedures that the scripts be +idempotent: ie, invoking the same script several times in the same +situation should do no harm. If the first call failed, or aborted +half way through for some reason, the second call should merely do the +things that were left undone the first time, if any, and exit with a +success status. +<p> + +When a package is upgraded a combination of the scripts from the old +and new packages is called in amongst the other steps of the upgrade +procedure. If your scripts are going to be at all complicated you +need to be aware of this, and may need to check the arguments to your +scripts. +<p> + +Broadly speaking the <tt/preinst/ is called before (a particular +version of) a package is installed, and the <tt/postinst/ afterwards; +the <tt/prerm/ before (a version of) a package is removed and the +<tt/postrm/ afterwards. +<p> + +See <ref id="maintscripts-instact" name="later"> for details of +exactly when and how these scripts are called and with what arguments. + +<sect>Declaring relationships between packages<label id="depconoverwr"> + +Packages can declare in their control file that they have certain +relationships to other packages - for example, that they may not be +installed at the same time as certain other packages, and/or that they +depend on the presence of others. +<p> + +This is done using the <tt/Depends/, <tt/Recommends/, <tt/Suggests/, +<tt/Conflicts/, <tt/Provides/ and <tt/Replaces control file fields. +<p> + +<sect>Syntax of relationship fields + +These fields all have a uniform syntax. They are a list of package +names separated by commas. +<p> + +In <tt/Depends/, <tt/Recommends/, <tt/Suggests/ and <tt/Pre-Depends/ +(the fields which declare dependencies of the package in which they +occur on other packages) these package names may also be lists of +alternative package names, separated by vertical bar symbols <tt/|/ +(pipe symbols). +<p> + +All the fields except <tt/Provides/ may restrict their applicability +to particular versions of each named package. This is done in +parentheses after each individual package name; the parentheses should +contain a relation from the list below followed by a version number, +in the format described in <ref id="versions" name="the version number +section, above">. +<p> + +The relations allowed are +<tt/<</, +<tt/<=/, +<tt/=/, +<tt/>=/ and +<tt/>>/ +for strictly earlier, earlier or equal, exactly equal, later or equal +and strictly later, respectively. The forms <tt/</ and <tt/>/ +were used to mean earlier/later or equal, rather than strictly +earlier/later, and so (while <tt/dpkg/ still supports them) they +should not appear in new packages. +<p> + +Whitespace may appear at any point in the version specification, and +must appear where it's necessary to disambiguate; it is not otherwise +significant. For consistency and in case of future changes to +<tt/dpkg/ it is recommended that a single space be used after a +version relationship and before a version number; it is usual also to +put a single space after each comma, on either side of each vertical +bar, and before each open parenthesis. + +<sect1>Dependencies - <tt/Depends/, <tt/Recommends/, <tt/Suggests/, <tt/Pre-Depends/ + +These three fields are used to declare a dependency by one package on +another. They appear in the depending package's control file. +<p> + +All but <tt/Pre-Depends/ (discussed below) take effect <em/only/ when +a package is to be configured. They do not prevent a package being on +the system in an unconfigured state while its dependencies are +unsatisfied, and it is possible to replace a package whose +dependencies are satisfied and which is properly installed with a +different version whose dependencies are not and cannot be satisfied; +when this is done the depending package will be left unconfigured +(since attempts to configure it will give errors) and will not +function properly. +<p> + +For this reason packages in an installation run are usually all +unpacked first and all configured later; this gives later versions of +packages with dependencies on later versions of other packages the +opportunity to have their dependencies satisfied. + +<descrip> +<tag/<tt/Depends// +This declares an absolute dependency. +<p> + +<tt/dpkg/ will not configure +packages whose dependencies aren't satisfied. If it is asked to make +an installation which would cause an installed package's dependencies +to become unsatisfied it will complain<footnote>Current versions +(1.2.4) of <tt/dpkg/ have a bug in this area which will cause some of +these problems to be ignored.</footnote>, unless +<tt/--auto-deconfigure/ is specified, in which case those packages +will be deconfigured before the installation proceeds. +<p> + +<tt/dselect/ makes it hard for the user to select packages for +installation, removal or upgrade in a way that would mean that +packages' <tt/Depends/ fields would be unsatisfied. The user can +override this if they wish, for example if they know that <tt/dselect/ +has an out-of-date view of the real package relationships. + +**** WHEN TO USE -- POLICY STATEMENT HERE ? + +<tag/<tt/Recommends// +This declares a strong, but not absolute, dependency. +<p> + +<tt/Recommends/ is ignored by <tt/dpkg/, so that users using the +command-line (who are presumed to know what they're doing) will not be +impeded. +<p> + +It is treated by <tt/dselect/ exactly as <tt/Depends/ is; this makes +it hard for the user to select things so as to leave <tt/Recommends/ +fields unsatisfied, but they are able to do so by being persistent. + +**** WHEN TO USE -- POLICY STATEMENT HERE ? + + + + +<tt/<tt/Suggests// +This declares a + +**** WRITE THIS + +<sect1>Alternative packages - <tt/Conflicts/ + +**** WRITE THIS + +<sect1>Virtual packages - <tt/Provides/ + +**** WRITE THIS + +<sect1>Overwriting files - <tt/Replaces/ + +**** WRITE THIS + +<tt/<</ +<tt/<</ +<tt/<</ +<descrip> +<tag>< + +<sect>Order of processing steps and maintainer script arguments<label id="maintscripts-instact"> + +<sect1>Summary of ways maintainer scripts are called +<p> + +<itemize> +<item><var/new preinst/ <tt/install/ +<item><var/new preinst/ <tt/install/ <var/old-version/ +<item><var/new preinst/ <tt/upgrade/ <var/old-version/ +<item><var/old preinst/ <tt/abort-upgrade/ <var/new-version/ +</itemize> + +<itemize> +<item><var/postinst/ <tt/configure/ <var/most-recently-configured-version/ +<item><var/old-postinst/ <tt/abort-upgrade/ <var/new version/ +<item><var/conflictor's-postinst/ <tt/abort-remove/ + in-favour <var/package/ <var/new-version/ +<item><var/deconfigured's-postinst/ <tt/abort-deconfigure/ + <tt/in-favour/ <var/failed-install-package/ <var/version/ + <tt/removing/ <var/conflicting-package/ <var/version/ +</itemize> + +<itemize> +<item><var/prerm/ <tt/remove/ +<item><var/old-prerm/ <tt/upgrade/ <var/new-version/ +<item><var/new-prerm/ <tt/failed-upgrade/ <var/old-version/ +<item><var/conflictor's-prerm/ <tt/remove/ <tt/in-favour/ + <var/package/ <var/new-version/ +<item><var/deconfigured's-prerm/ <tt/deconfigure/ + <tt/in-favour/ <var/package-being-installed/ <var/version/ + <tt/removing/ <var/conflicting-package/ <var/version/ +</itemize> + +<itemize> +<item><var/postrm/ <tt/remove/ +<item><var/postrm/ <tt/purge/ +<item><var/old-postrm/ <tt/upgrade/ <var/new-version/ +<item><var/new-postrm/ <tt/failed-upgrade/ <var/old-version/ +<item><var/new-postrm/ <tt/abort-install/ +<item><var/new-postrm/ <tt/abort-install/ <var/old-version/ +<item><var/new-postrm/ <tt/abort-upgrade/ <var/old-version/ +<item><var/disappearer's-postrm/ <tt/disappear/ <var/overwriter/ <var/new-version/ +</itemize> + +<sect1>Details of unpack phase of installation or upgrade +<p> + +The procedure on installation/upgrade/overwrite/disappear (ie, when +running <tt/dpkg --unpack/, or the unpack stage of <tt/dpkg +--install/) is as follows. In each case if an error occurs the +actions in are general run backwards - this means that the maintainer +scripts are run with different arguments in reverse order. These are +the `error unwind' calls listed below. + +<enum> +<item> + +<enum> +<item> +If a version the package is already +installed, call +<tscreen><verb> +<var/old-prerm/ <tt/upgrade/ <var/new-version/ +</verb></tscreen> + +<item> +If this gives an error (ie, a non-zero exit status), dpkg will +attempt instead: +<tscreen><verb> +<var/new-prerm/ <tt/failed-upgrade/ <var/old-version/ +</verb></tscreen> +Error unwind, for both the above cases: +<tscreen><verb> +<var/old-postinst/ <tt/abort-upgrade/ <var/new-version/ +</verb></tscreen> + +</enum> + +<item> +If a `conflicting' package is being removed at the same time: +<enum> + +<item> +If any packages depended on that conflicting package and +<tt/--auto-deconfigure/ is specified, call, for each such package: +<tscreen><verb> +<var/deconfigured's-prerm/ <tt/deconfigure/ + <tt/in-favour/ <var/package-being-installed/ <var/version/ + <tt/removing/ <var/conflicting-package/ <var/version/ +</verb></tscreen> +Error unwind: +<tscreen><verb> +<var/deconfigured's-postinst/ <tt/abort-deconfigure/ + <tt/in-favour/ <var/package-being-installed-but-failed/ <var/version/ + <tt/removing/ <var/conflicting-package/ <var/version/ +</verb></tscreen> +The deconfigured packages are marked as requiring configuration, so +that if <tt/--install/ is used they will be configured again if +possible. + +<item> +To prepare for removal of the conflicting package, call: +<tscreen><verb> +<var/conflictor's-prerm/ <tt/remove/ + <tt/in-favour/ <var/package/ <var/new-version/ +</verb></tscreen> +Error unwind: +<tscreen><verb> +<var/conflictor's-postinst/ <tt/abort-remove/ + <tt/in-favour/ <var/package/ <var/new-version/ +</verb></tscreen> + +</enum> + +<item> +<enum> +<item> +If the package is being upgraded, call: +<tscreen><verb> +<var/new-preinst/ <tt/upgrade/ <var/old-version/ +</verb></tscreen> + +<item> +Otherwise, if the package had some configuration files from a previous +version installed (ie, it is in the `configuration files only' state): +<tscreen><verb> +<var/new-preinst/ <tt/install/ <var/old-version/ +</verb></tscreen> + +<item> +Otherwise (ie, the package was completely purged): +<tscreen><verb> +<var/new-preinst/ <tt/install/ +</verb></tscreen> +Error unwind versions, respectively: +<tscreen><verb> +<var/new-postrm/ <tt/abort-upgrade/ <var/old-version/ +<var/new-postrm/ <tt/abort-install/ <var/old-version/ +<var/new-postrm/ <tt/abort-install/ +</verb></tscreen> + +</enum> + +<item> +The new package's files are unpacked, overwriting any that may be on +the system already, for example any from the old version of the same +package or from another package (backups of the old files are left +around, and if anything goes wrong dpkg will attempt to put them back +as part of the error unwind). +<p> + +It is an error for a package to contains files which are on the system +in another package, unless <tt/Replaces/ is used (see <ref +id="replaces" name="earlier">). Currently the <tt/--force-overwrite/ +flag is enabled, downgrading it to a warning, but this will not always +be the case. +<p> + +Packages which overwrite each other's files produce behaviour which +(though deterministic) is hard for the system administrator to +understand and can easily lead to `missing' programs (for example, if +a package is installed which overwrites a file from another package, +and then it is removed again). + +<item> + +<enum> +<item> +If the package is being upgraded, call +<tscreen><verb> +<var/old-postrm/ <tt/upgrade/ <var/new-version/ +</verb></tscreen> + +<item> +If this fails, <tt/dpkg/ will attempt: +<tscreen><verb> +<var/new-postrm/ <tt/failed-upgrade/ <var/old-version/ +</verb></tscreen> +Error unwind, for both cases: +<tscreen><verb> +<var/old-preinst/ <tt/abort-upgrade/ <var/new-version/ +</verb></tscreen> + +</enum> + +This is the point of no return - if <tt/dpkg/ gets this far, it won't +back off past this point if an error occurs. This will leave the +package in a fairly bad state, which will require a successful +reinstallation to clear up, but it's when <tt/dpkg/ starts doing +things that are irreversible. + +<item> +Any files which were in the old version of the package but not in the +new are removed. + +<item> +The new file list replaces the old. + +<item> +The new maintainer scripts replace the old. + +<item> +Any packages all of whose files have been overwritten during the +installation, and which aren't required for dependencies, are considered +to have been removed. For each such package, + +<enum> +<item> +<tt/dpkg/ calls: +<tscreen><verb> +<var/disappearer's-postrm/ <tt/disappear/ <var/overwriter/ <var/overwriter-version/ +</verb></tscreen> + +<item> +The package's maintainer scripts are removed. + +<item> +It is noted in the status database as being in a sane state, namely +not installed (any conffiles it may have are ignored). Note that +disappearing packages do not have their prerm called, because +<tt/dpkg/ doesn't know in advance that the package is going to vanish. + +</enum> + +<item> +Any files in the package we're unpacking that are also listed in the +file lists of other packages are removed from those lists. (This will +lobotomise the file list of the `conflicting' package if there is one.) + +<item> +The backup files made during installation, above, are deleted. + +<item> +The new package's status is now sane, and recorded as `unpacked'. Here +is another point of no return - if the conflicting package's removal +fails we do not unwind the rest of the installation; the conflicting +package is left in a half-removed limbo. + +<item> +If there was a conflicting package we go and do the removal actions +(described below), starting with the removal of the conflicting +package's files (any that are also in the package being installed +have already been removed from the conflicting package's file list, +and so do not get removed now). + +</enum> + +<sect1>Details of configuration +<p> + +When we configure a package (this happens with <tt/dpkg --install/, or +with <tt/--configure/), we first update the conffiles and then call: +<tscreen><verb> +<var/postinst/ <tt/configure/ <var/most-recently-configured-version/ +</verb></tscreen> +<p> + +No attempt is made to unwind after errors during configuration. +<p> + +If there is no most recently configured version <tt/dpkg/ will pass a +null argument; older versions of dpkg may pass +<tt><unknown></tt> (including the angle brackets) in this case. +Even older ones do not pass a second argument at all, under any +circumstances. + +<sect1>Details of removal and/or configration purging +<p> + +<enum> +<item> +<tscreen><verb> +<var/prerm/ <tt/remove/ +</verb></tscreen> + +<item> +The package's files are removed (except conffiles). + +<item> +<tscreen><verb> +<var/postrm/ <tt/remove/ +</verb></tscreen> + +<item> +All the maintainer scripts except the postrm are removed. +<p> + +If we aren't purging the package we stop here. Note that packages +which have no postrm and no conffiles are automatically purged when +removed, as there is no difference except for the <tt/dpkg/ status. + +<item> +The conffiles and any backup files (<tt/~/-files, <tt/#*#/ files, +<tt/%/-files, <tt/.dpkg-{old,new,tmp}/, etc.) are removed. + +<item> +<tscreen><verb> +<var/postrm/ <tt/purge/ +</verb></tscreen> + +<item> +The package's file list is removed. + +</enum> + +No attempt is made to unwind after errors during removal. + + +<sect>Dangling references + +<sect1>Would dangle to conffiles<label id="conffiles"> + +There would be a dangling xref here. Instead I've just put this dummy +text in. + +<sect1>Would dangle to descriptions<label id="descriptions"> + +There would be a dangling xref here. Instead I've just put this dummy +text in. + +</article> diff --git a/dpkg-deb/dpkg-deb.8 b/dpkg-deb/dpkg-deb.8 index b9af3dd3..f5251653 100644 --- a/dpkg-deb/dpkg-deb.8 +++ b/dpkg-deb/dpkg-deb.8 @@ -1,130 +1,231 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. -.\" Authors: Raul Miller and Ian Jackson -.TH DPKG\-DEB 8 "29 Nov 1995" "Debian Project" "Debian GNU/Linux" +.\" Authors: Ian Jackson +.TH DPKG\-DEB 8 "1st June 1996" "Debian Project" "Debian Linux manual" .SH NAME -dpkg\-deb \- Debian GNU/Linux package archive backend +dpkg\-deb \- Debian package archive (.deb) manipulation tool .SH SYNOPSIS -.B dpkg-deb --version -.LP -.B dpkg-deb -.BR -X | --vextract -.I <deb> -.RI [ <directory> ] -.LP .B dpkg-deb .BR -b | --build -.RB [ --nocheck ] -.I <directory> -.RI [ <deb> ] -.LP -.B dpkg-deb -.BR -c | --contents -.I <deb> -.LP +.IR directory " [" archive ] +.br .B dpkg-deb -.BR -e | --control -.I <deb> -.RI [ <directory> ] -.LP +.BR -I | --info +.IR archive " [" control\-file\-name " ..]" +.br .B dpkg-deb .BR -f | --field -.I <deb> -.RI [ <cfield> ]... -.LP -.B dpkg-deb -.BR -h | --help -.LP +.IR archive " [" control\-field\-name " ...]" +.br .B dpkg-deb -.BR -I | --info -.I <deb> -.RI [ <cfile> ] -.LP -.B dpkg-deb -.BR -x | --extract -.I <deb> <directory> -.LP +.BR -c | --contents +.I archive +.br .B dpkg-deb -.BR -D | --debug -.I <invocation-options> +.BR -x | --extract | -X | --vextract +.I archive directory +.br +.B dpkg-deb --fsys-tarfile +.I archive +.br +.B dpkg-deb --control +.I archive directory .SH DESCRIPTION .B dpkg-deb -packs and unpacks debian archives. It tracks file permissions, and -includes support for the staged unpacking mechanism required by debian. -.SH OPTIONS -.I <deb> -is the filename of a Debian format archive. -.I <cfile> -is the name of an administrative file component. -.I <cfield> -is the name of a field in the main `control' file. -.LP -.B --version -displays the version number. -.LP -.BR -X | --vextract -extracts files from archive and lists archive's contents. -.LP -.BR -b | --build -makes a debian archive from the image of -.IR <directory> . -.I <directory> +packs, unpacks and provides information about Debian archives. + +Use +.B dpkg +to install and remove packages from your system. + +You can also invoke +.B dpkg\-deb +by calling +.B dpkg +with whatever options you want to pass to +.BR dpkg\-deb ". " dpkg +will spot that you wanted +.B dpkg\-deb +and run it for you. +.SH ACTION OPTIONS +.TP +.BR -b ", " --build +Creates a debian archive from the filesystem tree stored in +.IR directory ". " directory must have a .B DEBIAN -subdirectory, which is treated specially for the debian-specific -control file and any pre- or post-install scripts. +subdirectory, which contains the control information files such +as the control file itself. This directory will +.I not +appear in the binary package's filesystem archive, but instead +the files in it will be put in the binary package's control +information area. -The +Unless you specify +.BR \-\-no\-check ", " dpkg\-deb " +will read +.B DEBIAN/control +and parse it. It will check it for syntax errors and other problems, +and display the name of the binary package being built. +.B dpkg\-deb +will also check the permissions of the maintainer scripts and other +files found in the .B DEBIAN -directory must contain a file called -.B control -whose contents is a valid control file for the Debian package -management system. Errors in this file will abort the processing of -the package. This check can be bypassed by the use of the -.B --nocheck -option. -.LP -.BR -c | --contents -lists the contents of the archive on stdout. -.LP -.BR -e | --control -extracts the control file from the archive. -If no target directory is specified, the control files are extracted -into -.BR ./DEBIAN . -.LP -.BR -f | --field -displays [named field(s) from] the control file. -.LP -.BR -h | --help -displays summary of usage. -.LP -.BR -I | --info -describes the archive, on stdout. -.LP -.BR -x | --extract -extracts files from archive. -.LP -.BR -D | --debug -would enable debugging. -.SH NOTES -.B dpkg-deb -packs and unpacks *.deb files, but does not deal with any of the -larger administrative issues of installing/de-installing packages. -.SH SEE ALSO -.BR deb (5), -.BR deb-control (5), -.BR dpkg (5), -.BR dpkg (8), -.BR dselect (8). +control information directory. + +If no +.I archive +is specified then +.B dpkg\-deb +will write the package into the file +.IR directory \fB.deb\fR. + +If the archive to be created already exists it will be overwritten. +.TP +.BR \-\-info ", " -I +Provides information about a binary package archive. + +If no +.IR control\-file\-name s +are specified then it will print a summary of the contents of the +package as well as its control file. + +If any +.IR control\-file\-name s +are specified then +.B dpkg\-deb +will print them in the order they were specified; if any of the +components weren't present it will print an error message to stderr +about each one and exit with status 2. +.TP +.BR \-\-field ", " -f +Extracts control file information from a binary package archive. + +If no +.BR control\-file\-field s +are specified then it will print the whole control file. + +If any are specified then +.B dpkg\-deb +will print their contents, in the order in which they appear in the +control file. If more than one +.BR control\-file\-field +is specified then +.B dpkg\-deb +will precede each with its field name (and a colon and space). + +No errors are reported for fields requested but not found. +.TP +.BR --contents ", " -c +Lists the contents of the filesystem tree archive portion of the +package archive. It is currently produced in the format generated by +.BR tar 's +verbose listing. +.TP +.BR --extract ", " -x ", " \-\-vextract ", " -X +Extracts the filesystem tree from a package archive into the specified +directory. + +.BR \-\-vextract " (" -X ")" +prints a listing of the files extracted as it goes, while +.BR \-\-extract " (" -x ")" +is silent unless an error occurs. + +Note that extracting a package to the root directory will +.I not +result in a correct installation ! Use +.B dpkg +to install packages. + +.I directory +(but not its parents) will be created if necessary. +.TP +.BR --fsys-tarfile +Extracts the filesystem tree data from a binary package and sends it +to standard output in +.B tar +format. Together with +.B tar +this can be used to extract a particular file from a package archive. +.TP +.BR --control ", " -e +Extracs the control information files from a package archive into the +specified directory. + +If no directory is specified then a subdirectory +.B DEBIAN +in the current directory is used. + +The target directory (but not its parents) will be created if +necessary. +.TP +.BR --help ", " -h +Prints +.BR dpkg\-deb 's +usage message, giving a summary of its options and their uses. +.TP +.BR --version +Prints +.BR dpkg\-deb 's +version number. +.TP +.BR --licence +Prints information about +.BR dpkg\-deb 's +copyright licensing and lack of warranty. (The American spelling +.B \-\-license +is also supported.) +.SH OTHER OPTIONS +.TP +.BR --new +Ensures that +.B dpkg\-deb +builds a `new' format archive. This is the default. +.TP +.BR --old +Forces +.B dpkg\-deb +to build an `old' format archive. This old archive format is less +easily parsed by non-Debian tools and is now obsolete; its only use is +when building packages to be parsed by versions of dpkg older than +0.93.76 (September 1995), which was released as i386 a.out only. +.TP +.BR --no-check +Inhibit's +.BR "dpkg\-deb \-\-build" 's +usual checks on the proposed contents of an archive. You can build +any archive you want, no matter how broken, this way. +.TP +.BR --debug ", " -D +Enables debugging output. This is not very interesting. .SH BUGS .B dpkg-deb -I .IB package1 .deb .IB package2 .deb does the wrong thing. -This manpage is too terse and fails to document all the options. If -you are a competent and accurate writer and are willing to spend the -time reading the source and writing good manpages please -please write a better man page than this one. -.LP -Still being developed, as of 29th November 1995. +There is no authentication on +.B .deb +files; in fact, there isn't even a straightforward checksum. + +Do not attempt to use just +.B dpkg\-deb +to install software ! You must use +.B dpkg +proper to ensure that all the files are correctly placed and the +package's scripts run and its status and contents recorded. +.SH SEE ALSO +.BR deb (5), +.BR deb-control (5), +.BR dpkg (5), +.BR dpkg (8), +.BR dselect (8). +.SH AUTHOR +.B dpkg\-deb +and this manpage were written by Ian Jackson. They are +Copyright (C)1995-1996 +by him and released under the GNU General Public Licence; there is NO +WARRANTY. See +.B /usr/doc/copyright/dpkg +and +.B /usr/doc/copyright/GPL +for details. diff --git a/dselect/main.cc b/dselect/main.cc index 4900e397..e99d13d8 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -166,10 +166,7 @@ extern void operator delete(void *p) { } urqresult urq_list(void) { - readwrite= modstatdb_init(admindir, - // Why do I need this cast ?? - (modstatdb_rw)(msdbrw_writeifposs| - msdbrw_availablepreferversion)); + readwrite= modstatdb_init(admindir,msdbrw_writeifposs); curseson(); diff --git a/dselect/methlist.cc b/dselect/methlist.cc index 710fabf3..c81ce8e1 100644 --- a/dselect/methlist.cc +++ b/dselect/methlist.cc @@ -115,16 +115,22 @@ void methodlist::redrawcolheads() { } methodlist::methodlist() : baselist(&methodlistbindings) { + int newcursor= -1; + if (debug) fprintf(debug,"methodlist[%p]::methodlist()\n",this); table= new struct option*[noptions]; struct option *opt, **ip; - for (opt=options, ip=table, nitems=0; opt; opt=opt->next, nitems++) *ip++= opt; + for (opt=options, ip=table, nitems=0; opt; opt=opt->next, nitems++) { + if (opt == coption) { assert(newcursor==-1); newcursor= nitems; } + *ip++= opt; + } assert(nitems==noptions); - setcursor(0); + if (newcursor==-1) newcursor= 0; + setcursor(newcursor); if (debug) fprintf(debug,"methodlist[%p]::methodlist done; noptions=%d\n", this, noptions); diff --git a/include/dpkg-db.h b/include/dpkg-db.h index ec3e187b..b2de971c 100644 --- a/include/dpkg-db.h +++ b/include/dpkg-db.h @@ -146,9 +146,7 @@ enum modstatdb_rw { msdbrw_write/*s*/, msdbrw_needsuperuser, /* Now some optional flags: */ msdbrw_flagsmask= ~077, - /* Prefer later versions from `status' in `available' info, but do not - * save `available' info: */ - msdbrw_availablepreferversion= 0100 + /* ... of which there are currently none, but they'd start at 0100 */ }; enum modstatdb_rw modstatdb_init(const char *admindir, enum modstatdb_rw reqrwflags); @@ -178,8 +176,7 @@ void hashreport(FILE*); enum parsedbflags { pdb_recordavailable =001, /* Store in `available' in-core structures, not `status' */ pdb_rejectstatus =002, /* Throw up an error if `Status' encountered */ - pdb_weakclassification=004, /* Ignore priority/section info if we already have any */ - pdb_preferversion= 010 /* Discard information about earlier versions */ + pdb_weakclassification=004 /* Ignore priority/section info if we already have any */ }; const char *illegal_packagename(const char *p, const char **ep); diff --git a/lib/database.c b/lib/database.c index 4f410488..02c3c3cf 100644 --- a/lib/database.c +++ b/lib/database.c @@ -145,11 +145,10 @@ int informative(struct pkginfo *pkg, struct pkginfoperfile *info) { * out. */ if (info == &pkg->installed && - ((pkg->want != want_unknown && pkg->want != want_purge) || + (pkg->want != want_unknown || pkg->eflag != eflagv_ok || pkg->status != stat_notinstalled || - informativeversion(&pkg->configversion) || - pkg->files)) + informativeversion(&pkg->configversion))) /* We ignore Section and Priority, as these tend to hang around. */ return 1; if (!info->valid) return 0; diff --git a/lib/dbmodify.c b/lib/dbmodify.c index 0fbbe9c5..54bb36a2 100644 --- a/lib/dbmodify.c +++ b/lib/dbmodify.c @@ -179,8 +179,7 @@ enum modstatdb_rw modstatdb_init(const char *adir, enum modstatdb_rw readwritere if (cstatus != msdbrw_needsuperuserlockonly) { parsedb(statusfile, pdb_weakclassification, 0,0,0); parsedb(availablefile, - pdb_recordavailable|pdb_rejectstatus| - (cflags & msdbrw_availablepreferversion ? pdb_preferversion : 0), + pdb_recordavailable|pdb_rejectstatus, 0,0,0); } @@ -206,9 +205,7 @@ void modstatdb_shutdown(void) { switch (cstatus) { case msdbrw_write: checkpoint(); - if (!(cflags & msdbrw_availablepreferversion)) - writedb(availablefile,1,0); - + writedb(availablefile,1,0); /* tidy up a bit, but don't worry too much about failure */ fclose(importanttmp); strcpy(updatefnrest, IMPORTANTTMP); unlink(updatefnbuf); diff --git a/lib/parse.c b/lib/parse.c index 0d367f46..e14db139 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -197,7 +197,7 @@ int parsedb(const char *filename, enum parsedbflags flags, &newpifp->description, "description"); parsemustfield(file,filename,lno, warnto,warncount,&newpig,1, &newpifp->maintainer, "maintainer"); - parsemustfield(file,filename,lno, warnto,warncount,&newpig,1, + parsemustfield(file,filename,lno, warnto,warncount,&newpig,0, &newpifp->version.version, "version"); } if (flags & pdb_recordavailable) @@ -222,51 +222,57 @@ int parsedb(const char *filename, enum parsedbflags flags, } } + /* There was a bug that could make a not-installed package have + * conffiles, so we check for them here and remove them (rather than + * calling it an error, which will do at some point -- fixme). + */ + if (!(flags & pdb_recordavailable) && + newpig.status == stat_notinstalled && + newpifp->conffiles) { + parseerr(file,filename,lno, warnto,warncount,&newpig,1, + "Package which in state not-installed has conffiles, forgetting them"); + newpifp->conffiles= 0; + } + pigp= findpackage(newpig.name); pifp= (flags & pdb_recordavailable) ? &pigp->available : &pigp->installed; if (!pifp->valid) blankpackageperfile(pifp); - if (!(flags & pdb_preferversion) || - versioncompare(&newpifp->version,&pifp->version) >= 0) { - /* If we're ignoring older versions compare version numbers - * and only process this entry if it's a higher version. - */ - - /* Copy the priority and section across, but don't overwrite existing - * values if the pdb_weakclassification flag is set. - */ - if (newpig.section && *newpig.section && - !((flags & pdb_weakclassification) && pigp->section && *pigp->section)) - pigp->section= newpig.section; - if (newpig.priority != pri_unknown && - !((flags & pdb_weakclassification) && pigp->priority != pri_unknown)) { - pigp->priority= newpig.priority; - if (newpig.priority == pri_other) pigp->otherpriority= newpig.otherpriority; - } + /* Copy the priority and section across, but don't overwrite existing + * values if the pdb_weakclassification flag is set. + */ + if (newpig.section && *newpig.section && + !((flags & pdb_weakclassification) && pigp->section && *pigp->section)) + pigp->section= newpig.section; + if (newpig.priority != pri_unknown && + !((flags & pdb_weakclassification) && pigp->priority != pri_unknown)) { + pigp->priority= newpig.priority; + if (newpig.priority == pri_other) pigp->otherpriority= newpig.otherpriority; + } - /* Sort out the dependency mess. */ - copy_dependency_links(pigp,&pifp->depends,newpifp->depends, - (flags & pdb_recordavailable) ? 1 : 0); - /* Leave the `depended' pointer alone, we've just gone to such - * trouble to get it right :-). The `depends' pointer in - * pifp was indeed also updated by copy_dependency_links, - * but since the value was that from newpifp anyway there's - * no need to copy it back. - */ - newpifp->depended= pifp->depended; + /* Sort out the dependency mess. */ + copy_dependency_links(pigp,&pifp->depends,newpifp->depends, + (flags & pdb_recordavailable) ? 1 : 0); + /* Leave the `depended' pointer alone, we've just gone to such + * trouble to get it right :-). The `depends' pointer in + * pifp was indeed also updated by copy_dependency_links, + * but since the value was that from newpifp anyway there's + * no need to copy it back. + */ + newpifp->depended= pifp->depended; - /* Copy across data */ - memcpy(pifp,newpifp,sizeof(struct pkginfoperfile)); - if (!(flags & pdb_recordavailable)) { - pigp->want= newpig.want; - pigp->eflag= newpig.eflag; - pigp->status= newpig.status; - pigp->configversion= newpig.configversion; - pigp->files= 0; - } else { - pigp->files= newpig.files; - } + /* Copy across data */ + memcpy(pifp,newpifp,sizeof(struct pkginfoperfile)); + if (!(flags & pdb_recordavailable)) { + pigp->want= newpig.want; + pigp->eflag= newpig.eflag; + pigp->status= newpig.status; + pigp->configversion= newpig.configversion; + pigp->files= 0; + } else { + pigp->files= newpig.files; } + if (donep) *donep= pigp; pdone++; if (c == EOF) break; diff --git a/main/main.c b/main/main.c index 18c98146..5496d67b 100644 --- a/main/main.c +++ b/main/main.c @@ -63,6 +63,7 @@ Usage: \n\ " DPKG " --update-avail <Packages-file> replace available packages info\n\ " DPKG " --merge-avail <Packages-file> merge with info from file\n\ " DPKG " --clear-avail erase existing available info\n\ + " DPKG " --forget-old-unavail forget uninstalled unavailable pkgs\n\ " DPKG " -s|--status <package-name> ... display package status details\n\ " DPKG " --print-avail <package-name> ... display available version details\n\ " DPKG " -L|--listfiles <package-name> ... list files `owned' by package(s)\n\ @@ -242,7 +243,7 @@ DPKG " forcing options - control behaviour when problems found:\n\ configure-any Configure any package which may help this one\n\ hold Process incidental packages even when on hold\n\ bad-path PATH is missing important programs, problems likely\n\ - overwrite Overwrite a file from one package with another\n\ + overwrite [*] Overwrite a file from one package with another\n\ overwrite-diverted Overwrite a diverted file with an undiverted version\n\ depends-version [!] Turn dependency version problems into warnings\n\ depends [!] Turn all dependency problems into warnings\n\ @@ -297,6 +298,7 @@ static const struct cmdinfo cmdinfos[]= { ACTION( "update-avail", 0, act_avreplace, updateavailable ), ACTION( "merge-avail", 0, act_avmerge, updateavailable ), ACTION( "clear-avail", 0, act_avclear, updateavailable ), + ACTION( "forget-old-unavail", 0, act_forgetold, forgetold ), ACTION( "audit", 'C', act_audit, audit ), ACTION( "yet-to-unpack", 0, act_unpackchk, unpackchk ), ACTION( "list", 'l', act_listpackages, listpackages ), diff --git a/main/main.h b/main/main.h index b41c111d..24832691 100644 --- a/main/main.h +++ b/main/main.h @@ -52,7 +52,8 @@ enum action { act_unset, act_install, act_unpack, act_avail, act_configure, act_remove, act_purge, act_listpackages, act_avreplace, act_avmerge, act_unpackchk, act_status, act_searchfiles, act_audit, act_listfiles, act_assertpredep, act_printarch, act_predeppackage, act_cmpversions, - act_printinstarch, act_compareversions, act_printavail, act_avclear }; + act_printinstarch, act_compareversions, act_printavail, act_avclear, + act_forgetold }; enum conffopt { cfof_prompt = 001, @@ -98,6 +99,7 @@ void process_archive(const char *filename); /* from update.c */ +void forgetold(const char *const *argv); void updateavailable(const char *const *argv); /* from enquiry.c */ diff --git a/main/processarc.c b/main/processarc.c index 9f9c6c59..472753c1 100644 --- a/main/processarc.c +++ b/main/processarc.c @@ -878,6 +878,7 @@ void process_archive(const char *filename) { otherpkg->installed.depends= 0; otherpkg->installed.essential= 0; otherpkg->installed.description= otherpkg->installed.maintainer= 0; + otherpkg->installed.conffiles= 0; blankversion(&otherpkg->installed.version); otherpkg->installed.arbs= 0; otherpkg->clientdata->fileslistvalid= 0; diff --git a/main/remove.c b/main/remove.c index 5f685f81..86bc81e3 100644 --- a/main/remove.c +++ b/main/remove.c @@ -90,7 +90,7 @@ void deferred_remove(struct pkginfo *pkg) { } assert(pkg->installed.valid); - if (pkg->installed.essential) + if (pkg->installed.essential && pkg->status != stat_configfiles) forcibleerr(fc_removeessential, "This is an essential package -" " it should not be removed."); @@ -294,6 +294,7 @@ void removal_bulk(struct pkginfo *pkg) { pop_cleanup(ehflag_normaltidy); /* closedir */ pkg->status= stat_configfiles; + pkg->installed.essential= 0; modstatdb_note(pkg); push_checkpoint(~ehflag_bombout, ehflag_normaltidy); diff --git a/main/update.c b/main/update.c index 7a9b759f..ad4b4faf 100644 --- a/main/update.c +++ b/main/update.c @@ -38,11 +38,16 @@ void updateavailable(const char *const *argv) { int count= 0; static struct varbuf vb; - if (cipaction->arg == act_avclear) { - if (sourcefile) - badusage("--clear-avail takes no arguments"); - } else if (!sourcefile || argv[1]) { - badusage("--%s needs exactly one Packages file argument", cipaction->olong); + switch (cipaction->arg) { + case act_avclear: + if (sourcefile) badusage("--%s takes no arguments",cipaction->olong); + break; + case act_avreplace: case act_avmerge: + if (!sourcefile || argv[1]) + badusage("--%s needs exactly one Packages file argument",cipaction->olong); + break; + default: + internerr("bad cipaction->arg in updateavailable"); } if (!f_noact) { @@ -86,3 +91,37 @@ void updateavailable(const char *const *argv) { if (cipaction->arg != act_avclear) printf("Information about %d package(s) was updated.\n",count); } + +void forgetold(const char *const *argv) { + struct pkgiterator *it; + struct pkginfo *pkg; + enum pkgwant oldwant; + + if (*argv) badusage("--forget-old-unavail takes no arguments"); + + modstatdb_init(admindir, f_noact ? msdbrw_readonly : msdbrw_write); + + it= iterpkgstart(); + while ((pkg= iterpkgnext(it))) { + debug(dbg_eachfile,"forgetold checking %s",pkg->name); + if (informative(pkg,&pkg->available)) { + debug(dbg_eachfile,"forgetold ... informative available"); + continue; + } + if (pkg->want != want_purge && pkg->want != want_deinstall) { + debug(dbg_eachfile,"forgetold ... informative want"); + continue; + } + oldwant= pkg->want; + pkg->want= want_unknown; + if (informative(pkg,&pkg->installed)) { + debug(dbg_eachfile,"forgetold ... informative installed"); + pkg->want= oldwant; + continue; + } + debug(dbg_general,"forgetold forgetting %s",pkg->name); + } + iterpkgend(it); + + modstatdb_shutdown(); +} diff --git a/methods/disk.setup b/methods/disk.setup index d37c42c6..2ba78ced 100644 --- a/methods/disk.setup +++ b/methods/disk.setup @@ -405,7 +405,7 @@ development tree are available for installation. Would you like to use the unreleased development tree (this is only recommended for experts who like to live dangerously and want to help with testing) ?' yesno "$p_usedevel" 'Use unreleased development distribution ?' - usedevel="$response" + usedevel="$yesno" if [ "$usedevel" = yes ] then whichmain=development diff --git a/methods/disk.update b/methods/disk.update index 97aa8839..def5f37a 100644 --- a/methods/disk.update +++ b/methods/disk.update @@ -82,6 +82,8 @@ do esac done +dpkg --forget-old-unavail + echo -n 'Update OK. Hit RETURN. ' read response diff --git a/scripts/Makefile.in b/scripts/Makefile.in index e3fe56dd..64433b94 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -38,7 +38,7 @@ MAN1 = dpkg-name EXC = dpkg-name MAN8 = update-rc.d start-stop-daemon update-alternatives install-info SBIN = update-rc.d start-stop-daemon update-alternatives install-info \ - dpkg-scanpackages dpkg-divert + dpkg-scanpackages dpkg-divert cleanup-info INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/scripts/cleanup-info.pl b/scripts/cleanup-info.pl new file mode 100644 index 00000000..e6bfcc31 --- /dev/null +++ b/scripts/cleanup-info.pl @@ -0,0 +1,155 @@ +#!/usr/bin/perl -- +# +# Clean up the mess that bogus install-info may have done : +# +# - gather all sections with the same heading into a single one. +# Tries to be smart about cases and trailing colon/spaces. +# +# Other clean ups : +# +# - remove empty sections, +# - squeeze blank lines (in entries part only). +# +# Order of sections is preserved (the first encountered section +# counts). +# +# Order of entries within a section is preserved. +# +# BUGS: +# +# Probably many : I just recently learned Perl for this program +# using the man pages. Hopefully this is a short enough program to +# debug. + +# don't put that in for production. +# use strict; + +my $version = '1.1.6'; # This line modified by Makefile +sub version { + print STDERR <<END; +Debian Linux cleanup-info $version. Copyright (C)1996 Kim-Minh Kaplan. +This is free software; see the GNU General Public Licence +version 2 or later for copying conditions. There is NO warranty. +END +} + +sub usage { + print STDERR <<'EOF'; +usage: cleanup-info [--version] [--help] [--unsafe] [--] [<dirname>] +Warning: the ``--unsafe'' option may garble an otherwise correct file +EOF +} + +my $infodir = '/usr/info'; +my $unsafe = 0; +$0 =~ m|[^/]+$|; +my $name= $&; + +sub ulquit { + unlink "$infodir/dir.lock" + or warn "$name: warning - unable to unlock $infodir/dir: $!\n"; + die $_[0]; +} + +while (scalar @ARGV > 0 && $ARGV[0] =~ /^--/) { + $_ = shift; + /^--$/ and last; + /^--version$/ and do { + version; + exit 0; + }; + /^--help$/ and do { + usage; + exit 0; + }; + /^--unsafe$/ and do { + $unsafe=1; + next; + }; + print STDERR "$name: unknown option \`$_'\n"; + usage; + exit 1; +} + +if (scalar @ARGV > 0) { + $infodir = shift; + if (scalar @ARGV > 0) { + print STDERR "$name: too many arguments\n"; + usage; + exit 1; + } +} + +if (!link "$infodir/dir", "$infodir/dir.lock") { + die "$name: failed to lock dir for editing! $!\n". + ($! =~ /exist/i ? "try deleting $infodir/dir.lock\n" : ''); +} +open OLD, "$infodir/dir" or ulquit "$name: can't open $infodir/dir: $!\n"; +open OUT, ">$infodir/dir.new" + or ulquit "$name can't create $infodir/dir.new: $!\n"; + +my (%sections, @section_list, $lastline); +my $section="Miscellaneous"; # default section +my $section_canonic="miscellaneous"; +my $waitfor = $unsafe ? '^\*.*:' : '^\*\s*Menu'; + +while (<OLD>) { # dump the non entries part + last if (/$waitfor/oi); + if (defined $lastline) { + print OUT $lastline + or ulquit "$name: error writing $infodir/dir.new: $!\n"; + } + $lastline = $_; +}; + +if (/^\*\s*Menu\s*:?/i) { + print OUT $lastline if defined $lastline; + print OUT $_; +} else { + print OUT "* Menu:\n"; + if (defined $lastline) { + $lastline =~ s/\s*$//; + if ($lastline =~ /^([^\*\s].*)/) { # there was a section title + $section = $1; + $lastline =~ s/\s*:$//; + $section_canonic = lc $lastline; + } + } + push @section_list, $section_canonic; + s/\s*$//; + $sections{$section_canonic} = "\n$section\n$_\n"; +} + +foreach (<OLD>) { # collect sections + next if (/^\s*$/ or $unsafe and /^\*\s*Menu/oi); + s/\s*$//; + if (/^([^\*\s].*)/) { # change of section + $section = $1; + s/\s*:$//; + $section_canonic = lc $_; + } else { # add to section + if (! exists $sections{$section_canonic}) { # create section header + push @section_list, $section_canonic; + $sections{$section_canonic} = "\n$section\n"; + } + $sections{$section_canonic} .= "$_\n"; + } +} + +eof OLD or ulquit "$name: read $infodir/dir: $!\n"; +close OLD or ulquit "$name: close $infodir/dir after read: $!\n"; + +print OUT @sections{@section_list}; +close OUT or ulquit "$name: error closing $infodir/dir.new: $!\n"; + +# install clean version +unlink "$infodir/dir.old"; +link "$infodir/dir", "$infodir/dir.old" + or ulquit "$name: can't backup old $infodir/dir, giving up: $!\n"; +rename "$infodir/dir.new", "$infodir/dir" + or ulquit "$name: failed to install $infodir/dir; I'll leave it as $infodir/dir.new: $!\n"; + +unlink "$infodir/dir.lock" + or die "$name: failed to unlock $infodir/dir: $!\n"; + +exit 0; diff --git a/scripts/dpkg-name.1 b/scripts/dpkg-name.1 index e3760f72..6f7d2c0a 100644 --- a/scripts/dpkg-name.1 +++ b/scripts/dpkg-name.1 @@ -4,7 +4,7 @@ .\" This is free software; see the GNU General Public Licence version 2 .\" or later for copying conditions. There is NO warranty. .\" Time-stamp: <96/05/03 14:00:06 root> -.TH dpkg-name 1 "April 1996" "Debian Project" "Debian Linux" +.TH dpkg-name 1 "May 1996" "Debian Project" "Debian Linux" .SH NAME dpkg\-name \- rename Debian packages to full package names .SH SYNOPSIS @@ -19,19 +19,18 @@ This manual page documents the sh script which provides an easy way to rename .B Debian packages into their full package names. A full package name consists -of <package>-<version>.<architecture>.deb as specified in the control -file of the package. The <package> part of the filename will have -hyphens "-" replaced by underscores "_". The <version> part of the -filename consists of the mainstream version information optionally -followed by a hyphen and the revision information. +of <package>_<version>_<architecture>.deb as specified in the control +file of the package. The <version> part of the filename consists of +the mainstream version information optionally followed by a hyphen and +the revision information. .SH EXAMPLES .TP .B dpkg-name bar-foo.deb -The file `bar-foo.deb' will be renamed to bar_foo-1.0-2.i386.deb or +The file `bar-foo.deb' will be renamed to bar-foo_1.0-2_i386.deb or something similar (depending on whatever information is in the control part of `bar-foo.deb'). .TP -.B find /root/debian/ \-name '*.deb' | xargs \-n 1 dpkg\-name -a +.B find /root/debian/ \-name '*.deb' | xargs \-n 1 dpkg\-name \-a All files with the extension `deb' in the directory /root/debian and its subdirectory's will be renamed by dpkg\-name if required into names with no architecture information. @@ -42,7 +41,7 @@ Your archive will be messed up completely because a lot of packages don't come with section information. .B Don't do this. .TP -.B dpkg --build debian-tmp && dpkg-name -s .. debian-tmp.deb +.B dpkg --build debian-tmp && dpkg-name -o -s .. debian-tmp.deb This can be used when building new packages. .SS OPTIONS .TP @@ -83,15 +82,18 @@ information and exit successfully. Successfully tested on .B Debian Linux systems only. Some packages don't follow the name structure -<package>-<version>.<architecture>.deb. Packages renamed by dpkg-name +<package>_<version>_<architecture>.deb. Packages renamed by dpkg-name will follow this structure. Generally this will have no impact on how -packages are installed by dselect/dpkg. +packages are installed by dselect/dpkg, but other installation tools +might depend on this naming structure. .SH SEE ALSO .BR deb (5), .BR deb-control (5), .BR dpkg (5), .BR dpkg (8), -.BR dpkg-deb (8). +.BR dpkg-deb (8), +.BR find (1), +.BR xargs (1). .SH COPYRIGHT Copyright 1995,1996 Erick Branderhorst. .B dpkg-name diff --git a/scripts/dpkg-name.sh b/scripts/dpkg-name.sh index 1256802b..e427e8d6 100644 --- a/scripts/dpkg-name.sh +++ b/scripts/dpkg-name.sh @@ -4,7 +4,7 @@ set -e # Time-stamp: <96/05/03 13:59:41 root> prog="`basename \"${0}\"`" -version="1.1.6"; # This line modified by Makefile +version="1.2.3"; # This line modified by Makefile purpose="rename Debian packages to full package names" license () { @@ -33,8 +33,8 @@ show_version () { usage () { echo "Usage: ${prog} file[s] ${purpose} - file.deb changes to <package>-<version>.<architecture>.deb - <package> is y/-/_/ aware + file.deb changes to <package>_<version>_<architecture>.deb + according to the ``underscores convention''. -a|--no-architecture No architecture part in filename -o|--overwrite Overwrite if file exists -s|--subdir [dir] Move file into subdir (Use with care) @@ -55,7 +55,6 @@ fileexists () { getname () { if p=`dpkg-deb -f -- "$1" package`; then - p=`echo $p|sed -e 'y/-/_/'`; v=`dpkg-deb -f -- "$1" version`; r=`dpkg-deb -f -- "$1" revision`; if [ -z "$r" ]; @@ -77,9 +76,9 @@ getname () { fi if [ -z "$noarchitecture" ]; then - tname=$p-$v.$a.deb; + tname=$p\_$v\_$a.deb; else - tname=$p-$v.deb + tname=$p\_$v.deb fi name=`echo $tname|sed -e 's/ //g'` diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 3d592b98..db068413 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -69,7 +69,12 @@ while (<F>) { $t =~ m/^\n*$/ || die "$fn $o / $t ?"; defined($tv{'package'}) || die "$fn $o ?"; $p= $tv{'package'}; delete $tv{'package'}; - defined($p1{$p}) && die "$fn $p repeat"; + if (defined($p1{$p})) { + print(STDERR " ! Package $p (filename $fn) is repeat;\n". + " ignored that one and using data from $pfilename{$p}) !\n") + || die $!; + continue; + } if (defined($tv{'filename'})) { print(STDERR " ! Package $p (filename $fn) has Filename field !\n") || die $!; } @@ -122,8 +127,8 @@ while(<O>) { next unless defined($p1{$p}); if (length($maintainer)) { if ($maintainer =~ m/\s*=\>\s*/) { - $oldmaint= $`; $newmaint= $'; - if ($pv{$p,'maintainer'} ne $oldmaint) { + $oldmaint= $`; $newmaint= $'; $debmaint= $pv{$p,'maintainer'}; + if (!grep($debmaint eq $_, split(m,\s*//\s*, $oldmaint))) { push(@changedmaint, " $p (package says $pv{$p,'maintainer'}, not $oldmaint)\n"); } else { @@ -132,6 +137,7 @@ while(<O>) { } elsif ($pv{$p,'maintainer'} eq $maintainer) { push(@samemaint," $p ($maintainer)\n"); } else { + print(STDERR " * Unconditional maintainer override for $p *\n") || die $!; $pv{$p,'maintainer'}= $maintainer; } } diff --git a/scripts/install-info.pl b/scripts/install-info.pl index a50a3965..a5a2af05 100755 --- a/scripts/install-info.pl +++ b/scripts/install-info.pl @@ -257,7 +257,7 @@ if (!$remove) { if ($i <= 0) { # We ran off the top, make this section and Misc. print "$name: no sections yet, creating Miscellaneous section too.\n" unless $quiet; - @work= ("\n", "$sectiontitle\n", "\n", "Miscellaneous:", @work); + @work= ("\n", "$sectiontitle\n", "\n", "Miscellaneous:\n", @work); $mss= 1; } else { @work= (@work[0..$i], "$sectiontitle\n", "\n", @work[$i+1..$#work]); diff --git a/scripts/update-rc.d.8 b/scripts/update-rc.d.8 index 3ed3d904..3055175e 100644 --- a/scripts/update-rc.d.8 +++ b/scripts/update-rc.d.8 @@ -1,5 +1,5 @@ .\" Hey, Emacs! This is an -*- nroff -*- source file. -.TH UPDATE\-RC.D 8 "29th November 1995" "Debian Project" "Debian/GNU Linux" +.TH UPDATE\-RC.D 8 "6th June 1996" "Debian Project" "Debian/GNU Linux" .SH NAME update\-rc.d \- install and remove System-V style init script links .SH SYNOPSIS @@ -27,11 +27,12 @@ removing init scripts on a Debian system. .SH REMOVING SCRIPTS When invoked with the .I remove -option, update-rc.d removes the script and links to the script for the package -.RI "" <basename> . -It first finds and removes the script in -.B /etc/init.d/ -and then removes all links to the script in +option, update-rc.d removes the links to the script for the package +.IR basename . +The script must have been deleted already - +.B update-rc.d +checks for this. +It then removes all the (now-dangling) links to the script in .RB "" /etc/rc[0123456].d/ . .SH INSTALLING SCRIPTS diff --git a/version.h b/version.h index 978d18e2..0c40076c 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define DPKG_VERSION "1.2.3" /* This line modified by Makefile */ +#define DPKG_VERSION "1.2.4" /* This line modified by Makefile */