Commit Graph

1608 Commits

Author SHA1 Message Date
Alexey Tourbin
e1f0ef1fe5 build/parseReqs.c: make dependencies on rpmlib(SetVersions) feature 2010-10-04 01:20:22 +04:00
Alexey Tourbin
49066900de lib.req: updated underlinking check for file-level dependencies 2010-10-04 00:08:27 +04:00
Alexey Tourbin
d1ced258db lib.req: implemented set-versions for soname dependencies 2010-10-01 08:48:48 +04:00
Alexey Tourbin
e1970e44d5 lib.prov (SuggestBPP): minor glitch in description 2010-10-01 08:30:45 +04:00
Alexey Tourbin
dee07e402b ldd.in: added --bindings option 2010-10-01 01:57:35 +04:00
Alexey Tourbin
973e4d19b3 lib.req: reindented, no changes 2010-09-30 17:16:12 +04:00
271952beb7 4.0.4-alt98.48
- 0common-files.req.list: Added /etc/sysctl.d, /lib/udev/rules.d,
  /lib64/udev and /lib64/udev/rules.d entries.
2010-09-24 11:16:50 +00:00
0b8394d51d 0common-files.req.list: add /lib64/udev and /lib64/udev/rules.d
Neither /lib64/udev nor /lib64/udev/rules.d is going to be provided.
These lines will just result to unmet requirements.
2010-09-24 10:46:36 +00:00
bec54ac071 0common-files.req.list: add /etc/sysctl.d 2010-09-24 10:22:39 +00:00
b55f8b12a5 0common-files.req.list: add /lib/udev/rules.d 2010-09-24 09:39:42 +00:00
Alexey Tourbin
fc1578bf5b 4.0.4-alt98.47
- set.c (rpmsetcmp): Fixed check for set2 decoding error.
- brp-cleanup: Updated for /usr/lib64/perl5 and /usr/share/perl5.
2010-09-20 21:47:22 +04:00
Alexey Tourbin
49950b83b6 brp-cleanup: updated for /usr/lib64/perl5 and /usr/share/perl5 2010-09-19 09:58:12 +04:00
Alexey Tourbin
50a7eb6602 set.c: minor fixes, no changes 2010-09-19 09:56:00 +04:00
Alexey Tourbin
ca83cfb381 set.c (rpmsetcmp): set2 err fix 2010-09-13 18:54:45 +04:00
Alexey Tourbin
6dc4825087 4.0.4-alt98.46
- set.c: Implemented base62, golomb, and set-string routines.
- depends.c (rpmRangesOverlap): Added support for set-versions.
- rpmlibprov.c: Added rpmlib(SetVersions) feature.
- %_rpmlibdir/mkset: Command-line helper for making set-versions.
- lib.prov: Implemented soname set-versioning with exported symbols.
2010-09-11 02:48:56 +04:00
Alexey Tourbin
e70027f478 lib.prov: implemented soname set-versioning with exported symbols 2010-09-11 02:32:12 +04:00
Alexey Tourbin
5f10a0f256 lib.prov: reindented, minor changes 2010-09-11 02:20:58 +04:00
Alexey Tourbin
5e8118e213 tools/mkset.c, tools/setcmp.c: command-line helpers 2010-09-11 02:09:55 +04:00
Alexey Tourbin
9fabff6e7a rpmlibprov.c: added rpmlib(SetVersions) feature 2010-09-11 01:58:23 +04:00
Alexey Tourbin
3e9adcff64 depends.c (rpmRangesOverlap): added support for set-versions 2010-09-11 01:58:13 +04:00
Alexey Tourbin
a6d2902271 set.c: implemented base62, golomb, and set-string routines 2010-09-11 01:34:05 +04:00
2e0c9f4f43 4.0.4-alt98.45
- Added SELinux support (by Mikhail Efremov and me).
2010-08-25 16:03:28 +00:00
Mikhail Efremov
e35b78cf6f Update specfile for SELinux support 2010-08-24 16:59:19 +00:00
Mikhail Efremov
f92be4b40e Added SELinux support
Mostly backported from rpm-4.8
2010-08-24 16:59:07 +00:00
Alexey Tourbin
df21cab192 4.0.4-alt98.44
- depends.c: Permit self-conflicting packages.
- verify.c: Updated verifyDependencies() for self-conflicting packages.
2010-08-22 03:26:42 +04:00
Alexey Tourbin
0e2e506379 depends.c: do not check installed Conflicts against addedPackages names
In build.c:checkSpec(), build dependencies are checked by creating
a transaction, adding source header to the transaction and then running
rpmdepCheck().  Source headers have only BuildRequies and BuildConflicts
types of dependencies (no regular Requires and Conflicts).  Also, source
packages have no Provides, but they have NAMES.  When a self-conflicting
package is installed, its self conflict will be triggered by the source
package name.

