aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-10-21 13:27:32 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-10-21 13:27:32 +0000
commit339634c2b096777a8977f19f308400ead362f7a2 (patch)
tree9e1a44f6617696f5ec691b1727570a62079bbde4
parentd17687012dc2a3ca360fcbf0d80866680aa02362 (diff)
downloadrpmdrake-339634c2b096777a8977f19f308400ead362f7a2.tar
rpmdrake-339634c2b096777a8977f19f308400ead362f7a2.tar.gz
rpmdrake-339634c2b096777a8977f19f308400ead362f7a2.tar.bz2
rpmdrake-339634c2b096777a8977f19f308400ead362f7a2.tar.xz
rpmdrake-339634c2b096777a8977f19f308400ead362f7a2.zip
Allow rpmdrake branding.
-rwxr-xr-xrpmdrake26
-rw-r--r--rpmdrake.pm56
-rw-r--r--rpmdrake.spec2
3 files changed, 56 insertions, 28 deletions
diff --git a/rpmdrake b/rpmdrake
index f25fc947..732192ab 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -40,8 +40,6 @@ BEGIN { #- we want to run this code before the Gtk->init of the use-my_gtk
}
use strict;
-use vars qw($MODE %options);
-
use lib qw(/usr/lib/libDrakX);
use common;
use rpmdrake;
@@ -60,16 +58,14 @@ if ($collation_locale) {
$collation_locale =~ /UTF-8/ or setlocale(LC_COLLATE, "$collation_locale.UTF-8");
};
-
-$MODE = 'install';
+our %options;
+our $MODE = 'install';
$0 =~ m|remove$| and $MODE = 'remove';
$0 =~ m|update$|i and $MODE = 'update';
$MODE eq 'update' || "@ARGV" =~ /--root/ and require_root_capability();
$ugtk2::wm_icon = "title-$MODE";
-
-
eval { require ugtk2; ugtk2->import(qw(:all)); require Gtk2::Pango; require Gtk2::Gdk::Keysyms };
if ($@) {
print "This program cannot be run in console mode.\n";
@@ -793,7 +789,10 @@ or you already installed all of them."));
} \@toggle_names_ordered, \@modes_buttons;
} else {
my %radios_infos = (
- mandrake_choices => { name => N("Mandrakelinux choices"), flat => 0 },
+ mandrake_choices => {
+ name => $rpmdrake::branded ? N("%s choices", $rpmdrake::distrib{system}) : N("Mandrakelinux choices"),
+ flat => 0,
+ },
flat => { name => N("All packages, alphabetical"), flat => 1 },
by => { name => '', flat => 0 },
);
@@ -1133,7 +1132,7 @@ all of them are currently disabled. You should run the Software
Media Manager to enable at least one (check it in the Enabled?
column).
-Then, restart Mandrakeupdate."));
+Then, restart %s.", $rpmdrake::myname_update));
myexit(-1);
}
mu_retry_another_mirror:
@@ -1143,7 +1142,7 @@ N("You may also choose your desired mirror manually: to do so,
launch the Software Media Manager, and then add a `Security
updates' medium.
-Then, restart Mandrakeupdate.")), myexit(-1);
+Then, restart %s.", $rpmdrake::myname_update)), myexit(-1);
add_medium_and_check($urpm, {},
$update_name, make_url_mirror($m), 'media_info/synthesis.hdlist.cz', update => 1);
@update_medias = { name => $update_name }; #- hack to simulate a medium for parsing of descriptions
@@ -1586,16 +1585,17 @@ Is it ok to continue?",
This tool will help you choose which software you want to remove from
your computer.")
: $MODE eq 'update' ?
- N("Welcome to Mandrakeupdate!
+ N("Welcome to %s!
This tool will help you choose the updates you want to install on your
-computer.")
+computer.", $rpmdrake::myname_update)
:
- N("Welcome to the software installation tool!
+ ($rpmdrake::branded ? N("Welcome to the software installation tool!")
+ : N("Welcome to the software installation tool!
Your Mandrakelinux system comes with several thousands of software
packages on CDROM or DVD. This tool will help you choose which software
-you want to install on your computer."))
+you want to install on your computer.")))
, yesno => 1) or myexit(-1);
push @$already_splashed, $MODE;
}
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 9386f60d..23905c92 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -25,6 +25,7 @@ use lib qw(/usr/lib/libDrakX);
use standalone; #- warning, standalone must be loaded very first, for 'explanations'
use MDK::Common;
+use MDK::Common::System;
use urpm;
use URPM;
use URPM::Resolve;
@@ -73,11 +74,6 @@ use curl_download;
);
-our $mandrake_release = cat_(
- -e '/etc/mandrakelinux-release' ? '/etc/mandrakelinux-release' : '/etc/mandrake-release'
-) || '';
-(our $mdk_version) = $mandrake_release =~ /(\d+\.\d+)/;
-
eval { require ugtk2; ugtk2->import(qw(:all)) };
if ($@) {
print "This program cannot be run in console mode.\n";
@@ -86,6 +82,15 @@ if ($@) {
ugtk2::add_icon_path('/usr/share/rpmdrake/icons');
c::bind_textdomain_codeset('rpmdrake', 'UTF8');
+
+our $mandrake_release = cat_(
+ -e '/etc/mandrakelinux-release' ? '/etc/mandrakelinux-release' : '/etc/mandrake-release'
+) || '';
+(our $mdk_version) = $mandrake_release =~ /(\d+\.\d+)/;
+our $branded = -f '/etc/sysconfig/oem'
+ and our %distrib = MDK::Common::System::distrib();
+our $myname_update = $rpmdrake::branded ? N("Software Update") : N("Mandrakelinux Update");
+
sub translate {
my ($s) = @_;
my $r = '';
@@ -394,32 +399,51 @@ sub mirrors {
sub choose_mirror {
my (%options) = @_;
- interactive_msg('',
-N("I need to contact the Mandrakesoft website to get the mirror list.
+ interactive_msg('',
+$branded
+? N("I need to access internet to get the mirror list.
+Please check that your network is currently running.
+
+Is it ok to continue?")
+: N("I need to contact the Mandrakesoft website to get the mirror list.
Please check that your network is currently running.
Is it ok to continue?"), yesno => 1) or return '';
- my $wait = wait_msg(N("Please wait, downloading mirror addresses from the Mandrakesoft website."));
+ my $wait = wait_msg(
+ $branded
+ ? N("Please wait, downloading mirror addresses.")
+ : N("Please wait, downloading mirror addresses from the Mandrakesoft website.")
+ );
my @mirrors;
eval { @mirrors = mirrors('/var/cache/urpmi') };
remove_wait_msg($wait);
if ($@) {
my $msg = $@; #- seems that value is bitten before being printed by next func..
interactive_msg(N("Error during download"),
-N("There was an error downloading the mirror list:
+$branded
+? N("There was an error downloading the mirror list:
+
+%s
+The network, or the website, may be unavailable.
+Please try again later.", $msg)
+: N("There was an error downloading the mirror list:
%s
The network, or the Mandrakesoft website, may be unavailable.
-Please try again later.", $msg));
+Please try again later.", $msg)
+ );
return '';
}
!@mirrors and interactive_msg(N("No mirror"),
-N("I can't find any suitable mirror.
+$branded
+? N("I can't find any suitable mirror.")
+: N("I can't find any suitable mirror.
There can be many reasons for this problem; the most frequent is
the case when the architecture of your processor is not supported
-by Mandrakelinux Official Updates.")), return '';
+by Mandrakelinux Official Updates.")
+ ), return '';
my $w = ugtk2->new('rpmdrake', grab => 1);
$w->{rwindow}->set_position($options{transient} ? 'center_on_parent' : 'center_always') if !$::isEmbedded;
@@ -659,9 +683,13 @@ sub check_update_media_version {
if ($_->{name} =~ /(\d+\.\d+).*\bftp\du\b/ && $1 ne $mdk_version) {
interactive_msg(
'rpmdrake',
- N("Your medium `%s', used for updates, does not match the version of Mandrakelinux you're running (%s).
+ $branded
+ ? N("Your medium `%s', used for updates, does not match the version of %s you're running (%s).
+It will be disabled.",
+ $_->{name}, $distrib{system}, $distrib{product})
+ : N("Your medium `%s', used for updates, does not match the version of Mandrakelinux you're running (%s).
It will be disabled.",
- $_->{name}, $mdk_version),
+ $_->{name}, $mdk_version)
);
$_->{ignore} = 1;
$urpm->write_config if -w $urpm->{config};
diff --git a/rpmdrake.spec b/rpmdrake.spec
index abccc93a..1e024004 100644
--- a/rpmdrake.spec
+++ b/rpmdrake.spec
@@ -16,7 +16,7 @@ Release: %{release}
License: GPL
Source0: %name-%version.tar.bz2
Summary: Mandrakelinux graphical front end for choosing packages for installion/removal
-Requires: perl-MDK-Common >= 1.1.18-1mdk
+Requires: perl-MDK-Common >= 1.1.18-2mdk
Requires: urpmi >= 4.5-28mdk gurpmi >= 4.5-28mdk
Requires: perl-URPM >= 1.03-1mdk
Requires: drakxtools >= 10.1-11mdk