Bug 168808 - [PATCH] net/mtr: Convert to new options framework
Summary: [PATCH] net/mtr: Convert to new options framework
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-07 16:10 UTC by Bryan Drewery
Modified: 2012-07-04 11:00 UTC (History)
1 user (show)

See Also:


Attachments
patch-net-mtr-optionsng.txt (797 bytes, patch)
2012-06-07 16:10 UTC, Bryan Drewery
no flags Details | Diff
patch-net-mtr-optionsng.txt (822 bytes, patch)
2012-06-07 16:19 UTC, Bryan Drewery
no flags Details | Diff
patch-net-mtr-optionsng.txt (881 bytes, patch)
2012-06-22 03:27 UTC, Bryan Drewery
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Drewery 2012-06-07 16:10:08 UTC
	- Convert to new options framework
	- Fixes build without X11 [ports/168795]
Comment 1 Bryan Drewery 2012-06-07 16:19:56 UTC
Previous patch missed the OPTIONS_DEFAULT= IPV6. Not sure if it is
intended to have X11 as the default. I left it out of my patch.
Attached adds IPV6 to default.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-07 16:31:55 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 3 vsjcfm 2012-06-08 07:37:16 UTC
Patch tested. It effectively fixes ports/168795
Comment 4 Bryan Drewery 2012-06-22 03:27:03 UTC
sunpoet pointed out that the previous patches did not properly set X11
as the default for net/mtr. This patch does. While properly keeping it
default off for net/mtr-nox11.

I also considered some other checks such as ${.CURDIR],
${PKGNAMESUFFIX}. I ended up checking for !defined(WITHOUT_X11) as this
avoids needing to updating net/mtr-nox11 and matches how it worked before.

Regards,
Bryan Drewery
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-06-23 14:44:21 UTC
State Changed
From-To: open->feedback

Please confirm if the patch [1] for new options framework works for you 
both in net/mtr and net/mtr-nox11. 

[1] http://people.freebsd.org/~sunpoet/mtr.patch 

http://www.freebsd.org/cgi/query-pr.cgi?pr=168808 

Date: Sat, 23 Jun 2012 10:29:36 -0500
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-06-23 18:51:43 UTC
On Sat, Jun 23, 2012 at 11:29 PM, Bryan Drewery <bryan@shatow.net> wrote:
> It mostly works.
>
> 1. mtr_UNSET= is overriding the user's own settings due to = instead of
> +=. This is a user-only setting, the OPTIONS_EXCLUDE seems to be enough.
> You can see this by adding mtr_UNSET=IPV6 in /etc/make.conf and building
> mtr-nox11

Hi,

I agree that the patch is not a good solution but it works.
OPTIONS_EXCLUDE is not enough. It only *hides* the option from the
dialog but does not actually unset the option. You may remove
mtr_UNSET line and /var/db/ports/mtr/options then try "make
build-depends-list" or "make run-depends-list". The invisible X11
still exists.

> 2. Missing tabs on the OPTIONS_DEFAULT and OPTIONS_DEFINE lines

I meant not to add tab after OPTIONS_DEFAULT= as it has same length as
OPTION_DEFINE=<tab>.

Regards,
sunpoet

> Regards,
> Bryan Drewery
Comment 7 Bryan Drewery 2012-06-23 18:56:20 UTC
On 6/23/2012 12:51 PM, Sunpoet Po-Chuan Hsieh wrote:
> I agree that the patch is not a good solution but it works.
> OPTIONS_EXCLUDE is not enough.

Ok well at least make it a += so it does not override the user's own
setting if they have unset IPV6.

Regards,
Bryan Drewery
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-06-23 19:30:59 UTC
On Sun, Jun 24, 2012 at 1:56 AM, Bryan Drewery <bryan@shatow.net> wrote:
> On 6/23/2012 12:51 PM, Sunpoet Po-Chuan Hsieh wrote:
>> I agree that the patch is not a good solution but it works.
>> OPTIONS_EXCLUDE is not enough.
>
> Ok well at least make it a += so it does not override the user's own
> setting if they have unset IPV6.

It makes no difference here and we should not use +=. Port Makefile is
processed before user's option file.

You can test it by yourself with the following steps:
1. Remove WITHOUT_X11 from /etc/make.conf
2. Remove net/mtr and net/mtr-nox11 lines from /usr/local/etc/ports.conf
3. 'make config' and unset both IPV6 and X11 (to generate option file)
4. In net/mtr-nox11, 'make -V CONFIGURE_ARGS -V CATEGORIES'

The result should be:
--disable-ipv6 --without-gtk --prefix=/usr/local ${_LATE_CONFIGURE_ARGS}
net

