From 191f00cb6f3f4dd125859bfb43f1398fc3bf4447 Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Wed, 5 Mar 2014 12:10:16 -0500
Subject: [PATCH] =?UTF-8?q?Have=20force-not=20take=20precedence=20over=20f?=
 =?UTF-8?q?orce.=20Not=20only=20is=20it=20the=20Right=20Thing=E2=84=A2=20(?=
 =?UTF-8?q?see=20lp#1184002),=20it=20makes=20code=20simpler.=20Actually,?=
 =?UTF-8?q?=20the=20two=20are=20one=20and=20the=20same.=20=20=20=20=20http?=
 =?UTF-8?q?s://bugs.launchpad.net/asdf/+bug/1184002?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 doc/asdf.texinfo       | 5 +++--
 plan.lisp              | 8 +++-----
 test/test-force.script | 5 +++++
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo
index d6029e90b..997c89e38 100644
--- a/doc/asdf.texinfo
+++ b/doc/asdf.texinfo
@@ -1728,8 +1728,9 @@ is forced not to be recompiled even if modified since last compilation,
 but other systems are not affected.
 If @var{force-not} is a list, then it specifies a list of systems that
 are forced not to be recompiled even if modified since last compilation.
-@var{force} takes precedences over @var{force-not};
-both of them apply to systems that are dependencies and were already compiled.
+@var{force-not} takes precedences over @var{force},
+as it should, really, but unhappily only since 3.1.1.
+Both apply to systems that are dependencies and were already compiled.
 
 To see what @code{operate} would do, you can use:
 @example
diff --git a/plan.lisp b/plan.lisp
index 2d84d6bb6..593e98a05 100644
--- a/plan.lisp
+++ b/plan.lisp
@@ -122,11 +122,9 @@ the action of OPERATION on COMPONENT in the PLAN"))
                  (not (eq system (plan-system plan))))))))
 
   (defmethod action-forced-not-p (plan operation component)
-    (and
-     ;; Did the user ask us to not re-perform the action?
-     (action-override-p plan operation component 'plan-forced-not)
-     ;; Force takes precedence over force-not
-     (not (action-forced-p plan operation component))))
+    ;; Did the user ask us to not re-perform the action?
+    ;; NB: force-not takes precedence over force, as it should
+    (action-override-p plan operation component 'plan-forced-not))
 
   (defmethod action-forced-p ((plan null) (operation operation) (component component))
     nil)
diff --git a/test/test-force.script b/test/test-force.script
index 59a5b294b..5cad8f6c8 100644
--- a/test/test-force.script
+++ b/test/test-force.script
@@ -10,6 +10,11 @@
 (assert file1)
 (assert file1-date)
 
+;; Check that force has some effect, but force-not takes precedence.
+(assert (traverse 'load-op 'test-force :force t))
+(assert (null (traverse 'load-op 'test-force :force-not t)))
+(assert (null (traverse 'load-op 'test-force :force t :force-not t)))
+
 ;; unforced, date should stay same
 (touch-file "test-force.asd" :timestamp date1)
 (touch-file "file1.lisp" :timestamp date1)
-- 
GitLab