2017-08-29 17:17:25 +02:00
|
|
|
#!/bin/bash -p
|
|
|
|
|
|
|
|
codename=$1
|
2018-04-27 03:48:43 +02:00
|
|
|
CODENAME=$1
|
2017-08-29 17:17:25 +02:00
|
|
|
package=$2
|
|
|
|
version=$3
|
|
|
|
arch=$4
|
|
|
|
job=$5
|
|
|
|
|
2017-08-30 05:51:28 +02:00
|
|
|
source /home/vinaigrette/config/config
|
2017-08-31 00:35:22 +02:00
|
|
|
source /home/vinaigrette/scripts/package_helpers.sh
|
2017-08-29 17:17:25 +02:00
|
|
|
|
|
|
|
# Architecture independent packages are built on default arch
|
|
|
|
ARCH=$arch
|
|
|
|
[[ $arch == all ]] && ARCH=$DEFAULT_ARCH
|
|
|
|
|
|
|
|
# Resulting changes file
|
|
|
|
CHANGES_FILE=$PBUILDER_RESULTS/${package}_${version}_${ARCH}.changes
|
|
|
|
|
|
|
|
# Retrieve distribution/component
|
|
|
|
DISTRIBUTION=$(get_distribution $CHANGES_FILE)
|
|
|
|
|
|
|
|
# Attempt to extract Debian codename from Distribution
|
|
|
|
extract_codename_distribution $DISTRIBUTION || exit 1
|
|
|
|
|
|
|
|
# Retrieving component from source package
|
|
|
|
get_source_component() {
|
|
|
|
reprepro -b $REPO_DIR -T dsc --list-max 1 --list-format '${$component}' \
|
|
|
|
listfilter $CODENAME "\$Source (==${package}), \$SourceVersion (==${version})"
|
|
|
|
}
|
|
|
|
COMPONENT=$(get_source_component)
|
2020-05-11 04:24:44 +02:00
|
|
|
[ -n "$COMPONENT" ] || echo "Unable to retrieve source package component"
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2018-04-27 03:48:43 +02:00
|
|
|
echo "#########################"
|
|
|
|
echo " Adding binary package..."
|
|
|
|
echo "#########################"
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2020-05-11 04:24:44 +02:00
|
|
|
# Include changes to the given repo (waiting 1m max)
|
|
|
|
echo "Adding to $CODENAME/$COMPONENT..."
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2020-05-11 04:24:44 +02:00
|
|
|
reprepro --waitforlock 6 -b $REPO_DIR -C $COMPONENT include $CODENAME $CHANGES_FILE > /dev/null
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2020-05-11 04:24:44 +02:00
|
|
|
status=$?
|
2017-08-29 17:17:25 +02:00
|
|
|
if [ $status -eq 0 ]; then
|
|
|
|
# Clean pbuilder results
|
|
|
|
for f in $(get_files $CHANGES_FILE); do
|
|
|
|
rm -f /var/cache/pbuilder/result/$f
|
|
|
|
done
|
2020-06-04 21:35:28 +02:00
|
|
|
sendxmpppy "✔️ Completed build for ${package}/${version} for ${CODENAME}/${COMPONENT}/${arch}."
|
2020-05-11 04:24:44 +02:00
|
|
|
else
|
2020-06-04 21:35:28 +02:00
|
|
|
sendxmpppy "❌ Failed to include change of ${package}/${version} for ${CODENAME}/${COMPONENT}/${arch} ?!"
|
2017-08-29 17:17:25 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit $status
|