Re: apt_preferences man page

2002-12-09 Thread Thomas Hood
(In reply to Travis Crump)

Hello, and thanks for the feedback.

I think that the original is right.  It speaks of the
priority assigned to an "instance" of a package (i.e.,
a particular version of that package coming from a
particular source).  So although coreutils (the package)
is assigned three different priorities, one "instance" of
coreutils (4.5.3-4 from http.us.debian.org) is assigned
priority 70, another (4.5.2-1 from http.us.debian.org)
is assigned priority 700, while the installed instance
(also version 4.5.2-1) is assigned priority 100.

It is also necessary to add the "and not installed" 
clause for obvious reasons.

I have another question about the man page draft, though.
Do we use the word 'release' where we should use the
word 'distribution'?

--
Thomas

Travis Crump wrote:
> Thomas Hood wrote:
> >If  a target release has been specified, then APT uses the
> >following algorithm to set the priorities of the instances
> >of a package.  Assign:
> > 
> >priority 100
> >   to  the  instance  of  a  package  that  is already
> >   installed (if any).
> > 
> >priority 500
> >   to  the  instances  of  a  package  that  are   not
> >   installed  and do not belong to the target release.
> > 
> >priority 990
> >   to  the  instances  of  a  package  that  are   not
> >   installed and belong to the target release.
>
> Is this right?  Shouldn't it be something to the effect:
>
>  priority 100
> to  the  instance  of  a  package  that  is already
> installed (if any).
> 
>  priority 500
> to the instances of a package that are available
> in an archive but do not belong to the target release.
>
>  priority 990
> to  the  instances  of  a  package that belong to the
> target release.
>
> For instance, taking a random package:
> [EMAIL PROTECTED]:~$ apt-cache policy coreutils
> coreutils:
>Installed: 4.5.2-1
>Candidate: 4.5.2-1
>Version Table:
>   4.5.3-4 0
>   70 http://http.us.debian.org unstable/main Packages
>   *** 4.5.2-1 0
>  700 http://http.us.debian.org testing/main Packages
>  100 /var/lib/dpkg/status

> 4.5.2-1 gets both the 100 for being installed and the 700 for belonging
> to the testing release.  There are other places in the man page that use
> this language as well.






Re: apt_preferences man page

2002-12-09 Thread Travis Crump
Thomas Hood wrote:
   If  a target release has been specified, then APT uses the
   following algorithm to set the priorities of the instances
   of a package.  Assign:
   priority 100
  to  the  instance  of  a  package  that  is already
  installed (if any).
   priority 500
  to  the  instances  of  a  package  that  are   not
  installed  and do not belong to the target release.
   priority 990
  to  the  instances  of  a  package  that  are   not
  installed and belong to the target release.

Is this right?  Shouldn't it be something to the effect:
priority 100
   to  the  instance  of  a  package  that  is already
   installed (if any).
priority 500
   to the instances of a package that are available
   in an archive but do not belong to the target release.
priority 990
   to  the  instances  of  a  package that belong to the
   target release.
For instance, taking a random package:
[EMAIL PROTECTED]:~$ apt-cache policy coreutils
coreutils:
  Installed: 4.5.2-1
  Candidate: 4.5.2-1
  Version Table:
 4.5.3-4 0
 70 http://http.us.debian.org unstable/main Packages
 *** 4.5.2-1 0
700 http://http.us.debian.org testing/main Packages
100 /var/lib/dpkg/status
4.5.2-1 gets both the 100 for being installed and the 700 for belonging
to the testing release.  There are other places in the man page that use
this language as well.



Re: apt_preferences man page

2002-12-09 Thread Thomas Hood
Because this matter was mentioned in the 26 November Debian
Weekly News, it seems appropriate to post an update.

Susan Kleinmann took the bull by the horns and rewrote
the page from scratch.  I have proposed some revisions
and hopefully we'll have a finished product soon.  I
append the latest version I have, in the hopes that
people will point out any remaining errors.

--
Thomas Hood

APT_PREFERENCES(5) APT_PREFERENCES(5)



NAME
   apt_preferences - Preference control file for APT

DESCRIPTION
   The  APT preferences file /etc/apt/preferences can be used
   to control which version of a package will be selected for
   installation.

   Several versions of a package may be available for instal­
   lation when the sources.list(5) file  contains  references
   to  more  than  one release (for example, stable and test­
   ing), and several instances of the same version of a pack­
   age  may be available when the file contains references to
   more than one download site for a particular release.  APT
   assigns  a  "priority" to each instance that is available.
   (In what follows, an "instance" will be an instance  of  a
   package  that  is available according to sources.list(5).)
   Subject to dependency constraints,  apt-get  installs  the
   instance with the highest priority.

   The APT preferences file overrides the priorities that APT
   assigns to package instances by default, thus  giving  the
   user control over which one is selected.

   APT'S DEFAULT PRIORITY ASSIGNMENTS
   If  there  is no preferences file, or if there is no entry
   in the file that applies to a  particular  instance,  then
   the  priority  assigned  to  an  instance  is the priority
   assigned to the release to which  that  instance  belongs.
   It is possible to single out a release, called the "target
   release", which receives  a  higher  priority  than  other
   releases.   The  target  release can be set on the apt-get
   command  line   or   in   the   APT   configuration   file
   /etc/apt/apt.conf.  For example,

   # Command to install the version of some-pkg from the testing
release
   apt-get install -t testing some-pkg

   # Configuration setting to make stable the target release
   APT::Default-Release "stable";

   If  a target release has been specified, then APT uses the
   following algorithm to set the priorities of the instances
   of a package.  Assign:

   priority 100
  to  the  instance  of  a  package  that  is already
  installed (if any).

   priority 500
  to  the  instances  of  a  package  that  are   not
  installed  and do not belong to the target release.

   priority 990
  to  the  instances  of  a  package  that  are   not
  installed and belong to the target release.

   If  no  target release has been specified, then APT simply
   assigns priority 100 to all  installed  package  instances
   and priority 500 to all uninstalled package instances.

   APT  then  applies  the following rules to determine which
   instance of a package to install:

   · Never downgrade an installed package unless the priority
 of  an  available  instance of the package exceeds 1000.
 (Note that none of APT's default priorities exceeds this
 threshold;  such  high priorities can only be set in the
 preferences file.)

   · Always  install  or  upgrade  to  the  highest  priority
 instance of a package.

   · If two or more instances of a package have the same pri­
 ority, install or upgrade to the most recent one.

   In a typical situation, the installed instance of a  pack­
   age  (priority  100)  is  not  as  recent  as  one  of the
   instances available from the sites and releases listed  in
   the  sources.list(5) file (priority 500 or 990).  Then the
   package will be upgraded with the command: apt-get install
   or apt-get dist-upgrade.

   Rarely, the installed instance of a package is more recent
   than any of the other available instances.   This  package
   will not be downgraded.

   Sometimes  the  installed  instance  of  a package is more
   recent than the version belonging to the  target  release,
   but  not  as  recent  as a version belonging to some other
   release.  Such a package will indeed be upgraded,  because
   at  least one of the available instances has a higher pri­
   ority than the installed instance.

   THE EFFECT OF APT PREFERENCES
   The APT preferences file allows the  system  administrator
   to customize priorities.  The preferences file consists of
   one or more multi-line records separated by  blank  lines.
   Records can have one of two forms:

   · The  fir