Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2012 12:25:26 +0400
From:      Eygene Ryabinkin <rea@freebsd.org>
To:        Bleakwiser <traebarlow@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: [CFT] Hadoop preliminary port
Message-ID:  <McnJ8989v1LoOhAusRWCCdEtqRc@ccIJq6nEuRe/NjgSGItUEiBW9ng>
In-Reply-To: <CAEVfBA9Yx8Bp-bUiWmZbum3dmGYLhMNVgobq2-e%2B06jaB1gNbw@mail.gmail.com>
References:  <20110808091432.GA16138@goofy.cultdeadsheep.org> <1329119043376-5478416.post@n5.nabble.com> <HWPffMLk/yCuhsOy2IZmsptEMik@ccIJq6nEuRe/NjgSGItUEiBW9ng> <CAEVfBA9Yx8Bp-bUiWmZbum3dmGYLhMNVgobq2-e%2B06jaB1gNbw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--TdkiTnkLhLQllcMS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sun, Feb 12, 2012 at 11:57:03PM -0800, Bleakwiser wrote:
> On Mon, Feb 13, 2012 at 1:49 AM, Eygene Ryabinkin-2 [via FreeBSD] <
> ml-node+s1045724n5478425h6@n5.nabble.com> wrote:
> > Sun, Feb 12, 2012 at 11:44:03PM -0800, Bleakwiser wrote:
> > > I know this isn't exactly the place for it but I really have no idea
> > what to
> > > do with this .diff file.
> >
> > Try
> > {{{
> > cd /usr/ports
> > fetch -o - http://people.freebsd.org/~clement/hadoop/hadoop-1.0.0.diff |
> > patch -p1
> > }}}
> > then go to the relevant port directory (devel/hadoop, I suppose)
> > and build the port.
>
> Kidding right?

No, I am dead serious.

> patch -p1 isn't even mentioned in the man pages.....

'patch -p1' can't be mentioned on the man pages, because 'patch' is
the utility and '-p1' is the argument to that utility.  Invoke 'man patch'
and look for '-p[number]'.

> And again, i've ran,
> > patch hadoop-1.0.0.diff
> Nothing happens, just blank cursor.

Well, it just happened that your mail reader broke the line starting
with 'fetch -o -' into two.  You should invoke the command
{{{
fetch -o - http://people.freebsd.org/~clement/hadoop/hadoop-1.0.0.diff | pa=
tch -p1 -E
}}}
with everything on one line: fetch should feed its output to the patch util=
ity.

By the way, I forgot the -E flag -- it could be needed too.

> For starters it isn't really clear what I'm even supposed to be applying
> the patch to.

I think that the Wikipage article about patch is a good thing to start from,
  http://en.wikipedia.org/wiki/Patch_%28Unix%29

In a nutshell, since you're doing 'cd /usr/ports', patchfile contents speci=
fy
that diffs are relative to the ports directory,
{{{
--- ports/devel/Makefile	30 Jan 2012 09:15:00 -0000	1.4819
+++ ports/devel/Makefile	1 Feb 2012 16:26:31 -0000
}}}
and -p1 instructs 'patch' utility to strip one directory level
=66rom the file names to be patched, you'll be patching every file
that is mentioned in the diff, but without the leading 'ports/'
prefix, and the base directory will be the $PWD (/usr/ports).

If you really want to understand, what files will be patched, then
here we go:
{{{
$ fetch -qo - http://people.freebsd.org/~clement/hadoop/hadoop-1.0.0.diff |=
 grep -E '^(---|\+\+\+) ' | grep -v /dev/null | awk '{print $2;}' | sort | =
uniq | sed -e's,^,/usr/,'
/usr/ports/GIDs
/usr/ports/UIDs
/usr/ports/devel/Makefile
/usr/ports/devel/hadoop/Makefile
/usr/ports/devel/hadoop/distinfo
/usr/ports/devel/hadoop/files/000.java_home.env.in
/usr/ports/devel/hadoop/files/datanode.in
/usr/ports/devel/hadoop/files/hadoop.in
/usr/ports/devel/hadoop/files/jobtracker.in
/usr/ports/devel/hadoop/files/namenode.in
/usr/ports/devel/hadoop/files/patch-build.xml
/usr/ports/devel/hadoop/files/patch-src__c++__libhdfs__hdfs.c
/usr/ports/devel/hadoop/files/patch-src__c++__libhdfs__hdfsJniHelper.c
/usr/ports/devel/hadoop/files/patch-src__native__Makefile.in
/usr/ports/devel/hadoop/files/patch-src__native__configure
/usr/ports/devel/hadoop/files/patch-src__native__configure.ac
/usr/ports/devel/hadoop/files/patch-src__native__src__org__apache__hadoop__=
io__nativeio__NativeIO.c
/usr/ports/devel/hadoop/files/patch-src__native__src__org__apache__hadoop__=
security__JniBasedUnixGroupsNetgroupMapping.c
/usr/ports/devel/hadoop/files/pkg-deinstall.in
/usr/ports/devel/hadoop/files/pkg-install.in
/usr/ports/devel/hadoop/files/secondarynamenode.in
/usr/ports/devel/hadoop/files/tasktracker.in
/usr/ports/devel/hadoop/pkg-descr
/usr/ports/devel/hadoop/pkg-plist
}}}

Again, the command, starting from 'fetch' and ending on 'sed'
must be on a single line.
--=20
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

--TdkiTnkLhLQllcMS
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iF4EABEIAAYFAk84yPYACgkQFq+eroFS7PuSqgD+IQs+a58ABU0Kl7S48wD4HOYi
QG0uU0ybpzc2C9+J89YA/0UJ+km69efD2WLOYR/gloU1IKfh0YTgW6gIJ9fuNQuQ
=5ELi
-----END PGP SIGNATURE-----

--TdkiTnkLhLQllcMS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?McnJ8989v1LoOhAusRWCCdEtqRc>