File 0004-push-Do-not-remove-refresh-flag.patch of Package quilt-ks

From 5b30ab6ee4f355f5cb755fbf6978a9862c99849c Mon Sep 17 00:00:00 2001
From: Benjamin Poirier <bpoirier@suse.de>
Date: Fri, 31 Mar 2017 14:58:48 -0700
Subject: [PATCH 4/5] push: Do not remove refresh flag

This allows to preset it for a patch after it has been imported but before
it has been applied. The patch might apply without conflict but we'd still
like to "remind" the user to refresh it.
---
 quilt/delete.in |  1 +
 quilt/push.in   | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/quilt/delete.in b/quilt/delete.in
index 240a43b..ac4b44b 100644
--- a/quilt/delete.in
+++ b/quilt/delete.in
@@ -136,6 +136,7 @@ then
 			exit 1
 		fi
 	fi
+	rm -f "$QUILT_PC/$patch~refresh"
 fi
 ### Local Variables:
 ### mode: shell-script
diff --git a/quilt/push.in b/quilt/push.in
index 44ff742..d61f166 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -200,12 +200,11 @@ add_patch()
 
 	if [ $status -eq 0 -o -n "$opt_force" ]
 	then
+		local refresh="$QUILT_PC/$patch~refresh"
 		add_to_db "$patch"
-		if [ $status -eq 0 ]
+		if [ $status -ne 0 ]
 		then
-			rm -f "$QUILT_PC/$patch~refresh"
-		else
-			touch "$QUILT_PC/$patch~refresh"
+			touch "$refresh"
 		fi
 
 		if [ -e "$QUILT_PC/$patch" ]
@@ -223,10 +222,14 @@ add_patch()
 		then
 			printf $"Patch %s appears to be empty; applied\n" \
 			       "$(print_patch "$patch")"
-		elif [ $status -ne 0 ]
+		elif [ -e "$refresh" ]
 		then
-			printf $"Applied patch %s (forced; needs refresh)\n" \
-			       "$(print_patch "$patch")"
+			local text
+			if [ "$opt_force" ]; then
+				text="forced; "
+			fi
+			printf $"Applied patch %s (%sneeds refresh)\n" \
+			       "$(print_patch "$patch")" "$text"
 		fi
 	else
 		rollback_patch "$patch"
-- 
2.21.0

openSUSE Build Service is sponsored by