[script/builder] handling portage repos.conf with local Overlay

This commit is contained in:
mudler
2015-09-12 13:45:51 +02:00
parent 559f39b78a
commit f4d9699e42
+9 -2
View File
@@ -62,17 +62,24 @@ system("echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen"); #be sure about that.
system("cd /etc/portage/;git checkout master; git pull");
system("echo 'y' | layman -f -a $_") for @overlays;
my $reponame="LocalOverlay";
# Setting up a local overlay if doesn't exists
if (!-f "/usr/local/portage/profiles/repo_name") {
system("mkdir -p /usr/local/portage/{metadata,profiles}");
system("echo 'LocalOverlay' > /usr/local/portage/profiles/repo_name");
system("echo 'masters = gentoo' > /usr/local/portage/metadata/layout.conf");
system("chown -R portage:portage /usr/local/portage");
} else {
open FILE,"</usr/local/portage/profiles/repo_name";
my @FILE=<FILE>;
close FILE;
chomp(@FILE);
$reponame=$FILE[0];
}
# Anyway should be declared, also if you mount it with docker
qx{
echo '[LocalOverlay]
echo '[$reponame]
location = /usr/local/portage
masters = gentoo
priority=9999