Jeremy C. Reed | 1 Dec 2006 03:27

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

> On a Fedora box, /bin/sh is bash. pkgsrc is having a lot of problems
> building, with complaints about embedded `...` execution instances
> inside case ... logic, inherited down from configure stuff.
> 
> its also dying on sort +2n instances.
> 
> is this a well known gotcha for pkgsrc on some annoying distros?
> 
> I've got over the sh stuff by doing a replace of ksh for sh, but I
> haven't yet worked out what tickles the sort problem.

Do you have any examples? And log output?

(Show me and I may try under CentOS.)

Jeremy C. Reed | 1 Dec 2006 04:46

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

On Fri, 1 Dec 2006, George Michaelson wrote:

> its also dying on sort +2n instances.
...
> sort (GNU coreutils) 5.97
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software.  You may redistribute copies of it under the terms of
> the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
> There is NO WARRANTY, to the extent permitted by law.

I'd guess other packages will have problems too. This is common (at least 
to me). But I see coreutils 4.5.3 sort info page says:

     On older systems, `sort' supports an obsolete origin-zero syntax
     `+POS1 [-POS2]' for specifying sort keys.  POSIX 1003.1-2001 (*note
     Standards conformance::) does not allow this; use `-k' instead.

Have a look at
http://www.gnu.org/software/coreutils/manual/html_node/coreutils_7.html
Maybe some environment variable will work for you?

Or we could go through a fix this in

pdksh-5.2.14/siglist.sh

and elsewhere (assuming that our other Unix platforms support the other 
sort syntax).

Marius ROMAN | 1 Dec 2006 02:01
Picon

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

Use NetBSD.

On 12/1/06, George Michaelson <ggm <at> apnic.net> wrote:

On a Fedora box, /bin/sh is bash. pkgsrc is having a lot of problems
building, with complaints about embedded `...` execution instances
inside case ... logic, inherited down from configure stuff.

its also dying on sort +2n instances.

is this a well known gotcha for pkgsrc on some annoying distros?

I've got over the sh stuff by doing a replace of ksh for sh, but I
haven't yet worked out what tickles the sort problem.

-G


# bash --version
GNU bash, version 3.1.17(1)-release (i686-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
# uname -a
Linux mirin.apnic.net 2.6.18-1.2239.fc5smp #1 SMP Fri Nov 10 13:22:44 EST 2006 i686
# sort --version
sort (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
#

Lubomir Sedlacik | 1 Dec 2006 08:49

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

hi Marius,

On Fri, Dec 01, 2006 at 03:01:40AM +0200, Marius ROMAN wrote:
> Use NetBSD.

undeniably, the OP knows his needs and requirements better than anyone
else on this list and has his own reasons to run the operating system he
chose.  your reaction was uncalled for, please next time refrain from
such comments and keep them for appropriate places.

perhaps you overlooked the fact that this list is called "pkgsrc-users"
and not "netbsd-advocacy"?

thanks,
regards,

--

-- 
-- Lubomir Sedlacik <salo <at> {NetBSD,Xtrmntr,silcnet}.org>   --
George Michaelson | 1 Dec 2006 09:08
Favicon

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

Further to this, Jeremy Reed helped me with debug and two outcomes might 
be relevant for pkgsrc on RedHat/Fedora

1) the base /bin/sh -> bash doesn't grok configure stuff.

if you run bmake as SH=/bin/ksh bmake... this problem goes away.

Is there some simple way to make the /bin/ksh *be* the default shell in 
either the pkgsrc/mk/ or in /etc/mk.conf?

2) gnu sort cannot handle +n form arguments unless told to use an
older POSIX environment.

This is also fixable by setting a runtime environment call before the 
exec of bmake. Therefore the same question: can/should these be set by 
some env, or mk/mk.conf settings on the platform?

I've since found that the gcc version is 4.1.1, and there are lvalue 
cast related problems which are well understood, and indeed fixed on 
some code, I may have a patch from gentoo which addresses this for nvi 
I'd like to submit into pkgsrc. Interestingly, the NetBSD gcc doesn't 
trip over this problem, I guess people realized that ANSI C fascism had 
a downside and provided some way out of the problem

Many thanks to Jeremy Reed for his help.

-george

PS I run BSD, but I sometimes have to work on non-BSD boxen, which is 
why It matters to me that pkgsrc works on them. Go pkgsrc for being as
amazingly portable as it is!! as fixes go, setting env is *trivial*.

Ondřej Tůma | 1 Dec 2006 09:40

mini_sendmail doesn't parse recipient corectly

Hi, i found error in mini_sendmail from pkgsrc, i didn't test on original distribution, only with pkgsrc patches.

root <at> jim# echo -e 'To:Ondrej Tuma <pkgsrc <at> blackmouse.biz>\nFrom:Konference
<pkgscr <at> blackmouse.biz>\nSubject: test\n\ntest' | mini_sendmail -t -v -fpkgsrc <at> blackmouse.biz
<<<< 220 jim.lan.blackmouse.biz ESMTP Postfix
>>>> HELO jim
<<<< 250 jim.lan.blackmouse.biz
>>>> MAIL FROM:<pkgsrc <at> blackmouse.biz>
<<<< 250 2.1.0 Ok
>>>> RCPT TO:<pkgsrc <at> blackmouse.bi>
<<<< 250 2.1.5 Ok
>>>> DATA
<<<< 354 End data with <CR><LF>.<CR><LF>
<<<< 250 2.0.0 Ok: queued as 317EF49DD89
>>>> QUIT
<<<< 221 2.0.0 Bye

Error is in RCPT TO: command, it shorts recipient email address. It's only doing, when recipient is write
like this key: "Some Name <email <at> domain.net>". If I write only email address: "email <at> domain.net" it
works fine.

root <at> jim# echo -e 'To:pkgsrc <at> blackmouse.biz\nFrom:Konference <pkgscr <at> blackmouse.biz>\nSubject:
test\n\ntest' | mini_sendmail -t -v -fpkgsrc <at> blackmouse.biz
<<<< 220 jim.lan.blackmouse.biz ESMTP Postfix
>>>> HELO jim
<<<< 250 jim.lan.blackmouse.biz
>>>> MAIL FROM:<pkgsrc <at> blackmouse.biz>
<<<< 250 2.1.0 Ok
>>>> RCPT TO:<pkgsrc <at> blackmouse.biz>
<<<< 250 2.1.5 Ok
>>>> DATA
<<<< 354 End data with <CR><LF>.<CR><LF>
<<<< 250 2.0.0 Ok: queued as 5479249DD89
>>>> QUIT
<<<< 221 2.0.0 Bye

I can't find which part of code do this error :(

--
Ondřej Tůma

Unix-like system is the best operation system from the top of the world.
I'm lucky BSD and linux user. :) Use unix-like, be free. :)

www.blackmouse.biz                                        hash.webjet.cz
ICQ: 107760454       JABBER: mcbig <at> jabber.cz      MSN: ondra.tu <at> atlas.cz
Christian Biere | 1 Dec 2006 09:58
Picon
Picon
Gravatar

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

George Michaelson wrote:
> I've since found that the gcc version is 4.1.1, and there are lvalue 
> cast related problems which are well understood, and indeed fixed on 
> some code, I may have a patch from gentoo which addresses this for nvi 
> I'd like to submit into pkgsrc. Interestingly, the NetBSD gcc doesn't 
> trip over this problem, I guess people realized that ANSI C fascism had 
> a downside and provided some way out of the problem

I suspect the uncalled for comment of a by-stander kind of provoked this
comment. Let me tell you, nvi from pkgsrc does not compile here on NetBSD
with GCC 4.1.2 at all. GCC created a mess by introducing the idiotic
concept of lvalue casts. They are just cleaning up their own mess. Don't
call them fascists, neither as a joke nor seriously. Most of these lvalue
casts are actually caused by accident in macros. I don't think anyone who
knows what he's doing ever used lvalue casts. Also GCC has emitted warnings
for such code for about one or two years.

--

-- 
Christian

George Michaelson | 1 Dec 2006 10:43
Favicon

Re: pkgsrc on fedora seems to need /bin/(ba)sh replaced by /bin/(k)sh

Christian Biere wrote:

> I suspect the uncalled for comment of a by-stander kind of provoked this
> comment. Let me tell you, nvi from pkgsrc does not compile here on NetBSD
> with GCC 4.1.2 at all.

my bad. I assumed it did. after all, the lvalue casts are all in one
file, dist/common/mem.h from what I can see. The gentoo fix looks 
applicable, thats what I intend submitting as a patches/ file.

 > GCC created a mess by introducing the idiotic
> concept of lvalue casts. They are just cleaning up their own mess. Don't
> call them fascists, neither as a joke nor seriously. 

oh dear. did I provoke a descent into godwins law? again, my bad. lets 
not go there.

 > Most of these lvalue
> casts are actually caused by accident in macros. I don't think anyone who
> knows what he's doing ever used lvalue casts. Also GCC has emitted warnings
> for such code for about one or two years.

um. Well, its in the 1.8x rev (since Keith Bostic) so I guess the other 
auther must be responsible. I wouldn't go casting assertions on Mr 
Bostic's coding skills...

-G
> 

Lasse Hillerøe Petersen | 1 Dec 2006 11:21
Picon

Re: mini_sendmail doesn't parse recipient corectly


Hi!

Your mail got me curious about what mini_sendmail was, and I took a look at
it. Jef Poskanzner usually writes great stuff, so I was surprised to see a
bug. Especially what looks like an "off-by-one" error.

It seems the error is not in the original code, but in patch-aa. I CC this to
pkgsrc-users, but you should probably file a PR with send-pr.

>Hi, i found error in mini_sendmail from pkgsrc, i didn't test on original d=
>istribution, only with pkgsrc patches.

>Error is in RCPT TO: command, it shorts recipient email address. It's only =
>doing, when recipient is write like this key: "Some Name <email <at> domain.net>=
>". If I write only email address: "email <at> domain.net" it works fine.

The bug is in mini_sendmail.c, remove or comment out line 600-601:

dog:../mini_sendmail-1.3.6 $ diff mini_sendmail.cBAK mini_sendmail.c    
600,601c600,601
<       if (recipient[len] == '>')
<           --len;
---
> /* THIS IS WRONG      if (recipient[len] == '>')
>           --len; END THIS IS WRONG */

Apparantly, someone must have gotten confused while fixing this code.

-Lasse

Martin Husemann | 1 Dec 2006 11:41
Picon

Re: mini_sendmail doesn't parse recipient corectly

Thanks, I commited this.

Martin


Gmane