Go to file
Alexey Tourbin b85388dd91 depcache.cc (MarkInstall): mark unambiguous dependencies first
Consider a package called "test":

	Name: test
	Version: 1
	Release: alt1
	Summary: test
	License: GPL
	Group: Development/Other
	Requires: /usr/bin/latex
	Requires: tetex-latex
	%description
	%files

The problem with this "test" package is that it cannot be installed.
Since recently, Sisyphus has two packages which provide /usr/bin/latex:
tetex-latex and texlive-latex-base.  These two packages conflict with
each other.  When /usr/bin/latex dependency is processed, apt chooses
to install texlive-latex-base.  And after a short while, apt also has
to choose tetex-latex.  Since there are also other packages involved
(e.g. tetex-core and texlive-base), ProblemResolver fails to fix the
conflict.

	The following packages have unmet dependencies:
	  test: Depends: tetex-latex
	E: Broken packages

To avoid the problem (to to a large extent), apt should process
non-ambiguous dependencies first.  That would be tetex-latex.
After tetex-latex is selected for install, ambigous dependency
on /usr/bin/latex will be automatically satisfied.

This change implements recursive wavefront algorithm that helps
to disambiguate dependencies gradually.  The recursive function
MarkInstallRec() has "Restricted" flag, by which it avoids to mark
ambiguous dependencies, and instead returns "MarkAgain" set of
packages.  Moreover, Restricted flag is automatically re-enabled
on recursive invocations (in other words, ambiguous dependencies
can be resolved only on the current wavefront).

MarkAgain packages must be marked again.  There are two possibilities.
Either marking again does nothing, because previously marked unambiguous
dependencies now satisfy ambiguous dependencies (that's where I'm trying
to get to).  And otherwise, the package has to be marekd without
Restricted flag, to force ambiguous selection (which cannot be
completely avoided).

Here is the piece of code that does full recursive mark.

   std::set<PkgIterator> MA;
   std::set<PkgIterator>::iterator I;
   MarkInstallRec(Pkg, true, MA, 0, DebugA);
   while (1) {
      std::set<PkgIterator> MAA;
      for (I = MA.begin(); I != MA.end(); ++I)
	 MarkInstallRec(*I, true, MAA, 0, DebugB);
      for (I = MA.begin(); I != MA.end(); ++I)
	 MarkInstallRec(*I, false, MAA, 0, DebugC);
      if (MA == MAA)
	 break;
      MA = MAA;
   }

First, I mark the package with Restricted=true, and see if something
needs to be marked again because of ambiguous dependencies.  The loop
then says: before we can go with Restricted=false and grab some
ambiguous dependencies, we need to mark all non-ambigous dependencies
first.  The loop ends when no new packages can be marked (which is
usually when MA gets empty).

With '-o Debug::pkgMarkInstall=1' option, it is now possible to
show how apt deals with the "test" package.

	MI2a: mark test
	MI2a:  target /usr/bin/latex AMB
	MI2a:  target tetex-latex
	MI2a:   mark tetex-latex
	MI2a:    target tetex-core
	MI2a:     mark tetex-core
	MI2a:      target dialog
	MI2a:       mark dialog
	MI2a:      target /etc/cron.daily
	MI2a:       mark crontabs
	MI2a:        target vixie-cron
	MI2a:         mark vixie-cron
	MI2a:          target crontab-control
	MI2a:           mark crontab-control
	MI2a:          target libsetproctitle.so.0()(64bit)
	MI2a:           mark setproctitle
	MI2a:      target /etc/tex-fonts.d
	MI2a:       mark tex-common
	MI2a:      target /usr/sbin/stmpclean
	MI2a:       mark stmpclean
	MI2a:      target ed
	MI2a:       mark ed
	MI2a:      target libpng12.so.0(PNG_12)(64bit)
	MI2a:       mark libpng12
	MI2a:      target libstdc++.so.6(CXXABI_1.3)(64bit) AMB
	MI2a:      target libstdc++.so.6(GLIBCXX_3.4)(64bit) AMB
	MI2a:      target texinfo
	MI2a:       mark texinfo
	MI2b: mark tetex-core
	MI2b:  target libstdc++.so.6(CXXABI_1.3)(64bit) AMB
	MI2b:  target libstdc++.so.6(GLIBCXX_3.4)(64bit) AMB
	MI2c: mark tetex-core
	MI2c:  target libstdc++.so.6(CXXABI_1.3)(64bit)
	MI2c:   mark libstdc++4.3
