Commit 2acff203 authored by Jerome Benoit's avatar Jerome Benoit

Primary Debian patch 0.999a+ds-1

parent 83b58187
#! /bin/sh
# /usr/share/doc/apophenia-doc/examples/build.sh
#
# ad hoc script for building the example sources distributed
# within the debian package apophenia-doc.
#
# Recommended usage:
# create a dedicated folder somewhere in your HOME directory;
# link all the files in /usr/share/doc/apophenia-doc/examples in the dedicated folder;
# launch this script in the dedicated folder;
# to cleanup, if not yet done, create a link clean.sh to this script, and run this link.
#
# written for Debian by Jerome Benoit <calculus@rezozer.net>
# copyright: 2014 Jerome Benoit <calculus@rezozer.net>
# distributed under the terms and conditions of GPL version 2 or later
#
CC="gcc -std=c99 $(pkg-config apophenia --cflags --libs)"
listof_zsource=$(find . -maxdepth 1 -regextype posix-egrep -regex '.*\.c(\.gz|\.bz2|\.xz)?' -printf '%f\n')
for zsource in $listof_zsource ; do
executable=${zsource%%.*}
for extension in gz bz2 xz ; do
if [ -f ${zsource}.${extension} ]; then
rm -rf ${zsource}
fi
done
if [ -f ${executable}.o ]; then
rm -f ${executable}.o
fi
if [ -x ${executable} ]; then
rm -f ${executable}
fi
done
if [ "${0##*/}" = "clean.sh" ]; then exit 0 ; fi
listof_zsource=$(find . -maxdepth 1 -regextype posix-egrep -regex '.*\.c(\.gz|\.bz2|\.xz)?' -printf '%f\n')
for zsource in $listof_zsource ; do
zextension=${zsource##*.}
executable=${zsource%%.*}
printf "%-35s -> %-25s\n" ${zsource} ${executable}
case ${zextension} in
gz)
source=${zsource%.*}
zcat ${zsource} > ${source}
;;
bz2)
source=${zsource%.*}
bzcat ${zsource} > ${source}
;;
xz)
source=${zsource%.*}
xzcat ${zsource} > ${source}
;;
*)
source=${zsource}
;;
esac
extension=${source#*.}
case ${extension} in
c)
$CC -o ${executable} ${source}
;;
*)
;;
esac
if [ "${source}" != "${zsource}" ]; then
rm -f ${source}
fi
rm -f ${executable}.o
done
exit 0
##
## eos
debian/tmp/usr/share/man/man1/*.1
Document: apophenia
Title: Apophenia
Author: Ben Klemens
Abstract:
The Apophenia Statistical C Library is an open source C library for working
with data sets and statistical models. It provides functions on the same level
as those of the typical stats packages (such as OLS, probit, or singular value
decomposition) but gives the user more flexibility to be creative in model-building.
Apophenia is meant to scale well, to comfortably work with gigabyte data sets,
million-step simulations, or computationally-intensive agent-based models.
The source code is distributed under the GNU General Public License version 2 (GPL2)
with two modifications.
Section: Science/Mathematics
Format: HTML
Index: /usr/share/doc/apophenia-doc/html/index.html
Files: /usr/share/doc/apophenia-doc/html/*.html
debian/adhoc/examples/build.sh
eg/*.c
tests/data
tests/faith.data
usr/share/doc/apophenia-doc/examples/build.sh usr/share/doc/apophenia-doc/examples/clean.sh
usr/share/doc/apophenia-doc/examples usr/share/doc/apophenia-doc/eg
apophenia (0.999a+ds-1) UNRELEASED; urgency=medium
* Initial release (Closes: #755493).
* Debianization:
- debian/copyright in DEP-5 format;
- debian/control:
- debhelper build-dep to >= 9;
- Standards Version 3.9.5;
- Vcs-* headers.
- debian/source, format 3.0 (quilt);
- debian/patches/ patches in DEP-3 format;
- debian/watch file;
- debian/repack, repack script to clean up and gain weight;
- debian/rules:
- autoreconf-iguration;
- full and minal dh integration;
- get-orig-source uscan based target which downloads the currently
packaged upstream tarball and repacks it;
- default target which basically queries package status with uscan
-- output in DEHS format;
- gpg-signature check support, neutralize;
- ad hoc script to build/clean the upstream source examples, provide.
* Fixes, enhancements, request for a better autotools machinery support
(more rational, passing the `make distcheck' test, explicit gnulib support)
and bug reports has been submitted to the upstream maintainer.
-- Jerome Benoit <calculus@rezozer.net> Fri, 15 Aug 2014 08:46:42 +0000
cmd/apop_db_to_crosstab.1
cmd/apop_plot_query.1
cmd/apop_text_to_db.1
tests/ff.db
tests/runs.db
tests/td.db
tests/draws-k
tests/draws-k2
tests/draws-mvN
tests/draws-N
tests/draws-std_multinormal
tests/draws-std_normal
tests/the_data.txt
tests/print_test.out
tests/xxx
docs/model_doc.h
docs/missing_model_parts
Source: apophenia
Section: math
Priority: extra
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Uploaders: Jerome Benoit <calculus@rezozer.net>
Build-Depends:
debhelper (>= 9),
autotools-dev, autoconf-archive, dh-autoreconf, libtool,
pkg-config, help2man,
zlib1g-dev, libmysqlclient-dev, libsqlite3-dev, libgsl0-dev,
bc, sqlite3,
doxygen, texlive-latex-recommended, texlive-fonts-recommended, ghostscript,
rdfind, symlinks
Standards-Version: 3.9.5
Homepage: http://apophenia.info/
Vcs-Git: git://anonscm.debian.org/debian-science/packages/apophenia.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/apophenia.git
Package: libapophenia0
Provides: libapophenia
Section: libs
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: libapophenia
Suggests: apophenia-doc (= ${binary:Version})
Multi-Arch: same
Description: Apophenia Statistical C Library -- library package
The Apophenia Statistical C Library is an open source C library for
working with data sets and statistical models. It provides functions
on the same level as those of the typical stats packages (such as OLS,
probit, or singular value decomposition) but gives the user more
flexibility to be creative in model-building.
.
Apophenia is meant to scale well, to comfortably work with gigabyte
data sets, million-step simulations, or computationally-intensive
agent-based models.
.
Apophenia builds upon the GNU Scientific and SQLite libraries,
MySQL/mariaDB is also supported. The core functions are written
in C, but experience has shown them to be easy to bind in Python,
Julia, Perl, Ruby, etc. The source code is distributed under the
GNU General Public License version 2 (GPL2) with two modifications.
.
This package provides the shared libraries required to run programs
compiled against the Apophenia Statistical C Library. To compile your
own programs you also need to install the libapophenia0-dev package.
Package: libapophenia0-dev
Provides: libapophenia-dev
Section: libdevel
Architecture: any
Depends: libapophenia0 (= ${binary:Version}), ${misc:Depends}
Conflicts: libapophenia-dev
Suggests: pkg-config
Multi-Arch: same
Description: Apophenia Statistical C Library -- development package
The Apophenia Statistical C Library is an open source C library for
working with data sets and statistical models. It provides functions
on the same level as those of the typical stats packages (such as OLS,
probit, or singular value decomposition) but gives the user more
flexibility to be creative in model-building.
.
Apophenia is meant to scale well, to comfortably work with gigabyte
data sets, million-step simulations, or computationally-intensive
agent-based models.
.
Apophenia builds upon the GNU Scientific and SQLite libraries,
MySQL/mariaDB is also supported. The core functions are written
in C, but experience has shown them to be easy to bind in Python,
Julia, Perl, Ruby, etc. The source code is distributed under the
GNU General Public License version 2 (GPL2) with two modifications.
.
This package contains the header files, static libraries and symbolic
links that developers using the Apophenia Statistical C Library will
need.
Package: apophenia-bin
Architecture: any
Depends: libapophenia0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Suggests: sqlite3
Multi-Arch: foreign
Description: Apophenia Statistical C Library -- binary package
The Apophenia Statistical C Library is an open source C library for
working with data sets and statistical models. It provides functions
on the same level as those of the typical stats packages (such as OLS,
probit, or singular value decomposition) but gives the user more
flexibility to be creative in model-building.
.
Apophenia is meant to scale well, to comfortably work with gigabyte
data sets, million-step simulations, or computationally-intensive
agent-based models.
.
Apophenia builds upon the GNU Scientific and SQLite libraries,
MySQL/mariaDB is also supported. The core functions are written
in C, but experience has shown them to be easy to bind in Python,
Julia, Perl, Ruby, etc. The source code is distributed under the
GNU General Public License version 2 (GPL2) with two modifications.
.
This package provides several command line utility examples.
Package: libapophenia0-dbg
Provides: libapophenia-dbg
Section: debug
Architecture: any
Depends: libapophenia0 (= ${binary:Version}), ${misc:Depends}
Conflicts: libapophenia-dbg
Multi-Arch: same
Description: Apophenia Statistical C Library -- debug symbols package
The Apophenia Statistical C Library is an open source C library for
working with data sets and statistical models. It provides functions
on the same level as those of the typical stats packages (such as OLS,
probit, or singular value decomposition) but gives the user more
flexibility to be creative in model-building.
.
Apophenia is meant to scale well, to comfortably work with gigabyte
data sets, million-step simulations, or computationally-intensive
agent-based models.
.
Apophenia builds upon the GNU Scientific and SQLite libraries,
MySQL/mariaDB is also supported. The core functions are written
in C, but experience has shown them to be easy to bind in Python,
Julia, Perl, Ruby, etc. The source code is distributed under the
GNU General Public License version 2 (GPL2) with two modifications.
.
This package provides the debugging symbols for the libraries from
the libapophenia0-dev package.
Package: apophenia-doc
Section: doc
Architecture: all
Depends: ${misc:Depends}
Suggests:
libapophenia0 (= ${binary:Version}), libapophenia0-dev (= ${binary:Version}),
# pdf-viewer,
www-browser,
gsl-doc-pdf, gsl-ref-html
Description: Apophenia Statistical C Library -- reference manual
The Apophenia Statistical C Library is an open source C library for
working with data sets and statistical models. It provides functions
on the same level as those of the typical stats packages (such as OLS,
probit, or singular value decomposition) but gives the user more
flexibility to be creative in model-building.
.
Apophenia is meant to scale well, to comfortably work with gigabyte
data sets, million-step simulations, or computationally-intensive
agent-based models.
.
Apophenia builds upon the GNU Scientific and SQLite libraries,
MySQL/mariaDB is also supported. The core functions are written
in C, but experience has shown them to be easy to bind in Python,
Julia, Perl, Ruby, etc. The source code is distributed under the
GNU General Public License version 2 (GPL2) with two modifications.
.
This package provides the reference manual for the Apophenia
Statistical C Library; it also contains examples.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
Upstream-Name: apophenia
Upstream-Contact: Ben Klemens <fluffmail@f-m.fm>
Source: http://apophenia.info/
X-Source: https://neunhoef.github.io/io/
X-Source-Downloaded-From: https://github.com/b-k/apophenia/releases
X-Upstream-Vcs: git clone https://github.com/b-k/apophenia.git
X-Upstream-Bugs: https://github.com/b-k/apophenia/issues
Comment:
The upstream source tarball is repacked to drop off the regenarated
material, mainly autotools related, to gain substantial weight.
Files: *
Copyright: 2005-2014 Ben Klemens <fluffmail@f-m.fm>
License: GPL-2 with two modifications
Files: debian/*
Copyright:
2014 Jerome Benoit <calculus@rezozer.net>
License: GPL-2+
License: GPL-2 with two modifications
This software is licensed under the GNU GPL v2, with two modifications,
as follows:
.
--An application hosted on a server and remotely operated by users, such
as a web application or database server, is understood to be distribution
of the software, and therefore all GPL v2 clauses regarding distribution
apply. For example, a web application must include a link for downloading
the application source code.
.
--You are explicitly granted permission to link this software to other
code licensed under other licenses, such as GPL v3 or the BSD license.
Linking to a differently-licensed code base does not free this code (or
the combination) of the stipulations of the GPLv2 plus the above clause.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this package. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
usr/lib/*/libapophenia.so
usr/lib/*/libapophenia.a
usr/lib/*/pkgconfig/*
usr/include/*
usr/lib/*/libapophenia.so.*
This diff is collapsed.
Description: debianization -- ad hoc
Meant to address Debian Policy requirements through ad hoc approaches:
a PNG image that must be present in the source tarball is imported
and incorporated as is as Debian material; this regrettable oversight
has been reported to the upstream maintainer.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-11
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -31,6 +31,7 @@
doc: documentation.h model_doc.h $(apophenia_IMAGES) $(apophenia_JS)
doxygen doxygen.conf
cp $(apophenia_IMAGES) $(apophenia_JS) html/
+ cp $(top_srcdir)/debian/adhoc/images/structs.png html/
sed -i -f edit_outline.sed html/index.html html/outline.html
sed -i -f edit_globals.sed html/globals.html
sed -i -f edit_group.sed html/group__models.html
--- a/docs/documentation.h
+++ b/docs/documentation.h
@@ -2419,7 +2419,7 @@
which will be useful to you if only because it lists some of the functions that act on
GSL vectors and matrices that are useful (in fact, essential) but out of the scope of the Apophenia documentation.
-\image html http://apophenia.info/structs.png
+\image html structs.png
\image latex structs.png
Description: debianization -- workaround around bugs
Meant to workaround bugs #597187 and #757967
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-12
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,8 @@
## Debian package version
DEB_PKG_VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p')
AC_SUBST(DEB_PKG_VERSION)
+## work around for bugs #597187 and #757967
+MYSQL_CFLAGS=$(echo "${MYSQL_CFLAGS}" | sed -e 's/-DNDEBUG//' -e 's/-g//' -e 's/-fno-strict-aliasing//' -e 's/[ ]*$//')
AC_CONFIG_FILES([
apophenia.pc
Description: debianization -- documentation
Address Debian Policy requirements for documentation.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-11
--- a/docs/head.html
+++ b/docs/head.html
@@ -2,13 +2,7 @@
<html> <head>
<title>Apophenia: a library for scientific computing</title>
-<!-- Google is watching. -->
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
-_uacct = "UA-134313-2";
-urchinTracker();
-</script>
+<!-- Google is no more watching. -->
<link rel="stylesheet" href="typical.css" type="text/css" >
--- a/docs/foot.html
+++ b/docs/foot.html
@@ -1,2 +1,2 @@
<p><p>
-<div class="tiny">Autogenerated by doxygen on $date.</div></body></html>
+<div class="tiny">Autogenerated by doxygen on $date (Debian $projectnumber).</div></body></html>
Description: debianization -- help2man
Generate help2man man pages for the command line utilities.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-12
--- a/cmd/Makefile.am
+++ b/cmd/Makefile.am
@@ -8,7 +8,35 @@
-I $(top_srcdir) \
$(GSL_CFLAGS)
+man_MANS = \
+ apop_text_to_db.1 \
+ apop_db_to_crosstab.1 \
+ apop_plot_query.1
+
LDADD = \
$(top_builddir)/libapophenia.la \
$(GSL_LIBS)
+AM_H2MFLAGS = \
+ --manual="Apophenia" \
+ --version-string="$(PACKAGE_VERSION)" \
+ --source="Apophenia (Debian $(DEB_PKG_VERSION))" \
+ --libtool \
+ --no-info
+
+%.1: %
+ $(HELP2MAN) \
+ -s 1 \
+ $(AM_H2MFLAGS) \
+ -I $(top_srcdir)/debian/man/$(subst nauty-,,$*).h2m \
+ -n $(if $($(subst -,_,$*)_DESCRIPTION), $($(subst -,_,$*)_DESCRIPTION), "manual page for $*") \
+ -o $@ \
+ $(top_builddir)/cmd/$<
+
+## short descriptions inspired from the header of the C source files
+apop_text_to_db_DESCRIPTION = "command line utility to convert a text file into a database table"
+apop_db_to_crosstab_DESCRIPTION = "command line utility to convert a three-column table to a crosstab"
+apop_plot_query_DESCRIPTION = "command line utility to take in a query and put out a Gnuplot table file"
+
+CLEANFILES = \
+ $(man_MANS)
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,7 @@
gl_LD_VERSION_SCRIPT
# Checks for programs.
+AC_PATH_PROG([HELP2MAN],[help2man])
AC_PROG_CC
AC_PROG_CC_C99
Description: debianization
Meant to maintain a minimal debian/rules, to fix warnings,
to address Debian specific stuff in general.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-11
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -3,6 +3,8 @@
default:
+all: html
+
## adhoc
html man: doc
@@ -33,6 +35,8 @@
sed -i -f edit_globals.sed html/globals.html
sed -i -f edit_group.sed html/group__models.html
sed -i -f edit_width.sed html/*.html
+ rdfind -outputname /dev/null -makesymlinks true html
+ symlinks -r -c -s -v html
doc-clean:
-rm -rf html latex man
@@ -56,3 +60,12 @@
typical.css \
documentation.h
+
+if MAINTAINER_MODE
+
+DISTCLEANFILES = $(MAINTAINERCLEANFILES)
+
+distclean-local: doc-clean
+
+endif
+
--- a/docs/doxygen.conf.in
+++ b/docs/doxygen.conf.in
@@ -32,7 +32,7 @@
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER =
+PROJECT_NUMBER = "@DEB_PKG_VERSION@"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
@@ -687,7 +687,7 @@
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE =
+EXCLUDE = @abs_top_srcdir@/debian
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -1216,7 +1216,7 @@
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
-GENERATE_LATEX = YES
+GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -1357,7 +1357,7 @@
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
-GENERATE_MAN = YES
+GENERATE_MAN = NO
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,11 @@
AC_PATH_PROGS([SQLITE3],[sqlite3],[/usr/bin/sqlite3])
+# Debian stuff
+## Debian package version
+DEB_PKG_VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/Version: //p')
+AC_SUBST(DEB_PKG_VERSION)
+
AC_CONFIG_FILES([
apophenia.pc
Makefile
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@
dist-bzip2 \
dist-zip
-AM_CFLAGS = -g -Wall -O3
+AM_CFLAGS = -O3
## Library versioning (C:R:A == current:revision:age)
LIBAPOPHENIA_LT_VERSION = 0:0:0
upstream-rationalization-version_script.patch
upstream-doxygen-typo.patch
upstream-rationalization-autotools.patch
upstream-error-format_security.patch
upstream-C2help2man.patch
debianization.patch
debianization-help2man.patch
debianization-documentation.patch
debianization-bug-597187_757967-mysql_config.patch
debianization-adhoc.patch
Description: format usages and helps
Attempt to format and harmonize helps of the wrapper programs
wrt UN*X customs in view to employ help2man to generate manpages.
Origin: debian
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2014-08-14
--- a/cmd/apop_plot_query.c
+++ b/cmd/apop_plot_query.c
@@ -1,5 +1,5 @@
/** \file
- Command line utility to take in a query and put out a Gnuplottable file.
+ Command line utility to take in a query and put out a Gnuplot table file.
Copyright (c) 2006--2007 by Ben Klemens. Licensed under the modified GNU GPL v2; see COPYING and COPYING2. */
@@ -64,21 +64,24 @@
}
int main(int argc, char **argv){
- char c, *q = NULL,
+ char c, *q = NULL,
*d = NULL,
*outfile = NULL;
int sf = 0,
no_plot = 0;
- const char* msg= "%s [opts] dbname query\n\n"
+ const char* msg= "Usage: %s [opts] dbname query\n"
+"\n"
"Runs a query, and pipes the output directly to gnuplot. Use -f to dump to stdout or a file.\n"
-"-d\tdatabase to use\t\t\t\t\tmandatory \n"
-"-q\tquery to run\t\t\t\t\tmandatory (or use -Q)\n"
-"-Q\tfile from which to read the query\t\t\n"
-"-n\tno plot: just run the query and display results to stdout\t\t\n"
-"-t\tplot type (points, bars, ...)\t\t\tdefault=\"lines\"\n"
-"-H\tplot histogram with this many bins (e.g., -H100). To let the system auto-select bin sizes, use -H0 .\n"
-"-f\tfile to dump to. If -f- then use stdout.\tdefault=pipe to Gnuplot\n";
+" -d\tdatabase to use (mandatory)\n"
+" -q\tquery to run (mandatory or use -Q)\n"
+" -Q\tfile from which to read the query\t\t\n"
+" -n\tno plot: just run the query and display results to stdout\t\t\n"
+" -t\tplot type (points, bars, ...) (default: \"lines\")\n"
+" -H\tplot histogram with this many bins (e.g., -H100) (to let the system auto-select bin sizes, use -H0)\n"
+" -f\tfile to dump to. If -f- then use stdout (default: pipe to Gnuplot)\n"
+" -h\tdisplay this help and exit\n"
+"\n";
Apop_stopif(argc<2, return 1, 0, msg, argv[0]);
while ((c = getopt (argc, argv, "ad:f:hH:nQ:q:st:-")) != -1)
@@ -88,7 +91,7 @@
} else if (c=='H'){
histoplotting = 1;
histobins = atoi(optarg);
- }
+ }
else if (c=='h'||c=='-') {
printf(msg, argv[0]);
return 0;
@@ -104,7 +107,7 @@
q = argv[optind+1];
} else if (optind == argc-1)
q = argv[optind];
-
+
Apop_stopif(!q, return 1, 0, "I need a query specified with -q.\n");
if (!plot_type) plot_type = strdup("lines");
--- a/cmd/apop_db_to_crosstab.c
+++ b/cmd/apop_db_to_crosstab.c
@@ -8,16 +8,17 @@
int main(int argc, char **argv){
char c, verbose=0;
- char const *msg="%s [opts] dbname table_name rows columns data\n\n"
- "A command-line wrapper for the apop_db_to_crosstab function.\n"
- "See Apophenia's online documentation for that function for details and tricks.\n"
- "-d\tdelimiter\t\tdefault=<tab>\n"
- "-v\tverbose: prints status info on stderr\n"
- "-v -v\textra verbose: also print queries executed on stderr\n";
+ char const *msg="Usage: %s [opts] dbname table_name rows columns data\n"
+"\n"
+"A command-line wrapper for the apop_db_to_crosstab function.\n"
+"See Apophenia's online documentation for that function for details and tricks.\n"
+" -d\tdelimiter (default: <tab>)\n"
+" -v\tverbose: prints status info on stderr\n"
+" -v -v\tvery verbose: also print queries executed on stderr\n"
+" -h\tdisplay this help and exit\n"
+"\n";
- Apop_stopif(argc<5, return 1, 0, msg, argv[0]);
-
- apop_opts.verbose=0; //so don't print queries until -v -v.
+ apop_opts.verbose=0; //so don't print queries until -v -v.
while ((c = getopt (argc, argv, "d:f:hv-")) != -1)
if (c=='d') strcpy(apop_opts.output_delimiter,optarg);
@@ -33,6 +34,6 @@
argv[optind], argv[optind +1], argv[optind+2], argv[optind+3], argv[optind+4]);
}
apop_db_open(argv[optind]);
- apop_data *m = apop_db_to_crosstab(argv[optind +1], argv[optind+2], argv[optind+3], argv[optind+4]);
+ apop_data *m = apop_db_to_crosstab(argv[optind +1], argv[optind+2], argv[optind+3], argv[optind+4]);
apop_data_print(m);
}
--- a/cmd/apop_text_to_db.c
+++ b/cmd/apop_text_to_db.c
@@ -25,28 +25,29 @@
tab_exists_check = 0;
char **field_names = NULL;
- Asprintf(&msg, "%s [-d delimiters] text_file table_name dbname\n"
- "e.g.: %s -d\",|\" infile.txt a_table info.db\n"
+ Asprintf(&msg, "Usage: %s [-d delimiters] text_file table_name dbname\n"
+"\n"
"If the input text file name is a single dash, -, then read from STDIN.\n"
"Input must be plain ASCII or UTF-8.\n"
-"-d\t\tThe single-character delimiters to use, e.g., -d \" ,\" or -d \"\\t\" (which you \n"
-"\t\t\twill almost certainly have to write as -d \"\\\\t\"). Default: \"|,\\t\", meaning \n"