This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
setup.exe packagedb cache refresh bug
- From: Brendan Conoboy <blc at redhat dot com>
- To: cygwin-apps at cygwin dot com
- Date: Fri, 21 May 2010 23:03:30 -0700
- Subject: setup.exe packagedb cache refresh bug
Hi folks,
There's a small bug in setup that shows up when doing side-by-side
installs. The problem occurs because packagedb is populated before the
user has a chance to specify what directory to use for the installation.
When an alternate install path is specified, the installer continues
to use the previously calculated list of packages as already being
installed. The end result is a skeletal installation of just the
packages from the original install tree that needed updating being
installed in the new install tree. The attached patch resets the
installeddbread flag, allowing the next package_db constructor to
repopulate the list. Works for me. Changelog below.
2010-05-21 Brendan Conoboy <blc@redhat.com>
* package_db.cc (packagedb::resetDBRead): New. Resets
installeddbread flag.
* package_db.h: Define packagedb::resetDBRead().
* mount.cc (set_root_dir): Call packagedb::resetDBRead() to
allow packagedb to repopulate with new root package list.
--
Brendan Conoboy / Red Hat, Inc. / blc@redhat.com
Index: mount.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/mount.cc,v
retrieving revision 2.33
diff -c -r2.33 mount.cc
*** mount.cc 29 Jan 2010 22:46:28 -0000 2.33
--- mount.cc 22 May 2010 05:25:14 -0000
***************
*** 24,29 ****
--- 24,30 ----
#include "ini.h"
#include "win32.h"
#include "filemanip.h"
+ #include "package_db.h"
#include <stdio.h>
#include <stdlib.h>
***************
*** 723,728 ****
--- 724,730 ----
read_mounts (val);
else
root_here->native = val;
+ packagedb::resetDBRead();
}
const std::string
Index: package_db.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_db.cc,v
retrieving revision 2.44
diff -c -r2.44 package_db.cc
*** package_db.cc 17 Apr 2010 12:36:45 -0000 2.44
--- package_db.cc 22 May 2010 05:25:14 -0000
***************
*** 433,435 ****
--- 433,441 ----
for_each(packages.begin(), packages.end(), visit_if(mem_fun(&packagemeta::addToCategoryBase), mem_fun(&packagemeta::isManuallyWanted)));
}
+
+ void
+ packagedb::resetDBRead ()
+ {
+ installeddbread = 0;
+ }
Index: package_db.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_db.h,v
retrieving revision 2.24
diff -c -r2.24 package_db.h
*** package_db.h 17 Apr 2010 12:36:45 -0000 2.24
--- package_db.h 22 May 2010 05:25:14 -0000
***************
*** 77,82 ****
--- 77,83 ----
typedef std::map <std::string, std::vector <packagemeta *>, casecompare_lt_op > categoriesType;
static categoriesType categories;
static PackageDBActions task;
+ static void resetDBRead();
private:
static int installeddbread; /* do we have to reread this */
friend class ConnectedLoopFinder;