These two lines indicate the IPV6 options is off (ref:
net/mtr/Makefile line 31 to 36).

Regards,
sunpoet

> Regards,
> Bryan Drewery
Comment 9 Bryan Drewery 2012-06-23 19:39:52 UTC
On 6/23/2012 1:30 PM, Sunpoet Po-Chuan Hsieh wrote:
> It makes no difference here and we should not use +=. Port Makefile is
> processed before user's option file.

Wrong. Using = blows away the user's options.

/usr/ports/net/mtr-nox11# grep mtr /etc/make.conf
mtr_UNSET= IPV6

/usr/ports/net/mtr-nox11# grep UNSET Makefile
mtr_UNSET= X11


/usr/ports/net/mtr-nox11# rm -rf /var/db/ports/mtr

/usr/ports/net/mtr-nox11# make pretty-print-config
+IPV6

It is showing IPV6 despite me having it *unset* in /etc/make.conf due to =.

Changing to +=:

/usr/ports/net/mtr-nox11# grep UNSET Makefile
mtr_UNSET+= X11

/usr/ports/net/mtr-nox11# make pretty-print-config
-IPV6

Now it correctly recognizes my mtr_UNSET=IPV6.

Regards,
Bryan Drewery
Comment 10 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-06-23 19:59:30 UTC
On Sun, Jun 24, 2012 at 2:39 AM, Bryan Drewery <bryan@shatow.net> wrote:
> On 6/23/2012 1:30 PM, Sunpoet Po-Chuan Hsieh wrote:
>> It makes no difference here and we should not use +=3D. Port Makefile is
>> processed before user's option file.
>
> Wrong. Using =3D blows away the user's options.
>
> /usr/ports/net/mtr-nox11# grep mtr /etc/make.conf
> mtr_UNSET=3D IPV6
>
> /usr/ports/net/mtr-nox11# grep UNSET Makefile
> mtr_UNSET=3D X11
>
>
> /usr/ports/net/mtr-nox11# rm -rf /var/db/ports/mtr
>
> /usr/ports/net/mtr-nox11# make pretty-print-config
> +IPV6
>
> It is showing IPV6 despite me having it *unset* in /etc/make.conf due to =
=3D.
>
> Changing to +=3D:
>
> /usr/ports/net/mtr-nox11# grep UNSET Makefile
> mtr_UNSET+=3D X11
>
> /usr/ports/net/mtr-nox11# make pretty-print-config
> -IPV6
>
> Now it correctly recognizes my mtr_UNSET=3DIPV6.
>
> Regards,
> Bryan Drewery

OK, now I know what the problem is. Personally I use ports.conf (all
options in one file) instead of option files and I do not set
xxx_SET/xxx_UNSET in make.conf. Anyway, I have another solution which
replaces mtr_UNSET=3DX11 by OPTIONS_FILE_UNSET=3DX11. It should respect
mtr_SET/mtr_UNSET in make.conf correctly.

Regards,
sunepot


--=20
=C2=A0 Sunpoet Po-Chuan Hsieh <sunpoet at sunpoet.net> <sunpoet at FreeBSD.=
org>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 4096R/CC57E36B 8AD8 68F2 7D2B 0A10 7E9B =
8CC0 DC44 247E CC57 E36B
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 http://people.FreeBSD.org/~sunpoet/pgpkeys.txt
Comment 11 dfilter service freebsd_committer freebsd_triage 2012-07-04 10:55:26 UTC
sunpoet     2012-07-04 09:55:12 UTC

  FreeBSD ports repository

  Modified files:
    net/mtr              Makefile 
  Log:
  - Convert to new options framework
  - Cosmetic change
  
  PR:             ports/168795 [1], ports/168808 [2]
  Submitted by:   Sayetsky Anton <vsjcfm@gmail.com> [1],
                  Bryan Drewery <bryan@shatow.net> [2]
  
  Revision  Changes    Path
  1.85      +7 -10     ports/net/mtr/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 12 dfilter service freebsd_committer freebsd_triage 2012-07-04 10:55:56 UTC
sunpoet     2012-07-04 09:55:42 UTC

  FreeBSD ports repository

  Modified files:
    net/mtr-nox11        Makefile 
  Log:
  - Convert to new options framework
  
  PR:             ports/168795 [1], ports/168808 [2]
  Submitted by:   Sayetsky Anton <vsjcfm@gmail.com> [1],
                  Bryan Drewery <bryan@shatow.net> [2]
  
  Revision  Changes    Path
  1.4       +2 -1      ports/net/mtr-nox11/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 13 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-07-04 10:56:14 UTC
State Changed
From-To: feedback->closed

Problem solved in the ports tree.