This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[[PATCH setup topic/libsolv] 2/2] Avoid clobbering installed.db when no setup.ini is found
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Sat, 28 Oct 2017 08:29:32 -0400
- Subject: [[PATCH setup topic/libsolv] 2/2] Avoid clobbering installed.db when no setup.ini is found
- Authentication-results: sourceware.org; auth=none
- References: <20171028122932.3024-1-kbrown@cornell.edu>
Move the calls to packagedb::read and other packagedb functions from
do_ini_thread to ChooserPage::OnInit. If no setup.ini is found,
do_ini_thread is never called. But we need to ensure that
packagedb::read is called, or else installed.db gets emptied.
---
choose.cc | 5 +++++
ini.cc | 7 -------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/choose.cc b/choose.cc
index 619d7db..013a30a 100644
--- a/choose.cc
+++ b/choose.cc
@@ -268,6 +268,11 @@ ChooserPage::OnInit ()
packagemeta::ScanDownloadedFiles (MirrorOption);
packagedb db;
+ db.makeBase();
+ db.read();
+ db.upgrade();
+ db.fixup_source_package_ids();
+ db.removeEmptyCategories();
db.setExistence ();
db.fillMissingCategory ();
diff --git a/ini.cc b/ini.cc
index 5089e8b..0f8b927 100644
--- a/ini.cc
+++ b/ini.cc
@@ -352,13 +352,6 @@ do_ini_thread (HINSTANCE h, HWND owner)
else
ini_count = do_remote_ini (owner);
- packagedb db;
- db.makeBase();
- db.read();
- db.upgrade();
- db.fixup_source_package_ids();
- db.removeEmptyCategories();
-
if (ini_count == 0)
return false;
--
2.14.2