Skip to content

Commit 85549e2

Browse files
committed
build/distfiles: PRODUCT_REBUILD awareness; closes #449
1 parent 07d8091 commit 85549e2

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014-2024 Franco Fichtner <[email protected]>
1+
Copyright (c) 2014-2025 Franco Fichtner <[email protected]>
22
Copyright (c) 2015-2017 The FreeBSD Foundation
33
Copyright (c) 2004-2011 Scott Ullrich <[email protected]>
44
All rights reserved.

build/distfiles.sh

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
# Copyright (c) 2015-2023 Franco Fichtner <[email protected]>
3+
# Copyright (c) 2015-2025 Franco Fichtner <[email protected]>
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions
@@ -69,7 +69,12 @@ echo "${PORTSLIST}" | while read PORT_ORIGIN; do
6969
FLAVOR_ARG="FLAVOR=\${FLAVOR}"
7070
fi
7171
PORT=\${PORT_ORIGIN%%@*}
72-
make -C ${PORTSDIR}/\${PORT} fetch \${MAKE_ARGS} \${FLAVOR_ARG}
72+
if ! make -C ${PORTSDIR}/\${PORT} fetch \${MAKE_ARGS} \${FLAVOR_ARG}; then
73+
if [ -n "${PRODUCT_REBUILD}" ]; then
74+
exit 1
75+
fi
76+
echo ">>> Failed fetching \${PORT}" >> ${STAGEDIR}/.pkg-msg
77+
fi
7378
PORT_DEPENDS=\$(make -C ${PORTSDIR}/\${PORT} all-depends-list \
7479
\${MAKE_ARGS})
7580
for PORT_DEPEND in \${PORT_DEPENDS}; do
@@ -79,7 +84,12 @@ echo "${PORTSLIST}" | while read PORT_ORIGIN; do
7984
FLAVOR_ARG="FLAVOR=\${FLAVOR}"
8085
fi
8186
PORT=\${PORT_DEPEND%%@*}
82-
make -C \${PORT} fetch \${MAKE_ARGS} \${FLAVOR_ARG}
87+
if ! make -C \${PORT} fetch \${MAKE_ARGS} \${FLAVOR_ARG}; then
88+
if [ -n "${PRODUCT_REBUILD}" ]; then
89+
exit 1
90+
fi
91+
echo ">>> Failed fetching \${PORT}" >> ${STAGEDIR}/.pkg-msg
92+
fi
8393
done
8494
done
8595
EOF
@@ -94,6 +104,14 @@ tar -C ${STAGEDIR}${PORTSDIR} -cf \
94104
${SETSDIR}/distfiles-${PRODUCT_VERSION}.tar distfiles
95105
echo "done"
96106

107+
if [ -f ${STAGEDIR}/.pkg-msg ]; then
108+
echo ">>> WARNING: The fetch provided additional info."
109+
cat ${BASEDIR}/.pkg-msg
110+
111+
# signal error as well now
112+
PORTSLIST=
113+
fi
114+
97115
if [ -z "${PORTSLIST}" ]; then
98116
echo ">>> The distfiles fetch did not finish properly :("
99117
exit 1

0 commit comments

Comments
 (0)