summaryrefslogtreecommitdiffstats
path: root/mdkupdate
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-10-11 08:21:42 +0000
committerFrancois Pons <fpons@mandriva.com>2002-10-11 08:21:42 +0000
commit13f32f436f0775dd7c1c6caa16e92a2dc67af73d (patch)
treea14f55b2608934761bbdc8bab35eb9a4644c4fec /mdkupdate
parent00b1751b6d9c98992af9cc6ffed70bde6712528d (diff)
downloadmgaonline-13f32f436f0775dd7c1c6caa16e92a2dc67af73d.tar
mgaonline-13f32f436f0775dd7c1c6caa16e92a2dc67af73d.tar.gz
mgaonline-13f32f436f0775dd7c1c6caa16e92a2dc67af73d.tar.bz2
mgaonline-13f32f436f0775dd7c1c6caa16e92a2dc67af73d.tar.xz
mgaonline-13f32f436f0775dd7c1c6caa16e92a2dc67af73d.zip
cleaned code a bit (use tempory copy of rpms installed instead of building new
one when sending configuration).
Diffstat (limited to 'mdkupdate')
-rwxr-xr-xmdkupdate10
1 files changed, 4 insertions, 6 deletions
diff --git a/mdkupdate b/mdkupdate
index e5739ac4..09ad4d76 100755
--- a/mdkupdate
+++ b/mdkupdate
@@ -69,10 +69,6 @@ update_rpms($o{LOGIN},$o{PASS},$o{BOX},$o{CURRENTKEY});
rpm_qa("/root/rpm_qa_installed_after");
my %new = getVarsFromSh("/root/.mdkupdate");
if (! -s "/root/.mdkupdate.rpms" || $update) {
- #- added to allow .mdkupdate.rpms file creation.
- open FILE, ">/root/.mdkupdate.rpms" or die "Couldn't open /root/.mdkupdate.rpms : $!";
- print FILE join ('', sort `rpm -qa`);
- close FILE;
#- send configuration and get back key to use...
$new{CURRENTKEY} = send_config($new{LOGIN},$new{PASS},$new{BOX});
delete $new{OLDKEY};
@@ -147,6 +143,9 @@ sub send_config {
$result = ($response->content =~ /TRUE(.*)/) ? 0 : -1;
#print("key is $1\n");
$key = $1;
+ #- update local copy now.
+ unlink "/root/.mdkupdate.rpms";
+ rename "/root/rpm_qa_installed_after", "/root/.mdkupdate.rpms";
} else {
# pb with the connection ?
$result = -1;
@@ -259,8 +258,7 @@ sub clean_dir {
sub rpm_qa {
my ($file) = @_;
open (FILE,"> $file") || die "Couldn't open $file : $!";
- join '', map { chomp; print FILE "$_" }
- join('',sort `rpm -qa`);
+ map { chomp; print FILE "$_" } join('',sort `rpm -qa`);
close FILE;
}