fix: alAddPackage sorted dirNames too soon, destroying dirMapping.
CVS patchset: 3481
CVS date: 1999/12/15 15:51:30
- fix: ftpAbort must close the data channel to read abort status.
- perform glob on remote ftp install args.
- fix: reload macros from cmd line when re-reading config files.
+ - fix: compressFileList was over-generating dirNames.
+ - fix: alAddPackage sorted dirNames too soon, destroying dirMapping.
3.0.2 -> 3.0.3
- add --eval to find result of macro expansion.
if (al->numDirs)
free(al->dirs);
- al->dirs = NULL;
+ al->dirs = NULL;
if (al->alloced && al->list)
free(al->list);
static int dirInfoCompare(const void * one, const void * two) {
const struct dirInfo * a = one;
const struct dirInfo * b = two;
+ int lenchk = a->dirNameLen - b->dirNameLen;
+ if (lenchk)
+ return lenchk;
+ /* XXX FIXME: this might do "backward" strcmp for speed */
return strcmp(a->dirName, b->dirName);
}
for (dirNum = 0; dirNum < numDirs; dirNum++) {
dirNeedle.dirName = (char *) dirNames[dirNum];
+ dirNeedle.dirNameLen = strlen(dirNames[dirNum]);
dirMatch = bsearch(&dirNeedle, al->dirs, origNumDirs,
sizeof(dirNeedle), dirInfoCompare);
if (dirMatch) {
dirMapping[dirNum] = dirMatch - al->dirs;
} else {
+ dirMapping[dirNum] = al->numDirs;
al->dirs[al->numDirs].dirName = xstrdup(dirNames[dirNum]);
+ al->dirs[al->numDirs].dirNameLen = strlen(dirNames[dirNum]);
al->dirs[al->numDirs].files = NULL;
al->dirs[al->numDirs].numFiles = 0;
- al->dirs[al->numDirs].dirNum = al->numDirs;
- dirMapping[dirNum] = al->numDirs;
al->numDirs++;
}
}
- if (origNumDirs + al->numDirs)
- qsort(al->dirs, al->numDirs, sizeof(dirNeedle), dirInfoCompare);
-
free(dirNames);
first = 0;
first = last + 1;
}
+
+ if (origNumDirs + al->numDirs)
+ qsort(al->dirs, al->numDirs, sizeof(dirNeedle), dirInfoCompare);
+
}
p->key = key;
}
dirNeedle.dirName = (char *) dirName;
+ dirNeedle.dirNameLen = strlen(dirName);
dirMatch = bsearch(&dirNeedle, al->dirs, al->numDirs,
sizeof(dirNeedle), dirInfoCompare);
xfree(dirName);
struct dirInfo {
/*@owned@*/ char * dirName; /* xstrdup'd */
- int dirNum;
+ int dirNameLen;
/*@owned@*/ struct fileIndexEntry * files; /* xmalloc'd */
int numFiles;
} ;
int _noDirTokens = 1;
+static int dncmp(const void * a, const void * b)
+{
+ const char *const * first = a;
+ const char *const * second = b;
+ return strcmp(*first, *second);
+}
+
void compressFilelist(Header h)
{
- const char ** fileNames;
+ char ** fileNames;
const char ** dirNames;
const char ** baseNames;
int_32 * dirIndexes;
int count;
int i;
int dirIndex = -1;
- int lastLen = -1;
/*
* This assumes the file list is already sorted, and begins with a
}
for (i = 0; i < count; i++) {
+ const char ** needle;
char *baseName = strrchr(fileNames[i], '/') + 1;
+ char savechar;
int len = baseName - fileNames[i];
- if (dirIndex < 0 || lastLen != len ||
- strncmp(dirNames[dirIndex], fileNames[i], len)) {
+ savechar = *baseName;
+ *baseName = '\0';
+ if (dirIndex < 0 ||
+ (needle = bsearch(&fileNames[i], dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) {
char *s = alloca(len + 1);
- memcpy(s, fileNames[i], len);
+ memcpy(s, fileNames[i], len + 1);
s[len] = '\0';
- dirNames[++dirIndex] = s;
- lastLen = len;
- }
+ dirIndexes[i] = ++dirIndex;
+ dirNames[dirIndex] = s;
+ } else
+ dirIndexes[i] = needle - dirNames;
- dirIndexes[i] = dirIndex;
+ *baseName = savechar;
baseNames[i] = baseName;
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-12-13 14:24-0500\n"
+"POT-Creation-Date: 1999-12-15 10:33-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#. XXX legacy epoch-less requires/conflicts compatibility
-#: lib/depends.c:411
+#: lib/depends.c:417
#, c-format
msgid ""
"the \"B\" dependency needs an epoch (assuming same as \"A\")\n"
"\tA %s\tB %s\n"
msgstr ""
-#: lib/depends.c:440
+#: lib/depends.c:446
#, c-format
msgid " %s A %s\tB %s\n"
msgstr ""
-#: lib/depends.c:532
+#: lib/depends.c:538
msgid "dbrecMatchesDepFlags() failed to read header"
msgstr ""
-#: lib/depends.c:777
+#: lib/depends.c:784
#, c-format
msgid "%s: %s satisfied by added file list.\n"
msgstr ""
-#: lib/depends.c:816
+#: lib/depends.c:823
#, c-format
msgid "%s: %s satisfied by added package.\n"
msgstr ""
-#: lib/depends.c:833
+#: lib/depends.c:840
#, c-format
msgid "%s: %s satisfied by added provide.\n"
msgstr ""
-#: lib/depends.c:864
+#: lib/depends.c:871
#, c-format
msgid "%s: %s satisfied by rpmrc provides.\n"
msgstr ""
-#: lib/depends.c:892
+#: lib/depends.c:899
#, c-format
msgid "%s: %s satisfied by db file lists.\n"
msgstr ""
-#: lib/depends.c:914
+#: lib/depends.c:921
#, c-format
msgid "%s: %s satisfied by db provides.\n"
msgstr ""
-#: lib/depends.c:936
+#: lib/depends.c:943
#, c-format
msgid "%s: %s satisfied by db packages.\n"
msgstr ""
-#: lib/depends.c:949
+#: lib/depends.c:956
#, c-format
msgid "%s: %s satisfied by rpmlib version.\n"
msgstr ""
-#: lib/depends.c:959
+#: lib/depends.c:966
#, c-format
msgid "%s: %s unsatisfied.\n"
msgstr ""
#. requirements are not satisfied.
-#: lib/depends.c:1007
+#: lib/depends.c:1014
#, c-format
msgid "package %s require not satisfied: %s\n"
msgstr ""
#. conflicts exist.
-#: lib/depends.c:1069
+#: lib/depends.c:1076
#, c-format
msgid "package %s conflicts: %s\n"
msgstr ""
-#: lib/depends.c:1124 lib/depends.c:1423
+#: lib/depends.c:1131 lib/depends.c:1430
#, c-format
msgid "cannot read header at %d for dependency check"
msgstr ""
-#: lib/depends.c:1219
+#: lib/depends.c:1226
#, c-format
msgid "loop in prerequisite chain: %s"
msgstr ""
Name: rpm
%define version 3.0.4
Version: %{version}
-Release: 0.14
+Release: 0.15
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
Copyright: GPL