From b79c594681832728bcedd984f4badd2c42c2a51a Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 20 Oct 2005 09:00:05 +0000 Subject: - use rmtree instead of rm_rf ( to not depend on Mdk::Common ) --- rpmbuildupdate | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rpmbuildupdate b/rpmbuildupdate index 805b70e..cbbf95d 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -33,6 +33,7 @@ use File::Basename; use File::Copy; use Cwd; use File::Spec; +use File::Path; use Hdlist; my %config; @@ -48,15 +49,13 @@ sub system_die { system($command) and die $message; } - - sub file_not_found { my ($basename) = @_; ! -f $basename and return 1; # sometimes, the webserver return a webpage when the file is not found, instead of letting wget fails # see wget http://www.wesnoth.org/files/wesnoth-0.7.1.tar.bz2 # So if the file is a html page, then it is a error and it should be removed. - is_html($basename) and do { rm_rf($basename); return 1 }; + is_html($basename) and do { rmtree($basename); return 1 }; return 0; } @@ -112,7 +111,7 @@ sub fetch_http { my $basename = basename($url); my $turl; - rm_rf($basename) if $config{nobuild}; + rmtree($basename) if $config{nobuild}; download($url); foreach ('.tar.gz', '.tgz', '.tar.Z', '.zip') { @@ -349,7 +348,7 @@ sub build { } my $basename = basename($_); - rm_rf("$config{sourcedir}/$basename") if $config{nobuild}; + rmtree("$config{sourcedir}/$basename") if $config{nobuild}; # GNOME: add the major version to the URL automatically # for example: ftp://ftp://ftp.gnome.org/pub/GNOME/sources/ORbit2/ORbit2-2.10.0.tar.bz2 -- cgit v1.2.1