Re: Dynamic Window Manager install with patch(es)

2011-09-22 Thread Warren Block

On Thu, 22 Sep 2011, Matthew Seaman wrote:


On 22/09/2011 11:21, Andy Zammy wrote:

File to patch: files/patch-defaultopacity
No file found--skip this patch? [n] n
File to patch: /usr/home/user/Downloads/dwm.defaultopacity.patch
patch:  malformed patch at line 9: @@ -52,6 +54,9 @@
=> Patch patch-defaultopacity failed to apply cleanly.


Um.. when it says 'file to patch', it means it wants the name of a file
to apply the patch /to/, not the file to read the patch /from/.  There
are some requirements about relative paths in the diff file that I
entirely glossed over when I mentioned adding patches to the files
directory; unfortunately not all patches will 'just work' (tm).

[[ Do this next bit after unpacking the distfiles but before building
the port.  ie. after running these commands:

  # cd /usr/ports/x11-wm/dwm
  # make clean ; make extract

]]


Or after 'make patch', so the port patches have already been applied. 
Of course, port patches and manual patches can interfere with each 
other.

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


Re: Dynamic Window Manager install with patch(es)

2011-09-22 Thread Matthew Seaman
On 22/09/2011 11:21, Andy Zammy wrote:
> File to patch: files/patch-defaultopacity
> No file found--skip this patch? [n] n
> File to patch: /usr/home/user/Downloads/dwm.defaultopacity.patch
> patch:  malformed patch at line 9: @@ -52,6 +54,9 @@
> => Patch patch-defaultopacity failed to apply cleanly.

Um.. when it says 'file to patch', it means it wants the name of a file
to apply the patch /to/, not the file to read the patch /from/.  There
are some requirements about relative paths in the diff file that I
entirely glossed over when I mentioned adding patches to the files
directory; unfortunately not all patches will 'just work' (tm).

[[ Do this next bit after unpacking the distfiles but before building
the port.  ie. after running these commands:

   # cd /usr/ports/x11-wm/dwm
   # make clean ; make extract

]]

For your purposes, first work out how to apply the patch by hand --
ie. running some variant of the command lines

   # cd /usr/ports/x11-wm/dwm/work
   # patch -p0 < ~/downloads/dwm.defaultopacity.patch

However, it seems the patch you've obtained is somehow corrupt.  If it's
not too long, you could post it here, or put it on the web somewhere for
people to look at (pastebin springs to mind).

Once the patch applies cleanly you should be able to continue with
building and installing the port as usual:

   # cd /usr/ports/x11-wm/dwm
   # make ; make install

If you want the low-down on adding patches to a port, start by reading
this section of the Porter's Handbook:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/slow-patch.html

Then take a look at the handy patchtool helper script in
/usr/ports/Tools/scripts/patchtool.py -- the README.patchtool file in
that directory will be more accessible if you aren't fluent in python.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Dynamic Window Manager install with patch(es)

2011-09-22 Thread Andy Zammy
I see, then in that case I don't think I'm doing anything wrong. Here is the
output of make:

# make
You can build dwm with your own config.h using the DWM_CONF knob:
make DWM_CONF=/path/to/dwm/config.h install clean
Note: Pre-5.6 config.h-files no longer work.
===>  License MIT accepted by the user
===>  Found saved configuration for dwm-5.9
===>  Extracting for dwm-5.9
=> SHA256 Checksum OK for dwm-5.9.tar.gz.
===>  Patching for dwm-5.9
===>  Applying FreeBSD patches for dwm-5.9
File to patch: files/patch-defaultopacity
No file found--skip this patch? [n] n
File to patch: /usr/home/user/Downloads/dwm.defaultopacity.patch
patch:  malformed patch at line 9: @@ -52,6 +54,9 @@
=> Patch patch-defaultopacity failed to apply cleanly.
=> Patch(es) patch-Makefile patch-config.mk applied cleanly.
*** Error code 1

Stop in /usr/ports/x11-wm/dwm.
*** Error code 1

Stop in /usr/ports/x11-wm/dwm.
--

Like I say I don't know how patch or diff work but it's strange how it needs
pointing to the patch again?

On 22 September 2011 08:05, Matthew Seaman
wrote:

> On 22/09/2011 00:51, Andy Zammy wrote:
> > According to the instructions listed here:
> http://dwm.suckless.org/patches/ I
> > figured I'm to use the "tarball method" as that's how ports fetches dwm.
> I
> > tried applying the method to /usr/ports/x11-wm/dwm/work/dwm-5.9 but it
> > didn't work (malformed patch).
>
> This is pretty much the correct approach.  Although to do it in the best
> ports fashion, you'ld save the patch file to
> ${PORTSDIR}/x11-wm/dwm/files/patch-something-or-other and then the ports
> would patch the sources for you automatically any time you rebuilt the
> port.  Don't worry about that for the time being though.  Just getting
> the patch to apply by hand is a good first step.
>
> It's quite normal for ports to apply patches this way -- the dwm port
> already has patches for Makefile and config.mk.  If your patch attempts
> to patch those same files it could fail.  However the error message
> would be 'patch failed to apply' which is obviously not what you're
> getting.
>
> The big question is why the patch you already have appears to be
> malformed.  How did you obtain it?  Can you repeat the process paying
> attention to any error messages and so forth and see if that works better?
>
> > I've used ubuntu for about a year but for all intents and purposes I'm
> still
> > a beginner with UNIX-like, and I've never used patch or diff before. But,
> I
> > remembered that these are ports and wonder if these patches would work on
> > FreeBSD source? Would I have to apply the patch to the tarball while it's
> in
> > distfiles before it gets 'ported' to freebsd? Or am I talking crazy?
>
> No -- modifying the tarball is possible, but as the effect is exactly
> the same as what you tried above and as it will then fail the checksum
> tests, well, it's not worth the bother.
>
> patch and diff at this level work in exactly the same way on just about
> any unix (eg FreeBSD) or unix-alike (Linux including Ubuntu) and
> probably a few weird OSes you've never heard of.  Like I said, applying
> patches is a common action the ports will do for you.
>
>Cheers,
>
>Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
>  Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
> JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
>
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Dynamic Window Manager install with patch(es)

2011-09-22 Thread Matthew Seaman
On 22/09/2011 00:51, Andy Zammy wrote:
> According to the instructions listed here: http://dwm.suckless.org/patches/ I
> figured I'm to use the "tarball method" as that's how ports fetches dwm. I
> tried applying the method to /usr/ports/x11-wm/dwm/work/dwm-5.9 but it
> didn't work (malformed patch).

This is pretty much the correct approach.  Although to do it in the best
ports fashion, you'ld save the patch file to
${PORTSDIR}/x11-wm/dwm/files/patch-something-or-other and then the ports
would patch the sources for you automatically any time you rebuilt the
port.  Don't worry about that for the time being though.  Just getting
the patch to apply by hand is a good first step.

It's quite normal for ports to apply patches this way -- the dwm port
already has patches for Makefile and config.mk.  If your patch attempts
to patch those same files it could fail.  However the error message
would be 'patch failed to apply' which is obviously not what you're getting.

The big question is why the patch you already have appears to be
malformed.  How did you obtain it?  Can you repeat the process paying
attention to any error messages and so forth and see if that works better?

> I've used ubuntu for about a year but for all intents and purposes I'm still
> a beginner with UNIX-like, and I've never used patch or diff before. But, I
> remembered that these are ports and wonder if these patches would work on
> FreeBSD source? Would I have to apply the patch to the tarball while it's in
> distfiles before it gets 'ported' to freebsd? Or am I talking crazy?

No -- modifying the tarball is possible, but as the effect is exactly
the same as what you tried above and as it will then fail the checksum
tests, well, it's not worth the bother.

patch and diff at this level work in exactly the same way on just about
any unix (eg FreeBSD) or unix-alike (Linux including Ubuntu) and
probably a few weird OSes you've never heard of.  Like I said, applying
patches is a common action the ports will do for you.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature