From 1429ea9432216a032bffafaa633b8066f8f0575f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 31 Jul 2024 08:44:43 +0200 Subject: [PATCH] Support updating submodules to main branch main is the new master ... even better would be a possibility to specify the branch or tag. Maybe with tag:, but then the next question arises to do this per submodule ... --- TarSCM/cli.py | 5 +++-- TarSCM/scm/git.py | 3 ++- appimage.service | 3 ++- snapcraft.service | 3 ++- tar_scm.service.in | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/TarSCM/cli.py b/TarSCM/cli.py index 17ecf4eb..322a559c 100644 --- a/TarSCM/cli.py +++ b/TarSCM/cli.py @@ -127,12 +127,13 @@ def parse_args(self, options): parser.add_argument('--subdir', default='', help='Package just a subdirectory of the sources') parser.add_argument('--submodules', - choices=['enable', 'master', 'disable'], + choices=['enable', 'master', 'main', 'disable'], default='enable', help='Whether or not to include git submodules ' 'from SCM commit log since a given parent ' 'revision (see changesrevision). Use ' - '\'master\' to fetch the latest master.') + '\'master\' or \'main\' to fetch the latest' + 'development revision.') parser.add_argument('--lfs', choices=['enable', 'disable'], default='disable', diff --git a/TarSCM/scm/git.py b/TarSCM/scm/git.py index 40ae1e00..8625f89d 100644 --- a/TarSCM/scm/git.py +++ b/TarSCM/scm/git.py @@ -201,7 +201,8 @@ def fetch_submodules(self): '--recursive'], cwd=self.clone_dir ) - elif 'submodules' in argsd and argsd['submodules'] == 'master': + elif 'submodules' in argsd and \ + argsd['submodules'] in ['main', 'master']: self.helpers.safe_run( self._get_scm_cmd() + ['submodule', 'update', '--init', '--recursive', '--remote'], diff --git a/appimage.service b/appimage.service index 9e241198..58c8a558 100644 --- a/appimage.service +++ b/appimage.service @@ -2,9 +2,10 @@ handle sources specified in appimage.yml This service needs to be executed to download sources according to appimage.yml file - Specify whether to include git submodules. Default is 'enable'. + Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch. enable master + main disable diff --git a/snapcraft.service b/snapcraft.service index d0098a14..c111f21a 100644 --- a/snapcraft.service +++ b/snapcraft.service @@ -2,9 +2,10 @@ handle sources specified in snapcraft.yaml This service needs to be executed to download sources according to snapcraft.yaml file. It also patches the snapcraft tile to use local sources during build. - Specify whether to include git submodules. Default is 'enable'. + Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch. enable master + main disable diff --git a/tar_scm.service.in b/tar_scm.service.in index 57e171d5..0e68da6d 100644 --- a/tar_scm.service.in +++ b/tar_scm.service.in @@ -172,9 +172,10 @@ which get maintained in the SCM. Can be used multiple times. Obsolete parameter which will be ignored. - Specify whether to include git submodules. Default is 'enable'. + Specify whether to include git submodules. Default is 'enable'. main or master is override the specified commit with master or main branch. enable master + main disable ===OBS_ONLY