Skip to content
Snippets Groups Projects

Small tweaks for the rebase scripts

Open Walter Lozano requested to merge wip/wlozano/rebase-tweaks into main
All threads resolved!
1 file
+ 77
0
Compare changes
  • Side-by-side
  • Inline
+ 77
0
#!/bin/sh
#
# Copyright © 2024 Collabora Ltd.
#
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
#
# Arguments
# -l : List of packages to import (i.e. report/target-keep.txt)
# -t : Private GitLab token used for the REST API
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CUR_DIR=`pwd`
set -eu
COMPONENT=
REASON="Imported to resolve dependencies flagged by germinate/obs"
ARGS=
PUSH_REMOTE=0
DEBIAN_RELEASE=trixie
APERTIS_RELEASE=apertis/v2026dev2
while getopts 'a:c:d:l:pr:' opt
do
case "$opt" in
a)
APERTIS_RELEASE=$OPTARG
;;
c)
COMPONENT=$OPTARG
;;
d)
DEBIAN_RELEASE=$OPTARG
;;
l)
LIST=$OPTARG
;;
p)
PUSH_REMOTE=1
;;
r)
REASON=$OPTARG
;;
*)
echo Invalid argument
;;
esac
done
test "$PUSH_REMOTE" = "1" && ARGS="--push-remote"
if ! command -v import-debian-package ; then
echo Command import-debian-package not found, please add it to the PATH
exit
fi
if [ -z "$COMPONENT" ]; then
echo Component not set aborting!
exit
fi
echo "Processing package list ${LIST}..."
while read p; do
echo "... processing the source package '$p'"
import-debian-package --upstream ${DEBIAN_RELEASE} \
--downstream ${APERTIS_RELEASE} \
--component ${COMPONENT} \
--reason "${REASON}" \
${ARGS} \
--package ${p}
done <${LIST}
echo "The package list ${LIST} have been processed!"
Loading