Commit Graph

293 Commits

Author SHA1 Message Date
Kirill A. Shutemov
4b05315a84 set.c: optimize decode_golomb()
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
4d9409cb9c set.c: optimize putbits()
Use bit operations instead of cycles.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
6a9ce451bc set.c: use packed bitmap for bit vector
Currently, set.c uses array of chars to store bit vector. Each char
stores one bit: 0 or 1.

Let's use packed bitmap instead. It creates room for optimizations.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
6afa2793f8 set.c: cleanup self-tests
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
82a064020b set.c: use function-like syntax for sizeof.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
d7ece41758 set.c: do not mix declarations and code
Let's move variable declarations to the begin of blocks.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:58:43 +00:00
Kirill A. Shutemov
82da3b0f49 set.c: slightly reformat code to increase its readability
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:57:43 +00:00
Kirill A. Shutemov
5c39279236 set.c: fixup self-test functions declaration
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
Kirill A. Shutemov
4226027fbb set.c: get rid of nested functions
Nested function in C is GCC extension.
Let's try to follow ANSI C syntax.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
Kirill A. Shutemov
75a4506d75 set.c, set.h: get rid of C++-style comments
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2010-12-07 16:56:19 +00:00
c7167f0395 lib/depends.c (rpmRangesOverlap): optimize out unneeded calls to printDepend()
This optimization speeds up rpmRangesOverlap() by 10%.
2010-12-04 17:30:16 +00:00
Alexey Tourbin
fc5b5a5f7d set.c: implemented LRU caching (2x speed-up, 1M footprint) 2010-12-04 13:11:45 +03:00
7c35077bf5 Link librpm with libbeecrypt 2010-10-20 09:04:43 +00:00
Alexey Tourbin
2463074998 set.c: corrected set_free() return type 2010-10-12 03:14:10 +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
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
Mikhail Efremov
f92be4b40e Added SELinux support
Mostly backported from rpm-4.8
2010-08-24 16:59:07 +00: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
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
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
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
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
Alexey Tourbin
994c5675a8 further removed RPMDBI_DEPENDS 2010-07-12 10:02:00 +04:00
Alexey Tourbin
c6943fb0f2 depends.c: further removed dying code 2010-07-12 10:01:55 +04:00
Alexey Tourbin
cf70d66c4e depends.c: disabled dbi-based dependency caching
Based on rpm.org 6bc5d870 by Panu Matilainen:
> Rip out dependency caching
> - it doesn't speed up things that much, is broken in some chroot
>   scenarios and is ugly ugly hardwired BDB hackery where it doesn't belong
2010-07-12 10:01:29 +04:00
Alexey Tourbin
63da9b7043 rpmdb.c: make rpmdb index list hard-wired, remove unused require- and provideversion indexes
based rpm.org changes by Panu Matilainen:
fb2a6cb Make rpmdb index list hard-wired
e23a2bf Remove unused require- and provideversion indexes
2a52cc8 Remove unused _DBI defines
2010-04-21 11:52:25 +04:00
Alexey Tourbin
f2d8576dae order.c: added missing error message 2010-03-16 15:06:10 +03:00
Alexey Tourbin
a8e1fe9fa1 order.c: identify Requires(auto) as plain Requires 2010-03-16 15:04:09 +03:00
Alexey Tourbin
a599f8f9c1 order.c: explain why things work properly 2010-03-16 15:04:05 +03:00
Alexey Tourbin
3d98659409 depends.c: need to export printDepend() 2010-03-16 15:03:27 +03:00
Alexey Tourbin
797f0ff2a5 order.c: factored from depends.c 2010-03-16 15:03:23 +03:00
Alexey Tourbin
df4147a97c al.c: introduced "fasthash" to improve bsearch performance 2010-03-12 11:20:56 +03:00
f2e4129237 rpmrc.c (is_pentiumN): Add models with nonzero extended model
http://www.intel.com/assets/pdf/appnote/241618.pdf table 2-3.
Reported by Alexander Sharapov.
2009-12-20 15:06:21 +00:00
Alexey Tourbin
2534a73873 4.0.4-alt97.M50.20
- depends.c: avoid expression dependent on evaluation order
- depends.c: implemented automatic realloc
- al.c: factored from depends.c
- al.c: reimplemented alProvIndex and alDirIndex/alFileIndex routines
2009-10-04 12:55:45 +04:00
Alexey Tourbin
7f0aa5d96d al.c: optimize out rpmRangesOverlap call for unversioned dependencies 2009-10-04 12:44:40 +04:00
Alexey Tourbin
09751027bf al.c: removed extra arguments in alAllSatisfiesDepend 2009-10-04 12:44:38 +04:00
Alexey Tourbin
ffeac246e1 al.c: merged FileSatisfiesDepend into alAllSatisfiesDepend, full unique list 2009-10-04 12:44:37 +04:00
Alexey Tourbin
f49976fd21 al.c: reimplemented alDirIndex and alFileIndex 2009-10-04 12:44:36 +04:00
Alexey Tourbin
216526577b al.c: reimplemented alProvIndex, removed alMakeIndex() 2009-10-04 12:44:35 +04:00
Alexey Tourbin
aee6223979 al.c: implemented generic alIndex routines 2009-10-04 12:44:34 +04:00
Alexey Tourbin
5c8817985a al.c: factored from depends.c 2009-10-04 12:44:33 +04:00
Alexey Tourbin
d9e8ab64f5 depends.c: turned availableIndex.index into flexible array 2009-10-04 12:44:32 +04:00
Alexey Tourbin
f14e4a1fd9 depends.c: implemented automatic realloc 2009-10-04 12:44:30 +04:00
Alexey Tourbin
f9e7f3e6e0 depends.c: avoid expression dependent on evaluation order
In alAddPackage(), ts->addedPackages.list can be reallocated with
realloc().  So it is not safe to use ts->addedPackages.list in the
same expression.
2009-10-04 12:44:28 +04:00
Alexey Tourbin
4ad3f315dc 4.0.4-alt97.M50.19
- Removed support for availablePackages/suggestedPackages.
- Removed rebuilddb db_filter_dups code (Panu Matilainen).
2009-10-01 04:44:10 +04:00
Alexey Tourbin
55ef8cfed5 removed support for availablePackages/suggestedPackages 2009-10-01 04:38:09 +04:00
Alexey Tourbin
f68c71a2d5 4.0.4-alt97.M50.18
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:30:39 +04:00
Alexey Tourbin
6795a36bb1 great removal 2009-09-29 15:29:52 +04:00
Alexey Tourbin
79be480d0e 4.0.4-alt97.M50.16
- rpmio: Updated lzma compression routines for xz-5.0 API.
- Packaged /usr/bin/rpm2cpio.static.
2009-09-24 12:48:17 +04:00
Alexey Tourbin
7407fd6de4 pack.c, rpmlibprov.c: updated for xz compression 2009-09-24 12:35:43 +04:00
Alexey Tourbin
0b739a3a9f psm.c, rpm2cpio.c: updated for xz decompression 2009-09-24 12:35:37 +04:00
04d5860a7b lib/header_internal.c (headerGetLangs): Fix stupid X<=Y<=Z comparison
(cherry picked from commit 4ce1b4bead)
2009-09-24 11:36:29 +04:00
Alexey Tourbin
31dc64497c 4.0.4-alt97.M50.12
- Removed _noDirTokens support (producing legacy filelist format).
- Disabled rpmlib(PayloadFilesHavePrefix), rpmlib(CompressedFileNames),
  and rpmlib(VersionedDependencies) dependencies.
