+Mon Oct 18 18:40:35 EDT 1999 Ben Collins <bcollins.debian.org>
+
+ * Reimplemented a better *stat cache for the removal checking code,
+ this helps a lot when doing upgrades where the packages are a lot
+ different in layout. Note, I tested the first way and this new way
+ against package foo (version 1 & 2) each had 5000 files (different
+ in version 2 than in version 1). basically this meant the old way
+ needed to do about 2.5 million lstats, and the new way only needs
+ 10,000 lstats. This sped it up about %6000 percent (the old way took
+ over 1 hour on a 333Mhz, the new way was 2 minutes and 20 seconds).
+ Note that this is an extreme case since most per package upgrades
+ a) don't have 5000 files
+ b) don't have all the files different
+ * Increased largemem auto detection to >= 24megs, since it's not uncommon
+ for dpkg to actually use 16megs of ram all on its own when using the
+ largemem setting (old minimum was 16megs)
+
Mon Oct 18 09:25:30 EDT 1999 Ben Collins <bcollins.debian.org>
* Add mipseb to the archtable too, since mips and mipseb are
DISTDEBFILES = 50dpkg-dev.el changelog control copyright \
dev-README postinst preinst prerm rules \
- shlibs shlibs.default.templates shlibs.local
+ shlibs shlibs.default.template shlibs.local
MAINTCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
* Removed shlibs.default.i386. It's now a template for arch porting to
Debian/dpkg, we install it still, if there exists a file matching the
arch
+ * Reimplemented a better *stat cache for the removal checking code,
+ this helps a lot when doing upgrades where the packages are a lot
+ different in layout
+ * Increased largemem auto detection to >= 24megs, since it's not uncommon
+ for dpkg to actually use 16megs of ram all on its own when using the
+ largemem setting (old minimum was 16megs)
-- Wichert Akkerman <wakkerma@debian.org> UNRELEASED
#ifdef HAVE_SYSINFO
struct sysinfo info;
if (sysinfo(&info)) return 0;
- if (info.freeram + (info.sharedram>>2) + (info.bufferram>>2) < 16384*1024 &&
- info.totalram < 16384*1024)
+ if (info.freeram + (info.sharedram>>2) + (info.bufferram>>2) < 24576*1024 &&
+ info.totalram < 24576*1024)
return 0;
#endif
return 1;
for (fnn= bins[i]; fnn; fnn= fnn->next) {
fnn->flags= 0;
fnn->oldhash= 0;
+ fnn->filestat= 0;
}
break;
case -1:
fnn= fnn->next) {
fnn->flags= 0;
fnn->oldhash= 0;
+ fnn->filestat= 0;
}
break;
default:
traverse->here->packages= 0;
traverse->here->flags= 0;
traverse->here->divert= 0;
+ traverse->here->filestat= 0;
n= strlen(name)+2;
if (namesarealeft < n) {
newnode->flags= 0;
newnode->next= 0;
newnode->divert= 0;
+ newnode->filestat= 0;
*pointerp= newnode;
nfiles++;
fnnf_no_atomic_overwrite= 000020, /* >=1 instance is a dir, cannot rename over */
} flags; /* Set to zero when a new node is created. */
const char *oldhash; /* valid iff this namenode is in the newconffiles list */
+ struct stat *filestat;
};
struct fileinlist {
* the process a little leaner. We are only worried about new ones
* since ones that stayed the same don't really apply here.
*/
- struct stat oldfs, newfs;
+ struct stat oldfs;
int donotrm = 0;
/* If we can't stat the old or new file, or it's a directory,
* we leave it up to the normal code
"upgrade/downgrade", fnamevb.buf);
if (!lstat(fnamevb.buf, &oldfs) && !S_ISDIR(oldfs.st_mode)) {
for (cfile = newfileslist; cfile; cfile = cfile->next) {
- if (lstat(cfile->namenode->name, &newfs) || S_ISDIR(newfs.st_mode))
- continue;
- if (oldfs.st_dev == newfs.st_dev &&
- oldfs.st_ino == newfs.st_ino) {
+ if (!cfile->namenode->filestat) {
+ cfile->namenode->filestat = (struct stat *) nfmalloc(sizeof(struct stat));
+ if (lstat(cfile->namenode->name, cfile->namenode->filestat)) {
+ cfile->namenode->filestat= 0;
+ continue;
+ }
+ }
+ if (S_ISDIR(cfile->namenode->filestat->st_mode))
+ continue;
+ if (oldfs.st_dev == cfile->namenode->filestat->st_dev &&
+ oldfs.st_ino == cfile->namenode->filestat->st_ino) {
donotrm = 1;
debug(dbg_eachfile, "process_archive: not removing %s, since it matches %s",
fnamevb.buf, cfile->namenode->name);