mirror of
https://github.com/SCST-project/scst.git
synced 2026-10-22 14:12:33 +00:00
Keep RPM artifact creation, archive generation, package release preparation and version updates in one directory. Switch all component archive targets, the top-level RPM target and the RPM workflow to the relocated helpers. Point archive generation at the shared source inventory in source/ while preserving its caller-directory semantics and the existing package inputs.
36 lines
852 B
Bash
Executable File
36 lines
852 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o pipefail
|
|
|
|
usage() {
|
|
echo "Usage: $(basename "$0") name version [file ...]"
|
|
}
|
|
|
|
if [ $# -lt 2 ]; then
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
scriptdir="$(dirname "$0")"
|
|
name="$1"; shift
|
|
version="$1"; shift
|
|
files=("$@")
|
|
if [ "${#files[@]}" -eq 0 ]; then
|
|
file_list="$("$scriptdir/../source/list-source-files")" || exit $?
|
|
if [ -z "$file_list" ]; then
|
|
echo "Error: no source files found." >&2
|
|
exit 1
|
|
fi
|
|
mapfile -t files <<< "$file_list"
|
|
if [ -e build_mode ]; then
|
|
files+=(build_mode)
|
|
fi
|
|
fi
|
|
|
|
result="../$name-$version.tar.bz2"
|
|
rm -f "${result}"
|
|
printf '%s\n' "${files[@]}" | \
|
|
tar --owner=root --group=root --transform="s|^|$name-$version/|;s|^$name-$version/../scst/include/backport.h$|../scst/include/backport.h|;s|^$name-$version/scstadmin.sysfs$|scstadmin.sysfs|" \
|
|
-cjf "${result}" -T- &&
|
|
ls -l "${result}"
|