diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-02-14 17:06:59 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-02-14 17:06:59 +0000 |
commit | e70b93f0257ee88cb16fc10490bfba4caef6c622 (patch) | |
tree | dfbb91bb7daaf6384d03d048b31b4ca11923f1fc /MDK/Common | |
parent | f71b7b6c7741fa5ff6e4c26790f2a353febe4285 (diff) | |
download | perl-MDK-Common-e70b93f0257ee88cb16fc10490bfba4caef6c622.tar perl-MDK-Common-e70b93f0257ee88cb16fc10490bfba4caef6c622.tar.gz perl-MDK-Common-e70b93f0257ee88cb16fc10490bfba4caef6c622.tar.bz2 perl-MDK-Common-e70b93f0257ee88cb16fc10490bfba4caef6c622.tar.xz perl-MDK-Common-e70b93f0257ee88cb16fc10490bfba4caef6c622.zip |
update_gnomekderc: modify the default group (entries at the top of the
file not preceded by a group name) if category is undef
Diffstat (limited to 'MDK/Common')
-rw-r--r-- | MDK/Common/System.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm index 2a03ff7..4ad4aea 100644 --- a/MDK/Common/System.pm +++ b/MDK/Common/System.pm @@ -410,7 +410,8 @@ sub update_gnomekderc { my %subst = map { lc($_) => [ $_, $subst_{$_} ] } keys %subst_; my $s; - foreach (MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { + defined($category) or $category = "DEFAULTCATEGORY"; + foreach ("[DEFAULTCATEGORY]\n", MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { if (my $i = /^\s*\[\Q$category\E\]/i ... /^\[/) { if ($i =~ /E/) { #- for last line of category chomp $s; $s .= "\n"; @@ -422,10 +423,10 @@ sub update_gnomekderc { } } } - $s .= $_ if !/^\Q[NOCATEGORY]/; + $s .= $_ if !/^\[(NO|DEFAULT)CATEGORY\]/; } - #- if category has not been found above. + #- if category has not been found above (DEFAULTCATEGORY is always found). if (keys %subst) { chomp $s; $s .= "\n[$category]\n"; |