Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate source package tarball when using SOURCES class #215

Merged
merged 1 commit into from
Dec 18, 2024
Merged
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
32 changes: 32 additions & 0 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,38 @@ create_netbootpackage() {
create_netbootpackage
# }}}

# {{{
create_sourcespackages() {
if ! hasclass SOURCES ; then
log "Skipping source package generation, only enabled with class SOURCES"
return 0
fi

local OUTPUT_FILE SOURCES_DIR
OUTPUT_FILE="${OUTPUT}/$(basename "${ISO_NAME}" .iso)-sources.tar"
SOURCES_DIR="${OUTPUT}/grml_sources/"

if ! [ -d "${SOURCES_DIR}" ] ; then
eerror "Base directory ${SOURCES_DIR} not present, can not generate source package" ; eend 1
bailout 22
fi

if tar -C "${OUTPUT}" -cf "${OUTPUT_FILE}" "$(basename "${SOURCES_DIR}")" ; then
(
# shellcheck disable=SC2164 # We just wrote there. If it disappeared, too bad.
cd "$(dirname "${OUTPUT_FILE}")"
sha256sum "$(basename "${OUTPUT_FILE}")" > "${OUTPUT_FILE}.sha256"
)
einfo "Generated source package ${OUTPUT_FILE}" ; eend 0
else
eerror "Could not generate source package ${OUTPUT_FILE}" ; eend 1
bailout 22
fi
}

create_sourcespackages
# }}}

# finalize {{{
if [ -n "${start_seconds}" ] ; then
end_seconds="$(date +%s)"
Expand Down
Loading