- Disabled versioning for rpmlib(PayloadIsBzip2) and rpmlib(PayloadIsLzma)
  dependencies.
2009-06-17 06:43:27 +04:00
Alexey Tourbin
23317f11b7 removed _noDirTokens (producing legacy filelist format)
Some code (e.g. apt/genpkglist) explicitly relies on the fact that
header file list is represented with baseNames+dirNames+dirIndexes
arrays.  Thus, generating legacy headers might have issues, and should
be disabled.
2009-06-17 06:32:18 +04:00
Alexey Tourbin
a15d548dec lib/depends.c: adjust provides check for versioned paths
(cherry picked from commit fb5f3e4c88)
2009-06-17 06:30:53 +04:00
Alexey Tourbin
4a6b102862 4.0.4-alt97.M50.11
- Remove artificial limit in dependency loop elimination attempts (Panu Matilainen).
2009-06-14 05:39:30 +04:00
Alexey Tourbin
de903ed718 4.0.4-alt95.M41.20
- Remove artificial limit in dependency loop elimination attempts (Panu Matilainen).
2009-06-14 05:38:27 +04:00
Panu Matilainen
3dfb7d4b01 Remove artificial limit in dependency loop elimination attempts
- continue processing as long as progress can be made instead of artificial
  hardcoded magic "try ten times"

