Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1921cae295 | |||
| 3322c5aa17 | |||
| 95ffe4d49d | |||
| 59855f3bb1 | |||
| d151a77e51 | |||
| 8fda356c53 |
@@ -20,19 +20,19 @@ use v5.10;
|
||||
no feature "say";
|
||||
use Storable 'dclone';
|
||||
|
||||
my $profile = $ENV{BUILDER_PROFILE} // 16;
|
||||
my $jobs = $ENV{BUILDER_JOBS} // 1;
|
||||
my $use_equo = $ENV{USE_EQUO} // 1;
|
||||
my $preserved_rebuild = $ENV{PRESERVED_REBUILD} // 0;
|
||||
my $profile = $ENV{BUILDER_PROFILE} // 16;
|
||||
my $jobs = $ENV{BUILDER_JOBS} // 1;
|
||||
my $use_equo = $ENV{USE_EQUO} // 1;
|
||||
my $preserved_rebuild = $ENV{PRESERVED_REBUILD} // 0;
|
||||
my $emerge_defaults_args = $ENV{EMERGE_DEFAULTS_ARGS}
|
||||
// "--accept-properties=-interactive --q --oneshot --complete-graph --buildpkg";
|
||||
// "--accept-properties=-interactive --quiet --oneshot --complete-graph --buildpkg";
|
||||
$ENV{FEATURES} = $ENV{FEATURES}
|
||||
// "parallel-fetch protect-owned compressdebug splitdebug -userpriv";
|
||||
|
||||
my $equo_install_atoms = $ENV{EQUO_INSTALL_ATOMS} // 1;
|
||||
my $equo_install_atoms = $ENV{EQUO_INSTALL_ATOMS} // 1;
|
||||
my $equo_install_version = $ENV{EQUO_INSTALL_VERSION} // 0;
|
||||
my $equo_split_install = $ENV{EQUO_SPLIT_INSTALL} // 0;
|
||||
my $equo_mirrorsort = $ENV{EQUO_MIRRORSORT} // 1;
|
||||
my $equo_split_install = $ENV{EQUO_SPLIT_INSTALL} // 0;
|
||||
my $equo_mirrorsort = $ENV{EQUO_MIRRORSORT} // 1;
|
||||
my $entropy_repository = $ENV{ENTROPY_REPOSITORY}
|
||||
// "main"; # Can be weekly, main, testing
|
||||
my $artifacts_folder = $ENV{ARTIFACTS_DIR};
|
||||
@@ -128,6 +128,11 @@ sub parse_overlays {
|
||||
map { $_ =~ s/.*?\:\://g; $_ } grep {/\:\:/} @{ dclone( \@_ ) };
|
||||
}
|
||||
|
||||
sub hook_script {
|
||||
my $s = shift;
|
||||
_system("chmod +x ${s};${s}") if -e $s;
|
||||
}
|
||||
|
||||
sub add_portage_repository {
|
||||
my $repo = $_[0];
|
||||
my $reponame;
|
||||
@@ -262,6 +267,12 @@ sub calculate_missing {
|
||||
return @to_install;
|
||||
}
|
||||
|
||||
sub portage_perms {
|
||||
my $dir = shift;
|
||||
_system("chown -R portage:portage $dir");
|
||||
_system("chmod -R ug+w,a+rX $dir");
|
||||
}
|
||||
|
||||
# Input : complete gentoo package (sys-fs/foobarfs-1.9.2)
|
||||
# Output: atom form (sys-fs/foobarfs)
|
||||
sub atom { s/-[0-9]{1,}.*$//; }
|
||||
@@ -383,8 +394,7 @@ system("echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen"); #be sure about that.
|
||||
if ( $remote_conf_portdir ne "" ) {
|
||||
_system("rm -rf /etc/portage");
|
||||
_system("git clone $remote_conf_portdir /etc/portage");
|
||||
_system("chown -R portage:portage /etc/portage");
|
||||
_system("chmod -R ug+w,a+rX /etc/portage");
|
||||
portage_perms('/etc/portage');
|
||||
}
|
||||
else {
|
||||
_system("cd /etc/portage/;git checkout master; git stash; git pull");
|
||||
@@ -394,9 +404,8 @@ else {
|
||||
if ( $remote_portdir ne "" ) {
|
||||
_system("rm -rf /usr/portage");
|
||||
_system("git clone $remote_portdir /usr/portage");
|
||||
_system("chown -R portage:portage /usr/portage");
|
||||
_system("chmod -R ug+w,a+rX /usr/portage");
|
||||
}
|
||||
|
||||
_system("mkdir /var/lib/layman") if ( !-d "/var/lib/layman" );
|
||||
_system("touch /var/lib/layman/make.conf && layman-updater -R")
|
||||
if ( !-e "/var/lib/layman/make.conf" );
|
||||
@@ -423,8 +432,7 @@ else {
|
||||
chomp(@FILE);
|
||||
$reponame = $FILE[0];
|
||||
}
|
||||
_system("chown -R portage:portage /usr/local/portage");
|
||||
_system("chmod -R 755 /usr/local/portage");
|
||||
portage_perms('/usr/local/portage');
|
||||
|
||||
qx{
|
||||
echo '[$reponame]
|
||||
@@ -450,6 +458,7 @@ if ( $remove_remote_overlay and $remove_remote_overlay ne "" ) {
|
||||
}
|
||||
|
||||
_system("mkdir -p /usr/portage/distfiles/git3-src");
|
||||
portage_perms('/usr/portage');
|
||||
|
||||
unless ( $skip_portage_sync == 1 ) {
|
||||
|
||||
@@ -459,7 +468,7 @@ unless ( $skip_portage_sync == 1 ) {
|
||||
_system("emerge-webrsync");
|
||||
}
|
||||
else {
|
||||
_system("emerge --sync");
|
||||
_system("emerge --sync --quiet");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +624,7 @@ if ($use_equo) {
|
||||
say "", "[install] Those dependencies will be installed with equo :",
|
||||
@packages_deps, "";
|
||||
if ($equo_split_install) {
|
||||
safe_call("equo i $equo_install_args --bdeps '$_'")
|
||||
_system("equo i $equo_install_args --bdeps '$_'")
|
||||
for ( @packages_deps, @equo_install )
|
||||
; ## bail out here, if installs fails. emerge will compile a LOT of stuff
|
||||
if ( @equo_remove > 0 and !$pretend ) {
|
||||
@@ -626,7 +635,7 @@ if ($use_equo) {
|
||||
else {
|
||||
my @p = map {"'$_'"} ( @packages_deps, @equo_install );
|
||||
my @r = map {"'$_'"} @equo_remove;
|
||||
safe_call("equo i $equo_install_args --bdeps @p")
|
||||
_system("equo i $equo_install_args --bdeps @p")
|
||||
if ( @p > 0 )
|
||||
; ## bail out here, if installs fails. emerge will compile a LOT of stuff
|
||||
_system("equo rm --nodeps @r") if ( @r > 0 );
|
||||
@@ -643,7 +652,8 @@ if ( $emerge_remove and $emerge_remove ne "" ) {
|
||||
_system("emerge -C '$_'") for split( / /, $emerge_remove );
|
||||
}
|
||||
|
||||
_system("chmod +x /pre-script;./pre-script") if -e "/pre-script";
|
||||
hook_script("./pre-script");
|
||||
hook_script("/pre-script");
|
||||
|
||||
loud "Compilation phase start";
|
||||
|
||||
@@ -668,12 +678,25 @@ else {
|
||||
$return = $rt >> 8;
|
||||
}
|
||||
|
||||
loud "Compilation phase end";
|
||||
if ( @injected_packages > 0 ) {
|
||||
my $res = compile_packs( "injected_targets", @injected_packages );
|
||||
loud "Compilation summary for injected_targets";
|
||||
foreach my $k ( keys %{$res} ) {
|
||||
my $c = $res->{$k} >> 8;
|
||||
if ( $c != 0 ) {
|
||||
say "$k : build failed ( Exit: $c )";
|
||||
$return = 1 unless $keep_going;
|
||||
}
|
||||
else {
|
||||
say "$k : build succeeded";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# best effort -B
|
||||
compile_packs( "injected_targets", @injected_packages );
|
||||
loud "Compilation phase end (Exit: $return)";
|
||||
|
||||
_system("chmod +x /post-script;./post-script") if -e "/post-script";
|
||||
hook_script("./post-script");
|
||||
hook_script("/post-script");
|
||||
|
||||
if ( $preserved_rebuild and !$pretend ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user