Hello community,

here is the log from the commit of package obs-service-tar_scm for 
openSUSE:Factory checked in at 2016-08-05 18:17:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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"

Changes:
--------
--- /work/SRC/openSUSE:Factory/obs-service-tar_scm/obs-service-tar_scm.changes  
2016-07-12 23:52:06.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.obs-service-tar_scm.new/obs-service-tar_scm.changes 
    2016-08-05 18:17:35.000000000 +0200
@@ -1,0 +2,16 @@
+Wed Jul 27 15:33:18 UTC 2016 - adr...@suse.de
+
+- fix mtime handling
+
+-------------------------------------------------------------------
+Wed Jul 27 15:31:10 UTC 2016 - adr...@suse.de
+
+- Update to version 0.6.0.1469628830.67456b7:
+  * pep8 fixes/workarounds
+  * make yaml dependency optional for travis
+  * Add an option 'master' to submodules to fetch the latest mater branch.
+  * do not set files back to 1970...
+  * transfer mtime via obsinfo
+  * create needed sub directories for cache handling
+
+-------------------------------------------------------------------

Old:
----
  obs-service-tar_scm-0.6.0.1467889501.49c9462.tar.gz

New:
----
  obs-service-tar_scm-0.6.0.1469628830.67456b7.tar.gz

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

Other differences:
------------------
++++++ obs-service-tar_scm.spec ++++++
--- /var/tmp/diff_new_pack.jSIHDT/_old  2016-08-05 18:17:36.000000000 +0200
+++ /var/tmp/diff_new_pack.jSIHDT/_new  2016-08-05 18:17:36.000000000 +0200
@@ -20,18 +20,18 @@
 %define seperate_build 0
 
 %if "%seperate_build" == "1"
-%define version_unconverted 0.6.0~pre.1467360725.f4aaf50
+%define version_unconverted 0.6.0.1469628830.67456b7
 
 Name:           obs-service-obs_scm
 %else
-%define version_unconverted 0.6.0~pre.1467360725.f4aaf50
+%define version_unconverted 0.6.0.1469628830.67456b7
 
 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.6.0.1467889501.49c9462
+Version:        0.6.0.1469628830.67456b7
 Release:        0
 Summary:        An OBS source service: checkout or update a tar ball from 
svn/git/hg
 License:        GPL-2.0+
@@ -40,7 +40,7 @@
 Source:         obs-service-tar_scm-%{version}.tar.gz
 # Fix build on Ubuntu by disabling mercurial tests, not applied in rpm
 # based distributions
-Patch0:         0001-Debianization-disable-running-mercurial-tests.patch
+#Patch0:         0001-Debianization-disable-running-mercurial-tests.patch
 BuildRequires:  bzr
 BuildRequires:  git-core
 BuildRequires:  mercurial

++++++ _service ++++++
--- /var/tmp/diff_new_pack.jSIHDT/_old  2016-08-05 18:17:36.000000000 +0200
+++ /var/tmp/diff_new_pack.jSIHDT/_new  2016-08-05 18:17:36.000000000 +0200
@@ -1,6 +1,6 @@
 <services>
   <service name="tar_scm" mode="disabled">
-    <param name="url">git://github.com/openSUSE/obs-service-tar_scm.git</param>
+    <param 
name="url">git://github.com/adrianschroeter/obs-service-tar_scm.git</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
     <param name="version">git-master</param>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.jSIHDT/_old  2016-08-05 18:17:36.000000000 +0200
+++ /var/tmp/diff_new_pack.jSIHDT/_new  2016-08-05 18:17:36.000000000 +0200
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
             <param 
name="url">git://github.com/adrianschroeter/obs-service-tar_scm.git</param>
-          <param 
name="changesrevision">f4aaf50fd98105daf0405a0d0f7824fbb723e1ac</param></service><service
 name="tar_scm">
+          <param 
name="changesrevision">67456b7400afa5c2c03d7701682470296497751a</param></service><service
 name="tar_scm">
             <param 
name="url">git://github.com/openSUSE/obs-service-tar_scm.git</param>
           <param 
name="changesrevision">49c9462599650ab6a6d122b9156c732187cf99ea</param></service></servicedata>
\ No newline at end of file

++++++ obs-service-tar_scm-0.6.0.1467889501.49c9462.tar.gz -> 
obs-service-tar_scm-0.6.0.1469628830.67456b7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tar_scm.py 
new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tar_scm.py
--- old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tar_scm.py 2016-07-07 
13:32:21.000000000 +0200
+++ new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tar_scm.py 2016-07-27 
16:13:50.000000000 +0200
@@ -113,9 +113,12 @@
 
 def fetch_upstream_git_submodules(clone_dir, kwargs):
     """Recursively initialize git submodules."""
-    if 'submodules' in kwargs and kwargs['submodules']:
+    if 'submodules' in kwargs and kwargs['submodules'] == 'enable':
         safe_run(['git', 'submodule', 'update', '--init', '--recursive'],
                  cwd=clone_dir)
+    elif 'submodules' in kwargs and kwargs['submodules'] == 'master':
+        safe_run(['git', 'submodule', 'update', '--init', '--recursive',
+                 '--remote'], cwd=clone_dir)
 
 
 def fetch_upstream_svn(url, clone_dir, revision, cwd, kwargs):
@@ -406,6 +409,7 @@
     metafile = open(os.path.join(args.outdir, basename + '.obsinfo'), "w")
     metafile.write("name: " + basename + "\n")
     metafile.write("version: " + version + "\n")
+    metafile.write("mtime: " + str(get_timestamp(args, topdir)) + "\n")
     # metafile.write("git describe: " + + "\n")
     if commit:
         metafile.write("commit: " + commit + "\n")
@@ -453,7 +457,8 @@
         """Python 2.7 only: reset uid/gid to 0/0 (root)."""
         tarinfo.uid = tarinfo.gid = 0
         tarinfo.uname = tarinfo.gname = "root"
-        tarinfo.mtime = timestamp
+        if timestamp != 0:
+            tarinfo.mtime = timestamp
         return tarinfo
 
     def tar_filter(tarinfo):
@@ -651,11 +656,11 @@
     return version
 
 
-def get_timestamp_tar(repodir):
-    return int(0)
+def get_timestamp_tar(args, repodir):
+    return int(read_from_obsinfo(args.obsinfo, "mtime"))
 
 
-def get_timestamp_bzr(repodir):
+def get_timestamp_bzr(args, repodir):
     log = safe_run(['bzr', 'log', '--limit=1', '--log-format=long'],
                    repodir)[1]
     match = re.search(r'timestamp:(.*)', log, re.MULTILINE)
@@ -665,20 +670,20 @@
     return int(timestamp)
 
 
-def get_timestamp_git(repodir):
+def get_timestamp_git(args, repodir):
     d = {"parent_tag": None, "versionformat": "%ct"}
     timestamp = detect_version_git(d, repodir)
     return int(timestamp)
 
 
-def get_timestamp_hg(repodir):
+def get_timestamp_hg(args, repodir):
     d = {"parent_tag": None, "versionformat": "{date}"}
     timestamp = detect_version_hg(d, repodir)
     timestamp = re.sub(r'([0-9]+)\..*', r'\1', timestamp)
     return int(timestamp)
 
 
-def get_timestamp_svn(repodir):
+def get_timestamp_svn(args, repodir):
     svn_info = safe_run(['svn', 'info', '-rHEAD'], repodir)[1]
 
     match = re.search('Last Changed Date: (.*)', svn_info, re.MULTILINE)
@@ -701,7 +706,7 @@
         'tar': get_timestamp_tar
     }
 
-    timestamp = get_timestamp_commands[args.scm](clone_dir)
+    timestamp = get_timestamp_commands[args.scm](args, clone_dir)
     logging.debug("COMMIT TIMESTAMP: %s (%s)", timestamp,
                   datetime.datetime.fromtimestamp(timestamp).strftime(
                       '%Y-%m-%d %H:%M:%S'))
@@ -1116,11 +1121,13 @@
                              DEFAULT_AUTHOR)
     parser.add_argument('--subdir', default='',
                         help='Package just a subdirectory of the sources')
-    parser.add_argument('--submodules', choices=['enable', 'disable'],
+    parser.add_argument('--submodules',
+                        choices=['enable', 'master', 'disable'],
                         default='enable',
                         help='Whether or not to include git submodules '
                              'from SCM commit log since a given parent '
-                             'revision (see changesrevision).')
+                             'revision (see changesrevision). Use '
+                             '\'master\' to fetch the latest master.')
     parser.add_argument('--sslverify', choices=['enable', 'disable'],
                         default='enable',
                         help='Whether or not to check server certificate '
@@ -1172,10 +1179,6 @@
     else:
         args.package_meta = False
 
-    if args.submodules == 'enable':
-        args.submodules = True
-    else:
-        args.submodules = False
     args.sslverify = False if args.sslverify == 'disable' else True
 
     # force verbose mode in test-mode
@@ -1256,7 +1259,13 @@
 
     repodir = None
     # construct repodir (the parent directory of the checkout)
-    if repocachedir and os.path.isdir(os.path.join(repocachedir, 'repo')):
+    if repocachedir and os.path.isdir(repocachedir):
+        # construct subdirs on very first run
+        if not os.path.isdir(os.path.join(repocachedir, 'repo')):
+            os.mkdir(os.path.join(repocachedir, 'repo'))
+        if not os.path.isdir(os.path.join(repocachedir, 'incoming')):
+            os.mkdir(os.path.join(repocachedir, 'incoming'))
+
         repohash = get_repocache_hash(args.scm, args.url, args.subdir)
         logging.debug("HASH: %s", repohash)
         repodir = os.path.join(repocachedir, 'repo')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tar_scm.service.in 
new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tar_scm.service.in
--- old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tar_scm.service.in 
2016-07-07 13:32:21.000000000 +0200
+++ new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tar_scm.service.in 
2016-07-27 16:13:50.000000000 +0200
@@ -118,6 +118,7 @@
   <parameter name="submodules">
     <description>Specify whether to include git submodules.  Default is 
'enable'.</description>
     <allowedvalue>enable</allowedvalue>
+    <allowedvalue>master</allowedvalue>
     <allowedvalue>disable</allowedvalue>
   </parameter>
   <parameter name="sslverify">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tests/gittests.py 
new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tests/gittests.py
--- old/obs-service-tar_scm-0.6.0.1467889501.49c9462/tests/gittests.py  
2016-07-07 13:32:21.000000000 +0200
+++ new/obs-service-tar_scm-0.6.0.1469628830.67456b7/tests/gittests.py  
2016-07-27 16:13:50.000000000 +0200
@@ -177,6 +177,23 @@
                                    submod_name, 'a')
         self.assertTarMemberContains(th, submod_path, '3')
 
+    def test_latest_submodule_in_different_branch(self):
+        submod_name = 'submod1'
+
+        rev = 'build'
+        self._submodule_fixture_prepare_branch(rev)
+        self._submodule_fixture(submod_name)
+
+        self.tar_scm_std('--submodules', 'master',
+                         '--revision', rev,
+                         '--version', rev)
+        tar_path = os.path.join(self.outdir,
+                                self.basename(version=rev) + '.tar')
+        th = tarfile.open(tar_path)
+        submod_path = os.path.join(self.basename(version=rev),
+                                   submod_name, 'a')
+        self.assertTarMemberContains(th, submod_path, '5')
+
     def _check_servicedata(self, expected_dirents=2, revision=2):
         expected_sha1 = self.sha1s('tag%d' % revision)
         dirents = self.assertNumDirents(self.outdir, expected_dirents)


Reply via email to