File 0005-push-Make-files-w-after-being-touched-by-a-patch.patch of Package quilt

From 2f7ff3514f4354eb1cd97b6db926d927001dc9a4 Mon Sep 17 00:00:00 2001
From: Benjamin Poirier <bpoirier@suse.de>
Date: Tue, 14 Mar 2017 14:21:36 -0700
Subject: [PATCH 5/5] push: Make files +w after being touched by a patch

---
 quilt/fold.in |  9 +++++++++
 quilt/push.in | 14 ++++++++++++++
 2 files changed, 23 insertions(+)

Index: quilt-0.68/quilt/fold.in
===================================================================
--- quilt-0.68.orig/quilt/fold.in
+++ quilt-0.68/quilt/fold.in
@@ -114,6 +114,15 @@ then
 				failed=1
 				break
 			fi
+			if [ -r "$file" ]
+			then
+				if [ $(stat -c "%h" "$file") -eq 1 ]
+				then
+					chmod +w "$file"
+				else
+					echo "Warning: file $file has link count != 1, not changing permissions"
+				fi
+			fi
 		fi
 	done
 fi
Index: quilt-0.68/quilt/push.in
===================================================================
--- quilt-0.68.orig/quilt/push.in
+++ quilt-0.68/quilt/push.in
@@ -221,6 +221,20 @@ add_patch()
 			printf $"Applied patch %s (%sneeds refresh)\n" \
 			       "$(print_patch "$patch")" "$text"
 		fi
+
+		local f
+		quilt_command files | while read f; do
+			if [ -r "$f" ]
+			then
+				if [ $(stat -c "%h" "$f") -eq 1 ]
+				then
+					chmod +w "$f"
+				else
+					echo "Warning: file $f has link count != 1, not changing permissions"
+				fi
+			fi
+		done
+
 	else
 		rollback_patch "$patch"
 		tmp=$(gen_tempfile)
openSUSE Build Service is sponsored by