summaryrefslogtreecommitdiffstats
path: root/mdkupdate
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2002-03-19 16:23:54 +0000
committerDaouda Lo <daouda@mandriva.com>2002-03-19 16:23:54 +0000
commitae7150afad637504392359c855e140d3c5003cc8 (patch)
tree21c73d581c59b4ad89a4b7762a9adb9c2b07631c /mdkupdate
parent49304956c03ca145c690d6eec8af889aa4b382f0 (diff)
downloadmgaonline-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-xmdkupdate8
1 files changed, 8 insertions, 0 deletions
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 : $!";