diff --git a/ChangeLog b/ChangeLog index 13909b63b6..387be8cb7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-05-01 Conrad Canterford + + * make-gnucash-patch.in: add --file option to allow single file + patches to be made. + + * README.patches (new file): Moved patch instructions from README + file into this new file, and added detailed descriptions of all + the options for make-gnucash-patch. + + * README: see above + 2001-05-01 Dave Peticolas * src/scm/report/stylesheet-plain.scm: fix i18n bugs diff --git a/Makefile.am b/Makefile.am index 0f06d5265a..accbac8c1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,8 @@ doc_DATA = \ HACKING \ INSTALL \ NEWS \ - README + README \ + README.patches # All the other files that go in the distribution tarfile that aren't # included some other way... @@ -30,6 +31,7 @@ EXTRA_DIST = \ .cvsignore \ ChangeLog.1 \ HACKING \ + README.patches \ gnucash.lsm \ make-gnucash-patch.in \ po/.cvsignore \ diff --git a/README b/README index d0b8a41b68..6138fa94e6 100644 --- a/README +++ b/README @@ -473,91 +473,10 @@ Before you start developing GnuCash, you should do the following: Submitting a Patch: - Once you have done some work that you would like to submit, you need - to send a patch. There is a perl script called make-gnucash-patch - provided with the distribution that you can use to create the - patch. Here is how to use that perl script. + This section has been removed to the file README.patches - There are two methods. + Please consult that file for details on using the script provided to make + patches suitable for submitting to the gnucash development team. - 1) Run ./make-gnucash-patch in your source directory. The script - will then create two directories ../diff and ../tmp. In ../tmp - it will then do a checkout of the cvs sources. If gnucash has - already been checked out into this directory then only an update - will occur. As a consequence of this you should make sure you - are merged with current CVS before running make-gnucash-patch or - you will find parts of the patch are reversing recent changes in - CVS. - make-gnucash-patch will then use makepatch to create a patch - between the original directory and ../tmp/gnucash. makepatch - will ask you for a description of the patch. And then the diff - will be written to the diff file - ../diffs/gnucash-YYYYMMDD-hhmmss-.diff.gz where Y=year, - M=month, D=day, h=hour, m=minute, and s=second. - - make-gnucash-patch will then uuencode the diff to - ../diffs/.uue. - - There are two vars you can set in a ~/.gnucash-patch.rc file. - The file should look like this - ----------------------------------------------------------------------- -# -*- perl -*- - -$::should_uuencode = 0; -$::ask_description = 0; - -1; ----------------------------------------------------------------------- - This is basically a perl file that is sourced by the script. If - you don't want the diff to be uuencoded (say you'll send the - 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. - - 2) The second method is basically described below but it also - includes the vars you can set from above. This method gives you - more control over which directories are used. - - First, set up your development directories as follows: - - < GnuCash home development directory > - | - |---- < directory containing original GnuCash sources > - | - |---- < directory containing your modified GnuCash sources > - - A concrete example of those directories might be: - - /home/me/gnucash - | - |---- /home/me/gnucash/gnucash.pristine (original sources) - | - |---- /home/me/gnucash/gnucash.mywork (original sources + my edits) - - Copy the make-gnucash-patch script to the home development - directory (/home/me/gnucash above). Now set three environment - variables to reflect the names of your directories. Given the - names above, you would use: - - export GNC_MAKEPATCH_OLD_DIR=gnucash.pristine - export GNC_MAKEPATCH_NEW_DIR=gnucash.mywork - export GNC_MAKEPATCH_HOME_DIR=/home/me/gnucash - - Right before you make your patch, make sure *both* your working - and your pristine directories are in sync with cvs. Run 'cvs -z3 - update -dP' in both directories to ensure that is the - case. Updating from cvs in your working directory may cause - conficts in a file. You must resolve those conficts before making - a patch. - - Now run the script. Note that this script requires the programs - 'makepatch', 'gzip', 'diff', 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). - - Thanks in advance for your contribution! +Thank you. diff --git a/README.patches b/README.patches new file mode 100644 index 0000000000..0ea7b737df --- /dev/null +++ b/README.patches @@ -0,0 +1,203 @@ +############################################################ + Gnucash 1.5.x README file. + +NOTE: THIS IS A DEVELOPMENT RELEASE!!! THIS VERSION HAS NOT +BEEN TESTED PROPERLY AND MAY DO ABSOLUTELY ANYTHING! + +USE AT YOUR OWN RISK (AND KEEP *LOTS* OF BACKUPS) + +If you want something a bit more tested, please use the +1.4 stable series. +------------------------------------------------------------ + +Submitting a Patch: + + Once you have done some work that you would like to submit, you need + to send a patch. There is a perl script called make-gnucash-patch + provided with the distribution that you can use to create the + patch. Here is how to use that perl script. + + This file comes in two parts: + - A quick summary of the common ways to use make-gnucash-patch; and + - A "users guide" style section giving detailed information on all + the options for make-gnucash-patch. + +COMMON USAGE + + There are two methods. + + 1) Run ./make-gnucash-patch in your source directory. The script + will then create two directories ../diff and ../tmp. In ../tmp + it will then do a checkout of the cvs sources. If gnucash has + already been checked out into this directory then only an update + will occur. As a consequence of this you should make sure you + are merged with current CVS before running make-gnucash-patch or + you will find parts of the patch are reversing recent changes in + CVS. + + make-gnucash-patch will then use makepatch to create a patch + between the original directory and ../tmp/gnucash. makepatch + will ask you for a description of the patch. And then the diff + will be written to the diff file + ../diffs/gnucash-YYYYMMDD-hhmmss-.diff.gz where Y=year, + M=month, D=day, h=hour, m=minute, and s=second. + + make-gnucash-patch will then uuencode the diff to + ../diffs/.uue. + + There are two vars you can set in a ~/.gnucash-patch.rc file. + The file should look like this + +---------------------------------------------------------------------- +# -*- perl -*- + +$::should_uuencode = 0; +$::ask_description = 0; + +1; +---------------------------------------------------------------------- + This is basically a perl file that is sourced by the script. If + you don't want the diff to be uuencoded (say you'll send the + 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. + + 2) The second method is basically described below but it also + includes the vars you can set from above. This method gives you + more control over which directories are used. + + First, set up your development directories as follows: + + < GnuCash home development directory > + | + |---- < directory containing original GnuCash sources > + | + |---- < directory containing your modified GnuCash sources > + + A concrete example of those directories might be: + + /home/me/gnucash + | + |---- /home/me/gnucash/gnucash.pristine (original sources) + | + |---- /home/me/gnucash/gnucash.mywork (original sources + my edits) + + Copy the make-gnucash-patch script to the home development + directory (/home/me/gnucash above). Now set three environment + variables to reflect the names of your directories. Given the + names above, you would use: + + export GNC_MAKEPATCH_OLD_DIR=gnucash.pristine + export GNC_MAKEPATCH_NEW_DIR=gnucash.mywork + export GNC_MAKEPATCH_HOME_DIR=/home/me/gnucash + + Right before you make your patch, make sure *both* your working + and your pristine directories are in sync with cvs. Run 'cvs -z3 + update -dP' in both directories to ensure that is the + case. Updating from cvs in your working directory may cause + conficts in a file. You must resolve those conficts before making + a patch. + + Now run the script. Note that this script requires the programs + 'makepatch', 'gzip', 'diff', 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). + +USERS GUIDE + + make-gnucash-patch supports a number of ways of providing required + information. Some information can be provided through the use of + environment variables or in the .gnucash-patch.rc file in your + home directory. All information can be provided by command-line + options. + + In all cases, the options given on the command-line override the + information in both environment variables and the .gnucash-patch.rc + file. + Environment variables (where permitted) will override the + .gnucash-patch.rc file. + + The general format for using make-gnucash-patch is: + ./make-gnucash-patch + + where valid options are: + --help, --h Display a short help message explaining available + options. + + --prefix "homedir" Specifies the home directory path to use. This path is + prepended to both the new and old directory names to + give the full path for those directories. + Defaults to: the parent directory. + Environment variable: GNC_MAKEPATCH_HOME_DIR + + --old "olddir" The name of the directory containing the "pristine" or + unmodified copy of the gnucash CVS tree. + The directory path as determined by --prefix is prepended + to this name to give the full directory path. + Defaults to: ../tmp and will create if it doesn't exist. + Environment variable: GNC_MAKEPATCH_OLD_DIR + + --new "newdir" The name of the directory containing the modified copy of + the gnucash CVS tree. + The directory path as determined by --prefix is prepended + to this name to give the full directory path. + Defaults to: the current directory. + Environment variable: GNC_MAKEPATCH_NEW_DIR + + --diff "diffname" The name to give to the output ("diff") file containing + the patch code. + Defaults to: gnucash-YYYYMMDD-HHmmSS-XXXX.diff + where: YYYY = current year (4 digit form) + MM = current month (2 digit form) + DD = current date (2 digit form) + HH = current hour (24-hour 2 digit form) + mm = current minutes (2 digit form) + SS = current seconds (2 digit form) + XXXX = userid of current user (arbitrary length) + + --file "filename" Generate a patch for ONLY this file. The path within + the CVS tree must be specified (eg. src/MultiLedger.c) or + the file cannot be matched. You *CANNOT* use this option + with wildcards or partial matches. + Defaults to: none. + +--ignore "igname" Name of the file in the parent directory which contains + regular expressions matching files which are to be excluded + from the patch. This is in addition to a number of files + which are automatically excluded by the script. + Defaults to: none. + + --uuencode Specifies whether the resultant diff file should be + --nouuencode uuencoded or not. uuencoding is a way of encrypting the file + so that it is less likely to be corrupted during transmission + over the internet. You should generally use it. + Defaults to: On. + .gnucash-patch.rc file: Yes + ("$::should_uuencode = 0;" to override default). + + --zip Specifies whether the resultant diff file should be + --nozip compressed or not. This is not always necessary when the + patch is a small one. + Defaults to: On. + + --ask Controls whether makepatch should ask for a description of + --noask this patch or not. + Defaults to: On. + .gnucash-patch.rc file: Yes + ("$::ask_description = 0;" to override default). + + +THINGS TO NOTE + - the script assumes (when using defaults) that it is being executed in the + top directory of the modified CVS tree. This can be overridden by specifying + prefix, old, and new directories. + - the script assumes that both the "pristine" and modified copy are children + of the same parent directory. + - the script will check out a "pristine" copy of the CVS tree automatically if + it cannot find the old directory you specify. + + + Thanks in advance for your contribution! diff --git a/make-gnucash-patch.in b/make-gnucash-patch.in index 241e1e9cee..c833e983ba 100644 --- a/make-gnucash-patch.in +++ b/make-gnucash-patch.in @@ -85,9 +85,11 @@ my $help; my $zip = 1; # defaults to on my $diffname = undef; my $ignorename = undef; +my $filename = undef; $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); @@ -98,19 +100,33 @@ 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 "--file \"filename\" Make patch for filename ONLY\n"; printf "--ignore \"igname\" File containing file matches to ignore\n"; printf "--(no)uuencode Enable or disable uuencoded output\n"; printf " (Defaults to enabled)\n"; printf "--(no)zip Enable or disable gzipped output\n"; printf " (Defaults to enabled)\n"; + printf "--(no)ask Enable or disable prompting for description\n"; + printf " (Defaults to enabled)\n"; 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, --i, --u/--nou, --z/--noz, and --h\n"; + printf " form: --o, --ne, --p, --d, --f, --i, --u/--nou, --z/--noz, \n"; + printf " --a/--noa, and --h\n"; printf "\n"; exit 1; } +# if explicit filename given, build required MANIFEST file + +if (defined($filename)) { + open (FN, ">$gnc_home/tmp.MANIFEST") or die "Couldn't create MANIFEST file"; + printf (FN "# Temporary manifest file for make-gnucash-patch -f option\n"); + printf (FN "\n"); + printf (FN "%s\n", $filename); + close (FN); +} + # Switch to the home directory print "Changing directory to $gnc_home\n"; chdir $gnc_home or die "Can't cd!\n"; @@ -136,8 +152,16 @@ my @args = ('-verbose', '-diff', 'diff -up', '-exclude-vc'); if (not $::ask_description) { push(@args, '-description', ''); } -# Add in the exclude patterns from the __DATA__ section -push_exclusions(\@args); + +# If -f options given, use generated manifest file +# otherwise, add exclusions and proceed as normal +if (defined($filename)) { + push(@args, '-manifest', "$gnc_home/tmp.MANIFEST"); +} +else { + # Add in the exclude patterns from the __DATA__ section + push_exclusions(\@args); +} sub push_exclusions { my $args = shift; diff --git a/rpm/gnucash.spec.in b/rpm/gnucash.spec.in index 45475fb43f..6b0f9cd247 100644 --- a/rpm/gnucash.spec.in +++ b/rpm/gnucash.spec.in @@ -55,5 +55,5 @@ rm -rf $RPM_BUILD_ROOT /usr/share/pixmaps/gnucash /usr/man/* %config /etc/gnucash -%doc AUTHORS COPYING ChangeLog ChangeLog.1 HACKING NEWS README +%doc AUTHORS COPYING ChangeLog ChangeLog.1 HACKING NEWS README README.patches %doc doc/README.german doc/README.francais doc/guile-hackers.txt