2009-03-23 16:09:25 +03:00
.gear/tags apt-%version-%release.patch 2009-03-23 08:52:06 +03:00
apt depcache.cc (MarkInstall): mark unambiguous dependencies first 2009-03-23 16:09:25 +03:00
.gear-rules apt-%version-%release.patch 2009-03-23 08:52:06 +03:00
apt-0.5.4cnc9-alt-getsrc-debug.patch 0.5.5cnc1-alt3 2003-02-13 13:28:59 +00:00
apt-0.5.4cnc9-alt-pkgorderlist-score.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.5cnc4.1-alt-PrioComp.patch Better pkgname comparison: now automake_1.10 > automake_1.9. 2007-12-17 17:58:41 +03:00
apt-0.5.5cnc5-alt-rsync.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc5-alt-debsystem.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc5-alt-distro.patch 0.5.15cnc5-alt1 2004-01-16 19:01:26 +00:00
apt-0.5.15cnc5-alt-execrpm-cmd.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc5-alt-getsrc.patch Fixed typo in patch description. 2007-08-01 00:14:46 +07:00
apt-0.5.15cnc5-alt-gettext.patch 0.5.15cnc5-alt4 2004-02-27 17:49:54 +00:00
apt-0.5.15cnc5-alt-gpg-homedir.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc5-alt-libtool.patch 0.5.15cnc5-alt1 2004-01-16 19:01:26 +00:00
apt-0.5.15cnc5-alt-md5hash-debug.patch 0.5.15cnc5-alt1 2004-01-16 19:01:26 +00:00
apt-0.5.15cnc5-alt-packagemanager-CheckRConflicts.patch 0.5.15cnc5-alt1 2004-01-16 19:01:26 +00:00
apt-0.5.15cnc5-alt-rpm-build.patch 0.5.15cnc5-alt4 2004-02-27 17:49:54 +00:00
apt-0.5.15cnc6-alt-apt-get-TryToInstall.patch 0.5.15cnc6-alt11 2005-05-18 17:03:04 +00:00
apt-0.5.15cnc6-alt-apt-pipe.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc6-alt-apt-shell-dl.patch 0.5.15cnc6-alt13 2005-06-16 11:25:49 +00:00
apt-0.5.15cnc6-alt-apt-shell.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc6-alt-dash-cmd.patch 0.5.15cnc6-alt14 2005-06-27 18:44:05 +00:00
apt-0.5.15cnc6-alt-defaults.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc6-alt-lsgroup.patch apt-shell: describe -G and -g options in "help list" output (#18256) 2009-01-02 00:50:37 +06:00
apt-0.5.15cnc6-alt-parseargs.patch 0.5.15cnc6-alt11 2005-05-18 17:03:04 +00:00
apt-0.5.15cnc6-alt-pkgcachegen.patch 0.5.15cnc6-alt3 2004-05-16 17:22:03 +00:00
apt-0.5.15cnc6-alt-PrintLocalFile.patch 0.5.15cnc6-alt18 2006-02-21 00:47:29 +00:00
apt-0.5.15cnc6-alt-quiet-update.patch 0.5.15cnc6-alt16 2005-07-15 17:30:29 +00:00
apt-0.5.15cnc6-alt-rpm-fancypercent.patch 0.5.15cnc6-alt1 2004-05-13 12:23:54 +00:00
apt-0.5.15cnc6-alt-rpm-order.patch 0.5.15cnc6-alt1 2004-05-13 12:23:54 +00:00
apt-0.5.15cnc6-alt-umount.patch 0.5.15cnc6-alt11 2005-05-18 17:03:04 +00:00
apt-0.5.15cnc6-alt-vendor.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc6-alt-virtual-scores.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15cnc6-apt-utils-locale.patch 0.5.15cnc6-alt17 2005-11-25 22:15:14 +00:00
apt-0.5.15lorg2-alt-apt-get-simple-output.patch 0.5.15lorg2-alt7 2006-11-30 14:55:12 +00:00
apt-0.5.15lorg2-alt-apt-get-TryToInstall-PrvPkgCandVer.patch 0.5.15lorg2-alt6 2006-10-10 20:47:53 +00:00
apt-0.5.15lorg2-alt-apt-shell-list_completion.patch Rename apt-shell patches according to the policy 2008-12-30 20:45:12 +00:00
apt-0.5.15lorg2-alt-apt-shell-quit_by_eof.patch quit_by_eof.patch: print newline before exit. 2009-01-09 23:52:48 +06:00
apt-0.5.15lorg2-alt-apt-shell-resetconfig.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-buildlib.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-exit-status.patch git-mv apt-0.5.15lorg3-alt-exit-status.patch apt-0.5.15lorg3-alt-exit-status.patch 2007-08-01 00:28:32 +04:00
apt-0.5.15lorg2-alt-fixes.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-gcc4.3.patch Additional fix required to build apt with g++-4.3.x on i586 2008-12-12 15:31:02 +00:00
apt-0.5.15lorg2-alt-genpkglist-no-fileflags.patch genpkglist.cc: RPMTAG_FILEFLAGS should not be copied into header list 2008-05-11 17:40:09 +04:00
apt-0.5.15lorg2-alt-genpkglist-reqfiles.patch genpkglist.cc: rewrite copyStrippedFileList() to avoid inplace dirnames edit bug 2007-11-30 19:19:42 +03:00
apt-0.5.15lorg2-alt-i18n-apt-shell-typo.patch 0.5.15lorg2-alt11.1 2007-08-01 00:59:13 +07:00
apt-0.5.15lorg2-alt-lua51.patch 0.5.15lorg2-alt4 2006-05-16 18:14:17 +00:00
apt-0.5.15lorg2-alt-manifest.patch - fix manifest patch (initialize memory with zero values) 2007-10-30 14:54:58 +03:00
apt-0.5.15lorg2-alt-pkgCache-PrvIterator.patch apt-pkg/cacheiterators.h(pkgCache::PrvIterator): Add default constructor, required for aptitude 0.4.1 (Raorn, #9604). 2006-10-05 14:24:32 +00:00
apt-0.5.15lorg2-alt-pkgInitConfig-cpu.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-readline.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-realloc.patch Fix realloc(3) usage. 2006-10-05 17:04:50 +00:00
apt-0.5.15lorg2-alt-rpmdbopen.patch - add patch: open rpm database with O_CREAT flag (we need it to use apt in system installer) 2009-01-19 17:33:03 +03:00
apt-0.5.15lorg2-alt-rpmSystem-DistroVer.patch 0.5.15lorg2-alt3 2006-04-02 12:15:03 +00:00
apt-0.5.15lorg2-alt-src-apt-shell-wrong_message_fix.patch 0.5.15lorg2-alt11.1 2007-08-01 00:59:13 +07:00
apt-0.5.15lorg2-alt-versionmatch-TryToChangeVer.patch updated alt-versionmatch-TryToChangeVer.patch 2007-04-09 16:16:57 +04:00
apt-0.5.15lorg2-lorg-cache-limit.patch lorg-cache-limit.patch: increase cache size limit 2008-05-11 18:58:35 +04:00
apt-0.5.15lorg2-lorg-pkgcachegen-selfprov.patch lorg-pkgcachegen-selfprov.patch: allow self-referencing provides 2008-03-30 01:30:43 +03:00
apt.be.po Fixed typo in output of help command in apt-shell (#5400) 2007-07-31 23:22:22 +07:00
apt.conf 0.5.15cnc6-alt7 2005-04-11 13:50:36 +00:00
apt.ru.po apt-shell: describe -G and -g options in "help list" output (#18256) 2009-01-02 00:50:37 +06:00
apt.spec apt-%version-%release.patch 2009-03-23 08:52:06 +03:00
ChangeLog-rpm.old 0.5.15cnc5-alt1 2004-01-16 19:01:26 +00:00
genbasedir Completely silent genbasedir by default 2007-12-17 17:58:40 +03:00
README.rsync 0.5.5cnc1-alt3 2003-02-13 13:28:59 +00:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Пакет apt-rsync предоставляет метод 'rsync' для APT.
Это значит, что apt-get сможет выкачивать пакеты по протоколу rsync.
Поддерживается работа через HTTP-proxy.
Для работы метода 'rsync' необходимо, чтобы был установлен пакет rsync,
скомпилированный с патчем для поддержки опции "--apt-support".
В ALT Linux Sisyphus поддерживается начиная с rsync-2.5.5-alt3.

Чтобы использовать метод 'rsync', необходимо добавить в /etc/apt/sources.list
строчки вида:

rpm [alt] rsync://rsync.altlinux.ru/ALTLinux/Sisyphus i586 classic
rpm-src [alt] rsync://rsync.altlinux.ru/ALTLinux/Sisyphus i586 classic

Для конфигурирования можно использовать следующие параметры
(в /etc/apt/apt.conf или из командной строки):

Debug::rsync = "true|false"
  Разрешает вывод отладочной информации.
  По умолчанию: false

Acquire::rsync::program
  Указывает путь к программе rsync.
  По умолчанию: /usr/bin/rsync

Acquire::rsync::Timeout
  Передаёт параметр "--timeout" с указанным значением программе rsync.
  По умолчанию: не передаёт этот параметр для rsync.

Acquire::rsync::proxy
Acquire::rsync::proxy::hostname
  Указывает, что необходимо использовать HTTP-proxy. Для этого будет
  установлена переменная окружения RSYNC_PROXY при вызове программы
  rsync.
  При использовании репозитариев на разных хостах возможно задание
  proxy для всех хостов и для каждого в отдельности.
  Значение для конкретного хоста перекрывает глобальное значение.
  Можно использовать специальное значение "none" для указания, что
  необходимо использовать прямое соединение.
  Формат: hostname:port или "none"
  Пример:

    Acquire::rsync::proxy="192.168.1.1:3128"
    Acquire::rsync::proxy::mirror.localdomain="none"

  Будет использоваться http-proxy "192.168.1.1:3128" для всех хостов,
  кроме mirror.localdomain, для которого будет использоваться прямое
  соединение.

Acquire::rsync::options::
  Позволяет задавать любые дополнительные опции при вызове программы
  rsync.
  Примеры:

    Acquire::rsync::options:: "-z";
    Acquire::rsync::options { "-z"; "--some-other-option"; };

  Первый вариант можно использовать, если все необходимые опции можно
  указать одной строкой. При наличии нескольких раздельных опций
  необходимо использовать второй вариант.