Reply
Thread Tools
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1781
Originally Posted by coderus View Post
best way is to have actual tree inside folder (c:\bla-bla\patches\my-super-patch\source\usr
c:\bla-bla\patches\my-super-patch\source\usr\share
etc.)
and use git in commandline or any tool, init folder and commit original files, and then you only need to produce git diff to file and output will be your final patch you can test in patchmanager directly.
Easy when you know how, eh

I'll try the method you describe in your previous post. I'm not familiar with 'git' and I don't fully understand (yet) what your describing here.
What is 'git diff'? - my brother is a git with a difference, but I'm sure that won't help me!

Thanks for info, I'll let you know how I get on, I'm sure I will have more questions.

I've eaten, so it's now time to get busy 'diffing'
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
pichlo's Avatar
Posts: 6,453 | Thanked: 20,983 times | Joined on Sep 2012 @ UK
#1782
It took me a while to type this and coderus has beaten me but since I spent so much effort typing it I will post it anyway even though it probably does not tell you anything new.

I second coderus' suggestion to copy the whole tree. Regarding git diff, there are other options. Some visual diff utilities (sadly, most of them for Windows) can compare whole directories but only to the point of showing you which files have changed. You still have to descend to each file if you want to see the line by line differences and/or produce a diff file. I would say the easiest and most obvious solution for you would be to find which files have changed and then diff them one by one, concatenating the diffs in a single unified_diff.patch file.

Have a look at some other patches that modify more than one file to see what unified_diff.patch looks like in such situations. For example, Remorse Items Timeout controls or Return old pulley menu.
__________________
Русский военный корабль, иди нахуй!
 

The Following 2 Users Say Thank You to pichlo For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#1783
 

The Following User Says Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1784
Originally Posted by pichlo View Post
It took me a while to type this and coderus has beaten me but since I spent so much effort typing it I will post it anyway even though it probably does not tell you anything new.

I second coderus' suggestion to copy the whole tree. Regarding git diff, there are other options. Some visual diff utilities (sadly, most of them for Windows) can compare whole directories but only to the point of showing you which files have changed. You still have to descend to each file if you want to see the line by line differences and/or produce a diff file. I would say the easiest and most obvious solution for you would be to find which files have changed and then diff them one by one, concatenating the diffs in a single unified_diff.patch file.

Have a look at some other patches that modify more than one file to see what unified_diff.patch looks like in such situations. For example, Remorse Items Timeout controls or Return old pulley menu.
Thank you Pichlo, for your time and effort creating this post, much appreciated.

I now cannot find or recall which diff command I had used before, silly me hasn't kept notes on it. What is the best command for diff, rather which options and output type - I see some output as a .txt file, while some output with .patch - what's best?
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1785
What's difficult?... Save original file as filename.ext.orig, modify filename.ext and make diff
cd /path_to_filename
diff -u filename.ext.orig filename.ext > unified_diff.patch

ext = extension, qml, f.e.
 
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1786
Right, so far, here's what I've got and I haven't yet tried to create patch with this output - it doesn't look right, it certainly does not look like any other patch file I've seen so far.

Any thoughts?, just try it I suppose and fail for the umpteenth time I guess.......

root@Jolla fonts]# diff -U0 /usr/share/fonts/roboto /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/roboto

Only in /usr/share/fonts/roboto: Roboto-Light.ttf
Only in /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/roboto: Roboto-Medium.ttf
Only in /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/roboto: Roboto-Regular.ttf
Only in /usr/share/fonts/roboto: Roboto-Thin.ttf


[root@Jolla fonts]# diff -U0 /usr/share/fonts/sail-sans-pro /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/fira-sans-pro

Only in /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/fira-sans-pro: FiraSans-Bold.ttf
Only in /usr/share/patchmanager/patches/sailfishos-bigger-system-fonts/sailfishos-bigger-system-fonts/usr/share/fonts/fira-sans-pro: FiraSans-Heavy.ttf
Only in /usr/share/fonts/sail-sans-pro: SailSansPro-ExtraLight.ttf
Only in /usr/share/fonts/sail-sans-pro: SailSansPro-Light.ttf

Not what I expected, where's all the +++ and the --- and wotnot? (I guess that's more about files not folders).....help!
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1787
Originally Posted by Ancelad View Post
What's difficult?... Save original file as filename.ext.orig, modify filename.ext and make diff
cd /path_to_filename
diff -u filename.ext.orig filename.ext > unified_diff.patch

ext = extension, qml, f.e.
I love these answers, lol - what's difficult? ME that's what!

I'm struggling Ancelad, simple as that, I don't fully get what I'm doing, my fingers are bleeding and my keyboard is drowning in blood!........

Save original file?, what file?, can you guys answer in laymans terms, I'm not a coder, I;m a Windows monkey of 20 years!, skilled in clicking coloured icons!, I don't know Linux!, coding, diffing etc........I'm getting there though, mm by mm.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#1788
 

The Following User Says Thank You to coderus For This Useful Post:
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1789
I can't explain what does 'original' means... Original = original, not modified, without changes... Original file is original in Windows such as in Linux...
 
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#1790
Ok, let's do it step by step...

1) Login into putty and winscp
2) Go to destination folder, for example, /usr/share/fonts
Code:
cd /usr/share/fonts
3) Decide, what file will be changed and copy it to backup, for example, file is Sans.ttf
Code:
cp Sans.ttf Sans.ttf.orig
4) Edit Sans.ttf as you want and save the file
5) Run
Code:
diff -u Sans.ttf.orig Sans.ttf > unified_diff.patch
This will create unified_diff.patch into /usr/share/fonts
6) Open unified_diff.patch and you will see something like this:
Code:
--- Sans.ttf.orig
+++ Sans.ttf
*some diff-code*
Edit it to
Code:
--- /usr/share/fonts/Sans.ttf
+++ /usr/share/fonts/Sans.ttf
*some diff-code*
And save patch...
 

The Following 3 Users Say Thank You to Ancelad For This Useful Post:
Reply

Tags
patchmanager, sailfish os


 
Forum Jump


All times are GMT. The time now is 13:00.