diff options
author | Oliver Tappe | 2007-07-28 22:38:11 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-07-28 22:38:11 +0200 |
commit | 102f63c43b0e32622bb5bf83a84cdac67174f539 (patch) | |
tree | ebd5ad2f8c50bca4e8cc38140ae55ee8071bf39c /installer/OpenSLX/OSSetup/MetaPackager/apt.pm | |
parent | * changed several class interfaces as a result of trying to integrate support (diff) | |
download | core-102f63c43b0e32622bb5bf83a84cdac67174f539.tar.gz core-102f63c43b0e32622bb5bf83a84cdac67174f539.tar.xz core-102f63c43b0e32622bb5bf83a84cdac67174f539.zip |
* 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
Diffstat (limited to 'installer/OpenSLX/OSSetup/MetaPackager/apt.pm')
-rw-r--r-- | installer/OpenSLX/OSSetup/MetaPackager/apt.pm | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/installer/OpenSLX/OSSetup/MetaPackager/apt.pm b/installer/OpenSLX/OSSetup/MetaPackager/apt.pm index 65a1d8e7..1526c4ec 100644 --- a/installer/OpenSLX/OSSetup/MetaPackager/apt.pm +++ b/installer/OpenSLX/OSSetup/MetaPackager/apt.pm @@ -37,20 +37,56 @@ sub initPackageSources { my $self = shift; + $ENV{LC_ALL} = 'POSIX'; + + # remove any existing sources + slxsystem('rm -f /etc/apt/sources.list'); + + # create default timezone if there isn't any + if (!-e '/etc/timezone') { + spitFile('/etc/timezone', "$openslxConfig{'default-timezone'}\n"); + } + + # create kernel config if there isn't any + if (!-e '/etc/kernel-img.conf') { + my $kernelConfig = unshiftHereDoc(<<" END-OF-HERE"); + # Kernel image management overrides + # See kernel-img.conf(5) for details + do_symlinks = yes + relative_links = yes + do_bootloader = no + do_bootfloppy = no + do_initrd = yes + link_in_boot = yes + END-OF-HERE + spitFile('/etc/kernel-img.conf', $kernelConfig); + } return; } sub setupPackageSource { - my $self = shift; - my $repoName = shift; - my $repoInfo = shift; + my $self = shift; + my $repoName = shift; + my $repoInfo = shift; my $excludeList = shift; + my $repoURLs = shift; + + my $baseURL = shift @$repoURLs; + my $distribution = $repoInfo->{'distribution'}; + my $components = $repoInfo->{'components'}; + + my $sourcesList = "deb $baseURL $distribution $components\n"; - my $repoSubdir = ''; - if (length($repoInfo->{'repo-subdir'})) { - $repoSubdir = "/$repoInfo->{'repo-subdir'}"; + my $avoidMirrors = $repoInfo->{'avoid-mirrors'} || 0; + if (!$avoidMirrors) { + foreach my $mirrorURL (@$repoURLs) { + $sourcesList .= "deb $mirrorURL $distribution $components\n"; + } } + + appendFile('/etc/apt/sources.list', $sourcesList); + return; } @@ -59,6 +95,12 @@ sub installSelection my $self = shift; my $pkgSelection = shift; + if (slxsystem("apt-get update")) { + die _tr("unable to update repository info (%s)\n", $!); + } + if (slxsystem("apt-get -y install $pkgSelection")) { + die _tr("unable to install selection (%s)\n", $!); + } return; } @@ -66,6 +108,12 @@ sub updateBasicVendorOS { my $self = shift; + if (slxsystem("apt-get -y update")) { + die _tr("unable to update repository info (%s)\n", $!); + } + if (slxsystem("apt-get -y upgrade")) { + die _tr("unable to update this vendor-os (%s)\n", $!); + } return; } |