From 102f63c43b0e32622bb5bf83a84cdac67174f539 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 28 Jul 2007 20:38:11 +0000 Subject: * finished installation support for Debian-etch, Debian-sarge and Ubuntu are nearly done (Ubuntu still missing a kernel ...) * some more refactorings to accommodate Debian-support git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1282 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/MetaPackager/smart.pm | 37 ++++++++++--------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'installer/OpenSLX/OSSetup/MetaPackager/smart.pm') diff --git a/installer/OpenSLX/OSSetup/MetaPackager/smart.pm b/installer/OpenSLX/OSSetup/MetaPackager/smart.pm index 5303a50a..21fe6d92 100644 --- a/installer/OpenSLX/OSSetup/MetaPackager/smart.pm +++ b/installer/OpenSLX/OSSetup/MetaPackager/smart.pm @@ -33,22 +33,14 @@ sub new return bless $self, $class; } -sub initialize +sub initPackageSources { my $self = shift; - my $engine = shift; - $self->SUPER::initialize($engine); $ENV{LC_ALL} = 'POSIX'; - return; -} - -sub initPackageSources -{ - my $self = shift; + # remove any existing channels slxsystem("rm -f /etc/smart/channels/*"); - # remove channel if it already exists if (slxsystem("smart channel -y --remove-all")) { die _tr("unable to remove existing channels (%s)\n", $!); } @@ -74,19 +66,20 @@ sub setupPackageSource if (slxsystem("smart channel -y --add $repoDescr")) { die _tr("unable to add channel '%s' (%s)\n", $repoName, $!); } + my $avoidMirrors = $repoInfo->{'avoid-mirrors'} || 0; - unless ($ENV{SLX_NO_MIRRORS} || $avoidMirrors) { - my $mirrorDescr; - foreach my $mirrorURL (@$repoURLs) { - $mirrorDescr .= " --add $baseURL$repoSubdir $mirrorURL$repoSubdir"; - } - if (defined $mirrorDescr) { - if (slxsystem("smart mirror $mirrorDescr")) { - die _tr( - "unable to add mirrors for channel '%s' (%s)\n", - $repoName, $! - ); - } + return if $avoidMirrors; + + my $mirrorDescr; + foreach my $mirrorURL (@$repoURLs) { + $mirrorDescr .= " --add $baseURL$repoSubdir $mirrorURL$repoSubdir"; + } + if (defined $mirrorDescr) { + if (slxsystem("smart mirror $mirrorDescr")) { + die _tr( + "unable to add mirrors for channel '%s' (%s)\n", + $repoName, $! + ); } } return; -- cgit v1.2.3-55-g7522