[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Documentation for Breaks in dpkg



Ian Jackson <iwj@ubuntu.com> writes:

> Package: debian-policy
> Version: 3.7.2.1
> Severity: wishlist
> Tags: patch
>
> As I report in #379140 (against dpkg), I have implemented Breaks in
> dpkg.  The attached patch is the corresponding change to the manual.
>
> It would probably not be wise to apply this patch until we have
> settled on a deployment plan for Breaks in Debian; as I say in
> #379140, I hope to get around to that this weekend.

Here is an updated patch.  The changes from Ian's original patch are:

 * Add a statement saying that Breaks should not be used until support is
   present in Debian stable, which I think was the consensus of recent
   discussion on the policy list, and also note this near the mention of
   Breaks in the Conflicts section.

 * Just remove the entire paragraph about suidmanager from the
   dpkg-statoverride section rather than changing it to use Breaks.
   suidmanager predates oldstable at this point; I don't think there's any
   reason to mention it ever existed at this point.

dpkg folks, could you please review this patch as a final double-check
that it matches the dpkg implementation as was committed and released?  I
want to be sure that nothing changed from the original patch so that we
don't document the wrong thing in Policy.

Other policy readers, comments or seconds?

--- orig/policy.sgml
+++ mod/policy.sgml
@@ -2545,7 +2545,8 @@
 	<sect1>
 	  <heading>Package interrelationship fields:
 	    <tt>Depends</tt>, <tt>Pre-Depends</tt>,
-	    <tt>Recommends</tt>, <tt>Suggests</tt>, <tt>Conflicts</tt>,
+	    <tt>Recommends</tt>, <tt>Suggests</tt>,
+	    <tt>Breaks</tt>, <tt>Conflicts</tt>,
 	    <tt>Provides</tt>, <tt>Replaces</tt>, <tt>Enhances</tt>
 	  </heading>
 
@@ -3336,8 +3337,8 @@
 		<var>deconfigured's-postinst</var>
 		<tt>abort-deconfigure</tt> <tt>in-favour</tt>
 		<var>failed-install-package</var> <var>version</var>
-		<tt>removing</tt> <var>conflicting-package</var>
-		<var>version</var>
+		[<tt>removing</tt> <var>conflicting-package</var>
+		<var>version</var>]
 	    </item>
 	  </list>
 
@@ -3362,9 +3363,9 @@
 	    <item>
 		<var>deconfigured's-prerm</var> <tt>deconfigure</tt>
 		<tt>in-favour</tt> <var>package-being-installed</var>
-		<var>version</var> <tt>removing</tt>
+		<var>version</var> [<tt>removing</tt>
 		<var>conflicting-package</var>
-		<var>version</var>
+		<var>version</var>]
 	    </item>
 	  </list>
 
@@ -3445,11 +3446,30 @@
 	    </item>
 
 	    <item>
-		If a "conflicting" package is being removed at the same time:
+		If a "conflicting" package is being removed at the same time,
+		or if any package will be broken (due to <tt>Breaks</tt>):
 		<enumlist>
 		  <item>
-		      If any packages depended on that conflicting
-		      package and <tt>--auto-deconfigure</tt> is
+		      If <tt>--auto-deconfigure</tt> is
+		      specified, call, for each package to be deconfigured
+		      due to <tt>Breaks</tt>:
+		      <example compact="compact">
+<var>deconfigured's-prerm</var> deconfigure \
+  in-favour <var>package-being-installed</var> <var>version</var>
+		      </example>
+		      Error unwind:
+		      <example compact="compact">
+<var>deconfigured's-postinst</var> abort-deconfigure \
+  in-favour <var>package-being-installed-but-failed</var> <var>version</var>
+		      </example>
+		      The deconfigured packages are marked as
+		      requiring configuration, so that if
+		      <tt>--install</tt> is used they will be
+		      configured again if possible.
+		  </item>
+		  <item>
+		      If any packages depended on a conflicting
+		      package being removed and <tt>--auto-deconfigure</tt> is
 		      specified, call, for each such package:
 		      <example compact="compact">
 <var>deconfigured's-prerm</var> deconfigure \
@@ -3468,7 +3488,7 @@
 		      configured again if possible.
 		  </item>
 		  <item>
-		      To prepare for removal of the conflicting package, call:
+		      To prepare for removal of each conflicting package, call:
 		      <example compact="compact">
 <var>conflictor's-prerm</var> remove \
   in-favour <var>package</var> <var>new-version</var>
@@ -3962,16 +3982,19 @@
 
         <p>
           This is done using the <tt>Depends</tt>, <tt>Pre-Depends</tt>,
-          <tt>Recommends</tt>, <tt>Suggests</tt>, <tt>Enhances</tt> and
-          <tt>Conflicts</tt> control file fields.
+          <tt>Recommends</tt>, <tt>Suggests</tt>, <tt>Enhances</tt>,
+          <tt>Breaks</tt> and <tt>Conflicts</tt> control file fields.
         </p>
 
 	<p>
-	  These six fields are used to declare a dependency
+	  These seven fields are used to declare a dependency
 	  relationship by one package on another.  Except for
-	  <tt>Enhances</tt>, they appear in the depending (binary)
-	  package's control file.  (<tt>Enhances</tt> appears in the
-	  recommending package's control file.)
+	  <tt>Enhances</tt> and <tt>Breaks</tt>, they appear in the
+	  depending (binary) package's control file.
+	  (<tt>Enhances</tt> appears in the recommending package's
+	  control file, and <tt>Breaks</tt> appears in the version of
+	  depended-on package which causes the named package to
+	  break).
 	</p>
 
 	<p>
@@ -4009,7 +4032,7 @@
           (based on rules below), and some packages may not be able to
           rely on their dependencies being present when being
           installed or removed, depending on which side of the break
-          of the circular dependcy loop they happen to be on.  If one
+          of the circular dependency loop they happen to be on.  If one
           of the packages in the loop has no postinst script, then the
           cycle will be broken at that package, so as to ensure that
           all postinst scripts run with the dependencies properly
@@ -4145,6 +4168,53 @@
 	</p>
       </sect>
 
+      <sect id="breaks">
+	<heading>Packages which break other packages - <tt>Breaks</tt></heading>
+
+	<p>
+	  Using <tt>Breaks</tt> may cause problems for upgrades from older
+	  versions of Debian and should not be used until the stable
+	  release of Debian supports <tt>Breaks</tt>.
+	</p>
+
+	<p>
+	  When one binary package declares that it breaks another,
+	  <prgn>dpkg</prgn> will refuse to allow the package which
+	  declares <tt>Breaks</tt> be installed unless the broken
+	  package is deconfigured first, and it will refuse to
+	  allow the broken package to be reconfigured.
+	</p>
+
+	<p>
+	  A package will not be regarded as causing breakage merely
+	  because its configuration files are still installed; it must
+	  be at least half-installed.
+	</p>
+
+	<p>
+	  A special exception is made for packages which declare that
+	  they break their own package name or a virtual package which
+	  they provide (see below): this does not count as a real
+	  breakage.
+	</p>
+
+	<p>
+	  Normally a <tt>Breaks</tt> entry will have an "earlier than"
+	  version clause; such a <tt>Breaks</tt> is introduced in the
+	  version of an (implicit or explicit) dependency which
+	  violates an assumption or reveals a bug in earlier versions
+	  of the broken package.  This use of <tt>Breaks</tt> will
+	  inform higher-level package management tools that broken
+	  package must be upgraded before the new one.
+	</p>
+
+	<p>
+	  If the breaking package also overwrites some files from the
+	  older package, it should use <tt>Replaces</tt> (not
+	  <tt>Conflicts</tt>) to ensure this goes smoothly.
+	</p>
+      </sect>
+
       <sect id="conflicts">
 	<heading>Conflicting binary packages - <tt>Conflicts</tt></heading>
 
@@ -4190,7 +4260,9 @@
 	  "earlier than" version clause.  This would prevent
 	  <prgn>dpkg</prgn> from upgrading or installing the package
 	  which declared such a conflict until the upgrade or removal
-	  of the conflicted-with package had been completed.
+	  of the conflicted-with package had been completed.  Instead,
+	  <tt>Breaks</tt> may be used (once <tt>Breaks</tt> is supported
+	  by the stable release of Debian).
 	</p>
       </sect>
 
@@ -4201,7 +4273,7 @@
 	  As well as the names of actual ("concrete") packages, the
 	  package relationship fields <tt>Depends</tt>,
 	  <tt>Recommends</tt>, <tt>Suggests</tt>, <tt>Enhances</tt>,
-	  <tt>Pre-Depends</tt>, <tt>Conflicts</tt>,
+	  <tt>Pre-Depends</tt>, <tt>Breaks</tt>, <tt>Conflicts</tt>,
 	  <tt>Build-Depends</tt>, <tt>Build-Depends-Indep</tt>,
 	  <tt>Build-Conflicts</tt> and <tt>Build-Conflicts-Indep</tt>
 	  may mention "virtual packages".
@@ -4237,16 +4309,16 @@
 	</p>
 
 	<p>
-	  If a dependency or a conflict has a version number attached
+	  If a relationship field has a version number attached
 	  then only real packages will be considered to see whether
 	  the relationship is satisfied (or the prohibition violated,
-	  for a conflict) - it is assumed that a real package which
-	  provides the virtual package is not of the "right" version.
-	  So, a <tt>Provides</tt> field may not contain version
-	  numbers, and the version number of the concrete package
-	  which provides a particular virtual package will not be
-	  looked at when considering a dependency on or conflict with
-	  the virtual package name.
+	  for a conflict or breakage) - it is assumed that a real
+	  package which provides the virtual package is not of the
+	  "right" version.  So, a <tt>Provides</tt> field may not
+	  contain version numbers, and the version number of the
+	  concrete package which provides a particular virtual package
+	  will not be looked at when considering a dependency on or
+	  conflict with the virtual package name.
 	</p>
 
 	<p>
@@ -7421,16 +7493,6 @@
 	  </p>
 
 	  <p>
-	    <prgn>dpkg-statoverride</prgn> is a replacement for the
-	    deprecated <tt>suidmanager</tt> package.  Packages which
-	    previously used <tt>suidmanager</tt> should have a
-	    <tt>Conflicts: suidmanager (<< 0.50)</tt> entry (or even
-	    <tt>(<< 0.52)</tt>), and calls to <tt>suidregister</tt>
-	    and <tt>suidunregister</tt> should now be simply removed
-	    from the maintainer scripts.
-	  </p>
-
-	  <p>
 	    If a system administrator wishes to have a file (or
 	    directory or other such thing) installed with owner and
 	    permissions different from those in the distributed Debian

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>


Reply to: