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

apertis-pkg-merge-*: Make the local suffix customizable


Downstreams need a different local suffix for their packages and we may
change ours at some point.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent e96cbf16
No related branches found
No related tags found
2 merge requests!175apertis-pkg-merge-*: Make the local suffix customizable,!93WIP: documentation-builder: Rebase on Apertis instead of Debian Buster
...@@ -146,6 +146,16 @@ test-package-source-builder: ...@@ -146,6 +146,16 @@ test-package-source-builder:
- test "$(dpkg-parsechangelog -SVersion)" = 0.5.10.2-5co0 - test "$(dpkg-parsechangelog -SVersion)" = 0.5.10.2-5co0
- test "$(dpkg-parsechangelog -SDistribution)" = apertis - test "$(dpkg-parsechangelog -SDistribution)" = apertis
- cd .. - cd ..
- rm -rf fixture-dash-unmodified
- git clone https://gitlab.apertis.org/infrastructure/test-data/fixture-dash-unmodified
- ": Verify we correctly handle custom local suffixes"
- cd fixture-dash-unmodified
- apertis-pkg-merge-updates --package dash --upstream debian/buster --downstream apertis/v2020dev0 --local-version-suffix TEST
- git log --graph --oneline --decorate
- git diff debian/buster..
- test "$(dpkg-parsechangelog -SVersion)" = 0.5.10.2-5TEST0
- test "$(dpkg-parsechangelog -SDistribution)" = apertis
- cd ..
- git clone https://gitlab.apertis.org/infrastructure/test-data/fixture-dash-modified - git clone https://gitlab.apertis.org/infrastructure/test-data/fixture-dash-modified
- ": Verify we correctly detect local changes and do not finalise the changelog" - ": Verify we correctly detect local changes and do not finalise the changelog"
- cd fixture-dash-modified - cd fixture-dash-modified
......
...@@ -94,6 +94,7 @@ def main(): ...@@ -94,6 +94,7 @@ def main():
parser.add_argument('--package', dest='package', type=str, help='the package name (e.g. glib2.0)') # TODO: figure this out from the repo parser.add_argument('--package', dest='package', type=str, help='the package name (e.g. glib2.0)') # TODO: figure this out from the repo
parser.add_argument('--downstream', dest='downstream', type=str, help='the downstream branch (e.g. apertis/v2020dev0)') parser.add_argument('--downstream', dest='downstream', type=str, help='the downstream branch (e.g. apertis/v2020dev0)')
parser.add_argument('--upstream', dest='upstream', type=str, required=True, help='the upstream branch (e.g. debian/buster)') parser.add_argument('--upstream', dest='upstream', type=str, required=True, help='the upstream branch (e.g. debian/buster)')
parser.add_argument('--local-version-suffix', dest="local_suffix", type=str, default="co", help='the local version suffix to be used in the new changelog entry')
args = parser.parse_args() args = parser.parse_args()
package_name = args.package package_name = args.package
...@@ -121,7 +122,7 @@ def main(): ...@@ -121,7 +122,7 @@ def main():
# we carry some changes in addition to changelog entries # we carry some changes in addition to changelog entries
# and metadata under debian/apertis, so someone should # and metadata under debian/apertis, so someone should
# re-summarize the remaining changes # re-summarize the remaining changes
version = upstream_version.full_version + 'co1' version = upstream_version.full_version + args.local_suffix + '1'
bump_version( bump_version(
version, version,
['PLEASE SUMMARIZE remaining Apertis changes'], ['PLEASE SUMMARIZE remaining Apertis changes'],
...@@ -129,7 +130,7 @@ def main(): ...@@ -129,7 +130,7 @@ def main():
) )
else: else:
# no changes, but we add a suffix anyway # no changes, but we add a suffix anyway
version = upstream_version.full_version + 'co0' version = upstream_version.full_version + args.local_suffix + '0'
bump_version( bump_version(
version, version,
[f'Sync from Debian {args.upstream}.'], [f'Sync from Debian {args.upstream}.'],
......
...@@ -67,11 +67,13 @@ def main(): ...@@ -67,11 +67,13 @@ def main():
required=True, help='the upstream branch (e.g. debian/buster)') required=True, help='the upstream branch (e.g. debian/buster)')
parser.add_argument('--downstreams', dest='downstreams', type=str, parser.add_argument('--downstreams', dest='downstreams', type=str,
required=True, help='downstream branches, colon seperate (e.g. apertis/v2020dev0:apertis/v2019)') required=True, help='downstream branches, colon seperate (e.g. apertis/v2020dev0:apertis/v2019)')
parser.add_argument('--local-version-suffix', dest="local_suffix", type=str, default="co", help='the local version suffix to be used in new changelog entries')
parser.add_argument('project_url', type=str, help='git project url to push updates to') parser.add_argument('project_url', type=str, help='git project url to push updates to')
args = parser.parse_args() args = parser.parse_args()
upstream = args.upstream upstream = args.upstream
downstreams = args.downstreams.split(":") downstreams = args.downstreams.split(":")
local_suffix = args.local_suffix
for upstream_branch in existing_upstream_branches(upstream): for upstream_branch in existing_upstream_branches(upstream):
# Mapping of downstream reference to proposed updates # Mapping of downstream reference to proposed updates
...@@ -92,7 +94,7 @@ def main(): ...@@ -92,7 +94,7 @@ def main():
print("New target, doing merge") print("New target, doing merge")
proposed_branch = f"proposed-updates/{upstream_branch}/{ref[0:8]}" proposed_branch = f"proposed-updates/{upstream_branch}/{ref[0:8]}"
git.checkout("-B", proposed_branch) git.checkout("-B", proposed_branch)
apertis_pkg_merge_updates(f"--downstream={downstream_branch}", f"--upstream={upstream_branch}", _fg=True) apertis_pkg_merge_updates(f"--downstream={downstream_branch}", f"--upstream={upstream_branch}", "--local-version-suffix={local_suffix}", _fg=True)
o = git('diff', '--quiet', f"HEAD..{downstream_branch}", _ok_code=[0,1]) o = git('diff', '--quiet', f"HEAD..{downstream_branch}", _ok_code=[0,1])
if o.exit_code == 1: if o.exit_code == 1:
print("Merge done, pushing") print("Merge done, pushing")
......
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