From e3e98c067e78d7d2290063eb6c70db070c220bb5 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 24 Nov 2016 15:13:42 +0100 Subject: [PATCH 251/257] reproduce.sh: Add a -d option to specifiy the directory to move the produced distfiles into Obtained from: ElectroBSD --- reproduce.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/reproduce.sh b/reproduce.sh index 6eb83f54c451..cd5c5cb0a30b 100755 --- a/reproduce.sh +++ b/reproduce.sh @@ -1,7 +1,7 @@ #!/bin/sh ########################################################################## -# Copyright (c) 2015 Fabian Keil +# Copyright (c) 2015-2016 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -70,7 +70,7 @@ announce_status() { reproduce_all_the_things() { local \ - f release_dir final_dir + f release_dir release_dir="${MAKEOBJDIRPREFIX}${SRC_DIR}/release" if "${RESUME_BUILD}"; then @@ -104,15 +104,14 @@ reproduce_all_the_things() { cd "${release_dir}" || return 1 - final_dir="${MAKEOBJDIRPREFIX}${SRC_DIR}/${BUILD}-$(date "+%Y-%m-%d-%H:%M")" - mkdir "${final_dir}" || return 1 + mkdir -p "${DISTFILE_DIR}" || return 1 for f in *.txz MANIFEST; do - mv "${f}" "${final_dir}/" || return + mv "${f}" "${DISTFILE_DIR}/" || return done - mv memstick.img "${final_dir}/${BUILD}.img" || return 1 + mv memstick.img "${DISTFILE_DIR}/${BUILD}.img" || return 1 - announce_status "Created files copied to ${final_dir}" - sha256 "${final_dir}"/* + announce_status "Created files copied to ${DISTFILE_DIR}" + sha256 "${DISTFILE_DIR}"/* } assert_untainted_source_tree() { @@ -137,6 +136,7 @@ assert_untainted_source_tree() { respawn_with_clean_environment() { exec env -i PATH="/sbin:/bin:/usr/sbin:/usr/bin" HOME="/root" \ LC_COLLATE=C SHELL=/bin/sh ALREADY_RESPAWNED=1 \ + DISTFILE_DIR="${DISTFILE_DIR}" \ MAX_MAKE_JOBS="${MAX_MAKE_JOBS}" RESUME_BUILD="${RESUME_BUILD}" \ DIRECTORY_PREFIX="${DIRECTORY_PREFIX}" XZ_THREADS=${XZ_THREADS} \ REPRO_SEED="${REPRO_SEED}" SRCCONF=/dev/null /bin/sh "${REPRODUCE_SH}" @@ -152,7 +152,7 @@ main() { dry_run=false config_file="${OPTIONAL_CONFIG_FILE}" - args=$(getopt af:j:npr $*) + args=$(getopt ad:f:j:npr $*) if [ $? -ne 0 ]; then echo 'You are doing it wrong: Invalid flag specified' exit 2 @@ -164,6 +164,11 @@ main() { shift auto_untaint="true" ;; + -d) + shift; + DISTFILE_DIR="${1}" + shift; + ;; -j) shift; MAX_MAKE_JOBS="${1}" @@ -226,6 +231,7 @@ main() { fi export REPRO_SEED="${fake_user}:${BUILD}:${EPOCH}" + export DISTFILE_DIR="${DISTFILE_DIR-${MAKEOBJDIRPREFIX}${SRC_DIR}/${BUILD}-$(date +%Y-%m-%d-%H:%M)}" announce_status "REPRO_SEED=${REPRO_SEED}" -- 2.11.0