summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-11-26 15:45:57 +0000
committerThierry Vignaud <tv@mandriva.org>2009-11-26 15:45:57 +0000
commit90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e (patch)
treeada79e605bd50b8df66b81a2067638a76beaac8d
parent8fd39a2250f28727c68367f4cc59fade2ab22c3f (diff)
downloadmgaonline-90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e.tar
mgaonline-90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e.tar.gz
mgaonline-90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e.tar.bz2
mgaonline-90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e.tar.xz
mgaonline-90061efdc5e8f6bdd0858bf2405e9a53b7f65a0e.zip
(is_enterprise_media_supported, is_restricted_media_supported) move
them into shared module (needed for next commits)
-rwxr-xr-xmdkapplet4
-rw-r--r--mdkonline.pm10
2 files changed, 12 insertions, 2 deletions
diff --git a/mdkapplet b/mdkapplet
index 1a6eb0af..459851dd 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -607,7 +607,7 @@ sub silentCheck() {
if (!@update_medias) {
get_product_id();
- if ($product_id->{type} eq 'Enterprise' && $product_id->{product} eq 'Server') {
+ if (is_enterprise_media_supported()) {
checker_exit('no_enterprise_update_medium');
} else {
checker_exit('no_update_medium');
@@ -811,7 +811,7 @@ sub get_enabled_restricted_media {
sub is_restricted_media_configured {
my ($urpm) = @_;
get_product_id();
- return 1 if $product_id->{product} !~ /powerpack/i;
+ return 1 if !is_restricted_media_supported();
my @restricted_media = get_enabled_restricted_media($urpm);
my @names = map { $_->{name} } @restricted_media;
diff --git a/mdkonline.pm b/mdkonline.pm
index b18a12ea..b605e976 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -34,6 +34,8 @@ our @EXPORT = qw(fork_exec
get_banner
get_product_id
get_stale_upgrade_filename
+ is_enterprise_media_supported
+ is_restricted_media_supported
xml2perl
$product_id
$root);
@@ -59,6 +61,14 @@ sub get_release() {
($r);
}
+sub is_enterprise_media_supported() {
+ to_bool($product_id->{type} eq 'Enterprise' && $product_id->{product} eq 'Server');
+}
+
+sub is_restricted_media_supported() {
+ to_bool($product_id->{product} =~ /powerpack/i);
+}
+
sub clean_confdir() {
my $confdir = '/root/.MdkOnline';
system "/bin/rm", "-f", "$confdir/*log.bz2", "$confdir/*log.bz2.uue", "$confdir/*.dif $confdir/rpm_qa_installed_before", "$confdir/rpm_qa_installed_after";