Create a patch?

Wittfella has kindly made a special piece of code, just for me, for his great filemanager Qtfm. I can apply it manually with the aid of nano. and it compiles fine. But, I've tried to make a patch with diff and patch but it is a bit over my IQ. Somehow I managed to reverse the patch and so destroyed the special code (backups are great).
Scenario;
Doc 1; special mainwindow.cpp complete or just with code snippet I need.
Doc 2; Qtfm newest source mainwindow.cpp
Desired result; put the code snippet from the special mainwinow.cpp into the new mainwindow.cpp, either from the complete file or a file with just the appropirate code sequence/snippet.
Of course, at one point the new code will change so that the special code snippet won't work anymore. But that's far off in the future.
Any hints are appreciated.

.:B:. wrote:
$ diff -Naur $file1 $file2 > $patch
should work fine in most cases.
One thing I am confused about patches are, when using 'git diff' generated patches I have to do 'patch -Np1' while for other patches I have to use 'patch -Np1'. I don't understand the difference between -Np0 and -Np1 and the whole strip lines concept.

Similar Messages

  • How to correctly create a patch file?

    Hi,
    I'm wondering what is the correct way to create a patch file for use in a PKGBUILD build function.
    I have tried doing the following:
    1) copy the file I want to patch (a Makefile) to Makefile.old in the same directory
    2) edit the original Makefile
    3) from that directory, run: diff -u Makefile.old Makefile > Makefile.patch
    4) move Makefile.patch into the directory containing the PKGBUILD, and add it to sources
    5) inside the build function, cd to the directory where the original Makefile is unpacked to ($srcdir/odamex-src-0.4.4), and run: patch -Nup0 < $srcdir/Makefile.patch || return 1
    6) run makepkg, and the patch is not applied, giving an error and aborting the build:
    Hunk #1 FAILED at 283.
    1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
    So, my question is, how do I do this properly?
    Thanks,
    Kladiin

    Example for individual file
    $ diff -Naur filename.ext.old filename.ext > filename-patchname.diff
    # PKGBUILD
    cd "${srcdir}/${pkgname}-${pkgver}"
    patch -uN filename.ext ../filename-patchname.diff || return 1
    Example for multiple files
    $ diff -Naur package-ver.old package-ver > package-patchname.diff
    # PKGBUILD
    cd "${srcdir}/${pkgname}-${pkgver}"
    patch -uNp1 -i ../${pkgname}-patchname.diff || return 1
    Last edited by anrxc (2010-02-18 03:57:29)

  • How to create a patch with enhancements

    Hi all,
              I need to create a patch of latest enhancements and deploy that patch in the webconsole.  So, I want to know the process or steps of creating a patch .
    Thanks & Regards,
    Ravi

    Hi Ravi
       You dont require the Mobile Component Descriptor file. What this tag says is that Application name and version would be the name of the MCD and the version you would have entered at the time of uploading the file in the web console.  This information is also available in the INFO page within the Client Home page.  Example for this tag is given below
    <PREREQ>
    <APPLICATION name="MobileEngine_JSP" version="2514" prefixmatch="true" comparator="greater_equal" />
    </PREREQ>
    Hope this helps
    Best Regards
    Sivakumar

  • Using samples to create a patch in Logic?

    Say, for example, I wanted to create a patch using a sound I recorded. Does Logic express have any way to do that? Or say I wanted to create a patch that has individually recorded drum hits or something like that. I'm getting it today, so I have no experience with it yet. Just putting that out as a disclaimer.

    If you have a wave file or aiff or similar file, you can use Logic Pro's sampler (EXS24) to create a patch. It is not hard to do, but it probably won't come out clear if I try to explain it here. Basically, open an instance of EXS24 on an audio instrument track, in the edit window, create a new instrument, map the sample to a key zone, and voila. For detailed info, just read the Plugin Reference Manual. There is a good explanation in the EXS24 section.

  • How can I do "pkgupdate" and/or create private patch clusters?

    I hope this is the right forum for this post :)
    I maintain a number of Solaris 8-10 systems which are automated by my scripts
    (i.e. for dumping data to a backup server, watchdog the services, start up portal
    services, etc.)
    Long ago I made my life easier by creating such scripts; then I made it easier by
    packaging these scripts into thematic Solaris packages (as in pkgadd/pkgrm).
    Since this concerns maintaining older systems, references to the new OpenSolaris
    Indiana Packaging System are not interesting.
    Now I want to simplify maintenance and update of such packages by building a
    patch cluster of them. In short, there should be one archive to copy to all these
    servers and one command to run (i.e. patchadd), and it should reinstall only(!)
    those of my script packages which are already installed.
    An interim solution would be to come up with a sort of "pkgupdate" utility which
    REinstalls only the existing package instances which are older than the one I
    currently provide (perhaps someone can share a pkgadd admin file with options
    to force such behavior?)
    I guess I can script up another solution for this automation as well, but I wonder
    if this wheel is already invented? It actually is, with the Sun-provided patch clusters
    proving that, but I've not seen any tools to create such clusters myself :)
    This is particularly important while maintaining a Solaris 10 system with lots of
    Solaris zones. Having different tasks, these zones are configured with different
    sets of my packages. Simply running pkgrm/pkgadd in the global zone would
    result in all zones having all of these packages, and I don't want that since I
    believe in specialization and minimization. And checking each zone is rather
    tedious, there's lots of them.
    Looking forward to constructive suggestions,
    //Jim
    Edited by: JimKlimov on Dec 2, 2008 7:47 PM

    Can you expand on that? How do you use automator in your game? Can you give me a rough idea of how and what you do with it? I have watched a tutorial on Automator and it seems more useful for documents.

  • Simple 'create a patch from subversion' script

    This script was written for a specific use, in a specific environment:
    here's the setup:
    You have a (development) PHP project under subversion source control, and another, un-versioned (live) copy.  You make changes to the development version, committing them to the repository as you go, until you're happy with your changes, then you want to copy any files that have changed since revision X (the last time you moved things across) from the development project into the live site.
    This script gets any modified / added files from revision X upwards from the repository and puts them (preserving the directory structure) into a directory called 'patch-rX'.  You can then just drop these into your live site to 'patch' it to the latest revision.
    It's not particularly elegant, and it doesn't deal with files that are removed from the repository (I'd have to parse the 'status' bit of each line, find out what's happened to the file and so-on) but as a quick and dirty hack it works quite well.
    run it like this:
    make patch.sh REVISION URL
    where REVISION is the lowest revision number to get changes from and URL is the url of your repository.
    #!/bin/bash
    #make patch.sh
    #by Paul B
    #[email protected]
    #simple script to make a very simple patch from a repository
    #call with make patch.sh REVISION URL
    #REVISION should be the lowest revision to get changes from, script gets all changes from REVISION to HEAD
    #URL is the url of your repository
    #eg: make patch.sh 750 svn://redmine.tyrrellsystems.com/tms/tms_dev/Trunk
    #first we need to get a list of changes since requested revision
    svn diff -r$1 $2 --summarize > filelist.txt
    #now remove the repo information from each line, so we're just left with the path from the root upwards
    sed -i "s#$2# #g" filelist.txt
    sed -i "s#M # #g" filelist.txt
    sed -i "s#A # #g" filelist.txt
    #now loop through what we've got
    #create the relevant folder, and export the file into it
    for i in $(cat filelist.txt);
    do
    filename=$(basename $i);
    path=$(dirname $i);
    mkdir -p patch-r$1/$path
    svn export --force $2/$path/$filename patch-r$1/$path/$filename
    echo "$filename";
    done

    This sounds similar to svn-export. Perhaps you would find that useful as well.

  • Create rpd patch using command line?

    Does anyone know of a way to create an xml patch file from the difference between 2 rpds using the command line?
    Thanks

    This lead me down the right track.  I found the command comparerpd that did the trick.
    Thanks

  • Creating application patch

    Hi all,
    We (my team and I) are relatively new in APEX. We start development of one application in APEX for few of our customers and we are in front of two problems:
    1. after each milestone we must create patch from development version and apply it onto QA-version and if it's OK - to the production versions (we have separate production version for each of our customers)
    2. each of out customers have slightly different requirements (in interface only) and we don't want to have separate development ( and QA) version for each customer.
    I need some tips and tricks (opinions and advices) about APEX projects development flow: dev - test - deploy - update and customization ( to achieve most of the differences in GUI with some sort of configuration settings)

    Hi Peter
    Thank you for confirming what is required!
    All the best
    Phil

  • How do I create custom patch lists for external synths?

    Hello peeps, I'm a long-time Cubase user trying out Logic for the first time. This is driving me crazy. Just want to know how to make Logic show synth patches for a JP 8000, an MS 2000, MC 505, or any other external synth; so that I can see, in Logic, the patch I want a certain synth to switch to. I've tried in the environment to name a few, but I don't know where to input the MSB, LSB, Program change info. Its right there in the inspector window in Cubase. How do I do this in Logic? I'm stumped.

    "Example: In my RS 7000 Fat Bass 1 is MSB 063, LSB 007, PC 007. How do I enter that in Logic?"
    That's the problem: you don't. Or I couldn't, not in the rational way you're (quite rationally) suggesting.
    If you go to the Environment window and create an external multi-instrument and double-click its header (title) bar, you'll see a drop-down menu for Bank, and another for Bank Message. I had to experiment with the Bank Message possibilities, because the Roland manual says Bank Select is "controller 0, 32" and LE8 makes you choose between those two (or choose the method of some similar product, though the similar ones aren't very similar to each other!). Pick a plausible one, and then initialize a bunch of banks in the Bank menu and see what sounds your keyboard produces. Try to match those up, by ear, with the sound banks listed in the manual for your external synth. When you find a Bank Message/Bank pair that produces something recognizable, try other banks and see if they fall into line also. If not, try again with a different Bank Message choice.
    Once you find a Bank Message that produces reasonable results with several Banks, then you start double-clicking patch names within each bank and typing in names. It's a really stupid process. If there's a better one, I couldn't find it.
    On the good side, once you've got the banks of patches all set, the whole package is transferable from one project to another through the Import Environment menu item. Which means, by the way, that you might want to do all this in a new, blank project that contains nothing but your external multi-instrument environment item.
    Good luck--meaning I hope you had better luck than I did. It took several hours. If you want a bright side: it sure familiarizes you with all the sounds in your synth.
    Message was edited by: Charles Hartman

  • Creating a patch for Solaris?

    Hi -
    My company has an application that we ship as a Solaris package - ie, it's installed with Solaris's pkgadd command. I'm trying to write a patch for that app and would like to package the patch in a format usable by Solaris' patchadd command. Anyone know if there is documentation available on how to do this?
    Thanks,
    mike

    Hi Mike,
    The section on "Patching Packages" in Chapter 6 of the "Application Package Developer's Guide" would be helpful.
    Below is the link to the section for the Solaris 10 doc:
    http://docs.sun.com/app/docs/doc/817-0406/6mg76sth4?l=en&a=view
    Hope this is going to be useful for you.
    Have fun.
    Regards
    S.T.

  • How to create the patch file for Printer installation?

    Hi,
    Recently I bought a network printer and really want to install printer via the batch file, but I don't know how and what command needs to be typed in Notepad.
    Could you please give me some templates for this?
    Thanks,

    Hello avocado0227,
    Please take a look at the following thread about Batch File to install printer.
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/372a3334-904e-4506-a63d-20ccd487ff05/batch-file-to-install-printer?forum=ITCG
    As you want to use the batch file to install printer, to receive better support, it is recommended to post in the TechNet script forum.
    The professionals there will be glad to help you.
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Thanks for your understanding.
    Best regards,
    Fangzhou CHEN
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How do you create a patch?

    Real-life (but not necessarily interesting) story:
    1. I download the Karmen windowmanager.
    2. I make some changes to the source code
    3. I want to submit a diff to sourceforge so they can consider including my changes.
    How do I do step 3?
    -dav7
    Last edited by dav7 (2008-10-11 06:58:40)

    Profjim wrote:Where is this "man" forum I keep hearing about? The guys over there sound really helpful!
    Man Forums

  • How to create patched MSI?

    Hello,
    I want to deploy the current Adobe Reader Security Update 9.3.2. So I first want to create a patched MSI. Here my steps:
    1. Download Adobe Reader 9.3.0 and Security Update 9.3.2
         --> AdbeRdr930_en_US.msi
         --> AdbeRdrUpd932_all_incr.msp
    2. Copy both files to C:\MyFolder
    3. Apply patch to MSI
         --> msiexec /p AdbeRdrUpd932_all_incr.msp  /a AdbeRdr930_en_US.msi /qb
    4. Install Adobe Reader using the modified AdbeRdr930_en_US.msi. When I check Help-->About ... On this splash  screen it shows 9.3.2....that's fine
         Now I take the mouse pointer to the  position on splash screen where 9.3.2 is written and click. After  clicking I see a different version 9.3.0.148.
    So my question is why?
    I need to build a correct patched MSI to deploy it using System Center Essentials/WSUS. I do not want to deploy using Group Policy!
    Any ideas?
    Best regards.

    The response in post http://forums.adobe.com/message/2739050#2739050 might be what you are looking for.

  • Questions on Patch Deployment - From older post.

    Almost a year ago I had a post with questions on the patch scan process.
    https://forums.novell.com/novell-pro...s-updates.html
    I have been reviewing my patch process again due to Student laptop's getting re-imaged this summer. I am hoping I can get some additional information based off the replies from that post.
    1. It was stated that monthly patch bundles were created and deployed. I am unsure how that is best accomplished. If I create an all Microsoft (Windows 7 for example) Patch bundle for each month, yet the workstations it is deployed to may not require the patch, would this not cause the bundle to fail? If it just fails on that section will the remaining patch's continue to deploy?
    What is the best way to deploy a monthly patch bundle? In the past I would create a patch bundle through the Patch Management area for Windows 7 but assign to only a single workstation and then go back and assign to the Windows 7 group as a "run on ref" option. Is it better to assign the patch bundle to all nonpatched devices? If this is done will a system that is reimaged and no longer has the patch or a new system created after the bundle create be automatically assigned said bundle?
    Any other good strategies for patching systems? I create custom bundles for Adobe, Java, and Quicktime to ensure I control how they are deployed. Java seems to be one that works better when older versions are not installed. This method seems to be working well for those products. It is my MS Windows updates that are way off the mark. I have most of my systems with 60 to 80 patches reported ready. No matter how many times I deploy the patches they never seem to report as patched on the devices (Even tho the bundle reports back as successful). I am getting ready to start an SR since I think this is an issue with the server since so many of my systems are doing this. Good deployment procedures would be nice since I really hate to mess with my Universal WIndows image since it is working so well. Recreating it just to patch it with the latest Windows Updates would be pain.
    Thanks
    Richard

    rhuhman,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Patch 20133080:R12.PO.D compatible with 12.1.3

    Hi, we are encountering the Bug 20133080, that cancels the PR line if the PO line is cancelled.
    Our EBS is 12.1.3, but this patch 20133080:R12.PO.D stated that it was for 12.2.3.
    however upon checking the patch details README File (https://updates.oracle.com/Orion/Services/download?type=readme&aru=18420063):
    For 12.0.X / 12.1.X / pre-upgrade patches (using adpatch), you must shut down all Application tier services before performing the tasks in this section.
    so does this mean that it's also compatible with 12.1.3? it's kind of confusing.
    if it isn't compatible, is there an existing patch for 12.1.3?
    if there isn't a patch for 12.1.3, where can i request a patch?
    i logged an SR at MOSC asking the same questions but they didn't really give me an outright answer.
    thank you!

    Hi to all!
    Oracle was able to create a patch for 12.1.3. (patch number 20133080:R12.PO.B).
    hope this helps!

Maybe you are looking for