What use is WWWDIR_REL?

2012-02-07 Thread Doug Barton
Following up to my previous post about "Why isn't WWWDIR_REL in the
default PLIST_SUB I broke open bsd.port.mk and found this:

PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
EXAMPLESDIR="${EXAMPLESDIR_REL}" \
DATADIR="${DATADIR_REL}" \
WWWDIR="${WWWDIR_REL}" \***!!!
ETCDIR="${ETCDIR_REL}"

So this leads me to many questions, the first and most obvious of which
is, what the heck good is WWWDIR_REL in the first place? I searched the
ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
them are literals in a pkg-plist, which at this point looks completely
useless. Of the 28 others 13 of them are PLIST_SUB related, which
apparently can also be removed. Most of the other 15 look like mistakes,
and all of them look like they can be fixed with little difficulty.

So I'd like to propose the attached, not to be included until the
existing uses of WWWDIR_REL are updated of course. Can anyone tell me
why this would be a bad idea? I think being able to just use %%WWWDIR%%
in the plist would be a lot less confusing.


Doug

-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

Index: bsd.port.mk
===
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.705
diff -u -r1.705 bsd.port.mk
--- bsd.port.mk 2 Feb 2012 07:21:14 -   1.705
+++ bsd.port.mk 8 Feb 2012 03:23:00 -
@@ -1006,7 +1006,6 @@
 #
 # WWWDIR   - Name of the directory to install the packages www 
data in.
 #Default: ${PREFIX}/www/${PORTNAME}
-# WWWDIR_REL   - The WWWDIR relative to ${PREFIX}
 #
 # USERS- List of users to create at install time. Each 
login must
 #have a corresponding entry in ${UID_FILES}.
@@ -3086,13 +3085,12 @@
 DOCSDIR_REL?=  ${DOCSDIR:S,^${PREFIX}/,,}
 EXAMPLESDIR_REL?=  ${EXAMPLESDIR:S,^${PREFIX}/,,}
 DATADIR_REL?=  ${DATADIR:S,^${PREFIX}/,,}
-WWWDIR_REL?=   ${WWWDIR:S,^${PREFIX}/,,}
 ETCDIR_REL?=   ${ETCDIR:S,^${PREFIX}/,,}
 
 PLIST_SUB+=DOCSDIR="${DOCSDIR_REL}" \
EXAMPLESDIR="${EXAMPLESDIR_REL}" \
DATADIR="${DATADIR_REL}" \
-   WWWDIR="${WWWDIR_REL}" \
+   WWWDIR="${WWWDIR:S,^${PREFIX}/,,}"
ETCDIR="${ETCDIR_REL}"
 
 DESKTOPDIR?=   ${PREFIX}/share/applications
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Re: What use is WWWDIR_REL?

2012-02-07 Thread Philip M. Gollucci
Makes sense to me.

I might even see about doing the nitty gritty.


On 02/08/12 03:28, Doug Barton wrote:
> Following up to my previous post about "Why isn't WWWDIR_REL in the
> default PLIST_SUB I broke open bsd.port.mk and found this:
> 
> PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
> EXAMPLESDIR="${EXAMPLESDIR_REL}" \
> DATADIR="${DATADIR_REL}" \
> WWWDIR="${WWWDIR_REL}" \  ***!!!
> ETCDIR="${ETCDIR_REL}"
> 
> So this leads me to many questions, the first and most obvious of which
> is, what the heck good is WWWDIR_REL in the first place? I searched the
> ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
> them are literals in a pkg-plist, which at this point looks completely
> useless. Of the 28 others 13 of them are PLIST_SUB related, which
> apparently can also be removed. Most of the other 15 look like mistakes,
> and all of them look like they can be fixed with little difficulty.
> 
> So I'd like to propose the attached, not to be included until the
> existing uses of WWWDIR_REL are updated of course. Can anyone tell me
> why this would be a bad idea? I think being able to just use %%WWWDIR%%
> in the plist would be a lot less confusing.
> 
> 
> Doug
> 
> 
> 
> 
> ___
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


-- 

1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollu...@p6m7g8.com) c: 703.336.9354
Member,   Apache Software Foundation
Committer,FreeBSD Foundation
Consultant,   P6M7G8 Inc.
Director Operations,  Ridecharge Inc.

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.





signature.asc
Description: OpenPGP digital signature


Re: What use is WWWDIR_REL?

2012-02-08 Thread Alex Dupre

Doug Barton wrote:

So this leads me to many questions, the first and most obvious of which
is, what the heck good is WWWDIR_REL in the first place?


I don't follow you: in what sense WWWDIR_REL is different from, e.g., 
DOCSDIR_REL or DATADIR_REL? Why do you want to remove it and not the others?


--
Alex Dupre
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-08 Thread Doug Barton
On 02/08/2012 07:36, Alex Dupre wrote:
> Doug Barton wrote:
>> So this leads me to many questions, the first and most obvious of which
>> is, what the heck good is WWWDIR_REL in the first place?
> 
> I don't follow you: in what sense WWWDIR_REL is different from, e.g.,
> DOCSDIR_REL or DATADIR_REL? Why do you want to remove it and not the
> others?

Looking again at this bit of bpm:

PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
EXAMPLESDIR="${EXAMPLESDIR_REL}" \
DATADIR="${DATADIR_REL}" \
WWWDIR="${WWWDIR_REL}" \
ETCDIR="${ETCDIR_REL}"

You're right, the silliness is universal. I was focused on WWWDIR
because I was working with it. They should probably all go away, but I
don't have the time atm to do an exhaustive search on where/how they are
all used.


Doug

-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-08 Thread Philip M. Gollucci
On 02/08/12 23:24, Doug Barton wrote:
> On 02/08/2012 07:36, Alex Dupre wrote:
>> Doug Barton wrote:
>>> So this leads me to many questions, the first and most obvious of which
>>> is, what the heck good is WWWDIR_REL in the first place?
>>
>> I don't follow you: in what sense WWWDIR_REL is different from, e.g.,
>> DOCSDIR_REL or DATADIR_REL? Why do you want to remove it and not the
>> others?
> 
> Looking again at this bit of bpm:
> 
> PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
> EXAMPLESDIR="${EXAMPLESDIR_REL}" \
> DATADIR="${DATADIR_REL}" \
> WWWDIR="${WWWDIR_REL}" \
> ETCDIR="${ETCDIR_REL}"
> 
> You're right, the silliness is universal. I was focused on WWWDIR
> because I was working with it. They should probably all go away, but I
> don't have the time atm to do an exhaustive search on where/how they are
> all used.
> 
> 
> Doug
> 
Ah, the lightbulb goes off.

pkg-plist is supposed to be relative to @cwd which may or may not be
${LOCALBASE} or ${PREFIX} hence abs paths should be avoided.

That said, I think dougb's original patch
+   WWWDIR="${WWWDIR:S,^${PREFIX}/,,}"

accomplishes this quite nicely and removes 1-3 variables in the process.



-- 

1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollu...@p6m7g8.com) c: 703.336.9354
Member,   Apache Software Foundation
Committer,FreeBSD Foundation
Consultant,   P6M7G8 Inc.
Director Operations,  Ridecharge Inc.

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.



signature.asc
Description: OpenPGP digital signature


Re: What use is WWWDIR_REL?

2012-02-08 Thread Scot Hetzel
On Tue, Feb 7, 2012 at 9:28 PM, Doug Barton  wrote:
> Following up to my previous post about "Why isn't WWWDIR_REL in the
> default PLIST_SUB I broke open bsd.port.mk and found this:
>
> PLIST_SUB+=     DOCSDIR="${DOCSDIR_REL}" \
>                EXAMPLESDIR="${EXAMPLESDIR_REL}" \
>                DATADIR="${DATADIR_REL}" \
>                WWWDIR="${WWWDIR_REL}" \        ***!!!
>                ETCDIR="${ETCDIR_REL}"
>
> So this leads me to many questions, the first and most obvious of which
> is, what the heck good is WWWDIR_REL in the first place? I searched the
> ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
> them are literals in a pkg-plist, which at this point looks completely
> useless. Of the 28 others 13 of them are PLIST_SUB related, which
> apparently can also be removed. Most of the other 15 look like mistakes,
> and all of them look like they can be fixed with little difficulty.
>
Those 1035 ports that are using WWWDIR_REL in their pkg-plist are
wrong and should be changed to use WWWDIR. Since PLIST_SUB will
automatically replace %%WWWDIR%% with ${WWWDIR_REL} in the pkg-plist.

> So I'd like to propose the attached, not to be included until the
> existing uses of WWWDIR_REL are updated of course. Can anyone tell me
> why this would be a bad idea? I think being able to just use %%WWWDIR%%
> in the plist would be a lot less confusing.
>
I believe the original purpose of the *_REL variables in bsd.port.mk
was to make maintaining bsd.port.mk easier.

These variables were introduced in bsd.port.mk version 1.557.

http://www.freebsd.org/cgi/query-pr.cgi?pr=110781 <- adds the *_REL
variables to bsd.port.mk
http://www.freebsd.org/cgi/query-pr.cgi?pr=105529 <- adds WWWDIR to bsd.port.mk

Portlint most likely should be updated to do the following:

- look for the use of these *_REL variables in the pkg-plist and flag
them as an error, and suggest to use the non *_REL variable instead.
- Check the ports Makefile for the use of the *_REL variables in
PLIST_SUB and flag those uses as an error.

Scot
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread Doug Barton
On 02/08/2012 20:18, Scot Hetzel wrote:
> On Tue, Feb 7, 2012 at 9:28 PM, Doug Barton  wrote:
>> Following up to my previous post about "Why isn't WWWDIR_REL in the
>> default PLIST_SUB I broke open bsd.port.mk and found this:
>>
>> PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
>>EXAMPLESDIR="${EXAMPLESDIR_REL}" \
>>DATADIR="${DATADIR_REL}" \
>>WWWDIR="${WWWDIR_REL}" \***!!!
>>ETCDIR="${ETCDIR_REL}"
>>
>> So this leads me to many questions, the first and most obvious of which
>> is, what the heck good is WWWDIR_REL in the first place? I searched the
>> ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
>> them are literals in a pkg-plist, which at this point looks completely
>> useless. Of the 28 others 13 of them are PLIST_SUB related, which
>> apparently can also be removed. Most of the other 15 look like mistakes,
>> and all of them look like they can be fixed with little difficulty.
>>
> Those 1035 ports that are using WWWDIR_REL in their pkg-plist are
> wrong and should be changed to use WWWDIR. Since PLIST_SUB will
> automatically replace %%WWWDIR%% with ${WWWDIR_REL} in the pkg-plist.

Ok, glad we're in agreement on that.

>> So I'd like to propose the attached, not to be included until the
>> existing uses of WWWDIR_REL are updated of course. Can anyone tell me
>> why this would be a bad idea? I think being able to just use %%WWWDIR%%
>> in the plist would be a lot less confusing.
>>
> I believe the original purpose of the *_REL variables in bsd.port.mk
> was to make maintaining bsd.port.mk easier.

Clearly I'm missing something then, because I don't see how they
accomplish anything useful. Perhaps you can enlighten me? There is
nothing in the CVS log that even mentions them, never mind why they were
added (bad portmgr, no cookie!).


Doug

-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread Jason Helfman

On Fri, Feb 10, 2012 at 04:13:32PM -0800, Doug Barton thus spake:

On 02/08/2012 20:18, Scot Hetzel wrote:

On Tue, Feb 7, 2012 at 9:28 PM, Doug Barton  wrote:

Following up to my previous post about "Why isn't WWWDIR_REL in the
default PLIST_SUB I broke open bsd.port.mk and found this:

PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
   EXAMPLESDIR="${EXAMPLESDIR_REL}" \
   DATADIR="${DATADIR_REL}" \
   WWWDIR="${WWWDIR_REL}" \***!!!
   ETCDIR="${ETCDIR_REL}"

So this leads me to many questions, the first and most obvious of which
is, what the heck good is WWWDIR_REL in the first place? I searched the
ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
them are literals in a pkg-plist, which at this point looks completely
useless. Of the 28 others 13 of them are PLIST_SUB related, which
apparently can also be removed. Most of the other 15 look like mistakes,
and all of them look like they can be fixed with little difficulty.


Those 1035 ports that are using WWWDIR_REL in their pkg-plist are
wrong and should be changed to use WWWDIR. Since PLIST_SUB will
automatically replace %%WWWDIR%% with ${WWWDIR_REL} in the pkg-plist.


Ok, glad we're in agreement on that.


So I'd like to propose the attached, not to be included until the
existing uses of WWWDIR_REL are updated of course. Can anyone tell me
why this would be a bad idea? I think being able to just use %%WWWDIR%%
in the plist would be a lot less confusing.


I believe the original purpose of the *_REL variables in bsd.port.mk
was to make maintaining bsd.port.mk easier.


Clearly I'm missing something then, because I don't see how they
accomplish anything useful. Perhaps you can enlighten me? There is
nothing in the CVS log that even mentions them, never mind why they were
added (bad portmgr, no cookie!).


Doug


Interesting bit here:
http://www.freebsd.org/doc/en/books/porters-handbook/book.html#INSTALL-DOCUMENTATION

snip

DATADIR gets expanded to PREFIX/share/PORTNAME.
--> DATADIR_REL gets expanded to share/PORTNAME.
DOCSDIR gets expanded to PREFIX/share/doc/PORTNAME.
--> DOCSDIR_REL gets expanded to share/doc/PORTNAME.
EXAMPLESDIR gets expanded to PREFIX/share/examples/PORTNAME.
--> EXAMPLESDIR_REL gets expanded to share/examples/PORTNAME.

-jgh

--
Jason Helfman
System Administrator
experts-exchange.com
http://www.experts-exchange.com/M_4830110.html
E4AD 7CF1 1396 27F6 79DD  4342 5E92 AD66 8C8C FBA5
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread Doug Barton
On 02/10/2012 16:17, Jason Helfman wrote:
> On Fri, Feb 10, 2012 at 04:13:32PM -0800, Doug Barton thus spake:
>> On 02/08/2012 20:18, Scot Hetzel wrote:
>>> On Tue, Feb 7, 2012 at 9:28 PM, Doug Barton  wrote:
 Following up to my previous post about "Why isn't WWWDIR_REL in the
 default PLIST_SUB I broke open bsd.port.mk and found this:

 PLIST_SUB+= DOCSDIR="${DOCSDIR_REL}" \
EXAMPLESDIR="${EXAMPLESDIR_REL}" \
DATADIR="${DATADIR_REL}" \
WWWDIR="${WWWDIR_REL}" \***!!!
ETCDIR="${ETCDIR_REL}"

 So this leads me to many questions, the first and most obvious of which
 is, what the heck good is WWWDIR_REL in the first place? I searched the
 ports tree and found 1,063 uses of it (outside of bpm itself). 1,035 of
 them are literals in a pkg-plist, which at this point looks completely
 useless. Of the 28 others 13 of them are PLIST_SUB related, which
 apparently can also be removed. Most of the other 15 look like
 mistakes,
 and all of them look like they can be fixed with little difficulty.

>>> Those 1035 ports that are using WWWDIR_REL in their pkg-plist are
>>> wrong and should be changed to use WWWDIR. Since PLIST_SUB will
>>> automatically replace %%WWWDIR%% with ${WWWDIR_REL} in the pkg-plist.
>>
>> Ok, glad we're in agreement on that.
>>
 So I'd like to propose the attached, not to be included until the
 existing uses of WWWDIR_REL are updated of course. Can anyone tell me
 why this would be a bad idea? I think being able to just use %%WWWDIR%%
 in the plist would be a lot less confusing.

>>> I believe the original purpose of the *_REL variables in bsd.port.mk
>>> was to make maintaining bsd.port.mk easier.
>>
>> Clearly I'm missing something then, because I don't see how they
>> accomplish anything useful. Perhaps you can enlighten me? There is
>> nothing in the CVS log that even mentions them, never mind why they were
>> added (bad portmgr, no cookie!).
>>
>>
>> Doug
>>
> Interesting bit here:

Have you actually read the thread at all? I understand how they get
expanded, my point is that the *_REL variables are (apparently) only
useful in a plist, and they are not needed there because of how the
default PLIST_SUB is expanded. I've already pasted that bit into this
thread twice, I'm not going to do it again. :)


Doug

-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread rflynn
Hi,

>>> Clearly I'm missing something then, because I don't see how they
>>> accomplish anything useful. Perhaps you can enlighten me? There is
>>> nothing in the CVS log that even mentions them, never mind why they were
>>> added (bad portmgr, no cookie!).

In theory they're useful for:
post-install:
 @(cd ${PREFIX} && foo-magic ${WWWDIR_REL} ${DATADIR_REL})

But if this only happens in theory, there's no use in keeping it around.

-- Mel

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread Doug Barton
On 02/10/2012 17:57, rfl...@acsalaska.net wrote:
> Hi,
> 
 Clearly I'm missing something then, because I don't see how they
 accomplish anything useful. Perhaps you can enlighten me? There is
 nothing in the CVS log that even mentions them, never mind why they were
 added (bad portmgr, no cookie!).
> 
> In theory they're useful for:
> post-install:
>  @(cd ${PREFIX} && foo-magic ${WWWDIR_REL} ${DATADIR_REL})
> 
> But if this only happens in theory, there's no use in keeping it around.

Did you see my original post in this thread?



-- 

It's always a long day; 86400 doesn't fit into a short.

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: What use is WWWDIR_REL?

2012-02-10 Thread rflynn
> On 02/10/2012 17:57, rfl...@acsalaska.net wrote:
>> Hi,
>>
> Clearly I'm missing something then, because I don't see how they
> accomplish anything useful. Perhaps you can enlighten me? There is
> nothing in the CVS log that even mentions them, never mind why they were
> added (bad portmgr, no cookie!).
>>
>> In theory they're useful for:
>> post-install:
>>  @(cd ${PREFIX} && foo-magic ${WWWDIR_REL} ${DATADIR_REL})
>>
>> But if this only happens in theory, there's no use in keeping it around.
>
> Did you see my original post in this thread?

Yep, easily fixable with substitution, as long as people use $PREFIX and not
$LOCALBASE - in other words doc problem and I agree with your original post.

-- Mel

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"