Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/etc/poudriere.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,10 @@ DISTFILES_CACHE=/usr/ports/distfiles
# The symlinks are only required for the local poudriere for resovling dependencies,
# they do not need to be uploaded to the CDN.
#PKG_HASH="no"

# If set to "yes", generate the AppStream metadata for each package built and
# for the whole repository. Requires ports-mgmt/appstream-generator installed on
# the host.
# USE_APPSTREAM="no"
# APPSTREAM_MEDIA_BASE="https://example.com"
# APPSTREAM_HTML_BASE="https://example.com"
12 changes: 12 additions & 0 deletions src/share/poudriere/bulk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,18 @@ fi

commit_packages

if [ ${USE_APPSTREAM} = "yes" ]; then
appstream-generator -w ${POUDRIERE_DATA}/appstream/${MASTERNAME} \
publish \
${MASTERNAME}
# TODO:
if [ "${IT_IS_TIME_TO_CLEANUP_APPSTREAM}" = "yes" ]; then
appstream-generator -w ${POUDRIERE_DATA}/appstream/${MASTERNAME} \
cleanup \
${MASTERNAME}
fi
fi

set +e

show_build_results
Expand Down
31 changes: 31 additions & 0 deletions src/share/poudriere/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5094,6 +5094,7 @@ build_port() {
port_var_fetch_originspec "${originspec}" \
${PORT_FLAGS} \
PREFIX PREFIX \
WRKDIR WRKDIR
${_need_root}

allownetworking=0
Expand Down Expand Up @@ -5472,6 +5473,22 @@ may show failures if the port does not respect PREFIX."
esac
done

if [ ${USE_APPSTREAM} = "yes" -a ${testfailure} = 0 ]; then
mkdir -p ${POUDRIERE_DATA}/appstream/${MASTERNAME}
sed -e "s|%%APPSTREAM_ARCHIVE_ROOT%%|${POUDRIERE_DATA}/packages/|g" \
-e "s|%%APPSTREAM_MEDIA_BASE%%|${APPSTREAM_MEDIA_BASE}|g" \
-e "s|%%APPSTREAM_HTML_BASE%%|${APPSTREAM_HTML_BASE}|g" \
-e "s|%%APPSTREAM_SUITE%%|${MASTERNAME}|g" \
-e "s|%%ARCH%%|amd64|g" \
"${MASTERMNT?}${PORTSDIR:?}/Templates/asgen-config.json" \
> ${POUDRIERE_DATA}/appstream/${MASTERNAME}/asgen-config.json
appstream-generator -w ${POUDRIERE_DATA}/appstream/${MASTERNAME} \
process-file \
${MASTERNAME} \
default \
"${mnt:?}${WRKDIR}"
fi

if [ -d "${PACKAGES}/.npkg/${pkgname}" ]; then
# everything was fine we can copy the package to the package
# directory
Expand Down Expand Up @@ -10643,6 +10660,18 @@ if [ ! -d ${POUDRIERED}/jails ]; then
esac
fi

#Create AppStream dataset, if needed
if [ "${USE_APPSTREAM}" = "yes" ]; then
case "${NO_ZFS:+set}" in
set) ;;
*)
if ! zfs get mountpoint ${ZPOOL}${ZROOTFS}/data/appstream >/dev/null 2>&1; then
zfs create -o compression=off ${ZPOOL}${ZROOTFS}/data/appstream
fi
;;
esac
fi

: ${LOIP6:=::1}
: ${LOIP4:=127.0.0.1}
# If in a nested jail we may not even have a loopback to use.
Expand Down Expand Up @@ -10840,6 +10869,8 @@ case "$(mount -t fdescfs | awk '$3 == "/dev/fd" {print $3}')" in
esac

: ${OVERLAYSDIR:=/overlays}
: ${APPSTREAM_MEDIA_BASE:=https://example.com}
: ${APPSTREAM_HTML_BASE:=https://example.com}

TIME_START=$(clock -monotonic)
EPOCH_START=$(clock -epoch)
Expand Down