From 559f39b78a3755d25c11f77cb79a951b44cd1e72 Mon Sep 17 00:00:00 2001 From: mudler Date: Thu, 10 Sep 2015 12:46:17 +0200 Subject: [PATCH] [script/builder] supporting local overlays --- script/builder | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/script/builder b/script/builder index ffcd1f7..4aa16b8 100755 --- a/script/builder +++ b/script/builder @@ -57,11 +57,32 @@ say "\t* ".$_ for @ARGV; say "* Syncing stuff for you, if it's the first time, can take a while"; -# Syncronizing Portage and Entropy +# Syncronizing portage configuration and adding overlays 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; + +# 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"); +} + +# Anyway should be declared, also if you mount it with docker +qx{ +echo '[LocalOverlay] +location = /usr/local/portage +masters = gentoo +priority=9999 +auto-sync = no' > /etc/portage/repos.conf/local.conf +}; # Declaring the repo and giving priority + +# sync portage and overlays system("layman -S;emerge --sync --quiet"); + + qx|eselect profile set $profile|; qx{ls /usr/portage/licenses -1 | xargs -0 > /etc/entropy/packages/license.accept} ; #HAHA