diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-28 11:03:50 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-28 11:03:50 +0000 |
commit | e13398a7b50ab981d246b98890b40ecebed6de80 (patch) | |
tree | 7982ac1b9c9f7ff90097ee859947df6543204d5c /perl-install/printer/gimp.pm | |
parent | 81947bb4ff3cc74309d52dabd3e8cf65b930346d (diff) | |
download | drakx-backup-do-not-use-e13398a7b50ab981d246b98890b40ecebed6de80.tar drakx-backup-do-not-use-e13398a7b50ab981d246b98890b40ecebed6de80.tar.gz drakx-backup-do-not-use-e13398a7b50ab981d246b98890b40ecebed6de80.tar.bz2 drakx-backup-do-not-use-e13398a7b50ab981d246b98890b40ecebed6de80.tar.xz drakx-backup-do-not-use-e13398a7b50ab981d246b98890b40ecebed6de80.zip |
- mkdir_p throws an exception on error, so "mkdir_p() or ..." is dumb, fixing
(thanks to Lea Gris)
- use output()
Diffstat (limited to 'perl-install/printer/gimp.pm')
-rw-r--r-- | perl-install/printer/gimp.pm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/perl-install/printer/gimp.pm b/perl-install/printer/gimp.pm index 0b0ebdaed..0a5919503 100644 --- a/perl-install/printer/gimp.pm +++ b/perl-install/printer/gimp.pm @@ -229,15 +229,12 @@ sub findconfigfiles { $dir =~ s,/[^/]*$,,; next if -f $dir && ! -d $dir; if (! -d "$::prefix$dir") { - mkdir_p("$::prefix$dir") or next; - set_permissions("$::prefix$dir", "$uid.$gid") or next; + eval { mkdir_p("$::prefix$dir") } or next; + set_permissions("$::prefix$dir", "$uid.$gid") or next; } if (! -f "$::prefix$homedir/$file") { - local *F; - open F, "> $::prefix$homedir/$file" or next; - print F "#PRINTRCv1 written by GIMP-PRINT 4.2.2 - 13 Sep 2002\n"; - close F; - set_permissions("$::prefix$homedir/$file", "$uid.$gid") or next; + eval { output("$::prefix$homedir/$file", "#PRINTRCv1 written by GIMP-PRINT 4.2.2 - 13 Sep 2002\n") } or next; + set_permissions("$::prefix$homedir/$file", "$uid.$gid") or next; } push @filestotreat, "$homedir/$file"; } |