To fix the problem, note that binary packages explicitly provide
their N=EVR among Provides; and source packages provides nothing,
even the name.  So the solution is as simple as not to check
the dependencies against package names.

Update: also, do not check installed Requires against erasedPackages names.
2010-08-22 03:20:50 +04:00
Alexey Tourbin
6684fd8ee5 verify.c: updated verifyDependencies() for self-conflicting packages
To check the dependencies of an installed package, a "transaction" is
created, and the package is added to the transaction.  The transaction
is then checked with rpmdepCheck().  However, since the installed
package has not been marked for removal, a conflict can be triggered
between the installed and that of transaction copies of the package.
The right thing to do is to mark package for removal, re-add it to
the transaction, and then to check the dependencies.
2010-08-22 02:30:13 +04:00
Alexey Tourbin
de60ab01a3 header.c: backported headerSetInstance() and headerGetInstance() from rpm.org
Header instance is its number in /var/lib/rpm/Packages database.
When a header comes from the database, it is sometimes useful to know
its instance (I need this to adjust verify.c:verifyDependencies() for
self-conflicting packages).  On the contrary, setting instance numbers
should happen only within librpmdb, which is why headerSetInstance()
comes with hidden visibility.
2010-08-22 02:16:02 +04:00
Alexey Tourbin
e8c5b7ad21 depends.c: permit self-conflicting packages
Only for the last two weeks or so, the issues has been raised twice.
By specifying "Provides: foo, Conflicts: foo", people expect that
other packages which provide "foo" will not be installed along with
the package.  What people don't anticipate is that the package will
conflict with itself, and will not be installed at all.  This is where
apt and rpm differ.  In apt, "conflicts may never self match".  In rpm,
Requires and Conflicts are handled in exactly the same way, except that
Requires should match, and Conflicts should not match (I call this
a symmetry).  Both can match against the package they come from.

So, to permit self-conflicting packages, I have to break the symmetry
and pass additional argument which indicates the type of dependency
being processed (either Requires or Conflicts).  The code is then
adjusted to discard self-matching Conflicts.

