diff options
Diffstat (limited to 'debian/extra')
-rwxr-xr-x | debian/extra/checkout-upstream | 57 | ||||
-rwxr-xr-x | debian/extra/initramfs-tools/hooks/udev | 4 |
2 files changed, 33 insertions, 28 deletions
diff --git a/debian/extra/checkout-upstream b/debian/extra/checkout-upstream index 68afd43..025b1df 100755 --- a/debian/extra/checkout-upstream +++ b/debian/extra/checkout-upstream @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Prepare systemd source package in current directory for testing an upstream # commit, branch, or PR, without Debian patches. This replaces everything # except the debian/ directory with an upstream checkout. @@ -41,13 +41,38 @@ if [ -d .git ]; then git config --get user.email || git config user.email "$DUMMY_USER_EMAIL" fi +mkdir -p debian/tmp +(cd debian/tmp + git clone "${UPSTREAM_REPO}" upstream || (rm -rf upstream; sleep 60; git clone "${UPSTREAM_REPO}" upstream) + cd upstream + $FETCH + $CO + git config user.email "$DUMMY_USER_EMAIL" + git config user.name "$DUMMY_USER_NAME" + if [ -n "${UPSTREAM_PULL_REQUEST:-}" ] && [ "${UPSTREAM_REPO}" != "https://github.com/systemd/systemd-stable.git" ]; then + git rebase main || git rebase --abort + fi +) +if [ -f debian/tmp/upstream/meson.version ]; then + UPSTREAM_VER=$(cat debian/tmp/upstream/meson.version) +else + UPSTREAM_VER=$(cd debian/tmp/upstream; git describe | sed 's/^v//;s/-/./g') +fi + +# If we are on a stable branch, check out the corresponding packaging branch. For some settings like +# build dependencies it is already too late, but this is mostly relevant for the dh_install files and +# the tests. +if [ -d .git ] && echo "$UPSTREAM_VER" | grep -q '\.'; then + git checkout "ci/v${UPSTREAM_VER%%.*}-stable" +fi + if [ -n "${KEEP_DEBIAN_PATCHES:-}" ]; then # set up pq branch if it does not exist if [ "$BRANCH_NAME" = HEAD ]; then echo "ERROR: $0 must be started from a branch when using KEEP_DEBIAN_PATCHES" >&2 exit 1 fi - gbp pq import 2> /dev/null && gbp pq switch || true + ( gbp pq import 2> /dev/null && gbp pq switch ) || true if ! git branch --contains "$BRANCH_NAME" | grep -q patch-queue/"$BRANCH_NAME"; then echo "ERROR: patch-queue/$BRANCH_NAME exists but it is not rebased, please rebase it." >&2 exit 1 @@ -64,33 +89,13 @@ rm -rf debian/patches [ -n "${KEEP_DEBIAN_TESTS:-}" ] || sed -i '/# NOUPSTREAM/ q' debian/tests/control # create new git commit with debian/ changes -if [ -d .git -a -n "$(git status --short debian)" ]; then +if [ -d .git ] && [ -n "$(git status --short debian)" ]; then git add debian git commit -n -m "checkout-upstream: edit debian/ files for upstream testing" fi -######## -# Everything below this changes only code outside debian/ -# besides temporary use of debian/tmp/ -# and the update to debian/changelog -######## - -mkdir -p debian/tmp -(cd debian/tmp - git clone "${UPSTREAM_REPO}" upstream || (rm -rf upstream; sleep 60; git clone "${UPSTREAM_REPO}" upstream) - cd upstream - $FETCH - $CO - git config user.email "$DUMMY_USER_EMAIL" - git config user.name "$DUMMY_USER_NAME" - if [ -n "${UPSTREAM_PULL_REQUEST:-}" ] && [ "${UPSTREAM_REPO}" != "https://github.com/systemd/systemd-stable.git" ]; then - git rebase main - fi -) -UPSTREAM_VER=$(cd debian/tmp/upstream; git describe | sed 's/^v//;s/-/./g') - # clean out original upstream sources -find -mindepth 1 -maxdepth 1 -name debian -o -name .git -prune -o -print0 | xargs -0n1 rm -rf +find . -mindepth 1 -maxdepth 1 -name debian -o -name .git -prune -o -print0 | xargs -0n1 rm -rf # These options changes are only needed for the upstream CI, and we don't want to pollute d/rules with them. # Also we want to ensure running on an older branch (e.g.: for the systemd-stable repository) doesn't break. @@ -106,7 +111,7 @@ mv debian/tmp/upstream/* . rm -rf debian/tmp # create new git commit with upstream code -if [ -d .git -a -n "$(git status --short)" ] ; then +if [ -d .git ] && [ -n "$(git status --short)" ] ; then git add . git commit -n -m "checkout-upstream: replace with upstream code at version ${UPSTREAM_VER}" fi @@ -114,7 +119,7 @@ fi # import Debian patches which apply cleanly if [ -n "${KEEP_DEBIAN_PATCHES:-}" ]; then for c in $(git log "$BRANCH_NAME"..patch-queue/"$BRANCH_NAME" --format='%H' --reverse); do - if ! git cherry-pick $c; then + if ! git cherry-pick "$c"; then git cherry-pick --abort git reset --hard git clean -dxf diff --git a/debian/extra/initramfs-tools/hooks/udev b/debian/extra/initramfs-tools/hooks/udev index 2ad482a..5a860e1 100755 --- a/debian/extra/initramfs-tools/hooks/udev +++ b/debian/extra/initramfs-tools/hooks/udev @@ -28,9 +28,9 @@ cp -p /etc/udev/udev.conf "$DESTDIR/etc/udev/" # copy .link files containing interface naming definitions mkdir -p "$DESTDIR/usr/lib/systemd/network/" -find -L /usr/lib/systemd/network -name '*.link' -execdir cp -pt "$DESTDIR/usr/lib/systemd/network/" '{}' + +find -L /usr/lib/systemd/network -name '*.link*' -execdir cp -r -pt "$DESTDIR/usr/lib/systemd/network/" '{}' + if [ -d /etc/systemd/network ]; then - find -L /etc/systemd/network -name '*.link' -execdir cp -pt "$DESTDIR/usr/lib/systemd/network/" '{}' + + find -L /etc/systemd/network -name '*.link*' -execdir cp -r -pt "$DESTDIR/usr/lib/systemd/network/" '{}' + fi mkdir -p "$DESTDIR/usr/lib/udev/rules.d/" |