From: Wouter Verhelst Date: Sat, 28 May 2011 09:02:07 +0000 (+0200) Subject: Merge branch 'alex' X-Git-Url: http://git.alex.org.uk?hp=1497866741e7fe685e634825791e3370665bd6e5 Merge branch 'alex' --- diff --git a/Makefile.am b/Makefile.am index 41e6358..8c51576 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = man -bin_PROGRAMS = nbd-server +bin_PROGRAMS = nbd-server nbd-trdump sbin_PROGRAMS = @NBD_CLIENT_NAME@ -EXTRA_PROGRAMS = nbd-client knbd-client nbd-trdump +EXTRA_PROGRAMS = nbd-client knbd-client TESTS_ENVIRONMENT=$(srcdir)/simple_test TESTS = cmd cfg1 cfgmulti cfgnew cfgsize write flush integrity check_PROGRAMS = nbd-tester-client diff --git a/autogen.sh b/autogen.sh index 0719077..a8fbf14 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ #!/bin/sh set -ex -make -C man -f Makefile.am nbd-server.1.sh.in nbd-server.5.sh.in nbd-client.8.sh.in nbd-trdump.8.sh.in +make -C man -f Makefile.am nbd-server.1.sh.in nbd-server.5.sh.in nbd-client.8.sh.in nbd-trdump.1.sh.in exec autoreconf -f -i diff --git a/configure.ac b/configure.ac index 6ebfa1a..e928aa3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Configure script for NBD system dnl (c) 1998 Martin Mares , (c) 2000 Pavel Machek , dnl (c) 2003-2006 Wouter Verhelst -AC_INIT([nbd],[2.9.21a],[wouter@debian.org]) +AC_INIT([nbd],[2.9.22],[wouter@debian.org]) AM_INIT_AUTOMAKE(foreign dist-bzip2) AM_MAINTAINER_MODE @@ -123,6 +123,6 @@ AC_TYPE_PID_T nbd_server_CPPFLAGS=$nbd_server_CPPFLAGS" -DSYSCONFDIR='\"$sysconfdir\"'" AC_SUBST(nbd_server_CPPFLAGS) AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile doc/Doxyfile man/Makefile man/nbd-client.8.sh man/nbd-server.5.sh man/nbd-server.1.sh man/nbd-trdump.8.sh]) +AC_CONFIG_FILES([Makefile doc/Doxyfile man/Makefile man/nbd-client.8.sh man/nbd-server.5.sh man/nbd-server.1.sh man/nbd-trdump.1.sh]) AC_OUTPUT diff --git a/man/Makefile.am b/man/Makefile.am index 2d1de20..10d244f 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,8 +1,8 @@ -man_MANS = nbd-server.1 nbd-server.5 nbd-client.8 nbd-trdump.8 +man_MANS = nbd-server.1 nbd-server.5 nbd-client.8 nbd-trdump.1 CLEANFILES = manpage.links manpage.refs -DISTCLEANFILES = nbd-server.1 nbd-client.8 nbd-server.5 nbd-trdump.8 -MAINTAINERCLEANFILES = nbd-server.1.sh.in nbd-client.8.sh.in nbd-server.5.sh.in nbd-trdump.8.sh.in -EXTRA_DIST = nbd-server.1.in.sgml nbd-client.8.in.sgml nbd-server.5.in.sgml nbd-trdump.8.in.sgml nbd-server.1.sh.in nbd-server.5.sh.in nbd-client.8.sh.in nbd-trdump.8.sh.in sh.tmpl +DISTCLEANFILES = nbd-server.1 nbd-client.8 nbd-server.5 nbd-trdump.1 +MAINTAINERCLEANFILES = nbd-server.1.sh.in nbd-client.8.sh.in nbd-server.5.sh.in nbd-trdump.1.sh.in +EXTRA_DIST = nbd-server.1.in.sgml nbd-client.8.in.sgml nbd-server.5.in.sgml nbd-trdump.1.in.sgml nbd-server.1.sh.in nbd-server.5.sh.in nbd-client.8.sh.in nbd-trdump.1.sh.in sh.tmpl nbd-server.1: nbd-server.1.sh sh nbd-server.1.sh > nbd-server.1 @@ -10,8 +10,8 @@ nbd-server.5: nbd-server.5.sh sh nbd-server.5.sh > nbd-server.5 nbd-client.8: nbd-client.8.sh sh nbd-client.8.sh > nbd-client.8 -nbd-trdump.8: nbd-trdump.8.sh - sh nbd-trdump.8.sh > nbd-trdump.8 +nbd-trdump.1: nbd-trdump.1.sh + sh nbd-trdump.1.sh > nbd-trdump.1 nbd-server.1.sh.in: nbd-server.1.in.sgml sh.tmpl LC_ALL=C docbook2man nbd-server.1.in.sgml cat sh.tmpl > nbd-server.1.sh.in @@ -30,9 +30,9 @@ nbd-server.5.sh.in: nbd-server.5.in.sgml sh.tmpl cat NBD-SERVER.5 >> nbd-server.5.sh.in echo "EOF" >> nbd-server.5.sh.in rm NBD-SERVER.5 -nbd-trdump.8.sh.in: nbd-trdump.8.in.sgml sh.tmpl - LC_ALL=C docbook2man nbd-trdump.8.in.sgml - cat sh.tmpl > nbd-trdump.8.sh.in - cat NBD-TRDUMP.8 >> nbd-trdump.8.sh.in - echo "EOF" >> nbd-trdump.8.sh.in - rm NBD-TRDUMP.8 +nbd-trdump.1.sh.in: nbd-trdump.1.in.sgml sh.tmpl + LC_ALL=C docbook2man nbd-trdump.1.in.sgml + cat sh.tmpl > nbd-trdump.1.sh.in + cat NBD-TRDUMP.1 >> nbd-trdump.1.sh.in + echo "EOF" >> nbd-trdump.1.sh.in + rm NBD-TRDUMP.1 diff --git a/man/nbd-trdump.1.in.sgml b/man/nbd-trdump.1.in.sgml new file mode 100644 index 0000000..4e58617 --- /dev/null +++ b/man/nbd-trdump.1.in.sgml @@ -0,0 +1,143 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + --> + + + Wouter"> + Verhelst"> + + $Date$"> + + 1"> + wouter@debian.org"> + + NBD-TRDUMP"> + + + Debian GNU/Linux"> + GNU"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2001 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + translate an nbd transaction log into human readable form + + + + &dhpackage; + + + + DESCRIPTION + + &dhpackage; translates + a transaction log produced by nbd-server + (specifically by the transactionlog + configuration directive) into human readable form. + + The command acts as a traditional UNIX filter, i.e. the + transaction log must be supplied on standard input, and the + human readable output is sent to standard output. + + + OUTPUT + + The following may be output: + + + + + + A request packet sent from the client to the server. + + + + + + A reply packet sent from the server to the client. + + + + + + The handle of the packet. + + + + + + The command sent. + + + + + + The offet from the start of the disk. + + + + + + The length of data. + + + + + + The error returned. + + + + + + SEE ALSO + + nbd-server (1). + + + + AUTHOR + The NBD kernel module and the NBD tools have been written by + Pavel Macheck (pavel@ucw.cz). + + The kernel module is now maintained by Paul Clements + (Paul.Clements@steeleye.com), while the userland tools are maintained by + Wouter Verhelst (wouter@debian.org) + + This manual page was written by &dhusername; (&dhemail;) for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under the + terms of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + +
diff --git a/man/nbd-trdump.8.in.sgml b/man/nbd-trdump.8.in.sgml deleted file mode 100644 index d047f59..0000000 --- a/man/nbd-trdump.8.in.sgml +++ /dev/null @@ -1,143 +0,0 @@ - manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | - less'. A typical entry in a Makefile or Makefile.am is: - -manpage.1: manpage.sgml - docbook-to-man $< > $@ - --> - - - Wouter"> - Verhelst"> - - $Date$"> - - 8"> - wouter@debian.org"> - - NBD-TRDUMP"> - - - Debian GNU/Linux"> - GNU"> -]> - - - -
- &dhemail; -
- - &dhfirstname; - &dhsurname; - - - 2001 - &dhusername; - - &dhdate; -
- - &dhucpackage; - - &dhsection; - - - &dhpackage; - - translate an nbd transaction log into human readable form - - - - &dhpackage; - - - - DESCRIPTION - - &dhpackage; translates - a transaction log produced by nbd-server - (specifically by the transactionlog - configuration directive) into human readable form. - - The command acts as a traditional UNIX filter, i.e. the - transaction log must be supplied on standard input, and the - human readable output is sent to standard output. - - - OUTPUT - - The following may be output: - - - - - - A request packet sent from the client to the server. - - - - - - A reply packet sent from the server to the client. - - - - - - The handle of the packet. - - - - - - The command sent. - - - - - - The offet from the start of the disk. - - - - - - The length of data. - - - - - - The error returned. - - - - - - SEE ALSO - - nbd-server (1). - - - - AUTHOR - The NBD kernel module and the NBD tools have been written by - Pavel Macheck (pavel@ucw.cz). - - The kernel module is now maintained by Paul Clements - (Paul.Clements@steeleye.com), while the userland tools are maintained by - Wouter Verhelst (wouter@debian.org) - - This manual page was written by &dhusername; (&dhemail;) for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document under the - terms of the GNU General Public License, - version 2, as published by the Free Software Foundation. - - -
diff --git a/nbd-trdump.c b/nbd-trdump.c index 49f4f9e..82b7688 100644 --- a/nbd-trdump.c +++ b/nbd-trdump.c @@ -43,6 +43,17 @@ int main(int argc, char**argv) { char * ctext; int readfd = 0; /* stdin */ + if(argc > 1) { + int retval=0; + if(strcmp(argv[1], "--help") && strcmp(argv[1], "-h")) { + printf("E: unknown option %s.\n", argv[1]); + retval=1; + } + printf("This is nbd-trdump, part of nbd %s.\n", PACKAGE_VERSION); + printf("Use: %s < transactionlog\n", argv[0]); + return retval; + } + while (1) { /* Read a request or reply from the transaction file */ doread(readfd, &magic, sizeof(magic));