Bug 41467 - latest portupgrade prevents make arg -DNO_IGNORE from working
Summary: latest portupgrade prevents make arg -DNO_IGNORE from working
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Akinori MUSHA
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-09 09:30 UTC by Alan E
Modified: 2002-09-13 05:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan E 2002-08-09 09:30:01 UTC
The newest portupgrade does a 'make $MAKE_ARGS -V PKGNAME -V IGNORE' before
trying to build the port.

The effect of this is that if you pass -DNO_IGNORE in make args, you still
cannot build the port because portupgrade cuts you off at the knees first.
(NO_IGNORE does not *unset* IGNORE, it merely negates its effect.)

It is not portupgrade's business to stop me from making a port with IGNORE set.
The code that does this should be removed. Checking the make args for NO_IGNORE
would not be sufficient, because it could be in /etc/make.conf, too.

FWIW, the -v option should show matches in pkgtools.conf for things, and should
also show make invocations. It would have made finding out why portupgrade was
broken a lot easier.

Fix: 

Remove the offending code. Let the port tell you if it isn't going to build.
Please do not try to protect the user by preventing an action that should 
(and used to) work correctly.
How-To-Repeat: 
Try to rebuild an installed java/jdk13 with:

portupgrade -f -m '-DNO_IGNORE -DBATCH' jdk

And please don't tell me to just remove the '-DBATCH'; in reality, it's
in my /etc/make.conf, for a reason, and will stay there.
Comment 1 Mario Sergio Fujikawa Ferreira freebsd_committer freebsd_triage 2002-08-09 11:14:40 UTC
Responsible Changed
From-To: freebsd-ports->knu

Over to maintainer
Comment 2 Akinori MUSHA 2002-08-09 12:28:24 UTC
At Fri, 9 Aug 2002 03:55:04 -0400 (EDT),
Alan Eldridge wrote:
> It is not portupgrade's business to stop me from making a port with
> IGNORE set.  The code that does this should be removed.

You could try modifying portupgrade and see what would happen.  For
ports that are marked as IGNORE, "make build/install" doesn't fail in
error, so portupgrade tries to proceed anyway; and due misery follows.
For the record, Jimmy Olgeni was the one who informed me of that.

> >Fix:
> 
> Remove the offending code. Let the port tell you if it isn't going to build.
> Please do not try to protect the user by preventing an action that should 
> (and used to) work correctly.

As I explained above, there is a case where user is terribly hurt and
that's why the check was introduced.  I'll alter the code to check
NO_IGNORE also to solve your problem.

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"When I leave I don't know what I'm hoping to find
              When I leave I don't know what I'm leaving behind.."
Comment 3 Akinori MUSHA 2002-08-09 12:29:24 UTC
At Fri, 09 Aug 2002 20:07:12 +0900,
I wrote:
> As I explained above, there is a case where user is terribly hurt and
> that's why the check was introduced.  I'll alter the code to check
> NO_IGNORE also to solve your problem.

Here's a patch, but beware, defining NO_IGNORE could be dangerous in
some cases (ports).

Index: portupgrade
===================================================================
RCS file: /home/cvs/pkgtools/bin/portupgrade,v
retrieving revision 1.182
diff -u -1 -r1.182 portupgrade
--- portupgrade	4 Aug 2002 22:46:15 -0000	1.182
+++ portupgrade	9 Aug 2002 11:20:30 -0000
@@ -1039,5 +1039,5 @@
 
-  output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE 2>&1`.to_a
+  output = `cd #{portdir} && #{shelljoin(*cmdargs)} -V PKGNAME -V IGNORE -V NO_IGNORE 2>&1`.to_a
 
-  if output.size != 2
+  if output.size != 3
     warning_message "Makefile of '#{origin}' is possibly broken:"
@@ -1048,2 +1048,3 @@
   ignore = output[1].chomp
+  no_ignore = !output[2].chomp.empty?
 
@@ -1052,3 +1053,5 @@
     STDERR.puts "\t" + ignore
-    raise IgnoreMarkError
+    raise IgnoreMarkError unless no_ignore
+
+    warning_message "Proceeding anyway since NO_IGNORE is defined"
   end

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"When I leave I don't know what I'm hoping to find
              When I leave I don't know what I'm leaving behind.."
Comment 4 Alan Eldridge 2002-08-09 18:28:00 UTC
On Fri, Aug 09, 2002 at 08:29:24PM +0900, Akinori MUSHA wrote:
>At Fri, 09 Aug 2002 20:07:12 +0900,
>I wrote:
>> As I explained above, there is a case where user is terribly hurt and
>> that's why the check was introduced.  I'll alter the code to check
>> NO_IGNORE also to solve your problem.
>
>Here's a patch, but beware, defining NO_IGNORE could be dangerous in
>some cases (ports).

Thank you very much. I have applied the patch. I assume we can expect it
to show up in the next rev of portupgrade, right?

-- 
AlanE
KDE-FreeBSD Team
Comment 5 Akinori MUSHA 2002-08-11 10:51:27 UTC
At Fri, 9 Aug 2002 13:28:00 -0400,
Alan E wrote:
> On Fri, Aug 09, 2002 at 08:29:24PM +0900, Akinori MUSHA wrote:
> >At Fri, 09 Aug 2002 20:07:12 +0900,
> >I wrote:
> >> As I explained above, there is a case where user is terribly hurt and
> >> that's why the check was introduced.  I'll alter the code to check
> >> NO_IGNORE also to solve your problem.
> >
> >Here's a patch, but beware, defining NO_IGNORE could be dangerous in
> >some cases (ports).
> 
> Thank you very much. I have applied the patch. I assume we can expect it
> to show up in the next rev of portupgrade, right?

Well, actually I attached the patch because I wanted you to test. :)
If it works for you and satisfies your need, it will appear in the
next release.

Thanks,

-- 
                     /
                    /__  __            Akinori.org / MUSHA.org
                   / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp

"When I leave I don't know what I'm hoping to find
              When I leave I don't know what I'm leaving behind.."
Comment 6 Alan Eldridge 2002-08-11 12:14:43 UTC
On Sun, Aug 11, 2002 at 06:51:27PM +0900, Akinori MUSHA wrote:
>At Fri, 9 Aug 2002 13:28:00 -0400,
>Alan E wrote:
>> On Fri, Aug 09, 2002 at 08:29:24PM +0900, Akinori MUSHA wrote:
>> >At Fri, 09 Aug 2002 20:07:12 +0900,
>> >I wrote:
>> >> As I explained above, there is a case where user is terribly hurt and
>> >> that's why the check was introduced.  I'll alter the code to check
>> >> NO_IGNORE also to solve your problem.
>> >
>> >Here's a patch, but beware, defining NO_IGNORE could be dangerous in
>> >some cases (ports).
>> 
>> Thank you very much. I have applied the patch. I assume we can expect it
>> to show up in the next rev of portupgrade, right?
>
>Well, actually I attached the patch because I wanted you to test. :)
>If it works for you and satisfies your need, it will appear in the
>next release.

Works perfectly. Thanks. Please add to release. 8=)
-- 
AlanE
KDE-FreeBSD Team
Comment 7 Akinori MUSHA freebsd_committer freebsd_triage 2002-08-12 11:54:37 UTC
State Changed
From-To: open->patched

A fix will be included in the next release.
Comment 8 Alan Eldridge 2002-08-28 16:24:54 UTC
Please commit NO_IGNORE patch. It has been 3 weeks now.
Comment 9 Akinori MUSHA freebsd_committer freebsd_triage 2002-09-13 05:52:12 UTC
State Changed
From-To: patched->closed

The port was updated with the patch integrated.