Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using Patch
« previous next »
  • Print
Pages: [1]

Author Topic: Using Patch  (Read 1958 times)

Offline Fatman

  • Member
  • *
  • Posts: 6
Using Patch
« on: January 06, 2008, 02:59:13 PM »
Im probably doing something silly...
Im trying to add a patch to the source ive downloaded via SVN:

patch < patchname.patch

I then get:

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: apps/misc.h
|===================================================================
|--- apps/misc.h   (revision 15901)
|+++ apps/misc.h   (working copy)
--------------------------
File to patch:

If i enter the filename exactly as listed in the Index value (apps/misc.h) then it works fine?

How can it not find the file, then when I type exactly the same path and filename, it finds it?

Logged

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Using Patch
« Reply #1 on: January 06, 2008, 03:04:23 PM »
Where is your patch file?  It should be in your checkout directory.

Also try with various p options

i.e.

patch -p0 < patch.patch
patch -p1 < patch.patch
etc.
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

Offline bascule

  • Rockbox Expert
  • Member
  • *
  • Posts: 1298
Re: Using Patch
« Reply #2 on: January 06, 2008, 03:05:50 PM »
It probably means you are running the patch command from a different place in the filetree that the patch was generated from. This where the -p option comes in useful.

From the Wiki:

http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling#Patching

The third bullet point explains the -p option
Logged
DataBase fanboy and author of the totally overhauled Rockbox Sync Tool

Offline Fatman

  • Member
  • *
  • Posts: 6
Re: Using Patch
« Reply #3 on: January 06, 2008, 03:54:55 PM »
I have the patch file in the same folder as ive check everything out to.
I have folder called rockbox - ls output below:

apps
bootloader
build
Build
Build
custom_splashV7.1.4.diff
dir.txt
docs
firmware
flash
fonts
gdb
manual
rbutil
tools
uisimulator
utils
wps

is this not where I should be running it from?
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using Patch
« Reply #4 on: January 06, 2008, 03:56:06 PM »
It's impossible to tell without seeing the content of the patch. Why not try with the -p options as you've been advised ?
Logged

Read The Manual Please

Offline Fatman

  • Member
  • *
  • Posts: 6
Re: Using Patch
« Reply #5 on: January 06, 2008, 04:41:14 PM »
the -p0 worked

So thats removed -0 directories from the path, why doesnt patch assume this?
Logged

Offline GodEater

  • Member
  • *
  • Posts: 2829
Re: Using Patch
« Reply #6 on: January 06, 2008, 04:56:32 PM »
No clue  :-\
Logged

Read The Manual Please

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Using Patch
« Reply #7 on: January 06, 2008, 05:00:02 PM »
If the path is /foo/bar/bob.c, -p0 looks for /foo/bar/bob.c (strips 0 /s), if you don't to a -p0, it simply looks for bob.c, in the folder you run it in.

Basically, it assumed "find it here" rather than "use the whole path." Really they could've gone either way with it, and this is the way least likely to cause accidental damage to files elsewhere.
Logged

Offline Fatman

  • Member
  • *
  • Posts: 6
Re: Using Patch
« Reply #8 on: January 06, 2008, 05:15:44 PM »
that makes sense!
Thanks
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Using Patch
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.091 seconds with 16 queries.