Commit Graph

168 Commits

Author SHA1 Message Date
Alexey Tourbin
b7b482faeb luaiface.cc: added "savestate" and "restorestate" 2009-12-17 00:43:09 +03:00
Alexey Tourbin
46fa5b45fc pkgcache.cc (AllTargets): optimize out CheckDep() calls 2009-12-17 00:38:39 +03:00
Alexey Tourbin
c0a5d41afb rpmversion.cc (CheckDep): optimize out rpmRangesOverlap() call
(before this change)
[at@altair ~]$ time $TMPDIR/build/aptbox/apt-get -qq script ./installable.lua
cannot install: kile
566.10user 270.93system 13:58.64elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+36070878minor)pagefaults 0swaps
[at@altair ~]$

(after this change)
[at@altair ~]$ LD_PRELOAD=$TMPDIR/libapt-pkg-libc6.9-6.so.2 time $TMPDIR/build/aptbox/apt-get -qq script ./installable.lua
cannot install: kile
286.06user 266.22system 9:13.49elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+35839571minor)pagefaults 0swaps
[at@altair ~]$
2009-12-17 00:38:26 +03:00
Alexey Tourbin
262da2edf5 0.5.15lorg2-alt30
- added support for changelogs in "apt-cache show"
2009-11-20 07:09:56 +03:00
Alexey Tourbin
080122ef61 added support for changelogs in "apt-cache show" 2009-11-20 06:29:24 +03:00
Alexey Tourbin
df0f099e6a 0.5.15lorg2-alt29
- apt-utils no longer packaged, replaced with apt-repo-tools
2009-09-27 16:51:25 +04:00
Alexey Tourbin
ff9b1fea10 spec: disabled apt-utils (replaced with apt-repo-tools) 2009-09-27 16:51:12 +04:00
Alexey Tourbin
ff8d494599 0.5.15lorg2-alt28
- apt-cache.cc: fixed "whatdepends" for versioned virtual dependencies
2009-08-03 16:04:26 +04:00
Alexey Tourbin
1e29517661 apt-cache.cc (WhatDepends): fixed for versioned virtual dependencies
(old)
$ apt-cache whatdepends perl-Bit-Vector
perl-Bit-Vector-6.4-alt2
$

(new)
$ ./cmdline/apt-cache whatdepends perl-Bit-Vector
perl-Bit-Vector-6.4-alt2
  perl-Date-Calc-5.4-alt2
    Depends: <perl(Bit/Vector.pm)>
      perl-Bit-Vector-6.4-alt2
$

Note that perl-Date-Calc has versioned virtual dependency:

$ rpm -qR perl-Date-Calc |grep Vector
perl(Bit/Vector.pm) >= 6.400
$

The problem was that version comparison was performed against
perl-Bit-Vector version (which is 6.4-alt2), not against provided
perl(Bit/Vector.pm) version (which is 6.400).

$ diff -U1 <(apt-cache whatdepends perl-base) <(./cmdline/apt-cache whatdepends perl-base)
--- /tmp/.private/at/zshtuurCP  2009-08-03 15:45:46 +0400
+++ /tmp/.private/at/zshfynbjW  2009-08-03 15:45:46 +0400
@@ -7145,2 +7145,5 @@
       perl-base-1:5.8.9-alt3
+  perl-HTML-FromText-2.05-alt3
+    Depends: <perl(Text/Tabs.pm)>
+      perl-base-1:5.8.9-alt3
   perl-Getopt-ArgvFile-1.10-alt2
@@ -8458,4 +8461,2 @@
       perl-base-1:5.8.9-alt3
-  perl-base-1:5.8.9-alt3
-    Obsoletes: <perl-MIME-Base64>
   nix-0.12-1

Again, this shows that versioned virtual dependencies are handled
properly now, more or less.  However, there is also a change in
"Obsoletes" which I did not expect.

apt/apt-pkg/rpm/rpmversion.cc:
| // rpmVS::CheckDep - Check a single dependency				/*{{{*/
| // ---------------------------------------------------------------------
| /* This prototype is a wrapper over CheckDep above. It's useful in the
|    cases where the kind of dependency matters to decide if it matches
|    or not */
| bool rpmVersioningSystem::CheckDep(const char *PkgVer,
| 				   pkgCache::DepIterator Dep)
| {
|    if (Dep->Type == pkgCache::Dep::Obsoletes &&
|        (PkgVer == 0 || PkgVer[0] == 0))
|       return false;
|    return CheckDep(PkgVer,Dep->CompareOp,Dep.TargetVer());
| }

I'm not sure if this "Obsoletes" logic should be enabled in WhatDepends.
But at least it can show "Requires" now, which is what I need.
2009-08-03 15:55:22 +04:00
Alexey Tourbin
bdb4cdf341 0.5.15lorg2-alt27
- depcache.cc: fixed for gcc-4.4
- buildlib/tools.m4: hackaround glibc soname change
- apt-cache.cc: added APT::Cache::DumpPackages option
2009-07-13 03:28:27 +04:00
Alexey Tourbin
81c112101f apt-cache.cc: added APT::Cache::DumpPackages option 2009-07-13 01:43:17 +04:00
Alexey Tourbin
e78206f1e5 buildlib/tools.m4: hackaround glibc soname change 2009-07-13 01:06:02 +04:00
Alexey Tourbin
fec2d4b78c depcache.cc: include <cstdio> 2009-07-12 23:54:56 +04:00
Alexey Tourbin
94f9c0dd62 0.5.15lorg2-alt26
- rpmpm.cc: try hard to fix package removal
2009-03-31 03:44:49 +04:00
Alexey Tourbin
8dec755ae0 rpmpm.cc: try hard to fix package removal 2009-03-31 03:44:36 +04:00
Alexey Tourbin
9e09c9f733 0.5.15lorg2-alt25
- rpmpm.cc: fixed removal of i586-*.32bit packages (Panu Matilainen)
2009-03-26 13:53:16 +03:00
pmatilai
c6b6e5d9ae - fix package removal on old rpm versions which don't support name.arch
for RPMDBI_LABEL, simplify the code while at it
(cherry picked from commit 9678cb8a55e7328246897b1172630ddfbf3e1636)
2009-03-26 13:44:55 +03:00
pmatilai
371bd63022 - don't try to look up CurrentVer() of noninstalled packages, duh
(Daisuke Suzuki)
(cherry picked from commit 55bf15da5b32193caf2508d1a6586c837d9c1f42)
2009-03-26 13:40:34 +03:00
pmatilai
3cbcc90c9d - clean up install/remove processing in rpmpm::Go()
- unmunge the multilib package names when removing
- always refer to packages with their architecture when removing, needed
  for multilib
