From 4187aed0eecdddbdcd9b2d9312372a62f1b2a178 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Sat, 3 Jan 2004 02:58:33 +0000 Subject: [PATCH] * README.patches: * make-gnucash-patch.in: Patch by Geoff Kassel to work on OpenBSD (allow user to set diffcmd) Fixes #122646 git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9753 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ README.patches | 17 +++++++++++++---- make-gnucash-patch.in | 17 +++++++++++------ 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e95975e0f..b994b70315 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-01-02 Derek Atkins + * README.patches: + * make-gnucash-patch.in: + Patch by Geoff Kassel to work on OpenBSD (allow user to set diffcmd) + Fixes #122646 + * src/business/business-core/gncInvoice.c: need a non-const string * src/engine/test/Makefile.am: add test-link, make libgw-engine depend on libgncmod-engine diff --git a/README.patches b/README.patches index c305ab7525..4cf046ce18 100644 --- a/README.patches +++ b/README.patches @@ -45,7 +45,7 @@ COMMON USAGE make-gnucash-patch will then uuencode the diff to ../diffs/.uue. - There are two vars you can set in a ~/.gnucash-patch.rc file. + There are three vars you can set in a ~/.gnucash-patch.rc file. The file should look like this ---------------------------------------------------------------------- @@ -53,6 +53,7 @@ COMMON USAGE $::should_uuencode = 0; $::ask_description = 0; +$::diffcmd = "diff -up"; 1; ---------------------------------------------------------------------- @@ -61,7 +62,9 @@ $::ask_description = 0; patch in email using mime and don't need it double encoded). Set $::should_uuencode to 0. If you don't want makepatch to ask you for the patch description (so the process is more automated - possibly) set $::ask_description to 0. + possibly) set $::ask_description to 0. If you want to use a + different diff command (not recommended for most) set $::diffcmd + to something else (say, "gdiff -up"). 2) The second method is basically described below but it also includes the vars you can set from above. This method gives you @@ -100,8 +103,8 @@ $::ask_description = 0; a patch. Now run the script. Note that this script requires the programs - 'makepatch', 'gzip', 'diff', and 'uuencode' (and, of course, - 'perl') to run. + 'makepatch', 'gzip', a 'diff' work-a-like, and 'uuencode' (and, of + course, 'perl') to run. The same files will be generated for this method as the last (../diffs/*.diff.gz and ../diffs/*.diff.gz.uue). @@ -157,6 +160,12 @@ USERS GUIDE mm = current minutes (2 digit form) SS = current seconds (2 digit form) XXXX = userid of current user (arbitrary length) + + --diffcmd "command" The command to give to makepatch to generate the + differences between two files. + *NOT* Recommended for most users, only for those whom + diff -up is non-functional. + Defaults to: diff -up --file "filename" Generate a patch for ONLY this file. The path within the CVS tree must be specified (eg. src/MultiLedger.c) or diff --git a/make-gnucash-patch.in b/make-gnucash-patch.in index 53afe581f2..ec012d7f89 100644 --- a/make-gnucash-patch.in +++ b/make-gnucash-patch.in @@ -7,7 +7,7 @@ # consult the README. # # This script requires the programs 'makepatch', 'gzip', -# 'diff', and 'uuencode'. +# a 'diff' work-a-like, and 'uuencode'. # # Author: Dave Peticolas @@ -18,6 +18,7 @@ use Getopt::Long; $::ask_description = 1; $::should_uuencode = 1; +$::diffcmd = "diff -up"; my $rcfile = $ENV{"HOME"} . "/.gnucash-patch.rc"; @@ -92,8 +93,8 @@ $result = GetOptions("old=s" => \$old, "new=s" => \$new, "prefix=s" => \$gnc_home, "help" => \$help, "file=s" => \@filename, "ask!" => \$::ask_description, "diff=s" => \$diffname, "uuencode!" => \$::should_uuencode, - "zip!" => \$zip, "ignore=s" => \$ignorename, - "manifest=s" => \$manifest); + "diffcmd!" => \$::diffcmd, "zip!" => \$zip, + "ignore=s" => \$ignorename, "manifest=s" => \$manifest); if ($help or $result == 0) { printf "Help information\n\n"; @@ -102,6 +103,7 @@ if ($help or $result == 0) { printf "--new \"newdir\" Directory with modified copy\n"; printf "--prefex \"homedir\" Full path of parent directory\n"; printf "--diff \"diffname\" Output name for diff file\n"; + printf "--diffcmd \"cmd\" Command to compare two files\n"; printf "--file \"filename\" Make patch for filename ONLY\n"; printf "--manifest \"file\" Use file as a manifest file\n"; printf "--ignore \"igname\" File containing file matches to ignore\n"; @@ -114,8 +116,8 @@ if ($help or $result == 0) { printf "and of course:\n"; printf "--help Displays this text\n"; printf "\nAll options can be abbreviated to their shortest unique\n"; - printf " form: --o, --ne, --p, --d, --f, --m, --i, --u/--nou,\n"; - printf " --z/--noz, --a/--noa, and --h\n"; + printf " form: --o, --ne, --p, --d, --diffc, --f, --m, --i,\n"; + printf " --u/--nou, --z/--noz, --a/--noa, and --h\n"; printf "\n"; exit 1; } @@ -154,7 +156,10 @@ if (not defined($old)) { chdir $gnc_home . "/" . $new or die "Can't cd!\n"; # Start out with our basic makepatch arguments -my @args = ('-verbose', '-diff', 'diff -up', '-exclude-vc'); +my @args = ('-verbose', '-exclude-vc'); + +# Push the diff command value +push(@args, '-diff', "$::diffcmd"); if (not $::ask_description) { push(@args, '-description', '');