mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
James LewisMoss's xml patch.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3840 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6740a78708
commit
2d76753469
@ -25,6 +25,7 @@ ltmain.sh
|
||||
make-gnucash-patch
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
install-stamp
|
||||
tags
|
||||
*.tar.gz
|
||||
*.log
|
||||
|
29
ChangeLog
29
ChangeLog
@ -1,3 +1,20 @@
|
||||
2001-03-27 James LewisMoss <jimdres@mindspring.com>
|
||||
|
||||
* src/engine/io-gncxml-v2.c (add_account_local): duh. currency
|
||||
not commodity. commodity is same as Security. Old gets freed
|
||||
really hosing the data known_commodities structure.
|
||||
|
||||
2001-03-26 James LewisMoss <jimdres@mindspring.com>
|
||||
|
||||
* src/engine/gnc-commodity.c (count_coms): new func.
|
||||
(gnc_commodity_table_get_size): Actually return size rather than
|
||||
namespace size.
|
||||
(gnc_commodity_table_get_number_of_namespaces): new func. Used to
|
||||
be the get_size one.
|
||||
|
||||
* src/test/test-commodities.c (test_commodity): Improve error
|
||||
output for size diffs.
|
||||
|
||||
2001-03-26 Bill Gribble <grib@billgribble.com>
|
||||
|
||||
* src/gnome/dialog-column-view.{c,h}: new files. Options editor
|
||||
@ -25,6 +42,10 @@
|
||||
multiple reports. Each report is in a table cell with a
|
||||
configurable rowspan and colspan.
|
||||
|
||||
2001-03-26 James LewisMoss <jimdres@mindspring.com>
|
||||
|
||||
* README (NOTE): Update how make-gnucash-patch works.
|
||||
|
||||
2001-03-26 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/scm/report/transaction-report.scm: fix i18n bug
|
||||
@ -90,6 +111,14 @@
|
||||
* src/scm/report/income-or-expense-pie.scm: Included new option to
|
||||
summarize all subaccount balances below a certain level threshold.
|
||||
|
||||
2001-03-23 James LewisMoss <jimdres@mindspring.com>
|
||||
|
||||
* src/engine/gnc-pricedb-xml-v1.c (gnc_pricedb_to_dom_tree): Don't
|
||||
return and empty tree. Return NULL.
|
||||
|
||||
* src/engine/io-gncxml-v2.c (write_pricedb): check for null return
|
||||
from pricedb tree generator and ignore. It's ok to get NULL.
|
||||
|
||||
2001-03-22 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/Makefile.am: compile src/test after compile src/
|
||||
|
112
README
112
README
@ -493,60 +493,86 @@ Submitting a Patch:
|
||||
provided with the distribution that you can use to create the
|
||||
patch. Here is how to use that perl script.
|
||||
|
||||
First, set up your development directories as follows:
|
||||
There are two methods.
|
||||
|
||||
< GnuCash home development directory >
|
||||
|
|
||||
|---- < directory containing original GnuCash sources >
|
||||
|
|
||||
|---- < directory containing your modified GnuCash sources >
|
||||
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.
|
||||
|
||||
A concrete example of those directories might be:
|
||||
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-<username>.diff.gz where Y=year,
|
||||
M=month, D=day, h=hour, m=minute, and s=second.
|
||||
|
||||
/home/me/gnucash
|
||||
|
|
||||
|---- /home/me/gnucash/gnucash.pristine (original sources)
|
||||
|
|
||||
|---- /home/me/gnucash/gnucash.mywork (original sources + my edits)
|
||||
make-gnucash-patch will then uuencode the diff to
|
||||
../diffs/<samefilename>.uue.
|
||||
|
||||
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:
|
||||
There are two vars you can set in a ~/.gnucash-patch.rc file.
|
||||
The file should look like this
|
||||
|
||||
export GNC_MAKEPATCH_OLD_DIR=gnucash.pristine
|
||||
export GNC_MAKEPATCH_NEW_DIR=gnucash.mywork
|
||||
export GNC_MAKEPATCH_HOME_DIR=/home/me/gnucash
|
||||
----------------------------------------------------------------------
|
||||
# -*- perl -*-
|
||||
|
||||
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.
|
||||
$::should_uuencode = 0;
|
||||
$::ask_description = 0;
|
||||
|
||||
Now run the script. Note that this script requires the programs
|
||||
'makepatch', 'gzip', 'diff', and 'uuencode' (and, of course, 'perl')
|
||||
to run.
|
||||
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.
|
||||
|
||||
When you run the script, three files will be generated:
|
||||
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.
|
||||
|
||||
gnc.diff: This file is an ascii text file containing the differences
|
||||
between the original sources and your edits. At the bottom of this
|
||||
file is a list of the files which were added, changed, or deleted.
|
||||
First, set up your development directories as follows:
|
||||
|
||||
Please examine this file (especially the list at the bottom) to
|
||||
make sure that all of your changes (and no other changes) are
|
||||
present in the file.
|
||||
< GnuCash home development directory >
|
||||
|
|
||||
|---- < directory containing original GnuCash sources >
|
||||
|
|
||||
|---- < directory containing your modified GnuCash sources >
|
||||
|
||||
If the patch is relatively small, send this file as an attachment
|
||||
to gnucash-patches@gnucash.org and you are done. Otherwise,
|
||||
continue.
|
||||
A concrete example of those directories might be:
|
||||
|
||||
gnucash.diff.gz: This is a gzipped version of the above file.
|
||||
If you want to send the patch as an attachment, send this
|
||||
file to gnucash-patches@gnucash.org. Otherwise, continue.
|
||||
/home/me/gnucash
|
||||
|
|
||||
|---- /home/me/gnucash/gnucash.pristine (original sources)
|
||||
|
|
||||
|---- /home/me/gnucash/gnucash.mywork (original sources + my edits)
|
||||
|
||||
gnucash.diff.gz.uue: This is a uuencoded (ascii-encoded) version of
|
||||
the above file. Send this file to gnucash-patches@gnucash.org.
|
||||
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:
|
||||
|
||||
Thanks in advance for your contribution!
|
||||
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!
|
||||
|
@ -301,13 +301,36 @@ gnc_commodity_table_new(void) {
|
||||
********************************************************************/
|
||||
|
||||
guint
|
||||
gnc_commodity_table_get_size(gnc_commodity_table* tbl)
|
||||
gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl)
|
||||
{
|
||||
g_return_val_if_fail(tbl, 0);
|
||||
g_return_val_if_fail(tbl->table, 0);
|
||||
return g_hash_table_size(tbl->table);
|
||||
}
|
||||
|
||||
static void
|
||||
count_coms(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
GHashTable *tbl = ((gnc_commodity_namespace*)value)->table;
|
||||
guint *count = (guint*)user_data;
|
||||
|
||||
if(!value) return;
|
||||
|
||||
*count += g_hash_table_size(tbl);
|
||||
}
|
||||
|
||||
guint
|
||||
gnc_commodity_table_get_size(gnc_commodity_table* tbl)
|
||||
{
|
||||
guint count = 0;
|
||||
g_return_val_if_fail(tbl, 0);
|
||||
g_return_val_if_fail(tbl->table, 0);
|
||||
|
||||
g_hash_table_foreach(tbl->table, count_coms, (gpointer)&count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* gnc_commodity_table_lookup
|
||||
* locate a commodity by namespace and mnemonic.
|
||||
|
@ -81,6 +81,7 @@ gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table * table,
|
||||
int gnc_commodity_table_has_namespace(const gnc_commodity_table * t,
|
||||
const char * namespace);
|
||||
guint gnc_commodity_table_get_size(gnc_commodity_table* tbl);
|
||||
guint gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl);
|
||||
|
||||
/* The next two functions return newly allocated lists which should
|
||||
* be freed with g_list_free. */
|
||||
|
@ -293,7 +293,6 @@ pricedb_v2_end_handler(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
sixtp*
|
||||
gnc_pricedb_sixtp_parser_create(void)
|
||||
{
|
||||
@ -430,6 +429,13 @@ gnc_pricedb_to_dom_tree(const char *tag, GNCPriceDB *db)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* if no children have been added just return NULL */
|
||||
if(!db_xml->xmlChildrenNode)
|
||||
{
|
||||
xmlFreeNode(db_xml);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return db_xml;
|
||||
}
|
||||
|
||||
|
@ -688,8 +688,6 @@ gnc_pricedb_substitute_commodity(GNCPriceDB *db,
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#if 0
|
||||
|
||||
/* Semi-lame debugging code */
|
||||
|
||||
static void
|
||||
@ -740,7 +738,7 @@ static gboolean
|
||||
print_pricedb_adapter(GNCPrice *p, gpointer user_data)
|
||||
{
|
||||
FILE *f = (FILE *) user_data;
|
||||
gnc_price_print(p, f);
|
||||
gnc_price_print(p, f, 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -755,4 +753,4 @@ gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f)
|
||||
fprintf(f, "</gnc:pricedb>\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -161,10 +161,8 @@ gboolean gnc_pricedb_foreach_price(GNCPriceDB *db,
|
||||
/* Return FALSE if the database has not been modified */
|
||||
gboolean gnc_pricedb_dirty(GNCPriceDB *p);
|
||||
|
||||
#if 0
|
||||
/* semi-lame debugging code */
|
||||
void gnc_price_print(GNCPrice *db, FILE *f);
|
||||
void gnc_price_print(GNCPrice *db, FILE *f, int indent);
|
||||
void gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "sixtp-parsers.h"
|
||||
#include "gnc-xml.h"
|
||||
#include "gnc-book-p.h"
|
||||
#include "gnc-pricedb.h"
|
||||
|
||||
#include "Group.h"
|
||||
|
||||
@ -57,8 +58,8 @@ static gboolean
|
||||
add_account_local(sixtp_gdv2 *data, Account *act)
|
||||
{
|
||||
clear_up_account_commodity(data->book, act,
|
||||
xaccAccountGetCommodity,
|
||||
xaccAccountSetCommodity);
|
||||
xaccAccountGetCurrency,
|
||||
xaccAccountSetCurrency);
|
||||
clear_up_account_commodity(data->book, act,
|
||||
xaccAccountGetSecurity,
|
||||
xaccAccountSetSecurity);
|
||||
@ -107,7 +108,8 @@ add_pricedb_local(sixtp_gdv2 *data, GNCPriceDB *db)
|
||||
{
|
||||
gnc_pricedb_destroy(gnc_book_get_pricedb(data->book));
|
||||
}
|
||||
|
||||
|
||||
/* gnc_pricedb_print_contents(db, stdout); */
|
||||
gnc_book_set_pricedb(data->book, db);
|
||||
|
||||
return TRUE;
|
||||
@ -364,6 +366,11 @@ write_pricedb(FILE *out, GNCBook *book)
|
||||
|
||||
node = gnc_pricedb_dom_tree_create(gnc_book_get_pricedb(book));
|
||||
|
||||
if(!node)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
xmlElemDump(out, NULL, node);
|
||||
fprintf(out, "\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user