From 32e51f65a19d030363f9c5d29472c59b2df0cccd Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 25 Nov 2012 14:36:29 -0500 Subject: Verify that files are not duplicated in the MANIFEST. Keep a hash so that file output to the MANIFEST file doesn't have duplicates of the same file name in it. --- contrib/non-profit-audit-reports/general-ledger-report.plx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/non-profit-audit-reports/general-ledger-report.plx b/contrib/non-profit-audit-reports/general-ledger-report.plx index 192be350..d1c92975 100755 --- a/contrib/non-profit-audit-reports/general-ledger-report.plx +++ b/contrib/non-profit-audit-reports/general-ledger-report.plx @@ -96,6 +96,7 @@ print MANIFEST "general-ledger.txt\n"; open(GL_CSV_OUT, ">", "general-ledger.csv") or die "unable to write general-ledger.csv: $!"; print MANIFEST "general-ledger.csv\n"; +my %manifest; foreach my $acct (@sortedAccounts) { print GL_TEXT_OUT "\n\nACCOUNT: $acct\nFROM: $beginDate TO $formattedEndDate\n\n"; my @acctLedgerOpts = ('-V', '-F', @@ -131,7 +132,8 @@ foreach my $acct (@sortedAccounts) { my $file = $1; next if $file =~ /^\s*$/; warn "$file does not exist and/or is not readable" unless -r $file; - print MANIFEST "$file\n"; + print MANIFEST "$file\n" if not defined $manifest{$file}; + $manifest{$file} = $line; } } close(GL_CSV_DATA); die "error reading ledger output for chart of accounts: $!" unless $? == 0; -- cgit v1.2.3