
Perl Regex Removed From Grep in Mountain Lion - superchink
http://www.dirtdon.com/?p=1452
======
js2
<http://wiki.freebsd.org/BSDgrep>

_BSD grep has been imported to 9.0-CURRENT on July 22, 2010. It has been
obtained from the OpenBSD and the FreeGrep projects to make it appropriate for
our needs to provide GNU compatibility and let ports build without problems.
GNU compatibility is almost 100%, the only missing feature is -P (--perl-
regex), which is not possible to support without having PCRE in base system
and anyway, it was disabled in GNU grep for the same reason._

Somewhat ironic as OS X includes PCRE. Not sure why Apple didn't stay with
GNUgrep.

~~~
Hemospectrum
Since the introduction of the GPL3, there's been a steady purge of GNU
software from OS X. This is why Apple's GCC, bash, etc. are stuck at old
versions lacking a variety of useful features.

I'm kind of curious what they'll do about Emacs. It doesn't have a BSD-
licensed counterpart like everything else they've removed... Maybe they'll
just leave it out.

~~~
smosher
_Since the introduction of the GPL3, there's been a steady purge of GNU
software from OS X._

Is it all GNU software that's being purged, or just the GPLv3 licensed stuff?
If the latter, I can't say I blame them. The former case can go either way but
I guess it's good to future-proof early.

~~~
Hemospectrum
As far as I know, _all_ GNU software went to GPLv3. Literally all of it. Even
things with no substantial updates since 2007.

~~~
gizmo686
Isn't (one of) the points of the GPL that you cannot change the licensing of
the software?

~~~
Hemospectrum
Short answer: Not quite.

Long answer: One of the conditions for contributing code to the GNU project is
assigning copyright to the FSF. That means they're legally the sole copyright
holders for all software they distribute. The official reason for this is so
they can pursue GPL violations in court without involving the actual authors
of the code. It also permits them to change the license on any of their
software. Finally, there are various reasons they might be able to do this
anyway even if they didn't have the copyright assignment rule, so long as the
new restrictions didn't conflict with whatever license the original software
was distributed under.

~~~
pooriaazimi
So, in theory, FSF can overnight change the license of all GNU softwares to
shareware and sell them?

That's really fucked up. (I trust they won't do such a thing, but I didn't
think such a thing could be possible)

~~~
bluedanieru
Well it's more likely than you might think over a span of a couple decades...

But, I _think_ if they were to go rogue it would be a matter of forking a GPL-
licensed version of the software and continuing development on that under an
open license.

~~~
jkn
I don't think it is likely at all even in decades, and if they did they would
be sued by loads of contributors for violating their binding promise to adhere
with free software spirit in future licenses. You get some guarantees when you
assign your copyright to the FSF.

And all this is ignoring that most GNU programs are licensed under a GPL
variant _and_ any future version, so they would not need the copyright to
upgrade the license anyway.

~~~
bluedanieru
I'm not saying it's a thing that's going to happen, just that you shouldn't
have some blind faith that it won't ("I trust they won't do such a thing").
I'm pretty sure RMS would agree with the sentiment.

------
zem
something i'm curious about - for linux fans who have made the switch, is osx
an "acceptable unix"? people keep trumpeting the fact that it combines the
best of both worlds, a seamless gui experience atop a full-fledged posix core
complete with a bash prompt you can drop down to as easily as you can in
linux, but philosophically it seems that for the little things like package
management, command line utilities, etc., the experience is closer to cygwin
than it is to linux proper - you can do it, sure, but it will involve falling
back to a third-party ecosystem.

~~~
mynegation
I may be a Linux fan, but there you go: Mac OS X as Unix is inferior to Linux.
Package management in Ubuntu is second to none, I have newer version of
everything, sane terminal colors and fonts out of the box, I don't have to
download monstrosity that is Xcode just to get a damn compiler, compiling some
non-mainstream sources may not work out of the box.

~~~
dfc
Package management in Ubuntu is not second to none, it is second to Debian.
Dont get me wrong Ubuntu has done a lot of wonderful things, but lets give
credit where credit is due...

~~~
mcpherrinm
I'd actually disagree on this point.

Ubuntu has introduced a number of refinements to the dpkg world that have been
pretty good.

Most useful, in my mind, is their set of tools for working with PPAs. They're
much simpler to run than setting up an entire new repository of packages.

~~~
dfc
Seriously? You think that PPAs and your other unnamed improvements tower over
the apt package management system? Without PPAs apt-get would be yet another
kludgy package management system? Sure apt-add-repository is a nice time saver
but how hard is:

    
    
      echo deb http://repo.net/ unstable main >> /etc/apt/sources.list
    

I think we might be miscommunicating because I can't imagine anyone making
this argument. I'm not sure how old you are but I can remember what package
management was like on slackware and redhat a decade ago when I switched.
Moving to debian was like a scene in a movie when it goes from black and white
to full color.

~~~
mcpherrinm
With respect to PPAs, I'm not speaking from a user perspective, but from that
of a sysadmin having to maintain mirrors. PPAs are just easier than setting up
all the key signing and mirror infrastructure.

Yeah, apt and dpkg are great compared to what else was available a decade ago.
But that doesn't mean that Ubuntu's additions, however incremental, are
worthless or somehow inferior to Debian. Incremental gains are still gains.

~~~
dfc
I'm confused about PPAs and setting up a mirror infrastructure. What mirror
infrastructure? What key signing is involved in a mirror that is not involved
in signing packages for a PPA?

Ubuntu's additions are nice. But they are minor improvements to apt/dpkg.
Without them apt and dpkg would still be phenomenal.

~~~
mcpherrinm
I administer a small number of systems and deploy custom packages to all of
those.

Running a custom mirror, signing packages, managing keyrings on the mirror,
and getting them on all systems is nontrivially harder than using a PPA and
associated scripts.

Now, I run a mix of Ubuntu and Debian systems. I don't use PPAs that much, but
when I do they're just plain easier.

Yes, it's an incremental gain, but that's a gain. It makes them better. They
weren't first, but they're innovating. Sometimes, the "innovations" aren't
fantastic especially some of the more harebrained stuff on desktop
(PulseAudio, avahi). But no longer is Ubuntu just a Debian rip-off: They're
producing new and useful additions.

The relative merits are debatable, and so I'm not going to continue that
thread. In the end, it boils down to X + epsilon > X, for any epsilon > 0.

------
cefstat
Apparently pre-10.8 the grep program that came with Mac OS X was GNU grep.
10.8 comes with BSD grep.

~~~
hollerith
It's definitely GNU grep on 10.7.5.

------
lutusp
This contradicts a clear historical trend in which Perl regex syntax and POSIX
regex syntax (not the same) are being more widely adopted as time passes. It's
a definite step backward.

~~~
Hemospectrum
This wasn't a deliberate decision on Apple's part to remove this particular
functionality. Rather, they switched to a different implementation of grep
(BSD instead of GNU) and it leaves out PCRE support by default. If word of
this gets back to whoever made the change, it should be a simple matter to
reenable it for future versions of OS X.

------
jevinskie
This bit me in our "golden file" checking portion of our product's test suite.
I moved the golden file checking regex to a Perl script. Apple's obsession
with removing GNU utilities has been annoying but I suppose the test suite
should have taken grep portability problems into account.

~~~
james2vegas
Yes it should have. You could still run into problems as PCRE regexes are not
quite the same as Perl regexes. Why not just check for and use pcregrep?

