@@ -20,19 +20,19 @@ use v5.10;
2020no feature " say" ;
2121use Storable ' dclone' ;
2222
23- my $profile = $ENV {BUILDER_PROFILE } // 16;
24- my $jobs = $ENV {BUILDER_JOBS } // 1;
25- my $use_equo = $ENV {USE_EQUO } // 1;
26- my $preserved_rebuild = $ENV {PRESERVED_REBUILD } // 0;
23+ my $profile = $ENV {BUILDER_PROFILE } // 16;
24+ my $jobs = $ENV {BUILDER_JOBS } // 1;
25+ my $use_equo = $ENV {USE_EQUO } // 1;
26+ my $preserved_rebuild = $ENV {PRESERVED_REBUILD } // 0;
2727my $emerge_defaults_args = $ENV {EMERGE_DEFAULTS_ARGS }
2828 // " --accept-properties=-interactive --quiet --oneshot --complete-graph --buildpkg" ;
2929$ENV {FEATURES } = $ENV {FEATURES }
3030 // " parallel-fetch protect-owned compressdebug splitdebug -userpriv" ;
3131
32- my $equo_install_atoms = $ENV {EQUO_INSTALL_ATOMS } // 1;
32+ my $equo_install_atoms = $ENV {EQUO_INSTALL_ATOMS } // 1;
3333my $equo_install_version = $ENV {EQUO_INSTALL_VERSION } // 0;
34- my $equo_split_install = $ENV {EQUO_SPLIT_INSTALL } // 0;
35- my $equo_mirrorsort = $ENV {EQUO_MIRRORSORT } // 1;
34+ my $equo_split_install = $ENV {EQUO_SPLIT_INSTALL } // 0;
35+ my $equo_mirrorsort = $ENV {EQUO_MIRRORSORT } // 1;
3636my $entropy_repository = $ENV {ENTROPY_REPOSITORY }
3737 // " main" ; # Can be weekly, main, testing
3838my $artifacts_folder = $ENV {ARTIFACTS_DIR };
@@ -267,6 +267,12 @@ sub calculate_missing {
267267 return @to_install ;
268268}
269269
270+ sub portage_perms {
271+ my $dir = shift ;
272+ _system(" chown -R portage:portage $dir " );
273+ _system(" chmod -R ug+w,a+rX $dir " );
274+ }
275+
270276# Input : complete gentoo package (sys-fs/foobarfs-1.9.2)
271277# Output: atom form (sys-fs/foobarfs)
272278sub atom { s / -[0-9]{1,}.*$// ; }
@@ -388,8 +394,7 @@ system("echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen"); #be sure about that.
388394if ( $remote_conf_portdir ne " " ) {
389395 _system(" rm -rf /etc/portage" );
390396 _system(" git clone $remote_conf_portdir /etc/portage" );
391- _system(" chown -R portage:portage /etc/portage" );
392- _system(" chmod -R ug+w,a+rX /etc/portage" );
397+ portage_perms(' /etc/portage' );
393398}
394399else {
395400 _system(" cd /etc/portage/;git checkout master; git stash; git pull" );
@@ -399,9 +404,8 @@ else {
399404if ( $remote_portdir ne " " ) {
400405 _system(" rm -rf /usr/portage" );
401406 _system(" git clone $remote_portdir /usr/portage" );
402- _system(" chown -R portage:portage /usr/portage" );
403- _system(" chmod -R ug+w,a+rX /usr/portage" );
404407}
408+
405409_system(" mkdir /var/lib/layman" ) if ( !-d " /var/lib/layman" );
406410_system(" touch /var/lib/layman/make.conf && layman-updater -R" )
407411 if ( !-e " /var/lib/layman/make.conf" );
@@ -428,8 +432,7 @@ else {
428432 chomp (@FILE );
429433 $reponame = $FILE [0];
430434}
431- _system(" chown -R portage:portage /usr/local/portage" );
432- _system(" chmod -R 755 /usr/local/portage" );
435+ portage_perms(' /usr/local/portage' );
433436
434437qx{
435438echo '[$reponame ]
@@ -455,6 +458,7 @@ if ( $remove_remote_overlay and $remove_remote_overlay ne "" ) {
455458}
456459
457460_system(" mkdir -p /usr/portage/distfiles/git3-src" );
461+ portage_perms(' /usr/portage' );
458462
459463unless ( $skip_portage_sync == 1 ) {
460464
0 commit comments