Hello community,

here is the log from the commit of package obs-service-tar_scm for 
openSUSE:Factory checked in at 2020-03-25 23:41:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-tar_scm (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-tar_scm.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-tar_scm"

Wed Mar 25 23:41:28 2020 rev:58 rq:786001 version:0.10.14.1584463383.06b0455

Changes:
--------
--- /work/SRC/openSUSE:Factory/obs-service-tar_scm/obs-service-tar_scm.changes  
2020-02-03 11:11:08.309778827 +0100
+++ 
/work/SRC/openSUSE:Factory/.obs-service-tar_scm.new.3160/obs-service-tar_scm.changes
        2020-03-25 23:41:29.607958217 +0100
@@ -1,0 +2,37 @@
+Tue Mar 17 16:44:31 UTC 2020 - [email protected]
+
+- Update to version 0.10.14.1584435160.d912143:
+  * [dist] don't install gbp files by default
+  * [dist] remove python-keyring* from dependcies
+  * [dist] make gbp switchable in spec file
+
+-------------------------------------------------------------------
+Tue Mar 10 15:22:18 UTC 2020 - [email protected]
+
+- Update to version 0.10.14.1583853599.ccbb399:
+  * support server side credentials for SCM repos
+
+-------------------------------------------------------------------
+Fri Feb 28 14:50:17 UTC 2020 - [email protected]
+
+- Update to version 0.10.12.1582901608.a1c02c1:
+  * simplify osc git update case a lot
+  * fixing revision usage on a commit hash
+
+-------------------------------------------------------------------
+Wed Feb 26 09:45:28 UTC 2020 - [email protected]
+
+- Update to version 0.10.12.1582709176.d82a692:
+  * fix lost commits on local run
+  * fix breakage when working on a specific tag/commit
+  * git-lfs should not be mandatory as tar_scm will never use it
+  * Allow use of git-lfs only when running obs_scm
+  * Document _none_ special version in .service
+  * Version cleanup: don't strip hyphen when building Debian packages
+  * Add new archive option for Debian: git-buildpackage
+  * call git stash with LANG=C
+  * improved comment for method get_changesrevision
+  * Add debian package dep to git-lfs
+  * Implement git LFS blobs retrieval
+
+-------------------------------------------------------------------

Old:
----
  obs-service-tar_scm-0.10.11.1579870213.888e79c.tar.gz

New:
----
  obs-service-tar_scm-0.10.14.1584463383.06b0455.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ obs-service-tar_scm.spec ++++++
--- /var/tmp/diff_new_pack.QItJGu/_old  2020-03-25 23:41:31.395958802 +0100
+++ /var/tmp/diff_new_pack.QItJGu/_new  2020-03-25 23:41:31.431958814 +0100
@@ -90,8 +90,8 @@
 ######## END OF MACROS AND FUN ###################################
 
 Name:           obs-service-tar_scm
-%define version_unconverted 0.10.11.1579870213.888e79c
-Version:        0.10.11.1579870213.888e79c
+%define version_unconverted 0.10.14.1584463383.06b0455
+Version:        0.10.14.1584463383.06b0455
 Release:        0
 Summary:        An OBS source service: create tar ball from svn/git/hg
 License:        GPL-2.0-or-later
@@ -203,6 +203,18 @@
 Experimental snapcraft support: This parses snapcraft.yaml files for SCM
 resources and packages them.
 
+%if 0%{?enable_gbp}
+%package -n     obs-service-gbp
+Summary:        Creates Debian source artefacts from a Git repository
+Group:          Development/Tools/Building
+Requires:       git-buildpackage >= 0.6.0
+Requires:       obs-service-obs_scm-common = %version-%release
+Provides:       obs-service-tar_scm:/usr/lib/obs/service/obs_gbp.service
+
+%description -n obs-service-gbp
+Debian git-buildpackage workflow support: uses gbp to create Debian
+source artefacts (.dsc, .origin.tar.gz and .debian.tar.gz if non-native).
+%endif
 
 %prep
 %setup -q -n obs-service-tar_scm-%version
@@ -233,6 +245,7 @@
 %{_prefix}/lib/obs/service/tar_scm
 %dir %{_sysconfdir}/obs
 %dir %{_sysconfdir}/obs/services
+%attr(-,obsservicerun,obsrun) %dir %{_sysconfdir}/obs/services/tar_scm.d
 %config(noreplace) %{_sysconfdir}/obs/services/*
 
 %files -n obs-service-tar
@@ -253,4 +266,10 @@
 %defattr(-,root,root)
 %{_prefix}/lib/obs/service/snapcraft*
 
+%if 0%{?enable_gbp}
+%files -n obs-service-gbp
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/obs_gbp*
+%endif
+
 %changelog

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.QItJGu/_old  2020-03-25 23:41:31.847958949 +0100
+++ /var/tmp/diff_new_pack.QItJGu/_new  2020-03-25 23:41:31.863958955 +0100
@@ -1,5 +1,5 @@
 pkgname=obs-service-tar_scm
-pkgver=0.10.11.1579870213.888e79c
+pkgver=0.10.14.1584463383.06b0455
 pkgrel=0
 pkgdesc="Source Service for the OpenSUSE Build Service (OBS)"
 arch=('any')

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.QItJGu/_old  2020-03-25 23:41:32.103959033 +0100
+++ /var/tmp/diff_new_pack.QItJGu/_new  2020-03-25 23:41:32.119959039 +0100
@@ -1,8 +1,10 @@
 <servicedata>
 <service name="tar_scm">
             <param 
name="url">git://github.com/adrianschroeter/obs-service-tar_scm.git</param>
-          <param 
name="changesrevision">d44d677cf006d48b261f5e2054ba2126bed64ae1</param></service><service
 name="tar_scm">
+          <param 
name="changesrevision">d44d677cf006d48b261f5e2054ba2126bed64ae1</param></service>
+<service name="tar_scm">
             <param 
name="url">git://github.com/M0ses/obs-service-tar_scm.git</param>
-          <param 
name="changesrevision">b742dfc0e12755cf306a95439494b5bdde7c0c61</param></service><service
 name="tar_scm">
+          <param 
name="changesrevision">9e8b88b088778c44db56781e6a908a0e82e27cf2</param></service>
+<service name="tar_scm">
                 <param 
name="url">git://github.com/openSUSE/obs-service-tar_scm.git</param>
-              <param 
name="changesrevision">888e79c03fa4a8b3aef514176ae77c3dcdcba991</param></service></servicedata>
\ No newline at end of file
+              <param 
name="changesrevision">d912143a87161e3c306c021f8e122140068a1dc6</param></service></servicedata>
\ No newline at end of file

++++++ debian.dsc ++++++
--- /var/tmp/diff_new_pack.QItJGu/_old  2020-03-25 23:41:32.347959113 +0100
+++ /var/tmp/diff_new_pack.QItJGu/_new  2020-03-25 23:41:32.367959120 +0100
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: obs-service-tar-scm
-Version: 0.10.11.1579870213.888e79c
+Version: 0.10.14.1584463383.06b0455
 Provides: obs-service-obs_scm, obs-service-tar
 Binary: obs-service-tar_scm
 Maintainer: Adrian Schroeter <[email protected]>

++++++ obs-service-tar_scm-0.10.11.1579870213.888e79c.tar.gz -> 
obs-service-tar_scm-0.10.14.1584463383.06b0455.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/GNUmakefile 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/GNUmakefile
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/GNUmakefile      
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/GNUmakefile      
2020-03-17 17:43:03.000000000 +0100
@@ -177,6 +177,10 @@
        ln -s tar_scm $(DESTDIR)$(mylibdir)/appimage
        [ ! -L $(DESTDIR)$(mylibdir)/snapcraft ] || rm 
$(DESTDIR)$(mylibdir)/snapcraft
        ln -s tar_scm $(DESTDIR)$(mylibdir)/snapcraft
+ifeq (1, ${WITH_GBP})
+       [ ! -L $(DESTDIR)$(mylibdir)/obs_gbp ] || rm 
$(DESTDIR)$(mylibdir)/obs_gbp
+       ln -s tar_scm $(DESTDIR)$(mylibdir)/obs_gbp
+endif
        find ./TarSCM/ -name '*.py*' -exec install -D -m 644 {} 
$(DESTDIR)$(mylibdir)/{} \;
 
 .PHONY: dirs
@@ -185,14 +189,18 @@
        mkdir -p $(DESTDIR)$(mylibdir)/TarSCM
        mkdir -p $(DESTDIR)$(mylibdir)/TarSCM/scm
        mkdir -p $(DESTDIR)$(mycfgdir)
+       mkdir -p $(DESTDIR)$(mycfgdir)/tar_scm.d
 
 .PHONY: service
 service: dirs
        install -m 0644 tar.service $(DESTDIR)$(mylibdir)/
        install -m 0644 snapcraft.service $(DESTDIR)$(mylibdir)/
        install -m 0644 appimage.service $(DESTDIR)$(mylibdir)/
-       sed -e '/^===OBS_ONLY/,/^===/d' -e '/^===/d' tar_scm.service.in > 
$(DESTDIR)$(mylibdir)/tar_scm.service
-       sed -e '/^===TAR_ONLY/,/^===/d' -e '/^===/d' tar_scm.service.in > 
$(DESTDIR)$(mylibdir)/obs_scm.service
+       sed -e '/^===OBS_ONLY/,/^===/d' -e '/^===GBP_ONLY/,/^===/d' -e 
'/^===/d' tar_scm.service.in > $(DESTDIR)$(mylibdir)/tar_scm.service
+       sed -e '/^===TAR_ONLY/,/^===/d' -e '/^===GBP_ONLY/,/^===/d' -e 
'/^===/d' tar_scm.service.in > $(DESTDIR)$(mylibdir)/obs_scm.service
+ifeq (1, ${WITH_GBP})
+       sed -e '/^===OBS_ONLY/,/^===/d' -e '/^===TAR_ONLY/,/^===/d' -e 
'/^===/d' tar_scm.service.in > $(DESTDIR)$(mylibdir)/obs_gbp.service
+endif
 
 show-python:
        @echo "$(PYTHON)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/README.md 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/README.md
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/README.md        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/README.md        
2020-03-17 17:43:03.000000000 +0100
@@ -130,6 +130,13 @@
 build a tarball from it.  You can find example `appimage.yml` files
 under the `tests/fixtures/` subdirectory.
 
+### gbp
+The `obs_gbp` service can be used to create Debian source artefacts
+(.dsc, .orig.tar.gz and if non-native .debian.tar.gz or .diff.gz) from
+Git repositories, following the very popular [git-buildpackage workflow.]
+(https://honk.sigxcpu.org/piki/projects/git-buildpackage/)
+Requires git-buildpackage to be installed.
+
 ## Archive Formats
 
 ### tar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/__init__.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/__init__.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/__init__.py       
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/__init__.py       
2020-03-17 17:43:03.000000000 +0100
@@ -8,6 +8,7 @@
 from TarSCM.cli        import Cli
 from TarSCM.archive    import Tar
 from TarSCM.archive    import ObsCpio
+from TarSCM.archive    import Gbp
 from TarSCM.exceptions import OptionsError
 
 
@@ -27,6 +28,9 @@
     if os.path.basename(sys.argv[0]) == "snapcraft":
         _cli.snapcraft = True
 
+    if os.path.basename(sys.argv[0]) == "obs_gbp":
+        _cli.use_obs_gbp = True
+
     task_list = Tasks(_cli)
 
     task_list.generate_list()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/archive.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/archive.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/archive.py        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/archive.py        
2020-03-17 17:43:03.000000000 +0100
@@ -7,6 +7,8 @@
 import shutil
 import glob
 import locale
+import logging
+import tempfile
 
 from TarSCM.helpers import Helpers
 
@@ -231,3 +233,132 @@
         self.archivefile    = tar.name
 
         os.chdir(cwd)
+
+
+class Gbp(BaseArchive):
+
+    def create_archive(self, scm_object, **kwargs):
+        """Create Debian source artefacts using git-buildpackage.
+        """
+        args = kwargs['cli']
+        version = kwargs['version']
+
+        (workdir, topdir) = os.path.split(scm_object.clone_dir)
+
+        cwd = os.getcwd()
+        os.chdir(workdir)
+
+        if not args.revision:
+            revision = 'origin/master'
+        else:
+            revision = 'origin/' + args.revision
+
+        command = ['gbp', 'buildpackage', '--git-notify=off',
+                   '--git-force-create', '--git-cleaner="true"']
+
+        # we are not on a proper local branch due to using git-reset but we
+        # anyway use the --git-export option
+        command.extend(['--git-ignore-branch',
+                        "--git-export=%s" % revision])
+
+        # gbp can load submodules without having to run the git command, and
+        # will ignore submodules even if loaded manually unless this option is
+        # passed.
+        if args.submodules:
+            command.extend(['--git-submodules'])
+
+        # create local pristine-tar branch if present
+        ret, output = self.helpers.run_cmd(['git', 'rev-parse', '--verify',
+                                            '--quiet', 'origin/pristine-tar'],
+                                           cwd=scm_object.clone_dir)
+        if not ret:
+            ret, output = self.helpers.run_cmd(['git', 'update-ref',
+                                                'refs/heads/pristine-tar',
+                                                'origin/pristine-tar'],
+                                               cwd=scm_object.clone_dir)
+            if not ret:
+                command.append('--git-pristine-tar')
+            else:
+                command.append('--git-no-pristine-tar')
+        else:
+            command.append('--git-no-pristine-tar')
+
+        # Prevent potentially dangerous arguments from being passed to gbp,
+        # e.g. via cleaner, postexport or other hooks.
+        if args.gbp_build_args:
+            build_args = args.gbp_build_args.split(' ')
+            safe_args = re.compile(
+                '--git-verbose|--git-upstream-tree=.*|--git-no-pristine-tar')
+            p = re.compile('--git-.*|--hook-.*|--.*-hook=.*')
+
+            gbp_args = [arg for arg in build_args if safe_args.match(arg)]
+            dpkg_args = [arg for arg in build_args if not p.match(arg)]
+
+            ignored_args = list(set(build_args) - set(gbp_args + dpkg_args))
+            if ignored_args:
+                logging.info("Ignoring build_args: %s" % ignored_args)
+            command.extend(gbp_args + dpkg_args)
+
+        # Set the version in the changelog. Note that we can't simply use
+        # --source-option=-Dversion=$ver as it will not change the tarball
+        # name, which means dpkg-source -x pkg.dsc will fail as the names
+        # and version will not match
+        cl_path = os.path.join(scm_object.clone_dir, 'debian', 'changelog')
+        skip_versions = ['', '_none_', '_auto_', None]
+        if (os.path.isfile(cl_path) and version not in skip_versions):
+            # Some characters are legal in Debian's versions but not in a git
+            # tag, so they get substituted
+            version = re.sub(r'_', r'~', version)
+            version = re.sub(r'%', r':', version)
+            with open(cl_path, 'r') as cl:
+                lines = cl.readlines()
+            old_version = re.search(r'.+ \((.+)\) .+', lines[0]).group(1)
+            # non-native packages MUST have a debian revision (-xyz)
+            drev_ov = re.search(r'-', old_version)
+            drev_v = re.search(r'-', version)
+            if (drev_ov is not None and drev_v) is None:
+                logging.warning("Package is non-native but requested version"
+                                " %s is native! Ignoring.", version)
+            else:
+                with open(cl_path, 'w+') as cl:
+                    # A valid debian changelog has 'package (version) release'
+                    # as the first line, if it's malformed we don't care as it
+                    # will not even build
+                    logging.debug("Setting version to %s", version)
+                    # gbp by default complains about uncommitted changes
+                    command.append("--git-ignore-new")
+                    lines[0] = re.sub(r'^(.+) \(.+\) (.+)',
+                                      r'\1 (%s) \2' % version, lines[0])
+                    cl.write("".join(lines))
+
+        logging.debug("Running in %s", scm_object.clone_dir)
+
+        self.helpers.safe_run(command, cwd=scm_object.clone_dir)
+
+        # Use dpkg to find out what source artefacts have been built and copy
+        # them back, which allows the script to be future-proof and work with
+        # all present and future package formats
+        sources = self.helpers.safe_run(['dpkg-scansources', workdir],
+                                        cwd=workdir)[1]
+
+        FILES_PATTERN = re.compile(
+            r'^Files:(.*(?:\n .*)+)', flags=re.MULTILINE)
+        for match in FILES_PATTERN.findall(sources):
+            logging.info("Files:")
+            for line in match.strip().split("\n"):
+                fname = line.strip().split(' ')[2]
+                logging.info(" %s", fname)
+                input_file = os.path.join(workdir, fname)
+                output_file = os.path.join(args.outdir, fname)
+
+                filename_matches_dsc = fnmatch.fnmatch(fname, '*.dsc')
+                if (args.gbp_dch_release_update and filename_matches_dsc):
+                    # This tag is used by the build-recipe-dsc to set the OBS
+                    # revision: https://github.com/openSUSE/obs-build/pull/192
+                    logging.debug("Setting OBS-DCH-RELEASE in %s", input_file)
+                    with open(input_file, "a") as dsc_file:
+                        dsc_file.write("OBS-DCH-RELEASE: 1")
+
+                shutil.copy(input_file, output_file)
+
+        os.chdir(cwd)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/changes.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/changes.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/changes.py        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/changes.py        
2020-03-17 17:43:03.000000000 +0100
@@ -97,7 +97,7 @@
 
     def get_changesrevision(self, tar_scm_service):
         """Returns an object representing the <param name="changesrevision">
-        element, or None, if it doesn't exist.
+        element from the _servicedata file, or None, if it doesn't exist.
         """
         params = tar_scm_service.findall("param[@name='changesrevision']")
         if not params:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/cli.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/cli.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/cli.py    
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/cli.py    
2020-03-17 17:43:03.000000000 +0100
@@ -61,6 +61,11 @@
                             choices=['git', 'hg', 'bzr', 'svn', 'tar'])
         parser.add_argument('--url',
                             help='Specify URL of upstream tarball to download')
+        parser.add_argument('--user',
+                            help='Specify user for SCM authentication')
+        parser.add_argument('--keyring-passphrase',
+                            help='Specify passphrase to decrypt credentials '
+                                 'from keyring')
         parser.add_argument('--obsinfo',
                             help='Specify .obsinfo file to create a tar ball')
         parser.add_argument('--version', default='_auto_',
@@ -120,6 +125,12 @@
                                  'from SCM commit log since a given parent '
                                  'revision (see changesrevision). Use '
                                  '\'master\' to fetch the latest master.')
+        parser.add_argument('--lfs',
+                            choices=['enable', 'disable'],
+                            default='disable',
+                            help='Whether or not to include git lfs blobs '
+                                 'from SCM commit log since a given parent '
+                                 'revision (see changesrevision).')
         parser.add_argument('--sslverify', choices=['enable', 'disable'],
                             default='enable',
                             help='Whether or not to check server certificate '
@@ -144,8 +155,14 @@
         parser.add_argument('--history-depth',
                             help='Obsolete osc service parameter that does '
                                  'nothing')
-        # This option is only used in test cases, in real life you would call
-        # obs_scm instead
+        parser.add_argument('--gbp-build-args', type=str,
+                            default='-nc -uc -us -S',
+                            help='Parameters passed to git-buildpackage')
+        parser.add_argument('--gbp-dch-release-update',
+                            choices=['enable', 'disable'], default='disable',
+                            help='Append OBS release number')
+        # These option is only used in test cases, in real life you would call
+        # obs_scm or obs_gbp instead
         parser.add_argument('--use-obs-scm', default = False,
                             help='use obs scm (obscpio) ')
 
@@ -158,6 +175,8 @@
                                  ' Set locale while service run')
         parser.add_argument('--encoding',
                             help='set encoding while service run')
+        parser.add_argument('--use-obs-gbp', default = False,
+                            help='use obs gbp (requires git-buildpackage) ')
 
         self.verify_args(parser.parse_args(options))
 
@@ -191,6 +210,9 @@
         args.package_meta    = bool(args.package_meta == 'yes')
         args.sslverify       = bool(args.sslverify != 'disable')
         args.use_obs_scm     = bool(args.use_obs_scm)
+        args.use_obs_gbp     = bool(args.use_obs_gbp)
+        t_gbp_dch_release_u  = bool(args.gbp_dch_release_update != 'disable')
+        args.gbp_dch_release_update = t_gbp_dch_release_u
 
         # Allow forcing verbose mode from the environment; this
         # allows debugging when running "osc service disabledrun" etc.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/base.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/base.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/base.py       
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/base.py       
2020-03-17 17:43:03.000000000 +0100
@@ -20,6 +20,13 @@
 except ImportError:
     from urlparse import urlparse
 
+keyring_import_error = 0
+
+try:
+    import keyrings.alt.file
+except ImportError:
+    keyring_import_error = 1
+
 
 class Scm():
     def __init__(self, args, task):
@@ -32,6 +39,8 @@
         self.lock_file      = None
         self.basename       = None
         self.repodir        = None
+        self.user           = None
+        self.password       = None
 
         # mandatory arguments
         self.args           = args
@@ -40,6 +49,22 @@
 
         # optional arguments
         self.revision       = args.revision
+        if args.user and args.keyring_passphrase:
+            if keyring_import_error == 1:
+                raise SystemExit('Error while importing keyrings.alt.file but '
+                                 '"--user" and "--keyring_passphrase" are set.'
+                                 ' Please install keyrings.alt.file!')
+            os.environ['XDG_DATA_HOME'] = '/etc/obs/services/tar_scm.d'
+            _kr = keyrings.alt.file.EncryptedKeyring()
+            _kr.keyring_key = args.keyring_passphrase
+            try:
+                self.password = _kr.get_password(self.url, args.user)
+                if not self.password:
+                    raise Exception('No user {u} in keyring for service {s}'
+                                    .format(u=args.user, s=self.url))
+            except AssertionError:
+                raise Exception('Wrong keyring passphrase')
+            self.user     = args.user
 
         # preparation of required attributes
         self.helpers        = Helpers()
@@ -55,6 +80,37 @@
         self.noproxy        = None
         self._calc_proxies()
 
+    def auth_url(self):
+        if self.scm not in ('bzr', 'git', 'hg'):
+            return
+        auth_patterns = {}
+        auth_patterns['bzr'] = {}
+        auth_patterns['bzr']['proto']   = r'^(ftp|bzr|https?)://.*'
+        auth_patterns['bzr']['already'] = r'^(ftp|bzr|https?)://.*:.*@.*'
+        auth_patterns['bzr']['sub']     = r'^((ftp|bzr|https?)://)(.*)'
+        auth_patterns['bzr']['format']  = r'\g<1>{user}:{pwd}@\g<3>'
+        auth_patterns['git'] = {}
+        auth_patterns['git']['proto']   = r'^(ftps?|https?)://.*'
+        auth_patterns['git']['already'] = r'^(ftps?|https?)://.*:.*@.*'
+        auth_patterns['git']['sub']     = r'^((ftps?|https?)://)(.*)'
+        auth_patterns['git']['format']  = r'\g<1>{user}:{pwd}@\g<3>'
+        auth_patterns['hg'] = {}
+        auth_patterns['hg']['proto']   = r'^https?://.*'
+        auth_patterns['hg']['already'] = r'^https?://.*:.*@.*'
+        auth_patterns['hg']['sub']     = r'^(https?://)(.*)'
+        auth_patterns['hg']['format']  = r'\g<1>{user}:{pwd}@\g<2>'
+
+        if self.user and self.password:
+            pattern_proto = re.compile(auth_patterns[self.scm]['proto'])
+            pattern = re.compile(auth_patterns[self.scm]['already'])
+            if pattern_proto.match(self.url) and not pattern.match(self.url):
+                logging.debug('[auth_url] settings credentials from keyring')
+                self.url = re.sub(auth_patterns[self.scm]['sub'],
+                                  auth_patterns[self.scm]['format'].format(
+                                      user=self.user,
+                                      pwd=self.password),
+                                  self.url)
+
     def check_scm(self):
         '''check version of scm to proof, it is installed and executable'''
         subprocess.Popen(
@@ -104,12 +160,21 @@
         # revision
         self.fetch_submodules()
 
+        # obs_scm specific: do not allow running git-lfs to prevent storage
+        #  duplication with tar_scm
+        if self.args.use_obs_scm:
+            self.fetch_lfs()
+
         self.unlock_cache()
 
     def fetch_submodules(self):
         """NOOP in other scm's than git"""
         pass
 
+    def fetch_lfs(self):
+        """NOOP in other scm's than git"""
+        pass
+
     def detect_changes(self):
         """Detect changes between revisions."""
         if not self.args.changesgenerate:
@@ -251,14 +316,18 @@
             'sslverify' not in self.args.__dict__ or \
             self.args.__dict__['sslverify']
 
-    def version_iso_cleanup(self, version):
+    def version_iso_cleanup(self, version, debian=False):
         """Reformat timestamp value."""
         version = re.sub(r'([0-9]{4})-([0-9]{2})-([0-9]{2}) +'
                          r'([0-9]{2})([:]([0-9]{2})([:]([0-9]{2}))?)?'
                          r'( +[-+][0-9]{3,4})',
                          r'\1\2\3T\4\6\8',
                          version)
-        version = re.sub(r'[-:]', '', version)
+        # avoid removing "-" for Debian packages, which use it to split the
+        # upstream vs downstream version
+        # for RPM it has to be stripped instead, as it's an illegal character
+        if not debian:
+            version = re.sub(r'[-:]', '', version)
         return version
 
     def prepare_working_copy(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/bzr.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/bzr.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/bzr.py        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/bzr.py        
2020-03-17 17:43:03.000000000 +0100
@@ -15,6 +15,8 @@
 
     def fetch_upstream_scm(self):
         """SCM specific version of fetch_uptream for bzr."""
+
+        self.auth_url()
         command = self._get_scm_cmd() + ['checkout', self.url, self.clone_dir]
         if self.revision:
             command.insert(3, '-r')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/git.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/git.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/git.py        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/git.py        
2020-03-17 17:43:03.000000000 +0100
@@ -38,34 +38,44 @@
         if self.revision is None:
             self.revision = 'master'
 
-        found_revision = None
-        revs = [x + self.revision for x in ['', 'origin/']]
-        for rev in revs:
-            if self._ref_exists(rev):
-                found_revision = True
-                if os.getenv('OSC_VERSION') and \
-                   len(os.listdir(self.clone_dir)) > 1:
-                    stash_text = self.helpers.safe_run(
-                        self._get_scm_cmd() + ['stash'],
-                        cwd=self.clone_dir)[1]
-                    text = self.helpers.safe_run(
-                        self._get_scm_cmd() + ['reset', '--hard', rev],
-                        cwd=self.clone_dir
-                    )[1]
-                    if stash_text != "No local changes to save\n":
-                        logging.debug("[switch_revision] GIT STASHING")
-                        text += self.helpers.safe_run(
-                            self._get_scm_cmd() + ['stash', 'pop'],
-                            cwd=self.clone_dir)[1]
-                else:
-                    text = self.helpers.safe_run(
-                        self._get_scm_cmd() + ['reset', '--hard', rev],
-                        cwd=self.clone_dir
-                    )[1]
-                break
+        if os.getenv('OSC_VERSION') and \
+           len(os.listdir(self.clone_dir)) > 1:
+            # Ensure that the call of "git stash" is done with
+            # LANG=C to get a reliable output
+            lang_bak = None
+            if 'LANG' in os.environ:
+                lang_bak = os.environ['LANG']
+                os.environ['LANG'] = "C"
+            stash_text = self.helpers.safe_run(
+                self._get_scm_cmd() + ['stash'],
+                cwd=self.clone_dir)[1]
+
+            # merge may fail when not a remote branch, that is fine
+            self.helpers.run_cmd(
+                self._get_scm_cmd() + ['merge', 'origin/' + self.revision],
+                cwd=self.clone_dir,
+                interactive=True)
 
-        if found_revision is None:
-            sys.exit('%s: No such revision' % self.revision)
+            # validate the existens of the revision
+            if self.revision and not self._ref_exists(self.revision):
+                sys.exit('%s: No such revision' % self.revision)
+
+            if stash_text != "No local changes to save\n":
+                logging.debug("[switch_revision] GIT STASHING")
+                self.helpers.run_cmd(
+                    self._get_scm_cmd() + ['stash', 'pop'],
+                    cwd=self.clone_dir,
+                    interactive=True)
+
+            if lang_bak:
+                os.environ['LANG'] = lang_bak
+        else:
+            # is doing the checkout in a hard way
+            # may not exist before when using cache
+            self.helpers.safe_run(
+                self._get_scm_cmd() + ['reset', '--hard', self.revision],
+                cwd=self.clone_dir
+            )
 
         # only update submodules if they have been enabled
         if os.path.exists(os.path.join(self.clone_dir, '.git', 'modules')):
@@ -76,6 +86,7 @@
 
     def fetch_upstream_scm(self):
         """SCM specific version of fetch_uptream for git."""
+        self.auth_url()
         # clone if no .git dir exists
         command = self._get_scm_cmd() + ['clone', self.url, self.clone_dir]
         if not self.is_sslverify_enabled():
@@ -92,6 +103,12 @@
 
         self.fetch_specific_revision()
 
+        if self.revision and not self.repocachedir:
+            self.helpers.safe_run(
+                self._get_scm_cmd() + ['checkout', self.revision],
+                cwd=self.clone_dir
+            )
+
     def fetch_specific_revision(self):
         if self.revision and not self._ref_exists(self.revision):
             # fetch reference from url and create locally
@@ -104,22 +121,36 @@
     def fetch_submodules(self):
         """Recursively initialize git submodules."""
         argsd = self.args.__dict__
-        if ('submodules' in argsd and argsd['submodules'] == 'enable'):
+        if 'submodules' in argsd and argsd['submodules'] == 'enable':
             self.helpers.safe_run(
                 self._get_scm_cmd() + ['submodule', 'update', '--init',
                                        '--recursive'],
                 cwd=self.clone_dir
             )
-        elif ('submodules' in argsd and argsd['submodules'] == 'master'):
+        elif 'submodules' in argsd and argsd['submodules'] == 'master':
             self.helpers.safe_run(
                 self._get_scm_cmd() + ['submodule', 'update', '--init',
                                        '--recursive', '--remote'],
                 cwd=self.clone_dir
             )
 
+    def fetch_lfs(self):
+        """Initialize git lfs objects."""
+        argsd = self.args.__dict__
+        if 'lfs' in argsd and argsd['lfs'] == 'enable':
+            self.helpers.safe_run(
+                self._get_scm_cmd() + ['lfs', 'fetch'],
+                cwd=self.clone_dir
+            )
+            self.helpers.safe_run(
+                self._get_scm_cmd() + ['lfs', 'checkout'],
+                cwd=self.clone_dir
+            )
+
     def update_cache(self):
         """Update sources via git."""
         # Force origin to the wanted URL in case it switched
+        self.auth_url()
         try:
             self.helpers.safe_run(
                 self._get_scm_cmd() + ['config', 'remote.origin.url',
@@ -138,18 +169,12 @@
                 cwd=self.clone_dir,
                 interactive=sys.stdout.isatty()
             )
-            self.helpers.safe_run(
-                self._get_scm_cmd() + ['merge'],
-                cwd=self.clone_dir,
-                interactive=sys.stdout.isatty()
-            )
 
-            self.fetch_specific_revision()
         except SystemExit as exc:
             logging.error("Corrupt clone_dir '%s' detected.", self.clone_dir)
             obs_service_daemon = os.getenv('OBS_SERVICE_DAEMON')
             osc_version = os.getenv('OSC_VERSION')
-            if (obs_service_daemon and not osc_version):
+            if obs_service_daemon and not osc_version:
                 logging.info("Removing corrupt cache!")
                 shutil.rmtree(self.clone_dir)
                 self.fetch_upstream_scm()
@@ -163,6 +188,7 @@
         """
         parent_tag = args['parent_tag']
         versionformat = args['versionformat']
+        debian = args.get('use_obs_gbp', False)
         if versionformat is None:
             versionformat = '%ct.%h'
 
@@ -184,7 +210,7 @@
                                    "--pretty=format:%s" % versionformat],
             self.clone_dir
         )[1]
-        return self.version_iso_cleanup(version)
+        return self.version_iso_cleanup(version, debian)
 
     def _detect_parent_tag(self, args):
         parent_tag = ''
@@ -263,7 +289,6 @@
         if last_rev is None:
             last_rev = self._log_cmd(
                 ['-n1', '--pretty=format:%H', '--skip=10'], subdir)
-            last_rev = last_rev
 
         current_rev = self._log_cmd(['-n1', '--pretty=format:%H'], subdir)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/hg.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/hg.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/hg.py 
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/hg.py 
2020-03-17 17:43:03.000000000 +0100
@@ -58,6 +58,7 @@
 
     def fetch_upstream_scm(self):
         """SCM specific version of fetch_uptream for hg."""
+        self.auth_url()
         command = self._get_scm_cmd() + ['clone', self.url, self.clone_dir]
         if not self.is_sslverify_enabled():
             command += ['--insecure']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/svn.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/svn.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/scm/svn.py        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/scm/svn.py        
2020-03-17 17:43:03.000000000 +0100
@@ -76,6 +76,10 @@
             cfg.close()
             scmcmd += ['--config-dir', self.svntmpdir]
 
+            if self.user and self.password:
+                scmcmd += ['--username', self.user]
+                scmcmd += ['--password', self.password]
+
         return scmcmd
 
     def fetch_upstream_scm(self):
@@ -109,7 +113,7 @@
         except SystemExit as exc:
             logging.warning("Could not update cache: >>>%s<<<!", exc.code)
             osd = os.getenv('OBS_SERVICE_DAEMON')
-            if (re.match(r".*run 'cleanup'.*", exc.code) and osd):
+            if re.match(r".*run 'cleanup'.*", exc.code) and osd:
                 logging.warning("Removing old cache dir '%s'!", self.clone_dir)
                 shutil.rmtree(self.clone_dir)
                 self.fetch_upstream_scm()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/tasks.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/tasks.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/TarSCM/tasks.py  
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/TarSCM/tasks.py  
2020-03-17 17:43:03.000000000 +0100
@@ -201,16 +201,23 @@
 
         detected_changes = scm_object.detect_changes()
 
-        scm_object.prep_tree_for_archive(args.subdir, args.outdir,
-                                         dstname=dstname)
-        self.cleanup_dirs.append(scm_object.arch_dir)
+        if not args.use_obs_gbp:
+            scm_object.prep_tree_for_archive(args.subdir, args.outdir,
+                                             dstname=dstname)
+            self.cleanup_dirs.append(scm_object.arch_dir)
 
+        # For the GBP service there is no copy in arch_dir, so use clone_dir
+        # which has the same content
+        extract_src = scm_object.arch_dir
         if args.use_obs_scm:
             arch = TarSCM.archive.ObsCpio()
+        elif args.use_obs_gbp:
+            arch = TarSCM.archive.Gbp()
+            extract_src = scm_object.clone_dir
         else:
             arch = TarSCM.archive.Tar()
 
-        arch.extract_from_archive(scm_object.arch_dir, args.extract,
+        arch.extract_from_archive(extract_src, args.extract,
                                   args.outdir)
 
         arch.create_archive(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/appimage.service 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/appimage.service
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/appimage.service 
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/appimage.service 
2020-03-17 17:43:03.000000000 +0100
@@ -7,6 +7,11 @@
     <allowedvalue>master</allowedvalue>
     <allowedvalue>disable</allowedvalue>
   </parameter>
+  <parameter name="lfs">
+    <description>Specify whether to include git lfs blobs.  Default is 
'disable'.</description>
+    <allowedvalue>enable</allowedvalue>
+    <allowedvalue>disable</allowedvalue>
+  </parameter>
   <parameter name="sslverify">
     <description>Specify Whether or not to check server certificate against 
installed CAs.  Default is 'enable'.</description>
     <allowedvalue>enable</allowedvalue>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/debian/control 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/debian/control
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/debian/control   
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/debian/control   
2020-03-17 17:43:03.000000000 +0100
@@ -11,7 +11,7 @@
 Architecture: all
 Provides: obs-service-obs-scm, obs-service-tar
 Depends: ${misc:Depends}, ${python:Depends}, bzr, git, subversion, cpio, 
python-dateutil, python-yaml, locales-all
-Recommends: mercurial
+Recommends: mercurial, git-buildpackage, git-lfs
 Description: An OBS source service: fetches SCM tarballs
  This is a source service for openSUSE Build Service.
  It supports downloading from svn, git, hg and bzr repositories.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/dist/obs-service-tar_scm.spec
 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/dist/obs-service-tar_scm.spec
--- 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/dist/obs-service-tar_scm.spec
    2020-01-24 13:50:13.000000000 +0100
+++ 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/dist/obs-service-tar_scm.spec
    2020-03-17 17:43:03.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package obs-service-tar_scm
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -90,13 +90,13 @@
 ######## END OF MACROS AND FUN ###################################
 
 Name:           obs-service-tar_scm
-%define version_unconverted 0.10.9.1557261720.32a1cdb
-Version:        0.10.9.1557261720.32a1cdb
+%define version_unconverted 0.10.14.1583853599.ccbb399
+Version:        0.10.14.1583853599.ccbb399
 Release:        0
 Summary:        An OBS source service: create tar ball from svn/git/hg
 License:        GPL-2.0-or-later
 Group:          Development/Tools/Building
-Url:            https://github.com/openSUSE/obs-service-tar_scm
+URL:            https://github.com/openSUSE/obs-service-tar_scm
 Source:         %{name}-%{version}.tar.gz
 
 # Fix build on Ubuntu by disabling mercurial tests, not applied in rpm
@@ -203,6 +203,18 @@
 Experimental snapcraft support: This parses snapcraft.yaml files for SCM
 resources and packages them.
 
+%if 0%{?enable_gbp}
+%package -n     obs-service-gbp
+Summary:        Creates Debian source artefacts from a Git repository
+Group:          Development/Tools/Building
+Requires:       git-buildpackage >= 0.6.0
+Requires:       obs-service-obs_scm-common = %version-%release
+Provides:       obs-service-tar_scm:/usr/lib/obs/service/obs_gbp.service
+
+%description -n obs-service-gbp
+Debian git-buildpackage workflow support: uses gbp to create Debian
+source artefacts (.dsc, .origin.tar.gz and .debian.tar.gz if non-native).
+%endif
 
 %prep
 %setup -q -n obs-service-tar_scm-%version
@@ -233,6 +245,7 @@
 %{_prefix}/lib/obs/service/tar_scm
 %dir %{_sysconfdir}/obs
 %dir %{_sysconfdir}/obs/services
+%attr(-,obsservicerun,obsrun) %dir %{_sysconfdir}/obs/services/tar_scm.d
 %config(noreplace) %{_sysconfdir}/obs/services/*
 
 %files -n obs-service-tar
@@ -253,4 +266,10 @@
 %defattr(-,root,root)
 %{_prefix}/lib/obs/service/snapcraft*
 
+%if 0%{?enable_gbp}
+%files -n obs-service-gbp
+%defattr(-,root,root)
+%{_prefix}/lib/obs/service/obs_gbp*
+%endif
+
 %changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/obs_gbp 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/obs_gbp
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/obs_gbp  1970-01-01 
01:00:00.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/obs_gbp  2020-03-25 
23:41:33.451959474 +0100
@@ -0,0 +1 @@
+symbolic link to tar_scm.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/snapcraft.service 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/snapcraft.service
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/snapcraft.service        
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/snapcraft.service        
2020-03-17 17:43:03.000000000 +0100
@@ -7,6 +7,11 @@
     <allowedvalue>master</allowedvalue>
     <allowedvalue>disable</allowedvalue>
   </parameter>
+  <parameter name="lfs">
+    <description>Specify whether to include git lfs blobs.  Default is 
'disable'.</description>
+    <allowedvalue>enable</allowedvalue>
+    <allowedvalue>disable</allowedvalue>
+  </parameter>
   <parameter name="sslverify">
     <description>Specify Whether or not to check server certificate against 
installed CAs.  Default is 'enable'.</description>
     <allowedvalue>enable</allowedvalue>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tar_scm.service.in 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tar_scm.service.in
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tar_scm.service.in       
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tar_scm.service.in       
2020-03-17 17:43:03.000000000 +0100
@@ -11,6 +11,20 @@
   <description>This service uses a SCM client to checkout or update from a 
given repository.  Supported are svn, git, hg and bzr.</description>
 ===
 
+===GBP_ONLY
+<service name="gbp_scm">
+  <summary>Create Debian source artefacts from SCM repository</summary>
+  <description>This service uses a Git to checkout or update from a given 
repository and create the Debian source artefacts (.dsc, .origin.tar.gz and 
.debian.tar.gz if non-native). Can only be used with (and implies) --scm 
git.</description>
+  <parameter name="gbp-build-args">
+    <description>Parameters passed to git-buildpackage. Default is '-nc -uc 
-us -S'.</description>
+  </parameter>
+  <parameter name="gbp-dch-release-update">
+    <description>Append OBS release number.  Default is 
'disable'.</description>
+    <allowedvalue>enable</allowedvalue>
+    <allowedvalue>disable</allowedvalue>
+  </parameter>
+===
+
   <parameter name="scm">
     <description>Specify SCM to use.</description>
     <allowedvalue>svn</allowedvalue>
@@ -23,11 +37,31 @@
     <description>Specify URL to checkout.</description>
     <required/>
   </parameter>
+  <parameter name="user">
+    <description>
+      Specify the username to be used for authentication to the repository.
+    </description>
+  </parameter>
+  <parameter name="keyring-passphrase">
+    <description>
+    Specify the passphrase to decrypt credentials from the python keyring.
+    To store credentials please use the following command line:
+    "sudo -H -u obsservicerun XDG_DATA_HOME=/etc/obs/services/tar_scm.d 
keyring -b keyrings.alt.file.EncryptedKeyring set URL username"
+      Its only available for the following combinaison of SCM / protocols:
+        - git: ftp(s),http(s)
+        - svn
+        - bzr: bzr,ftp,http(s)
+        - hg: http(s)
+    </description>
+  </parameter>
   <parameter name="subdir">
     <description>Package just a subdirectory.</description>
   </parameter>
   <parameter name="version">
-    <description>Specify version to be used in tarball.  Defaults to 
automatically detected value formatted by versionformat parameter.</description>
+    <description>
+      Specify version to be used in tarball.  Defaults to automatically 
detected value formatted by versionformat parameter (_auto_).
+      Use _none_ to disable version rewriting and use what is defined in the 
spec or debian/changelog.
+    </description>
   </parameter>
   <parameter name="versionformat">
     <description>
@@ -140,6 +174,13 @@
     <allowedvalue>master</allowedvalue>
     <allowedvalue>disable</allowedvalue>
   </parameter>
+===OBS_ONLY
+  <parameter name="lfs">
+    <description>Specify whether to include git-lfs blobs.  Default is 
'disable'.</description>
+    <allowedvalue>enable</allowedvalue>
+    <allowedvalue>disable</allowedvalue>
+  </parameter>
+===
   <parameter name="sslverify">
     <description>Specify Whether or not to check server certificate against 
installed CAs.  Default is 'enable'.</description>
     <allowedvalue>enable</allowedvalue>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tests/fake_classes.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tests/fake_classes.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tests/fake_classes.py    
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tests/fake_classes.py    
2020-03-17 17:43:03.000000000 +0100
@@ -1,10 +1,12 @@
 class FakeCli(dict):  # pylint: disable=no-init,too-few-public-methods
     def __init__(self, match_tag=False):
-        self.url             = ''
-        self.revision        = ''
-        self.changesgenerate = False
-        self.subdir          = ''
-        self.match_tag       = match_tag
+        self.url                = ''
+        self.revision           = ''
+        self.changesgenerate    = False
+        self.subdir             = ''
+        self.match_tag          = match_tag
+        self.user               = ''
+        self.keyring_passphrase = ''
 
 
 class FakeTasks():  # pylint: disable=no-init,too-few-public-methods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tests/scm.py 
new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tests/scm.py
--- old/obs-service-tar_scm-0.10.11.1579870213.888e79c/tests/scm.py     
2020-01-24 13:50:13.000000000 +0100
+++ new/obs-service-tar_scm-0.10.14.1584463383.06b0455/tests/scm.py     
2020-03-17 17:43:03.000000000 +0100
@@ -65,3 +65,23 @@
 
         with self.assertRaises(SystemExit) as ctx:
             scm_base.prep_tree_for_archive("test3", basedir, "test2")
+
+    def test_version_iso_cleanup(self):
+        # Avoid get_repocache_hash failure in Scm.__init__
+        self.cli.url = ""
+        scm_base = Scm(self.cli, None)
+        self.assertEqual(scm_base.version_iso_cleanup("2.0.1-3", True), 
"2.0.1-3")
+        self.assertEqual(scm_base.version_iso_cleanup("2.0.1-3", False), 
"2.0.13")
+        self.assertEqual(scm_base.version_iso_cleanup("2.0.1-3"), "2.0.13")
+        self.assertEqual(scm_base.version_iso_cleanup("1", True), "1")
+        self.assertEqual(scm_base.version_iso_cleanup("1", False), "1")
+        self.assertEqual(scm_base.version_iso_cleanup("1"), "1")
+        self.assertEqual(scm_base.version_iso_cleanup("1.54-1.2", True), 
"1.54-1.2")
+        self.assertEqual(scm_base.version_iso_cleanup("1.54-1.2", False), 
"1.541.2")
+        self.assertEqual(scm_base.version_iso_cleanup("1.54-1.2"), "1.541.2")
+        self.assertEqual(scm_base.version_iso_cleanup("2017-01-02 02:23:11 
+0100", True),
+                         "20170102T022311")
+        self.assertEqual(scm_base.version_iso_cleanup("2017-01-02 02:23:11 
+0100", False),
+                         "20170102T022311")
+        self.assertEqual(scm_base.version_iso_cleanup("2017-01-02 02:23:11 
+0100"),
+                         "20170102T022311")


Reply via email to