https://bugs.kde.org/show_bug.cgi?id=428148

            Bug ID: 428148
           Summary: kconf_update ignores config files that don’t use
                    groups
           Product: frameworks-kconfig
           Version: 5.74.0
          Platform: Other
                OS: All
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: matt...@mjdsystems.ca
          Reporter: david.hu...@mailbox.org
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

SUMMARY
When I run kconf_update on a file which contains only keys outside any group,
kconf_update ignores this file, but still marks is as updated.


STEPS TO REPRODUCE
1. Create a config file like this:
> SomeKey=true
2. Run kconf_update with some update script like this:
> Version=5
> Id=some-update
> File=demorc
> Key=SomeKey,SomeNewKey
3. Do the same with this config file:
> SomeKey=true
> [EmptyGroup]
4. Do the same with this config file:
> SomeKey=true
> [NotEmptyGroup]
> SomeOtherKey=true

OBSERVED RESULT
After Step 2 and 3:
> SomeKey=true
> [$Version]
> update_info=demo.upd:some-update
Only step 4 works fine.


EXPECTED RESULT
> SomeNewKey=true
> [$Version]
> update_info=demo.upd:some-update

ADDITIONAL INFORMATION
The code for this is KConfUpdate::gotFile():
> if (!m_oldFile.isEmpty()) {
>     // if File= is specified, it doesn't exist, is empty
>     // or contains only kconf_update's [$Version] group, skip
>     if (m_oldConfig1 != nullptr
>             && (m_oldConfig1->groupList().isEmpty()
>                 || (m_oldConfig1->groupList().count() == 1
>                     && m_oldConfig1->groupList().at(0) == 
> QLatin1String("$Version")))) {
>         qCDebug(KCONF_UPDATE_LOG) << m_currentFilename << ": File"
>                                   << m_oldFile << "does not exist or empty, 
> skipping";
>         m_skipFile = true;

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to