rpms/rpm/devel rpm-4.6.0-rc1-fp-hash.patch, NONE, 1.1 rpm.spec, 1.303, 1.304
Panu Matilainen
pmatilai at fedoraproject.org
Tue Oct 28 14:24:35 UTC 2008
Author: pmatilai
Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8303
Modified Files:
rpm.spec
Added Files:
rpm-4.6.0-rc1-fp-hash.patch
Log Message:
- Florian's improved fingerprinting hash algorithm from upstream
rpm-4.6.0-rc1-fp-hash.patch:
--- NEW FILE rpm-4.6.0-rc1-fp-hash.patch ---
diff --git a/lib/fprint.c b/lib/fprint.c
index d31a694..b763a38 100644
--- a/lib/fprint.c
+++ b/lib/fprint.c
@@ -183,16 +183,13 @@ unsigned int fpHashFunction(const void * key)
{
const fingerPrint * fp = key;
unsigned int hash = 0;
- char ch;
- const char * chptr;
+ int j;
- ch = 0;
- chptr = fp->baseName;
- while (*chptr != '\0') ch ^= *chptr++;
+ hash = hashFunctionString(fp->baseName);
+ if (fp->subDir) hash ^= hashFunctionString(fp->subDir);
- hash |= ((unsigned)ch) << 24;
- hash |= (((((unsigned)fp->entry->dev) >> 8) ^ fp->entry->dev) & 0xFF) << 16;
- hash |= fp->entry->ino & 0xFFFF;
+ hash ^= ((unsigned)fp->entry->dev);
+ for (j=0; j<4; j++) hash ^= ((fp->entry->ino >> (8*j)) & 0xFF) << ((3-j)*8);
return hash;
}
Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.303
retrieving revision 1.304
diff -u -r1.303 -r1.304
--- rpm.spec 25 Oct 2008 05:09:57 -0000 1.303
+++ rpm.spec 28 Oct 2008 14:24:04 -0000 1.304
@@ -18,7 +18,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: 0.%{snapver}.5
+Release: 0.%{snapver}.6
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -37,6 +37,7 @@
Patch201: rpm-4.6.0-rc1-skip-equal-nevr.patch
Patch202: rpm-4.6.0-rc1-noarch-subpkg.patch
Patch203: rpm-4.6.0-rc1-defaultdocdir.patch
+Patch204: rpm-4.6.0-rc1-fp-hash.patch
# These are not yet upstream
Patch300: rpm-4.5.90-posttrans.patch
@@ -174,6 +175,7 @@
%patch201 -p1 -b .skip-equal-nevr
%patch202 -p1 -b .noarch-subpkg
%patch203 -p1 -b .defaultdocdir
+%patch204 -p1 -b .fp-hash
# needs a bit of upstream love first...
#%patch300 -p1 -b .posttrans
@@ -364,6 +366,9 @@
%doc doc/librpm/html/*
%changelog
+* Tue Oct 28 2008 Panu Matilainen <pmatilai at redhat.com>
+- Florian's improved fingerprinting hash algorithm from upstream
+
* Sat Oct 25 2008 Panu Matilainen <pmatilai at redhat.com>
- Make noarch sub-packages actually work
- Fix defaultdocdir logic in installplatform to avoid hardwiring mandir
More information about the scm-commits
mailing list