From 8d6f04e906fabae3f5aea5b6adb6aa080c58764f Mon Sep 17 00:00:00 2001 From: Geaaru Date: Tue, 29 Jan 2019 11:15:02 +0100 Subject: [PATCH 1/8] sark-localbuild: Add BUILDER_PHARE option --- sark-localbuild | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sark-localbuild b/sark-localbuild index 2609b5b..1c8f391 100755 --- a/sark-localbuild +++ b/sark-localbuild @@ -7,7 +7,12 @@ export LC_ALL=en_US.UTF-8 export SKIP_PORTAGE_SYNC="${SKIP_PORTAGE_SYNC:-0}" export SKIP_CLEAN_PACKAGESDIR="${SKIP_CLEAN_PACKAGESDIR:-0}" export EQUO_MIRRORSORT="${EQUO_MIRRORSORT:-0}" +# Enable/Disable create repository phase export CREATEREPO_PHASE=${CREATEREPO_PHASE:-true} +# Enable/Disable builder phase. In general this is always true. +# It is set to false for testing injection of packages or move binhost files +# under a new repository. +export BUILDER_PHASE=${BUILDER_PHASE:-true} export SAB_WORKSPACE="${SAB_WORKSPACE:-$PWD}" export SAB_ARCH="${SAB_ARCH:-intel}" export MAKE_CONF="${MAKE_CONF:-}" @@ -108,9 +113,13 @@ if [ "${SKIP_PRINTENV}" != 1 ] ; then fi -pushd / - /usr/bin/tini -s -- ${SAB_BUILDER} $BUILD_ARGS -popd +if [ "$BUILDER_PHASE" = true ] ; then + pushd / + /usr/bin/tini -s -- ${SAB_BUILDER} $BUILD_ARGS + popd +fi + +[ "$CREATEREPO_PHASE" = false ] && exit $? BUILD_STATUS=$? @@ -147,4 +156,4 @@ if [ "$CHECK_BUILD_DIFFS" -eq 1 ]; then fi export PACKAGES_DIR=$TEMPDIR -sark-localcreaterepo \ No newline at end of file +sark-localcreaterepo From fccb895c4ef2892c91907b0321bf04c9b93d51bf Mon Sep 17 00:00:00 2001 From: Geaaru Date: Tue, 29 Jan 2019 11:16:25 +0100 Subject: [PATCH 2/8] sark-localbuild: Review logic when CHECK_BUILD_DIFFS is disable --- sark-localbuild | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sark-localbuild b/sark-localbuild index 1c8f391..10c238f 100755 --- a/sark-localbuild +++ b/sark-localbuild @@ -153,6 +153,9 @@ if [ "$CHECK_BUILD_DIFFS" -eq 1 ]; then cp -rf "${TBZ2_DIR}"/${TO_INJECT[$i]} ${TEMPDIR}/ done fi +else + # Inject all packages available under /usr/portage/packages + cp -R /usr/portage/packages/* ${TEMPDIR} || true fi export PACKAGES_DIR=$TEMPDIR From 0fab8a45d87c58a334e114b0793f74ca9b4c6dfd Mon Sep 17 00:00:00 2001 From: Geaaru Date: Sat, 2 Mar 2019 20:06:42 +0100 Subject: [PATCH 3/8] sark-localbuild: Add EIT_INJECT_OPTS env var --- sark-localbuild | 8 -------- sark-localcreaterepo | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/sark-localbuild b/sark-localbuild index 10c238f..d06645f 100755 --- a/sark-localbuild +++ b/sark-localbuild @@ -17,21 +17,13 @@ export SAB_WORKSPACE="${SAB_WORKSPACE:-$PWD}" export SAB_ARCH="${SAB_ARCH:-intel}" export MAKE_CONF="${MAKE_CONF:-}" export LOCAL_OVERLAY="${LOCAL_OVERLAY:-$SAB_WORKSPACE/local_overlay}" -export SKIP_COMMIT="${SKIP_COMMIT:-0}" -export SKIP_PUSH="${SKIP_PUSH:-0}" -export REPO_RESET="${REPO_RESET:-0}" # Add skip env print if there are env vars with credentials. export SKIP_PRINTENV="${SKIP_PRINTENV:-0}" -export REPO_CLEAN_EXPIRE="${REPO_CLEAN_EXPIRE:-0}" -export REPO_CLEAN_EXPIRE_DAYS="${REPO_CLEAN_EXPIRE_DAYS:-1}" -# Clean obsolete packages .tgz under binhost directory -export REPO_BINHOST_CLEAN="${REPO_BINHOST_CLEAN:-0}" export SAB_BUILDFILE=${SAB_BUILDFILE:-build.yaml} export SAB_BUILDER=${SAB_BUILDER:-/usr/sbin/builder} export SAB_PORTDIR=${SAB_PORTDIR:-/opt/sabayon-build/conf/${SAB_ARCH}/portage} -export ENTROPY_DIR="/${SAB_WORKSPACE}/artifacts/${REPOSITORY_NAME}" export EDITOR=cat if [ -e "$SAB_WORKSPACE/specs/make.conf" ]; then diff --git a/sark-localcreaterepo b/sark-localcreaterepo index b2fa732..367d87a 100755 --- a/sark-localcreaterepo +++ b/sark-localcreaterepo @@ -3,8 +3,12 @@ export REPOSITORY_NAME="${REPOSITORY_NAME:-$(basename $(pwd))}" export LC_ALL=en_US.UTF-8 export SKIP_PULL="${SKIP_PULL:-0}" +export SKIP_PUSH="${SKIP_PUSH:-0}" +export SKIP_COMMIT="${SKIP_COMMIT:-0}" export SAB_WORKSPACE="${SAB_WORKSPACE:-$PWD}" +# Add additional option for eit inject command. +export EIT_INJECT_OPTS="${EIT_INJECT_OPTS:-}" export REPO_RESET="${REPO_RESET:-0}" # Add skip env print if there are env vars with credentials. @@ -90,7 +94,7 @@ fi eit key import ${REPOSITORY_NAME} ${SAB_WORKSPACE}/confs/${REPOSITORY_NAME}.key ${SAB_WORKSPACE}/confs/${REPOSITORY_NAME}.pub && { eit key sign ${REPOSITORY_NAME} || true; } && { echo "=== Repository key imported successfully ==="; } echo "=== Injecting packages ===" echo "INJECT = ${built_pkgs}" -eit inject --to ${REPOSITORY_NAME} --quick ${built_pkgs} || { echo "ouch unable to inject" && exit 3; } +eit inject ${EIT_INJECT_OPTS} --to ${REPOSITORY_NAME} --quick ${built_pkgs} || { echo "ouch unable to inject" && exit 3; } echo "=== Inject COMPLETED =====" echo "=== Removing packages ===" From 7c4cdfd2df4f3a31c69b4a0acc75f37c8afdbe9c Mon Sep 17 00:00:00 2001 From: Geaaru Date: Fri, 26 Apr 2019 15:08:06 +0200 Subject: [PATCH 4/8] sark-localbuild: Fix typo on handle specs/env --- sark-localbuild | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sark-localbuild b/sark-localbuild index d06645f..bb5b180 100755 --- a/sark-localbuild +++ b/sark-localbuild @@ -91,10 +91,7 @@ if [ -d "$SAB_WORKSPACE"/specs ]; then cp -rfv "$SAB_WORKSPACE/specs/custom.keywords" "${SAB_PORTDIR}/package.keywords/99-custom.keywords" fi - if [ -d "$SAB_WORKSPACE"/specs/env ] ; then - mkdir -p "${SAB_PORTDIR}/package.keywords" || true - cp -rfv "$SAB_WORKSPACE/specs/env/" "${SAB_PORTDIR}/env/" - fi + [ -d "$SAB_WORKSPACE"/specs/env ] && cp -rfv "$SAB_WORKSPACE/specs/env/" "${SAB_PORTDIR}/env/" [ -e "$SAB_WORKSPACE"/specs/custom.env ] && cp -rfv "$SAB_WORKSPACE/specs/custom.env" "${SAB_PORTDIR}/package.env" fi From c0dd65420b90d513abb5129da0c55e0002fb4029 Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Fri, 17 May 2019 11:03:06 +0200 Subject: [PATCH 5/8] sark-localcreaterepo: Use --quick on eit rm --- sark-localcreaterepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sark-localcreaterepo b/sark-localcreaterepo index 367d87a..0eb3af6 100755 --- a/sark-localcreaterepo +++ b/sark-localcreaterepo @@ -100,7 +100,7 @@ echo "=== Inject COMPLETED =====" echo "=== Removing packages ===" if [ -n "${TOREMOVE}" ]; then - echo "Yes" | eit rm --from $REPOSITORY_NAME $TOREMOVE || { echo "ouch unable to remove" && exit 3; } + eit rm --quick --from $REPOSITORY_NAME $TOREMOVE || { echo "ouch unable to remove" && exit 3; } fi echo "=== Removing packages completed ===" From 4b4fab56dc1c30e7f2016e63e9acc3355645305e Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Fri, 17 May 2019 11:07:03 +0200 Subject: [PATCH 6/8] sark-localcreaterepo: Add ENTROPY_RSS_BASEURL, ENTROPY_RSS_WEBURL envs --- sark-localcreaterepo | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sark-localcreaterepo b/sark-localcreaterepo index 0eb3af6..c727c3a 100755 --- a/sark-localcreaterepo +++ b/sark-localcreaterepo @@ -23,6 +23,9 @@ export REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-Autogenerated repositor export ENTROPY_DIR="${ENTROPY_DIR:-/${SAB_WORKSPACE}/artifacts/${REPOSITORY_NAME}}" export PACKAGES_DIR="${PACKAGES_DIR:-/${SAB_WORKSPACE}/artifacts/${REPOSITORY_NAME}-binhost}" +export ENTROPY_RSS_BASEURL="${ENTROPY_RSS_BASEURL:-http://packages.sabayon.org/?quicksearch=}" +export ENTROPY_RSS_WEBURL="${ENTROPY_RSS_WEBURL:-http://www.sabayon.org/}" + set -e . /sbin/sark-functions.sh @@ -47,8 +50,8 @@ database-format = bz2 rss-feed = enable changelog = enable rss-name = packages.rss -rss-base-url = http://packages.sabayon.org/?quicksearch= -rss-website-url = http://www.sabayon.org/ +rss-base-url = ${ENTROPY_RSS_BASEURL} +rss-website-url = ${ENTROPY_RSS_WEBURL} max-rss-entries = 10000 # max-rss-light-entries = 100 rss-light-name = updates.rss From 6a35af70c0fc4cedd0ce772172b9d80af03bc931 Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Fri, 17 May 2019 12:34:01 +0200 Subject: [PATCH 7/8] sark-localcreaterepo: Add PKGS_CACHE_DIR to skip copy of pkgs --- sark-localbuild | 2 +- sark-localcreaterepo | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sark-localbuild b/sark-localbuild index bb5b180..aca0c4c 100755 --- a/sark-localbuild +++ b/sark-localbuild @@ -147,5 +147,5 @@ else cp -R /usr/portage/packages/* ${TEMPDIR} || true fi -export PACKAGES_DIR=$TEMPDIR +export PKGS_CACHE_DIR=$TEMPDIR sark-localcreaterepo diff --git a/sark-localcreaterepo b/sark-localcreaterepo index c727c3a..5962d6e 100755 --- a/sark-localcreaterepo +++ b/sark-localcreaterepo @@ -25,6 +25,9 @@ export PACKAGES_DIR="${PACKAGES_DIR:-/${SAB_WORKSPACE}/artifacts/${REPOSITORY_NA export ENTROPY_RSS_BASEURL="${ENTROPY_RSS_BASEURL:-http://packages.sabayon.org/?quicksearch=}" export ENTROPY_RSS_WEBURL="${ENTROPY_RSS_WEBURL:-http://www.sabayon.org/}" +# When PKGS_CACHE_DIR is defined then use directly packages +# directory without the use of a temporary directory. +export PKGS_CACHE_DIR="${PKGS_CACHE_DIR:-}" set -e @@ -63,9 +66,13 @@ EOF mkdir -p ${ENTROPY_DIR} || true -TEMPDIR=$(mktemp -d) -cp -rf $(find $PACKAGES_DIR -name "*.tbz2" | xargs) $TEMPDIR +if [ -z "${PKGS_CACHE_DIR}" ] ; then + TEMPDIR=$(mktemp -d) + cp -rf $(find $PACKAGES_DIR -name "*.tbz2" | xargs) $TEMPDIR +else + TEMPDIR="${PKGS_CACHE_DIR}" +fi built_pkgs=$(find $TEMPDIR -name "*.tbz2" | xargs) [[ -z "${built_pkgs}" ]] && echo "ERROR: no tbz2s found" && exit 2 From 8064b66bd634ebab8f9fe4f79ef51ae22ac6bb3a Mon Sep 17 00:00:00 2001 From: Daniele Rondina Date: Sat, 18 May 2019 16:46:05 +0200 Subject: [PATCH 8/8] sark-localcreaterepo: Use --quick as default for EIT_INJECT_OPTS --- sark-localcreaterepo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sark-localcreaterepo b/sark-localcreaterepo index 5962d6e..1ff1936 100755 --- a/sark-localcreaterepo +++ b/sark-localcreaterepo @@ -8,7 +8,7 @@ export SKIP_COMMIT="${SKIP_COMMIT:-0}" export SAB_WORKSPACE="${SAB_WORKSPACE:-$PWD}" # Add additional option for eit inject command. -export EIT_INJECT_OPTS="${EIT_INJECT_OPTS:-}" +export EIT_INJECT_OPTS="${EIT_INJECT_OPTS:---quick}" export REPO_RESET="${REPO_RESET:-0}" # Add skip env print if there are env vars with credentials.