diff options
author | Pablo Saratxaga <pablo@mandriva.com> | 2005-09-27 13:00:34 +0000 |
---|---|---|
committer | Pablo Saratxaga <pablo@mandriva.com> | 2005-09-27 13:00:34 +0000 |
commit | ad148fe0a23c45d94bc8e7611260d7ff59b8596c (patch) | |
tree | 94e8f17bec9a87d002fac335bf9a963be3b8e51b /MDK | |
parent | 6facc9b103d8210dd24a1734587154ec2605fca8 (diff) | |
download | perl-MDK-Common-ad148fe0a23c45d94bc8e7611260d7ff59b8596c.tar perl-MDK-Common-ad148fe0a23c45d94bc8e7611260d7ff59b8596c.tar.gz perl-MDK-Common-ad148fe0a23c45d94bc8e7611260d7ff59b8596c.tar.bz2 perl-MDK-Common-ad148fe0a23c45d94bc8e7611260d7ff59b8596c.tar.xz perl-MDK-Common-ad148fe0a23c45d94bc8e7611260d7ff59b8596c.zip |
fixed bug making localedrake (and maybe others) crashing when trying to
create a gnome/kde rc file under a non-existing directory
Diffstat (limited to 'MDK')
-rw-r--r-- | MDK/Common/System.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm index ff94cd3..720687c 100644 --- a/MDK/Common/System.pm +++ b/MDK/Common/System.pm @@ -438,6 +438,9 @@ sub update_gnomekderc { my %subst = map { lc($_) => [ $_, $subst_{$_} ] } keys %subst_; my $s; + # create the parent directory for the config file, if needed + my $directory = MDK::Common::File::dirname($file); + MDK::Common::File::mkdir_p($directory) if ! -r $directory; defined($category) or $category = "DEFAULTCATEGORY"; foreach ("[DEFAULTCATEGORY]\n", MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { if (my $i = /^\s*\[\Q$category\E\]/i ... /^\[/) { |