From ae7150afad637504392359c855e140d3c5003cc8 Mon Sep 17 00:00:00 2001 From: Daouda Lo Date: Tue, 19 Mar 2002 16:23:54 +0000 Subject: - clean dir stalled files --- mdkupdate | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mdkupdate') diff --git a/mdkupdate b/mdkupdate index a53aa2a0..2dbca727 100755 --- a/mdkupdate +++ b/mdkupdate @@ -64,6 +64,7 @@ update_rpms($o{LOGIN},$o{PASS},$o{BOX},$o{CURRENTKEY}); rpm_qa("/root/rpm_qa_installed_after"); my %new = getVarsFromSh("/root/.mdkupdate"); send_rpm_dif($new{LOGIN},$new{PASS},$new{BOX},$new{OLDKEY}); +clean_dir(); sub update_rpms () { my ($login,$password,$box_name,$curkey) =@_; @@ -80,6 +81,7 @@ sub update_rpms () { $result = ($response->content =~ /^TRUE/) ? 0 : -1; } else { log_it(_("Connection problem")."\n"._("MandrakeUpdate could not contact the site, we will try again")); + clean_dir(); exit -1; } } else { @@ -108,6 +110,7 @@ sub update_rpms () { } else { log_it(_("Your login or password may be wrong")."\n"._("You'll need to have an account on MandrakeOnline, or update your subscription")."\n"._("For any problem send mail to support\@mandrakeonline.net\n")); + clean_dir(); exit -1; } } @@ -139,6 +142,11 @@ sub send_rpm_dif { print "REPONSE: ".$response->content."\n"; } +sub clean_dir() { + `rm -f /root/$login.$password.$box_name.$oldkey.dif /root/rpm_qa_installed_before /root/rpm_qa_installed_after` if -e "/root/rpm_qa_installed_before"; + exit 1; +} + sub rpm_qa { my ($file) = @_; open (FILE,"> $file") || die "Couldn't open $file : $!"; -- cgit v1.2.1