summaryrefslogtreecommitdiffstats
path: root/mdkupdate
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2005-01-25 20:47:01 +0000
committerDaouda Lo <daouda@mandriva.com>2005-01-25 20:47:01 +0000
commit07b07eccd2d6a3305151c5db4eef48e0af71ce14 (patch)
treeb4f418144dc7002bd516a7d1add63742666b9271 /mdkupdate
parent49ee2f8fb8e38b1023716f199c02c928f60beed9 (diff)
downloadmgaonline-07b07eccd2d6a3305151c5db4eef48e0af71ce14.tar
mgaonline-07b07eccd2d6a3305151c5db4eef48e0af71ce14.tar.gz
mgaonline-07b07eccd2d6a3305151c5db4eef48e0af71ce14.tar.bz2
mgaonline-07b07eccd2d6a3305151c5db4eef48e0af71ce14.tar.xz
mgaonline-07b07eccd2d6a3305151c5db4eef48e0af71ce14.zip
- mnf installation
Diffstat (limited to 'mdkupdate')
-rwxr-xr-xmdkupdate18
1 files changed, 15 insertions, 3 deletions
diff --git a/mdkupdate b/mdkupdate
index f0b9bd60..7b45d1f2 100755
--- a/mdkupdate
+++ b/mdkupdate
@@ -61,12 +61,13 @@ usage:
", $VERSION, $YEARS) . N(" --help - print this help message.
") . N(" --auto - Mandrakeupdate launched automatically.
") . N(" --applet - launch Mandrakeupdate.
+") . N(" --mnf - launch mnf specific scripts.
");
exit(0);
}
my ($opt) = @ARGV;
-@ARGV == 1 && ($opt eq '--auto' || $opt eq '--applet') or usage();
+@ARGV == 1 && ($opt eq '--auto' || $opt eq '--applet' || $opt eq '--mnf') or usage();
-s $conffile or die N("No %s file found. Run mdkonline wizard first", $conffile);
@@ -95,6 +96,9 @@ if ($o{LOGIN} && $o{PASS} && $o{LOGIN} !~ /\s+/ && $o{PASS} !~ /\s+/) {
$noscheduled = join(',', @{$c2h->{nosched}}); $noscheduled =~ s/\.rpm//g;
#printf "SCHEDULED = $scheduled\nNOSCHEDULED = $noscheduled\n";
-f $currentrpm or rpm_qa($currentrpm);
+ if ($opt eq '--mnf') {
+ install_mnf_pkgs();
+ }
if ($opt eq '--applet') {
system "/usr/bin/MandrakeUpdate", "--no-confirmation", "--media=update_source", "--pkg-sel=$scheduled", "--pkg-nosel=$noscheduled"
} elsif ($opt eq '--auto') {
@@ -146,7 +150,8 @@ sub auto_install_rpms {
my ($pkgs) = shift;
my @pkg;
push(@pkg, $_ . '.rpm') foreach @$pkgs;
- update_pkgs(@pkg);
+ my $ret = update_pkgs(@pkg);
+ $ret == 1 or output_p($logfile, "[mdkupdate] Error 100: Packages failed to upgrade")
}
sub update_conf {
my ($oldkey, $newkey) = @_;
@@ -177,13 +182,20 @@ sub add_media {
};
$@ and die "Problem adding Update Media with urpmi";
}
+sub install_mnf_pkgs {
+ my $transaction = "$$";
+ my @pkg_to_upgrade = split(',', `config-wrapper.pl $transaction_name -g PackagesList`);
+ my $ret = update_pkgs(@pkg_to_upgrade);
+ $ret == 1 or system("config-wrapper.pl", "$transaction_name", "-a");
+}
sub update_pkgs {
@_ or return;
eval {
system "/usr/sbin/urpmi", "--auto", "--media", "update_source", map { /^(.*)\.rpm$/ && $1 } @_;
$? == 0 or die N("Unable to update packages from update_source medium.\n");
};
- $@ and die "Problem upgrading with urpmi";
+ $@ and output_p($logfile, "[mdkupdate] Error 99: $@"), return 0;
+ return 1;
}
sub send_conf_update {
my ($login, $password, $boxname) = @_;