From c83a3f908be2eb13354fdd9cfdb6bcf55796928a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 Dec 2025 08:35:58 +0100 Subject: [PATCH] build/download: allow REMOTEDIR change and consolidate away from UPLOADDIR --- Makefile | 3 +-- README.md | 2 +- build/common.sh | 5 +---- build/download.sh | 4 ++-- build/upload.sh | 4 ++-- composite/nightly.sh | 4 ++-- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 2e816e7..74371d4 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,6 @@ MIRRORS?= https://opnsense.c0urier.net \ https://mirror.fra10.de.leaseweb.net/opnsense \ https://mirror.ams1.nl.leaseweb.net/opnsense SERVER?= user@does.not.exist -UPLOADDIR?= . STAGEDIRPREFIX?=/usr/obj @@ -195,7 +194,7 @@ ${STEP}: lint-steps -g ${TOOLSBRANCH} -E ${COREBRANCH} -G ${PORTSREFBRANCH} \ -H "${COREENV}" -u "${UEFI:tl}" -U "${SUFFIX}" \ -V "${ADDITIONS}" -O "${GITBASE}" -r "${SERVER}" \ - -h "${PLUGINSENV}" -I "${UPLOADDIR}" -D "${EXTRABRANCH}" \ + -h "${PLUGINSENV}" -D "${EXTRABRANCH}" \ -A "${PORTSREFURL}" -J "${PORTSENV}" ${${STEP}_ARGS} .endfor diff --git a/README.md b/README.md index a91f230..0f66854 100644 --- a/README.md +++ b/README.md @@ -503,7 +503,7 @@ Logs can be downloaded as well for local inspection. Note that download like prefetch will purge all locally existing targets. Use SERVER to specify the remote end, e.g. SERVER=user@does.not.exist -Additionally, UPLOADDIR can be used to specify a remote location. At +Additionally, REMOTEDIR can be used to specify a remote location. At this point only "logs" upload cleares and creates directories on the fly. If you want to script interactive prompts you may use the confirm target diff --git a/build/common.sh b/build/common.sh index f9c30e7..c65073c 100644 --- a/build/common.sh +++ b/build/common.sh @@ -28,7 +28,7 @@ set -e -OPTS="A:a:B:b:C:c:D:d:E:e:F:G:g:H:h:I:J:K:k:L:l:m:n:O:o:P:p:R:r:S:s:T:t:U:u:v:V:" +OPTS="A:a:B:b:C:c:D:d:E:e:F:G:g:H:h:J:K:k:L:l:m:n:O:o:P:p:R:r:S:s:T:t:U:u:v:V:" while getopts ${OPTS} OPT; do case ${OPT} in @@ -80,9 +80,6 @@ while getopts ${OPTS} OPT; do h) export PLUGINSENV=${OPTARG} ;; - I) - export UPLOADDIR=${OPTARG} - ;; J) export PORTSENV=${OPTARG} ;; diff --git a/build/download.sh b/build/download.sh index 43b0e91..ac5dce3 100644 --- a/build/download.sh +++ b/build/download.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2018-2019 Franco Fichtner +# Copyright (c) 2018-2025 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -34,7 +34,7 @@ SELF=download download() { echo ">>> Downloading ${1} from ${PRODUCT_SERVER}..." - (cd ${2}; echo "get ${2}/${3}" | sftp ${PRODUCT_SERVER}) + (cd ${2}; echo "get ${REMOTEDIR:-"${2}"}/${3}" | sftp ${PRODUCT_SERVER}) } for ARG in ${@}; do diff --git a/build/upload.sh b/build/upload.sh index 41f73fd..03735e1 100644 --- a/build/upload.sh +++ b/build/upload.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (c) 2018-2024 Franco Fichtner +# Copyright (c) 2018-2025 Franco Fichtner # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -34,7 +34,7 @@ SELF=upload upload() { echo ">>> Uploading ${1} to ${PRODUCT_SERVER}..." - (echo "cd ${UPLOADDIR}"; echo "put ${2}/${3}") | sftp ${PRODUCT_SERVER} + (echo "cd ${REMOTEDIR:-"."}"; echo "put ${2}/${3}") | sftp ${PRODUCT_SERVER} } for ARG in ${@}; do diff --git a/composite/nightly.sh b/composite/nightly.sh index 82a9568..5a8b6c5 100644 --- a/composite/nightly.sh +++ b/composite/nightly.sh @@ -111,8 +111,8 @@ tar -C ${TARGETDIRPREFIX} -cJf \ rm -rf ${LOGSDIR}/latest mv ${LOGSDIR}/${PRODUCT_VERSION} ${LOGSDIR}/latest -# XXX SERVER and UPLOADDIR are forced here and not imported from Makefile -(make upload-log SERVER=${SERVER} UPLOADDIR=${UPLOADDIR} \ +# XXX SERVER and REMOTEDIR are forced here and not imported from Makefile +(make upload-log SERVER=${SERVER} REMOTEDIR=${REMOTEDIR} \ VERSION=${PRODUCT_VERSION} 2>&1) > ${LOGSDIR}/latest/upload.log cat ${LOGSDIR}/latest/watch.log