Obsoletes should be handled specially, too.  In tsSatisfiesDepend(),
I attempt to handle the Obsoletes case as well.  It is rather
unfortunate that, in rpmdepCheck(), Obsoletes are simply not checked
just yet.
2010-08-22 01:04:41 +04:00
Alexey Tourbin
682646a657 depends.c: made dbProvCache global (static __thread)
Passing this "implicit" argument from a toplevel API function
down to dbSatisfiesDepends() looks too ugly.
2010-08-19 00:37:23 +04:00
Alexey Tourbin
1fde6a24b4 4.0.4-alt98.43
- depends.c: A better solution to dbProvCache dangling pointers without
  resorting to strdup (ALT#23811).
2010-08-18 15:12:31 +04:00
Alexey Tourbin
adce826c53 depends.c: better solution for dbProvCache dangling pointers without resorting to strdup 2010-08-18 14:28:08 +04:00
Alexey Tourbin
da0408ae20 Revert "depends.c (dbSatisfiesDepend): strdup dbProvCache keys (ALT#23811)"
This reverts commit c9b1f0e2ec.
2010-08-18 11:56:59 +04:00
Alexey Tourbin
9a2de051e3 4.0.4-alt98.42
- Added .gitignore file, improved support for in-tree building.
- Removed %__ccache* macros (rpm will use default ccache settings).
2010-08-17 19:22:39 +04:00
Alexey Tourbin
19fdccc850 platform.in: removed %__ccache* macros
I enable ccache in my ~/.zshrc:
export GCC_USE_CCACHE=1
export CCACHE_DIR=$TMPDIR/.ccache
export CC=gcc CXX=g++

Now, under default rpm settings, ccache IS used with rpm, but the cache
directory is changed to ~/.ccache (since CCACHE_DIR is unset).

$ du -hs $TMPDIR/.ccache ~/.ccache
13M     /tmp/.private/at/.ccache
39M     /home/at/.ccache
$

These macros were added long ago.  Now we use hasher for final builds.
It's okay to use default ccache settings for local builds.
2010-08-17 19:22:28 +04:00
Alexey Tourbin
202244526d added .gitignore, improved support for in-tree building
Here is how to run configure within the source tree:
$ rpm -bE --enable debug *.spec |sed -n '/^%build$/,/^%install$/{/^%build$/d;/^%install$/d;p}' |sh -ex

There's still problem: po/Makefile.in is getting added to
configure.ac:AC_OUTPUT, and when running autoreconf for the second time,
it will die as follows.

    autoreconf-default: running: aclocal -I m4 --force -I m4
    configure.in:896: error: `po/Makefile.in' is already registered with AC_CONFIG_FILES.
    ../../lib/autoconf/status.m4:290: AC_CONFIG_FILES is expanded from...
    configure.in:896: the top level
    autom4te-2.60: /usr/bin/m4 failed with exit status: 1
2010-08-17 19:20:40 +04:00
c6b62ae933 4.0.4-alt98.41
- Migrated to beecrypt-4.2.1 (by Kirill A. Shutemov).
2010-08-12 21:01:34 +00:00
Kirill A. Shutemov
0ed9eed845 Migrate to new libbeecrypt
Let's try to use recent libbeectypt in our World Best RPM.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2010-08-12 20:41:06 +00:00
Alexey Tourbin
74183e0ce3 4.0.4-alt98.40
- build/files.c (parseForSimple): Fix potential NULL pointer dereference
  (Dmitry V. Levin, ALT#23813).
- depends.c (dbSatisfiesDepend): Use strdup for dbProvCache keys
  to avoid dangling pointers (ALT#23811).
2010-08-05 19:17:58 +04:00
Alexey Tourbin
c9b1f0e2ec depends.c (dbSatisfiesDepend): strdup dbProvCache keys (ALT#23811)
My previous assumption that strdup() was not needed for dbProvCache keys
was wrong.  The keys point to header memory, which is right.  However,
those are not only ts->addedPackages and ts->erasedPackages headers.
In checkDependent(), headers come from rpmdb and are disposed immediately
after the check.
2010-08-05 18:27:02 +04:00
cb105c88c8 build/files.c (parseForSimple): Fix potential NULL pointer dereference (ALT#23813) 2010-07-27 18:12:41 +00:00
Alexey Tourbin
0e7d2dcb99 4.0.4-alt98.39
- depends.c: Introduced ts->erasedPackages list of headers.
- depends.c: Replaced dbi-based dependes cache with rpmhash-based
  providename cache (based on rpm.org changes by Panu Matilainen).
2010-07-12 11:41:51 +04:00
Alexey Tourbin
b08133537b al.c: lazy creation of al->dirIndex and al->provIndex
For erasedPackages, the dirIndex and provIndex are unused, and
thus should not be created at all.  There is arguably a better
option - to provide explicit alMakeIndex and alFreeIndex API.
2010-07-12 11:39:28 +04:00
Alexey Tourbin
7a1f3ed06d depends.c: provided actual dbProvCache implementation
Based on rpm.org 2e76d0e6 by Panu Matilainen:
> Add in-memory hash for caching rpmdb dependency lookups
> - worst case behavior for uncached dependency lookups can be disastrous,
>   eg > 35s vs < 1s on my laptop for trying to remove /bin/sh provider
> - we only bother caching rpmdb lookups, the other cases plenty fast already
> - using in-memory cache avoids nasty in vs out of chroot issues with
>   temporary db files, which otherwise were about as fast

However, we do not use full-blown printDepend-based caching (i.e.
we no longer cache depends with versions).  This is because, well,
dependency versions are likely to differ.  This is especially true
if we consider upcoming set-versions for soname symbols - hashing
symbol sets here will be just a waste of time and memory.  And so
now we cache satisfied/unsatisfied depends by just name.  Thus,
"yes" hit can be used immediately only for unversioned dependences.

Top 10 dependencies which will be handled by the cache:
$ rpm -qaR |grep -v rpmlib |grep -v = |sort |uniq -c |sort -n |tail
    245 /usr/lib/perl5/vendor_perl
    311 libm.so.6(GLIBC_2.2.5)(64bit)
    386 libpthread.so.0(GLIBC_2.2.5)(64bit)
    454 /lib64/ld-linux-x86-64.so.2
    548 libc.so.6(GLIBC_2.3)(64bit)
    587 /bin/sh
    828 libc.so.6(GLIBC_2.3.4)(64bit)
    906 libc.so.6(GLIBC_2.4)(64bit)
   1128 rtld(GNU_HASH)
   1140 libc.so.6(GLIBC_2.2.5)(64bit)
$

Top 10 dependencies which will not be handled by the cache:
$ rpm -qaR |grep -v rpmlib |grep -e = |sort |uniq -c |sort -n |tail
     13 python-base = 2.6.5-alt2
     14 mono(mscorlib) = 1.0
     15 qt4-common = 4.6.2-alt6
     16 mono(mscorlib) = 2.0
     18 mktemp >= 1:1.3.1
     20 koffice-common = 4:2.2.0-alt2
     20 perl-base >= 1:5.8.0
     23 alternatives >= 0:0.4
     49 libqt4-core >= 4.6.2
     54 perl-base >= 1:5.6.0
$

Here's a simple test to see if the cache works (using Panu's example -
trying to remove /bin/sh).

(before this change)
$ time LD_LIBRARY_PATH=$PWD/1 rpm -e --test sh 2>&1 |tail
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by libgnome-sharp-2.24.1-alt1
        /bin/sh   is needed by kernel-image-std-def-2.6.32-alt15
        /bin/sh   is needed by kernel-image-std-def-2.6.32-alt15
        /bin/sh   is needed by kde4libs-4.4.5-alt1
        /bin/sh   is needed by kde4base-runtime-core-4.4.5-alt1
        /bin/sh   is needed by kde4base-konqueror-4.4.5-alt1
        /usr/lib/bash is needed by bash-builtin-lockf-0.3.1-alt1
rpm -e --test sh 2>&1  6.18s user 3.44s system 94% cpu 10.182 total
$

(after this change)
$ time LD_LIBRARY_PATH=$PWD/2 rpm -e --test sh 2>&1 |tail
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by groff-base-1.20.1-alt0.20091013
        /bin/sh   is needed by libgnome-sharp-2.24.1-alt1
        /bin/sh   is needed by kernel-image-std-def-2.6.32-alt15
        /bin/sh   is needed by kernel-image-std-def-2.6.32-alt15
        /bin/sh   is needed by kde4libs-4.4.5-alt1
        /bin/sh   is needed by kde4base-runtime-core-4.4.5-alt1
        /bin/sh   is needed by kde4base-konqueror-4.4.5-alt1
        /usr/lib/bash is needed by bash-builtin-lockf-0.3.1-alt1
rpm -e --test sh 2>&1  0.11s user 0.09s system 91% cpu 0.218 total
$
2010-07-12 11:39:27 +04:00
Alexey Tourbin
d35a165dc3 depends.c: pass dbProvCache parameter down to dbSatisfiesDepend
This is a bit ugly but this is probably still a bit better than
extending the ts structure.
2010-07-12 11:39:26 +04:00
Alexey Tourbin
945417c34f depends.c: updated for ts->erasedPackages 2010-07-12 11:39:25 +04:00
Alexey Tourbin
17a1de0d63 transaction.c: updated for ts->erasedPackages 2010-07-12 11:39:24 +04:00
Alexey Tourbin
d392376ed7 depends.c: added initial support for ts->erasedPackages list
Before this change, only rpm headers for addedPackages were loaded
during transaction; for removedPackages, we only stored the list
of rpmdb header numbers (numeric instances).  With this change,
removedPackages' headers are getting loaded, too (the list is called
erasedPackages).  The reason is that, when a header is loaded,
it is possible to use pointers to point e.g. into header strings
without using strdup.  This might come useful as we try to reimplement
the depends cache.
2010-07-12 11:37:40 +04:00
Alexey Tourbin
83a71d080d depends.c: merged check{PackageSet,Dependent{Packages,Conflicts}} into checkDependent 2010-07-12 10:04:41 +04:00
Alexey Tourbin
fc5bc9b582 depends.c: renamed unsatisfiedDepend -> tsSatisfiesDepends, factored dbSatisfiesDepends
Based on rpm.org ccb545f0 "Refactor rpmdb lookups..." by Panu Matilainen.
2010-07-12 10:03:19 +04:00