Skip to content
Snippets Groups Projects
Commit e7b23d06 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

gitlab-based_packaging_workflow: Use the same tools used in CI


Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent f848121f
No related branches found
No related tags found
1 merge request!2gitlab-based_packaging_workflow: Use the same tools used in CI
Pipeline #122113 passed
......@@ -54,59 +54,55 @@ either boot the Apertis [SDK]( {{< ref "/sdk.md" >}} ) or enter the
## How to sync an Apertis package with a new version from Debian
1. Check out the source repository from GitLab
1. On GitLab, [fork the
project](https://docs.gitlab.com/ce/user/project/repository/forking_workflow.html)
to your personal namespace.
1. Check out the source repository
GITLAB_USER=${USER}
UPSTREAM_DISTRIBUTION=buster
UPSTREAM_VERSION=2.58.3-2
UPSTREAM=http://deb.debian.org/debian/pool/main/g/glib2.0/glib2.0_${UPSTREAM_VERSION}.dsc
MIRROR=https://deb.debian.org/debian
PACKAGE=glib2.0
COMPONENT=target
git clone git@gitlab.apertis.org:pkg/${COMPONENT}/${PACKAGE}
git clone git@gitlab.apertis.org:${GITLAB_USER}/${PACKAGE}
cd ${PACKAGE}
2. Sync the upstream contents
git branch debian/${UPSTREAM_DISTRIBUTION} origin
GBP_CONF_FILES=/etc/git-buildpackage/gbp.conf gbp import-dsc ${UPSTREAM} --debian-branch=debian/${UPSTREAM_DISTRIBUTION} --upstream-branch=upstream/${UPSTREAM_DISTRIBUTION} --no-pristine-tar --allow-unauthenticated
1. Only if moving to a new upstream distribution, prepare the upstream base
branches using the current upstream branches as a base:
3. Commit the orig tarball to pristine-lfs
UPSTREAM_DISTRIBUTION=bullseye
UPSTREAM_BASE=buster
git push origin origin/upstream/${UPSTREAM_BASE}:upstream/${UPSTREAM_DISTRIBUTION}
git push origin origin/debian/${UPSTREAM_BASE}:debian/${UPSTREAM_DISTRIBUTION}
#FIXME: We should consider using 'import-tarballs' script instead, which acts nicely on .dsc files
1. Sync the upstream contents
pristine-lfs commit glib2.0_2.58.3.orig.tar.gz
apertis-pkg-pull-updates --package=$PACKAGE --upstream=$UPSTREAM_DISTRIBUTION --mirror=$MIRROR
git push origin --follow-tags pristine-lfs upstream/${UPSTREAM_DISTRIBUTION} debian/${UPSTREAM_DISTRIBUTION}
4. Prepare the repository for the merge [by setting up
`dpkg-mergechangelogs`](https://manpages.debian.org/testing/dpkg-dev/dpkg-mergechangelogs.1.en.html#INTEGRATION_WITH_GIT)
first and then by configuring it in the repository
1. Merge the upstream changes
git config merge.dpkg-mergechangelogs.driver "dpkg-mergechangelogs -m %O %A %B %A"
echo 'debian/changelog merge=dpkg-mergechangelogs' > .git/info/attributes
PROPOSED_BRANCH=wip/$GITLAB_USER/update-from-${UPSTREAM_DISTRIBUTION}
TARGET_BRANCH=apertis/v2021dev1
git checkout -b ${PROPOSED_BRANCH} ${TARGET_BRANCH}
apertis-pkg-merge-updates --upstream=debian/${UPSTREAM_DISTRIBUTION} --downstream=${PROPOSED_BRANCH}
5. Merge the upstream changes
1. Only if the merge fails, fix the conflicts and continue
git checkout -b wip/$USER/upstream-sync
git status
# fix conflicts
git merge --continue
dch --local co --no-auto-nmu
git merge --no-commit debian/{UPSTREAM_DISTRIBUTION}
1. Check `debian/changelog` and update it if needed by listing all the remaining Apertis changes
dch -l co
# in the editor add some contents to the created changelog entry, leaving it UNRELEASED, for instance:
#
# glib2.0 (2.58.3-2co1) UNRELEASED; urgency=medium
#
# * Sync with Debian Buster
# * Remaining Apertis changes:
# - Disable all tests
git add ./debian/changelog
git commit --signoff -m "Sync with Debian ${UPSTREAM_DISTRIBUTION} ${PACKAGE} ${UPSTREAM_VERSION}"
$EDITOR debian/changelog
git commit --signoff --amend debian/changelog
6. Push your changes for review
1. Push your changes for review
git push origin debian/${UPSTREAM_DISTRIBUTION} debian/${UPSTREAM_VERSION}
git push origin --follow-tags pristine-lfs upstream/${UPSTREAM_DISTRIBUTION} debian/${UPSTREAM_DISTRIBUTION}
git push -o merge_request.create
## How to work with downstream packaging changes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment