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+s1045724n547842...@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 | patch 
-p1 -E
}}}
with everything on one line: fetch should feed its output to the patch utility.

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 specify
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
from 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.
-- 
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

Attachment: pgpiLf0Y8brBf.pgp
Description: PGP signature

Reply via email to