diff --git a/src/modules/netinstall/PackageModel.cpp b/src/modules/netinstall/PackageModel.cpp index beb094d2d..147bd5a5c 100644 --- a/src/modules/netinstall/PackageModel.cpp +++ b/src/modules/netinstall/PackageModel.cpp @@ -10,6 +10,7 @@ #include "PackageModel.h" +#include "utils/Logger.h" #include "utils/Variant.h" #include "utils/Yaml.h" @@ -245,9 +246,21 @@ PackageModel::setupModelData( const QVariantList& groupList, PackageTreeItem* pa } } } + if ( !item->childCount() ) + { + cWarning() << "*packages* under" << item->name() << "is empty."; + } } if ( groupMap.contains( "subgroups" ) ) { + bool haveWarned = false; + const auto& subgroupValue = groupMap.value( "subgroups" ); + if ( !subgroupValue.canConvert( QVariant::List ) ) + { + cWarning() << "*subgroups* under" << item->name() << "is not a list."; + haveWarned = true; + } + QVariantList subgroups = groupMap.value( "subgroups" ).toList(); if ( !subgroups.isEmpty() ) { @@ -257,10 +270,22 @@ PackageModel::setupModelData( const QVariantList& groupList, PackageTreeItem* pa // the checked-state -- do it manually. item->updateSelected(); } + else + { + if ( !haveWarned ) + { + cWarning() << "*subgroups* list under" << item->name() << "is empty."; + } + } } if ( item->isHidden() ) { m_hiddenItems.append( item ); + if ( !item->isSelected() ) + { + cWarning() << "Item" << ( item->parentItem() ? item->parentItem()->name() : QString() ) << '.' + << item->name() << "is hidden, but not selected."; + } } else { diff --git a/src/modules/netinstall/netinstall.conf b/src/modules/netinstall/netinstall.conf index f96da9a8e..a9243510b 100644 --- a/src/modules/netinstall/netinstall.conf +++ b/src/modules/netinstall/netinstall.conf @@ -178,10 +178,11 @@ label: # the group's packages are installed. It will run after **each** package in # the group is installed. # -# If you set both *hidden* and *selected* for a group, you are basically +# If you set both *hidden* and *selected* for a top-level group, you are # creating a "default" group of packages which will always be installed -# in the user's system. Setting *hidden* to true without *selected*, or with -# *selected* set to false, is kind of pointless. +# in the user's system. Hidden selected subgroups are installed if their +# parent is selected. Setting *hidden* to true without *selected*, or with +# *selected* set to false, is kind of pointless and will generate a warning. # # The *pre-install* and *post-install* commands are **not** passed to # a shell; see the **packages** module configuration (i.e. `packages.conf`) @@ -291,11 +292,13 @@ groups: # # The name of the internal subgroup doesn't matter -- it is hidden # from the user -- so we can give them all bogus names and - # descriptions, even the same name. Here, we use "bogus". + # descriptions, even the same name. Here, we use "Bogus". You + # can re-use the subgroup name, it doesn't really matter. # # Each internal subgroup is set to *hidden*, so it does not show up # as an entry in the list, and it is set to *selected*, - # so that if you select its parent subgroup. + # so that if you select its parent subgroup, the packages from + # the subgroup are selected with it and get installed. - name: IDE description: "Development Environment" selected: false