commit obs-service-tar_scm for openSUSE:Factory
Hello community, here is the log from the commit of package obs-service-tar_scm for openSUSE:Factory checked in at 2017-04-11 09:34:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/obs-service-tar_scm (Old) and /work/SRC/openSUSE:Factory/.obs-service-tar_scm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "obs-service-tar_scm" Tue Apr 11 09:34:16 2017 rev:39 rq:483229 version:0.7.0.1490358243.8de854e Changes: -------- --- /work/SRC/openSUSE:Factory/obs-service-tar_scm/obs-service-tar_scm.changes 2017-02-28 23:51:29.077523579 +0100 +++ /work/SRC/openSUSE:Factory/.obs-service-tar_scm.new/obs-service-tar_scm.changes 2017-04-11 09:34:21.376678036 +0200 @@ -1,0 +2,16 @@ +Fri Mar 24 12:55:48 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version 0.7.0.1490358243.8de854e: + * keep .gitlab/.github directories + +------------------------------------------------------------------- +Thu Mar 23 10:09:38 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version 0.7.0.1490263157.682db30: + * Provide version rewrite using a regex pattern and replacement. + * initial appimage support + * make pep8 happy again + * test cases for version rewrite + * new parameter --match-tag to filter tags + +------------------------------------------------------------------- Old: ---- obs-service-tar_scm-0.7.0.1484082405.7671be8.tar.gz New: ---- obs-service-tar_scm-0.7.0.1490358243.8de854e.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ obs-service-tar_scm.spec ++++++ --- /var/tmp/diff_new_pack.VUMlFB/_old 2017-04-11 09:34:23.436387076 +0200 +++ /var/tmp/diff_new_pack.VUMlFB/_new 2017-04-11 09:34:23.436387076 +0200 @@ -20,18 +20,18 @@ %define seperate_build 0 %if "%seperate_build" == "1" -%define version_unconverted 0.7.0.1484082405.7671be8 +%define version_unconverted 0.7.0.1490358243.8de854e Name: obs-service-obs_scm %else -%define version_unconverted 0.7.0.1484082405.7671be8 +%define version_unconverted 0.7.0.1490358243.8de854e Name: obs-service-%{service} #Obsoletes: obs-service-obs_scm Provides: obs-service-obs_scm = %version-%release %endif Provides: obs-service-tar = %version-%release -Version: 0.7.0.1484082405.7671be8 +Version: 0.7.0.1490358243.8de854e Release: 0 Summary: An OBS source service: checkout or update a tar ball from svn/git/hg License: GPL-2.0+ @@ -45,7 +45,11 @@ BuildRequires: git-core BuildRequires: mercurial BuildRequires: python >= 2.6 +%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} +BuildRequires: PyYAML +%else BuildRequires: python-PyYAML +%endif BuildRequires: python-dateutil BuildRequires: python-lxml BuildRequires: python-mock @@ -53,7 +57,11 @@ Requires: bzr Requires: git-core Requires: mercurial +%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version} +Requires: PyYAML +%else Requires: python-PyYAML +%endif Requires: python-dateutil Requires: subversion %if 0%{?suse_version} < 1315 ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.VUMlFB/_old 2017-04-11 09:34:23.476381426 +0200 +++ /var/tmp/diff_new_pack.VUMlFB/_new 2017-04-11 09:34:23.480380861 +0200 @@ -3,4 +3,4 @@ <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="url">git://github.com/M0ses/obs-service-tar_scm.git</param> - <param name="changesrevision">7671be8f317658daec2bb24970bcba791396d9bd</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">b742dfc0e12755cf306a95439494b5bdde7c0c61</param></service></servicedata> \ No newline at end of file ++++++ obs-service-tar_scm-0.7.0.1484082405.7671be8.tar.gz -> obs-service-tar_scm-0.7.0.1490358243.8de854e.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/GNUmakefile new/obs-service-tar_scm-0.7.0.1490358243.8de854e/GNUmakefile --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/GNUmakefile 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/GNUmakefile 2017-03-24 13:24:03.000000000 +0100 @@ -36,7 +36,7 @@ echo "pep8 not installed! Cannot check PEP8 compliance; aborting." >&2; \ exit 1; \ fi - find -name \*.py | xargs pep8 --ignore=E221,E251,E272,E241,E731 $< + find -name \*.py | xargs pep8 --ignore=E221,E251,E272,E241,E731,E402 .PHONY: test test: @@ -68,10 +68,13 @@ ln -s tar_scm $(DESTDIR)$(mylibdir)/obs_scm [ ! -L $(DESTDIR)$(mylibdir)/tar ] || rm $(DESTDIR)$(mylibdir)/tar ln -s tar_scm $(DESTDIR)$(mylibdir)/tar + [ ! -L $(DESTDIR)$(mylibdir)/appimage ] || rm $(DESTDIR)$(mylibdir)/appimage + ln -s tar_scm $(DESTDIR)$(mylibdir)/appimage [ ! -L $(DESTDIR)$(mylibdir)/snapcraft ] || rm $(DESTDIR)$(mylibdir)/snapcraft ln -s tar_scm $(DESTDIR)$(mylibdir)/snapcraft - install -m 0644 tar.service $(DESTDIR)$(mylibdir)/tar.service - install -m 0644 snapcraft.service $(DESTDIR)$(mylibdir)/snapcraft.service + 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 find ./TarSCM/ -name '*.py*' -exec install -m 644 {} $(DESTDIR)$(mylibdir)/{} \; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/__init__.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/__init__.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/__init__.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/__init__.py 2017-03-24 13:24:03.000000000 +0100 @@ -19,6 +19,9 @@ if os.path.basename(sys.argv[0]) == "obs_scm": _cli.use_obs_scm = True + if os.path.basename(sys.argv[0]) == "appimage": + _cli.appimage = True + if os.path.basename(sys.argv[0]) == "snapcraft": _cli.snapcraft = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/archive.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/archive.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/archive.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/archive.py 2017-03-24 13:24:03.000000000 +0100 @@ -13,7 +13,7 @@ except: from StringIO import StringIO -METADATA_PATTERN = re.compile(r'.*/\.(bzr|git|hg|svn).*') +METADATA_PATTERN = re.compile(r'.*/\.(bzr|git(ignore)?|hg|svn)(\/.*|$)') class BaseArchive(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/changes.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/changes.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/changes.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/changes.py 2017-03-24 13:24:03.000000000 +0100 @@ -14,29 +14,29 @@ class changes(): def import_xml_parser(self): """Import the best XML parser available. Currently prefers lxml and - falls back to xml.etree. +falls back to xml.etree. - There are some important differences in behaviour, which also - depend on the Python version being used: +There are some important differences in behaviour, which also +depend on the Python version being used: - | Python | 2.6 | 2.6 | 2.7 | 2.7 | - |-----------+----------------+-------------+----------------+-------------| - | module | lxml.etree | xml.etree | lxml.etree | xml.etree | - |-----------+----------------+-------------+----------------+-------------| - | empty | XMLSyntaxError | ExpatError | XMLSyntaxError | ParseError | - | doc | "Document is | "no element | "Document is | "no element | - | | empty" | found" | empty | found" | - |-----------+----------------+-------------+----------------+-------------| - | syntax | XMLSyntaxError | ExpatError | XMLSyntaxError | ParseError | - | error | "invalid | "not well- | "invalid | "not well- | - | | element name" | formed" | element name" | formed" | - |-----------+----------------+-------------+----------------+-------------| - | e.message | deprecated | deprecated | yes | yes | - |-----------+----------------+-------------+----------------+-------------| - | str() | yes | yes | yes | yes | - |-----------+----------------+-------------+----------------+-------------| - | @attr | yes | no | yes | yes | - | selection | | | | | +| Python | 2.6 | 2.6 | 2.7 | 2.7 | +|-----------+----------------+-------------+----------------+-------------| +| module | lxml.etree | xml.etree | lxml.etree | xml.etree | +|-----------+----------------+-------------+----------------+-------------| +| empty | XMLSyntaxError | ExpatError | XMLSyntaxError | ParseError | +| doc | "Document is | "no element | "Document is | "no element | +| | empty" | found" | empty | found" | +|-----------+----------------+-------------+----------------+-------------| +| syntax | XMLSyntaxError | ExpatError | XMLSyntaxError | ParseError | +| error | "invalid | "not well- | "invalid | "not well- | +| | element name" | formed" | element name" | formed" | +|-----------+----------------+-------------+----------------+-------------| +| e.message | deprecated | deprecated | yes | yes | +|-----------+----------------+-------------+----------------+-------------| +| str() | yes | yes | yes | yes | +|-----------+----------------+-------------+----------------+-------------| +| @attr | yes | no | yes | yes | +| selection | | | | | """ global ET @@ -210,7 +210,7 @@ # find changesauthor in $HOME/.oscrc try: - files = [[os.path.join(os.environ['HOME'], '.oscrc'),False]] + files = [[os.path.join(os.environ['HOME'], '.oscrc'), False]] cfg = config(files) changesauthor = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/cli.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/cli.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/cli.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/cli.py 2017-03-24 13:24:03.000000000 +0100 @@ -9,6 +9,7 @@ def __init__(self): self.use_obs_scm = False self.snapcraft = False + self.appimage = False def parse_args(self, options): parser = argparse.ArgumentParser(description='Git Tarballs') @@ -31,10 +32,23 @@ 'source using this format string. ' 'This parameter is used if the \'version\' ' 'parameter is not specified.') + parser.add_argument('--versionrewrite-pattern', + help='Regex used to rewrite the version which is ' + 'applied post versionformat. For example, to ' + 'remove a tag prefix of "v" the regex "v(.*)"' + ' could be used. See the ' + 'versionrewrite-replacement parameter.') + parser.add_argument('--versionrewrite-replacement', + default=r'\1', + help='Replacement applied to rewrite pattern. ' + 'Typically backreferences are useful and as ' + 'such defaults to \\1.') parser.add_argument('--versionprefix', help='Specify a base version as prefix.') parser.add_argument('--parent-tag', help='Override base commit for @TAG_OFFSET@') + parser.add_argument('--match-tag', + help='tag must match glob(7)') parser.add_argument('--revision', help='Specify revision to package') parser.add_argument('--extract', action='append', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/config.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/config.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/config.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/config.py 2017-03-24 13:24:03.000000000 +0100 @@ -18,10 +18,12 @@ class config(): def __init__( self, - files=[['/etc/obs/services/tar_scm',True]] + files=[['/etc/obs/services/tar_scm', True]] ): try: - rc_file = [os.path.join(os.environ['HOME'], '.obs', 'tar_scm'),True] + rc_file = [ + os.path.join(os.environ['HOME'], '.obs', 'tar_scm'), True + ] files.append(rc_file) except KeyError: pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/scm/base.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/scm/base.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/scm/base.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/scm/base.py 2017-03-24 13:24:03.000000000 +0100 @@ -143,8 +143,8 @@ def prepare_clone_dir(self): # special case when using osc and creating an obscpio, use current work - # directory to allow the developer to work inside of the git repo and fetch - # local changes + # directory to allow the developer to work inside of the git repo and + # fetch local changes if sys.argv[0].endswith("snapcraft") or \ (self.args.use_obs_scm and os.getenv('OSC_VERSION')): self.repodir = os.getcwd() @@ -171,20 +171,18 @@ self.basename = os.path.basename(os.path.normpath(url_path)) self.basename = prefix + self.basename - osc_version = 0 try: osc_version = os.environ['OSC_VERSION'] except: - pass - + pass if osc_version == 0: tempdir = tempfile.mkdtemp(dir=self.args.outdir) self.task.cleanup_dirs.append(tempdir) else: - tempdir = os.getcwd() + tempdir = os.getcwd() self.repodir = os.path.join(tempdir, self.basename) @@ -203,7 +201,10 @@ def is_sslverify_enabled(self): """Returns ``True`` if the ``sslverify`` option has been enabled or not been set (default enabled) ``False`` otherwise.""" - return 'sslverify' not in self.args.__dict__ or self.args.__dict__['sslverify'] + return ( + 'sslverify' not in self.args.__dict__ or + self.args.__dict__['sslverify'] + ) def version_iso_cleanup(self, version): """Reformat timestamp value.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/scm/git.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/scm/git.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/scm/git.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/scm/git.py 2017-03-24 13:24:03.000000000 +0100 @@ -126,10 +126,14 @@ versionformat = '%ct.%h' if not parent_tag: - rc, output = self.helpers.run_cmd( - ['git', 'describe', '--tags', '--abbrev=0'], - self.clone_dir - ) + cmd = ['git', 'describe', '--tags', '--abbrev=0'] + try: + if args['match_tag']: + cmd.append("--match=%s" % args['match_tag']) + except KeyError: + pass + rc, output = self.helpers.run_cmd(cmd, self.clone_dir) + if rc == 0: # strip to remove newlines parent_tag = output.strip() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/tasks.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/tasks.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/TarSCM/tasks.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/TarSCM/tasks.py 2017-03-24 13:24:03.000000000 +0100 @@ -42,10 +42,26 @@ self.scm_object.unlock_cache() def generate_list(self, args): + scms = ['git', 'tar', 'svn', 'bzr', 'hg'] - if args.snapcraft: - # we read the SCM config from snapcraft.yaml instead from _service - # file + if args.appimage: + # we read the SCM config from appimage.yml + f = open('appimage.yml') + self.dataMap = yaml.safe_load(f) + f.close() + args.use_obs_scm = True + # run for each scm an own task + for scm in scms: + if scm not in self.dataMap['build'].keys(): + continue + for url in self.dataMap['build'][scm]: + args.url = url + args.scm = scm + self.task_list.append(copy.copy(args)) + + elif args.snapcraft: + # we read the SCM config from snapcraft.yaml instead getting it via + # parameters f = open('snapcraft.yaml') self.dataMap = yaml.safe_load(f) f.close() @@ -56,8 +72,7 @@ if 'source-type' not in self.dataMap['parts'][part].keys(): continue pep8_1 = self.dataMap['parts'][part]['source-type'] - pep8_2 = ['git', 'tar', 'svn', 'bzr', 'hg'] - if pep8_1 not in pep8_2: + if pep8_1 not in scms: continue # avoid conflicts with files args.clone_prefix = "_obs_" @@ -115,7 +130,8 @@ version = self.get_version(scm_object, args) changesversion = version if version and not sys.argv[0].endswith("/tar") \ - and not sys.argv[0].endswith("/snapcraft"): + and not sys.argv[0].endswith("/snapcraft") \ + and not sys.argv[0].endswith("/appimage"): dstname += '-' + version logging.debug("DST: %s", dstname) @@ -163,6 +179,9 @@ version = args.version if version == '_auto_' or args.versionformat: version = self.detect_version(scm_object, args) + if args.versionrewrite_pattern: + regex = re.compile(args.versionrewrite_pattern) + version = regex.sub(args.versionrewrite_replacement, version) if args.versionprefix: version = "%s.%s" % (args.versionprefix, version) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/appimage new/obs-service-tar_scm-0.7.0.1490358243.8de854e/appimage --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/appimage 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/appimage 2017-04-11 09:34:23.620361087 +0200 @@ -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.7.0.1484082405.7671be8/appimage.service new/obs-service-tar_scm-0.7.0.1490358243.8de854e/appimage.service --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/appimage.service 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/appimage.service 2017-03-24 13:24:03.000000000 +0100 @@ -0,0 +1,4 @@ +<service name="appimage"> +<summary>handle sources specified in appimage.yml</summary> + <description>This service needs to be executed to download sources according to appimage.yml file</description> +</service> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tar_scm.service.in new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tar_scm.service.in --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tar_scm.service.in 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tar_scm.service.in 2017-03-24 13:24:03.000000000 +0100 @@ -61,9 +61,28 @@ For bzr and svn, '%r' is expanded to the revision, and is the default. </description> </parameter> + <parameter name="versionrewrite-pattern"> + <description> + Regex used to rewrite the version which is applied post versionformat. For + example, to remove a tag prefix of "v" the regex "v(.*)" could be used. + See the versionrewrite-replacement parameter. + </description> + </parameter> + <parameter name="versionrewrite-replacement"> + <description> + Replacement applied to rewrite pattern. Typically backreferences are + useful and as such defaults to \1. + </description> + </parameter> <parameter name="versionprefix"> <description>Specify a base version as prefix.</description> </parameter> + <parameter name="match-tag"> + <description> + With this parameter you can specifiy a glob pattern to filter relevant + tags in your project e.g. if you use @PARENT_TAG@ + </description> + </parameter> <parameter name="parent-tag"> <description> This parameter allows overriding the tag that is being used for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/fixtures/TasksTestCases/test_generate_task_list_multi_tasks/snapcraft.yaml 2017-03-24 13:24:03.000000000 +0100 @@ -2,8 +2,8 @@ version: 1.0 summary: Libpipeline example description: | - This is an example package of an autotools project built with snapcraft - using a remote source. + This is an example package of an autotools project built + with snapcraft using a remote source. apps: pipelinetest: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/fixtures/TasksTestCases/test_generate_task_list_single_task_appimage/appimage.yml 2017-03-24 13:24:03.000000000 +0100 @@ -0,0 +1,9 @@ +app: QtQuickApp + +build: + packages: + - linuxdeployqt + - pkgconfig(Qt5Quick) + git: + - https://github.com/probonopd/QtQuickApp.git + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/gittests.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/gittests.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/gittests.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/gittests.py 2017-03-24 13:24:03.000000000 +0100 @@ -226,3 +226,58 @@ fix.safe_run('checkout tag2') fix.create_commits(3) fix.safe_run('tag -a -m some_message detached_tag') + + def test_versionrewrite(self): + fix = self.fixtures + fix.create_commits(2) + self.tar_scm_std("--revision", 'tag2', + "--versionrewrite-pattern", 'tag(\d+)', + "--versionrewrite-replacement", '\\1-test', + "--versionformat", "@PARENT_TAG@") + self.assertTarOnly(self.basename(version="2-test")) + + def test_match_tag(self): + fix = self.fixtures + fix.create_commits(2) + fix.safe_run('tag latest') + repo_path = fix.repo_path + os.chdir(repo_path) + self.tar_scm_std("--match-tag", 'tag*', + "--versionformat", "@PARENT_TAG@") + self.assertTarOnly(self.basename(version="tag4")) + self.tar_scm_std("--versionformat", "@PARENT_TAG@") + self.assertTarOnly(self.basename(version="latest")) + + def test_gitlab_github_files(self): + fix = self.fixtures + fix.create_commits(2) + fix.safe_run('tag latest') + repo_path = fix.repo_path + os.chdir(repo_path) + os.makedirs("./.gitlab") + os.makedirs("./.github") + fh = open('./.gitlab/test', 'a') + fh.close() + fh = open('./.github/test', 'a') + fh.close() + fix.safe_run('add .') + fix.safe_run('commit -a -m "github/gitlab"') + fix.safe_run('tag gitlab_hub') + self.tar_scm_std("--revision", "gitlab_hub", "--match-tag", + 'gitlab_hub', "--versionformat", "@PARENT_TAG@") + tar_path = os.path.join(self.outdir, + self.basename(version='gitlab_hub') + '.tar') + th = tarfile.open(tar_path) + submod_path = os.path.join(self.basename(version='gitlab_hub')) + print("...... th: %s" % th) + print("...... submod_path: %s" % submod_path) + self.assertTarMemberContains(th, os.path.join( + submod_path, + '.github/test'), + '' + ) + self.assertTarMemberContains(th, os.path.join( + submod_path, + '.gitlab/test'), + '' + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/tasks.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/tasks.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/tasks.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/tasks.py 2017-03-24 13:24:03.000000000 +0100 @@ -64,6 +64,23 @@ self.assertEqual(tasks.task_list[0].__dict__[k], expected[k]) self.assertEqual(len(tasks.task_list), 1) + def test_generate_task_list_single_task_appimage(self): + self.cli.snapcraft = False + self.cli.appimage = True + expected = { + 'scm': 'git', 'appimage': True, + 'revision': None, + 'url': 'https://github.com/probonopd/QtQuickApp.git', + 'use_obs_scm': True, + 'jailed': 0, 'outdir': self.cli.outdir, 'changesgenerate': False} + self._cd_fixtures_dir() + tasks = TarSCM.tasks() + tasks.generate_list(self.cli) + self._restore_cwd() + for k in expected.keys(): + self.assertEqual(tasks.task_list[0].__dict__[k], expected[k]) + self.assertEqual(len(tasks.task_list), 1) + def test_generate_task_list_multi_tasks(self): expected = { 'libpipeline': { @@ -105,9 +122,9 @@ expected = '''apps: pipelinetest: command: ./bin/test -description: 'This is an example package of an autotools project built with snapcraft +description: 'This is an example package of an autotools project built - using a remote source. + with snapcraft using a remote source. ' name: pipelinetest @@ -165,6 +182,17 @@ v = tasks.get_version(scm, self.cli) self.assertEqual(v, 'r.0.0.1') + def test_get_version_with_versionrewrite(self): + class FakeSCM(): + def detect_version(self, args): + return 'v0.0.1' + self.cli.versionrewrite_pattern = 'v(\d[\d\.]*)' + self.cli.versionrewrite_replacement = '\\1-stable' + scm = FakeSCM() + tasks = TarSCM.tasks() + v = tasks.get_version(scm, self.cli) + self.assertEqual(v, '0.0.1-stable') + def test_process_list(self): tasks = TarSCM.tasks() self.cli.snapcraft = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/unittestcases.py new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/unittestcases.py --- old/obs-service-tar_scm-0.7.0.1484082405.7671be8/tests/unittestcases.py 2017-01-10 22:06:45.000000000 +0100 +++ new/obs-service-tar_scm-0.7.0.1490358243.8de854e/tests/unittestcases.py 2017-03-24 13:24:03.000000000 +0100 @@ -85,15 +85,17 @@ def test_TarSCM_config_files_ordering(self): tc_name = inspect.stack()[0][3] files = [ - [os.path.join(self.fixtures_dir, tc_name, 'a.cfg'),True], - [os.path.join(self.fixtures_dir, tc_name, 'b.cfg'),True], + [os.path.join(self.fixtures_dir, tc_name, 'a.cfg'), True], + [os.path.join(self.fixtures_dir, tc_name, 'b.cfg'), True], ] var = config(files).get(None, 'var') self.assertEqual(var, 'b') def test_TarSCM_config_no_faked_header(self): tc_name = inspect.stack()[0][3] - files = [[os.path.join(self.fixtures_dir, tc_name, 'test.ini'),False]] + files = [ + [os.path.join(self.fixtures_dir, tc_name, 'test.ini'), False] + ] var = config(files).get('general', 'apiurl') self.assertEqual(var, 'http://api.example.com') var = config(files).get(var, 'email') @@ -109,7 +111,7 @@ os.environ['DEBUG_TAR_SCM'] = "1" - files = [[os.path.join(self.fixtures_dir, tc_name, 'test.rc'),True]] + files = [[os.path.join(self.fixtures_dir, tc_name, 'test.rc'), True]] var = config(files).get(None, 'var') self.assertEqual(var, None)
participants (1)
-
root@hilbert.suse.de