Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package obs-scm-bridge for openSUSE:Factory 
checked in at 2022-11-16 15:43:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-scm-bridge (Old)
 and      /work/SRC/openSUSE:Factory/.obs-scm-bridge.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-scm-bridge"

Wed Nov 16 15:43:00 2022 rev:3 rq:1035839 version:0.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/obs-scm-bridge/obs-scm-bridge.changes    
2022-06-08 14:25:33.916550276 +0200
+++ /work/SRC/openSUSE:Factory/.obs-scm-bridge.new.1597/obs-scm-bridge.changes  
2022-11-16 15:43:11.567794636 +0100
@@ -1,0 +2,6 @@
+Tue Nov  8 12:44:07 UTC 2022 - Adrian Schröter <adr...@suse.de>
+
+- update to 0.2.1
+  * fixed loss of branch informations in packages in project mode
+
+-------------------------------------------------------------------

Old:
----
  obs-scm-bridge-0.2.obscpio

New:
----
  obs-scm-bridge-0.2.1.obscpio

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

Other differences:
------------------
++++++ obs-scm-bridge.spec ++++++
--- /var/tmp/diff_new_pack.WxBHSD/_old  2022-11-16 15:43:12.091796536 +0100
+++ /var/tmp/diff_new_pack.WxBHSD/_new  2022-11-16 15:43:12.099796565 +0100
@@ -23,7 +23,7 @@
 %endif
 
 Name:           obs-scm-bridge
-Version:        0.2
+Version:        0.2.1
 Release:        0
 Summary:        A help service to work with git repositories in OBS
 License:        GPL-2.0-or-later

++++++ _service ++++++
--- /var/tmp/diff_new_pack.WxBHSD/_old  2022-11-16 15:43:12.123796652 +0100
+++ /var/tmp/diff_new_pack.WxBHSD/_new  2022-11-16 15:43:12.127796666 +0100
@@ -2,8 +2,8 @@
   <service name="obs_scm" mode="manual">
     <param name="url">https://github.com/openSUSE/obs-scm-bridge</param>
     <param name="scm">git</param>
-    <param name="revision">0.2</param>
-    <param name="version">0.2</param>
+    <param name="revision">0.2.1</param>
+    <param name="version">0.2.1</param>
   </service>
   <service mode="manual" name="set_version" />
 

++++++ obs-scm-bridge-0.2.obscpio -> obs-scm-bridge-0.2.1.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-scm-bridge-0.2/README.md 
new/obs-scm-bridge-0.2.1/README.md
--- old/obs-scm-bridge-0.2/README.md    2022-06-08 11:50:29.000000000 +0200
+++ new/obs-scm-bridge-0.2.1/README.md  2022-11-08 13:41:25.000000000 +0100
@@ -48,13 +48,22 @@
 It is recomended to use git submodules for each package if it is a larger
 project. This allows partial cloning of the specific package.
 
-TODO
-====
+Special directives
+==================
+
+Special directives can be given via cgi parameters to the bridge. Extend
+your url with
+
+ * lfs=1 CGI parameter to include LFS resources
 
- * Monitoring changes in referenced repository. (can currently be workarounded
-   via "osc service rr")
+ * arch=<ARCH> CGI parameter to specify arch specific assets downloads
 
- * osc upstream integration
+ * keepmeta=1 CGI parameter to include full git vcs data (.git directory)
+
+ * subdir=<DIRECTORY> CGI parameter to package only a subdirectory
+
+TODO
+====
 
  * signature validation
 
@@ -62,5 +71,5 @@
    they do not belong to the git repository
     auto extending .gitignore? (esp. when downloading asset files?)
 
- * make cpio generation bit identical (avoid mtime from clone)
+ * make cpio generation bit identical (avoiding mtime from clone)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-scm-bridge-0.2/obs_scm_bridge 
new/obs-scm-bridge-0.2.1/obs_scm_bridge
--- old/obs-scm-bridge-0.2/obs_scm_bridge       2022-06-08 11:50:29.000000000 
+0200
+++ new/obs-scm-bridge-0.2.1/obs_scm_bridge     2022-11-08 13:41:25.000000000 
+0100
@@ -46,6 +46,8 @@
         self.revision = None
         self.subdir   = None
         self.lfs = False
+        self.keep_meta = False
+        self.enforced_deep_clone = False
         self.arch = []
         self.url = list(urllib.parse.urlparse(url))
         query = urllib.parse.parse_qs(self.url[4]);
@@ -61,6 +63,11 @@
             self.lfs = True
             del query['lfs']
             self.url[4] = urllib.parse.urlencode(query)
+        if "keepmeta" in query:
+            self.enforced_deep_clone = True
+            self.keep_meta = True
+            del query['keepmeta']
+            self.url[4] = urllib.parse.urlencode(query)
         if self.url[5]:
             self.revision = self.url[5]
             self.url[5] = ''
@@ -101,14 +108,14 @@
         cmd = [ 'git', '-C', outdir, 'checkout', '-q', self.revision ]
         self.run_cmd(cmd, fatal="git checkout")
 
-    def do_clone(self, outdir):
+    def do_clone(self, outdir, shallow):
         if self.revision and re.match(r"^[0-9a-fA-F]{40,}$", self.revision):
             self.do_clone_commit(outdir)
             if self.lfs:
                 self.do_lfs(outdir)
             return
         cmd = [ 'git', 'clone', urllib.parse.urlunparse(self.url), outdir ]
-        if shallow_clone:
+        if shallow:
             cmd += [ '--depth', '1' ]
         if self.revision:
             cmd.insert(2, '-b')
@@ -117,12 +124,12 @@
         if self.lfs:
             self.do_lfs(outdir)
 
-    def clone(self):
+    def clone(self, shallow_clone):
         if not self.subdir:
-            self.do_clone(self.outdir)
+            self.do_clone(self.outdir, (shallow_clone and not 
self.enforced_deep_clone))
             return
         clonedir = tempfile.mkdtemp(prefix="obs-scm-bridge")
-        self.do_clone(clonedir)
+        self.do_clone(clonedir, (shallow_clone and not 
self.enforced_deep_clone))
         fromdir = os.path.join(clonedir, self.subdir)
         if not 
os.path.realpath(fromdir+'/').startswith(os.path.realpath(clonedir+'/')):
             print("ERROR: subdir is not below clone directory")
@@ -163,9 +170,9 @@
         listing = sorted(os.listdir("."))
         specials = []
         for name in listing:
-            if name == '.git':
-                # we do not store git meta data service side atm to avoid 
bloat storage
-                # however, this will break some builds, so we will need an 
opt-out in future
+            if name == '.git' and not self.keep_meta:
+                print("remove META")
+                # we do not store git meta data by default to avoid bloat 
storage
                 shutil.rmtree(name)
                 continue
             if name[0:1] == '.':
@@ -307,14 +314,13 @@
         listing = sorted(os.listdir("."))
         regexp =  re.compile(r"^[a-zA-Z0-9\.\-\_\+]*$");
         for name in listing:
-            if name == '.git':
+            if name == '.git' and not self.keep_meta:
                 shutil.rmtree(name)
                 continue
             if os.path.isdir(name):
                 if name in gitsubmodules:
                     # already handled as git submodule
                     continue
-
                 info = self.get_subdir_info(name)
                 shutil.rmtree(name)
                 if not regexp.match(name):
@@ -329,6 +335,8 @@
                 query = urllib.parse.parse_qs(url[4])
                 query['subdir'] = name
                 url[4] = urllib.parse.urlencode(query)
+                if self.revision:
+                    self.url[5] = self.revision
 
                 self.write_package_xml_file(name, urllib.parse.urlunparse(url))
             else:
@@ -368,7 +376,7 @@
 
     # workflow
     obsgit = ObsGit(outdir, url)
-    obsgit.clone()
+    obsgit.clone(shallow_clone)
     if project_mode == 'true' or project_mode == '1':
         obsgit.generate_package_xml_files()
         sys.exit(0)

++++++ obs-scm-bridge.obsinfo ++++++
--- /var/tmp/diff_new_pack.WxBHSD/_old  2022-11-16 15:43:12.243797087 +0100
+++ /var/tmp/diff_new_pack.WxBHSD/_new  2022-11-16 15:43:12.247797102 +0100
@@ -1,5 +1,5 @@
 name: obs-scm-bridge
-version: 0.2
-mtime: 1654681829
-commit: 67f17ebde3d22312d81a79c440337a75b704d360
+version: 0.2.1
+mtime: 1667911285
+commit: 4ac1b2d9ce256a79aa5475521c5e6b48d15d931d
 

Reply via email to