From 18c8687d6993231b9b71fe81aa963d98edd70672 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Oct 28 2008 14:24:04 +0000 Subject: - Florian's improved fingerprinting hash algorithm from upstream --- diff --git a/rpm-4.6.0-rc1-fp-hash.patch b/rpm-4.6.0-rc1-fp-hash.patch new file mode 100644 index 0000000..2bb750f --- /dev/null +++ b/rpm-4.6.0-rc1-fp-hash.patch @@ -0,0 +1,26 @@ +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; + } diff --git a/rpm.spec b/rpm.spec index 0f3dcf4..b2d80dd 100644 --- a/rpm.spec +++ b/rpm.spec @@ -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 @@ Patch200: rpm-4.6.0-rc1-permit-tab.patch 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 @@ that will manipulate RPM packages and databases. %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 @@ exit 0 %doc doc/librpm/html/* %changelog +* Tue Oct 28 2008 Panu Matilainen +- Florian's improved fingerprinting hash algorithm from upstream + * Sat Oct 25 2008 Panu Matilainen - Make noarch sub-packages actually work - Fix defaultdocdir logic in installplatform to avoid hardwiring mandir