[rpm.org f39d2432f74bdc328ceafa8abc6cac517e02c73b]
2009-06-14 05:34:36 +04:00
Alexey Tourbin
ed0daa3c53 4.0.4-alt97.M50.8
- package.c (readPackageHeaders): Use posix_fadvise(2) to disable readahead.
  When scanning a large number of packages (with e.g. rpmquery), readahead
  might cause negative effects on the buffer cache.
2009-05-10 23:59:41 +04:00
Alexey Tourbin
9e87611786 4.0.4-alt95.M41.18
- package.c (readPackageHeaders): Use posix_fadvise(2) to disable readahead.
  When scanning a large number of packages (with e.g. rpmquery), readahead
  might cause negative effects on the buffer cache.
2009-05-10 23:41:33 +04:00
Alexey Tourbin
66b17f5fd5 package.c (readPackageHeaders): use posix_fadvise(2) to disable readahead 2009-05-10 23:32:48 +04:00
Alexey Tourbin
af944d993e package.c (readPackageHeaders): factored do_readPackageHeaders 2009-05-10 23:32:43 +04:00
258aa58b05 lib/psm.c (rpmVersionCompare): Handle omitted tags
Now it can handle headers with RPMTAG_VERSION/RPMTAG_RELEASE tags omitted.
2009-04-14 16:37:54 +00:00
e957d80905 lib/psm.c (rpmVersionCompare): Optimize code
RPMTAG_BUILDTIME and RPMTAG_EPOCH comparisons use the same algorithm.
Now they use the same code, too.
2009-04-14 16:37:53 +00:00
Alexey Tourbin
a8575523ec 4.0.4-alt97.M50.3
- Improved fingerprint cache performance (credits: Florian Festi).
2009-03-26 11:38:00 +03:00
Alexey Tourbin
0890b6456f 4.0.4-alt95.M41.15
- Improved fingerprint cache performance (credits: Florian Festi).
2009-03-26 11:23:19 +03:00
Alexey Tourbin
6a2cc38410 fprint.c: fpCacheFree returns NULL 2009-03-26 11:20:07 +03:00
Alexey Tourbin
dba96abac5 deal with fpCacheCreate() size parameter 2009-03-26 11:19:53 +03:00
Alexey Tourbin
02104ae61f Use only one, global fingerPrintCache to save a lot of stat calls
[Based on rpm.org af80c3de by Florian Festi.]
2009-03-26 11:19:43 +03:00
Alexey Tourbin
6d4fea769d jhash.h, rpmhash.c: switch to Jenkins One-at-a-time hash 2009-03-26 11:19:01 +03:00
Alexey Tourbin
c4170e6003 rpmhash.c: htFree() takes freeKey and freeData fns and returns NULL 2009-03-26 11:17:46 +03:00
Alexey Tourbin
d4b7714b36 rpmhash.c: removed keySize arg from htCreate() 2009-03-26 11:17:14 +03:00
Alexey Tourbin
07c1a647d4 4.0.4-alt97.M50.2
- Removed prehistoric multilib support.
2009-03-10 14:39:35 +03:00
Alexey Tourbin
3995f6a271 4.0.4-alt95.M41.14
- Removed prehistoric multilib support.
2009-03-10 14:37:49 +03:00
Alexey Tourbin
aebc9a42dd removed prehistoric multilib support 2009-03-10 14:27:38 +03:00
Alexey Tourbin
07e59dab46 4.0.4-alt97.M50.1
- alt97.M50 release series is for branch 5.0, alt98 is for Sisyphus.
- Updated %config algorithm to avoid unnecessary *.rpmnew, *.rpmsave,
  and *.rpmorig files (credits: Panu Matilainen, Tomas Mraz).
  + If new package keeps the same config file, updating the file on disk
    is skipped (rhbz#194246).  This provides limited support for replacing
    config files with custom symbolic links.
  + If pre-existing file is the same as the one being installed for
    the first time, backup action is suppress (rhbz#128622).
  + Backup action is also disabled but for regular files and symlinks.
2009-03-09 21:06:06 +03:00
Alexey Tourbin
098c3256ab 4.0.4-alt95.M41.13
- Updated %config algorithm to avoid unnecessary *.rpmnew, *.rpmsave,
  and *.rpmorig files (credits: Panu Matilainen, Tomas Mraz).
  + If new package keeps the same config file, updating the file on disk
    is skipped (rhbz#194246).  This provides limited support for replacing
    config files with custom symbolic links.
  + If pre-existing file is the same as the one being installed for
    the first time, backup action is suppress (rhbz#128622).
  + Backup action is also disabled but for regular files and symlinks.
2009-03-09 20:59:18 +03:00
Alexey Tourbin
822062204d transaction.c: shorter local names in decideConfigFate 2009-03-09 20:13:10 +03:00
Alexey Tourbin
52e51f6ae6 Avoid unnecessary .rpmnew and .rpmsave files (rhbz#128622)
[Based on rpm.org ebfbc82b by Panu Matilainen.]

Don't create .rpmnew and .rpmsave files when file/symlink on disk differs
just by timestamp. Patch by Tomas Mraz.
2009-03-09 20:13:08 +03:00
Alexey Tourbin
329d84a5d8 transaction.c: simplified SAVE/ALTNAME/CREATE condition 2009-03-09 20:13:08 +03:00
Alexey Tourbin
7bb2ab740a transaction.c: use explicit conditions for newWhat 2009-03-09 20:13:07 +03:00
Alexey Tourbin
be808f57ca Avoid .rpmnew when the file hasn't changed in package (rhbz#194246)
[Based on rpm.org e64bf5b9 by Panu Matilainen.]

The current behavior of %config(noreplace) creates a .rpmnewfile iff the type
of the current file has been changed wrto what was originally installed.

The patch changes this behavior so when old and new (in db and in package) is
identical -> not changed, the function returns FA_SKIP -> it won't clobber
anything, it simply skips installation of the file from the package.
This patch handles also the opposite case when old and new packages contain
%config symlink and we have regular file on disk.

Patch from Tomas Mraz.
2009-03-09 20:13:05 +03:00
Alexey Tourbin
ebf4093293 transaction.c: further decideConfigFate() tweaks 2009-03-09 20:13:02 +03:00
Alexey Tourbin
0ee67602ee transaction.c: revamped decideFileFate() akin to filecmp() 2009-03-09 20:11:22 +03:00
Alexey Tourbin
f9c067a1ad psm.[ch]: skip fuser and fgroup test/set for src.rpm
Previous change in loadFi() triggers the code which depends
on fi->fuser and fi->fgroup being NULL for source rpms.
Now I add explicit check for source rpms.

Update: also turn off suid/sgid bits for src.rpm.
(cherry picked from commit 070b65040e)
2009-03-08 20:12:41 +03:00