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
This commit is contained in:
Matthias Koefferlein 2017-08-14 21:29:10 +02:00
parent bd05fae9aa
commit 0accc84367
2 changed files with 4 additions and 4 deletions

View File

@ -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 ())));

View File

@ -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) {