* [PATCH setup, revised 2/2] Avoid clobbering installed.db when no setup.ini is found
@ 2017-10-28 17:46 Ken Brown
0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2017-10-28 17:46 UTC (permalink / raw)
To: cygwin-apps
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. Move the calls to packagedb::read and other packagedb
functions from do_ini_thread to ChooserPage::OnInit.
---
choose.cc | 8 +++++++-
ini.cc | 7 -------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/choose.cc b/choose.cc
index 619d7db..3a990d5 100644
--- a/choose.cc
+++ b/choose.cc
@@ -264,10 +264,16 @@ ChooserPage::OnInit ()
}
SetBusy ();
+ packagedb db;
+ db.makeBase();
+ db.read();
+ db.upgrade();
+ db.fixup_source_package_ids();
+ db.removeEmptyCategories();
+
if (source == IDC_SOURCE_DOWNLOAD || source == IDC_SOURCE_LOCALDIR)
packagemeta::ScanDownloadedFiles (MirrorOption);
- packagedb db;
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.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-28 17:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 17:46 [PATCH setup, revised 2/2] Avoid clobbering installed.db when no setup.ini is found Ken Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).