VectorLinux
July 23, 2014, 07:26:50 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [SOLVED] Generating patches for patch -p1 (strip)  (Read 1148 times)
roarde
Vectorian
****
Posts: 519


move the needle


« on: December 23, 2013, 02:44:58 pm »

What Huh?

OK, did a bit of looking and here's what I get. Please let me know whether it's right.

Hypothetically, I'm packaging  flurb 0.1. It has two problems: It blurfles, and a config path not correct for VL is hardcoded into the Makefile.
Because these are two different issues, I should create two separate patches.

I unpack the tarball into my working directory, resulting in flurb-0.1/ and its subdirectories . . . and begin.
Code:
me: $ mkdir flurb-0.1.blurflepatch                  # Make a directory for blurfle fixing
me: $ cp -a flurb-0.1/* flurb-0.1.blurflepatch      # Copy original source there
me: $ mkdir flurb-0.1.config-path-patch             # Separate directory for config path work
me: $ cp -a flurb-0.1/* flurb-0.1.config-path-patch # (there are other ways)
#Edit files in text editor
me: $ nano flurb-0.1.blurflepatch/examples/flurbrc  # Make changes and save
me: $ nano flurb-0.1.config-path-patch/Makefile
# Make no other changes for now.
# The crux of the question:  ###################################################################~
me: $ ls ;                                       # Run diff from original working directory     #
flurb-0.1/                 flurb-0.1.blurflepatch/     flurb-0.1.config-path-patch/             #
                                                                                                #
diff -Naur flurb-0.1 flurb-0.1.blurflepatch >flurb-0.1-blurfle.patch                            #
diff -Naur flurb-0.1 flurb-0.1.config-path-patch >flurb-0.1-config-path-VL.patch                #
# That one's slack-specific, so I chose to tag it "VL"                                          #
Diff compares everything in flurb-0.1/ to what's in flurb-0.1.blurflepatch/ and outputs the differences between the files (just one, here) to the patch. Same thing for config path fix. I now have two patches ready to copy to my submission's src/patches.
Am I right?

Of course there are other ways to do these particular patches without copying over the whole source, etc. I'm just trying to get the basics down.

So the question is, will using diff this way result in valid patches ready for 'patch -p1 <(patchfile)' as used by sbbuilder-generated SlackBuilds?
« Last Edit: December 23, 2013, 05:36:20 pm by roarde » Logged

Robert
VL STD 7.1 RC2.2.2, icewmvmods
hata_ph
Packager
Vectorian
****
Posts: 3256


-- Just being myself --


« Reply #1 on: December 23, 2013, 04:17:16 pm »

that I wound do...use diff -u to make a patch and use patch -p1 to apply it
just remember to include the correct path in your patch files...see below example highlighted part

Quote
commit bd70d4e589711fda9ab07738c46e37eee8376214
Author: David Faure <faure@kde.org>
Date:   Thu Jun 30 23:43:45 2011 +0200

    Security fix: don't interpret html tags
   
    Credits to Tim Brown for the find.

diff --git a/kio/kssl/ksslcertificatebox.cpp b/kio/kssl/ksslcertificatebox.cpp
index 4ffc613..094787a 100644
--- a/kio/kssl/ksslcertificatebox.cpp
+++ b/kio/kssl/ksslcertificatebox.cpp

@@ -36,6 +36,10 @@ KSslCertificateBox::KSslCertificateBox(QWidget *parent)
    d(new KSslCertificateBoxPrivate())
 {
     d->ui.setupUi(this);
+    // No fooling us with html tags
+    Q_FOREACH(QLabel* label, qFindChildren<QLabel *>(this)) {
+        label->setTextFormat(Qt::PlainText);
+    }
 }
Logged
roarde
Vectorian
****
Posts: 519


move the needle


« Reply #2 on: December 23, 2013, 05:12:10 pm »

OK, that seems to verify how to run diff (well, basically) and from where. It also suggests prepending info about the diff -- good idea.

The example was apparently run from an hg (Mercurial) repo using the hg command "diff", which is instructed by its single flag, "--git", to do the diff in the way that the CVS tool "git" would do it by default.

Which is a lot for me to wrap my head around, as CVS's haven't really been touched on here. Since the submission is to a git repo, using "git diff" will (should) be common.

But for me to grok this, what I need to know now is what flags to feed the standard diff command so that it mimics "git diff" default. Git's git-diff(1) says that's just "-u", but I'm not so sure.
Logged

Robert
VL STD 7.1 RC2.2.2, icewmvmods
hata_ph
Packager
Vectorian
****
Posts: 3256


-- Just being myself --


« Reply #3 on: December 23, 2013, 05:23:14 pm »

Just use diff -u original.files altered.files > patch to generate your patch files.
I attached the example just to show your about the path...
Try it on the slackbuild and play the command will help you understand more about it

PS: Sorry about the confusion about the diff --git issue
Logged
roarde
Vectorian
****
Posts: 519


move the needle


« Reply #4 on: December 23, 2013, 05:35:34 pm »

That pretty much covers it, especially "Try it [ . . . ] and play".

Thanks, hata_ph
« Last Edit: December 23, 2013, 05:40:45 pm by roarde » Logged

Robert
VL STD 7.1 RC2.2.2, icewmvmods
hata_ph
Packager
Vectorian
****
Posts: 3256


-- Just being myself --


« Reply #5 on: December 23, 2013, 05:39:22 pm »

Have fun Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!