Hello community,

here is the log from the commit of package obs-service-refresh_patches for 
openSUSE:Factory checked in at 2014-02-18 14:46:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-refresh_patches (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-refresh_patches.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-refresh_patches"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/obs-service-refresh_patches/obs-service-refresh_patches.changes
  2014-02-13 15:02:31.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.obs-service-refresh_patches.new/obs-service-refresh_patches.changes
     2014-02-18 14:46:09.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Feb 17 16:15:55 UTC 2014 - [email protected]
+
+- Update to version 0.3.8+git.1392653668.565b745:
+  + Remove patches only after processing all specs
+
+-------------------------------------------------------------------

Old:
----
  obs-service-refresh_patches-0.3.7+git.1392213832.12f52e6.tar.gz

New:
----
  obs-service-refresh_patches-0.3.8+git.1392653668.565b745.tar.gz

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

Other differences:
------------------
++++++ obs-service-refresh_patches.spec ++++++
--- /var/tmp/diff_new_pack.Ho56xh/_old  2014-02-18 14:46:09.000000000 +0100
+++ /var/tmp/diff_new_pack.Ho56xh/_new  2014-02-18 14:46:09.000000000 +0100
@@ -19,7 +19,7 @@
 %define service refresh_patches
 
 Name:           obs-service-%{service}
-Version:        0.3.7+git.1392213832.12f52e6
+Version:        0.3.8+git.1392653668.565b745
 Release:        0
 Summary:        An OBS source service: Refreshs local patches
 License:        Apache-2.0

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.Ho56xh/_old  2014-02-18 14:46:09.000000000 +0100
+++ /var/tmp/diff_new_pack.Ho56xh/_new  2014-02-18 14:46:09.000000000 +0100
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param 
name="url">https://github.com/openSUSE/obs-service-refresh_patches.git</param>
-    <param name="changesrevision">12f52e6867</param>
+    <param name="changesrevision">565b745c4c</param>
   </service>
 </servicedata>
\ No newline at end of file

++++++ obs-service-refresh_patches-0.3.7+git.1392213832.12f52e6.tar.gz -> 
obs-service-refresh_patches-0.3.8+git.1392653668.565b745.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/obs-service-refresh_patches-0.3.7+git.1392213832.12f52e6/refresh_patches 
new/obs-service-refresh_patches-0.3.8+git.1392653668.565b745/refresh_patches
--- 
old/obs-service-refresh_patches-0.3.7+git.1392213832.12f52e6/refresh_patches    
    2014-02-12 15:04:33.000000000 +0100
+++ 
new/obs-service-refresh_patches-0.3.8+git.1392653668.565b745/refresh_patches    
    2014-02-17 17:15:55.000000000 +0100
@@ -35,6 +35,7 @@
 QUILT_PUSH_REVERSE_RE = re.compile(r".*Patch (?:patches/)?(.*) can be 
reverse-applied$")
 QUILT_REFRESH_SUCCESS_RE = re.compile(r".*Refreshed patch (.*)")
 QUILT_SUCCESS_RE = re.compile(r".*File series fully applied, ends at (.*)$")
+QUILT_SERIES_EMPTY_RE = re.compile(r".*No patches in series$")
 
 SPEC_PATCH_PREAMBLE_RE_TEMPLATE = r"Patch(\d+):\s*{0}"  # Needs patch name, 
group(1) returns patch number
 SPEC_PATCH_PRE_SECTION_RE_TEMPLATE = r"%patch{0}\s+.*"  # Needs patch number, ^
@@ -190,6 +191,10 @@
                     if match:  # We're done
                         print("Finished refreshing patches for 
{0}".format(specfile))
                         break
+                    match = QUILT_SERIES_EMPTY_RE.match(output_oneline)
+                    if match:  # Either we removed all dropped patches from 
'series' or ...
+                        print("Finished refreshing patches for 
{0}".format(specfile))
+                        break
                     match = QUILT_PUSH_FUZZ_RE.match(output_oneline)
                     if match:  # Manual intervention needed
                         if args.ignorefuzz != "enable":
@@ -207,12 +212,15 @@
                     match = QUILT_PUSH_REVERSE_RE.match(output_oneline)
                     if match:  # Patch was fully merged, mark it for dropping
                         patch_name = os.path.basename(match.groups(1)[0])
-                        try:
-                            os.chdir(src_dir)
-                            silent_popen(["osc", "rm", patch_name])
-                            os.chdir(quilt_dir)
-                        except OSError:  # No osc installed, let's still kill 
the file:
-                            os.remove(os.path.join(src_dir, patch_name))
+                        # Only remove the patch from the 'series' file to be 
able to go on with further
+                        # patches. Delete fully-merged patches only after all 
spec files have been processed.
+                        with open("series", "r") as f:
+                            lines = f.readlines()
+                        with open("series", "w") as f:
+                            for line in lines:
+                                if line == patch_name + "\n":
+                                    continue
+                                f.write(line)
                         # Let's try to remove it from the spec file too.
                         with open(os.path.join(src_dir, specfile), "r") as f:
                             lines = f.readlines()
@@ -229,7 +237,6 @@
                                     if match:
                                         continue
                                 f.write(line)
-                        print("Patch {0} merged upstream and 
dropped".format(patch_name))
                         dropped_patches.append(patch_name)
                         continue
                     match = QUILT_PUSH_SUCCESS_RE.match(output_oneline)
@@ -249,3 +256,10 @@
             finally:
                 os.chdir(src_dir)
                 shutil.rmtree(quilt_dir)
+
+        for dropped_patch in dropped_patches:
+            print("Patch {0} merged upstream and dropped".format(patch_name))
+            try:
+                silent_popen(["osc", "rm", patch_name])
+            except OSError:  # No osc installed, let's still kill the file:
+                os.remove(os.path.join(src_dir, patch_name))

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to