From 0accc84367c59a4d8ac248b417a795f2b9d9fa6f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 14 Aug 2017 21:29:10 +0200 Subject: [PATCH] Bugfix: package installation wasn't working from scratch * Create the "salt" package directory as well - not just the package folder * Include the package folder in the error message * A better indication of what to do in the Apply button message --- src/lay/laySalt.cc | 6 +++--- src/lay/laySaltManagerDialog.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lay/laySalt.cc b/src/lay/laySalt.cc index 7ef818c5b..c327062ff 100644 --- a/src/lay/laySalt.cc +++ b/src/lay/laySalt.cc @@ -366,7 +366,7 @@ public: bool Salt::create_grain (const SaltGrain &templ, SaltGrain &target) { - tl_assert (!m_root.is_empty ()); + tl_assert (m_root.begin_collections () != m_root.end_collections ()); const SaltGrains *coll = m_root.begin_collections ().operator-> (); @@ -407,8 +407,8 @@ Salt::create_grain (const SaltGrain &templ, SaltGrain &target) if (subdir.exists () && ! subdir.isDir ()) { throw tl::Exception (tl::to_string (tr ("Unable to create target directory '%1' for installing package - is already a file").arg (subdir.path ()))); } else if (! subdir.exists ()) { - if (! target_dir.mkdir (tl::to_qstring (*n))) { - throw tl::Exception (tl::to_string (tr ("Unable to create target directory '%1' for installing package").arg (subdir.path ()))); + if (! target_dir.mkpath (tl::to_qstring (*n))) { + throw tl::Exception (tl::to_string (tr ("Unable to create target directory '%1' for installing package").arg (subdir.filePath ()))); } if (! target_dir.cd (tl::to_qstring (*n))) { throw tl::Exception (tl::to_string (tr ("Unable to change to target directory '%1' for installing package").arg (subdir.path ()))); diff --git a/src/lay/laySaltManagerDialog.cc b/src/lay/laySaltManagerDialog.cc index d16ee2b37..7c2cf6fd1 100644 --- a/src/lay/laySaltManagerDialog.cc +++ b/src/lay/laySaltManagerDialog.cc @@ -454,7 +454,7 @@ SaltManagerDialog::update_apply_state () apply_new_button->setEnabled (marked > 0); if (marked == 0) { - apply_label_new->setText (QString ()); + apply_label_new->setText (tr ("Select at least one package for installation (check button)")); } else if (marked == 1) { apply_label_new->setText (tr ("One package selected")); } else if (marked > 1) {