(cherry picked from commit 0463f8ddbabf216dab9cb83fcb8f4a525d9298e5)
2009-03-26 13:38:04 +03:00
Alexey Tourbin
a583517439 0.5.15lorg2-alt24
- depcache.cc (MarkInstall): mark unambiguous dependencies first
2009-03-24 10:21:39 +03:00
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
Alexey Tourbin
3417b3b657 pkgcache.cc (AllTargets): return unique list
Each rpm package also provides its name.  So, since it makes sense
to check if AllTargets has only one target version (which means
unambiguous dependency), the list sould be made unique.
2009-03-23 09:33:44 +03:00
Alexey Tourbin
b609c9f7e6 apt-%version-%release.patch 2009-03-23 08:52:06 +03:00
Stanislav Ievlev
a04c3dc823 0.5.15lorg2-alt23
- open rpm database with O_CREAT flag
2009-01-19 17:38:14 +03:00
Stanislav Ievlev
96870b68f4 - 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
Slava Semushin
e7409ecffb 0.5.15lorg2-alt22.2
- apt-shell: print newline symbol during quit by Ctrl+D
  (Based on feedback for bug #18343 from Ivan A. Melnikov aka iv@)
2009-01-10 00:00:08 +06:00
Slava Semushin
403aa68686 quit_by_eof.patch: print newline before exit.
Be more accurate during exit by Ctrl+D.
Thanks to Ivan A. Melnikov <iv@altlinux> for feedback.
2009-01-09 23:52:48 +06:00
Slava Semushin
644f9d78d8 0.5.15lorg2-alt22.1
- apt-shell: show up "list" command by completion (#5953)
- apt-shell: quit from shell by Ctrl+D (#6264, #18343)
- apt-shell: describe -G and -g options in "help list" output (#18256)
2009-01-02 00:50:47 +06:00
Slava Semushin
13e93a217a apt-shell: describe -G and -g options in "help list" output (#18256)
FIXME: apt.be.po should be updated similar to apt.ru.po file.
2009-01-02 00:50:37 +06:00
52275b373d Rename apt-shell patches according to the policy 2008-12-30 20:45:12 +00:00
Slava Semushin
7956d444db apt-shell: quit from shell by Ctrl+D (#18343) 2008-12-31 02:11:46 +06:00
Slava Semushin
1c7245aad0 apt-shell: show up "list" command by completion (#5953)
And also added it to help output.
2008-12-31 02:02:29 +06:00
ecfa3c0fb8 0.5.15lorg2-alt22
- Fixed build with g++-4.3.x (Stanislav Ievlev).
2008-12-12 15:31:20 +00:00
bbdf66fff5 Additional fix required to build apt with g++-4.3.x on i586 2008-12-12 15:31:02 +00:00
Stanislav Ievlev
d20fc76a4d - fix build with gcc-4.3 2008-12-12 16:43:56 +03:00
dcb817f3ff Merge branch 'master' of git.alt:/people/avm/packages/apt 2008-11-27 22:42:25 +00:00
Alex V. Myltsev
d6ac8fcdfa 0.5.15lorg2-alt21
- fix by led@: change type of Package.ID to int (fixes #16900)
- fixes by raorn@:
 - apt-get.cc: protect VerTag (fixes #16311)
 - apt-get.cc: fix memory corruption (fixes #14929)
 - fileutl.cc: change semantics of flExtension() (fixes #15909)
2008-09-01 22:41:45 +04:00
Alexey I. Froloff
65a82cc0f2 Fix a memory corruption (altbug #14929). 2008-08-29 22:14:08 +04:00
Alex V. Myltsev
f2922999ae Change flExtension() to return the empty string if there is no extension.
This should fix #15909, thanks to raorn for investigating.
2008-08-29 22:14:00 +04:00
Alex V. Myltsev
c2a7ba45e0 Protect VerTag by pointing it to OrigS, not to S (closes #16311). 2008-08-29 22:13:52 +04:00
Alex V. Myltsev
418a824fd6 Change type of pkgCache::Package.ID to 'unsigned int'.
'unsigned short' breaks when there are more than 65535 packages.
2008-08-29 22:13:44 +04:00
06b3e692bd apt.spec: s/repositaries/repositories/ (ALT#14775) 2008-05-11 22:49:08 +00:00
Alexey Tourbin
92b2ba1c36 0.5.15lorg2-alt20
- genpkglist.cc: RPMTAG_FILEFLAGS should not be copied into header list
- lorg-cache-limit.patch: increase cache size limit
- removed old triggers, updated dependencies
2008-05-11 19:12:59 +04:00
Alexey Tourbin
b3abb08b99 spec (apt-utils): removed comment 2008-05-11 19:11:26 +04:00
Alexey Tourbin
1351d4a75c spec: removed URL part in Source0 2008-05-11 19:10:49 +04:00
Alexey Tourbin
ecbb921870 spec: removed *apt-0.5* obsoletes 2008-05-11 19:09:13 +04:00
Alexey Tourbin
f8e8cd00c6 spec: dropped very old triggers (Master 2.4 has apt-0.5.15cnc6-alt6) 2008-05-11 19:07:20 +04:00
Alexey Tourbin
d5ff215628 lorg-cache-limit.patch: increase cache size limit 2008-05-11 18:58:35 +04:00
Alexey Tourbin
ab496886f6 genpkglist.cc: RPMTAG_FILEFLAGS should not be copied into header list
(Or, at least, RPMTAG_FILEFLAGS should be copiled consistently with
RPMTAG_BASENAMES, RPMTAG_DIRNAMES, and RPMTAG_DIRINDEXES.)
2008-05-11 17:40:09 +04:00
Alexey Tourbin
6ba7ec5518 0.5.15lorg2-alt19
- lorg-pkgcachegen-selfprov.patch: allow self-referencing provides,
  so that e.g. ocaml-runtime#3.10.2-alt2 can provide ocaml-runtime = 3.10
2008-03-30 06:08:07 +04:00