diff options
author | Daouda Lo <daouda@mandriva.com> | 2002-03-19 16:23:54 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2002-03-19 16:23:54 +0000 |
commit | ae7150afad637504392359c855e140d3c5003cc8 (patch) | |
tree | 21c73d581c59b4ad89a4b7762a9adb9c2b07631c /mdkupdate | |
parent | 49304956c03ca145c690d6eec8af889aa4b382f0 (diff) | |
download | mgaonline-ae7150afad637504392359c855e140d3c5003cc8.tar mgaonline-ae7150afad637504392359c855e140d3c5003cc8.tar.gz mgaonline-ae7150afad637504392359c855e140d3c5003cc8.tar.bz2 mgaonline-ae7150afad637504392359c855e140d3c5003cc8.tar.xz mgaonline-ae7150afad637504392359c855e140d3c5003cc8.zip |
- clean dir stalled files
Diffstat (limited to 'mdkupdate')
-rwxr-xr-x | mdkupdate | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 : $!"; |