Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0831363686 | |||
| 0f776e4dd8 | |||
| 8261606b8b | |||
| 71403285a4 | |||
| dd53f6a35e | |||
| 0e41fbd168 | |||
| ce0272bd29 | |||
| 4eee9a7fbc | |||
| 320f75cd46 | |||
| e9c671b65e | |||
| e07cb53932 | |||
| 51d7bdc968 | |||
| 79d3d5d4b5 |
@@ -2,6 +2,7 @@
|
||||
|
||||
use Getopt::Long;
|
||||
use v5.10;
|
||||
no feature "say";
|
||||
|
||||
my $profile = $ENV{BUILDER_PROFILE} // 3;
|
||||
my $jobs = $ENV{BUILDER_JOBS} // 1;
|
||||
@@ -20,7 +21,9 @@ my $entropy_repository = $ENV{ENTROPY_REPOSITORY} // "main"; # Can be weekly
|
||||
my $artifacts_folder = $ENV{ARTIFACTS_DIR};
|
||||
my $dep_scan_depth = $ENV{DEPENDENCY_SCAN_DEPTH} // 2;
|
||||
my $skip_portage_sync = $ENV{SKIP_PORTAGE_SYNC} // 0;
|
||||
my $emerge_split_install = $ENV{EMERGE_SPLIT_INSTALL} // 0;
|
||||
my $webrsync = $ENV{WEBRSYNC} // 0;
|
||||
my $enman_repositories = $ENV{ENMAN_REPOSITORIES};
|
||||
|
||||
my $make_conf = $ENV{MAKE_CONF};
|
||||
|
||||
@@ -56,12 +59,11 @@ sub package_deps {
|
||||
# leading to duplicates. The sanest thing to do is dedup the list. This gives the superset of all
|
||||
# possible dependencies, which isn't perfectly accurate but should be good enough. For completely
|
||||
# accurate results, pass in a versioned atom.
|
||||
@dependencies =
|
||||
uniq
|
||||
@dependencies = uniq(
|
||||
sort
|
||||
grep { $_ }
|
||||
map { $_ =~ s/\[.*\]|\s//g; &atom($_) if $atom; $_ }
|
||||
@dependencies;
|
||||
@dependencies);
|
||||
|
||||
$cache{$cache_key} = \@dependencies;
|
||||
}
|
||||
@@ -90,7 +92,6 @@ sub calculate_missing {
|
||||
my @Available_Packages = @{+shift};
|
||||
|
||||
# Getting the package dependencies and the installed packages
|
||||
say "[$package] Getting the package dependencies and the installed packages";
|
||||
my @dependencies = package_deps( $package, $depth, 1 );
|
||||
|
||||
my %install_dependencies = map { $_ => 1 } @dependencies;
|
||||
@@ -135,11 +136,12 @@ sub help {
|
||||
"\t$0 app-foo/foobar --equo foo-misc/foobar --equo net-foo/foobar --layman foo --layman bar foo",
|
||||
"**************************", "",
|
||||
"You can supply multiple overlays as well: $0 plasma-meta --layman kde plab",
|
||||
"The documentation is available at https://github.com/Sabayon/devkit",
|
||||
"";
|
||||
}
|
||||
|
||||
say
|
||||
"************* IF YOU WANT TO SUPPLY ADDITIONAL ARGS TO EMERGE, pass to docker EMERGE_DEFAULT_OPTS env with your options *************";
|
||||
"****************************************************";
|
||||
|
||||
if ( @overlays > 0 ) {
|
||||
say "Overlay(s) to add";
|
||||
@@ -148,11 +150,11 @@ if ( @overlays > 0 ) {
|
||||
}
|
||||
}
|
||||
|
||||
say "Installing:";
|
||||
say "[*] Installing:";
|
||||
|
||||
say "\t* " . $_ for @ARGV;
|
||||
|
||||
say "* Syncing stuff for you, if it's the first time, can take a while";
|
||||
say "[*] Syncing configurations files, Layman and Portage";
|
||||
|
||||
# Syncronizing portage configuration and adding overlays
|
||||
system("echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen"); #be sure about that.
|
||||
@@ -220,6 +222,10 @@ if ($use_equo && $entropy_repository eq "weekly" ) {
|
||||
}
|
||||
|
||||
if ($use_equo) {
|
||||
if ($enman_repositories and $enman_repositories ne "") {
|
||||
my @enman_toadd=split(/ /,$enman_repositories);
|
||||
system("enman add $_") for @enman_toadd;
|
||||
}
|
||||
system("equo repo mirrorsort sabayonlinux.org") if $equo_mirrorsort;
|
||||
system("equo up && equo u")
|
||||
}
|
||||
@@ -241,10 +247,9 @@ if ($use_equo) {
|
||||
if $equo_install_atoms;
|
||||
push( @packages_deps, package_deps( $p, $dep_scan_depth, 0 ) )
|
||||
if $equo_install_version;
|
||||
say "[$p] Done"
|
||||
}
|
||||
@packages_deps = grep { defined() and length() } @packages_deps; #cleaning
|
||||
say "", "[install] Installing missing dependencies with equo", @packages_deps, "";
|
||||
say "", "[install] Those dependencies will be installed with equo :", @packages_deps, "";
|
||||
if ($equo_split_install) {
|
||||
system("equo i --bdeps $_") for (@packages_deps,@equo_install);
|
||||
if (@equo_remove > 0){
|
||||
@@ -257,9 +262,22 @@ if ($use_equo) {
|
||||
}
|
||||
}
|
||||
|
||||
say "* Ready to compile, finger crossed";
|
||||
say "*** Ready to compile, finger crossed ***";
|
||||
|
||||
my $rt = system("emerge $emerge_defaults_args -j $jobs @packages");
|
||||
system("emerge --info"); #always give detailed information about the building environment, helpful to debug
|
||||
|
||||
my $rt;
|
||||
|
||||
if ($emerge_split_install) {
|
||||
for my $pack (@packages){
|
||||
my $tmp_rt=system("emerge $emerge_defaults_args -j $jobs $pack");
|
||||
# $rt=$tmp_rt if ($? == -1 or $? & 127 or !$rt); # if one fails, the build should be considered failed!
|
||||
}
|
||||
$rt=0; #consider the build good anyway, like a "keep-going"
|
||||
}
|
||||
else {
|
||||
$rt = system("emerge $emerge_defaults_args -j $jobs @packages");
|
||||
}
|
||||
|
||||
my $return = $rt >> 8;
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ docker_volumes=( -v "$OUTPUT_DIR:/usr/portage/packages" )
|
||||
|
||||
[ -z "$PORTAGE_CACHE" ] || docker_volumes+=(-v "$PORTAGE_CACHE:/usr/portage")
|
||||
[ -z "$BUILDER_PROFILE" ] || docker_env+=(-e "BUILDER_PROFILE=$BUILDER_PROFILE")
|
||||
[ -z "$EMERGE_SPLIT_INSTALL" ] || docker_env+=(-e "EMERGE_SPLIT_INSTALL=$EMERGE_SPLIT_INSTALL")
|
||||
[ -z "$BUILDER_JOBS" ] || docker_env+=(-e "BUILDER_JOBS=$BUILDER_JOBS")
|
||||
[ -z "$USE_EQUO" ] || docker_env+=(-e "USE_EQUO=$USE_EQUO")
|
||||
[ -z "$PRESERVED_REBUILD" ] || docker_env+=(-e "PRESERVED_REBUILD=$PRESERVED_REBUILD")
|
||||
@@ -36,8 +37,10 @@ docker_volumes=( -v "$OUTPUT_DIR:/usr/portage/packages" )
|
||||
[ -z "$ENTROPY_REPOSITORY" ] || docker_env+=(-e "ENTROPY_REPOSITORY=$ENTROPY_REPOSITORY")
|
||||
[ -z "$SKIP_PORTAGE_SYNC" ] || docker_env+=(-e "SKIP_PORTAGE_SYNC=$SKIP_PORTAGE_SYNC")
|
||||
[ -z "$WEBRSYNC" ] || docker_env+=(-e "WEBRSYNC=$WEBRSYNC")
|
||||
[ -z "$ENMAN_REPOSITORIES" ] || docker_env+=(-e "ENMAN_REPOSITORIES=$ENMAN_REPOSITORIES")
|
||||
[ -z "$DISTFILES" ] || docker_volumes+=(-v "$DISTFILES:/usr/portage/distfiles")
|
||||
[ -z "$ENTROPY_DOWNLOADED_PACKAGES" ] || docker_volumes+=(-v "$ENTROPY_DOWNLOADED_PACKAGES:/var/lib/entropy/client/packages")
|
||||
[ -z "$DISTCC_HOSTS" ] || docker_env+=(-e "DISTCC_HOSTS=$DISTCC_HOSTS")
|
||||
|
||||
if [ -n "$REMOTE_OVERLAY" ]; then
|
||||
git clone "$REMOTE_OVERLAY" "$TEMPDIR"
|
||||
|
||||
@@ -10,6 +10,7 @@ REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-My Sabayon repository}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/eit-amd64}"
|
||||
PORTAGE_ARTIFACTS="${PORTAGE_ARTIFACTS:-$SAB_WORKSPACE/portage_artifacts}"
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-$SAB_WORKSPACE/entropy_artifacts}"
|
||||
DOCKER_OPTS="${DOCKER_OPTS:--ti --rm}"
|
||||
|
||||
args=("$@")
|
||||
EDITOR=cat
|
||||
@@ -88,6 +89,6 @@ function cleanup {
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
echo "docker run --rm --entrypoint /bin/bash ${docker_env[@]} ${docker_volumes[@]} -ti $DOCKER_IMAGE /sabayon/bin/create_repo.sh"
|
||||
echo "docker run $DOCKER_OPTS --entrypoint /bin/bash ${docker_env[@]} ${docker_volumes[@]} $DOCKER_IMAGE /sabayon/bin/create_repo.sh"
|
||||
|
||||
docker run --rm --entrypoint /bin/bash "${docker_env[@]}" "${docker_volumes[@]}" -ti $DOCKER_IMAGE /sabayon/bin/create_repo.sh || true
|
||||
docker run $DOCKER_OPTS --entrypoint /bin/bash "${docker_env[@]}" "${docker_volumes[@]}" $DOCKER_IMAGE /sabayon/bin/create_repo.sh || true
|
||||
|
||||
@@ -10,6 +10,7 @@ REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-My Sabayon repository}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/eit-amd64}"
|
||||
PORTAGE_ARTIFACTS="${PORTAGE_ARTIFACTS:-$SAB_WORKSPACE/portage_artifacts}"
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-$SAB_WORKSPACE/entropy_artifacts}"
|
||||
DOCKER_OPTS="${DOCKER_OPTS:--ti --rm}"
|
||||
|
||||
args=("$@")
|
||||
EDITOR=cat
|
||||
@@ -86,6 +87,6 @@ function cleanup {
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
echo "docker run --rm --entrypoint /bin/bash ${docker_env[@]} ${docker_volumes[@]} -ti $DOCKER_IMAGE /sabayon/bin/create_repo.sh"
|
||||
echo "docker run $DOCKER_OPTS --entrypoint /bin/bash ${docker_env[@]} ${docker_volumes[@]} $DOCKER_IMAGE /sabayon/bin/create_repo.sh"
|
||||
|
||||
docker run --rm --entrypoint /bin/bash "${docker_env[@]}" "${docker_volumes[@]}" -ti $DOCKER_IMAGE /sabayon/bin/create_repo.sh || true
|
||||
docker run $DOCKER_OPTS --entrypoint /bin/bash "${docker_env[@]}" "${docker_volumes[@]}" $DOCKER_IMAGE /sabayon/bin/create_repo.sh || true
|
||||
|
||||
Reference in New Issue
Block a user