summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSSetup/MetaPackager
diff options
context:
space:
mode:
authorOliver Tappe2007-05-28 15:29:45 +0200
committerOliver Tappe2007-05-28 15:29:45 +0200
commitd7afcd0a5a3d03251991bc7fc91ba14b38a92fc8 (patch)
treec8bd01847af67ab915cd60abaa25183e56505157 /installer/OpenSLX/OSSetup/MetaPackager
parent* changed slxsystem to ignore SIGPIPE instead of exiting, as this used to cause (diff)
downloadcore-d7afcd0a5a3d03251991bc7fc91ba14b38a92fc8.tar.gz
core-d7afcd0a5a3d03251991bc7fc91ba14b38a92fc8.tar.xz
core-d7afcd0a5a3d03251991bc7fc91ba14b38a92fc8.zip
* integrated mirror support into yum & smart backend
* fixed smart backend with respect to being restarted (it no longer stops, waiting for you to enter an alternative name for any existing channel) * the use of mirrors can now be deactivated with SLX_NO_MIRROR=1, very useful for development git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1095 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/MetaPackager')
-rw-r--r--installer/OpenSLX/OSSetup/MetaPackager/smart.pm28
-rw-r--r--installer/OpenSLX/OSSetup/MetaPackager/yum.pm15
2 files changed, 34 insertions, 9 deletions
diff --git a/installer/OpenSLX/OSSetup/MetaPackager/smart.pm b/installer/OpenSLX/OSSetup/MetaPackager/smart.pm
index c4b9735d..bef44ddc 100644
--- a/installer/OpenSLX/OSSetup/MetaPackager/smart.pm
+++ b/installer/OpenSLX/OSSetup/MetaPackager/smart.pm
@@ -48,6 +48,10 @@ sub initPackageSources
my $self = shift;
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", $!);
+ }
}
sub setupPackageSource
@@ -55,17 +59,29 @@ sub setupPackageSource
my $self = shift;
my $repoName = shift;
my $repoInfo = shift;
+ my $excludeList = shift;
- my $repoURL = $self->{engine}->selectBaseURL($repoInfo);
+ my $repoSubdir;
if (length($repoInfo->{'repo-subdir'})) {
- $repoURL .= "/$repoInfo->{'repo-subdir'}";
+ $repoSubdir = "/$repoInfo->{'repo-subdir'}";
}
- my $repoDescrCmdline
- = qq[$repoName name="$repoInfo->{name}" baseurl=$repoURL];
- $repoDescrCmdline .= " type=rpm-md";
- if (slxsystem("smart channel -y --add $repoDescrCmdline")) {
+ my $repoURLs = $self->{engine}->sortRepositoryURLs($repoInfo);
+ my $baseURL = shift @$repoURLs;
+ my $repoDescr
+ = qq[$repoName name="$repoInfo->{name}" baseurl=$baseURL$repoSubdir];
+ $repoDescr .= " type=rpm-md";
+ if (slxsystem("smart channel -y --add $repoDescr")) {
die _tr("unable to add channel '%s' (%s)\n", $repoName, $!);
}
+ unless ($ENV{SLX_NO_MIRRORS}) {
+ my $mirrorDescr;
+ foreach my $mirrorURL (@$repoURLs) {
+ $mirrorDescr .= " --add $baseURL$repoSubdir $mirrorURL$repoSubdir";
+ }
+ if (slxsystem("smart mirror $mirrorDescr")) {
+ die _tr("unable to add mirrors for channel '%s' (%s)\n", $repoName, $!);
+ }
+ }
}
sub installSelection
diff --git a/installer/OpenSLX/OSSetup/MetaPackager/yum.pm b/installer/OpenSLX/OSSetup/MetaPackager/yum.pm
index acdb470d..6be391f0 100644
--- a/installer/OpenSLX/OSSetup/MetaPackager/yum.pm
+++ b/installer/OpenSLX/OSSetup/MetaPackager/yum.pm
@@ -58,11 +58,20 @@ sub setupPackageSource
my $repoInfo = shift;
my $excludeList = shift;
- my $repoURL = $self->{engine}->selectBaseURL($repoInfo);
+ my $repoSubdir;
if (length($repoInfo->{'repo-subdir'})) {
- $repoURL .= "/$repoInfo->{'repo-subdir'}";
+ $repoSubdir = "/$repoInfo->{'repo-subdir'}";
+ }
+ my $repoURLs = $self->{engine}->sortRepositoryURLs($repoInfo);
+ my $baseURL = shift @$repoURLs;
+
+ my $repoDescr
+ = "[$repoName]\nname=$repoInfo->{name}\nbaseurl=$baseURL$repoSubdir\n";
+ unless ($ENV{SLX_NO_MIRRORS}) {
+ foreach my $mirrorURL (@$repoURLs) {
+ $repoDescr .= " $mirrorURL$repoSubdir\n";
+ }
}
- my $repoDescr = "[$repoName]\nname=$repoInfo->{name}\nbaseurl=$repoURL\n";
my $repoFile = "/etc/yum.repos.d/$repoName.repo";
open(REPO, "> $repoFile")
or die _tr("unable to create repo-file <%s> (%s)\n", $repoFile, $1);