From: Bdale Garbee Date: Sun, 15 Feb 2009 19:41:13 +0000 (-0700) Subject: Imported Upstream version 2.6.1 X-Git-Tag: upstream/2.6.1^0 X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=commitdiff_plain;h=2627875b7d18858bc1f9f7652811e4d8c15a23eb Imported Upstream version 2.6.1 --- diff --git a/ChangeLog b/ChangeLog index e671971..a37ffb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,39 +1,1171 @@ -2008-08-22 Jean-Louis Martineau - * configure.in, packaging/deb/rules, - packaging/deb/buildpkg, packaging/rpm/buildpkg, - packaging/rpm/amanda.spec: Change release to 2.6.0p2 - * NEWS: News in 2.6.0p2 +2009-01-22 Jean-Louis Martineau + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.1") + * packaging/deb/rules, packaging/deb/buildpkg, packaging/deb/changelog, + packaging/rpm/buildpkg, + packaging/rpm/amanda.spec: Change version to 2.6.1. + +2009-01-22 Jean-Louis Martineau + * man/xml-source/amstar.8.xml: Typo. + +2009-01-21 Jean-Louis Martineau + * server-src/driver.c: Add call to short_dump_state(). + +2009-01-21 Jean-Louis Martineau + * server-src/reporter.c: Set exit_status to STATUS_TAPE if taper crash. + +2009-01-21 Jean-Louis Martineau , + Dustin J. Mitchell + * common-src/fileheader.c: Remove strquotedstr function. + * common-src/quoting-test.c: Test strquotedstr function. + * common-src/util.c: Add prototype for strquotedstr function. + * common-src/util.h: Add new strquotedstr function. + +2009-01-21 Jean-Louis Martineau + * application-src/Makefile.am: Typo + +2009-01-21 Dustin J. Mitchell + Patch suggested by Ingo Schaefer + * packaging/rpm/amanda.spec: detect and properly support suse11.1, + with a temporary hack to support suse11, too + +2009-01-21 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Typo. + +2009-01-21 Jean-Louis Martineau + * server-src/amstatus.pl: Fix use of %free and %qlen keys. + +2009-01-20 Dan Locks + * packaging/rpm/amanda.spec: add missing BuildRequires, conditionalize + libtermcap.so.2 for fedora, change tar requirement to %{tarver} + +2009-01-20 Dan Locks + * packaging/rpm/amanda.spec: add %{PERLSITELIB} to %files section to + install perl for the client package add "directory mode" to defattr + statements where appropriate. + +2009-01-19 Jean-Louis Martineau + * server-src/diskfile.c: Use dp->hostnext to scan dles of a host. + +2009-01-19 Jean-Louis Martineau + * device-src/vfs-device.c: robust_open can return fd 0. + +2009-01-19 Tom Robinson + * server-src/amoverview.pl: fix parsing of filenames containing colons + +2009-01-19 Jean-Louis Martineau + * application-src/amzfs-sendrecv.pl: Handle incremental, + new KEEP-SNAPSHOT property. + * man/xml-source/amzfs-sendrecv.8.xml: Document it. + * application-src/teecount.c: New program. + * application-src/Makefile.am: Add teecount. + * perl/Amanda/Application/Zfs.pm: Work with 'current' snapshot. + * common-src/amanda.h: include "safe-read.h" + +2009-01-17 Jean-Louis Martineau + * server-src/amstatus.pl: Don't add 'dump to tape' in the 'dumped' + result. + +2009-01-16 Dan Locks + * packaging/rpm/amanda.spec: fix the fedora 10 fix for other distros + +2009-01-16 Dustin J. Mitchell + * device-src/vfs-device.c: don't cache the dir_handle, as + such caching does not work on some network filesystems + +2009-01-16 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Fix for fedora 10. + +2009-01-16 Dustin J. Mitchell + * device-src/amtapetype.pl: remove call to old device function + +2009-01-16 Jean-Louis Martineau + * server-src/driver.c: Use bitwise NOT for taper_state. + +2009-01-16 Jean-Louis Martineau + * server-src/taper.c: Go to next tape if device_start_file fail. + * device-src/tape-device.c: write a filemark when a file is finished. + * device-src/tape-device.h (TapeDevice): Remove first_file. + +2009-01-16 Jean-Louis Martineau + * client-src/sendbackup.c: Fix for no index with application. + * application-src/amstar.c: Improve error reporting. + * application-src/amgtar.c: Improve error reporting. + +2009-01-14 Jean-Louis Martineau + * application-src/amgtar.c: Add TAR-BLOCKSIZE property. + * man/xml-source/amgtar.8.xml; document TAR-BLOCKSIZE property. + +2009-01-13 Jean-Louis Martineau + * server-src/amcheck.c: Check fallback_splitsize is smaller than + physmem_total(). + * server-src/taper-mem-port-source.c: Dont; check physmem_available. + +2009-01-12 Jean-Louis Martineau + * server-src/server_util.c: New get_pending_cmd function. + * server-src/server_util.h: get_pending_cmd prototype. + * server-src/driver.c: Send message to dumper in ABORT command. + * server-src/driverio.c: Send message to dumper in ABORT command. + * server-src/dumper.c: Check for ABORT cmd. + * server-src/reporter.c: Don't log duplicate + 'Not enough holding disk space' error + +2009-01-12 Jean-Louis Martineau + * server-src/driver.c: Fix result_argv subscript. + +2009-01-08 Jean-Louis Martineau + * restore-src/amfetchdump.c: Write to stderr. + +2009-01-06 Jean-Louis Martineau + * device-src/tape-device.c (tape_device_seek_file): Set is_eof to FALSE + after it is use. + +2009-01-06 Jean-Louis Martineau + * server-src/taper.c: Don't call changer_label() if a changer is not + in use. + +2009-01-06 Jean-Louis Martineau + * server-src/driverio.c: Set *result_argv to NULL on EOF. + * server-src/taper-mem-port-source.c: Set an error if the memory can't + be allocated for the memory buffer. + +2009-01-05 Dustin J. Mitchell + * client-src/runtar.c: remove unnecessary check for existence of + CLIENT_LOGIN + +2009-01-05 Jean-Louis Martineau + * perl/Amanda/Archive.swg, perl/Amanda/Device.swg, + perl/Amanda/Xfer.swg: Fix compiler warning. + +2009-01-05 Jean-Louis Martineau + * config/automake/scripts.am: Remove 'use lib' line before doing check. + +2008-12-22 Jean-Louis Martineau + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.1b2") + * packaging/deb/rules, packaging/deb/buildpkg, + packaging/deb/changelog, packaging/rpm/buildpkg, + packaging/rpm/amanda.spec: Change version to 2.6.1b2. + +2008-12-22 Paul Yeatman + * man/entities/global.entities.in: added author/email entity for me + * man/xml-source/amanda-auth.7.xml: newly added man page + * man/Makefile.am: added amanda-auth to section 7 + * man/xml-source/amanda.conf.5.xml: removed details on auth parameter + and added link to amanda-auth man page + * man/xml-source/amanda.conf.5.xml: moved AUTHORIZATION section to + amanda-auth and added link to amanda-auth man page + +2008-12-22 Nikolas Coukouma + * device-src/s3.c: retry on CURLE_GOT_NOTHING (52) to handle "connection reset by peer" + +2008-12-22 Dustin J. Mitchell + * device-src/s3.c: translate error code 0 to "None", not NULL + +2008-12-22 Dustin J. Mitchell + * application-src/amgtar.c, + application-src/amstar.c: Use sizeof(line) for argument to fgets. + +2008-12-22 Jean-Louis Martineau + * man/xml-source/amarchiver.8.xml: amanda-archive-format man page is + in section 5. + +2008-12-22 Dustin J. Mitchell + * installcheck/Installcheck/Dumpcache.pm + installcheck/Installcheck/Run.pm installcheck/amdump.pl + installcheck/pp-scripts.pl: move amdump_diag to Installcheck::Run, fix + it, and use it in amdump and pp-scripts + * application-src/amlog-script.pl: don't pretend to be script-email + * man/Makefile.am: amanda-archive-format should be section 5 + * man/xml-source/amanda-archive-format.5.xml: small tweaks + * man/xml-source/amanda-changers.7.xml: fix authorship + * man/xml-source/amanda.8.xml: add link to amvault(8) + * man/xml-source/amvault.8.xml: enumerate limitations of this version + * perl/Amanda/Config.swg: fix mem leak in config_dir_relative wrapper + +2008-12-22 Dustin J. Mitchell + * config/amanda/dirs.m4: add --with-amdatadir + * example/Makefile.am: use it for examples and templates + * perl/Amanda/Paths.pm.in: add $amdatadir + * server-src/amserverconfig.pl: use it + * packaging/deb/rules packaging/rpm/amanda.spec: packaging changes + so that built packages still put examples and templates in + /var/lib/amanda + +2008-12-22 Jean-Louis Martineau + * application-src/amstar.c: Use fgets to read star output. + * application-src/amgtar.c: Use fgets to read gtar output. + +2008-12-22 Jean-Louis Martineau , + Dustin J. Mitchell + * common-src/util.c: Convert underscore in application and script + property name to dash. + * device-src/property.c: Make underscore and dash equal in device + property name. + * installcheck/Amanda_Device.pl: Check device property name with + mixed case and dash. + * installcheck/pp-scripts.pl: Check property name with underscore. + +2008-12-22 Jean-Louis Martineau + * server-src/reporter.c: Fix reporting of FLUSH. + +2008-12-19 Nikolas Coukouma , Dustin J. Mitchell + * device-src/s3-device.c, device-src/s3.c, device-src/s3.h: + Reset read and write when retrying a failed request + +2008-12-19 Jean-Louis Martineau + * server-src/holding.c (holding_get_file_chunks): Set fullpaths to 1. + +2008-12-18 Jean-Louis Martineau + * common-src/security-util.c: Don't free 'rc'. + +2008-12-18 Jean-Louis Martineau + * man/xml-source/amgtar.8.xml: Improve documentation of regex. + +2008-12-18 Jean-Louis Martineau + * common-src/conffile.h (anonymous_value): New prototype. + * common-src/conffile.c (anonymous_value): New function. + * common-src/conffile.c: Use anonymous_value. + * server-src/diskfile.c: Use anonymous_value. + +2008-12-17 Jean-Louis Martineau + * perl/Amanda/Script_App.pm: Fix infinite loop. + * perl/Amanda/Application/Zfs.pm: Fix for freebsd. + +2008-12-17 Jean-Louis Martineau + * server-src/planner.c: Run script only if todo is set. + +2008-12-17 Jean-Louis Martineau + * installcheck/amfetchdump.pl: chdir() before rmtree(). + +2008-12-17 Jean-Louis Martineau + * common-src/pipespawn.c: Remove bogus g_debug(). + +2008-12-17 Jean-Louis Martineau + * installcheck/amarchiver.pl: chdir() before rmtree(). + * installcheck/amcheckdump.pl: Add reason to BAIL_OUT. + * installcheck/amdevcheck.pl: Add reason to BAIL_OUT. + +2008-12-07 Satya Ganga + * changer-src/chg-lib.sh.in: Remove dependency on ggrep and use mtx + offline command instead of "eject" which is not supported on solaris. + +2008-12-17 Dan Locks + * config/amanda/changer.m4: update AC_CHECK_HEADERS to get rid of + "present but cannot be compiled" warning during debian packaging. + +2008-12-17 Dan Locks + * packaging/rpm/amanda.spec: add detection for SLES11 (Beta) + +2008-12-17 Dustin J. Mitchell + * man/xml-source/amgtar.8.xml: atime_preserve -> atime-preserve + * installcheck/pp-scripts.pl: add atime-preserve property, remove + references to Installcheck::Dumpcache, which isn't in this release + +2008-12-16 Dustin J. Mitchell + * man/xslt/html.xsl.in: add
for the benefit + of amanda.css. + +2008-12-16 Jean-Louis Martineau + * common-src/security-util.c: Don't close if it's not open. + +2008-12-16 Jean-Louis Martineau + * application-src/Makefile.am: Add amlog-script. + * application-src/amlog-script.pl: New scripts. + * server-src/amcheck.c , server-src/planner.c, + server-src/server_util.c, server-src/server_util.h, + server-src/driver.c: Add level argument to run_server_scripts(). + The script is executed with that level argument. + * installcheck/pp-scripts.pl: Check scripts. + * installcheck/Makefile.am: Add pp-scripts. + +2008-12-16 Dustin J. Mitchell + * man/Makefile.am man/xml-source/amanda-changers.7.xml + man/xml-source/amanda-devices.7.xml man/xml-source/amanda.8.xml + man/xml-source/amanda.conf.5.xml: new documentation + * perl/Amanda/Changer.pm: not finished yet! + * perl/Amanda/Changer/compat.pm: fix error message + * server-src/changer.c changer-src/chg-glue.pl: + better error handling + +2008-12-16 Dustin J. Mitchell + * changer-src/chg-glue.pl: add labelling support + * perl/Amanda/Changer/compat.pm: only call '-label' on chg-zd-mtx if + the changer is not seekable (hack to make slotinfofile work) + * changer-src/chg-zd-mtx.sh: provide optional slotinfofile mapping + slots to labels on a best-information-available basis + +2008-12-15 Jean-Louis Martineau + * amandad-src/amandad.c: Set wait_30s to 0 for local auth. + +2008-12-15 Dustin J. Mitchell + * installcheck/Amanda_Config.pl: work around buggy sort() in perl-5.6 + * installcheck/Amanda_DB_Catalog.pl installcheck/Amanda_Logfile.pl: + stringify bigints in is_deeply arguments + * perl/Amanda/Archive.swg: grok_number is not in perl-5.6 + * perl/Amanda/BigIntCompat.pm: additional overloads and methods for + BigIntCompat for perl-5.6 compatibility + +2008-12-14 Dustin J. Mitchell + * man/Makefile.am: change manpage build process + * man/entities/global.entities.in: generate with config.status + * man/xslt/html.xsl.in: new templates to handle authors + * man/xslt/man.xsl.in: new templates to handle authors + * man/xml-source/*.xml: change specification of authors + * man/xml-source/amanda-applications.7.xml: add links to apps + * man/xml-source/amanda-scripts.7.xml: add links to scripts + +2008-12-12 John Hein + * server-src/amdump.sh: fix Open3 invocation to work on + FreeBSD-4.x + +2008-12-12 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Fix use of , it must + always be at the beginning of the line. + +2008-12-12 Jean-Louis Martineau + * application-src/amgtar.c: Fix coredump if GNUTAR is not set. + +2008-12-12 Dustin J. Mitchell + * client-src/sendbackup-dump.c: fix previous commit to not use + precompiler directives in the middle of a macro invocation + +2008-12-12 Jean-Louis Martineau + * NEWS, ReleaseNotes: Add amzfs-sendrecv. + * client-src/sendbackup.c: Fix indexd test. + * man/Makefile.am: Add amzfs-sendrecv.8. + * man/xml-source/amzfs-snapshot.8.xml: Add DLE format example. + * man/xml-source/amanda-applications.7.xml: Add amzfs-sendrecv.8. + * man/xml-source/amanda.8.xml: Add amzfs-sendrecv.8. + * man/xml-source/amzfs-sendrecv.8.xml: New man page. + * application-src/amzfs-sendrecv.pl: New application. + * application-src/amzfs-snapshot.pl: Fix to use + Amanda::Application::Zfs + * application-src/Makefile.am: Add amzfs-sendrecv. + * perl/Amanda/Script_App.pm: Exit instead of die. + * perl/Amanda/Application/Zfs.pm: New perl module for zfs. + * perl/Makefile.am: Add Amanda/Application and + Amanda/Application/Zfs.pm + +2008-12-12 Jean-Louis Martineau + * recover-src/extract_list.c: Wait to read at least one byte from the + data stream before forking the child. + +2008-12-12 Jun Kuriyama , Göran Löwkran + * changer-src/chg-zd-mtx.sh: fix bashisms + * client-src/sendbackup-dump.c: use -L on systems that support it + +2008-12-11 Jean-Louis Martineau + * NEWS, ReleaseNotes: Add amsamba. + +2008-12-11 Jean-Louis Martineau + * server-src/driver.c: Check start_t before doing a dump to tape. + +2008-12-09 C R Ritson. + * server-src/reporter.c: Add threshold to small and big estimate. + +2008-12-09 Jean-Louis Martineau + * client-src/client_util.c: Parse RECOVER-MODE application support. + * client-src/client_util.h (backup_support_option_t): + Add smb_recover_mode. + * client-src/sendsize.c: Fix size. + * man/Makefile.am: Add amsamba.8. + * man/xml-source/amsamba.8.xml: New man page. + * man/xml-source/amanda-applications.7.xml: List amsamba. + * man/xml-source/amanda.8.xml: List amsamba. + * application-src/Makefile.am (CHECK_PERL): Add amsamba + * application-src/amsamba.pl: New application. + * recover-src/extract_list.c: Get support option from application + and set --recover-mode if needed. + * recover-src/amrecover.h: Remove some "#ifdef SAMBA_CLIENT". + * recover-src/set_commands.c: Remove some "#ifdef SAMBA_CLIENT". + * perl/Amanda/Paths.pm.in: Add $sysconfdir. + * perl/Amanda/Util.swg: Add skip_quoted_string. + +2008-12-09 Jean-Louis Martineau + * man/xml-source/amstar.8.xml: Typo. + +2008-12-09 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Fix plugin location. + +2008-12-07 Dustin J. Mitchell + * server-src/Makefile.am server-src/amvault.pl: new, experimental + script to copy data from secondary to tertiary volumes + * common-src/fileheader.c: strip spurious ' ' from headers + * man/Makefile.am man/xml-source/amvault.8.xml: docs + * perl/Amanda/DB/Catalog.pm: add kbps calculation + * perl/Amanda/Device.swg: add volume_header() method + +2008-12-05 Dustin J. Mitchell + * server-src/taper.c: remove dead code that can cause compiler errors + +2008-12-05 Jean-Louis Martineau + * server-src/driverio.c: Send a message with NO-NEW-TAPE. + * server-src/driver.c: Generate message for NO-NEW-TAPE, call + start_degraded_mode when sending NO-NEW-TAPE, Fix a subscript error + for INPUT-ERROR and TAPE-ERROR + * server-src/taper.c: Get message from NO-NEW-TAPE command and log it. + +2008-12-03 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Provide default unit. + +2008-12-03 Jean-Louis Martineau + * server-src/amcheckdump.pl: Use GNUTAR to validate smbclient image. + +2008-12-01 Nikolas Coukouma + * device-src/s3.c: fix signedness + +2008-12-01 Dustin J. Mitchell + * common-src/util.c: fix mishandling of trailing backslash in + unquote_string + +2008-12-01 Nikolas Coukouma + * device-src/s3.c, device-src/s3.h: Fix segmentation fault within s3_make_bucket + by adding some "null-op" read and write functions. + +2008-11-27 Jean-Louis Martineau + * server-src/amstatus.pl: Correctly parse degraded size. + +2008-11-26 Jean-Louis Martineau + * client-src/sendbackup.c: Set application in extraction command. + +2008-11-25 Jean-Louis Martineau + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.1b1") + * ReleaseNotes: Release notes for 2.6.1b1. + * NEWS: News for 2.6.1b1. + * packaging/deb/rules, packaging/deb/buildpkg, + packaging/rpm/buildpkg, + packaging/rpm/amanda.spec: Change version to 2.6.1b1. + +2008-11-25 Jean-Louis Martineau + * config/amanda/bsd-security.m4: Fix. + * config/amanda/bsdtcp-security.m4: Enable --with-bsdtcp-secutiy by + default. + * config/amanda/ssh-security.m4: Enable --with-ssh-security by default. + +2008-11-25 Dustin J. Mitchell + * changer-src/Makefile.am changer-src/chg-glue.pl: + add new c-to-perl glue script + * server-src/changer.c: interface with new script + * server-src/amtape.c man/xml-source/amtape.8.xml: + remove 'slot last' and 'slot prev' + * perl/Amanda/Changer.pm perl/Amanda/Changer/compat.pm + perl/Amanda/Changer/disk.pm perl/Amanda/Changer/single.pm: updates to + new Changer API + * installcheck/Amanda_Changer.pl installcheck/Amanda_Changer_compat.pl + installcheck/Amanda_Changer_disk.pl installcheck/Amanda_Changer_single.pl + installcheck/Makefile.am: tests for all of it + +2008-11-25 Dustin J. Mitchell + * example/template.d/advanced.conf.in: don't imply that + maxdumpsize is in bytes + +2008-11-21 Nikolas Coukouma + * device-src/s3.c: work around a bug in Amazon's HTTP implementation + by avoiding HEAD requests. + +2008-11-21 Jean-Louis Martineau + * server-src/diskfile.c (clean_dle_str_for_client): Return NULL if + argument is NULL. + * restore-src/restore.c: Also check for F_EMPTY. + +2008-11-21 Jean-Louis Martineau + * amandad-src/amandad.c: Wait up to 5 seconds dwfor only for process + that should terminate. + +2008-11-21 Dustin J. Mitchell + * restore-src/restore.c: Continue if setting PROPERTY_READ_BUFFER_SIZE + fail. + +2008-11-20 Jean-Louis Martineau + * server-src/server_util.c: Skip one field in parsing INFO pid line. + +2008-11-20 Jean-Louis Martineau + * oldrecover-src/extract_list.c: Use config. + * server-src/dumper.c: Check dle_str for NULL. + +2008-11-20 Jean-Louis Martineau + * server-src/amdump.sh: Run amreport if the 'log' file already exist. + +2008-11-20 Urs Schurer + * server-src/amindexd.c: remove unnecessary stralloc()/free() calls + in process_ls_dump + +2008-11-19 Satya Ganga + * example/inetd.conf.amandaserver.in: Add serverconfig file + * configure.in,example/Makefile.am: Include inetd.conf.amandaserver + +2008-11-18 Dan Locks + * packaging/rpm/amanda.spec: removed conditionals around + perl(ExtUtils::Embed) so that buildrequires applies to all platforms + +2008-11-18 Satya Ganga + * device-src/tape-device.c: Remove O_NONBLOCK flag from all tape open calls. + +2008-11-18 Jean-Louis Martineau + * application-src/amstar.c: Free qdisk after the loop. + * application-src/amgtar.c: Free qdisk after the loop. + +2008-11-17 Jean-Louis Martineau + * man/xml-source/amgtar.8.xml: Update for ATIME-PRESERVE default. + +2008-11-17 Jean-Louis Martineau + * server-src/taper.c: Fix formating. + +2008-11-17 Jean-Louis Martineau + * server-src/amstatus.pl: Parse "taper: using label ..." line. + * server-src/driver.c: Print tape size. + * server-src/amtoc.pl: Fix for new log format. + * server-src/reporter.c: Increase field width. + * server-src/taper.c: Print number of kbytes written to each tape. + +2008-11-14 Dustin J. Mitchell + * device-src/s3-device.c: eliminate an extra buffer copy in the + common case where the caller supplies a large enough buffer + * device-src/s3.h: tweak a comment + +2008-11-14 Jean-Louis Martineau + * server-src/holding.h: Improve comment. + * server-src/reporter.c: Print holding disk size in displyaunit. + +2008-11-14 Jean-Louis Martineau + * client-src/client_util.c: Get stderr of scripts and send it to + server. + * client-src/client_util.h: Add err in client_script_result_t. + * client-src/sendbackup.c: Call run_client_scripts with mesgstream. + * client-src/sendsize.c: Fix. + * server-src/planner.c: Get WARNING line from client. + * server-src/reporter.c: Don't mark the dumper as FAILED if the + planner FAILED. + * common-src/amfeatures.h (fe_sendsize_rep_warning): New amfeature + * common-src/amfeatures.c: Add fe_sendsize_rep_warning. + +2008-11-12 Dustin J. Mitchell + * man/xml-source/amfetchdump.8.xml: fix ugly HTML formatting + +2008-11-11 Jean-Louis Martineau + * amandad-src/amandad.c: Check that something is ready to be read + before calling errfd_recv. + +2008-11-11 Dustin J. Mitchell + * changer-src/chg-manual.sh: fix typo + +2008-11-11 Dan Locks + * packaging/rpm/amanda.spec: add fedora 9 detection, add + BuildRequires: perl(ExtUtils::Embed), fix %{dist}=unknown when + undetected instead of at all times + +2008-11-11 Dustin J. Mitchell + * installcheck/Makefile.am installcheck/amfetchdump.pl: build all + active test scripts; add a DLE in the amfetchdump installcheck + +2008-11-11 Dustin J. Mitchell + * config/macro-archive/ac_perl_module_version.m4: new macro + * config/amanda/swig.m4: check for ExtUtils::Embed + +2008-11-11 Dustin J. Mitchell + * installcheck/amarchiver.pl: quote $sbindir from regexp + interpretation + +2008-11-11 Jean-Louis Martineau + * perl/Makefile.am: Don't add Amanda/Script_App.pm and Amanda/Script.pm + to DISTCLEANFILES. + +2008-11-11 Jean-Louis Martineau + * installcheck/amdump.pl: Set property "ATIME-PRESERVE" to "NO" in + amgtar application. + +2008-11-11 Jean-Louis Martineau + * client-src/selfcheck.c: fix. + * amandad-src/amandad.c: Read stderr of server and report it to server. + * server-src/planner.c: Keep first line only. + +2008-11-10 Dustin J. Mitchell + * amar-src/amarchiver.c: fix filesize printf conversion + +2008-11-10 Jean-Louis Martineau + * client-src/sendbackup.c, client-src/selfcheck.c: Check return + value of pipe. + +2008-11-10 Dustin J. Mitchell + * installcheck/Installcheck/Run.pm: change default DLEs + * installcheck/amcheckdump.pl: add DLE explicitly + * installcheck/amdevcheck.pl: add DLE explicitly + * installcheck/amdump.pl: use the amgtar application in a dump + +2008-11-10 Dustin J. Mitchell + * installcheck/Makefile.am: only test amfetchdump if it was built + * installcheck/amfetchdump.pl: use arguments in the right order + +2008-11-10 Dustin J. Mitchell + * perl/Amanda/Archive.swg amar-src/amar.c amar-src/amar.h: bugfixes + * man/Makefile.am man/xml-source/amarchiver.8.xml + amar-src/Makefile.am amar-src/amarchiver.c: new application + * installcheck/Makefile.am installcheck/amarchiver.pl: tests + +2008-11-10 Dustin J. Mitchell + * installcheck/Installcheck/Run.pm: add Expect support + * installcheck/Makefile.am installcheck/amfetchdump.pl: amfetchdump + installcheck, using Expect support + +2008-11-10 Dustin J. Mitchell + * common-src/amgetconf.pl: don't setup_application() in dbclose + +2008-11-10 Jean-Louis Martineau + * perl/Makefile.am: Build Amanda::Application only if WANT_CLIENT. + +2008-11-08 Dustin J. Mitchell + * perl/Amanda/Changer.pm perl/Amanda/Changer/compat.pm + perl/Amanda/Changer/disk.pm perl/Amanda/Changer/single.pm + perl/Makefile.am: entirely new perl-based changer API + * perl/Amanda/Config.swg common-src/conffile.c common-src/conffile.h: + add changer subsections + * man/xml-source/amanda.conf.5.xml: document them + * server-src/amcheckdump.pl: use the new changer API + * installcheck/Amanda_Changer.pl installcheck/Amanda_Changer_Compat.pl + installcheck/Amanda_Changer_Single.pl installcheck/Amanda_Config.pl + installcheck/Installcheck/Config.pm installcheck/Makefile.am + installcheck/Amanda_Changer_Disk.pl: new/updated tests + +2008-11-07 Jean-Louis Martineau + * application-src/amstar.c: fix. + +2008-11-07 Jean-Louis Martineau + * perl/Amanda/Application.swg: Remove %init. + +2008-11-07 Jean-Louis Martineau + * application-src/amgtar.c, application-src/amgtar_perl.pl, + application-src/amstar.c: Write backup image to fd3 and index to fd4. + * perl/Amanda/Script_App.pm: Use $self->{mesgout}. + * recover-src/extract_list.c: Add more check. + * client-src/client_util.c (backup_support_option): Get stderr of + application and put it in errarray, + * client-src/client_util.h (backup_support_option): New prototype. + * client-src/selfcheck.c, client-src/sendbackup.c, + client-src/sendsize.c: Get stderr of application and send it to + server. + * server-src/dumper.c: Log the first error message. + * server-src/planner.c: Log the first error message. + * server-src/reporter.c: Don't print some error in report. + +2008-11-07 Jean-Louis Martineau + * client-src/client_util.c: Parse CALCSIZE and MULTI-ESTIMATE. + * client-src/client_util.c (run_calcsize): New function. + * client-src/client_util.h (run_calcsize): Prototype. + * client-src/sendbackup.c: Update amandates. + * client-src/sendsize.c: Handling of calcsize and multi-estimate. + * client-src/selfcheck.c: Check calcsize for application. + * application-src/amgtar_perl.pl, application-src/amstar.c, + * application-src/amgtar.c: handling of calcsize and multi-estimate. + * perl/Amanda/Script_App.pm: Add a check. + * perl/Amanda/Application.swg: Add run_calcsize. + * perl/Amanda/Application.pm: Delete + * perl/Makefile.am: Built from Application.swg + * client-src/calcsize.c: Handling of STAR program. + +2008-11-06 Jean-Louis Martineau + * man/xml-source/amgtar.8.xml: Document new properties. + * application-src/amgtar.c: Remove ifdef IGNORE_TAR_ERRORS. + +2008-11-06 Jean-Louis Martineau + * changer-src/chg-zd-mtx.sh: Return first line of mtx output if mtx + exit with a status != 0. + * server-src/amtape.c: Display changer error. + +2008-11-06 Jean-Louis Martineau + * application-src/amgtar.c: Add exit-handling property. + +2008-11-06 Jean-Louis Martineau + * application-src/amgtar.c: Add normal, ignore and strange property. + +2008-11-04 Jean-Louis Martineau + * server-src/amcheck.c: Check tape_splitsize < tape length. + +2008-10-30 Dustin J. Mitchell + * server-src/find.c server-src/find.h man/xml-source/amadmin.8.xml: + add new sort key, 'w', for write_timestamp + * server-src/amadmin.c: use it + * server-src/amindexd.c restore-src/amfetchdump.c: use 'w' to prefer + the oldest-written copy of a dump + +2008-10-30 Jean-Louis Martineau + * application-src/amgtar_perl.pl, application-src/amstar.c, + application-src/amgtar.c: Implement validate command. + * server-src/amcheckdump.pl: Execute the validate command of an + application. + * perl/Amanda/Script_App.pm (print_to_server): Add validate. + * perl/Amanda/Application.pm (known_commands): Add validate. + * common-src/security-util.c: Fix typo. + +2008-10-29 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml + man/xml-source/amanda-devices.7.xml: improve device property + documentation + +2008-10-29 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml: taperflush params can be + greater than 100% + +2008-10-27 Jean-Louis Martineau + * common-src/fileheader.c (dumpfile_free_data): New function. + * common-src/fileheader.h (dumpfile_free_data): New prototype. + * server-src/cmdline.c, server-src/dumper.c, + server-src/planner.c, server-src/amadmin.c, + server-src/amflush.c, server-src/holding.c, + server-src/driver.c, server-src/find.c, + server-src/taper-source.c, server-src/taper-file-source.c + server-src/taper.c: Call dumpfile_free or dumpfile_free_data. + +2008-10-27 Dustin J. Mitchell + * common-src/glib-util.c: check library version at runtime + +2008-10-27 Jean-Louis Martineau + * perl/Amanda/Device.swg (start_file): Remove const for jobInfo. + +2008-10-24 Dustin J. Mitchell + * installcheck/Amanda_Archive.pl: fix to also test for identity of + $user_data on perls that recognize such things + +2008-10-24 Dustin J. Mitchell + * amar-src/amar-test.c: don't ignore the return value of write() + +2008-08-14 Nikolas Coukouma + Jean-Louis Martineau + * amar-src/amar.c: fix mis-aligned memory accesses + * amar-src/amar-test.c: fix test_pipe + +2008-10-24 Jean-Louis Martineau + * perl/Amanda/Script_App.pm: New base module for script and application. + * perl/Amanda/Script.pm: New base module for script. + * perl/Amanda/Application.pm: New base module for application. + * perl/Makefile.am: Add Amanda::Script_app, Amanda::Script And + Amanda::Application. + * application-src/generic-dumper.pl: Remove file. + * application-src/generic-script.pl: Remove file. + * application-src/script-email.pl: Use Amanda::Script. + * application-src/amgtar_perl.pl: Use Amanda::Application. + * application-src/amzfs-snapshot.pl: Use Amanda::Script. + * application-src/Makefile.am: Remove generic-*.pl files. + +2008-10-24 Dustin J. Mitchell + * perl/Amanda/Archive.swg perl/Makefile.am: add a Perl interface to + libamar + * installcheck/Amanda_Archive.pl installcheck/Makefile.am: test it. + +2008-10-24 Dustin J. Mitchell + * */Makefile.am: change @AMLINT@ to $(AMLINT), similarly for + $(AMLINTFLAGS), and strip $(EXEEXT) from program names when running + lint + * config/amanda/libs.m4: put GLIB_CFLAGS in AMANDA_CPPFLAGS + +2008-10-23 Dustin J. Mitchell + * amar-src/Makefile.am: add amar.h to noinst_HEADERS + +2008-10-23 Dustin J. Mitchell + * configure.in Makefile.am amar-src/Makefile.am: new directory + * amar-src/amar.c amar-src/amar.h: amanda archive library + * amar-src/amar-test.c: tests for library + * common-src/security-util.c common-src/security-util.h + common-src/util.c common-src/util.h: move net_writev to + util.c, rename to full_writev + * man/Makefile.am man/xml-source/amanda-archive-format.7.xml + man/xml-source/amanda.8.xml: new manpage to describe the format + +2008-10-20 Nikolas Coukouma + * configure.in: add tests for more headers, plus some defines + for the presence of Amanda's headers + * device-src/s3-util.c, device-src/s3-util.h: Use defines to switch between + POSIX regex API and a GRegex (PCRE) call-compatability layer. + * device-src/s3.c, device-src/s3.h: Add a curl progress callback. + Use callbacks to write and read data. Provide callbacks for + memory buffers and files. The callbacks for files are currently + Windows-specific. + * device-src/s3-device.c: update to use new API + +2008-10-20 Dustin J. Mitchell + * perl/Makefile.am: remove spurious variables + +2008-10-17 Jean-Louis Martineau + * changer-src/chg-multi.sh: Check permission on the statefile and its + directory. + +2008-10-17 Jean-Louis Martineau + * server-src/planner.c: Set i to 0. + +2008-10-17 Jean-Louis Martineau + * server-src/amcheck.c, server-src/dumper.c + server-src/planner.c: Don't send appliaciton-api request if the + client doesn't use the xml protocol. + +2008-10-15 Jean-Louis Martineau + * server-src/reporter.c: print space instead of N/A, dumper stats are + set to "FLUSH" if it is a flush. + +2008-10-13 Dustin J. Mitchell + * device-src/vfs-device.c: re-open the dir handle on every + device start or read label + * installcheck/Amanda_Device.pl: adjust tests to degrade the + VFS device *after* it is started + +2008-10-13 Jean-Louis Martineau + * perl/Makefile.am: Moce EXTRA_DIST out of conditionals. + +2008-10-13 Jean-Louis Martineau + * installcheck/Makefile.am: revert previous commit. + * config/automake/scripts.am: Check for a server perl module. + +2008-10-13 Jean-Louis Martineau + * installcheck/Makefile.am: SCRIPTS_PERL = $(tests). + +2008-10-13 Jean-Louis Martineau + * perl/Makefile.am: Don't check Amanda/Config files. + +2008-10-11 Jean-Louis Martineau + * perl/Makefile.am: Check file in top_srcdir if they are not + in top_builddir. + +2008-10-10 Jean-Louis Martineau + * common-src/amgetconf.pl: remove 'use Amanda::Device qw( :constants);' + +2008-10-10 Jean-Louis Martineau + * perl/Makefile.am: test for libConfig.so before doing check. + +2008-10-10 Jean-Louis Martineau + * config/automake/scripts.am: Check perl scripts on compilation. + Add -I... to 'make check' to access perl module in build tree. + Add installcheck rules to check perl scripts with installed perl + modules. + * application-src/amstar_perl.pl: Remove file. + * device-src/Makefile.am, application-src/Makefile.am, + server-src/Makefile.am, installcheck/Makefile.am, + common-src/Makefile.am: Move most perl scripts to CHECK_PERL. + * installcheck/Makefile.am: + Add "CHECK_PERL_FLAGS=-I$(top_srcdir)/installcheck". + * perl/Makefile.am: Add rules to check all .pm files for check-local. + * device-src/amtapetype.pl, server-src/amaddclient.pl, + common-src/amgetconf.pl: Fix syntax errors. + +2008-10-10 Jean-Louis Martineau + * application-src/amzfs-snapshot.pl, application-src/amoracle.pl + application-src/script-email.pl, application-src/amgtar_perl.pl: + fix typos. + +2008-10-10 Nick Smith + * application-src/amzfs-snapshot.pl: fix typos + +2008-10-08 Dustin J. Mitchell + * perl/Amanda/DB/Catalog.pm: manage the tapelist internally + * perl/Amanda/Tapelist.swg: fix error message, re-read C tapelist + after writing + * server-src/amcheckdump.pl: don't read tapelist + * installcheck/Amanda_DB_Catalog.pl: don't read tapelist first + +2008-10-08 Nick Smith + * server-src/driver.c: set degr_mesg to NULL when not degraded + +2008-10-06 Jean-Louis Martineau + * application-src/amzfs-snapshot.pl: Accept execute-where argument. + * application-src/script-email.pl: Accept execute-where argument. + * client-src/client_util.c: Send execute-where argument to script. + * server-src/server_util.c: Send execute-where argument to script. + +2008-10-06 Jean-Louis Martineau + * application-src/amzfs-snapshot.pl: Add PFEXEC-PATH and PFEXEC + properties. + * man/xml-source/amzfs-snapshot.8.xml: Document new properties. + +2008-10-03 Dustin J. Mitchell + * perl/Amanda/Util.swg: add Amanda::Util::generate_timestamp + * common-src/timestamp.c: add comment + +2008-10-02 Dustin J. Mitchell + * perl/Amanda/DB/Catalog.pm: add rudimentary ability to read logfiles + * installcheck/Amanda_DB_Catalog.pl: test it + * perl/Amanda/Logfile.swg: fix typo + +2008-10-01 Nikolas Coukouma + * device-src/s3-device.c, device-src/s3.c, device-src/s3.h: + Add new property, S3_SSL, to control the use of SSL/TLS when + connecting to Amazon S3 + * man/xml-source/amanda-devices.7.xml: + document S3_SSL and S3_BUCKET_LOCATION + +2008-10-01 Nikolas Coukouma + * device-src/s3-util.c: Re-implement s3_hex_encode() to avoid OpenSSL weirdness. + +2008-10-01 Dustin J. Mitchell + * common-src/amanda.h common-src/conffile.c + oldrecover-src/extract_list.c recover-src/extract_list.c + server-src/amcheck.c server-src/amflush.c server-src/planner.c: + use g_ascii_isspace, as we assume ASCII (for now) and isspace() + is affected by locale and encoding settings. Thanks to Michael + Reuland for helping track this down. + +2008-09-30 Jean-Louis Martineau + * server-src/diskfile.h (xml_optionstr): New prototype. + * server-src/diskfile.h (clean_dle_str_for_client): Prototype. + * server-src/amindexd.c: Pass 0 to new argument of xml_optionstr. + * server-src/amcheck.c: Pass 0 to new argument of xml_optionstr. + * server-src/planner.c: Pass 0 to new argument of xml_optionstr. + * server-src/driverio.c: Pass 1 to new argument of xml_optionstr. + * server-src/dumper.c: Call clean_dle_str_for_client. + * server-src/diskfile.c (xml_optionstr): Work for ENCRYPT_SERV_CUST. + * server-src/diskfile.c (clean_dle_str_for_client): New function. + * restore-src/restore.c: Call clean_dle_str_for_client. + * common-src/amxml.c: Fix parsing. + * common-src/amanda.h (match_no_newline): Prototype. + * common-src/match.c (match_no_newline): New function. + +2008-09-30 Dustin J. Mitchell + * restore-src/restore.c: set data.flags for use by the changer_find + callback + +2008-09-30 Dustin J. Mitchell + * perl/Amanda/MainLoop.swg: add call_later() + * installcheck/Amanda_MainLoop.pl: test it + +2008-09-30 Dustin J. Mitchell + * device-src/rait-device.c: fix typos + +2008-09-30 Dustin J. Mitchell + * common-src/semaphore.h: fix typo + * device-src/rait-device.c: add a private threadpool-like + implementation for old glibs, where GThreadPool is susceptible to + deadlock + +2008-09-29 Dustin J. Mitchell + * device-src/device.c device-src/device.h device-src/null-device.c + device-src/property.c device-src/property.h device-src/rait-device.c + device-src/s3-device.c device-src/tape-aix.c device-src/tape-device.c + device-src/tape-device.h device-src/tape-ops.h device-src/tape-posix.c + device-src/tape-uware.c device-src/tape-xenix.c + device-src/vfs-device.c: add a 'configure' method to the Device API; + revamp device property handling to add source and surety and make + implementation easier + * device-src/rait-device.h device-src/rait-device.c: make RAIT device + calculate block sized based on child devices, if they were configured + explicitly. + * man/xml-source/amanda-devices.7.xml: note that common properties are + not implemented on all devices + * common-src/glib-util.c common-src/glib-util.h: add helpers for + case-insensitive hashes + * changer-src/scsi-changer-driver.c installcheck/Amanda_Device.pl + perl/Amanda/Device.swg restore-src/restore.c server-src/amcheck.c + server-src/amlabel.c server-src/amtape.c server-src/taper.c + server-src/taperscan.c: use new API + +2008-09-29 Dustin J. Mitchell + * server-src/find.c: handle find_result->label == NULL + * perl/Amanda/DB/Catalog.pm: filter out bogus results with NULL label + +2008-09-26 Dustin J. Mitchell + * perl/amglue/ghashtable.c: #include conffile.h, not conffile.c (!) + +2008-09-26 Jean-Louis Martineau + * server-src/driver.c: Parse dumpsize from taper result. + +2008-09-26 Jean-Louis Martineau + * client-src/selfcheck.c: Set qdevice on common_exit path. + +2008-09-25 Dustin J. Mitchell + * common-src/fileheader.c: fix headers_are_equal + +2008-09-25 Dustin J. Mitchell + * common-src/fileheader.c common-src/fileheader.h: allow blocksize=0 + * device-src/device.c device-src/device.h: set blocksize in tape + header + * device-src/null-device.c device-src/s3-device.c + device-src/tape-device.c device-src/vfs-device.c: set blocksize + in headers when starting files + * device-src/rait-device.c: duplicate headers for child devices, since + they are no longer const + * server-src/dumper.c: set blocksize on holding-disk files to + DISK_BLOCK_BYTES + +2008-09-25 Dustin J. Mitchell + * device-src/tape-device.c: mark device as non-appendable temporarily, + since file numbers are incorrect when appending + * installcheck/Amanda_Device.pl: handle non-appendable devices + +2008-09-24 Jean-Louis Martineau + * server-src/driverio.c (dumper_cmd, chunker_cmd): Take new mesg + argument. + * server-src/server_util.h (dumper_cmd, chunker_cmd): New prototype. + * server-src/chunker.c: Get mesg from ABORT cmd and log it. + * server-src/driver.c: Add the mesg argument to all dumper_cmd and + chunker_cmd. + +2008-09-24 Jean-Louis Martineau + * server-src/planner.c: Set degr_mesg and send it to driver. + * server-src/driverio.h (sched_t): Add degr_mesg field. + * server-src/driver.c: Parse message if no degraded estimate. + +2008-09-23 Dustin J. Mitchell + * common-src/conffile.c common-src/conffile.h: store a struct + containing both filename and line number for each parameter, and use + it when reporting errors and warnings + +2008-09-23 Dustin J. Mitchell + * device-src/device.c: make 'unimplemented method' an assertion + +2008-09-23 Dustin J. Mitchell + * device-src/s3.c: use max_keys, instead of maximum body size (which + doesn't work) to limit the number of keys listed + +2008-09-22 Jean-Louis Martineau + * common-src/fileheader.c (fh_init): Set default type to F_EMPTY. + * changer-src/chg-zd-mtx.sh: Allow to remove barcode from barcode file. + * server-src/taperscan.c: Check type != F_EMPTY. + * server-src/taper.c: Call changer_label(). + * server-src/amlabel.c: iCheck type != F_EMPTY. Call changer_label(). + +2008-09-22 Jean-Louis Martineau + * device-src/device.c: Don't g_value_unset a bzero value. + +2008-09-22 Jean-Louis Martineau + * server-src/driver.c: Set result_argv=NULL, Fix typo. + +2008-09-22 Dustin J. Mitchell + * config/amanda/ps.m4: give up on runtime detection and just special- + case the 'ps' arguments for various systems + * perl/Amanda/Constants.pm.in: add $PS + * perl/Amanda/Process.pm: use $PS + +2008-09-19 Jean-Louis Martineau + * server-src/reporter.c (addline): Done it constant time. + +2008-09-19 Dustin J. Mitchell + * common-src/Makefile.am common-src/quoting-test.c: new tests + * common-src/token.c common-src/token.h: removed + * common-src/util.c common-src/util.h: new home for quoting functions + * configure.in: don't check for shquote + * man/xml-source/amanda.conf.5.xml: info on quoting + * perl/Amanda/Config/Server.pm: note about incompatibility + * server-src/amcheck.c server-src/amindexd.c server-src/chunker.c + server-src/driver.c server-src/driverio.c server-src/driverio.h + server-src/dumper.c server-src/infofile.c server-src/server_util.c + server-src/server_util.h server-src/taper-file-source.c + server-src/taper-port-source.c server-src/taper.c: use new/updated + quoting functions + +2008-09-19 Nick Smith + * example/amanda.conf.in: fix incorrect execute_on examples + +2008-09-18 Jean-Louis Martineau + * server-src/dumper.c: Call security_close_connection before + checking if pkt == NULL. + +2008-09-18 Jean-Louis Martineau + Patch by Nick Smith + * server-src/diskfile.c: Fix vstrextend use, Patch by Nick Smith. + * server-src/diskfile.c: Init xml_app.result to stralloc(""). + +2008-09-16 Dan Locks + * packaging/rpm/amanda.spec: Added detection of CentOS 4 and 5 as + suggested by dswartz. added graceful failure when Distro/version is + not detected correctly + +2008-09-15 Dustin J. Mitchell + * common-src/conffile.c: uninit apps, pp_scripts, and device_configs + +2008-09-14 Dustin J. Mitchell + * server-src/tapefile.c server-src/tapefile.h: add comments to + tapelist + * perl/Amanda/Tapelist.swg: perl tapelist parser, too + * installcheck/Amanda_Tapelist.pl: tests + * man/xml-source/tapelist.5.xml: docs + * server-src/amlabel.c: no initial comments when labeling + * server-src/taper.c: maintain comment when relabeling + +2008-09-12 Jean-Louis Martineau + * amandad-src/amandad.c: Fix typo: authetication -> authentication. + +2008-09-05 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml: fix inequalities; thanks to + Mike McConnell for spotting these + +2008-09-05 Dustin J. Mitchell + * server-src/taper.c: improve handling of device errors in taper + +2008-09-02 Jean-Louis Martineau + * restore-src/amrestore.c: Load a default server config. + +2008-08-29 Dustin J. Mitchell + * autogen: revert glib's configure-time requirement for + pkg-config-0.16 + +2008-08-28 Dustin J. Mitchell + * device-src/tape-device.c: use the correct blocksize while reading + * device-src/rait-device.c: fix typo + * installcheck/Amanda_Device.pl: use the VFS device in RAIT tests, not + the tape device + +2008-08-28 Jean-Louis Martineau + * server-src/dumper.c: Reset the MESG buffer for a new dump. + +2008-08-27 Dustin J. Mitchell + * server-src/amcheck.c: make the check for tapelist result in a NOTE, + not a failure + * server-src/tapefile.c: make a missing tapelist equivalent to an + empty one + +2008-08-27 Dustin J. Mitchell + * config/amanda/types.m4: always include sys/types.h, if it exists, + before trying other headers (fixes builds of FreeBSD-4.x); thanks + to John Hein + * perl/Amanda/MainLoop.swg server-src/driverio.h: include amanda.h + before event.h 2008-08-22 Dustin J. Mitchell * perl/amglue/bigint.c: add #include "stdint.h" +2008-08-22 Dustin J. Mitchell + * config/amanda/ps.m4: search multiple ps invocations; thanks + to John Hein + 2008-08-22 Jean-Louis Martineau - * server-src/amadmin.c (tape): Correctly print next tape to use. + * server-src/amadmin.ci (tape): Correctly print next tape to use. * server-src/tapefile.c (print_new_tapes): New function to print new - tapes. + tapes. * server-src/tapefile.h (print_new_tapes): Prototype. * server-src/reporter.c: Correctly print next tape to use. 2008-08-22 Dustin J. Mitchell - Thanks to Stefan G. Weichinger - * server-src/taper.c: check errors from device, and handle them by - either requesting a new tape or just using the next tape in the - changer - -2008-08-22 Olivier Nicole - * changer-src/chg-disk.sh: replace == with = + * common-src/conffile.c common-src/conffile.h perl/Amanda/Config.swg: + add new 'define device' config section + * perl/Makefile.am perl/Amanda/Config/Server.pm + perl/Amanda/Config/Server/Devices.pm + perl/Amanda/Config/Server/Grammar: ditto + * device-src/device.c device-src/device.h: configure devices from + device definitions, with better error handling + * device-src/rait-device.c: handle child devices better + * installcheck/Amanda_Config.pl installcheck/Amanda_Config_Server.pl + installcheck/Amanda_Xfer.pl installcheck/Installcheck/Config.pm + installcheck/amgetconf.pl: new tests, modifications to work with the + new system + * man/xml-source/amanda-devices.7.xml + man/xml-source/amanda.conf.5.xml: corresponding documentation updates + * perl/Amanda/Changer.pm perl/Amanda/Device.swg + restore-src/amrestore.c restore-src/restore.c server-src/amcheck.c + server-src/amcheckdump.pl server-src/amdevcheck.pl + server-src/amlabel.c server-src/amtape.c server-src/taper.c + server-src/taperscan.c: remove calls to + set_startup_properties_from_config + * device-src/vfs-test.c: load config before trying to use a device + * common-src/conffile.c: fix use of uninitialized variable 2008-08-22 Dustin J. Mitchell + * changer-src/chg-disk.sh: replace == with = * changer-src/chg-lib.sh.in: fix sed invocation for BSD's sed 2008-08-22 Jean-Louis Martineau * server-src/reporter.c: Fix computation of compression ratio. -2008-08-21 Jean-Louis Martineau - * common-src/krb5-security.c: Fix security_seterror use. +2008-08-22 Jean-Louis Martineau + * client-src/sendbackup.h: Add DMP_IGNORE and AM_IGNORE_RE. + * application-src/amgtar.c, application-src/amgtar_perl.pl: + Ignore "Directory is new" and "Directory has been renamed". 2008-08-21 Jean-Louis Martineau - * device-src/queueing.c: Fix compiler warning. + * common-src/krb5-security.c: Fix security_seterror use. 2008-08-19 Dustin J. Mitchell * configure.in: check for getgrgid_r and getpwuid_r @@ -43,51 +1175,232 @@ * common-src/version.h: remove #include of config.h * device-src/vfs-device.c: #include amanda.h first +2008-08-18 Dustin J. Mitchell + * device-src/Makefile.am device-src/amtapetype.pl: new perl amtapetype + * installcheck/Installcheck/Run.pm: report exit status + * installcheck/Makefile.am installcheck/amtapetype.pl: new test + * man/xml-source/amtapetype.8.xml: updated manpage + * device-src/s3-device.c device-src/vfs-device.c + device-src/tape-device.c: add compression property + * perl/Amanda/Xfer.swg: add POD for the cancel() method + * xfer-src/dest-device.c: add a default for max_memory + +2008-08-18 Dustin J. Mitchell + * common-src/conffile.c: make find_multiplier case-insensitive + * device-src/device.c: reorder assertions + * device-src/tape-device.c: don't set access_mode twice, but + set in_file = FALSE in start + * device-src/s3-device.c: fix property registration + * perl/Amanda/MainLoop.swg: remove attach() from example + * perl/Amanda/Xfer.swg: more detail in POD + * xfer-src/source-pattern.c: operate byte-for-byte, like the random + source, instead of using lots of memcpys and reallocs + * xfer-src/source-random.c: remove redundant check + +2008-08-18 Dustin J. Mitchell + * configure.in Makefile.am tape-src/*: remove tape-src + * changer-src/Makefile.am: don't link with libamtape + * changer-src/chg-scsi.c: don't use libamtape + * changer-src/scsi-changer-driver.c: don't use libamtape + * config/amanda/tape.m4: fix comment + * example/amanda.conf.in example/template.d/tapetypes: fix outdated + comments + * man/Makefile.am man/xml-source/amdd.8.xml man/xml-source/ammt.8.xml: + remove amdd and ammt manpages + * restore-src/Makefile.am: remove refs to tape-src/ + * server-src/Makefile.am: remove refs to tape-src/ + +2008-08-18 Dustin J. Mitchell + * common-src/krb4-security.c common-src/krb5-security.c + config/amanda/tape.m4 common-src/amanda.h: remove + --with-maxtapeblocksize + * common-src/conffile.c: deprecate file-pad + * device-src/device-queueing.c device-src/device-queueing.h + device-src/device.c device-src/device.h device-src/null-device.c + device-src/property.c device-src/property.h device-src/rait-device.c + device-src/s3-device.c device-src/tape-device.c + device-src/tape-device.h device-src/vfs-device.c server-src/amcheck.c + server-src/taper.c tape-src/tapeio.c xfer-src/dest-device.c + xfer-src/source-device.c perl/Amanda/Device.swg: devices have + {min,max,current} block sizes; remove the short_block parameter from + device_write_block; fix property initialization; rename + PROPERTY_MEDIUM_TYPE to PROPERTY_MEDIUM_ACCESS_TYPE + * device-src/rait-device.c: set child block sizes explicitly + * installcheck/Amanda_Device.pl: tests; better S3 test count + calculations + * installcheck/Amanda_Xfer.pl: tests + * man/xml-source/amanda-devices.7.xml: update block sizes + documentation + * man/xml-source/amanda.conf.5.xml: refer to block size properties + * restore-src/amrestore.c: use set_restore_device_read_buffer_size + * restore-src/restore.h restore-src/restore.c: add + set_restore_device_read_buffer_size + +2008-08-16 Dustin J. Mitchell + * server-src/driver.c: handle taper_{input,tape}_error memory + correctly, and add taper_tape_error to the trace log + +2008-08-16 Dustin J. Mitchell + * application-src/amzfs-snapshot.pl application-src/script-email.pl: + remove unnecessary 'use Amanda::Device' + +2008-08-16 Dustin J. Mitchell + * common-src/amgetconf.pl: use filename-safe characters for $appname + * installcheck/amgetconf.pl: test it + +2008-08-16 Dustin J. Mitchell + * man/entities/global.entities: add manpage refs + * packaging/rpm/amanda_enterprise.spec + packaging/rpm/amanda_enterprise_client.spec + man/xml-source/disklist.5.xml man/xml-source/tapelist.5.xml + man/Makefile.am: add disklist(5), tapelist(5) + * man/xml-source/amaddclient.8.xml man/xml-source/amadmin.8.xml + man/xml-source/amanda-client.conf.5.xml man/xml-source/amanda.8.xml + man/xml-source/amanda.conf.5.xml man/xml-source/amcheck.8.xml + man/xml-source/amcheckdb.8.xml man/xml-source/amdevcheck.8.xml + man/xml-source/amflush.8.xml man/xml-source/amlabel.8.xml + man/xml-source/amrecover.8.xml man/xml-source/amrmtape.8.xml: + - remove references to "output drivers" in favor of "device drivers" + - add more inter-page references + - fix typos + - add client_login to amanda-client.conf(5) + - reformat informaltables, which don't render well in HTML or nroff, + into variablelists, with fixes for bad xml->man conversion + - fix funky replacement entities in HTML output + * perl/Amanda/DB/Catalog.pm: mention $dump->{kb} and ->{sec} + * perl/Amanda/Device.swg: fix typo + * perl/Amanda/MainLoop.swg: add hints for writing async functions + * perl/Amanda/Types.swg: fix bad POD + * perl/Amanda/Util.swg: POD fix: use $CONTEXT_* rather than strings + * perl/Amanda/Xfer.swg: tweaks + * server-src/taper.c: fix typo + * server-src/taperscan.c: remove "(previously non-amanda)", as Amanda + will no longer overwrite such tapes + +2008-08-16 Dustin J. Mitchell + * common-src/debug.c: lock debug logging on a per-line basis + +2008-08-16 Dustin J. Mitchell + * device-src/rait-device.c: parse RAIT names with internal {..} + * installcheck/Amanda_Device.pl: light testing + 2008-08-15 Dustin J. Mitchell * common-src/debug.c: include backtraces on fatal errors * config/amanda/debugging.m4: look for glibc's backtrace support * configure.in: ditto -2008-08-05 Dan Locks - * packaging/rpm/amanda.spec: Merged fixes from trunk .spec for - parsing redhat-release for fedora versions correctly. +2008-08-14 Dustin J. Mitchell + * device-src/tape-aix.c device-src/tape-ops.h device-src/tape-uware.c + device-src/tape-xenix.c: bring non-POSIX tape-ops implementations up + to date with function signatures + +2008-08-14 Dustin J. Mitchell , + Nikolas Coukouma + * xfer-src/*: add support for asynchronous cancellation of transfers + and use it for error-handling + * perl/Amanda/Xfer.swg: reflect into perl + * installcheck/Amanda_Xfer.pl: test cancellation + +2008-08-12 Dustin J. Mitchell + * common-src/Makefile.am: clean up svn-info.h on maintainer-clean + * man/Makefile.am: remove config.log after running config.status + +2008-08-07 Nikolas Coukouma + * common-src/conffile.c: cleaner fix for signed compared to unsigned + errors on older versions of GCC. + +2008-08-06 Dustin J. Mitchell + * common-src/Makefile.am: second fix + +2008-08-06 Dustin J. Mitchell + * common-src/Makefile.am: don't syntax-check amgetconf, since + it uses Amanda::* modules + +2008-08-06 Nikolas Coukouma + * server-src/amgetconf.pl, common-src/amgetconf.pl: + Add --execute-where=client|server and --client options + to make amgetconf query the client configuration + instead. Move from server-src to common-src. + * man/xml-source/amgetconf.8.xml: Document the new options. + * installcheck/amgetconf.pl: Test the new options. + * server-src/Makefile.am, common-src/Makefile.am: + Updated Makefiles for move. + * packaging/deb/amanda-enterprise-backup-client.install, + packaging/sun-pkg/i386/client/prototype: + Add amgetconf to client packages. 2008-08-04 Dan Locks * packaging/rpm/amanda.spec: add %{tarver} macro and set the correct minimum version per distro (Thanks to Jesse Angell for the rhel4 tip) -2008-07-30 Dustin J. Mitchell - * perl/Amanda/Changer.pm perl/Amanda/Cmdline.swg - perl/Amanda/Config.swg perl/Amanda/DB/Catalog.pm - perl/Amanda/Device.swg perl/Amanda/Logfile.swg - perl/Amanda/Util.swg: POD cleanup - * perl/Makefile.am: new files, rules to make HTML - * perl/amperl.css: CSS file for online POD - * perl/make_html.pl: make online POD +2008-08-04 Dustin J. Mitchell + * common-src/conffile.c: workaround gcc<4.1.0 problems with long + constants, don't use G_MAXINT64 in precompiler expressions -2008-07-30 Dustin J. Mitchell - * man/Makefile.am man/amanda.css man/index.php man/xslt/html.xsl.in: - new files for HTML output - * man/xslt/man.xsl.in: substitute XSLT_VERS - * man/xml-source/amanda-devices.7.xml: tweaks - * man/xml-source/amanda.8.xml: tweaks - * man/xml-source/amanda.conf.5.xml: tweaks - * man/xml-source/amgetconf.8.xml: tweaks - * man/xml-source/amtoc.8.xml: tweaks +2008-08-03 Dustin J. Mitchell + * server-src/amrmtape.sh: use shell redirection with shell functions -2008-07-30 Dan Locks - * packaging/rpm/amanda.spec: removed activate-devpay from %files section +2008-08-03 Dustin J. Mitchell + * common-src/util.c: if !WORKING_IPV6, request AF_INET, not AF_NATIVE + * common-src/dgram.c: address family debugging + * common-src/stream.c: address family debugging -2008-07-30 Dan Locks - * device-src/s3.c: Merged changes from 968 to work around a libcurl bug. - * config/amanda/s3-device.m4: Same +2008-08-03 Dustin J. Mitchell + * common-src/amanda.h common-src/conffile.c common-src/conffile.h + installcheck/Amanda_Config.pl perl/Amanda/Config.swg + server-src/planner.c: replace am64 type with gint64; also replace + some uses of off_t + +2008-08-01 Nikolas Coukouma + * perl/Amanda/BigIntCompat.pm: Add a module to make 'Math::BigInt's + stringify consistently (no '+' prefixing positive numbers). + * perl/Makefile.am: Add Amanda/BigIntCompat.pm for installation, etc. + * installcheck/bigint.pl, perl/amglue/bigint.c: + Use Amanda::BigIntCompat everywhere we use bigint. + +2008-08-01 Nikolas Coukouma + * common-src/match.c: Correct array index to be within bounds + +2008-08-01 Nikolas Coukouma + * config/amanda/flags.m4: Rename AMANDA_TEST_GCC_WARNING_FLAG to + AMANDA_TEST_GCC_FLAG and use AMANDA_ENABLE_GCC_WARNING where + appropriate. Add AMANDA_DISABLE_GCC_FEATURE. Disable strict-aliasing + (which causes errors). 2008-07-30 Dustin J. Mitchell * installcheck/Amanda_Config.pl: add + to avoid perl-5.6.0 parsing bug * installcheck/amgetconf.pl: ditto +2008-07-29 Dan Locks + * packaging/rpm/amanda.spec: Merged fixes from enterprise .spec for + parsing redhat-release for fedora versions correctly. + +2007-07-28 Nikolas Coukouma + * config/amanda/flags.m4: Add proper detection of flags for GCC 4.3+ + +2007-07-28 Nikolas Coukouma + * device-src/s3.c: Calculate and send the MD5 hash when uploading data. + Also check the returned ETag to make sure it matches the sent MD5 hash. + Use simpler s3_base64_encode() instead of base64_encode(). + Correct the use of character classes in several regular expressions. + * device-src/s3-util.h, device-src/s3-util.c: Add utility functions + s3_base64_encode(), s3_hex_encode(), and s3_compute_md5_hash() as well + as some constants. Move regexec_wrap() into this and rename it to + s3_regexec_wrap(). + * device-src/Makefile.am: add s3-util.c and s3-util.h + +2008-07-28 Dustin J. Mitchell + * installcheck/Installcheck/Config.pm: don't set default tapetype + unless not set explicitly. + * installcheck/Amanda_Config.pl: test changes + * man/xml-source/amanda-client.conf.5.xml + man/xml-source/amanda.conf.5.xml: encourage, but don't require, + quoted identifiers + 2008-07-28 Dustin J. Mitchell - * client-src/sendsize.c: remove cruft causing compile errors on HP/UX + * server-src/amserverconfig.pl: apply perltidy, factor some common + code, and create the config dir and changer conf only after the check + for mtx is performed 2008-07-28 Dustin J. Mitchell * device-src/tests/semaphore-test.c: move function call out of @@ -99,36 +1412,212 @@ libcurl-dev, libssl-dev. Updated server and client dependency for curl to libcurl3 -2008-07-23 Dustin J. Mitchell - * common-src/conffile.c: fix handling for config overwrites of - non-string parameters +2008-07-18 Dan Locks + * configure.in: add format-security to gcc compile flags + * server-src/amindexd.c, + server-src/dumper.c, + server-src/reporter.c, + restore-src/restore.c, + common-src/security-util.c, + common-src/bsd-security.c: replacemented unquoted strings in + function arguments with "%s", arg. jrfranks's suggestion, dustin provided + syntax for the fix. + +2008-07-17 Dan Locks + * packaging/debian/amanda-enterprise-backup-*.install: added entries for + applications and devices man pages. + +2008-07-17 Jean-Louis Martineau + * man/Makefile.am: Add amzfs-snapshot.8 + * man/xml-source/amzfs-snapshot.8.xml: New man page. + * man/xml-source/amanda.8.xml: Add amzfs-snapshot.8 + * man/xml-source/amanda-scripts.7.xml: Add amzfs-snapshot.8 + * application-src/amzfs-snapshot.pl: New script + * application-src/Makefile.am: Add amzfs-snapshot + * perl/Amanda/Util.swg: Add sanitise_filename. 2008-07-17 Jean-Louis Martineau * amandad-src/amandad.c: amandad must be run by root for krb5 auth. -200i-07-14 Dan Locks +2008-07-16 Jean-Louis Martineau + * server-src/driver.c: Improve message in failure to dump in degraded + mode. + +2008-07-16 Dan Locks + * packaging/deb/control, + packaging/rpm/amanda.spec: added explicit dependency on openssl, and a + build dependency for openssl and curl development files. + +2008-07-15 Dustin J. Mitchell + * example/xinetd.amandaserver.in example/xinetd.amandaclient.in: + specifying both IPv{4,6} does not work; remove IPv4 + +2008-07-15 Jean-Louis Martineau + * man/Makefile.am: Add new man pages. + * man/xml-source/script-email.8.xml: New man page. + * man/xml-source/amanda.8.xml: List new man pages. + * man/xml-source/amanda-scripts.7.xml: New man page. + +2008-07-15 Dustin J. Mitchell + * configure.in: generate (x)inetd files + * example/inetd.conf.amandaclient.in example/xinetd.amandaclient.in + example/xinetd.amandaserver.in: give appropriate path for amandad, + from configure (fixes builds on 64-bit machines) +2008-07-15 Dustin J. Mitchell + * client-src/client_util.c: #include "glib-util.h" + * common-src/glib-util.c: New g_ptr_array_foreach fucntion. + * common-src/glib-util.h: Prototype of g_ptr_array_foreach. + * device-src/rait-device.c: Remove g_ptr_array_foreach. + +2008-07-15 Jean-Louis Martineau + * client-src/client_util.c: Read stdout of scripts. + * client-src/client_util.h: New prototype for run_client_scripts, + New client_script_result_t struct. + * client-src/sendbackup.c: Send scripts properties to application. + * client-src/sendsize.c: Send scripts properties to application. + * client-src/selfcheck.c: Send scripts properties to application. + * recover-src/extract_list.c: Send scripts properties to application. + * common-src/amxml.h (script_t) Add field to keep result of script. + * common-src/amxml.c: Set script->result to NULL. + +2008-07-14 Dan Locks + * packaging/rpm/amanda.spec: fix macro detection of fedora version + +2008-07-14 Dan Locks * packaging/rpm/amanda.spec: fix distribution detection, add activate-devpay to server files list 2008-07-11 Dustin J. Mitchell - * device-src/rait-device.c: fix RAIT file numbers; don't pass - block-size-related properties down to child devices (we set the block - size in find_block_size); don't use union_robust for checking whether - labels changed, as it causes spurious failures + * installcheck/Amanda_Changer.pl: set up and parse a config, now that + Amanda::Changer needs one 2008-07-11 Dustin J. Mitchell - Thanks to Stefan G. Weichinger - * device-src/tape-*.c: return DEVICE_ERROR|VOLUME_MISSING on EIO while - checking tape_is_tape_device - * changer-src/chg-lib.sh.in: keep waiting for a device if it *might* - be busy or offline + * perl/Amanda/Changer.pm: set device properties when testing device + labels in the changer -2008-07-09 Dustin J. Mitchell - * device-src/rait-device.c: rewrite g_ptr_array_union_robust to - correctly detect and handle child device failures +2008-07-11 Jean-Louis Martineau + * application-src/amgtar.c: Add a DIRECTORY property. + * man/xml-source/amgtar.8.xml: Document DIRECTORY property. + +2008-07-11 Dustin J. Mitchell + * changer-src/chg-lib.sh.in: remove bogus Log() invocations -2008-07-09 Dustin J. Mitchell - * perl/Amanda/Logfile.swg: POD tweaks +2008-07-11 Dustin J. Mitchell + * man/xml-source/amanda.8.xml: fix amanda(8) formatting and add links + to new manpages + +2008-07-11 Dustin J. Mitchell + * installcheck/Amanda_Device.pl: be more liberal in the flags that are + accepted from S3's read_label; this will reduce false failures + +2008-07-11 Jean-Louis Martineau + * client-src/client_util.c: Remove unused output_tool_property function. + * client-src/client_util.h: Remove output_tool_property prototype. + * man/xml-source/amanda-client.conf.5.xml: Add application and script + sections. + * man/xml-source/amanda.conf.5.xml: Improve application and script + sections. + * device-src/device.c: Fix for new property_t. + * server-src/diskfile.h: Change prototype for xml_application and + xml_scripts. + * server-src/diskfile.c: Add tag if client support it. + * server-src/amindexd.c: Fix call to xml_application. + * server-src/amcheck.c: Fix call to xml_application. + * server-src/planner.c: Fix call to xml_application. + * server-src/driverio.c: Fix call to xml_application. + * server-src/server_util.c: Remove code to write property to stdin of + script. + * perl/Amanda/Config.swg: Fix for new property_t. + * perl/amglue/amglue.h: Prototype for g_hash_table_to_hashref_property. + * perl/amglue/ghashtable.c: New g_hash_table_to_hashref_property + function. + * installcheck/Amanda_Config.pl: Fix for new property_t. + * common-src/util.c: Remove unused output_tool_proplist fucntion, + Fix for new property_t. + * common-src/util.h: Remove output_tool_proplist prototype. + * common-src/amxml.c:Fix for new property_t, parse priority of property. + * common-src/conffile.c: Parse priority of a property, + Add application and script to amanda-client.conf. + * common-src/conffile.h: New property_t struct. + * common-src/amfeatures.h: New fe_xml_property_priority amfeature. + * common-src/amfeatures.c: New fe_xml_property_priority amfeature. + +2008-07-11 Jean-Louis Martineau + * man/entities/global.entities: Add ENTITY email.jlm. + * man/Makefile.am (CLIENT_MAN_PAGES): Set to amanda-applications.7, + amgtar.8 and amstar.8. + * man/xml-source/amanda.conf.5.xml: Fix , it must be + at the begining of a line. + * man/xml-source/amanda-applications.7.xml: New page. + * man/xml-source/amgtar.8.xml: New page. + * man/xml-source/amstar.8.xml: New page. + +2008-07-09 Ian Turner + * device-src/device.h: Clarify documentation of device_read_label(). + * device-src/s3-device.c, device-src/tape-device.c, + device-src/vfs-device.c (device_read_label): Always clear volume + labels, even if device is in error. + * device-src/rait-device.c: Ditto; also properly handle properties + that change device labels. + +2007-07-09 Nikolas Coukouma + * man/xml-source/amanda-devices.7.xml: Document the S3_BUCKET_LOCATION + property (for setting location constraints). + +2008-07-08 Dustin J. Mitchell + * device-src/vfs-device.c device-src/tape-device.c: do not autofinish + when EOF occurs on writing + +2008-07-08 Dustin J. Mitchell , + Nikolas Coukouma , + Ian Turner , + Jean-Louis Martineau + Amanda has been analyzed with Klocwork source code analysis, the most + accurate and comprehensive tool for finding critical programming + errors and security vulnerabilities. + * amandad-src/amandad.c changer-src/chg-scsi.c + client-src/client_util.c client-src/selfcheck.c + client-src/sendbackup.c client-src/sendsize.c common-src/amfeatures.c + common-src/bsd-security.c common-src/fileheader.c + common-src/local-security.c common-src/queueing.c + common-src/security-util.c device-src/property.c + device-src/rait-device.c device-src/tape-device.c + device-src/vfs-device.c recover-src/set_commands.c + restore-src/amidxtaped.c restore-src/amrestore.c restore-src/restore.c + server-src/amadmin.c server-src/amcheck.c server-src/amindexd.c + server-src/changer.c server-src/chunker.c server-src/cmdline.c + server-src/driver.c server-src/holding.c server-src/logfile.c + server-src/reporter.c server-src/server_util.c + server-src/taper-file-source.c: fix many issues identified + by Klockwork, ranging in severity from stylistic to minor. + - many memory leaks in error paths and application shutdown + - better handling of incorrect commandline arguments + - better resource management (file descriptors, etc.) + +2008-07-07 Nikolas Coukouma + * device-src/Makefile.am: conditionalize activate-devpay on + WANT_S3_DEVICE + +2007-07-06 Nikolas Coukouma + * device-src/s3-device.c, device-src/s3.c, device-src/s3.h, + device-src/activate-devpay.c, device-src/Makefile.am: + Allow both regular S3 and S3-with-DevPay to be used in + the same installation. Remove WANT_DEVPAY macro. + * device-src/s3-device.c: Added a flag, is_devpay, to the device + and handled divergent cases. Removed useless device_error_set calls. + * device-src/s3.c: Use DevPay authentication iff user_token is set. + Replaced some if statements about non-NULL pointers with assertions. + * config/amanda/s3-device.m4, device-src/Makefile.am: + remove devpay flag and WANT_DEVPAY definition. + * installcheck/Amanda_Device.pl: add tests for DevPay, refactor + other S3 tests. + +2007-07-06 Nikolas Coukouma + * device-src/s3.c: wait for bucket to appear after creation, treat + missing bucket as temporary error, increase retries from 5 to 14 + (about 3min), explicitly handle HTTP verbs as libcurl expects. + * installcheck/Amanda_Device.pl: remove (now-irrelvant) note about + buckets taking too long to appear. 2008-07-06 Dan Locks * packaging/deb/amanda-backup-server.postrm @@ -138,51 +1627,525 @@ * packaging/deb/rules: added specific preinst and postrm scripts for client and server. -2008-07-04 Dan Locks - * packaging/rpm/buildpkg: add lines to copy rpms to root of the build dir. +2008-07-03 Dustin J. Mitchell + * man/Makefile.am man/amanda.css man/index.php man/xslt/html.xsl.in: + new files for HTML output + * man/xslt/man.xsl.in: substitute XSLT_VERS + * man/xml-source/amanda-devices.7.xml: tweaks + * man/xml-source/amanda.8.xml: tweaks + * man/xml-source/amanda.conf.5.xml: tweaks + * man/xml-source/amgetconf.8.xml: tweaks + * man/xml-source/amtoc.8.xml: tweaks -2008-06-30 Ian Turner +2008-07-03 Dustin J. Mitchell + * common-src/genversion.c: correctly represent available amflock + implementations + +2008-07-03 Jean-Louis Martineau + * perl/Amanda/Xfer.swg: #include "glib-util.h" + +2008-07-02 Dustin J. Mitchell + * device-src/rait-device.c: don't use self->device_name in open_device + +2008-07-02 Dustin J. Mitchell + * installcheck/amgetconf.pl: supply a plugin for scripts + +2008-07-02 Jean-Louis Martineau + * server-src/diskfile.c: Check an application is set if + program == "APPLICATION". + * common-src/amxml.c: Check plugin is set for application and script. + * common-src/conffile.c: Check plugin is set for application and script + +2008-07-02 Jean-Louis Martineau + * server-src/amstatus.pl: Fix printing of config path on error. + +2008-07-02 Dustin J. Mitchell + * installcheck/Amanda_Device.pl: test that start(READ) without first + reading the label doesn't cause errors + * device-src/s3-device.c: call s3_device_read_label directly + +2008-07-02 Ian Turner + * man/xml-source/amanda.8.xml: Document how to override device + properties. + +2008-07-02 Ian Turner + Dustin J. Mitchell contributed code and thoughts + to this patch. + * man/xml-source/amanda-devices.7.xml: Document new ERROR flag + to start RAIT device in degraded mode. + * device/device.c: Be a little more forgiving of NULL devices. + * device-src/vfs-device.c: Fix a bug where vfs_device_start() + would sometimes throw an erroneous assertion. + * device-src/rait-device.c: Be much more robust in error handling; + new feature to start a RAIT device in degraded mode. + * installcheck/Amanda_Device.pl: Enable more RAIT device tests. + +2008-07-02 Dustin J. Mitchell + * common-src/amanda.h: remove unused #include + +2008-07-02 Dustin J. Mitchell + * device-src/tape-device.c: add "user" and "good" to feature flags + * man/xml-source/amanda-devices.7.xml: document it + +2008-07-01 Dustin J. Mitchell + * device-src/device.h: fix comments to reflect removal of + autofinishing + * device-src/tape-device.c: remove autofinishing + +2008-07-01 Dustin J. Mitchell + * changer-src/chg-lib.sh.in: also handle bare tape dev names + +2008-07-01 Dustin J. Mitchell + * changer-src/chg-lib.sh.in: fix tape_device_filename to not use perl + * changer-src/chg-zd-mtx.sh: always use the unqualified hostname to + open the debug file + +2008-06-30 Dustin J. Mitchell + * common-src/match.c: fix multiple bugs in match_datestamp + +2008-06-29 Dustin J. Mitchell + * perl/Amanda/Changer.pm perl/Amanda/Cmdline.swg + perl/Amanda/Config.swg perl/Amanda/DB/Catalog.pm + perl/Amanda/Device.swg perl/Amanda/Logfile.swg + perl/Amanda/Util.swg: POD cleanup + * perl/Makefile.am: new files, rules to make HTML + * perl/amperl.css: CSS file for online POD + * perl/make_html.pl: make online POD + +2008-06-29 Dustin J. Mitchell + * installcheck/Makefile.am installcheck/amstatus.pl: new check + +2008-06-27 Ian Turner + * server-src/taper.c: fix printing a NULL pointer in the error path + +2008-06-27 Dustin J. Mitchell + * device-src/device.c: check for and fail on multiple + short writes to the same file + * device-src/null-device.c device-src/rait-device.c + device-src/s3-device.c device-src/tape-device.c + device-src/vfs-device.c: do not autofinish files + * installcheck/Amanda_Device.pl installcheck/Amanda_Xfer.pl: don't + expect devices to autofinish anymore + * server-src/taper.c xfer-src/dest-device.c: finish files explicitly + * device-src/device-queueing.c: comments + * xfer-src/xfer-element.h: comments + +2008-06-27 Nikolas Coukouma + * device-src/s3.c device-src/s3.h device-src/s3-device.c installcheck/Amanda_Device.pl: + Add support for bucket location constraints + * device-src/s3-device.c: Add S3_BUCKET_LOCATION device property + * device-src/s3.c device-src/s3.h device-src/s3-device.c: + Checks for libcurl and bucket name compatability with location constraints + * device-src/s3.c: make s3_init() threadsafe, + refactor regex compilation and calling, + refactor perform_request() functions to construct URL later, + use GString to tidy string generation + * installcheck/Amanda_Device.pl: Add tests for location constraints + +2008-06-27 Ian Turner + * device-src/rait-device.c: Fix a memory corruption issue on the last + block of a file. + +2008-06-27 Ian Turner * device-src/rait-device.c: Fix a memory corruption issue on the last block of a file. + +2008-06-27 Ian Turner * device-src/rait-device.c: Track file numbers properly when child devices change them (that is, in rait_device_start_file() and rait_device_seek_file()). + * installcheck/Amanda_Device.pl: Enable primary set of RAIT tests. -2008-06-27 Ian Turner - * device-src/rait-device.c (rait_device_start): Check for consistent - volume label on all child devices, otherwise fail +2008-06-27 Jean-Louis Martineau + * device-src/s3-device.c (s3_device_read_label): Don't set + volume_header if nothing is read. -2008-06-27 Ian Turner - * device-src/rait-device.c: Silence a compiler warning. +2008-06-27 Jean-Louis Martineau + * device-src/device.c: Don't log is flag is DEVICE_STATUS_SUCCESS. 2008-06-27 Dustin J. Mitchell + * device-src/tape-posix.c: return DEVICE_ERROR|DEVICE_BUSY on EIO + * changer-src/chg-lib.sh.in: keep waiting for a device if it *might* + be busy or offline + +2008-06-26 Jean-Louis Martineau + * application-src/amstar.c: Use local start_time variable. + * application-src/amgtar.c: Use local start_time variable. + * common-src/clock.h: Remove times_zero and start_time extern. + * common-src/clock.c: Remove times_zero. + +2008-06-25 Jean-Louis Martineau + * server-src/diskfile.c: Don't send encryption in xml req packet for + server encryption. + +2008-06-25 Dustin J. Mitchell + * application-src/amgtar.c: revert --atime-preserve change + +2008-06-22 Dustin J. Mitchell + * application-src/amgtar.c: change --atime-preserve=system to + --atime-preserve + +2008-06-20 Dustin J. Mitchell + * installcheck/amdump.pl: fix checks to refresh the test configuration + +2008-06-20 Dustin J. Mitchell , Ian Turner + * server-src/amdump.sh: correctly handle error exits from planner + * server-src/planner.c: fail if planning fails + * installcheck/amdump.pl: test changes + +2008-06-20 Dan Locks + * packaging/rpm/amanda.spec: typo amanda-devices.7.gz + +2008-06-20 Dan Locks + * packaging/rpm/amanda.spec: added %{MANDIR}/man7/amanda-device.7.gz + +2008-06-20 Jean-Louis Martineau + * client-src/client_util.c: Call check_access() only + if getuid() == geteuid(). + * application-src/amgtar.c: check_dir(argument->dle.device, R_OK) + +2008-06-19 Jean-Louis Martineau + * server-src/amcleanup.pl: Correctly rename amdump files. + +2008-06-19 Dustin J. Mitchell , Ian Turner + * man/Makefile.am man/xml-source/amanda-devices.7.xml: new manpage + * man/entities/global.entities: emails for dustin and ian + * man/xml-source/amanda.8.xml: refer to new manpage + * man/xml-source/amanda.conf.5.xml: refer to new manpage + * man/xml-source/amrecover.8.xml: refer to new manpage + * server-src/amcheck.c: fix message regarding WORM media + +2008-06-19 Dustin J. Mitchell + * server-src/amgetconf.pl: fail on bad parameters or subsections, but + not empty values or subsection lists + * perl/Amanda/Config.swg: publish a list of subsections + * installcheck/amgetconf.pl: test it + +2008-06-19 Dustin J. Mitchell + * example/template.d/amanda-single-tape.conf.in + example/template.d/amanda-harddisk.conf.in + example/template.d/amanda-tape-changer.conf.in + example/template.d/dumptypes example/template.d/amanda-S3.conf.in: + use application amgtar instead of program GNUTAR + +2008-06-19 Dustin J. Mitchell + * config/amanda/net.m4: AC_SUBST port ranges; update comments + +2008-06-19 Satya Ganga + * example/template.d/amanda-single-tape.conf.in + example/template.d/advanced.conf.in: update displayunit to "g" and + remove chg-manual for single tape configurations. + +2008-06-19 Ian Turner + * device-src/rait-device.c (rait_device_start): Check for consistent + volume label on all child devices, fail with + DEVICE_STATUS_DEVICE_ERROR otherwise. + * installcheck/Amanda_Device.pl: Test for foregoing. + +2008-06-19 Paddy Sreenivasan + * device-src/s3.h: use "https://ls.amazonaws.com/" as STS endpoint + +2008-06-19 Dustin J. Mitchell + * installcheck/Makefile.am: remove test_utils from SCRIPTS_PERL + * config/automake/scripts.am: explain why + +2008-06-18 Jean-Louis Martineau + * changer-src/chg-manual.sh: Make it interruptible. + +2008-06-18 Jean-Louis Martineau + * application-src/amgtar.c: Remove check for amandates file. + +2008-06-18 Jean-Louis Martineau + * common-src/amanda.h: Fix skip_quoted_string for "\\". + * common-src/file.c: Fix debug_agets for "\\". + +2008-06-18 Jean-Louis Martineau + * server-src/amstatus.pl: Report size of PART taped on 'dump to tape'. + +2008-06-18 Jean-Louis Martineau + * client-src/sendsize.c: Report error from application to server. + * application-src/amgtar.c: Report exit status of tar. + +2008-06-16 Dustin J. Mitchell + * perl/Amanda/Xfer.swg xfer-src/Makefile.am xfer-src/xfer-element.h + xfer-src/dest-device.c xfer-src/source-device.c: new elements + Amanda::Xfer:{Dest,Source}::Device + * perl/Amanda/Xfer.swg: POD fix for Amanda::Xfer:Filter::Xor + * installcheck/Amanda_Xfer.pl: tests for new elements + +2008-06-16 Dustin J. Mitchell + * installcheck/amservice.pl: add invocations of selfcheck for GNUTAR + and amgtar + * installcheck/amservice.pl: put -f switches first + +2008-06-15 Dustin J. Mitchell + * installcheck/Amanda_Config.pl: test config overwrites + * common-src/conffile.c: don't segfault applying config overwrites + after config_init(0, NULL) + +2008-06-13 Jean-Louis Martineau + * client-src/sendbackup.c: Run compression and encryption for + application-api. + +2008-06-13 Jean-Louis Martineau + * perl/Amanda/Util.swg: Expose get_original_cwd. + * application-src/amgtar_perl.pl, application-src/amoracle.pl: + chdir(get_original_cwd()) before restore. + +2008-06-13 Dustin J. Mitchell + * device-src/property.c device-src/property.h: remove tape properties + * device-src/tape-device.c device-src/tape-device.h: add tape + properties + +2008-06-12 Dan Locks + * packaging/rpm/amanda_enterprise.spec, + packaging/rpm/amanda_enterprise_client.spec, + packaging/deb/rules: install amgtar and amstar suid root + +2008-06-12 Jean-Louis Martineau + * client-src/selfcheck.c: Typo. + +2008-06-11 Jean-Louis Martineau + * client-src/sendsize.c: Check MAX-LEVEL from application. + * server-src/planner.c: Ask for estimate even if SERVER, estimate is + valid if client return -1 and invelid if client return -2. + * common-src/amfeatures.h: New fe_xml_estimate amfeature. + * common-src/amxml.c: Parse tag. + * common-src/amxml.h (dle_t): New estimate field. + * common-src/amfeatures.c: Set fe_xml_estimate. + +2008-06-11 Jean-Louis Martineau + * client-src/client_util.c (application_property_add_to_argv): + Add include and exclude. + * client-src/client_util.h (application_property_add_to_argv): + New prototype. + * client-src/sendbackup.c, client-src/sendsize.c, + client-src/selfcheck.c, recover-src/extract_list.c: + Add bsu param to application_property_add_to_argv. + * client-src/selfcheck.c: Check if application support includ/exclude. + * application-src/amgtar_perl.pl: Don't support include/exclude. + * application-src/amgtar.c: Support include-optional and + exclude-optional. + * common-src/amxml.c: Fix include/exclude parsing. + +2008-06-11 Jean-Louis Martineau + * application-src/Makefile.am: Install amgtar and amstar suid root. + +2008-06-11 Jean-Louis Martineau + * client-src/selfcheck.c: Print cmdline before execing the application. + * application-src/generic-dumper.pl: Cleanup. + * application-src/script-oracle.pl: Cleanup. + * application-src/script-email.pl: Cleanup. + * application-src/amgtar_perl.pl: Cleanup. + * application-src/generic-script.pl: Cleanup. + * application-src/Makefile.am: Remove all scripts from CHECK_PERL. + * perl/Amanda/Debug.swg: Typo. + +2008-06-10 Dustin J. Mitchell + * common-src/Makefile.am: don't use $(builddir), fix comparison + * installcheck/Makefile.am: don't use $(builddir) + +2008-06-10 Ian Turner + * common-src/fileheader.c: Silence a compiler warning. + * device-src/rait-device.c: ditto. + +2008-06-10 Dustin J. Mitchell * device-src/rait-device.c: hack around glib bug in versions <2.10.2 + using the precompiler macro instead of glib_check_version, which + doesn't exist in every version of glib + +2008-06-10 Dan Locks + * packaging/rpm/amanda.spec: Replaced individual SBINDIR/am... entries + with SBINDIR/am* in %%files + +2008-06-10 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Add pre&post recover scripts. + +2008-06-09 Dan Locks + * packaging/rpm/buildpkg: added "|| exit 1" to any command which should + cause the script to fail. + +2008-06-09 Dan Locks + * packaging/rpm/amanda.spec: Changed individual SBINDIR/am... entries to + use a single SBINDIR/am* entry in %files 2008-06-09 Dustin J. Mitchell - * common-src/conffile.c: don't complain about a missing client conf - file, as the complaint interferes with the network communication - ("invalid size: could not open conf file") + * common-src/fileheader.c: correctly free dle_str + * device-src/device.c device-src/device.h: add volume_header Device + attributes + * device-src/rait-device.c device-src/s3-device.c + device-src/tape-device.c device-src/vfs-device.c: populate + volume_header + * server-src/amlabel.c: use volume_header to detect a non-empty tape + and require a force (-f) to overwrite it + * server-src/taperscan.c: use volume_header to detect a non-empty tape + and require 'amlabel -f' to overwrite it + * device-src/tape-device.c device-src/vfs-device.c: fix read_label + return values and remove useless chain-up calls + +2008-06-09 Jean-Louis Martineau + * server-src/amservice.c: Open input file in read mode, prepend + get_original_cwd() to relative path. + * installcheck/Makefile.am: Check amservice only on server. + +2008-06-09 Dustin J. Mitchell + * installcheck/Amanda_Device.pl: skip all RAIT tests temporarily + +2008-06-09 Dustin J. Mitchell + * man/xml-source/amanda.8.xml: add links to amservice + +2008-06-07 Dustin J. Mitchell + * config/amanda/ipv6.m4: remove redundant AC_SOCKADDR_STORAGE + * configure.in: don't call AC_SOCKADDR_STORAGE + +2008-06-07 Dustin J. Mitchell + * installcheck/Amanda_Xfer.pl: make AMANDA_TMPDIR if it doesn't exist + +2008-06-07 Dustin J. Mitchell + * installcheck/Installcheck/Run.pm: fix Installcheck::Run vtape + handling so that checks can load/unload vtapes "manually" + +2008-06-07 Dustin J. Mitchell + * server-src/amdevcheck.pl: apply config_overwrites before printing + config errors + +2008-06-07 Dustin J. Mitchell + * application-src/amgtar_perl.pl application-src/amstar_perl.pl + application-src/generic-dumper.pl application-src/generic-script.pl + application-src/script-email.pl server-src/amgetconf.pl: add GPL + notice + +2008-06-06 Jean-Louis Martineau + * server-src/amservice.c: Exit with 1 if the connection fail. + * man/xml-source/amservice.8.xml: Document exit code. + +2008-06-06 Dustin J. Mitchell + * device-src/device.c: make device_set_error bulletproof to NULLs + * device-src/tape-posix.c: fix compilation error when GMT_ONLINE is + not defined + +2008-06-06 Jean-Louis Martineau + * man/Makefile.am: Add amservice.8. + * man/xml-source/amservice.8.xml: New man page for amservice. + * server-src/amservice.c: New program to execute an amanda service + on a client. + * server-src/Makefile.am: Add amservice + * installcheck/amservice.pl: New check for amservice program. + * installcheck/Makefile.am: Add amservice + +2008-06-06 Jean-Louis Martineau + * server-src/dumper.c: Don't quote dle_str. + * common-src/fileheader.c: DLE= in header is like heredoc. 2008-06-06 Dustin J. Mitchell - * device-src/*: bugfixes backported from trunk r1087 - - device_read_block returns an int, not a gboolean, and sets in_file - = FALSE on EOF - - tape device only requires a label in READ and APPEND modes - - tape device isn't opened until start or read_label - - rait sets self->file correctly in start - - rait compares child devices' labels and times correctly - - vfs correctly chains up in property_get - - vfs sets self->file correctly in start with ACCESS_APPEND + * device-src/*: major overhaul: + - add device_set_error to set error status and message for Device + - every error return from a device API method sets error status + - device_status_error is now threadsave + - a device in an error state will not perform further operations + - ensure Device attributes are set correctly by member functions + - device_open never returns NULL, but may return a null device with + error status set + - clearly define $device_name="$device_type:$device_node" + - send RAIT logging to the debug log + - vfs, tape devices don't touch the device until read_label or start + - on out-of-space in write, set is_eof, finish the file, and return + FALSE + - use accessor functions in Amanda::Device + - move device-specific properties to live with their devices + - change g_return_val_if_fail to g_assert or explicit checks + - remove most default Device methods, as they were more confusing + than helpful + - misc. other cleanup + * device-src/null-device.h device-src/rait-device.h + device-src/s3-device.h device-src/vfs-device.h: removed to make most + device class declarations local to the source file + * perl/Amanda/Device.swg: new error handling + * perl/Amanda/Changer.pm restore-src/amrestore.c restore-src/restore.c + server-src/amcheck.c server-src/amcheckdump.pl + server-src/amdevcheck.pl server-src/amlabel.c server-src/amtape.c + server-src/taperscan.c: use new device error-handling + * server-src/taper-file-source.c server-src/taper-port-source.c + server-src/taper-source.c: rename GObject constants (typo) + * server-src/taper-source.h: + * server-src/taper.c: handle opening devices better, log on EOM + * common-src/glib-util.c: g_english_strjoinv: handle one-element lists + correctly + * installcheck/amdevcheck.pl: volume-unlabeled message has changed + * installcheck/Amanda_Device.pl perl/Amanda/Tests.swg: test all device + classes + * configure.in device-src/tests/: removed + * device-src/vfs-test.c: moved from device-src/tests/ + +2008-06-06 Jean-Louis Martineau + * client-src/sendbackup.c: Don't write the uncompression program if + it is not client compressed. + +2008-06-05 Jean-Louis Martineau + * server-src/taper.c: Log no-tape line. + +2008-06-05 Jean-Louis Martineau + * server-src/reporter.c: Improve formating. + +2008-06-05 Jean-Louis Martineau + * server-src/driver.c: start the degraded mode if it receive + NO-NEW-TAPE from taper. + +2008-06-05 Jean-Louis Martineau + * server-src/amcheckdump.pl: Check log fiels in directory if find_log + find no log for the timestamps. + +2008-06-05 Dustin J. Mitchell + * common-src/conffile.c common-src/conffile.h: expose config_add_error + * server-src/diskfile.c server-src/diskfile.h: use config_add_error + to send diskfile errors to conffile's error-handling mechanism + * restore-src/amfetchdump.c server-src/amadmin.c server-src/amcheck.c + server-src/amcleanupdisk.c server-src/amflush.c server-src/amindexd.c + server-src/amtrmidx.c server-src/amtrmlog.c server-src/driver.c + server-src/planner.c: parse disklist along with config + +2008-06-04 Jean-Louis Martineau + And Dustin J. Mitchell + * man/xml-source/amanda-client.conf.5.xml: Document property. + * installcheck/Amanda_Config.pl: Add test for client property. + * common-src/conffile.c (client_var): Add CONF_PROPERTY. + +2008-06-03 Jean-Louis Martineau + * perl/Amanda/Types.swg: Add dle_str to dumpfile_t. + * common-src/fileheader.c: Don't print NULL dle_str. + +2008-06-03 Jean-Louis Martineau + * common-src/amfeatures.h: Rename fe_amrecover_dle to fe_amindexd_DLE, + add fe_amrecover_dle_in_header. + * common-src/amfeatures.c: Set fe_amrecover_dle_in_header. + * recover-src/set_commands.c: Use fe_amindexd_DLE. + * server-src/dumper.c: Set dle_str and add it to the header. + * restore-src/restore.c: Remove dle_str is client doesn't have + fe_amrecover_dle_in_header. + * common-src/fileheader.c: Parse and set dle_str from header. + * common-src/fileheader.h: Add dle_str in dumpfile_t. 2008-06-03 Jean-Louis Martineau * man/xml-source/amdump.8.xml, man/xml-source/amreport.8.xml, man/xml-source/amcheck.8.xml, man/xml-source/amflush.8.xml, man/xml-source/amstatus.8.xml: Add "EXIT CODE" section". +2008-06-03 Jean-Louis Martineau + * common-src/conffile.c (parm_key_info): Don't fold '-' to '_' in + subsec_name. + * installcheck/amgetconf.pl: Fix and add more tests. + +2008-06-03 Dustin J. Mitchell + * common-src/amxml.c: give parse error on an empty "disk" element + * server-src/diskfile.c: give parse error on an empty "disk" element + 2008-05-30 Jean-Louis Martineau * common-src/security-util.c: Remove unneeded pointer cast. * common-src/stream.c: Fix compiler error. +2008-05-30 Dustin J. Mitchell + * installcheck/Installcheck/Config.pm: fix subsection inheritance + 2008-05-30 Dustin J. Mitchell * common-src/amanda.h, common-src/bsd-security.c, common-src/bsdtcp-security.c, common-src/bsdudp-security.c, @@ -193,9 +2156,48 @@ restore-src/amidxtaped.c, server-src/amindexd.c: add sockaddr_union, change all relevant functions to use it, to avoid aliasing violations +2008-05-30 Jean-Louis Martineau + * common-src/conffile.c (lookup_keyword): Use temporary variable. + * installcheck/Amanda_Config.pl: Check insentivity of -/_ in amanda + keyword. + * installcheck/Installcheck/Config.pm: Adjust to make the subsection + inheritance work. + +2008-05-30 Jean-Louis Martineau + * recover-src/extract_list.c: Send properties from dump_dle to + application plugin. + +2008-05-30 Jean-Louis Martineau + * client-src/client_util.c: New *-RECOVER scripts. + * application-src/script-email.pl: Add new *-RECOVER scripts. + * application-src/generic-script.pl: Add new *-RECOVER scripts. + * application-src/amstar.c: Fix. + * application-src/amgtar.c: Fix. + * recover-src/amrecover.c: Add a global dump_dle variable. + * recover-src/extract_list.c: Call run_client_scripts for *-RECOVER + scripts. + * recover-src/amrecover.h: Add an extern dump_dle variable. + * recover-src/set_commands.c: Send to amindexd the DLE command. + * server-src/amindexd.c: Handle the DLE command. + * server-src/server_util.c: Add *-RECOVER scripts, they can't be + executed on server. + * server-src/diskfile.c (xml_scripts): Add *-RECOVER scripts. + * common-src/amfeatures.h: New fe_amrecover_dle amfeature. + * common-src/amfeatures.c (am_init_feature_set): Add fe_amrecover_dle. + * common-src/amxml.c: Add *-RECOVER scripts. + * common-src/conffile.c: Add *-RECOVER scripts. + * common-src/conffile.h: Add *-RECOVER scripts. + +2008-05-29 Dustin J. Mitchell + * common-src/conffile.c: make config insensitive to + differences between '-' and '_' + * man/xml-source/amanda-client.conf.5.xml + man/xml-source/amanda.conf.5.xml + man/xml-source/amgetconf.8.xml: document it + * installcheck/Amanda_Config.pl installcheck/amgetconf.pl: update + tests + 2008-05-29 Orion Poplawski - * device-src/tests/semaphore-test.c: fix call to amanda_thread_init - * device-src/tests/vfs_test.c: fix call to amanda_thread_init * server-src/chunker.c: fix buffer overrun 2008-05-29 Jean-Louis Martineau @@ -205,11 +2207,110 @@ * device-src/rait-device.c: rait-device returns correct size when blocksize is too small +2008-05-28 Jean-Louis Martineau + * server-src/reporter.c: Fix ignoring pid line. + +2008-05-27 Jean-Louis Martineau + * config/amanda/ps.m4: Define PS_ARGUMENT to CYGWIN on cygwin. + * perl/Amanda/Process.pm: Works with PS_ARGUMENT eq "CYGWIN". + +2008-05-25 Jean-Louis Martineau + * server-src/amstatus.pl: use lib '@amperldir@'; + * perl/Amanda/Process.pm: use Amanda::Constants; + +2008-05-26 Dustin J. Mitchell + * device-src/rait-device.c: temporarily remove the call to set the + BLOCK_SIZE property on all RAIT children, as it fails with VFS + devices + * device-src/rait-device.c: rewrite g_ptr_array_union_robust to + correctly detect and handle child device failures + * common-src/fileheader.c: fix parse_file_header to be threadsafe + +2008-05-25 Jean-Louis Martineau + * device-src/tape-aix.c, device-src/tape-xenix.c + device-src/tape-posix.c: tape_is_ready take a (TapeDevice *) argument + * device-src/tape-posix.c (tape_is_ready): Check for broken_gmt_online. + * device-src/property.c: Add broken_gmt_online property. + * device-src/property.h: Add PROPERTY_BROKEN_GMT_ONLINE. + * device-src/tape-device.c: Use broken_gmt_online property. + * device-src/tape-device.h (TapeDevice): Add broken_gmt_online field. + * device-src/tape-ops.h (tape_is_ready): Change prototype. + 2008-05-25 Jean-Louis Martineau * changer-src/chg-zd-mtx.sh: Fix logging. 2008-05-25 Jean-Louis Martineau - * packaging/rpm/amanda.spec: Fix output message. + * packaging/rpm/amanda.spec: Fix output message. + +2008-05-25 Dustin J. Mitchell + * common-src/Makefile.am common-src/simpleprng.c + common-src/simpleprng.h: new simple PRNG module for + reproducible use in tests (bitlength bug fixed). + * xfer-src/dest-null.c: verify stream against PRNG + * xfer-src/source-random.c: use PRNG to create stream + * installcheck/Amanda_Xfer.pl: verify streams in xfers + * perl/Amanda/Xfer.swg: use PRNG + * xfer-src/xfer-element.h xfer-src/xfer-test.c: use + PRNG to test glue elements + +2008-05-23 Dustin J. Mitchell + * installcheck/Amanda_MainLooop.pl: handle SIGCHILD while + reading from dying child + +2008-05-22 Dustin J. Mitchell + * xfer-src/xfer-test.c: don't try to write to a file in the + source directory + +2008-05-22 Jean-Louis Martineau + * perl/Amanda/Process.pm (load_ps_table): Fix split. + +2008-05-22 Jean-Louis Martineau + * configure.in: Call AMANDA_PS_ARGUMENT + * config/amanda/ps.m4 (AMANDA_PS_ARGUMENT): New macro to find ps + argument. + * perl/Amanda/Constants.pm.in: Add PS_ARGUMENT. + * perl/Amanda/Process.pm (load_ps_table): Use PS_ARGUMENT. + +2008-05-22 Jean-Louis Martineau + * perl/Amanda/Process.pm: process_alive return '' if the process is + dead. + * installcheck/Amanda_Process.pl: New module to check Amanda::Process. + * installcheck/Makefile.am (server_tests): Add Amanda_Process. + +2008-05-21 Jean-Louis Martineau + * server-src/amstatus.pl: Add "failed: killed while" to some status if + the driver process is dead. + * perl/Amanda/Process.pm: New process_alive function. + +2008-05-21 Jean-Louis Martineau + * server-src/dumper.c server-src/planner.c, server-src/chunker.c, + server-src/amflush.c, server-src/driver.c, server-src/taper.c, + restore-src/amidxtaped.c, restore-src/restore.c, + restore-src/amfetchdump.c: Convert all pid_t to long before printing. + +2008-05-21 Jean-Louis Martineau + * man/xml-source/amcleanup.8.xml: Document new -p option. + * server-src/logfile.c (program_str): Add many programs. + * server-src/logfile.h (program_e): Add many programs. + * server-src/dumper.c, server-src/planner.c, + server-src/chunker.c, server-src/amflush.c, + server-src/driver.c, server-src/taper.c, + restore-src/amidxtaped.c, restore-src/restore.c, + restore-src/amfetchdump.c, + server-src/amdump.sh: Log pid and pid-done lines, call run_amclenup. + * server-src/server_util.c (run_amcleanup): New function to run + amcleanup. + * server-src/server_util.c (get_master_process): New function get the + name of the first pid line in a log file. + * server-src/server_util.h (run_amcleanup): Prototype. + * server-src/server_util.h (get_master_process): Prototype. + * server-src/reporter.c: Ignore pid and pid-done lines. + * server-src/amcleanup.pl: New amcleanup program written in perl. + * server-src/Makefile.am: Move amcleanup from SCRIPTS_SHELL to + SCRIPTS_PERL. + * server-src/amcleanup.sh: Old program removed. + * perl/Amanda/Process.pm: New module to hanlde amanda process. + * perl/Makefile.am: Add Amanda/Process.pm to Amanda_DATA and EXTRA_DIST 2008-05-21 Jean-Louis Martineau * server-src/driver.c: Fix quoting of diskname. @@ -222,64 +2323,308 @@ common-src/krb5-security.c common-src/dgram.c common-src/stream.c: use the type instead of socklen_t -2008-05-14 Dustin J. Mitchell - * client-src/amhpfixdevs.sh client-src/Makefile.am - client-src/amsinixfixdevs.sh config/amanda/devprefix.m4: - permanently remove amsinixfixdevs and amhpfixdevs +2008-05-20 Jean-Louis Martineau + Dustin J. Mitchell + John Franks + * server-src/amstatus.pl: quote disknames in amstatus + * server-src/Makefile.am: don't check amstatus (since it + uses Amanda::* libs) + * perl/Amanda/Util.swg: add (un)quote_string + * installcheck/Amanda_Util.pl installcheck/Makefile.am: test it 2008-05-16 Jean-Louis Martineau * common-src/conffile.c: Fix conf_parserror use. -2008-05-13 Dan Locks - * packaging/deb/buildpkg: modified build script to create unsigned - packages +2008-05-15 Dustin J. Mitchell + * perl/Makefile.am installcheck/Makefile.am Makefile.am: only build + XFA in server builds + +2008-05-15 Jean-Louis Martineau + * common-src/conffile.c: Parse send-amreport-on. + * common-src/conffile.h (send_amreport_t): New enum for possible value + of send-amreport-on. + * server-src/reporter.c: Use send-amreport-on setting. + * perl/Amanda/Config.swg: Define send_amreport_on_t constants. + * man/xml-source/amanda.conf.5.xml: Document send-amreport-on. + +2008-05-15 Jean-Louis Martineau + * client-src/client_util.c (application_property_argv_size): New + function to count the number of argument needed to store all + properties of an application for + * a dle in an ARGV. + * client-src/client_util.c (application_property_add_to_argv): New + function to add all properties of an application for a dle to an ARGV. + * client-src/client_util.h (application_property_argv_size, + application_property_add_to_argv): Prototype. + * client-src/sendbackup.c, client-src/sendsize.c, + client-src/selfcheck.c: Use new functions to pass properties as + argument to application plugin. + * application-src/script-email.pl, application-src/amstar.c, + application-src/generic-script.pl, + application-src/amgtar.c: Get properties from command line. + * server-src/server_util.c: Use new functions to pass properties as + argument to pre/post script. + * common-src/util.c (count_proplist): Callback function to count the + number of values of a property. + * common-src/util.c (proplist_add_to_argv): callback function to store a + property and it's value in an ARGV. + * common-src/util.h (count_proplist, proplist_add_to_argv): Prototype. + * common-src/conffile.c (property_argv_size): New function to count the + number of properties. + * common-src/conffile.c (property_add_to_argv): New function to store a + property and it's value in an ARGV. + * common-src/conffile.h (property_argv_size, + property_add_to_argv): Prototype. + +2008-05-15 Dustin J. Mitchell + * xfer-src/Makefile.am: add element-glue.h to the distribution + * xfer-src/element-glue.h: add 'extern' + * xfer-src/xfer-test.c: fix test elements + * xfer-src/xfer.c: don't use the sometimes-undefined constant + G_MAXINT32 + * xfer-src/source-random.c: Only use 'prolong' for threads, not + push/pull methods + * installcheck/Amanda_Xfer.pl: Check the content of $msg->{message} in + XMSG_INFO + +2008-05-14 Dustin J. Mitchell + * xfer-src/xfer-element.h xfer-src/xfer.c xfer-src/dest-null.c + xfer-src/source-random.c xfer-src/xfer-test.c + xfer-src/element-glue.c xfer-src/xmsg.h xfer-src/dest-fd.c + xfer-src/source-fd.c xfer-src/element-glue.h + xfer-src/Makefile.am xfer-src/filter-xor.c + xfer-src/xfer-element.c perl/Amanda/Xfer.swg: new organization + of transfer mechansims and new algorithm for linking xfers, with + expanded unit tests to exercise new glue elements + * installcheck/Amanda_Xfer.pl: updated installchecks + * common-src/semaphore.h: fix comment typo + * common-src/testutils.c common-src/testutils.h: optionally skip + timeouts (-t), and only show g_debug messages if -d is given + +2008-05-14 Dustin J. Mitchell + * client-src/amhpfixdevs.sh client-src/Makefile.am + client-src/amsinixfixdevs.sh config/amanda/devprefix.m4: + permanently remove amsinixfixdevs and amhpfixdevs 2008-05-12 Jean-Louis Martineau Patch by Orion Poplawski * server-src/planner.c: Warn about overwrite of last level 1, and force backup of level 1 if overwrite on this run. -2008-05-12 Dustin J. Mitchell - * server-src/dumper.c server-src/server_util.c - server-src/infofile.c server-src/amtrmlog.c common-src/debug.c - common-src/file.c: Always call mkpdir without the 02000 bit set, - as it is not needed and causes problems on MacOS X. - 2008-05-08 Jean-Louis Martineau - * packaging/deb/buildpkg packaging/rpm/buildpkg: AMVER=amanda-2.6.0p1 - * packaging/deb/changelog: amanda (2.6.0p1-1) - * packaging/deb/rules: AMVER=2.6.0p1 - * packaging/rpm/amanda.spec: amanda_version 2.6.0p1, amanda_release 1 - * NEWS: Update for 2.6.0p1 - * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0p1") + * common-src/conffile.c: Define default tapetype. 2008-05-08 Jean-Louis Martineau - * common-src/conffile.c: Define default tapetype. + * device-src/tape-device.c (tape_validate_properties): New function to + validate properties. + +2008-05-07 Jean-Louis Martineau + * man/xml-source/amdevcheck.8.xml: Add an OUTPUT section. 2008-05-07 Jean-Louis Martineau * common-src/conffile.c: Check the tapetype is defined. 2008-05-07 Jean-Louis Martineau * device-src/tape-device.c: Allow user to set "read_buffer_size" - property. + property. * restore-src/amrestore.c: Don't limit blocksize to - --with-maxtapeblocksize. + --with-maxtapeblocksize. * common-src/conffile.c: Increase readblocksize to blocksize. blocksize and readblocksize can be bigger than --with-maxtapeblocksize. +2008-05-06 Jean-Louis Martineau + * common-src/conffile.c: Add a 'mailer' config parameter. + * common-src/conffile.h: Add CNF_MAILER. + * changer-src/chg-scsi-chio.c, changer-src/chg-scsi.c + changer-src/chg-manual.sh, application-src/script-email.pl + server-src/amcheck.c server-src/amgetconf.pl + server-src/reporter.c: Use mailer from config. + * perl/Amanda/Config.swg: amglue_add_constant(CNF_MAILER, confparm_key) + * config/amanda/progs.m4: Set DEFAULT_MAILER. + * common-src/amanda-sh-lib.sh.in: Don't set MAILER. + * man/xml-source/amanda-client.conf.5.xml, + man/xml-source/amanda.conf.5.xml, + man/xml-source/amgetconf.8.xml: Update man pages. + 2008-05-02 Dan Locks - * packaging/rpm/amanda.spec: Replace ${ with %{ where applicable. + * packaging/rpm/amanda.spec: Replace ${ with %{ where applicable. + +2008-05-02 Dan Locks + * packaging/deb/amanda-enterprise-backup-server.postinst + packaging/rpm/amanda_enterprise.spec: Change .am_passphrase to a + semi-random number in both packages. + +2008-04-29 Dustin J. Mitchell + * config/amanda/dirs.m4: note that --with-dumperdir is + deprecated in ./configure --help + + +2008-04-24 Jean-Louis Martineau + * restore-src/restore.c: Fix test for DEVICE_STATUS_SUCCESS. + +2008-04-28 Dustin J. Mitchell + * xfer-src/Makefile.am xfer-src/xfer-element.h xfer-src/dest-fd.c + xfer-src/source-fd.c perl/Amanda/Xfer.swg: add new + Amanda::Xfer::Source::Fd, Amanda::Xfer::Dest::Fd + * xfer-src/source-random.c xfer-src/xfer.c xfer-src/dest-null.c + xfer-src/xfer.h xfer-src/filter-xor.c xfer-src/xfer-element.c: + reorganize detection of transfer completion, to handle cases where + elements don't do any active processing + * installcheck/Amanda_Xfer.pl: test it all + +2008-04-24 Jean-Louis Martineau + * server-src/reporter.c: Correctly print truncated quoted diskname. + +2008-04-23 Dustin J. Mitchell + * installcheck/Amanda_MainLoop.pl common-src/event-test.c + common-src/queueing-test.c: try to make tests more resilient + to heavily-loaded, slow machines 2008-04-23 Jean-Louis Martineau * common-src/security-util.c: Typo. 2008-04-23 Jean-Louis Martineau * server-src/driver.c: Always sent a FAILED to taper if dumper failed. + * common-src/event.c: Check event is not dead before fire it. 2008-04-23 Jean-Louis Martineau * server-src/planner.c: Fix vstrextend use. +2008-04-23 Dustin J. Mitchell + * common-src/event.c: use internal child_watch_source + for glib <2.6.0; versions 2.4.0 to 2.6.0 use unreliable + signals and are thus unreliable + +2008-04-22 Dustin J. Mitchell + * perl/Amanda/Logfile.swg server-src/find.c server-src/find.h: add + parsing of 'sec' and 'kb' from logfile messages + * perl/Amanda/DB/Catalog.pm perl/Makefile.am: new module + * installcheck/Amanda_DB_Catalog.pl installcheck/Makefile.am: checks + for new module + +2008-04-22 Dustin J. Mitchell + * common-src/event.c: on glib <2.4.0, use a simple polling + child_watch_source; on more recent glib, use glib's own + child_watch_source + +2008-04-22 Dustin J. Mitchell + * xfer-src/source-random.c xfer-src/xmsg.c xfer-src/xfer-element.h + xfer-src/xfer-dest.c xfer-src/xfer-test.c xfer-src/xmsg.h + xfer-src/xfer.c xfer-src/xfer-dest.h xfer-src/dest-null.c + xfer-src/xfer.h xfer-src/filter-xor.c xfer-src/xfer-element.c: + - flatten XferElement hierarchy to one level + - change test element argument order + - rename XMsg.src to Xmsg.elt + - Improve memory management (refcounting, perl interface) + * perl/Amanda/Changer.pm perl/Amanda/Xfer.swg + perl/Amanda/MainLoop.swg perl/Makefile.am + perl/amglue/amglue.h perl/amglue/source.c: + - rewrite handling of amglue_Source for better refcounting + - Amanda::MainLoop callbacks get the event source as 1st argument, + and will be called even if the event source goes out of scope in + perl + - MainLoop.swg significantly rewritten to get refcounting right + * installcheck/Amanda_Xfer.pl: new checks (without excessive use of + file descriptors) + * installcheck/Amanda_MainLoop.pl installcheck/Makefile.am: updated + checks + +2008-04-22 Jean-Louis Martineau + * device-src/tape-posix.c: Don't return DEVICE_STATUS_VOLUME_MISSING + on ioctl error. + * changer-src/chg-lib.sh.in (amdevcheck_status): return 1 only if the + possible errors are VOLUME_MISSING or DEVICE_BUSY. + +2008-04-22 Kevin Zembower + * man/xml-source/amflush.8.xml: add amflush example + +2008-04-22 Jean-Louis Martineau + * device-src/tape-device.c: Move all device access from + tape_device_open_device to tape_device_read_label. + tape_device_start read the label if it is not already read. + * device-src/vfs-device.c (vfs_device_open_device): remove read of the + label. + +2008-04-22 Jean-Louis Martineau + * device-src/tape-device.c (check_resetofs): Compilation fix if + NEED_RESETOFS is defined. + * device-src/tape-posix.c: Handle no ENOMEDIUM. + +2008-04-21 Dan Locks + * packaging/deb/buildpkg: modified build script to create unsigned + packages + +2008-04-21 Jean-Louis Martineau + * changer-src/chg-lib.sh.in (amdevcheck_status): + Set amdevcheck_message. + * changer-src/chg-chs.sh, changer-src/chg-juke.sh, + changer-src/chg-manual.sh, changer-src/chg-zd-mtx.sh, + changer-src/chg-multi.sh: Output amdevcheck_message + * device-src/device.c: Set errmsg and status. + device_open always return a device, the status and errmsg are set. + * device-src/device.h: Define DeviceStatusFlags. + * device-src/null-device.c, device-src/s3-device.c, + device-src/tape-device.c, device-src/vfs-device.c, + device-src/rait-device.c: Set errmsg and status. + * device-src/tape-posix.c: Return status for VOLUME_MISSING. + * device-src/tape-ops.h: Remove TapeCheckResult. + * server-src/taper-source.h (_TaperSource): Add errmsg. + * server-src/taper-source.c: Set errmsg + * server-src/amcheck.c, server-src/amtape.c, server-src/amlabel.c, + server-src/taperscan.c, restore-src/amrestore.c, + restore-src/restore.c: Use status and errmsg of a device. + * server-src/taper-disk-port-source.c: Set errmsg. + * server-src/reporter.c: Fix parsing of taper PARTIAL line. + * server-src/taper.c: Use errmsg for device and _TaperSource. + * server-src/taper-file-source.c: Set errmsg. + * server-src/amcheckdump.pl, + server-src/amdevcheck.pl: Use status and errmsg from device. + * perl/Amanda/Changer.pm: Fix for DEVICE_STATUS_*. + * perl/Amanda/Device.swg: New interface. + * installcheck/Makefile.am: Don't print some commands. + * installcheck/Amanda_Device.pl: Check new device api. + * common-src/queueing.c: Use new queue_fd_t. + * common-src/queueing.h (queue_fd_t): new struct. + * common-src/amanda-sh-lib.sh.in: Fix bug. + * common-src/queueing-test.c: Use queue_fd_t. + +2008-04-21 Dustin J. Mitchell + * installcheck/amgetconf.pl: properly quote filenames in + regex, to avoid spurious failures when e.g., '+' appears + in the filename + +2008-04-18 Dustin J. Mitchell + * perl/Amanda/Changer.pm: rewrite Amanda::Changer to use + Amanda::MainLoop, allowing asynchronous operation of + changers + * server-src/amcheckdump.pl: use new Amanda::Changer + interface (synchronously, until we have Amanda::Xfer) + * installcheck/Amanda_Changer.pl: test new interface + +2008-04-18 Dustin J. Mitchell + * installcheck/Makefile.am: build $(full_tests) too + +2008-04-18 Cyrille Bollu + * client-src/sendsize.c: use --numeric-owner during 'sendsize' + +2008-04-17 Dustin J. Mitchell + * installcheck/Makefile.am: segregate installchecks that require + both client and server components + +2008-04-17 Dustin J. Mitchell + * common-src/debug.c: add Amanda version to debug logs + +2008-04-16 Dustin J. Mitchell + * perl/Amanda/Util.swg common-src/util.c common-src/util.h: add + process type and context process attributes + * perl/Amanda/Debug.swg common-src/debug.c common-src/debug.h: add + debug_init to set up debugging according to the process context, and + log nothing in CONTEXT_SCRIPTUTIL + * server-src/amgetconf.pl server-src/amdevcheck.pl: + CONTEXT_SCRIPTUTIL + * server-src/amcheckdump.pl: use new $CONSTANT_CMDLINE variable + * installcheck/Amanda_Debug.pl: add comment + 2008-04-16 Dan Locks * Fixes to debian package reported by daniel_P * packaging/deb/preinst: remove spaces near ${amanda_group} @@ -291,11 +2636,20 @@ * packaging/deb/buildpkg: removed extraneous configure step * packaging/deb/amanda-backup-server.postinst: added check for correct permissions on /tmp/amanda - + +2008-04-16 Dan Locks + * packaging/deb/rules packaging/rpm/amanda.spec: remove --with-gnutar= + from configure invocation. no longer necessary. + +2008-04-16 Dustin J. Mitchell + * device-src/s3.c config/amanda/s3-device.m4: test curl features + at runtime, instead of compile time, and always use SSL if it + is available. + 2008-04-16 Jean-Louis Martineau * server-src/amadmin.c: Improve message. * man/xml-source/amanda.conf.5.xml: Fix man page. - * server-src/planner.c: Fix DS_INCRONLY and FORCE_FULL + * server-src/planner.c: Fix DS_INCRONLY and FORCE_FULL. 2008-04-16 Dustin J. Mitchell * config/amanda/dumpers.m4: continue searching for gnutar if we @@ -311,6 +2665,12 @@ * common-src/debug.c (debug_logging_handler, debug_printf): Don't print msg_timestamp() to stderr. +2008-04-15 Jean-Louis Martineau + * server-src/dumper.c: Call error() only after set_logerror is done. + * server-src/planner.c: Call error() only after set_logerror is done. + * server-src/chunker.c: Report a better error message. + * common-src/stream.c: Set errno to ETIMEDOUT after a timeout. + 2008-04-15 Jean-Louis Martineau * server-src/find.c (dumps_match_dumpspecs): New function to only keep dumps that match a dumpspecs, using it simplify amfetchdump. @@ -327,6 +2687,7 @@ * perl/Amanda/Cmdline.swg: cmdline_parse_dumpspecs. * perl/amglue/dumpspecs.swg: Map dumpspecs to perl. * perl/Makefile.am (AMGLUE_SWG): Add amglue/dumpspecs.swg. + * installcheck/Amanda_Logfile.pl: Add many tests. 2008-04-15 Jean-Louis Martineau * tape-src/tapetype.c: Initialize an default config. @@ -335,19 +2696,155 @@ * common-src/util.c (connect_portrange, connect_port, bind_portrange): Return the latest errno reported. +2008-04-08 Dustin J. Mitchell + * common-src/conffile.c common-src/conffile.h + perl/Amanda/Config.swg installcheck/Amanda_Config.pl: + new interface for config errors, re-introduce rawtapedev for + deprectation purposes + * installcheck/Installcheck/Config.pm: support test + amanda-client.conf files + * installcheck/Installcheck/Run.pm: add get_stdout, get_stderr + * client-src/client_util.c client-src/client_util.h: add + config_errors_to_error_string + * server-src/dumper.c server-src/planner.c: handle ERRORs and NAKs + better, so users see client-side config errors + * oldrecover-src/amrecover.c changer-src/chg-scsi-chio.c + changer-src/chg-scsi.c client-src/sendbackup.c client-src/sendsize.c + client-src/selfcheck.c amandad-src/amandad.c application-src/amstar.c + application-src/amgtar.c recover-src/amrecover.c + server-src/amlogroll.c server-src/amindexd.c server-src/amcheck.c + server-src/amgetconf.pl server-src/chunker.c server-src/amadmin.c + server-src/amtape.c server-src/amcheckdump.pl + server-src/amcleanupdisk.c server-src/amflush.c server-src/amtrmlog.c + server-src/driver.c server-src/reporter.c server-src/taper.c + server-src/amdevcheck.pl server-src/amtrmidx.c server-src/diskfile.c + server-src/amlabel.c installcheck/Amanda_Changer.pl + installcheck/Amanda_Device.pl installcheck/Amanda_Logfile.pl + installcheck/Amanda_Tapelist.pl restore-src/amidxtaped.c + restore-src/amrestore.c restore-src/amfetchdump.c: adapt to new config + error interface + +2008-04-08 Dustin J. Mitchell + * server-src/diskfile.c: improve messages when client does not + support required features + +2008-04-08 Dustin J. Mitchell + * installcheck/Amanda_Config.pl common-src/conffile.c + common-src/conffile.h: fix deprecation of keywords to + actually issue a warning. 'netusage' is no longer + deprecated. + +2008-04-08 Dustin J. Mitchell + * common-src/event.c: use SA_RESTART for child_watch_source + +2008-04-07 Dustin J. Mitchell + * perl/Amanda/MainLoop.swg perl/amglue/source.c + installcheck/Amanda_MainLoop.pl: wrap GMainLoop and the + GSources defined in event.c, using an extensible model + * common-src/event.c: check whether child_watch_source's signal + handler has been replaced, and issue a warning if it has. + +2008-04-07 Dustin J. Mitchell + * common-src/queueing.c: fix condition (thanks to Jean-Louis + Martineau) + +2008-04-07 Dustin J. Mitchell + * common-src/Makefile.am common-src/queueing-test.c: new tests + * device-src/tests/queue_test.c device-src/tests/Makefile.am: remove + * common-src/queueing.c: fix two bugs: + - spurious in-place memmove on every buffer copy + - silent discard of a final packet if the consumer does not + completely consume it + * common-src/queueing.h: update comments + * common-src/testutils.h: add header-protection macros + +2008-04-07 Dustin J. Mitchell + * installcheck/Makefile.am installcheck/Amanda_Device.pl: Add tests + for Amanda::Device + +2008-04-07 Dustin J. Mitchell + * man/xml-source/amanda.conf.5.xml: fix typos + 2008-04-04 Jean-Louis Martineau * man/xml-source/*.xml: Use ulink tag to link to wiki.zmanda.com. 2008-04-04 Jean-Louis Martineau * restore-src/restore.c: Check last_header->type != F_UNKNOWN. +2008-04-01 Dustin J. Mitchell + Suggested by Sunil Sawant + * man/xml-source/amrecover.8.xml: suggest including a config in the + amrecover command line + +2008-04-01 John Franks + * gnulib/regenerate/regenerate gnulib/regenerate/no-restrict.patch: + Patches to reapply after gnulib updates. + * gnulib/inet_ntop.c gnulib/inet_ntop.h gnulib/string.in.h + gnulib/gettimeofday.c gnulib/sys_time.in.h gnulib/base64.c + gnulib/getaddrinfo.c gnulib/Makefile.am gnulib/base64.h + gnulib/getaddrinfo.h: + Remove restricted keywords from source files. + +2008-04-01 Satya Ganga + * example/template.d/amanda-S3.conf.in: S3 device should have + "infinite" tape length + +2008-03-31 John Franks + * common-src/stream.c + Fix warning about ininitialized variables. + +2008-03-31 John Franks + * oldrecover-src/Makefile.am xfer-src/Makefile.am + recover-src/Makefile.am server-src/Makefile.am + restore-src/Makefile.am: + Fix build problems with multiply defined symbols. + 2008-03-31 Dan Locks - * packaging/deb/buildpkg + * packaging/deb/buildpkg packaging/rpm/buildpkg: added -p to cp to preserve file timestamps. +2008-03-31 Dustin J. Mitchell , Jean-Louis Martineau + * client-src/sendbackup-gnutar.c client-src/sendsize.c + client-src/selfcheck.c: update amandates whenever possible, but only + complain when it is really needed: when using calcsize, or when + using GNUTAR and --without-gnutar-listdir. + * client-src/amandates.c: Set errno before return of start_amandates + * perl/Amanda/Paths.pm.in: always terminate a perl mod with '1;' + +2008-03-31 Jean-Louis Martineau + * server-src/amgetconf.pl: Parse config after setup_applccation call. + +2008-03-31 Jean-Louis Martineau + * server-src/amcheck.c: Check errno after full_read. + 2008-03-31 Dan Locks * packaging/Makefile.am: add deb subdirectory. +2008-03-31 Dustin J. Mitchell + * common-src/rsh-security.c common-src/ssh-security.c: improve error + messages for resolve_hostname calls + +2008-03-27 Dustin J. Mitchell + * common-src/util.c common-src/util.h: remove fullread(), fullwrite() + * gnulib/regenerate/regenerate gnulib/Makefile.am + config/gnulib/gnulib-cache.m4: add full-read, full-write modules + * oldrecover-src/extract_list.c client-src/noop.c + client-src/sendbackup-gnutar.c client-src/sendbackup.c + client-src/sendsize.c client-src/selfcheck.c amandad-src/amandad.c + application-src/amgtar.c recover-src/extract_list.c + server-src/changer.c server-src/logfile.c server-src/amindexd.c + server-src/amcheck.c server-src/dumper.c server-src/chunker.c + server-src/taper-port-source.c server-src/driverio.c + server-src/holding.c server-src/driver.c + server-src/taper-file-source.c restore-src/restore.c + common-src/security-util.c common-src/amanda.h + tape-src/output-file.c: use gnulib full_read, full_write functions, + which have slightly different error semantics than the corresponding + Amanda functions. + +2008-03-27 Jean-Louis Martineau + * application-src/amgtar.c: Add 'CHECK-DEVICE' property. + 2008-03-27 Jean-Louis Martineau * device-src/activate-devpay.c (parse_commandline): Always return. @@ -365,6 +2862,9 @@ * perl/Makefile.am (install-data-hook): Copy cygwin ddl if WANT_CYGWIN_COPY_PERL_DLL. +2008-03-25 Jean-Louis Martineau + * common-src/conffile.c: Fix typo and remove unused prefix. + 2008-03-25 Jean-Louis Martineau * server-src/reporter.c: Check difference between origsize and outsize to find if the image is compressed. @@ -372,7 +2872,7 @@ 2008-03-25 Jean-Louis Martineau Greg Troxel reported the bug and possible solution. * common-src/stream.c (stream_server): New family argument, it is used - to create the socket. + to create the socket. * common-src/stream.h (stream_server): New prototype. * server-src/chunker.c, server-src/taper.c: Call stream_server with family of 'localhost', it's the name dumper use to contact them. @@ -380,10 +2880,14 @@ * common-src/bsd-security.c, common-src/security-util.c: Call stream_server with family of incoming packet. +2008-03-25 Jean-Louis Martineau + Davor Ocelic reported the problem. + * application-src/Makefile.am: Use applicationexec_PROGRAMS and + applicationexec_SCRIPTS to install executable. + 2008-03-25 Jean-Louis Martineau * common-src/security-util.c (show_stat_info): Use getpwuid_r and getgrgid_r. - 2008-03-25 Dustin J. Mitchell * config/amanda/swig.m4: fix the fix to the fix for FreeBSD systems' peculiar linking of threading libraries. @@ -400,40 +2904,154 @@ overrides * packaging/deb/amanda-backup-client.dirs: removed var/amanda -2008-03-18 Jean-Louis Martineau - * Amanda 2.6.0 released. - * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0") - * packaging/rpm/amanda.spec: %define amanda_version 2.6.0 - * packaging/rpm/buildpkg: AMVER=amanda-2.6.0 +2008-03-18 Dustin J. Mitchell + * device-src/activate-devpay.c: fix type warning 2008-03-17 Jean-Louis Martineau * server-src/diskfile.c: Correctly check if two hosts map to the same name. +2008-03-15 Dustin J. Mitchell + * perl/Makefile.am perl/amglue/mainloop.c perl/amglue/amglue.h + perl/amglue/source.c: rename mainloop.c to source.c to avoid + conflicts with MainLoop.c on case-insensitive filesystems + 2008-03-14 Dan Locks - * packaging/deb/*: Initial debian package release. This package is - based on Bdale Garbee's work as the official debian maintainer for - amanda. + * Initial debian release: This package is based on Bdale Garbee's + work as the official debian maintainer for amanda. + +2008-03-14 Jean-Louis Martineau + * man/xml-source/amanda.conf.5.xml: Document global and by dumptype + property. + * server-src/server_util.c: Rename _proplist to _property. + * server-src/diskfile.c: Rename _proplist to _property. + * server-src/amadmin.c (disklist_one): Print property. + * perl/Amanda/Config.swg: Add new constants to Amanda::Config + * installcheck/Amanda_Config.pl: Test global property. + * common-src/conffile.c: Add global and by dumptype property. + * common-src/conffile.h: Add global and by dumptype property. + +2008-03-14 Dustin J. Mitchell + * perl/Amanda/MainLoop.swg perl/Makefile.am: new perl module + * perl/amglue/amglue.h perl/amglue/mainloop.c: support for new module + * installcheck/Amanda_MainLoop.pl installcheck/Makefile.am: tests for + new module + * common-src/event.h: fix typo in comment + +2008-03-14 Dustin J. Mitchell + * xfer-src/dest-null.c: fix Solaris 8 compilation problem: isprint() + expects an int, not a char. 2008-03-13 Dan Locks * packaging/rpm/amanda.spec: changed the PKG_CONFIG_PATH macro so that it works with rpm versions earlier than 4.4 +2008-03-13 Dustin J. Mitchell + * device-src/device-queueing.c device-src/device-queueing.h + server-src/taper-source.c server-src/taper-source.h + server-src/taper-source-test.c server-src/taper.c + common-src/queueing.c common-src/queueing.h: change ints in + consumer/producer to (s)size_t + * device-src/device.c device-src/device-queueing.c + device-src/tests/semaphore-test.c device-src/tests/Makefile.am + device-src/queueing.c device-src/semaphore.c + device-src/device-queueing.h device-src/queueing.h + device-src/Makefile.am device-src/semaphore.h + device-src/property.h server-src/taper.c common-src/queueing.c + common-src/queueing.h common-src/semaphore-test.c + common-src/semaphore.c common-src/semaphore.h + common-src/Makefile.am: move queueing and semaphore into + common-src, along with their tests + * configure.in xfer-src/source-random.c xfer-src/xfer-element.h + xfer-src/xfer-dest.c xfer-src/xfer-test.c xfer-src/xfer.c + xfer-src/xfer-dest.h xfer-src/amxfer.h xfer-src/dest-null.c + xfer-src/Makefile.am xfer-src/xfer.h xfer-src/xfer-element.c + xfer-src/filter-xor.c Makefile.am: introduce transfer architecture + * xfer-src/xmsg.c xfer-src/xfer-element.h xfer-src/xfer-test.c + xfer-src/xmsg.h xfer-src/xfer.c xfer-src/amxfer.h + xfer-src/Makefile.am xfer-src/xfer.h: support for sending + and receiving XMsgs. + * common-src/event.c common-src/event.h: add default_event_loop(). + * device-src/device.c server-src/taper-source-test.c common-src/util.c + common-src/util.h common-src/glib-util.c common-src/glib-util.h: + create new glib_init() to do g_type_init(), initialize threads, etc. + +2008-03-13 Jean-Louis Martineau + * client-src/sendsize.c: Don't use sscanf for est->qamname because it + can have a '%'. + * server-src/diskfile.c: Clean the diskname before using it as a regex. + * common-src/protocol.c: Fix bug if packet have a '%' character. + +2008-03-13 Jean-Louis Martineau + * installcheck/Installcheck/Run.pm: Increase size of TAPE. + +2008-03-12 Dustin J. Mitchell + * common-src/event.c: Use %jd to print a pid_t, since it may be + larger on some platforms. + +2008-03-12 Jean-Louis Martineau + * common-src/conffile.c: Fix solaris 8 cc warning. + +2008-03-12 Jean-Louis Martineau + * client-src/sendbackup.c: Set stroptions to "". + +2008-03-12 Dustin J. Mitchell + * common-src/event.c common-src/event.h common-src/event-test.c: + add two new GSources: child_watch_source (sends events when a child + dies) and fdsource (sends events when file descriptors match + conditions). Thanks to Jean-Louis Martineau for finding and fixing + a race condition. + +2008-03-12 Dustin J. Mitchell + * gnulib/regenerate/regenerate gnulib/Makefile.am DEVELOPING: update + documentation to reflect use of gnulib's git repository + +2008-03-12 Jean-Louis Martineau + * installcheck/Makefile.am: Remove CONFIG_CLOBBER_MY_CONFIG, + it is done automaticaly. + * config/amanda/defaults.m4: AC_SUBST(CONFIG_CLOBBER_MY_CONFIG) to not + conflict with make CLOBBER_MY_CONFIG. + +2008-03-12 Jean-Louis Martineau + * installcheck/Makefile.am: Use CONFIG_CLOBBER_MY_CONFIG for Makefile + variable. + +2008-03-11 Dan Locks + * packaging/rpm/buildpkg: made the script quieter + 2008-03-12 Dan Locks - * packaging/rpm/buildpkg: made the script quieter, simplified its - usage by creating the required tarball on the fly. * packaging/rpm/amanda.spec: fixed a number of complaints from rpmlint, added --quiet to the configure invocation 2008-03-10 Jean-Louis Martineau - * device-src/tests/semaphore-test.c, - device-src/tests/vfs_test.c: Call amanda_thread_init(NULL). + * gnulib: Update to latest version, add getopt module. 2008-03-07 Jean-Louis Martineau - * Amanda 2.6.0b3 released. - * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b3") - * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b3 - * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b3 + * oldrecover-src/Makefile.am, example/Makefile.am, + amandad-src/Makefile.am, recover-src/Makefile.am, + restore-src/Makefile.am, Makefile.am: Include config/automake/vars.am. + * installcheck/Amanda_Config.pl: Check config_filename. + * installcheck/Installcheck/Config.pm: Use local amandates and + gnutar_listdir. + * installcheck/Makefile.am: Take a copy of amanda-client.conf + * config/amanda/defaults.m4: AC_SUBST(CLOBBER_MY_CONFIG) + * config/automake/scripts.am: DISTCLEANFILES += $(SCRIPTS_INCLUDE) + * config/automake/installperms.am: installperms.sh in top_builddir, + DISTCLEANFILES += $(installperms_sh) + * Makefile.am: add '--without-amperldir CLOBBER_MY_CONFIG=OK' to + DISTCHECK_CONFIGURE_FLAGS. + * common-src/Makefile.am: distclean-local: remove svn-info.h. + +2008-03-07 Dan Locks + * packaging/rpm/buildpkg: Simplified usage of packaging script by + creating a tarball from existing source. + +2008-03-06 Jean-Louis Martineau + * installcheck/Installcheck/Run.pm: merge from application-api. + * installcheck/Installcheck/Config.pm: merge from application-api. + +2008-03-06 Jean-Louis Martineau + * merge application-api 2008-03-06 Jean-Louis Martineau * common-src/Makefile.am: dest=$(amlibexecdir). @@ -474,8 +3092,10 @@ * packaging/rpm/amanda.spec: Add %{PERLSITELIB} in %files sections. 2008-03-05 Jean-Louis Martineau - * restore-src/amidxtaped: Use default config if amrecover doesn't send a config name. (amoldrecover doesn't send a config). - * restore-src/restore.c: amrecover from 2.4.5 doesn't send the filenum, so desired_tape->numfiles == 0. + * restore-src/amidxtaped: Use default config if amrecover doesn't send + a config name. (amoldrecover doesn't send a config). + * restore-src/restore.c: amrecover from 2.4.5 doesn't send the filenum, + so desired_tape->numfiles == 0. If amidxtaped is launched directly from xinetd, then flags->pipe_to_fd == STDOUT_FILENO, but this test should only succeed for amrestore of amfetchdump. @@ -496,25 +3116,28 @@ * config/amanda/dumpers.m4: Typo. 2008-03-03 Jean-Louis Martineau - * device-src/tests/vfs_test.c: Fix ignoring + * device-src/tests/vfs_test.c, common-src/event-test.c: Fix ignoring return value of 'pipe', declared with attribute warn_unused_result. 2008-02-29 Dustin J. Mitchell * common-src/amanda.h: add -2008-02-29 Dustin J. Mitchell - * installcheck/Amanda_Config.pl: fix Amanda_Config's use of the - missing Amanda::Tests - -2008-02-29 Dustin J. Mitchell - * installcheck/Makefile.am: remove Amconfig.pm from EXTRA_DIST, as it - is a generated file. +2008-02-28 Dustin J. Mitchell + * config/automake/installperms.am: --without-installperms now + generates a shell-parsable list of desired permissions + * Makefile.am: erase installperms.sh before beginning a 'make + install' + * oldrecover-src/Makefile.am client-src/Makefile.am + recover-src/Makefile.am server-src/Makefile.am: give mode + bits in octal 2008-02-28 Dustin J. Mitchell Thanks to John E. Hein for identifying this problem + * perl/Amanda/Tests.swg: expose sizeof(size_t) to perl * installcheck/Amanda_Config.pl: use a properly-sized constant to check parsing of large configuration values + 2008-02-28 Jean-Louis Martineau * server-src/amindexd.c: Compute maxpart, call clean_dump. * server-src/disk_history.h (DUMP_ITEM): Add maxpart field. @@ -526,18 +3149,32 @@ DUMP_ITEM if all part are not added. * common-src/tapelist.h (tapelist_t): Add partnum field. * common-src/tapelist.h (append_to_tapelist): New prototype, - add partnum argument. + add partnum argument. * common-src/tapelist.c (append_to_tapelist): New partnum argument. * restore-src/amfetchdump.c: Use new append_to_tapelist prototype. +2008-02-28 Jean-Louis Martineau + * common-src/security-util.c: Don't write unclaimed warning if we have + an accept function. + +2008-02-27 Dustin J. Mitchell + * common-src/testutils.c common-src/testutils.h + common-src/Makefile.am: add libtestutils.la + * common-src/event-test.c common-src/amflock-test.c: + use libtestutils.la + 2008-02-27 Jean-Louis Martineau * server-src/find.c: Use sort_key in switch statement. 2008-02-26 Jean-Louis Martineau * NEWS, ReleaseNotes: Document --with-amlibdir. * config/amanda/dirs.m4: Add AS_HELP_STRING for --without-amlibdir and - --without-amlibexecdir, - Set AMPERLLIB to $amlibdir/perl. + --without-amlibexecdir, + Set AMPERLLIB to $amlibdir/perl. + +2008-02-26 Dustin J. Mitchell + * common-src/event-test.c: a more robust and effective test of + EV_READFD; thanks to Jean-Louis Martineau for the suggestions. 2008-02-26 Dustin J. Mitchell * perl/Makefile.am config/amanda/dirs.m4 config/amanda/summary.m4: @@ -557,7 +3194,6 @@ 2008-02-20 Jean-Louis Martineau * config/amanda/dirs.m4: Add --with-amlibdir and --with-amlibexecdir. - * NEWS, ReleaseNotes: Document it. 2008-02-20 Jean-Louis Martineau * server-src/amcheck.c, server-src/dumper.c, @@ -587,7 +3223,7 @@ * server-src/find.c: fix compiler warning on Solaris 8 2008-02-15 Jean-Louis Martineau - * packaging/rpm/amanda.spec: Fix typo. + * packaging/rpm/amanda.spec: Remove amverify* 2008-02-15 Jean-Louis Martineau * oldrecover-src/Makefile.am: Build all files in the build directory. @@ -601,14 +3237,52 @@ * file server-src/infofile.c: Use %jd to print intmax_t value. * file server-src/driver.c: Use 'long long' and '%lld' to sscanf. +2008-02-15 Jean-Louis Martineau + * packaging/rpm/amanda.spec: Fix typo. + 2008-02-15 Jean-Louis Martineau * server-src/amdump.sh: Don't use 'date -d', use sed. +2008-02-14 Dustin J. Mitchell + * installcheck/Installcheck/Run.pm: run test dumps of a smaller + directory, to avoid overflowing test tapes + +2008-02-14 Dustin J. Mitchell + * dumper-src/amstar.pl dumper-src/amgtar.pl + device-src/tests/get-activation-key.pl server-src/amcheckdump.pl + server-src/amdevcheck.pl: add GPL header + +2008-02-14 Dustin J. Mitchell + * installcheck/Makefile.am installcheck/amdump.pl: add a check + that runs 'amdump' directly, since that fails often + +2008-02-14 Dustin J. Mitchell + * common-src/event-test.c: make tests more robust to environmental + variations, clean up forked children + +2008-02-13 Dustin J. Mitchell + * common-src/security-util.c + common-src/security-util.h: don't cast pointers to + integers for tcp_conn event id's + 2008-02-13 Dan Locks * packaging/rpm/amanda.spec: added a check for PKG_CONFIG_PATH in the build environment as well as if provided on rpmbuild commandline. Conditionalized this var to handle cross compiling on FC8. +2008-02-12 Dustin J. Mitchell + * amandad-src/amandad.c: use sizeof() instead of strlen() + in a constant expression + +2008-02-12 Dustin J. Mitchell + * amandad-src/amandad.c: initialize as->service + * common-src/event.c common-src/event.h: new GMainLoop-based + version of the event library, allowing GMainLoop-based and + event-based processes to co-exist peacefully + +2008-02-12 Dustin J. Mitchell + * installcheck/amcheckdump.pl: fix typo + 2008-02-12 Jean-Louis Martineau * server-src/dumper.c: Fail if no header or no data. @@ -616,48 +3290,93 @@ * server-src/amstatus.pl: Report failure if dumper succeed and chunker failed. -2008-02-07 Jean-Louis Martineau - * NEWS, ReleaseNotes: Add notes about rsh/ssh and amandad_path. +2008-02-12 Jean-Louis Martineau + * common-src/conffile.h (config_name, config_dir, config_filename): + Remove extern declaration. + * common-src/conffile.h (get_config_name, get_config_dir, + get_config_filename): New prototype. + * common-src/conffile.c (config_name, config_dir, config_filename): + Declare static. + * common-src/conffile.h (get_config_name, get_config_dir, + get_config_filename): New functions. + * perl/Amanda/Config.swg: Don't inline the functions. + * oldrecover-src/extract_list.c, client-src/sendbackup.c, + client-src/sendsize.c, client-src/selfcheck.c, + recover-src/amrecover.c, recover-src/extract_list.c, + server-src/changer.c, server-src/amlogroll.c, + server-src/amindexd.c, server-src/amcheck.c, + server-src/dumper.c, server-src/planner.c, + server-src/chunker.c, server-src/amadmin.c, + server-src/amtape.c, server-src/amcleanupdisk.c, + server-src/amflush.c, server-src/amtrmlog.c, + server-src/driverio.c, server-src/driver.c, + server-src/reporter.c, server-src/taper.c, + server-src/amtrmidx.c, server-src/diskfile.c, + server-src/amlabel.c, + restore-src/amfetchdump.c: Use new functions. -2008-02-07 Jean-Louis Martineau - * Amanda 2.6.0b2 released. - * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0b2") - * packaging/rpm/amanda.spec: %define amanda_version 2.6.0b2 - * packaging/rpm/buildpkg: AMVER=amanda-2.6.0b2 +2008-02-12 Dustin J. Mitchell + * common-src/event-test.c common-src/Makefile.am: add checks + for the event module + +2008-02-12 Dustin J. Mitchell + * server-src/dumper.c server-src/server_util.c + server-src/infofile.c server-src/amtrmlog.c common-src/debug.c + common-src/file.c: Always call mkpdir without the 02000 bit set, + as it is not needed and causes problems on MacOS X. + +2008-02-11 Dustin J. Mitchell + * all source files: update GPL dates + * perl/*: use LGPL instead of GPL + +2008-02-11 Dustin J. Mitchell + * amandad-src/amandad.c: fix use of non-constant array size + +2008-02-11 Dustin J. Mitchell + * amandad-src/amandad.c: add hack to avoid a race condition in + sendbackup operation + * common-src/security-util.c: issue debug log message when data + tokens are dropped by the security API 2008-02-07 Jean-Louis Martineau * recover-src/amrecover.c: Use tapedev from server if it is not set - in amanda.client.conf + in amanda.client.conf * example/amanda-client.conf.in: Document it. 2008-02-07 Jean-Louis Martineau - * device-src/tape-device.c (tape_device_init): Init min_block_size - and fixed_block_size to 32768. - -2008-02-07 Jean-Louis Martineau - * device-src/tape-posix.c (tape_is_ready): Don't use GMT_ONLINE. + * device-src/tape-device.c (tape_device_init): Init min_block_size + and fixed_block_size to 32768. 2008-02-07 Dustin J. Mitchell - * man/xml-source/amcheckdump.8.xml: add -o option - * man/Makefile.am: build amcheckdump manpage + * packaging/rpm/amanda_enterprise.spec man/Makefile.am + man/xml-source/amverify.8.xml man/xml-source/amverifyrun.8.xml + man/xml-source/amcheckdump.8.xml server-src/amverifyrun.sh + server-src/amverify.sh server-src/Makefile.am: remove amverify* * server-src/amdevcheck.pl: tweak @ARGV parsing * server-src/amcheckdump.pl installcheck/Installcheck/Run.pm installcheck/amcheckdump.pl: significant rewrite to catch more errors and not loop for ever on some errors. +2008-02-01 Dustin J. Mitchell + * server-src/amgetconf.pl installcheck/amgetconf.pl + common-src/conffile.c: fix and test amgetconf to allow extra + command-line arguments (undocumented), to allow -o options without a + space, and to correctly return empty results for empty build + variables + 2008-02-01 Dan Locks * packaging/rpm/amanda.spec: added amdumpcheck.8.gz to the %files list for both client and server, removed amplot from client, added missing directory %{SYSCONFDIR}/amanda 2008-01-29 Dan Locks - * packaging/rpm/amanda.spec: changed %{SYSCONFDIR} to %{LOCALSTATEDIR} - where amanda/amandates is concerned. also added %{LOCALSTATEDIR} to - the %files list. + * packaging/rpm/amanda.spec: changed %{SYSCONFDIR} to %{LOCALSTATEDIR} + where amanda/amandates is concerned. also added %{LOCALSTATEDIR} to + the %files list. 2008-01-29 Dan Locks - * man/xml-src/*: added wiki.zmanda.com to "see also" section of all - man pages. + * man/xml-source/* added http://wiki.zmanda.com to the "see also" + section 2008-01-29 Jean-Louis Martineau * client-src/sendbackup.c: Check for g_options. @@ -677,7 +3396,7 @@ 2008-01-28 Dustin J. Mitchell * configure.in config/amanda/ipv6.m4 common-src/amanda.h: check - for netinet/in.h and in_port_t, and define the latter if + for netinet/in.h and in_port_t, and define the latter if necessary. Thanks to Craig Dewick for the suggestion. @@ -700,6 +3419,9 @@ 2008-01-22 Dustin J. Mitchell * configure.in config/amanda/userid.m4: add --with-single-userid +2008-01-22 Dustin J. Mitchell + * server-src/amfreetapes.sh: remove unused script + 2008-01-22 Dustin J. Mitchell * perl/amglue/amglue.h perl/amglue/bigint.c: Include integer limits for all amglue files where they are missing from glib headers @@ -718,6 +3440,76 @@ * config/amanda/dumpers.m4: eliminate strange warning when --without-smbclient is given +2008-01-18 Dustin J. Mitchell + * server-src/amgetconf.pl perl/Amanda/Constants.pm.in + installcheck/Amanda_Types.pl installcheck/Amanda_Config.pl + installcheck/Amanda_Tapelist.pl installcheck/Amanda_Debug.pl + installcheck/Amanda_Changer.pl installcheck/amdevcheck.pl + installcheck/Installcheck/Config.pm + installcheck/Amanda_Cmdline.pl installcheck/amcheckdump.pl + installcheck/Amanda_Logfile.pl installcheck/amgetconf.pl: + accumulated tweaks and updates to installchecks + +2008-01-18 Dustin J. Mitchell + * perl/Amanda/Tests.swg perl/Makefile.am installcheck/bigint.pl + installcheck/Makefile.am: new tests for integer-handling + SWIG support, including an installed module (Amanda::Test) that + is not used except by this test. + +2008-01-18 Dustin J. Mitchell + * installcheck/Amanda_Types.pl + installcheck/Amanda_Config.pl installcheck/Amanda_Changer.pl + installcheck/Amconfig.pm.in installcheck/amdevcheck.pl + installcheck/Installcheck installcheck/Installcheck/Run.pm + installcheck/Installcheck/Config.pm installcheck/Makefile.am + installcheck/amcheckdump.pl installcheck/Amanda_Logfile.pl + installcheck/amgetconf.pl: tweaks: + - Move installcheck utilities to the Installcheck::* namespace + - add Installcheck::Run to help with setting up amdump runs, and + running applications in general + - Add complete runs to amdevcheck, amcheckdump + - Return a nonzero exit status from amgetconf when an invalid + configuration parameter is specified. + +2008-01-18 Dustin J. Mitchell + * perl/Amanda/Tapelist.swg perl/Amanda/Tapefile.swg perl/Makefile.am: + new module (Tapelist) replaces old stub (Tapefile) + * installcheck/Amanda_Tapelist.pl installcheck/Makefile.am: test new + module + * server-src/amcheckdump.pl installcheck/Amanda_Logfile.pl: use new + module + +2008-01-18 Dustin J. Mitchell + * perl/Makefile.am perl/Amanda/Debug.swg: handle die() and warn() with + critical() and warning(), respectively + * server-src/amgetconf.pl server-src/amcheckdump.pl + server-src/amdevcheck.pl: use die() + * installcheck/Amanda_Config.pl installcheck/Amanda_Changer.pl + installcheck/Amanda_Debug.pl installcheck/Makefile.am: new/updated + unit tests + +2008-01-18 Dustin J. Mitchell + * man/xml-source/amgetconf.8.xml server-src/amgetconf.pl + server-src/getconf.c server-src/Makefile.am: rewrite amgetconf in + Perl, and add the ability to list available build variables. + * config/amanda/krb4-security.m4 config/amanda/krb5-security.m4 + config/amanda/bsd-security.m4 config/amanda/dumpers.m4 + config/amanda/bsdtcp-security.m4 config/amanda/userid.m4 + config/amanda/rsh-security.m4 config/amanda/ssh-security.m4 + config/amanda/bsdudp-security.m4 config/amanda/compress.m4 + config/amanda/debugging.m4 config/amanda/flock.m4: AC_SUBST a bunch + of constants for use in Amanda::Constants + * perl/Makefile.am perl/Amanda/Paths.pm.in + perl/Amanda/Constants.pm.in: add new constants + * perl/Amanda/Config.swg: add getconf_byname_strs + * installcheck/amgetconf.pl: check new functionality + * perl/Amanda/Util.swg common-src/util.c common-src/util.h: add + RUNNING_AS_ANY + +2008-01-17 Jean-Louis Martineau + * packaging/rpm/buildpkg, packaging/rpm/amanda.spec, + configure.in: Set for release 2.6.1alpha. + 2008-01-16 Dustin J. Mitchell * installcheck/Makefile.am: Require user to specify CLOBBER_MY_CONFIG=OK when running installchecks diff --git a/DEVELOPING b/DEVELOPING index 8ba7d32..583205b 100644 --- a/DEVELOPING +++ b/DEVELOPING @@ -18,15 +18,25 @@ This should probably be done after most releases, so that we have adequate time to uncover any bugs or problems in the new gnulib before we make another release. -To update the gnulib files included with Amanda, you'll first need a -CVS checkout of gnulib; let's call it $GNULIB_CO. Then, in the root -of the Amanda source, run +To update the gnulib files included with Amanda, you'll first need a git +working copy of gnulib; let's call it $GNULIB_BR: - GNULIB_TOOL=$GNULIB_CO/gnulib-tool ./gnulib/regenerate/regenerate + cd /tmp + git clone git://git.savannah.gnu.org/gnulib.git + GNULIB_BR=/tmp/gnulib + +See http://www.gnu.org/software/gnulib/ for more information. Then, in the +root of the Amanda source, run + + GNULIB_TOOL=$GNULIB_BR/gnulib-tool ./gnulib/regenerate/regenerate Use 'svn status' to figure out what changed, and 'svn add' / 'svn rm' to inform Subversion. Then re-run autogen, configure, make, and test -the result. If all is well, commit. +the result. + +Get the object ID of the latest commit, using 'git show', and replace the +previous object ID in Amanda's gnulib/regenerate/regenerate, so that other +developers can access the same "release" of gnulib as you did. Updating Libtool ---------------- diff --git a/Makefile.am b/Makefile.am index b6824ac..dcbb1bc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,16 +1,16 @@ ## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = 1.4 foreign +include $(top_srcdir)/config/automake/vars.am +include $(top_srcdir)/config/automake/installperms.am + ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive if WANT_CLIENT -CLIENT_SUBDIRS = client-src dumper-src -endif -if WANT_TAPE -TAPE_SUBDIRS = tape-src +CLIENT_SUBDIRS = client-src application-src endif if WANT_SERVER -SERVER_SUBDIRS = device-src server-src changer-src +SERVER_SUBDIRS = device-src server-src changer-src xfer-src endif if WANT_RESTORE RESTORE_SUBDIRS = restore-src @@ -22,10 +22,11 @@ if WANT_AMPLOT PLOT_SUBDIRS = amplot endif # order is significant, don't change it arbitrarily -SUBDIRS = \ +SUBDIRS = . \ gnulib \ config \ common-src \ + amar-src \ amandad-src \ $(TAPE_SUBDIRS) \ $(CLIENT_SUBDIRS) \ @@ -46,7 +47,7 @@ pkgdata_DATA = \ NEWS \ ChangeLog -EXTRA_DIST = $(SNAPSHOT_STAMP) \ +EXTRA_DIST += $(SNAPSHOT_STAMP) \ $(pkgdata_DATA) \ autogen \ contrib/README \ @@ -74,6 +75,10 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \ libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck +# empty out the installperms manifest file when we start +install-exec-local: installperms-init +install-data-local: installperms-init + ## This is only meaningful for snapshots, but it won't hurt releases. CONFIG_STATUS = config.status $(CONFIG_STATUS): $(SNAPSHOT_STAMP) @@ -89,7 +94,7 @@ lint: (cd recover-src; make lint) (cd restore-src; make lint) (cd server-src; make lint) - (cd tape-src; make lint) + (cd xfer-src; make lint) ## Do not release the *.test.c sources. They get built on the fly and ## would contain a path from the distribution machine, which will just @@ -100,4 +105,4 @@ dist-hook: # ensure that configure gets the right arguments for distcheck; this keeps the # user/group through to the distcheck, rather than defaulting back to 'amanda'. -DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes +DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-amperldir --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes CLOBBER_MY_CONFIG=OK diff --git a/Makefile.in b/Makefile.in index ac65c5e..b1884a3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,6 +14,75 @@ @SET_MAKE@ +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + +# vim:ft=automake +# +# Adjust post-install permissions settings. This rule works off two +# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. +# Each is a whitespace-separated list of commands, all of which are either +# a variable assignment or a filename. Three variables are available: +# +# - dest= sets the destination directory to e.g., $(sbindir) +# - chown= controls changes in ownership; value is first argument to chown +# - chmod= controls changes in permissions; value is first argument to chmod +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with +# whitespace in the user/group names. +# +# when a filename is seen, the currently active variables are applied. +# +# Note that scripts are data, not executables! +# +# EXAMPLE +# +# sbin_PROGRAMS = foo bar bing +# libexec_PROGRAMS = pro gram +# sbin_SCRIPTS = sk ript +# INSTALLPERMS_exec = \ +# dest=$(sbindir) chown=amanda chmod= \ +# foo bar \ +# chmod=07450 \ +# bing +# dest=$(libexecdir) chmod= \ +# $(libexec_PROGRAMS) +# INSTALLPERMS_data = \ +# dest=$(sbindir) chown=amanda chmod= \ +# $(sbin_SCRIPTS) +# +# This whole operation is not required when making builds for packaging, +# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -33,18 +102,22 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure \ + $(srcdir)/Makefile.in \ + $(top_srcdir)/config/automake/installperms.am \ + $(top_srcdir)/config/automake/vars.am $(top_srcdir)/configure \ $(top_srcdir)/example/template.d/advanced.conf.in \ $(top_srcdir)/example/template.d/amanda-S3.conf.in \ $(top_srcdir)/example/template.d/amanda-harddisk.conf.in \ $(top_srcdir)/example/template.d/amanda-single-tape.conf.in \ $(top_srcdir)/example/template.d/amanda-tape-changer.conf.in \ AUTHORS ChangeLog INSTALL NEWS +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) +subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -78,6 +151,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -100,7 +174,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -128,7 +204,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -139,7 +214,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -155,8 +229,8 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h -CONFIG_CLEAN_FILES = example/template.d/amanda-S3.conf \ - example/template.d/advanced.conf \ +CONFIG_CLEAN_FILES = example/template.d/advanced.conf \ + example/template.d/amanda-S3.conf \ example/template.d/amanda-harddisk.conf \ example/template.d/amanda-single-tape.conf \ example/template.d/amanda-tape-changer.conf @@ -182,10 +256,10 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = gnulib config common-src amandad-src tape-src \ - client-src dumper-src device-src server-src changer-src \ - restore-src recover-src oldrecover-src amplot perl po man \ - example packaging installcheck +DIST_SUBDIRS = . gnulib config common-src amar-src amandad-src \ + client-src application-src device-src server-src changer-src \ + xfer-src restore-src recover-src oldrecover-src amplot perl po \ + man example packaging installcheck DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -198,6 +272,7 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -212,8 +287,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -225,16 +302,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -248,6 +337,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -255,7 +345,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -268,6 +358,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -278,9 +369,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -290,6 +384,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -314,8 +409,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -324,11 +421,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -342,6 +443,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -350,9 +452,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -360,7 +463,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -369,8 +474,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -378,7 +485,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -387,10 +493,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -406,6 +514,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -422,6 +532,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -430,7 +542,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -466,26 +577,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -493,7 +615,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -503,6 +629,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -512,7 +639,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -521,6 +655,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -549,6 +684,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -567,6 +703,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -596,21 +734,60 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.4 foreign +SUFFIXES = +EXTRA_DIST = $(SNAPSHOT_STAMP) $(pkgdata_DATA) autogen contrib/README \ + contrib/dbbackup.README contrib/dbbackup.ksh \ + contrib/dbbackup.sql contrib/dbbackup.tcl contrib/mkamandisk \ + contrib/set_prod_link.pl contrib/gsc/README \ + contrib/gsc/cfggsc.c contrib/gsc/defgsc.c contrib/gsc/gsc.add \ + contrib/gsc/gscdd.c contrib/gsc/gscdds.h contrib/gsc/makefile \ + contrib/gsc/tstinq.c contrib/gsc/ucfggsc.c \ + patches/regex-3.6alpha.patch patches/samba-largefs.patch \ + patches/tar-1.12.patch UPGRADING DEVELOPING +BUILT_SOURCES = +MOSTLYCLEANFILES = +CLEANFILES = +DISTCLEANFILES = $(am__append_1) +MAINTAINERCLEANFILES = + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" ACLOCAL_AMFLAGS = --force -I . -I config -I config/gettext-macros -I config/gnulib -I config/amanda -I config/macro-archive -@WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src dumper-src -@WANT_TAPE_TRUE@TAPE_SUBDIRS = tape-src -@WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src +@WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src application-src +@WANT_SERVER_TRUE@SERVER_SUBDIRS = device-src server-src changer-src xfer-src @WANT_RESTORE_TRUE@RESTORE_SUBDIRS = restore-src @WANT_RECOVER_TRUE@RECOVER_SUBDIRS = recover-src oldrecover-src @WANT_AMPLOT_TRUE@PLOT_SUBDIRS = amplot # order is significant, don't change it arbitrarily -SUBDIRS = \ +SUBDIRS = . \ gnulib \ config \ common-src \ + amar-src \ amandad-src \ $(TAPE_SUBDIRS) \ $(CLIENT_SUBDIRS) \ @@ -631,42 +808,19 @@ pkgdata_DATA = \ NEWS \ ChangeLog -EXTRA_DIST = $(SNAPSHOT_STAMP) \ - $(pkgdata_DATA) \ - autogen \ - contrib/README \ - contrib/dbbackup.README \ - contrib/dbbackup.ksh \ - contrib/dbbackup.sql \ - contrib/dbbackup.tcl \ - contrib/mkamandisk \ - contrib/set_prod_link.pl \ - contrib/gsc/README \ - contrib/gsc/cfggsc.c \ - contrib/gsc/defgsc.c \ - contrib/gsc/gsc.add \ - contrib/gsc/gscdd.c \ - contrib/gsc/gscdds.h \ - contrib/gsc/makefile \ - contrib/gsc/tstinq.c \ - contrib/gsc/ucfggsc.c \ - patches/regex-3.6alpha.patch \ - patches/samba-largefs.patch \ - patches/tar-1.12.patch \ - UPGRADING \ - DEVELOPING - CONFIG_STATUS = config.status # ensure that configure gets the right arguments for distcheck; this keeps the # user/group through to the distcheck, rather than defaulting back to 'amanda'. -DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes -all: all-recursive +DISTCHECK_CONFIGURE_FLAGS = --with-user=$(CLIENT_LOGIN) --with-group=$(SETUID_GROUP) --with-owner=$(BINARY_OWNER) --disable-installperms --without-amperldir --without-force-uid --with-tmpdir=$(AMANDA_TMPDIR) SINGLE_USERID=yes CLOBBER_MY_CONFIG=OK +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: +.SUFFIXES: am--refresh: @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -697,10 +851,10 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -example/template.d/amanda-S3.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-S3.conf.in - cd $(top_builddir) && $(SHELL) ./config.status $@ example/template.d/advanced.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/advanced.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ +example/template.d/amanda-S3.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-S3.conf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ example/template.d/amanda-harddisk.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-harddisk.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ example/template.d/amanda-single-tape.conf: $(top_builddir)/config.status $(top_srcdir)/example/template.d/amanda-single-tape.conf.in @@ -809,8 +963,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -835,8 +989,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -846,13 +1000,12 @@ ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -926,6 +1079,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -952,6 +1109,8 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -1011,14 +1170,16 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -1033,15 +1194,20 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am @@ -1062,11 +1228,15 @@ info: info-recursive info-am: -install-data-am: install-pkgdataDATA +install-data-am: install-data-local install-pkgdataDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive -install-exec-am: +install-exec-am: install-exec-local + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive @@ -1101,28 +1271,68 @@ ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip + install-data-am install-exec-am install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ - distclean distclean-generic distclean-libtool distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-pkgdataDATA install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-pkgdataDATA + dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-zip \ + distcheck distclean distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-hook \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-exec-local \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgdataDATA \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-pkgdataDATA +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" + libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status --recheck + +# empty out the installperms manifest file when we start +install-exec-local: installperms-init +install-data-local: installperms-init $(CONFIG_STATUS): $(SNAPSHOT_STAMP) SNAPSHOT: : SNAPSHOT file was removed, will reconfigure... @@ -1136,7 +1346,7 @@ lint: (cd recover-src; make lint) (cd restore-src; make lint) (cd server-src; make lint) - (cd tape-src; make lint) + (cd xfer-src; make lint) dist-hook: find $(distdir)/. -name '*.test.c' -exec rm {} \; diff --git a/NEWS b/NEWS index a039ad8..54cf7b5 100644 --- a/NEWS +++ b/NEWS @@ -1,18 +1,40 @@ -Changes in release 2.6.0p2 - - * Bugs fix only: - o Various device-api fix - o Compilation on various platform - o others small fixes. - -Changes in release 2.6.0p1 - - * Bugs fix only: - o amfetchdump -p - o amtapetype crash - o Fix DS_INCRONLY and FORCE_FULL - o planner crash - o others small bugs +Changes in release 2.6.1 + + * Application API: Allow to easily write wrappers around any backup program, + See the 'amanda-applications' man page. + o amgtar: Use GNU tar, it is a lot more configurable than the GNUTAR + program. See 'amgtar' man page. + o amstar: Use star to do a backup, it work only on a partition. See + 'amstar' man page. + o amsamba: Use smbclient to backup a cifs share, see amsamba man page. + o amzfs-sendrecv: Do a backup of a ZFS filesystem with 'zfs send'. + * Script API: Allow to run script before and after amanda process, see the + 'amanda-scripts' man page. + o amzfs-snapshot: Do a snapshot of a ZFS filesystem, then 'amgtar' + application will backup the snapshot. See 'amzfs-snapshot' man page. + o script-email: Simple script to send email. see 'script-email' man page. + * Changer API v2.0: perl-based changer interface supporting concurrent + use of multiple devices and changers. + o currently operating in "compatibility mode," calling old changer + shell scripts. + o under active development. + * Xfer API: generic library to move and filter data with maximal efficiency + o can read from and write to arbitrary devices, files, etc. + o only used in some applications. + * Amanda archive format: A simple archive format that an application can + use to create backup image. + * 'amarchiver' program to manipulate file in amanda archive format. + * Many improvements to report better error message to user. + * amtape subcommands 'slot prev' and 'slot last' are removed. + * Dozens more perl libraries, with more stable interfaces. + * Many bugs fixed and improvement. + * amgetconf '--client' option to retrieve config from + amanda-client.conf on a client. + * Amanda configuration file changes + o new application-tool section + o new script-tool section + o new device section + o new changer section Changes in release 2.6.0 @@ -24,18 +46,14 @@ Changes in release 2.6.0 * 'amdd' and 'ammt' are deprecated. * Some Amanda files are now installed in new "amanda/" subdirectories: libraries are now installed in $libdir/amanda and internal programs - are now installed in $libexecdir/amanda. You can set --with-amlibdir - and --with-amlibexecdir if you don't want the amanda suffix. - If you mix 2.6.0 and earlier version with rsh/ssh auth, you need to - add an 'amandad_path' to the dumptype and to amanda-client.conf + are now installed in $libexecdir/amanda. * The amandates file, previously at /etc/amandates, is now at $localstatedir/amanda/amandates. You may want to move your existing /etc/amandates when you upgrade Amanda. * New 'amcryptsimple', 'amgpgcrypt' - encryption plugins based on gpg. * New 'amserverconfig', 'amaddclient' - Initial Amanda configuration tools these tools make assumptions, please see man page. - * Many bugs fixed and code rewrite/cleanup. - Speedup in 'amrecover find' and starting amrecover. + * Many bugs fixed and code rewrite/cleanup * glib is required to compile and run amanda. * Device API: pluggable interface to storage devices, supporting tapes, vtapes, RAIT, and Amazon S3 diff --git a/ReleaseNotes b/ReleaseNotes index e6f11b2..ff5f136 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -1,3 +1,35 @@ + Release Notes for amanda-2.6.1 + +amgtar, amstar, amsamba, amzfs-sendrecv + Four new programs implementing application-api. + Swithching from the program "GNUTAR" to the application "amgtar" have some + advantage: + - amgtar use by default the gtar --atime-preserve=system option, you must + disable it if you gtar relase doesn't have that option. + - Can be configured to cross filesystem. + - Can be configured to not check the device number on newer gtar + (--no-check-device of gtar). + - You can configure error message from gtar you don't want to see in the + report. + +amzfs-snapshot, script-email + Two new scripts implementing script-api. + The 'zfs-snapshot' script must be used only with the 'amgtar' application. + +amarchiver + New program to manipulate file in amanda archive format. + +New perl Module: + Application (perl utility functions for Applications) + Archive (Perl access to the amanda archive library) + Constants (perl access to build-time configuration values) + MainLoop (Perl interface to the Glib MainLoop) + Process (interface to process), used by amcleanup. + Script (perl utility functions for Scripts) + Tapelist (Manipulate the Amanda tapelist) + Xfer (Xfer-api) + + Release Notes for amanda-2.6.0 amcheckdump @@ -18,7 +50,7 @@ Deprecated programs Configure options --disable-shared doesn't work because perl modules require shared library. - Instead, use --with-static-binaries to build statically linked binaries. + Instead, use --with-static-binaries to build staticailly linked binaries. --with-amlibdir, libraries are now installed in $amlibdir --without-amlibdir : amlibdir=$libdir --with-amlibdir=yes : amlibdir=$libdir/amanda (default value) diff --git a/aclocal.m4 b/aclocal.m4 index 09703f0..23863fc 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.10 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,17 +11,20 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -m4_if(m4_PACKAGE_VERSION, [2.61],, -[m4_fatal([this file was generated for autoconf 2.61. -You have another version of autoconf. If you want to use that, -you should regenerate the build system entirely.], [63])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.63],, +[m4_warning([this file was generated for autoconf 2.63. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or -dnl gthread is specified in MODULES, pass to pkg-config +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject, +dnl gthread, or gio is specified in MODULES, pass to pkg-config dnl AC_DEFUN([AM_PATH_GLIB_2_0], [dnl @@ -46,10 +49,13 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; + gio*) + pkg_config_args="$pkg_config_args $module-2.0" + ;; esac done - PKG_PROG_PKG_CONFIG([0.16]) + PKG_PROG_PKG_CONFIG([0.7]) no_glib="" @@ -293,16 +299,14 @@ fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -346,9 +350,9 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD @@ -383,7 +387,7 @@ else fi[]dnl ])# PKG_CHECK_MODULES -# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -398,7 +402,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10], [], +m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -414,8 +418,10 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10])dnl -_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -687,7 +693,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -735,13 +741,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006 Free Software Foundation, Inc. +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 +# serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -846,16 +852,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -1148,7 +1155,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- -# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) @@ -1249,6 +1256,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([config/macro-archive/ac_define_dir.m4]) +m4_include([config/macro-archive/ac_perl_module_version.m4]) m4_include([config/macro-archive/ac_prog_perl_version.m4]) m4_include([config/macro-archive/ac_prog_swig.m4]) m4_include([config/macro-archive/ax_compare_version.m4]) @@ -1282,6 +1290,7 @@ m4_include([config/amanda/lfs.m4]) m4_include([config/amanda/libs.m4]) m4_include([config/amanda/net.m4]) m4_include([config/amanda/progs.m4]) +m4_include([config/amanda/ps.m4]) m4_include([config/amanda/readdir.m4]) m4_include([config/amanda/readline.m4]) m4_include([config/amanda/rsh-security.m4]) @@ -1304,7 +1313,9 @@ m4_include([config/gnulib/extensions.m4]) m4_include([config/gnulib/float_h.m4]) m4_include([config/gnulib/fsusage.m4]) m4_include([config/gnulib/getaddrinfo.m4]) +m4_include([config/gnulib/getopt.m4]) m4_include([config/gnulib/gettimeofday.m4]) +m4_include([config/gnulib/gnulib-common.m4]) m4_include([config/gnulib/gnulib-comp.m4]) m4_include([config/gnulib/include_next.m4]) m4_include([config/gnulib/inet_ntop.m4]) @@ -1332,7 +1343,6 @@ m4_include([config/gnulib/sys_socket_h.m4]) m4_include([config/gnulib/sys_stat_h.m4]) m4_include([config/gnulib/sys_time_h.m4]) m4_include([config/gnulib/tempname.m4]) -m4_include([config/gnulib/ulonglong.m4]) m4_include([config/gnulib/unistd_h.m4]) m4_include([config/gnulib/vasnprintf.m4]) m4_include([config/gnulib/visibility.m4]) @@ -1343,7 +1353,6 @@ m4_include([config/gettext-macros/inttypes_h.m4]) m4_include([config/gettext-macros/lib-ld.m4]) m4_include([config/gettext-macros/lib-link.m4]) m4_include([config/gettext-macros/lib-prefix.m4]) -m4_include([config/gettext-macros/longlong.m4]) m4_include([config/gettext-macros/nls.m4]) m4_include([config/gettext-macros/po.m4]) m4_include([config/gettext-macros/progtest.m4]) diff --git a/amandad-src/Makefile.am b/amandad-src/Makefile.am index f62a51e..768d0bb 100644 --- a/amandad-src/Makefile.am +++ b/amandad-src/Makefile.am @@ -1,5 +1,6 @@ # Makefile for Amanda client programs. +include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am @@ -10,8 +11,8 @@ INCLUDES = -I$(top_builddir)/common-src \ AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -LINT=@AMLINT@ -LINTFLAGS=@AMLINTFLAGS@ +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) amlib_LTLIBRARIES = libamandad.la LIB_EXTENSION = la @@ -46,6 +47,7 @@ INSTALLPERMS_data = \ lint: @ for p in $(amlibexec_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ diff --git a/amandad-src/Makefile.in b/amandad-src/Makefile.in index 489ef14..a281709 100644 --- a/amandad-src/Makefile.in +++ b/amandad-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,28 @@ # Makefile for Amanda client programs. +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two @@ -43,7 +65,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -53,7 +75,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -81,12 +111,15 @@ target_triplet = @target@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ - $(top_srcdir)/config/automake/precompile.am + $(top_srcdir)/config/automake/precompile.am \ + $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) amlibexec_PROGRAMS = amandad$(EXEEXT) subdir = amandad-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -120,6 +153,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -142,7 +176,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -170,7 +206,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -181,7 +216,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -220,7 +254,7 @@ amandad_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ libamandad.$(LIB_EXTENSION) \ ../common-src/libamanda.$(LIB_EXTENSION) \ ../gnulib/libgnu.$(LIB_EXTENSION) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -239,6 +273,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -253,8 +288,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -266,16 +303,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -289,6 +338,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -296,7 +346,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -309,6 +359,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -319,9 +370,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -331,6 +385,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -355,8 +410,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -365,11 +422,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -383,6 +444,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -391,9 +453,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -401,7 +464,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -410,8 +475,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -419,7 +486,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -428,10 +494,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -447,6 +515,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -463,6 +533,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -471,7 +543,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -507,26 +578,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -534,7 +616,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -544,6 +630,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -553,7 +640,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -562,6 +656,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -590,6 +685,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -608,6 +704,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -637,20 +735,47 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = +BUILT_SOURCES = +MOSTLYCLEANFILES = +CLEANFILES = +DISTCLEANFILES = $(am__append_1) +MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -LINT = @AMLINT@ -LINTFLAGS = @AMLINTFLAGS@ +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) amlib_LTLIBRARIES = libamandad.la LIB_EXTENSION = la libamandad_la_SOURCES = amandad_util.c @@ -677,11 +802,12 @@ INSTALLPERMS_data = \ dest=$(amlibexecdir) chown=amanda \ $(amlibexec_SCRIPTS) -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -716,8 +842,8 @@ install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done @@ -725,8 +851,8 @@ uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done clean-amlibLTLIBRARIES: @@ -748,8 +874,8 @@ install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done @@ -812,8 +938,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -825,8 +951,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -836,13 +962,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -882,13 +1007,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -903,17 +1030,20 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ @@ -997,52 +1127,40 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS uninstall-amlibexecPROGRAMS -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange @@ -1056,6 +1174,7 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS lint: @ for p in $(amlibexec_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ diff --git a/amandad-src/amandad.c b/amandad-src/amandad.c index 430f2b7..cfb7a47 100644 --- a/amandad-src/amandad.c +++ b/amandad-src/amandad.c @@ -47,6 +47,7 @@ #define REP_TIMEOUT (6*60*60) /* secs for service to reply */ #define ACK_TIMEOUT 10 /* XXX should be configurable */ +#define STDERR_PIPE (DATA_FD_COUNT + 1) #define amandad_debug(i, ...) do { \ if ((i) <= debug_amandad) { \ @@ -67,6 +68,37 @@ typedef enum { A_START, A_RECVPKT, A_RECVREP, A_PENDING, A_FINISH, A_CONTINUE, struct active_service; typedef action_t (*state_t)(struct active_service *, action_t, pkt_t *); +/* string that we scan for in sendbackup's MESG stream */ +static const char info_end_str[] = "sendbackup: info end\n"; +#define INFO_END_LEN (sizeof(info_end_str)-1) + +/* + * Here are the services that we allow. + * Must be in the same order as services[]. + */ +typedef enum { + SERVICE_NOOP, + SERVICE_SENDSIZE, + SERVICE_SENDBACKUP, + SERVICE_SELFCHECK, + SERVICE_AMINDEXD, + SERVICE_AMIDXTAPED +} service_t; + +static struct services { + char *name; + int active; + service_t service; +} services[] = { + { "noop", 1, SERVICE_NOOP }, + { "sendsize", 1, SERVICE_SENDSIZE }, + { "sendbackup", 1, SERVICE_SENDBACKUP }, + { "selfcheck", 1, SERVICE_SELFCHECK }, + { "amindexd", 0, SERVICE_AMINDEXD }, + { "amidxtaped", 0, SERVICE_AMIDXTAPED } +}; +#define NSERVICES (int)(sizeof(services) / sizeof(services[0])) + /* * This structure describes an active running service. * @@ -76,6 +108,7 @@ typedef action_t (*state_t)(struct active_service *, action_t, pkt_t *); * for communications with the amanda server. */ struct active_service { + service_t service; /* service name */ char *cmd; /* name of command we ran */ char *arguments; /* arguments we sent it */ security_handle_t *security_handle; /* remote server */ @@ -84,13 +117,19 @@ struct active_service { int send_partial_reply; /* send PREP packet */ int reqfd; /* pipe to write requests */ int repfd; /* pipe to read replies */ + int errfd; /* pipe to read stderr */ event_handle_t *ev_repfd; /* read event handle for repfd */ event_handle_t *ev_reptimeout; /* timeout for rep data */ + event_handle_t *ev_errfd; /* read event handle for errfd */ pkt_t rep_pkt; /* rep packet we're sending out */ + char *errbuf; /* buffer to read the err into */ char *repbuf; /* buffer to read the rep into */ size_t bufsize; /* length of repbuf */ size_t repbufsize; /* length of repbuf */ int repretry; /* times we'll retry sending the rep */ + int seen_info_end; /* have we seen "sendbackup info end\n"? */ + char info_end_buf[INFO_END_LEN]; /* last few bytes read, used for scanning for info end */ + /* * General user streams to the process, and their equivalent * network streams. @@ -107,22 +146,6 @@ struct active_service { TAILQ_ENTRY(active_service) tq; /* queue handle */ }; -/* - * Here are the services that we allow. - */ -static struct services { - char *name; - int active; -} services[] = { - { "noop", 1 }, - { "sendsize", 1 }, - { "sendbackup", 1 }, - { "selfcheck", 1 }, - { "amindexd", 0 }, - { "amidxtaped", 0 } -}; -#define NSERVICES (int)(sizeof(services) / sizeof(services[0])) - /* * Queue of outstanding requests that we are running. */ @@ -152,12 +175,13 @@ static action_t s_sendrep(struct active_service *, action_t, pkt_t *); static action_t s_ackwait(struct active_service *, action_t, pkt_t *); static void repfd_recv(void *); +static void errfd_recv(void *); static void timeout_repfd(void *); static void protocol_recv(void *, pkt_t *, security_status_t); static void process_readnetfd(void *); static void process_writenetfd(void *, void *, ssize_t); static struct active_service *service_new(security_handle_t *, - const char *, const char *); + const char *, service_t, const char *); static void service_delete(struct active_service *); static int writebuf(struct active_service *, const void *, size_t); static ssize_t do_sendpkt(security_handle_t *handle, pkt_t *pkt); @@ -216,6 +240,7 @@ main( /* Don't die when child closes pipe */ signal(SIGPIPE, SIG_IGN); + /* Parse the configuration; we'll handle errors later */ config_init(CONFIG_INIT_CLIENT, NULL); if (geteuid() == 0) { @@ -412,6 +437,7 @@ main( if(strcasecmp(auth, "rsh") == 0 || strcasecmp(auth, "ssh") == 0 || + strcasecmp(auth, "local") == 0 || strcasecmp(auth, "bsdtcp") == 0) { wait_30s = 0; exit_on_qlength = 1; @@ -419,12 +445,12 @@ main( if (getuid() == 0) { if (strcasecmp(auth, "krb5") != 0) { - error(_("Amanda must be run as user '%s' when using '%s' authetication"), + error(_("Amanda must be run as user '%s' when using '%s' authentication"), CLIENT_LOGIN, auth); } } else { if (strcasecmp(auth, "krb5") == 0) { - error(_("Amanda must be run as user 'root' when using 'krb5' authetication")); + error(_("Amanda must be run as user 'root' when using 'krb5' authentication")); } } @@ -514,6 +540,7 @@ protocol_accept( struct active_service *as; char *pktbody, *tok, *service, *arguments; char *service_path = NULL; + GSList *errlist = NULL; int i; pkt_out.body = NULL; @@ -525,6 +552,32 @@ protocol_accept( return; } + /* + * If we have errors (not warnings) from the config file, let the server + * know immediately. Unfortunately, we only get one ERROR line, so if there + * are multiple errors, we just show the first. + */ + if (config_errors(&errlist) >= CFGERR_ERRORS) { + GSList *iter = errlist; + char *errmsg; + gboolean multiple_errors = FALSE; + + if (iter) { + errmsg = (char *)iter->data; + if (iter->next) + multiple_errors = TRUE; + } else { + errmsg = "(no error message)"; + } + + pkt_init(&pkt_out, P_NAK, "ERROR %s%s", errmsg, + multiple_errors? _(" (additional errors not displayed)"):""); + do_sendpkt(handle, &pkt_out); + amfree(pkt_out.body); + security_close(handle); + return; + } + /* * If pkt is NULL, then there was a problem with the new connection. */ @@ -612,7 +665,7 @@ protocol_accept( * the request pipe. */ dbprintf(_("creating new service: %s\n%s\n"), service, arguments); - as = service_new(handle, service_path, arguments); + as = service_new(handle, service_path, services[i].service, arguments); if (writebuf(as, arguments, strlen(arguments)) < 0) { const char *errmsg = strerror(errno); dbprintf(_("error sending arguments to %s: %s\n"), service, errmsg); @@ -759,6 +812,8 @@ s_sendack( as->ev_repfd = event_register((event_id_t)as->repfd, EV_READFD, repfd_recv, as); as->ev_reptimeout = event_register(REP_TIMEOUT, EV_TIME, timeout_repfd, as); + as->errbuf = NULL; + as->ev_errfd = event_register((event_id_t)as->errfd, EV_READFD, errfd_recv, as); security_recvpkt(as->security_handle, protocol_recv, as, -1); return (A_PENDING); } @@ -779,7 +834,6 @@ s_repwait( char *what; char *msg; int code = 0; - int t; int pid; amwait_t retstat; @@ -835,14 +889,36 @@ s_repwait( /* If end of service, wait for process status */ if (n == 0) { - t = 0; pid = waitpid(as->pid, &retstat, WNOHANG); - while (t<5 && pid == 0) { - sleep(1); - t++; - pid = waitpid(as->pid, &retstat, WNOHANG); + if (as->service == SERVICE_NOOP || + as->service == SERVICE_SENDSIZE || + as->service == SERVICE_SELFCHECK) { + int t = 0; + while (t<5 && pid == 0) { + sleep(1); + t++; + pid = waitpid(as->pid, &retstat, WNOHANG); + } + } + + /* Process errfd before sending the REP packet */ + if (as->ev_errfd) { + SELECT_ARG_TYPE readset; + struct timeval tv; + int nfound; + + memset(&tv, 0, SIZEOF(tv)); + FD_ZERO(&readset); + FD_SET(as->errfd, &readset); + nfound = select(as->errfd+1, &readset, NULL, NULL, &tv); + if (nfound && FD_ISSET(as->errfd, &readset)) { + errfd_recv(as); + } } + if (pid == 0) + pid = waitpid(as->pid, &retstat, WNOHANG); + if (pid > 0) { what = NULL; if (! WIFEXITED(retstat)) { @@ -870,6 +946,7 @@ s_repwait( } strcpy(as->repbuf + as->repbufsize, msg); as->repbufsize += strlen(msg); + amfree(msg); } } } @@ -1077,9 +1154,18 @@ s_ackwait( dh->netfd = NULL; continue; } - /* setup an event for reads from it */ - dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD, - process_readnetfd, dh); + + /* setup an event for reads from it. As a special case, don't start + * listening on as->data[0] until we read some data on another fd, if + * the service is sendbackup. This ensures that we send a MESG or + * INDEX token before any DATA tokens, as dumper assumes. This is a + * hack, if that wasn't already obvious! */ + if (dh != &as->data[0] || as->service != SERVICE_SENDBACKUP) { + dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD, + process_readnetfd, dh); + } else { + amandad_debug(1, "Skipping registration of sendbackup's data FD\n"); + } security_stream_read(dh->netfd, process_writenetfd, dh); @@ -1132,6 +1218,79 @@ repfd_recv( state_machine(as, A_RECVREP, NULL); } +/* + * Called when a errfd has received data + */ +static void +errfd_recv( + void * cookie) +{ + struct active_service *as = cookie; + char buf[32769]; + int n; + char *r; + + assert(as != NULL); + assert(as->ev_errfd != NULL); + + n = read(as->errfd, &buf, 32768); + /* merge buffer */ + if (n > 0) { + /* Terminate it with '\0' */ + buf[n+1] = '\0'; + + if (as->errbuf) { + as->errbuf = vstrextend(&as->errbuf, buf, NULL); + } else { + as->errbuf = stralloc(buf); + } + } else if (n == 0) { + event_release(as->ev_errfd); + as->ev_errfd = NULL; + } else { /* n < 0 */ + event_release(as->ev_errfd); + as->ev_errfd = NULL; + g_snprintf(buf, 32768, + "error reading stderr or service: %s\n", strerror(errno)); + } + + /* for each line terminate by '\n' */ + while (as->errbuf != NULL && (r = index(as->errbuf, '\n')) != NULL) { + char *s; + + *r = '\0'; + s = vstrallocf("ERROR service %s: %s\n", + services[as->service].name, as->errbuf); + + /* Add to repbuf, error message will be in the REP packet if it + * is not already sent + */ + n = strlen(s); + if (as->bufsize == 0) { + as->bufsize = NETWORK_BLOCK_BYTES; + as->repbuf = alloc(as->bufsize); + } + while (as->bufsize < as->repbufsize + n) { + char *repbuf_temp; + as->bufsize *= 2; + repbuf_temp = alloc(as->bufsize); + memcpy(repbuf_temp, as->repbuf, as->repbufsize + 1); + amfree(as->repbuf); + as->repbuf = repbuf_temp; + } + memcpy(as->repbuf + as->repbufsize, s, n); + as->repbufsize += n; + + dbprintf("%s", s); + + /* remove first line from buffer */ + r++; + s = stralloc(r); + amfree(as->errbuf); + as->errbuf = s; + } +} + /* * Called when a repfd has timed out */ @@ -1222,6 +1381,34 @@ process_readnetfd( service_delete(as); return; } + + /* Handle the special case of recognizing "sendbackup info end" + * from sendbackup's MESG fd */ + if (as->service == SERVICE_SENDBACKUP && !as->seen_info_end && dh == &as->data[1]) { + /* make a buffer containing the combined data from info_end_buf + * and what we've read this time, and search it for info_end_strj + * This includes a NULL byte for strstr's sanity. */ + char *combined_buf = malloc(INFO_END_LEN + n + 1); + memcpy(combined_buf, as->info_end_buf, INFO_END_LEN); + memcpy(combined_buf+INFO_END_LEN, as->databuf, n); + combined_buf[INFO_END_LEN+n] = '\0'; + + as->seen_info_end = (strstr(combined_buf, info_end_str) != NULL); + + /* fill info_end_buf from the tail end of combined_buf */ + memcpy(as->info_end_buf, combined_buf + n, INFO_END_LEN); + + /* if we did see info_end_str, start reading the data fd (fd 0) */ + if (as->seen_info_end) { + struct datafd_handle *dh = &as->data[0]; + amandad_debug(1, "Opening datafd to sendbackup (delayed until sendbackup sent header info)\n"); + dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD, + process_readnetfd, dh); + } else { + amandad_debug(1, "sendbackup header info still not complete\n"); + } + } + if (security_stream_write(dh->netfd, as->databuf, (size_t)n) < 0) { /* stream has croaked */ pkt_init(&nak, P_NAK, _("ERROR write error on stream %d: %s\n"), @@ -1255,7 +1442,7 @@ process_writenetfd( if (dh->fd_write <= 0) { dbprintf(_("process_writenetfd: dh->fd_write <= 0\n")); } else if (size > 0) { - fullwrite(dh->fd_write, buf, (size_t)size); + full_write(dh->fd_write, buf, (size_t)size); security_stream_read(dh->netfd, process_writenetfd, dh); } else { @@ -1314,11 +1501,12 @@ static struct active_service * service_new( security_handle_t * security_handle, const char * cmd, + service_t service, const char * arguments) { int i; - int data_read[DATA_FD_COUNT + 1][2]; - int data_write[DATA_FD_COUNT + 1][2]; + int data_read[DATA_FD_COUNT + 2][2]; + int data_write[DATA_FD_COUNT + 2][2]; struct active_service *as; pid_t pid; int newfd; @@ -1328,6 +1516,13 @@ service_new( assert(arguments != NULL); /* a plethora of pipes */ + /* data_read[0] : stdin + * data_write[0] : stdout + * data_read[1], data_write[1] : first stream + * data_read[2], data_write[2] : second stream + * data_read[3], data_write[3] : third stream + * data_write[4] : stderr + */ for (i = 0; i < DATA_FD_COUNT + 1; i++) { if (pipe(data_read[i]) < 0) { error(_("pipe: %s\n"), strerror(errno)); @@ -1338,6 +1533,10 @@ service_new( /*NOTREACHED*/ } } + if (pipe(data_write[STDERR_PIPE]) < 0) { + error(_("pipe: %s\n"), strerror(errno)); + /*NOTREACHED*/ + } switch(pid = fork()) { case -1: @@ -1347,14 +1546,18 @@ service_new( /* * The parent. Close the far ends of our pipes and return. */ - as = alloc(SIZEOF(*as)); + as = g_new0(struct active_service, 1); as->cmd = stralloc(cmd); as->arguments = stralloc(arguments); as->security_handle = security_handle; as->state = NULL; + as->service = service; as->pid = pid; as->send_partial_reply = 0; - if(strcmp(cmd+(strlen(cmd)-8), "sendsize") == 0) { + as->seen_info_end = FALSE; + /* fill in info_end_buf with non-null characters */ + memset(as->info_end_buf, '-', sizeof(as->info_end_buf)); + if(service == SERVICE_SENDSIZE) { g_option_t *g_options; char *option_str, *p; @@ -1386,6 +1589,14 @@ service_new( as->repretry = 0; as->rep_pkt.body = NULL; + /* + * read from the stderr pipe + */ + as->errfd = data_write[STDERR_PIPE][0]; + aclose(data_write[STDERR_PIPE][1]); + as->ev_errfd = NULL; + as->errbuf = NULL; + /* * read from the rest of the general-use pipes * (netfds are opened as the client requests them) @@ -1482,7 +1693,9 @@ service_new( /* close all unneeded fd */ close(STDERR_FILENO); - debug_dup_stderr_to_debug(); + dup2(data_write[STDERR_PIPE][1], 2); + aclose(data_write[STDERR_PIPE][0]); + aclose(data_write[STDERR_PIPE][1]); safe_fd(DATA_FD_OFFSET, DATA_FD_COUNT*2); execle(cmd, cmd, "amandad", auth, (char *)NULL, safe_env()); @@ -1572,7 +1785,7 @@ writebuf( size_t size) { pid_t pid; - ssize_t writesize; + size_t writesize; switch (pid=fork()) { case -1: @@ -1584,8 +1797,8 @@ writebuf( case 0: /* this is the child */ close(as->repfd); - writesize = fullwrite(as->reqfd, bufp, size); - exit(writesize != (ssize_t)size); + writesize = full_write(as->reqfd, bufp, size); + exit(writesize != size); /* NOTREACHED */ } return -1; diff --git a/amar-src/Makefile.am b/amar-src/Makefile.am new file mode 100644 index 0000000..92f2c88 --- /dev/null +++ b/amar-src/Makefile.am @@ -0,0 +1,39 @@ +# Makefile for Amanda archive library + +include $(top_srcdir)/config/automake/vars.am +include $(top_srcdir)/config/automake/scripts.am +include $(top_srcdir)/config/automake/installperms.am +include $(top_srcdir)/config/automake/precompile.am + +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/gnulib + +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) + +LINT=@AMLINT@ +LINTFLAGS=@AMLINTFLAGS@ + +amlib_LTLIBRARIES = libamar.la + +libamar_la_SOURCES = amar.c +libamar_la_LDFLAGS = -release $(VERSION) +libamar_la_LIBADD = ../common-src/libamanda.la + +noinst_HEADERS = \ + amar.h + +sbin_PROGRAMS = amarchiver + +amarchiver_SOURCES = amarchiver.c +amarchiver_LDADD = libamar.la + +# automake-style tests + +TESTS = amar-test +noinst_PROGRAMS = $(TESTS) + +amar_test_SOURCES = amar-test.c +amar_test_LDADD = libamar.la \ + ../common-src/libtestutils.la diff --git a/amar-src/Makefile.in b/amar-src/Makefile.in new file mode 100644 index 0000000..381cfd8 --- /dev/null +++ b/amar-src/Makefile.in @@ -0,0 +1,1423 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for Amanda archive library + +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# SYNOPSIS: +# +# Automake magic to handle the various tasks of building scripts. Scripts can +# be built down to extensionless executables (e.g., foo.pl -> foo), or to +# files with the usual extension (foo-lib.sh.in -> foo.sh). +# +# Files which support it are syntax-checked when the user invokes 'make check'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. +# +# USAGE: +# +# include $(top_srcdir)/config/automake/vars.am +# include $(top_srcdir)/config/automake/scripts.am +# ... +# SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm +# SCRIPTS_SHELL = shell1 shell2 sh-lib.sh +# SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl +# +# with the corresponding files in the repository: +# +# fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in +# shell1.sh shell2.sh sh-lib.sh.in +# talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# To add extra flags to the perl checks (e.g., to add new -I flags), set +# CHECK_PERL_FLAGS. + +# Implementation note: +# +# This file uses config.status to substitute @foo@ in those scripts while +# converting them. It also adds the executable bits (a+x) to extensionless +# files. The substitution works even though the files are not listed in +# configure.in + +# vim:ft=automake +# +# Adjust post-install permissions settings. This rule works off two +# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. +# Each is a whitespace-separated list of commands, all of which are either +# a variable assignment or a filename. Three variables are available: +# +# - dest= sets the destination directory to e.g., $(sbindir) +# - chown= controls changes in ownership; value is first argument to chown +# - chmod= controls changes in permissions; value is first argument to chmod +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with +# whitespace in the user/group names. +# +# when a filename is seen, the currently active variables are applied. +# +# Note that scripts are data, not executables! +# +# EXAMPLE +# +# sbin_PROGRAMS = foo bar bing +# libexec_PROGRAMS = pro gram +# sbin_SCRIPTS = sk ript +# INSTALLPERMS_exec = \ +# dest=$(sbindir) chown=amanda chmod= \ +# foo bar \ +# chmod=07450 \ +# bing +# dest=$(libexecdir) chmod= \ +# $(libexec_PROGRAMS) +# INSTALLPERMS_data = \ +# dest=$(sbindir) chown=amanda chmod= \ +# $(sbin_SCRIPTS) +# +# This whole operation is not required when making builds for packaging, +# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. + +# vim:ft=automake + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in \ + $(top_srcdir)/config/automake/installperms.am \ + $(top_srcdir)/config/automake/precompile.am \ + $(top_srcdir)/config/automake/scripts.am \ + $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) +sbin_PROGRAMS = amarchiver$(EXEEXT) +TESTS = amar-test$(EXEEXT) +noinst_PROGRAMS = $(am__EXEEXT_1) +subdir = amar-src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ + $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ + $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ + $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ + $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ + $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ + $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ + $(top_srcdir)/config/macro-archive/xsltproc.m4 \ + $(top_srcdir)/config/amanda/amplot.m4 \ + $(top_srcdir)/config/amanda/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.m4 \ + $(top_srcdir)/config/amanda/components.m4 \ + $(top_srcdir)/config/amanda/compress.m4 \ + $(top_srcdir)/config/amanda/config.m4 \ + $(top_srcdir)/config/amanda/debugging.m4 \ + $(top_srcdir)/config/amanda/defaults.m4 \ + $(top_srcdir)/config/amanda/devprefix.m4 \ + $(top_srcdir)/config/amanda/dirs.m4 \ + $(top_srcdir)/config/amanda/documentation.m4 \ + $(top_srcdir)/config/amanda/dumpers.m4 \ + $(top_srcdir)/config/amanda/flags.m4 \ + $(top_srcdir)/config/amanda/flock.m4 \ + $(top_srcdir)/config/amanda/funcs.m4 \ + $(top_srcdir)/config/amanda/getfsent.m4 \ + $(top_srcdir)/config/amanda/i18n.m4 \ + $(top_srcdir)/config/amanda/ipv6.m4 \ + $(top_srcdir)/config/amanda/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ + $(top_srcdir)/config/amanda/readdir.m4 \ + $(top_srcdir)/config/amanda/readline.m4 \ + $(top_srcdir)/config/amanda/rsh-security.m4 \ + $(top_srcdir)/config/amanda/s3-device.m4 \ + $(top_srcdir)/config/amanda/shmem.m4 \ + $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ + $(top_srcdir)/config/amanda/ssh-security.m4 \ + $(top_srcdir)/config/amanda/summary.m4 \ + $(top_srcdir)/config/amanda/swig.m4 \ + $(top_srcdir)/config/amanda/syshacks.m4 \ + $(top_srcdir)/config/amanda/tape.m4 \ + $(top_srcdir)/config/amanda/types.m4 \ + $(top_srcdir)/config/amanda/userid.m4 \ + $(top_srcdir)/config/amanda/version.m4 \ + $(top_srcdir)/config/gnulib/alloca.m4 \ + $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ + $(top_srcdir)/config/gnulib/eoverflow.m4 \ + $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ + $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ + $(top_srcdir)/config/gnulib/inet_ntop.m4 \ + $(top_srcdir)/config/gnulib/intmax_t.m4 \ + $(top_srcdir)/config/gnulib/lock.m4 \ + $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ + $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ + $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ + $(top_srcdir)/config/gnulib/snprintf.m4 \ + $(top_srcdir)/config/gnulib/socklen.m4 \ + $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ + $(top_srcdir)/config/gnulib/stdbool.m4 \ + $(top_srcdir)/config/gnulib/stdint.m4 \ + $(top_srcdir)/config/gnulib/stdio_h.m4 \ + $(top_srcdir)/config/gnulib/stdlib_h.m4 \ + $(top_srcdir)/config/gnulib/strdup.m4 \ + $(top_srcdir)/config/gnulib/string_h.m4 \ + $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ + $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ + $(top_srcdir)/config/gnulib/sys_time_h.m4 \ + $(top_srcdir)/config/gnulib/tempname.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ + $(top_srcdir)/config/gnulib/vasnprintf.m4 \ + $(top_srcdir)/config/gnulib/visibility.m4 \ + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.m4 \ + $(top_srcdir)/config/gettext-macros/iconv.m4 \ + $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ + $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ + $(top_srcdir)/config/gettext-macros/lib-link.m4 \ + $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ + $(top_srcdir)/config/gettext-macros/nls.m4 \ + $(top_srcdir)/config/gettext-macros/po.m4 \ + $(top_srcdir)/config/gettext-macros/progtest.m4 \ + $(top_srcdir)/config/gettext-macros/size_max.m4 \ + $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ + $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ + $(top_srcdir)/config/gettext-macros/wint_t.m4 \ + $(top_srcdir)/config/gettext-macros/xsize.m4 \ + $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" +amlibLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(amlib_LTLIBRARIES) +libamar_la_DEPENDENCIES = ../common-src/libamanda.la +am_libamar_la_OBJECTS = amar.lo +libamar_la_OBJECTS = $(am_libamar_la_OBJECTS) +libamar_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libamar_la_LDFLAGS) $(LDFLAGS) -o $@ +am__EXEEXT_1 = amar-test$(EXEEXT) +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) +am_amar_test_OBJECTS = amar-test.$(OBJEXT) +amar_test_OBJECTS = $(am_amar_test_OBJECTS) +amar_test_DEPENDENCIES = libamar.la ../common-src/libtestutils.la +am_amarchiver_OBJECTS = amarchiver.$(OBJEXT) +amarchiver_OBJECTS = $(am_amarchiver_OBJECTS) +amarchiver_DEPENDENCIES = libamar.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libamar_la_SOURCES) $(amar_test_SOURCES) \ + $(amarchiver_SOURCES) +DIST_SOURCES = $(libamar_la_SOURCES) $(amar_test_SOURCES) \ + $(amarchiver_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMANDA_DBGDIR = @AMANDA_DBGDIR@ +AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ +AMANDA_TMPDIR = @AMANDA_TMPDIR@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ +AMLINT = @AMLINT@ +AMLINTFLAGS = @AMLINTFLAGS@ +AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ +AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ +AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ +AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ +AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ +AR = @AR@ +ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +BINARY_OWNER = @BINARY_OWNER@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ +CAT = @CAT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ +CHIO = @CHIO@ +CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ +CLIENT_LOGIN = @CLIENT_LOGIN@ +CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ +COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ +CONFIG_DIR = @CONFIG_DIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ +DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ +DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ +DEFAULT_SERVER = @DEFAULT_SERVER@ +DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ +DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOC_BUILD_DATE = @DOC_BUILD_DATE@ +DUMP = @DUMP@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FLOAT_H = @FLOAT_H@ +GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNUPLOT = @GNUPLOT@ +GNUTAR = @GNUTAR@ +GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRNDUP = @HAVE_STRNDUP@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL = @LIBCURL@ +LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPTH = @LIBPTH@ +LIBS = @LIBS@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAILER = @MAILER@ +MAKEINFO = @MAKEINFO@ +MCUTIL = @MCUTIL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MT = @MT@ +MTX = @MTX@ +MT_FILE_FLAG = @MT_FILE_FLAG@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCAT = @PCAT@ +PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ +SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ +SERVICE_SUFFIX = @SERVICE_SUFFIX@ +SETUID_GROUP = @SETUID_GROUP@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ +SORT = @SORT@ +SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ +SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ +USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ +USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ +VDUMP = @VDUMP@ +VERSION = @VERSION@ +VERSION_COMMENT = @VERSION_COMMENT@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_PATCH = @VERSION_PATCH@ +VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ +VRESTORE = @VRESTORE@ +VXDUMP = @VXDUMP@ +VXRESTORE = @VXRESTORE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XFSDUMP = @XFSDUMP@ +XFSRESTORE = @XFSRESTORE@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XSLREL = @XSLREL@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +_libcurl_config = @_libcurl_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +amdatadir = @amdatadir@ +amincludedir = @amincludedir@ +amlibdir = @amlibdir@ +amlibexecdir = @amlibexecdir@ +amperldir = @amperldir@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = +BUILT_SOURCES = +MOSTLYCLEANFILES = + +# config.status leaves config.log files around +CLEANFILES = config.log + +# and we'll need to clean up our generated files for distclean +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) $(am__append_1) +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/gnulib + +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +LINT = @AMLINT@ +LINTFLAGS = @AMLINTFLAGS@ +amlib_LTLIBRARIES = libamar.la +libamar_la_SOURCES = amar.c +libamar_la_LDFLAGS = -release $(VERSION) +libamar_la_LIBADD = ../common-src/libamanda.la +noinst_HEADERS = \ + amar.h + +amarchiver_SOURCES = amarchiver.c +amarchiver_LDADD = libamar.la +amar_test_SOURCES = amar-test.c +amar_test_LDADD = libamar.la \ + ../common-src/libtestutils.la + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu amar-src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu amar-src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(amlibdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibdir)" + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + else :; fi; \ + done + +uninstall-amlibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + done + +clean-amlibLTLIBRARIES: + -test -z "$(amlib_LTLIBRARIES)" || rm -f $(amlib_LTLIBRARIES) + @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libamar.la: $(libamar_la_OBJECTS) $(libamar_la_DEPENDENCIES) + $(libamar_la_LINK) -rpath $(amlibdir) $(libamar_la_OBJECTS) $(libamar_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done + +clean-sbinPROGRAMS: + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +amar-test$(EXEEXT): $(amar_test_OBJECTS) $(amar_test_DEPENDENCIES) + @rm -f amar-test$(EXEEXT) + $(LINK) $(amar_test_OBJECTS) $(amar_test_LDADD) $(LIBS) +amarchiver$(EXEEXT): $(amarchiver_OBJECTS) $(amarchiver_DEPENDENCIES) + @rm -f amarchiver$(EXEEXT) + $(LINK) $(amarchiver_OBJECTS) $(amarchiver_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amar-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amar.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amarchiver.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ + clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-amlibLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am + +install-exec-am: install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: installcheck-local + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS + +.MAKE: install-am install-data-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-local \ + clean clean-amlibLTLIBRARIES clean-generic clean-libtool \ + clean-noinstPROGRAMS clean-sbinPROGRAMS ctags dist-hook \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am \ + install-amlibLTLIBRARIES install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installcheck-local \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi + +%.pl: %.pl.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +%.pm: %.pm.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Shell +%: %.sh $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.sh: %.sh.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Awk +%: %.awk $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.awk: %.awk.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# syntax-check perl scripts on 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +installcheck-local: installcheck-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_SHELL; do \ + if $(BASH) -n $$shobj; then \ + echo "$$shobj syntax OK"; \ + else \ + echo "$$shobj syntax error"; \ + exit 1; \ + fi; \ + done; \ + else \ + echo "No 'bash' available -- cannot syntax-check shell scripts"; \ + fi; \ + fi +check-local: check-shell + +# make sure that the sources for all shell and perl scripts get included +# in the distribution +dist-scripts: + SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" + +# A rule to make precompiler output from C files. This is not used during +# ordinary builds, but but can very useful in debugging problems on strange +# architectures. With this rule, we can ask users to 'make foo.i' and send +# the result to us. +# +# It touches some automake internals ($COMPILE), but since it's not +# build-critical, that's OK. +%.i : %.c + $(COMPILE) -E -o $@ $< +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/amar-src/amar-test.c b/amar-src/amar-test.c new file mode 100644 index 0000000..d69b7be --- /dev/null +++ b/amar-src/amar-test.c @@ -0,0 +1,1121 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +#include "amanda.h" +#include "amar.h" +#include "testutils.h" +#include "simpleprng.h" + +static char *temp_filename = NULL; + +/**** + * Macros for creating files with a particular structure + */ + +#define WRITE_HEADER(fd, version) do { \ + char hdr[28]; \ + bzero(hdr, 28); \ + snprintf(hdr, 28, "AMANDA ARCHIVE FORMAT %d", (version)); \ + g_assert(full_write((fd), hdr, 28) == 28); \ +} while(0); + +#define WRITE_RECORD(fd, filenum, attrid, size, eoa, data) do { \ + struct { uint16_t f; uint16_t a; uint32_t s; } rec; \ + rec.f = htons((filenum)); \ + rec.a = htons((attrid)); \ + rec.s = htonl((size) | (eoa? 0x80000000 : 0)); \ + g_assert(full_write((fd), &rec, sizeof(rec)) == sizeof(rec)); \ + g_assert(full_write((fd), (data), (size)) == (size)); \ +} while(0); + +#define WRITE_RECORD_STR(fd, filenum, attrid, eoa, str) do { \ + size_t len = strlen((str)); \ + WRITE_RECORD((fd), (filenum), (attrid), len, (eoa), (str)); \ +} while(0); + +/**** + * Assertions for amanda_read_archive callbacks + */ + +typedef enum { + EXP_END, + EXP_START_FILE, + EXP_ATTRDATA, + EXP_FINISH_FILE, +} expected_kind_t; + +typedef struct { + expected_kind_t kind; + uint16_t filenum; + uint16_t attrid; + char *data; + size_t datasize; + gboolean multipart_ok; + gboolean eoa; + gboolean truncated; + gboolean should_ignore; + gboolean isstr; +} expected_step_t; + +typedef struct { + expected_step_t *steps; + int curstep; +} expected_state_t; + +#define EXPECT_START_FILE(filenum, data, datasize, should_ignore) \ + { EXP_START_FILE, (filenum), 0, (data), (datasize), 0, 0, 0, (should_ignore), 0 } + +#define EXPECT_START_FILE_STR(filenum, filename, should_ignore) \ + { EXP_START_FILE, (filenum), 0, (filename), strlen((filename)), 0, 0, 0, (should_ignore), 1 } + +#define EXPECT_ATTR_DATA(filenum, attrid, data, datasize, eoa, truncated) \ + { EXP_ATTRDATA, (filenum), (attrid), (data), (datasize), 0, (eoa), (truncated), 0, 0 } + +#define EXPECT_ATTR_DATA_MULTIPART(filenum, attrid, data, datasize, eoa, truncated) \ + { EXP_ATTRDATA, (filenum), (attrid), (data), (datasize), 1, (eoa), (truncated), 0, 0 } + +#define EXPECT_ATTR_DATA_STR(filenum, attrid, datastr, eoa, truncated) \ + { EXP_ATTRDATA, (filenum), (attrid), (datastr), strlen((datastr)), 0, (eoa), (truncated), 0, 1 } + +#define EXPECT_FINISH_FILE(filenum, truncated) \ + { EXP_FINISH_FILE, (filenum), 0, 0, 0, 0, 0, (truncated), 0, 0 } + +#define EXPECT_END() \ + { EXP_END, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +#define EXPECT_FAILURE(fmt, ...) do { \ + fprintf(stderr, fmt "\n", __VA_ARGS__); \ + exit(1); \ +} while(0) + +static gboolean +file_start_cb( + gpointer user_data, + uint16_t filenum, + gpointer filename, + gsize filename_len, + gboolean *ignore, + gpointer *file_data G_GNUC_UNUSED) +{ + expected_state_t *state = user_data; + expected_step_t *step = state->steps + state->curstep; + + tu_dbg("file_start_cb(NULL, %d, '%s', %zd, .., ..)\n", + (int)filenum, (char *)filename, filename_len); + + if (step->kind != EXP_START_FILE) + EXPECT_FAILURE("step %d: unexpected new file with fileid %d", + state->curstep, (int)filenum); + + if (step->filenum != filenum) + EXPECT_FAILURE("step %d: expected new file with filenum %d; got filenum %d", + state->curstep, (int)step->filenum, (int)filenum); + + if (filename_len != step->datasize) + EXPECT_FAILURE("step %d: filename lengths do not match: got %zd, expected %zd", + state->curstep, filename_len, step->datasize); + + if (memcmp(filename, step->data, filename_len)) { + if (step->isstr) { + EXPECT_FAILURE("step %d: new file's filename does not match: got '%*s', expected '%*s'", + state->curstep, (int)filename_len, (char *)filename, + (int)step->datasize, (char *)step->data); + } else { + EXPECT_FAILURE("step %d: new file's filename does not match", + state->curstep); + } + } + + *ignore = step->should_ignore; + state->curstep++; + + return TRUE; +} + +static gboolean +file_finish_cb( + gpointer user_data, + uint16_t filenum, + gpointer *file_data G_GNUC_UNUSED, + gboolean truncated) +{ + expected_state_t *state = user_data; + expected_step_t *step = state->steps + state->curstep; + + tu_dbg("file_finish_cb(NULL, %d, NULL, %d)\n", + (int)filenum, truncated); + + if (step->kind != EXP_FINISH_FILE) + EXPECT_FAILURE("step %d: unexpected file finish with fileid %d", + state->curstep, (int)filenum); + + if (step->truncated && !truncated) + EXPECT_FAILURE("step %d: file %d was unexpectedly not truncated", + state->curstep, (int)filenum); + + if (step->truncated && !truncated) + EXPECT_FAILURE("step %d: file %d was unexpectedly truncated", + state->curstep, (int)filenum); + + state->curstep++; + + return TRUE; +} + +static gboolean +frag_cb( + gpointer user_data, + uint16_t filenum, + gpointer file_data G_GNUC_UNUSED, + uint16_t attrid, + gpointer attrid_data G_GNUC_UNUSED, + gpointer *attr_data G_GNUC_UNUSED, + gpointer data, + gsize datasize, + gboolean eoa, + gboolean truncated) +{ + expected_state_t *state = user_data; + expected_step_t *step = state->steps + state->curstep; + + tu_dbg("file_finish_cb(NULL, %d, NULL, %d, %p, %zd, %d, %d)\n", + (int)filenum, (int)attrid, data, datasize, eoa, truncated); + + if (step->kind != EXP_ATTRDATA) + EXPECT_FAILURE("step %d: unexpected attribute data with fileid %d, attrid %d", + state->curstep, (int)filenum, (int)attrid); + + if (step->filenum != filenum) + EXPECT_FAILURE("step %d: expected attribute data with filenum %d; got filenum %d", + state->curstep, (int)step->filenum, (int)filenum); + + if (step->attrid != attrid) + EXPECT_FAILURE("step %d: expected attribute data with attrid %d; got attrid %d", + state->curstep, (int)step->attrid, (int)attrid); + + /* if we're accepting multiple fragments of the attribute here (due to internal + * buffering by the reader), then handle that specially */ + if (step->multipart_ok && datasize < step->datasize) { + if (eoa) + EXPECT_FAILURE("step %d: file %d attribute %d: early EOA in multipart attribute", + state->curstep, (int)filenum, (int)attrid); + + if (memcmp(data, step->data, datasize)) { + EXPECT_FAILURE("step %d: attribute's data does not match", + state->curstep); + } + step->data += datasize; + step->datasize -= datasize; + return TRUE; + } + + if (step->eoa && !eoa) + EXPECT_FAILURE("step %d: file %d attribute %d: expected EOA did not appear", + state->curstep, (int)filenum, (int)attrid); + + if (!step->eoa && eoa) + EXPECT_FAILURE("step %d: file %d attribute %d: unexpected EOA", + state->curstep, (int)filenum, (int)attrid); + + if (!step->truncated && truncated) + EXPECT_FAILURE("step %d: file %d attribute %d was unexpectedly truncated", + state->curstep, (int)filenum, (int)attrid); + + if (step->truncated && !truncated) + EXPECT_FAILURE("step %d: file %d attribute %d was unexpectedly not truncated", + state->curstep, (int)filenum, (int)attrid); + + if (datasize != step->datasize) + EXPECT_FAILURE("step %d: file %d attribute %d lengths do not match: " + "got %zd, expected %zd", + state->curstep, (int)filenum, (int)attrid, + datasize, step->datasize); + + if (memcmp(data, step->data, datasize)) { + if (step->isstr) { + EXPECT_FAILURE("step %d: attribute's data does not match: got '%*s', expected '%*s'", + state->curstep, (int)datasize, (char *)data, + (int)step->datasize, (char *)step->data); + } else { + EXPECT_FAILURE("step %d: attribute's data does not match", + state->curstep); + } + } + + state->curstep++; + + return TRUE; +} + +/**** + * Utilities + */ + +static int +open_temp(gboolean write) +{ + int fd = open(temp_filename, write? O_WRONLY|O_CREAT|O_TRUNC : O_RDONLY, 0777); + if (fd < 0) { + perror("open temporary file"); + exit(1); + } + + return fd; +} + +static void +check_gerror_( + gboolean ok, + GError *error, + const char *fn) +{ + if (ok && !error) + return; + + if (ok) + EXPECT_FAILURE( + "'%s' set 'error' but did not indicate an error condition: %s (%s)\n", + fn, error->message, strerror(error->code)); + else if (!error) + EXPECT_FAILURE( + "'%s' indicated an error condition but did not set 'error'.\n", fn); + else + EXPECT_FAILURE( + "'%s' error: %s (%s)\n", fn, error->message, strerror(error->code)); + + exit(1); +} + +#define check_gerror(ok, error, fn) check_gerror_((ok)!=0, (error), (fn)) + +static void +check_gerror_matches_( + gboolean ok, + GError *error, + const char *matches, + const char *fn) +{ + if (!ok && error) { + if (0 != strcmp(matches, error->message)) { + EXPECT_FAILURE( + "%s produced error '%s' but expected '%s'\n", + fn, error->message, matches); + exit(1); + } + return; + } + + if (ok) + EXPECT_FAILURE( + "'%s' correctly set 'error' but did not indicate an error condition: %s (%s)\n", + fn, error->message, strerror(error->code)); + else /* (!error) */ + EXPECT_FAILURE( + "'%s' correctly indicated an error condition but did not set 'error'.\n", fn); + + exit(1); +} + +#define check_gerror_matches(ok, error, match, fn) \ + check_gerror_matches_((ok)!=0, (error), (match), (fn)) + +static void +try_reading_fd( + expected_step_t *steps, + amar_attr_handling_t *handling, + int fd) +{ + amar_t *ar; + expected_state_t state = { steps, 0 }; + GError *error = NULL; + gboolean ok; + + ar = amar_new(fd, O_RDONLY, &error); + check_gerror(ar, error, "amar_new"); + ok = amar_read(ar, &state, handling, file_start_cb, file_finish_cb, &error); + if (ok || error) + check_gerror(ok, error, "amar_read"); + if (steps[state.curstep].kind != EXP_END) + EXPECT_FAILURE("Stopped reading early at step %d", state.curstep); + ok = amar_close(ar, &error); + check_gerror(ok, error, "amar_close"); +} + +static void +try_reading( + expected_step_t *steps, + amar_attr_handling_t *handling) +{ + int fd; + + fd = open_temp(0); + try_reading_fd(steps, handling, fd); + close(fd); +} + +static void +try_reading_with_error( + expected_step_t *steps, + amar_attr_handling_t *handling, + const char *message) +{ + amar_t *ar; + expected_state_t state = { steps, 0 }; + int fd; + GError *error = NULL; + gboolean ok; + + fd = open_temp(0); + ar = amar_new(fd, O_RDONLY, &error); + check_gerror(ar, error, "amar_new"); + ok = amar_read(ar, &state, handling, file_start_cb, file_finish_cb, &error); + check_gerror_matches(ok, error, message, "amar_read"); + amar_close(ar, NULL); + close(fd); +} + +/**** + * Test various valid inputs + */ + +static int +test_simple_read(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "/first/filename"); + WRITE_RECORD_STR(fd, 1, 18, 1, "eighteen"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, 19, 0, "nine"); + WRITE_RECORD_STR(fd, 1, 20, 0, "twen"); + WRITE_RECORD_STR(fd, 1, 19, 1, "teen"); + WRITE_RECORD_STR(fd, 1, 20, 1, "ty"); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_EOF, 1, ""); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 19, 256, frag_cb, NULL }, /* reassemble this attribute */ + { 20, 0, frag_cb, NULL }, /* but pass along each fragment of this */ + { 0, 256, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "/first/filename", 0), + EXPECT_ATTR_DATA_STR(1, 18, "eighteen", 1, 0), + EXPECT_ATTR_DATA_STR(1, 20, "twen", 0, 0), + EXPECT_ATTR_DATA_STR(1, 19, "nineteen", 1, 0), + EXPECT_ATTR_DATA_STR(1, 20, "ty", 1, 0), + EXPECT_FINISH_FILE(1, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static int +test_read_buffering(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "file1"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 2, AMAR_ATTR_FILENAME, 1, "file2"); + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); /* one byte at a time, for 12 bytes */ + WRITE_RECORD_STR(fd, 2, 19, 0, "9"); + WRITE_RECORD_STR(fd, 2, 21, 1, "012345678901234567890123456789"); /* thirty bytes exactly */ + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); + WRITE_RECORD_STR(fd, 1, 18, 0, "ATTR"); + WRITE_RECORD_STR(fd, 2, 19, 0, "9"); + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); + WRITE_RECORD_STR(fd, 2, 19, 0, "9"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, 20, 0, "TWENTYTWE"); /* nine bytes, then three in the next frag */ + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); + WRITE_RECORD_STR(fd, 1, 20, 1, "NTY"); + WRITE_RECORD_STR(fd, 2, 19, 0, "9"); + WRITE_RECORD_STR(fd, 1, 18, 0, "181818"); /* hit ten bytes exactly */ + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); + WRITE_RECORD_STR(fd, 2, 19, 0, "9"); + WRITE_RECORD_STR(fd, 1, 18, 0, "ATTR"); + WRITE_RECORD_STR(fd, 1, 22, 0, "012345678"); /* nine bytes followed by 20 */ + WRITE_RECORD_STR(fd, 1, 18, 1, "18"); + WRITE_RECORD_STR(fd, 1, 22, 1, "01234567890123456789"); + WRITE_RECORD_STR(fd, 2, 19, 0, "1"); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 2, 19, 1, "9"); + WRITE_RECORD_STR(fd, 2, AMAR_ATTR_EOF, 1, ""); + + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 10, frag_cb, NULL }, /* reassemble all fragments in 10-byte chunks */ + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "file1", 0), + EXPECT_START_FILE_STR(2, "file2", 0), + EXPECT_ATTR_DATA_STR(2, 21, "012345678901234567890123456789", 1, 0), + EXPECT_ATTR_DATA_STR(1, 20, "TWENTYTWENTY", 1, 0), + EXPECT_ATTR_DATA_STR(1, 18, "ATTR181818", 0, 0), + EXPECT_ATTR_DATA_STR(2, 19, "1919191919", 0, 0), + EXPECT_ATTR_DATA_STR(1, 18, "ATTR18", 1, 0), + EXPECT_ATTR_DATA_STR(1, 22, "01234567801234567890123456789", 1, 0), + EXPECT_FINISH_FILE(1, 0), + EXPECT_ATTR_DATA_STR(2, 19, "19", 1, 0), + EXPECT_FINISH_FILE(2, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static int +test_missing_eoa(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "file1"); + WRITE_RECORD_STR(fd, 1, 21, 0, "attribu"); /* note no EOA */ + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_EOF, 1, ""); + + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 1024, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "file1", 0), + EXPECT_ATTR_DATA_STR(1, 21, "attribu", 1, 1), + EXPECT_FINISH_FILE(1, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static int +test_ignore(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "file1"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 2, AMAR_ATTR_FILENAME, 1, "file2"); + WRITE_RECORD_STR(fd, 2, 20, 1, "attr20"); + WRITE_RECORD_STR(fd, 1, 21, 0, "attr"); + WRITE_RECORD_STR(fd, 1, 21, 1, "21"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 3, AMAR_ATTR_FILENAME, 1, "file3"); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 4, AMAR_ATTR_FILENAME, 1, "file4"); + WRITE_RECORD_STR(fd, 3, 22, 1, "attr22"); + WRITE_RECORD_STR(fd, 4, 23, 1, "attr23"); + WRITE_RECORD_STR(fd, 4, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 3, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 2, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_EOF, 1, ""); + + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 10, frag_cb, NULL }, /* reassemble all fragments in 10-byte chunks */ + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "file1", 1), + EXPECT_START_FILE_STR(2, "file2", 0), + EXPECT_ATTR_DATA_STR(2, 20, "attr20", 1, 0), + EXPECT_START_FILE_STR(3, "file3", 1), + EXPECT_START_FILE_STR(4, "file4", 0), + EXPECT_ATTR_DATA_STR(4, 23, "attr23", 1, 0), + EXPECT_FINISH_FILE(4, 0), + EXPECT_FINISH_FILE(2, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static int +test_missing_eof(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "file!"); + WRITE_RECORD_STR(fd, 1, 20, 1, "attribute"); + WRITE_RECORD_STR(fd, 1, 21, 0, "attribu"); /* note no EOA */ + + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 1024, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "file!", 0), + EXPECT_ATTR_DATA_STR(1, 20, "attribute", 1, 0), + EXPECT_ATTR_DATA_STR(1, 21, "attribu", 1, 1), + EXPECT_FINISH_FILE(1, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static int +test_extra_records(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 4, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 5, 20, 1, "old attribute"); + WRITE_RECORD_STR(fd, 6, AMAR_ATTR_FILENAME, 1, "file!"); + WRITE_RECORD_STR(fd, 6, 21, 0, "attribu"); /* note no EOA */ + WRITE_RECORD_STR(fd, 5, AMAR_ATTR_EOF, 1, ""); + WRITE_RECORD_STR(fd, 6, 21, 1, "te"); + WRITE_RECORD_STR(fd, 6, AMAR_ATTR_EOF, 1, ""); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 1024, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(6, "file!", 0), + EXPECT_ATTR_DATA_STR(6, 21, "attribute", 1, 0), + EXPECT_FINISH_FILE(6, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +static gboolean +early_exit_frag_cb( + gpointer user_data G_GNUC_UNUSED, + uint16_t filenum G_GNUC_UNUSED, + gpointer file_data G_GNUC_UNUSED, + uint16_t attrid G_GNUC_UNUSED, + gpointer attrid_data G_GNUC_UNUSED, + gpointer *attr_data G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED, + gsize datasize G_GNUC_UNUSED, + gboolean eoa G_GNUC_UNUSED, + gboolean truncated G_GNUC_UNUSED) +{ + return FALSE; +} + +static int +test_early_exit(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 6, AMAR_ATTR_FILENAME, 1, "file!"); + WRITE_RECORD_STR(fd, 6, 21, 1, "attribu"); + WRITE_RECORD_STR(fd, 6, AMAR_ATTR_EOF, 1, ""); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 0, early_exit_frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(6, "file!", 0), + EXPECT_FINISH_FILE(6, 1), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +/**** + * Test the write side, using round trips. + */ + +/* just try to execute most of the writing code */ +static int +test_writing_coverage(void) +{ + int fd, fd2; + off_t posn, fdsize; + char buf[16300]; + char buf2[16300]; + char *bigbuf; + size_t bigbuf_size = 1024*50+93; + simpleprng_state_t prng; + gsize i; + guint16 attrid = 20; + amar_t *arch = NULL; + amar_file_t *af = NULL, *af2 = NULL; + amar_attr_t *at = NULL, *at2 = NULL; + GError *error = NULL; + gboolean ok; + + /* set up some data buffers */ + for (i = 0; i < sizeof(buf); i++) { + buf[i] = 0xfe; + buf2[i] = 0xaa; + } + + bigbuf = g_malloc(bigbuf_size); + simpleprng_seed(&prng, 0xfeaa); + simpleprng_fill_buffer(&prng, bigbuf, bigbuf_size); + + fd = open("amar-test.big", O_CREAT|O_WRONLY|O_TRUNC, 0777); + g_assert(fd >= 0); + g_assert(full_write(fd, bigbuf, bigbuf_size) == bigbuf_size); + close(fd); + + fd = open_temp(1); + + arch = amar_new(fd, O_WRONLY, &error); + check_gerror(arch, error, "amar_new"); + g_assert(arch != NULL); + + af = amar_new_file(arch, "MyFile", 0, &posn, &error); + check_gerror(af, error, "amar_new_file"); + tu_dbg("MyFile starts at 0x%x\n", (int)posn) + g_assert(af != NULL); + + /* by character with EOA */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + g_assert(at != NULL); + ok = amar_attr_add_data_buffer(at, buf, sizeof(buf), 1, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + /* by character without EOA */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + g_assert(at != NULL); + ok = amar_attr_add_data_buffer(at, buf2, sizeof(buf2), 0, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + /* open up a new file, for fun */ + af2 = amar_new_file(arch, "MyOtherFile", 0, &posn, &error); + check_gerror(af2, error, "amar_new_file"); + tu_dbg("MyOtherFile starts at 0x%x\n", (int)posn) + + /* by file descriptor, to the first file */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + fd2 = open("amar-test.big", O_RDONLY); + g_assert(fd2 >= 0); + fdsize = amar_attr_add_data_fd(at, fd2, 0, &error); + check_gerror(fdsize != -1, error, "amar_attr_add_data_fd"); + g_assert(fdsize > 0); + close(fd2); + unlink("amar-test.big"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + ok = amar_file_close(af, &error); + check_gerror(ok, error, "amar_file_close"); + + /* interlaeave two attributes */ + at = amar_new_attr(af2, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + at2 = amar_new_attr(af2, attrid++, &error); + check_gerror(at2, error, "amar_new_attr"); + ok = amar_attr_add_data_buffer(at, buf, 72, 0, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_add_data_buffer(at2, buf2, 72, 0, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_add_data_buffer(at, buf, 13, 0, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_add_data_buffer(at2, buf2, 13, 1, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + ok = amar_attr_close(at2, &error); + check_gerror(ok, error, "amar_attr_close"); + + ok = amar_file_close(af2, &error); + check_gerror(ok, error, "amar_file_close"); + + ok = amar_close(arch, &error); + check_gerror(ok, error, "amar_close"); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 22, bigbuf_size+1, frag_cb, NULL }, /* buffer the big attr */ + { 0, 0, frag_cb, NULL }, /* don't buffer other records */ + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "MyFile", 0), + EXPECT_ATTR_DATA_MULTIPART(1, 20, buf, sizeof(buf), 1, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, buf2, sizeof(buf2), 0, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, buf2, 0, 1, 0), /* trailing EOA */ + EXPECT_START_FILE_STR(2, "MyOtherFile", 0), + EXPECT_ATTR_DATA(1, 22, bigbuf, bigbuf_size, 1, 0), + EXPECT_FINISH_FILE(1, 0), + EXPECT_ATTR_DATA_MULTIPART(2, 23, buf, 72, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(2, 24, buf2, 72, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(2, 23, buf+72, 13, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(2, 24, buf2+72, 13, 1, 0), + EXPECT_ATTR_DATA_MULTIPART(2, 23, buf, 0, 1, 0), + EXPECT_FINISH_FILE(2, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +/* test big attributes */ +static int +test_big_attr(void) +{ + int fd, fd2; + off_t fdsize; + char *bigbuf; + const size_t max_record_data_size = 4*1024*1024; + size_t bigbuf_size = max_record_data_size + 1274; /* a record and a bit */ + simpleprng_state_t prng; + guint16 attrid = 20; + amar_t *arch = NULL; + amar_file_t *af = NULL; + amar_attr_t *at = NULL; + GError *error = NULL; + gboolean ok; + + /* set up some data buffers */ + bigbuf = g_malloc(bigbuf_size); + simpleprng_seed(&prng, 0xb001); + simpleprng_fill_buffer(&prng, bigbuf, bigbuf_size); + + fd = open("amar-test.big", O_CREAT|O_WRONLY|O_TRUNC, 0777); + g_assert(fd >= 0); + g_assert(full_write(fd, bigbuf, bigbuf_size) == bigbuf_size); + close(fd); + + fd = open_temp(1); + + arch = amar_new(fd, O_WRONLY, &error); + check_gerror(arch, error, "amar_new"); + + af = amar_new_file(arch, "bigstuff", 0, NULL, &error); + check_gerror(af, error, "amar_new_file"); + + /* by character */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + ok = amar_attr_add_data_buffer(at, bigbuf, bigbuf_size, 1, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + /* by file descriptor */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + fd2 = open("amar-test.big", O_RDONLY); + g_assert(fd2 >= 0); + fdsize = amar_attr_add_data_fd(at, fd2, 1, &error); + check_gerror(fdsize != -1, error, "amar_attr_add_data_fd"); + g_assert(fdsize > 0); + close(fd2); + unlink("amar-test.big"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + ok = amar_file_close(af, &error); + check_gerror(ok, error, "amar_file_close"); + + ok = amar_close(arch, &error); + check_gerror(ok, error, "amar_close"); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 0, frag_cb, NULL }, /* don't buffer records */ + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "bigstuff", 0), + EXPECT_ATTR_DATA_MULTIPART(1, 20, bigbuf, max_record_data_size, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 20, bigbuf+max_record_data_size, bigbuf_size-max_record_data_size, 1, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, bigbuf, max_record_data_size, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, bigbuf+max_record_data_size, bigbuf_size-max_record_data_size, 1, 0), + EXPECT_FINISH_FILE(1, 0), + EXPECT_END(), + }; + try_reading(steps, handling); + } + + return 1; +} + +/* like test_big_attr, but using a pipe and ignoring one of the attrs in hopes + * of triggering an lseek(), which will fail on a pipe. */ +static int +test_pipe(void) +{ + int fd; + int p[2]; + off_t fdsize; + char *bigbuf; + const size_t max_record_data_size = 4*1024*1024; + size_t bigbuf_size = max_record_data_size + 1274; /* a record and a bit */ + simpleprng_state_t prng; + guint16 attrid = 20; + amar_t *arch = NULL; + amar_file_t *af = NULL; + amar_attr_t *at = NULL; + GError *error = NULL; + gboolean ok; + + /* set up some data buffers */ + bigbuf = g_malloc(bigbuf_size); + simpleprng_seed(&prng, 0xb001); + simpleprng_fill_buffer(&prng, bigbuf, bigbuf_size); + + fd = open("amar-test.big", O_CREAT|O_WRONLY|O_TRUNC, 0777); + g_assert(fd >= 0); + g_assert(full_write(fd, bigbuf, bigbuf_size) == bigbuf_size); + close(fd); + + g_assert(pipe(p) >= 0); + + switch (fork()) { + case 0: /* child */ + close(p[0]); + arch = amar_new(p[1], O_WRONLY, &error); + check_gerror(arch, error, "amar_new"); + g_assert(arch != NULL); + + af = amar_new_file(arch, "bigstuff", 0, NULL, &error); + check_gerror(af, error, "amar_new_file"); + + /* by character */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + ok = amar_attr_add_data_buffer(at, bigbuf, bigbuf_size, 1, &error); + check_gerror(ok, error, "amar_attr_add_data_buffer"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + /* by file descriptor */ + at = amar_new_attr(af, attrid++, &error); + check_gerror(at, error, "amar_new_attr"); + fd = open("amar-test.big", O_RDONLY); + g_assert(fd >= 0); + fdsize = amar_attr_add_data_fd(at, fd, 1, &error); + check_gerror(fdsize != -1, error, "amar_attr_add_data_fd"); + g_assert(fdsize > 0); + close(fd); + unlink("amar-test.big"); + ok = amar_attr_close(at, &error); + check_gerror(ok, error, "amar_attr_close"); + + ok = amar_file_close(af, &error); + check_gerror(ok, error, "amar_file_close"); + + ok = amar_close(arch, &error); + check_gerror(ok, error, "amar_close"); + close(p[1]); + exit(0); + + case -1: + perror("fork"); + exit(1); + + default: { /* parent */ + amar_attr_handling_t handling[] = { + { 20, 0, NULL, NULL }, /* ignore attr 20 */ + { 0, 0, frag_cb, NULL }, /* don't buffer records */ + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "bigstuff", 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, bigbuf, max_record_data_size, 0, 0), + EXPECT_ATTR_DATA_MULTIPART(1, 21, bigbuf+max_record_data_size, bigbuf_size-max_record_data_size, 1, 0), + EXPECT_FINISH_FILE(1, 0), + EXPECT_END(), + }; + int status; + close(p[1]); + try_reading_fd(steps, handling, p[0]); + close(p[0]); + wait(&status); + if(WIFSIGNALED(status)) { + printf("child was terminated by signal %d\n", WTERMSIG(status)); + exit(1); + } + } + } + + return 1; +} + +/**** + * Invalid inputs - test error returns + */ + +static int +test_no_header(void) +{ + int fd; + + fd = open_temp(1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "/first/filename"); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 0, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_END(), + }; + try_reading_with_error(steps, handling, + "Archive read does not begin at a header record"); + } + + return 1; +} + +static int +test_invalid_eof(void) +{ + int fd; + + fd = open_temp(1); + WRITE_HEADER(fd, 1); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_FILENAME, 1, "hi"); + WRITE_RECORD_STR(fd, 1, AMAR_ATTR_EOF, 1, "abc"); + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 0, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_START_FILE_STR(1, "hi", 0), + EXPECT_END(), + }; + try_reading_with_error(steps, handling, + "Archive contains an EOF record with nonzero size"); + } + + return 1; +} + +static int +test_header_vers(void) +{ + int fd; + char hdr[32]; + + bzero(hdr, sizeof(hdr)); + strcpy(hdr, "AMANDA ARCHIVE FORMAT 2"); + + fd = open_temp(1); + if (full_write(fd, hdr, sizeof(hdr)) < sizeof(hdr)) { + perror("full_write"); + exit(1); + } + close(fd); + + { + amar_attr_handling_t handling[] = { + { 0, 0, frag_cb, NULL }, + }; + expected_step_t steps[] = { + EXPECT_END(), + }; + try_reading_with_error(steps, handling, + "Archive version 2 is not supported"); + } + + return 1; +} + +/**** + * Driver + */ + +int +main(int argc, char **argv) +{ + int rv; + char *cwd = g_get_current_dir(); + static TestUtilsTest tests[] = { + TU_TEST(test_simple_read, 10), + TU_TEST(test_read_buffering, 10), + TU_TEST(test_missing_eoa, 10), + TU_TEST(test_ignore, 10), + TU_TEST(test_missing_eof, 10), + TU_TEST(test_extra_records, 10), + TU_TEST(test_early_exit, 10), + TU_TEST(test_writing_coverage, 10), + TU_TEST(test_big_attr, 20), + TU_TEST(test_pipe, 20), + TU_TEST(test_no_header, 10), + TU_TEST(test_invalid_eof, 10), + TU_TEST(test_header_vers, 10), + TU_END() + }; + + temp_filename = vstralloc(cwd, "/amar-test.tmp", NULL); + + rv = testutils_run_tests(argc, argv, tests); + unlink(temp_filename); + return rv; +} diff --git a/amar-src/amar.c b/amar-src/amar.c new file mode 100644 index 0000000..a39854d --- /dev/null +++ b/amar-src/amar.c @@ -0,0 +1,1069 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "util.h" +#include "amar.h" + +/* Each block in an archive is made up of one or more records, where each + * record is either a header record or a data record. The two are + * distinguished by the header magic string; the string 'AM' is + * explicitly excluded as an allowed filenum to prevent ambiguity. */ + +#define HEADER_MAGIC "AMANDA ARCHIVE FORMAT" +#define MAGIC_FILENUM 0x414d +#define HEADER_VERSION 1 +#define EOA_BIT 0x80000000 + +typedef struct header_s { + /* magic is HEADER_MAGIC + ' ' + decimal version, NUL padded */ + char magic[28]; +} header_t; +#define HEADER_SIZE (SIZEOF(header_t)) + +typedef struct record_s { + uint16_t filenum; + uint16_t attrid; + uint32_t size; +} record_t; +#define RECORD_SIZE (SIZEOF(record_t)) +#define MAX_RECORD_DATA_SIZE (4*1024*1024) + +#define MKRECORD(ptr, f, a, s, eoa) do { \ + record_t r; \ + uint32_t size = s; \ + if (eoa) size |= EOA_BIT; \ + r.filenum = htons(f); \ + r.attrid = htons(a); \ + r.size = htonl(size); \ + memcpy(ptr, &r, sizeof(record_t)); \ +} while(0) + +/* N.B. - f, a, s, and eoa must be simple lvalues */ +#define GETRECORD(ptr, f, a, s, eoa) do { \ + record_t r; \ + memcpy(&r, ptr, sizeof(record_t)); \ + s = ntohl(r.size); \ + if (s & EOA_BIT) { \ + eoa = TRUE; \ + s &= ~EOA_BIT; \ + } else { \ + eoa = FALSE; \ + } \ + f = ntohs(r.filenum); \ + a = ntohs(r.attrid); \ +} while(0) + +/* performance knob: how much data will we buffer before just + * writing straight out of the user's buffers? */ +#define WRITE_BUFFER_SIZE (512*1024) + +struct amar_s { + int fd; /* file descriptor */ + mode_t mode; /* mode O_RDONLY or O_WRONLY */ + uint16_t maxfilenum; /* Next file number to allocate */ + header_t hdr; /* pre-constructed header */ + off_t position; /* current position in the archive */ + GHashTable *files; /* List of all amar_file_t */ + gboolean seekable; /* does lseek() work on this fd? */ + + /* internal buffer; on writing, this is WRITE_BUFFER_SIZE bytes, and + * always has at least RECORD_SIZE bytes free. */ + gpointer buf; + size_t buf_len; + size_t buf_size; +}; + +struct amar_file_s { + amar_t *archive; /* archive for this file */ + gint filenum; /* filenum of this file; gint is required by hash table */ + GHashTable *attributes; /* all attributes for this file */ +}; + +struct amar_attr_s { + amar_file_t *file; /* file for this attribute */ + gint attrid; /* id of this attribute */ + gboolean wrote_eoa; /* If the attribute is finished */ +}; + +/* + * Internal functions + */ + +GQuark +amar_error_quark(void) +{ + static GQuark q; + if (!q) + q = g_quark_from_static_string("amar_error"); + return q; +} + +static gboolean +flush_buffer( + amar_t *archive, + GError **error) +{ + if (archive->buf_len) { + if (full_write(archive->fd, archive->buf, archive->buf_len) != archive->buf_len) { + g_set_error(error, amar_error_quark(), errno, + "Error writing to amanda archive: %s", strerror(errno)); + return FALSE; + } + archive->buf_len = 0; + } + + return TRUE; +} + +static gboolean +write_header( + amar_t *archive, + GError **error) +{ + /* if it won't fit in the buffer, take the easy way out and flush it */ + if (archive->buf_len + HEADER_SIZE >= WRITE_BUFFER_SIZE - RECORD_SIZE) { + if (!flush_buffer(archive, error)) + return FALSE; + } + + memcpy(archive->buf + archive->buf_len, &archive->hdr, HEADER_SIZE); + archive->buf_len += HEADER_SIZE; + archive->position += HEADER_SIZE; + + return TRUE; +} + +static gboolean +write_record( + amar_t *archive, + uint16_t filenum, + uint16_t attrid, + gboolean eoa, + gpointer data, + gsize data_size, + GError **error) +{ + /* the buffer always has room for a new record header */ + MKRECORD(archive->buf + archive->buf_len, filenum, attrid, data_size, eoa); + archive->buf_len += RECORD_SIZE; + + /* is it worth copying this record into the buffer? */ + if (archive->buf_len + RECORD_SIZE + data_size < WRITE_BUFFER_SIZE - RECORD_SIZE) { + /* yes, it is */ + if (data_size) + memcpy(archive->buf + archive->buf_len, data, data_size); + archive->buf_len += data_size; + } else { + /* no, it's not */ + struct iovec iov[2]; + + /* flush the buffer and write the new data, all in one syscall */ + iov[0].iov_base = archive->buf; + iov[0].iov_len = archive->buf_len; + iov[1].iov_base = data; + iov[1].iov_len = data_size; + if (full_writev(archive->fd, iov, 2) < 0) { + g_set_error(error, amar_error_quark(), errno, + "Error writing to amanda archive: %s", strerror(errno)); + return FALSE; + } + archive->buf_len = 0; + } + + archive->position += data_size + RECORD_SIZE; + return TRUE; +} + +/* + * Public functions + */ + +amar_t * +amar_new( + int fd, + mode_t mode, + GError **error) +{ + amar_t *archive = malloc(SIZEOF(amar_t)); + + /* make some sanity checks first */ + g_assert(fd >= 0); + g_assert(mode == O_RDONLY || mode == O_WRONLY); + + archive->fd = fd; + archive->mode = mode; + archive->maxfilenum = 0; + archive->position = 0; + archive->seekable = TRUE; /* assume seekable until lseek() fails */ + archive->files = g_hash_table_new(g_int_hash, g_int_equal); + archive->buf = NULL; + + if (mode == O_WRONLY) { + archive->buf = g_malloc(WRITE_BUFFER_SIZE); + archive->buf_size = WRITE_BUFFER_SIZE; + } + archive->buf_len = 0; + + if (mode == O_WRONLY) { + /* preformat a header with our version number */ + bzero(archive->hdr.magic, HEADER_SIZE); + snprintf(archive->hdr.magic, HEADER_SIZE, + HEADER_MAGIC " %d", HEADER_VERSION); + + /* and write it out to start the file */ + if (!write_header(archive, error)) { + amar_close(archive, NULL); /* flushing buffer won't fail */ + return NULL; + } + } + + return archive; +} + +gboolean +amar_close( + amar_t *archive, + GError **error) +{ + gboolean success = TRUE; + + /* verify all files are done */ + g_assert(g_hash_table_size(archive->files) == 0); + + if (!flush_buffer(archive, error)) + success = FALSE; + + g_hash_table_destroy(archive->files); + if (archive->buf) g_free(archive->buf); + amfree(archive); + + return success; +} + +/* + * Writing + */ + +amar_file_t * +amar_new_file( + amar_t *archive, + char *filename_buf, + gsize filename_len, + off_t *header_offset, + GError **error) +{ + amar_file_t *file = NULL; + + g_assert(archive->mode == O_WRONLY); + g_assert(filename_buf != NULL); + + /* set filename_len if it wasn't specified */ + if (!filename_len) + filename_len = strlen(filename_buf); + g_assert(filename_len != 0); + + if (filename_len > MAX_RECORD_DATA_SIZE) { + g_set_error(error, amar_error_quark(), ENOSPC, + "filename is too long for an amanda archive"); + return NULL; + } + + /* pick a new, unused filenum */ + + if (g_hash_table_size(archive->files) == 65535) { + g_set_error(error, amar_error_quark(), ENOSPC, + "No more file numbers available"); + return NULL; + } + + do { + gint filenum; + + archive->maxfilenum++; + + /* MAGIC_FILENUM can't be used because it matches the header record text */ + if (archive->maxfilenum == MAGIC_FILENUM) { + continue; + } + + /* see if this fileid is already in use */ + filenum = archive->maxfilenum; + if (g_hash_table_lookup(archive->files, &filenum)) + continue; + + } while (0); + + file = g_new0(amar_file_t, 1); + file->archive = archive; + file->filenum = archive->maxfilenum; + file->attributes = g_hash_table_new_full(g_int_hash, g_int_equal, NULL, g_free); + g_hash_table_insert(archive->files, &file->filenum, file); + + /* record the current position and write a header there, if desired */ + if (header_offset) { + *header_offset = archive->position; + if (!write_header(archive, error)) + goto error_exit; + } + + /* add a filename record */ + if (!write_record(archive, file->filenum, AMAR_ATTR_FILENAME, + 1, filename_buf, filename_len, error)) + goto error_exit; + + return file; + +error_exit: + if (file) { + g_hash_table_remove(archive->files, &file->filenum); + g_hash_table_destroy(file->attributes); + g_free(file); + } + return NULL; +} + +static void +foreach_attr_close( + gpointer key G_GNUC_UNUSED, + gpointer value, + gpointer user_data) +{ + amar_attr_t *attr = value; + GError **error = user_data; + + /* return immediately if we've already seen an error */ + if (*error) + return; + + if (!attr->wrote_eoa) { + amar_attr_close(attr, error); + } +} + +gboolean +amar_file_close( + amar_file_t *file, + GError **error) +{ + gboolean success = TRUE; + amar_t *archive = file->archive; + + /* close all attributes that haven't already written EOA */ + g_hash_table_foreach(file->attributes, foreach_attr_close, error); + if (*error) + success = FALSE; + + /* write an EOF record */ + if (success) { + if (!write_record(archive, file->filenum, AMAR_ATTR_EOF, 1, + NULL, 0, error)) + success = FALSE; + } + + /* remove from archive->file list */ + g_hash_table_remove(archive->files, &file->filenum); + + /* clean up */ + g_hash_table_destroy(file->attributes); + amfree(file); + + return success; +} + +amar_attr_t * +amar_new_attr( + amar_file_t *file, + uint16_t attrid, + GError **error G_GNUC_UNUSED) +{ + amar_attr_t *attribute; + gint attrid_gint = attrid; + + /* make sure this attrid isn't already present */ + g_assert(attrid >= AMAR_ATTR_APP_START); + g_assert(g_hash_table_lookup(file->attributes, &attrid_gint) == NULL); + + attribute = malloc(SIZEOF(amar_attr_t)); + attribute->file = file; + attribute->attrid = attrid; + attribute->wrote_eoa = FALSE; + g_hash_table_replace(file->attributes, &attribute->attrid, attribute); + + /* (note this function cannot currently return an error) */ + + return attribute; +} + +gboolean +amar_attr_close( + amar_attr_t *attribute, + GError **error) +{ + amar_file_t *file = attribute->file; + amar_t *archive = file->archive; + gboolean rv = TRUE; + + /* write an empty record with EOA_BIT set if we haven't ended + * this attribute already */ + if (!attribute->wrote_eoa) { + if (!write_record(archive, file->filenum, attribute->attrid, + 1, NULL, 0, error)) + rv = FALSE; + attribute->wrote_eoa = TRUE; + } + + return rv; +} + +gboolean +amar_attr_add_data_buffer( + amar_attr_t *attribute, + gpointer data, gsize size, + gboolean eoa, + GError **error) +{ + amar_file_t *file = attribute->file; + amar_t *archive = file->archive; + + g_assert(!attribute->wrote_eoa); + + /* write records until we've consumed all of the buffer */ + while (size) { + gsize rec_data_size; + gboolean rec_eoa = FALSE; + + if (size > MAX_RECORD_DATA_SIZE) { + rec_data_size = MAX_RECORD_DATA_SIZE; + } else { + rec_data_size = size; + if (eoa) + rec_eoa = TRUE; + } + + if (!write_record(archive, file->filenum, attribute->attrid, + rec_eoa, data, rec_data_size, error)) + return FALSE; + + data += rec_data_size; + size -= rec_data_size; + } + + if (eoa) { + attribute->wrote_eoa = TRUE; + } + + return TRUE; +} + +off_t +amar_attr_add_data_fd( + amar_attr_t *attribute, + int fd, + gboolean eoa, + GError **error) +{ + amar_file_t *file = attribute->file; + amar_t *archive = file->archive; + gssize size; + off_t filesize = 0; + gpointer buf = g_malloc(MAX_RECORD_DATA_SIZE); + + g_assert(!attribute->wrote_eoa); + + /* read and write until reaching EOF */ + while ((size = full_read(fd, buf, MAX_RECORD_DATA_SIZE)) >= 0) { + if (!write_record(archive, file->filenum, attribute->attrid, + eoa && (size < MAX_RECORD_DATA_SIZE), buf, size, error)) + goto error_exit; + + filesize += size; + + if (size < MAX_RECORD_DATA_SIZE) + break; + } + + if (size < 0) { + g_set_error(error, amar_error_quark(), errno, + "Error reading from fd %d: %s", fd, strerror(errno)); + goto error_exit; + } + g_free(buf); + + attribute->wrote_eoa = eoa; + + return filesize; + +error_exit: + g_free(buf); + return -1; +} + +/* + * Reading + */ + +/* Note that this implementation assumes that an archive will have a "small" + * number of open files at any time, and a limited number of attributes for + * each file. */ + +typedef struct attr_state_s { + uint16_t attrid; + amar_attr_handling_t *handling; + gpointer buf; + gsize buf_len; + gsize buf_size; + gpointer attr_data; + gboolean wrote_eoa; +} attr_state_t; + +typedef struct file_state_s { + uint16_t filenum; + gpointer file_data; /* user's data */ + gboolean ignore; + + GSList *attr_states; +} file_state_t; + +typedef struct handling_params_s { + /* parameters from the user */ + gpointer user_data; + amar_attr_handling_t *handling_array; + amar_file_start_callback_t file_start_cb; + amar_file_finish_callback_t file_finish_cb; + + /* tracking for open files and attributes */ + GSList *file_states; + + /* read buffer */ + gpointer buf; + gsize buf_size; /* allocated size */ + gsize buf_len; /* number of active bytes .. */ + gsize buf_offset; /* ..starting at buf + buf_offset */ + gboolean got_eof; + gboolean just_lseeked; /* did we just call lseek? */ +} handling_params_t; + +/* buffer-handling macros and functions */ + +/* Ensure that the archive buffer contains at least ATLEAST bytes. Returns + * FALSE if that many bytes are not available due to EOF or another error. */ +static gboolean +buf_atleast_( + amar_t *archive, + handling_params_t *hp, + gsize atleast) +{ + gsize to_read; + gsize bytes_read; + + /* easy case of hp->buf_len >= atleast is taken care of by the macro, below */ + + if (hp->got_eof) + return FALSE; + + /* If we just don't have space for this much data yet, then we'll have to reallocate + * the buffer */ + if (hp->buf_size < atleast) { + if (hp->buf_offset == 0) { + hp->buf = g_realloc(hp->buf, atleast); + } else { + gpointer newbuf = g_malloc(atleast); + if (hp->buf) { + memcpy(newbuf, hp->buf+hp->buf_offset, hp->buf_len); + g_free(hp->buf); + } + hp->buf = newbuf; + hp->buf_offset = 0; + } + hp->buf_size = atleast; + } + + /* if we have space in this buffer to satisfy the request, but not without moving + * the existing data around, then move the data around */ + else if (hp->buf_size - hp->buf_offset < atleast) { + memmove(hp->buf, hp->buf+hp->buf_offset, hp->buf_len); + hp->buf_offset = 0; + } + + /* as an optimization, if we just called lseek, then only read the requested + * bytes in case we're going to lseek again. */ + if (hp->just_lseeked) + to_read = atleast - hp->buf_len; + else + to_read = hp->buf_size - hp->buf_offset - hp->buf_len; + + bytes_read = full_read(archive->fd, + hp->buf+hp->buf_offset+hp->buf_len, + to_read); + if (bytes_read < to_read) + hp->got_eof = TRUE; + hp->just_lseeked = FALSE; + + hp->buf_len += bytes_read; + + return hp->buf_len >= atleast; +} + +#define buf_atleast(archive, hp, atleast) \ + (((hp)->buf_len >= (atleast))? TRUE : buf_atleast_((archive), (hp), (atleast))) + +/* Skip the buffer ahead by SKIPBYTES bytes. This will discard data from the + * buffer, and may call lseek() if some of the skipped bytes have not yet been + * read. Returns FALSE if the requisite bytes cannot be skipped due to EOF or + * another error. */ +static gboolean +buf_skip_( + amar_t *archive, + handling_params_t *hp, + gsize skipbytes) +{ + /* easy case of buf_len > skipbytes is taken care of by the macro, below, + * so we know we're clearing out the entire buffer here */ + + skipbytes -= hp->buf_len; + hp->buf_len = 0; + + hp->buf_offset = 0; + +retry: + if (archive->seekable) { + if (lseek(archive->fd, skipbytes, SEEK_CUR) < 0) { + /* did we fail because archive->fd is a pipe or something? */ + if (errno == ESPIPE) { + archive->seekable = FALSE; + goto retry; + } + hp->got_eof = TRUE; + return FALSE; + } + } else { + while (skipbytes) { + gsize toread = MIN(skipbytes, hp->buf_size); + gsize bytes_read = full_read(archive->fd, hp->buf, toread); + + if (bytes_read < toread) { + hp->got_eof = TRUE; + return FALSE; + } + + skipbytes -= bytes_read; + } + } + + return TRUE; +} + +#define buf_skip(archive, hp, skipbytes) \ + (((skipbytes) <= (hp)->buf_len) ? \ + ((hp)->buf_len -= (skipbytes), \ + (hp)->buf_offset += (skipbytes), \ + TRUE) \ + : buf_skip_((archive), (hp), (skipbytes))) + +/* Get a pointer to the current position in the buffer */ +#define buf_ptr(hp) ((hp)->buf + (hp)->buf_offset) + +/* Get the amount of data currently available in the buffer */ +#define buf_avail(hp) ((hp)->buf_len) + +static gboolean +finish_attr( + handling_params_t *hp, + file_state_t *fs, + attr_state_t *as, + gboolean truncated) +{ + gboolean success = TRUE; + if (!as->wrote_eoa && as->handling && as->handling->callback) { + success = as->handling->callback(hp->user_data, fs->filenum, + fs->file_data, as->attrid, as->handling->attrid_data, + &as->attr_data, as->buf, as->buf_len, TRUE, truncated); + } + amfree(as->buf); + amfree(as); + + return success; +} + +static gboolean +finish_file( + handling_params_t *hp, + file_state_t *fs, + gboolean truncated) +{ + GSList *iter; + gboolean success = TRUE; + + /* free up any attributes not yet ended */ + for (iter = fs->attr_states; iter; iter = iter->next) { + attr_state_t *as = (attr_state_t *)iter->data; + success = success && finish_attr(hp, fs, as, TRUE); + } + g_slist_free(fs->attr_states); + fs->attr_states = NULL; + + if (hp->file_finish_cb && !fs->ignore) + success = success && hp->file_finish_cb(hp->user_data, fs->filenum, &fs->file_data, truncated); + + amfree(fs); + return success; +} + +/* buffer the data and/or call the callback for this attribute */ +static gboolean +handle_hunk( + handling_params_t *hp, + file_state_t *fs, + attr_state_t *as, + amar_attr_handling_t *hdl, + gpointer buf, + gsize len, + gboolean eoa) +{ + gboolean success = TRUE; + + /* capture any conditions where we don't have to copy into the buffer */ + if (hdl->min_size == 0 || (as->buf_len == 0 && len >= hdl->min_size)) { + success = success && hdl->callback(hp->user_data, fs->filenum, + fs->file_data, as->attrid, hdl->attrid_data, &as->attr_data, + buf, len, eoa, FALSE); + as->wrote_eoa = eoa; + } else { + /* ok, copy into the buffer */ + if (as->buf_len + len > as->buf_size) { + gpointer newbuf = g_malloc(as->buf_len + len); + if (as->buf) { + memcpy(newbuf, as->buf, as->buf_len); + g_free(as->buf); + } + as->buf = newbuf; + as->buf_size = as->buf_len + len; + } + memcpy(as->buf + as->buf_len, buf, len); + as->buf_len += len; + + /* and call the callback if we have enough data or if this is the last attr */ + if (as->buf_len >= hdl->min_size || eoa) { + success = success && hdl->callback(hp->user_data, fs->filenum, + fs->file_data, as->attrid, hdl->attrid_data, &as->attr_data, + as->buf, as->buf_len, eoa, FALSE); + as->buf_len = 0; + as->wrote_eoa = eoa; + } + } + + return success; +} + +gboolean +amar_read( + amar_t *archive, + gpointer user_data, + amar_attr_handling_t *handling_array, + amar_file_start_callback_t file_start_cb, + amar_file_finish_callback_t file_finish_cb, + GError **error) +{ + file_state_t *fs = NULL; + attr_state_t *as = NULL; + GSList *iter; + handling_params_t hp; + uint16_t filenum; + uint16_t attrid; + uint32_t datasize; + gboolean eoa; + amar_attr_handling_t *hdl; + gboolean success = TRUE; + + g_assert(archive->mode == O_RDONLY); + + hp.user_data = user_data; + hp.handling_array = handling_array; + hp.file_start_cb = file_start_cb; + hp.file_finish_cb = file_finish_cb; + hp.file_states = NULL; + hp.buf_len = 0; + hp.buf_offset = 0; + hp.buf_size = 1024; /* use a 1K buffer to start */ + hp.buf = g_malloc(hp.buf_size); + hp.got_eof = FALSE; + hp.just_lseeked = FALSE; + + /* check that we are starting at a header record, but don't advance + * the buffer past it */ + if (buf_atleast(archive, &hp, RECORD_SIZE)) { + GETRECORD(buf_ptr(&hp), filenum, attrid, datasize, eoa); + if (filenum != MAGIC_FILENUM) { + g_set_error(error, amar_error_quark(), EINVAL, + "Archive read does not begin at a header record"); + return FALSE; + } + } + + while (1) { + if (!buf_atleast(archive, &hp, RECORD_SIZE)) + break; + + GETRECORD(buf_ptr(&hp), filenum, attrid, datasize, eoa); + + /* handle headers specially */ + if (G_UNLIKELY(filenum == MAGIC_FILENUM)) { + int vers; + + /* bail if an EOF occurred in the middle of the header */ + if (!buf_atleast(archive, &hp, HEADER_SIZE)) + break; + + if (sscanf(buf_ptr(&hp), HEADER_MAGIC " %d", &vers) != 1) { + g_set_error(error, amar_error_quark(), EINVAL, + "Invalid archive header"); + return FALSE; + } + + if (vers > HEADER_VERSION) { + g_set_error(error, amar_error_quark(), EINVAL, + "Archive version %d is not supported", vers); + return FALSE; + } + + buf_skip(archive, &hp, HEADER_SIZE); + + continue; + } + + buf_skip(archive, &hp, RECORD_SIZE); + + if (datasize > MAX_RECORD_DATA_SIZE) { + g_set_error(error, amar_error_quark(), EINVAL, + "Invalid record: data size must be less than %d", + MAX_RECORD_DATA_SIZE); + return FALSE; + } + + /* find the file_state_t, if it exists */ + if (!fs || fs->filenum != filenum) { + fs = NULL; + for (iter = hp.file_states; iter; iter = iter->next) { + if (((file_state_t *)iter->data)->filenum == filenum) { + fs = (file_state_t *)iter->data; + break; + } + } + } + + /* get the "special" attributes out of the way */ + if (G_UNLIKELY(attrid < AMAR_ATTR_APP_START)) { + if (attrid == AMAR_ATTR_EOF) { + if (datasize != 0) { + g_set_error(error, amar_error_quark(), EINVAL, + "Archive contains an EOF record with nonzero size"); + return FALSE; + } + if (fs) { + success = finish_file(&hp, fs, FALSE); + hp.file_states = g_slist_remove(hp.file_states, fs); + as = NULL; + fs = NULL; + if (!success) + break; + } + continue; + } else if (attrid == AMAR_ATTR_FILENAME) { + /* for filenames, we need the whole filename in the buffer */ + if (!buf_atleast(archive, &hp, datasize)) + break; + + if (fs) { + /* TODO: warn - previous file did not end correctly */ + success = finish_file(&hp, fs, TRUE); + hp.file_states = g_slist_remove(hp.file_states, fs); + as = NULL; + fs = NULL; + if (!success) + break; + } + + if (!datasize) { + g_set_error(error, amar_error_quark(), EINVAL, + "Archive file %d has an empty filename", + (int)filenum); + return FALSE; + } + + if (!eoa) { + g_set_error(error, amar_error_quark(), EINVAL, + "Filename record for fileid %d does " + "not have its EOA bit set", (int)filenum); + return FALSE; + } + + fs = g_new0(file_state_t, 1); + fs->filenum = filenum; + hp.file_states = g_slist_prepend(hp.file_states, fs); + + if (hp.file_start_cb) { + success = hp.file_start_cb(hp.user_data, filenum, + buf_ptr(&hp), datasize, + &fs->ignore, &fs->file_data); + if (!success) + break; + } + + buf_skip(archive, &hp, datasize); + + continue; + } else { + g_set_error(error, amar_error_quark(), EINVAL, + "Unknown attribute id %d in archive file %d", + (int)attrid, (int)filenum); + return FALSE; + } + } + + /* if this is an unrecognized file or a known file that's being + * ignored, then skip it. */ + if (!fs || fs->ignore) { + buf_skip(archive, &hp, datasize); + continue; + } + + /* ok, this is an application attribute. Look up its as, if it exists. */ + if (!as || as->attrid != attrid) { + as = NULL; + for (iter = fs->attr_states; iter; iter = iter->next) { + if (((attr_state_t *)(iter->data))->attrid == attrid) { + as = (attr_state_t *)(iter->data); + break; + } + } + } + + /* and get the proper handling for that attribute */ + if (as) { + hdl = as->handling; + } else { + hdl = hp.handling_array; + for (hdl = hp.handling_array; hdl->attrid != 0; hdl++) { + if (hdl->attrid == attrid) + break; + } + } + + /* As a shortcut, if this is a one-record attribute, handle it without + * creating a new attribute_state_t. */ + if (eoa && !as) { + gpointer tmp = NULL; + if (hdl->callback) { + /* a simple single-part callback */ + if (buf_avail(&hp) >= datasize) { + success = hdl->callback(hp.user_data, filenum, fs->file_data, attrid, + hdl->attrid_data, &tmp, buf_ptr(&hp), datasize, eoa, FALSE); + if (!success) + break; + buf_skip(archive, &hp, datasize); + continue; + } + + /* we only have part of the data, but if it's big enough to exceed + * the attribute's min_size, then just call the callback for each + * part of the data */ + else if (buf_avail(&hp) >= hdl->min_size) { + gsize firstpart = buf_avail(&hp); + gsize lastpart = datasize - firstpart; + + success = hdl->callback(hp.user_data, filenum, fs->file_data, attrid, + hdl->attrid_data, &tmp, buf_ptr(&hp), firstpart, FALSE, FALSE); + if (!success) + break; + buf_skip(archive, &hp, firstpart); + + if (!buf_atleast(archive, &hp, lastpart)) + break; + + success = hdl->callback(hp.user_data, filenum, fs->file_data, attrid, + hdl->attrid_data, &tmp, buf_ptr(&hp), lastpart, eoa, FALSE); + if (!success) + break; + buf_skip(archive, &hp, lastpart); + continue; + } + } else { + /* no callback -> just skip it */ + buf_skip(archive, &hp, datasize); + continue; + } + } + + /* ok, set up a new attribute state */ + if (!as) { + as = g_new0(attr_state_t, 1); + as->attrid = attrid; + as->handling = hdl; + fs->attr_states = g_slist_prepend(fs->attr_states, as); + } + + if (hdl->callback) { + /* handle the data as one or two hunks, depending on whether it's + * all in the buffer right now */ + if (buf_avail(&hp) >= datasize) { + success = handle_hunk(&hp, fs, as, hdl, buf_ptr(&hp), datasize, eoa); + if (!success) + break; + buf_skip(archive, &hp, datasize); + } else { + gsize hunksize = buf_avail(&hp); + success = handle_hunk(&hp, fs, as, hdl, buf_ptr(&hp), hunksize, FALSE); + if (!success) + break; + buf_skip(archive, &hp, hunksize); + + hunksize = datasize - hunksize; + if (!buf_atleast(archive, &hp, hunksize)) + break; + + handle_hunk(&hp, fs, as, hdl, buf_ptr(&hp), hunksize, eoa); + buf_skip(archive, &hp, hunksize); + } + } else { + buf_skip(archive, &hp, datasize); + } + + /* finish the attribute if this is its last record */ + if (eoa) { + success = finish_attr(&hp, fs, as, FALSE); + fs->attr_states = g_slist_remove(fs->attr_states, as); + if (!success) + break; + as = NULL; + } + } + + /* close any open files, assuming that they have been truncated */ + + for (iter = hp.file_states; iter; iter = iter->next) { + file_state_t *fs = (file_state_t *)iter->data; + finish_file(&hp, fs, TRUE); + } + g_slist_free(hp.file_states); + g_free(hp.buf); + + return success; +} diff --git a/amar-src/amar.h b/amar-src/amar.h new file mode 100644 index 0000000..288bdbf --- /dev/null +++ b/amar-src/amar.h @@ -0,0 +1,251 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include + +/* A note regarding error handling in this module. Amar returns errors via the + * Glib GError mechanism. Most functions return a boolean, where TRUE + * indicates success, and FALSE indicates an error which is indicated in the + * 'error' parameter. + * + * Fatal programming errors are handled with assertions and error exits; any + * fatal format or system errors are handled via GError. Some format errors + * (e.g., missing EOAs at the end of a file) are handled without any + * acknowledgement. + * + * The domain for amar errors is that returned from amar_error_quark, and error + * codes are system error codes (e.g., EINVAL, ENOSPC). */ + +GQuark amar_error_quark(void); + +/* opaque types for archives, files, and attributes */ + +typedef struct amar_s amar_t; +typedef struct amar_file_s amar_file_t; +typedef struct amar_attr_s amar_attr_t; + +/* Application attribute IDs should start at AMAR_ATTR_APP_START */ + +enum { + /* internal-use only attributes */ + AMAR_ATTR_FILENAME = 0, + AMAR_ATTR_EOF = 1, + + /* anything above this value can be used by the application */ + AMAR_ATTR_APP_START = 16, + AMAR_ATTR_GENERIC_DATA = AMAR_ATTR_APP_START, +}; + +/* Create an object to read/write an amanda archive on the file descriptor fd. + * @param fd: file descriptor of the file, it must already be opened + * @mode: O_RDONLY for reading, O_WRONLY for writing + * @returns: NULL on error + */ +amar_t *amar_new(int fd, mode_t mode, GError **error); + +/* Finish writing to this fd. All buffers are flushed, but the file descriptor + * is not closed -- the user must close it. */ +gboolean amar_close(amar_t *archive, GError **error); + +/* create a new 'file' object on the archive. The filename is treated as a + * binary blob, but if filename_len is zero, then its length will be calculated + * with strlen(). A zero-length filename_buf is not allowed. + * + * Note that a header record will only be written if header_offset is non-NULL, + * as this represents a location to which a reader could seek. + * + * @param archive: the archive containing this file + * @param filename_buf: filename to include in the file + * @param filename_len: length of the filename_buf, or 0 to calculate + * @param header_offset (output): offset of the header record preceding + * this file; pass NULL to ignore. + * @returns: NULL on error, otherwise a file object + */ +amar_file_t *amar_new_file( + amar_t *archive, + char *filename_buf, + gsize filename_len, + off_t *header_offset, + GError **error); + +/* Flush all buffer the 'file' object and write a record with ID=2 */ +gboolean amar_file_close( + amar_file_t *file, + GError **error); + +/* create a new 'attribute' object with attrid attached to the file + * + * @returns: NULL on error, otherwise an attribute object + */ +amar_attr_t *amar_new_attr( + amar_file_t *file, + uint16_t attrid, + GError **error); + +/* flush all buffers and mark the end of the attribute */ +gboolean amar_attr_close( + amar_attr_t *attribute, + GError **error); + +/* Add 'size' byte of data from 'data' to the attribute. If this is the + * last data in this attribute, set eoa to TRUE. This will save space by + * writing and end-of-attribute indication in this record, instead of adding + * an empty EOA record. + */ +gboolean amar_attr_add_data_buffer( + amar_attr_t *attribute, + gpointer data, + gsize size, + gboolean eoa, + GError **error); + +/* This function reads from the file descriptor 'fd' until EOF and adds + * the resulting data to the attribute. The end of the attribute is + * flagged appropriately if EOA is true. + * + * @param attribute: the attribute for the data + * @param fd: the file descriptor from which to read + * @param eoa: add an EOA bit to the end? + * @returns: number of bytes read from fd, or -1 on error + */ +off_t amar_attr_add_data_fd( + amar_attr_t *attribute, + int fd, + gboolean eoa, + GError **error); + +/* When reading files, the handling of each attribute can be configured + * separately. Some attributes may always be short enough to fit in memory, + * and in this case the archive interface will take care of assembling any + * fragments for you. Some attributes should be ignored, while others + * will call a function for each fragment. + * + * There are a a number of xx_data options available here, that deserve some + * disambiguation. + * - user_data is global to the entire read operation (it is a parameter to + * amar_read) + * - file_data is specific to the current file; it is set by the start_file + * callback and freed by the finish_file callback. + * - attrid_data is specific this the current attribute ID, across all files; + * it comes from the amar_attr_handling_t struct. + * - attr_data is specific to the current instance of the particular + * attribute. It points to a NULL pointer on the first call to the fragment + * callback, and can be set at that time. It should be freed when the EOA + * argument is TRUE. + * + * @param user_data: the pointer passed to amar_read + * @param filenum: the file number for this record + * @param file_data: the file_data pointer returned from the start_file callback + * @param attrid: the attribute id for this record + * @param attrid_data: the data from the handling array + * @param attr_data (in/out): data for this attribute; this will be the same + * pointer for every callback for a particular instance of an attribute. + * Any resources should be freed when eoa is true. + * @param data: the data for this fragment + * @param size: the size of data + * @param eoa: TRUE iff this is the last fragment for this attribute + * @param truncated: TRUE if this attribute is likely to be incomplete (e.g., + * in an error situation) + * @returns: FALSE if the amar_read call should be aborted + */ +typedef gboolean (*amar_fragment_callback_t)( + gpointer user_data, + uint16_t filenum, + gpointer file_data, + uint16_t attrid, + gpointer attrid_data, + gpointer *attr_data, + gpointer data, + gsize size, + gboolean eoa, + gboolean truncated); + +/* amar_read takes an array of this struct, terminated by an entry + * with attrid 0. This final entry is used as the "catchall" for attributes + * not matching any other array entries. */ +typedef struct amar_attr_handling_s { + uint16_t attrid; + + /* if nonzero, this is the minimum size fragment that will be passed to the + * callback. Use SIZE_MAX for no limit, although this may result in + * excessive memory use while parsing a malicious or corrupt archive. */ + gsize min_size; + + /* if non-NULL, this function will be called for each fragment + * with this attribute ID */ + amar_fragment_callback_t callback; + + /* this value is passed as the attr_data parameter to the callback */ + gpointer attrid_data; +} amar_attr_handling_t; + +/* This function is called for each new file, and can decide whether to ignore + * the file, or set up file-specific data. + * + * @param user_data: the pointer passed to amar_read + * @param filenum: the file number for this record + * @param filename_buf: the filename of this file + * @param filename_len: the length of the filename + * @param ignore (output): if set to TRUE, ignore all attributes for this file. + * @param file_data (output): space to store file-specific data + * @returns: FALSE if the amar_read call should be aborted + */ +typedef gboolean (*amar_file_start_callback_t)( + gpointer user_data, + uint16_t filenum, + gpointer filename_buf, + gsize filename_len, + gboolean *ignore, + gpointer *file_data); + +/* This function is called for each new file, and can decide whether to ignore + * the file, or set up file-specific data. + * + * @param user_data: the pointer passed to amar_read + * @param filenum: the file number for this record + * @param file_data (output): space to store file-specific data + * @param truncated: TRUE if this file is likely to be incomplete (e.g., + * in an error situation, or at an early EOF) + * @returns: FALSE if the amar_read call should be aborted + */ +typedef gboolean (*amar_file_finish_callback_t)( + gpointer user_data, + uint16_t filenum, + gpointer *file_data, + gboolean truncated); + +/* This function actually performs the read operation, calling all of the + * above callbacks. If any of the callbacks return FALSE, this function + * returns FALSE but does not set its error parameter. + * + * @param user_data: passed to all callbacks + * @param handling_array: array giving handling information + * @param file_start_cb: callback for file starts + * @param file_finish_cb: callback for file finishs + * @param error (output): the error result + * @returns: FALSE on error or an early exit, otherwise TRUE + */ +gboolean amar_read( + amar_t *archive, + gpointer user_data, + amar_attr_handling_t *handling_array, + amar_file_start_callback_t file_start_cb, + amar_file_finish_callback_t file_finish_cb, + GError **error); diff --git a/amar-src/amarchiver.c b/amar-src/amarchiver.c new file mode 100644 index 0000000..2d08816 --- /dev/null +++ b/amar-src/amarchiver.c @@ -0,0 +1,359 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "getopt.h" +#include "version.h" +#include "amar.h" + +static struct option long_options[] = { + {"create" , 0, NULL, 1}, + {"extract" , 0, NULL, 2}, + {"list" , 0, NULL, 3}, + {"verbose" , 0, NULL, 4}, + {"file" , 1, NULL, 5}, + {"version" , 0, NULL, 6}, + {NULL, 0, NULL, 0} +}; + +static void +usage(void) +{ + printf("Usage: amarchiver [--version|--create|--list|--extract] [--verbose]* [--file file]\n"); + printf(" [filename]*\n"); +} + +static void +error_exit(const char *action, GError *error) +{ + const char *msg = error->message? error->message : "(unknown)"; + g_fprintf(stderr, "%s: %s\n", action, msg); + exit(1); +} + +static void +do_create(char *opt_file, int opt_verbose, int argc, char **argv) +{ + FILE *output = stdout; + amar_t *archive; + amar_file_t *file; + amar_attr_t *attribute; + GError *error = NULL; + int i, fd_out, fd_in; + off_t filesize = 0; + + if (opt_file != NULL && strcmp(opt_file,"-") != 0) { + fd_out = open(opt_file, O_CREAT|O_WRONLY|O_TRUNC, 0660); + if (fd_out <= 0) { + error("open of '%s' failed: %s\n", opt_file, strerror(errno)); + } + } else { + fd_out = fileno(stdout); + output = stderr; + } + archive = amar_new(fd_out, O_WRONLY, &error); + if (!archive) + error_exit("amar_new", error); + + i = 0; + while (i 1) { + g_fprintf(output,"%llu %s\n", (unsigned long long)filesize, argv[i]); + } + close(fd_in); + i++; + } + + if (!amar_close(archive, &error)) + error_exit("amar_close", error); + close(fd_out); +} + +struct read_user_data { + gboolean verbose; + char **argv; + int argc; +}; + +static gboolean +extract_file_start_cb( + gpointer user_data, + uint16_t filenum G_GNUC_UNUSED, + gpointer filename_buf, + gsize filename_len, + gboolean *ignore G_GNUC_UNUSED, + gpointer *file_data) +{ + struct read_user_data *ud = user_data; + int i; + + /* keep the filename for later */ + *file_data = g_strndup(filename_buf, filename_len); + + if (ud->argc) { + *ignore = TRUE; + for (i = 0; i < ud->argc; i++) { + if (strlen(ud->argv[i]) == filename_len + && 0 == strcmp(ud->argv[i], *file_data)) + *ignore = FALSE; + } + } + + return TRUE; +} + +static gboolean +extract_file_finish_cb( + gpointer user_data G_GNUC_UNUSED, + uint16_t filenum G_GNUC_UNUSED, + gpointer *file_data, + gboolean truncated) +{ + if (truncated) + g_fprintf(stderr, _("Data for '%s' may have been truncated\n"), + (char *)*file_data); + + g_free(*file_data); + + return TRUE; +} + +static gboolean +extract_frag_cb( + gpointer user_data G_GNUC_UNUSED, + uint16_t filenum G_GNUC_UNUSED, + gpointer file_data, + uint16_t attrid, + gpointer attrid_data G_GNUC_UNUSED, + gpointer *attr_data, + gpointer data, + gsize datasize, + gboolean eoa, + gboolean truncated) +{ + struct read_user_data *ud = user_data; + int fd = GPOINTER_TO_INT(*attr_data); + + if (!fd) { + char *filename = g_strdup_printf("%s.%d", (char *)file_data, attrid); + fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0660); + if (fd < 0) { + g_fprintf(stderr, _("Could not open '%s' for writing: %s"), + filename, strerror(errno)); + } + if (ud->verbose) + g_fprintf(stderr, "%s\n", filename); + g_free(filename); + *attr_data = GINT_TO_POINTER(fd); + } + + if (full_write(fd, data, datasize) != datasize) { + g_fprintf(stderr, _("while writing '%s.%d': %s"), + (char *)file_data, attrid, strerror(errno)); + return FALSE; + } + + if (eoa) { + if (truncated) { + g_fprintf(stderr, _("'%s.%d' may be truncated\n"), + (char *)file_data, attrid); + } + close(fd); + } + + return TRUE; +} + +static void +do_extract( + char *opt_file, + int opt_verbose, + int argc, + char **argv) +{ + amar_t *archive; + GError *error = NULL; + int fd_in; + amar_attr_handling_t handling[] = { + { 0, 0, extract_frag_cb, NULL }, + }; + struct read_user_data ud; + + ud.argv = argv; + ud.argc = argc; + ud.verbose = opt_verbose; + + if (opt_file && strcmp(opt_file,"-") != 0) { + fd_in = open(opt_file, O_RDONLY); + if (fd_in <= 0) { + error("open of '%s' failed: %s\n", opt_file, strerror(errno)); + } + } else { + fd_in = fileno(stdin); + } + + archive = amar_new(fd_in, O_RDONLY, &error); + if (!archive) + error_exit("amar_new", error); + + if (!amar_read(archive, &ud, handling, extract_file_start_cb, + extract_file_finish_cb, &error)) { + if (error) + error_exit("amar_read", error); + else + /* one of the callbacks already printed an error message */ + exit(1); + } +} + +static gboolean +list_file_start_cb( + gpointer user_data G_GNUC_UNUSED, + uint16_t filenum G_GNUC_UNUSED, + gpointer filename_buf, + gsize filename_len, + gboolean *ignore, + gpointer *file_data G_GNUC_UNUSED) +{ + g_printf("%.*s\n", (int)filename_len, (char *)filename_buf); + *ignore = TRUE; + + return TRUE; +} +static void +do_list( + char *opt_file, + int opt_verbose G_GNUC_UNUSED) +{ + amar_t *archive; + GError *error = NULL; + int fd_in; + amar_attr_handling_t handling[] = { + { 0, 0, NULL, NULL }, + }; + + if (opt_file && strcmp(opt_file,"-") != 0) { + fd_in = open(opt_file, O_RDONLY); + if (fd_in <= 0) { + error("open of '%s' failed: %s\n", opt_file, strerror(errno)); + } + } else { + fd_in = fileno(stdin); + } + + archive = amar_new(fd_in, O_RDONLY, &error); + if (!archive) + error_exit("amar_new", error); + + if (!amar_read(archive, NULL, handling, list_file_start_cb, + NULL, &error)) { + if (error) + error_exit("amar_read", error); + else + /* one of the callbacks already printed an error message */ + exit(1); + } +} + +int main( + int argc, + char **argv) +{ + int opt_create = 0; + int opt_extract = 0; + int opt_list = 0; + int opt_verbose = 0; + char *opt_file = NULL; + + while(1) { + int option_index = 0; + int c = getopt_long (argc, argv, "", long_options, &option_index); + if (c == -1) { + break; + } + switch (c) { + case 1: opt_create = 1; + break; + case 2: opt_extract = 1; + break; + case 3: opt_list = 1; + break; + case 4: opt_verbose += 1; + break; + case 5: opt_file = stralloc(optarg); + break; + case 6: printf("amarchiver %s\n", version()); + exit(0); + break; + } + } + argc -= optind; + argv += optind; + + /* check those arguments */ + if (opt_create + opt_extract + opt_list == 0) { + g_fprintf(stderr,"--create, --list or --extract must be provided\n"); + usage(); + } + if (opt_create + opt_extract + opt_list > 1) { + g_fprintf(stderr,"Only one of --create, --list or --extract must be provided\n"); + usage(); + } + if (opt_list > 1) { + if (argc) { + g_fprintf(stderr, "--list does not take any additional filenames\n"); + usage(); + } + } + + if (opt_create > 0) + do_create(opt_file, opt_verbose, argc, argv); + else if (opt_extract > 0) + do_extract(opt_file, opt_verbose, argc, argv); + else if (opt_list > 0) + do_list(opt_file, opt_verbose); + + return 0; +} diff --git a/amplot/Makefile.in b/amplot/Makefile.in index f2e6b09..7824ef5 100644 --- a/amplot/Makefile.in +++ b/amplot/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ # Makefile for amplot. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -32,14 +32,14 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -54,8 +54,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -66,7 +66,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -76,12 +80,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -125,7 +132,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -135,7 +142,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -164,10 +179,12 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = amplot ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -201,6 +218,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -223,7 +241,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -251,7 +271,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -262,7 +281,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -292,6 +310,7 @@ amplotDATA_INSTALL = $(INSTALL_DATA) DATA = $(amplot_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -306,8 +325,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -319,16 +340,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -342,6 +375,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -349,7 +383,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -362,6 +396,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -372,9 +407,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -384,6 +422,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -408,8 +447,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -418,11 +459,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -436,6 +481,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -444,9 +490,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -454,7 +501,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -463,8 +512,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -472,7 +523,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -481,10 +531,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -500,6 +552,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -516,6 +570,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -524,7 +580,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -560,26 +615,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -587,7 +653,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -597,6 +667,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -606,7 +677,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -615,6 +693,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -643,6 +722,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -661,6 +741,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -690,6 +772,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = @@ -702,7 +785,7 @@ CLEANFILES = config.log amplot.gp.new # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ - amplot.gp + $(SCRIPTS_INCLUDE) $(am__append_1) amplot.gp MAINTAINERCLEANFILES = # syntax-check shell scripts on 'make check' @@ -711,6 +794,25 @@ CHECK_SHELL = $(SCRIPTS_SHELL) # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" SCRIPTS_SHELL = amplot SCRIPTS_AWK = amcat.awk sbin_SCRIPTS = $(SCRIPTS_SHELL) @@ -871,8 +973,6 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am @@ -911,7 +1011,7 @@ install-pdf: install-pdf-am install-ps: install-ps-am -installcheck-am: +installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -f Makefile @@ -942,16 +1042,21 @@ uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am uninstall uninstall-am uninstall-amplotDATA \ - uninstall-sbinSCRIPTS + installcheck-local installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-amplotDATA uninstall-sbinSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -977,13 +1082,27 @@ uninstall-am: uninstall-amplotDATA uninstall-sbinSCRIPTS # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl check-shell: $(CHECK_SHELL) @CHECK_SHELL="$(CHECK_SHELL)"; \ if test -n "$$CHECK_SHELL"; then \ @@ -1021,52 +1140,40 @@ dist-scripts: true dist-hook: dist-scripts -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange diff --git a/application-src/Makefile.am b/application-src/Makefile.am new file mode 100644 index 0000000..ef88154 --- /dev/null +++ b/application-src/Makefile.am @@ -0,0 +1,62 @@ +# Makefile for Amanda wrapper programs. + +include $(top_srcdir)/config/automake/vars.am +include $(top_srcdir)/config/automake/scripts.am +include $(top_srcdir)/config/automake/installperms.am +include $(top_srcdir)/config/automake/precompile.am + +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/client-src \ + -I$(top_srcdir)/amandad-src \ + -I$(top_srcdir)/gnulib + +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) + +LIB_EXTENSION = la + +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) + +CHECK_PERL = amgtar_perl \ + script-email \ + amlog-script \ + amzfs-sendrecv \ + amzfs-snapshot \ + amsamba + +SCRIPTS_PERL = $(CHECK_PERL) + +SCRIPTS_SHELL = $(amlibexec_SCRIPTS) + +amlibexec_PROGRAMS = teecount + +#We use two variables, applicationdir applicationexecdir, to segregate the +#platform-independent (applicationdir) files installed by install-data from the +#platform-dependent files (applicationexecdir) installed by install-exec. +#Automake recognizes the 'exec' substring in the variable name. From the +#Automake manual: "Any variable using a user-defined directory prefix with +#‘exec’ in the name (e.g., myexecbin_PROGRAMS) is installed by install-exec. +#All other user-defined prefixes are installed by install-data." (section 12.2) +applicationexecdir = $(APPLICATION_DIR) +applicationdir = $(APPLICATION_DIR) +applicationexec_PROGRAMS = amgtar amstar +applicationexec_SCRIPTS = $(SCRIPTS_PERL) + +LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ + ../client-src/libamclient.$(LIB_EXTENSION) \ + ../amandad-src/libamandad.$(LIB_EXTENSION) \ + ../common-src/libamanda.$(LIB_EXTENSION) \ + ../gnulib/libgnu.$(LIB_EXTENSION) + +INSTALLPERMS_exec = dest=$(amlibexecdir) chown=amanda $(amlibexec_PROGRAMS) \ + dest=$(applicationdir) chown=amanda $(applicationexec_PROGRAMS) \ + dest=$(applicationdir) chown=amanda $(applicationexec_SCRIPTS) + +INSTALLPERMS_data = dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) + +if WANT_SETUID_CLIENT +INSTALLPERMS_exec += dest=$(applicationdir) chown=root chmod=04750 \ + amgtar amstar +endif diff --git a/application-src/Makefile.in b/application-src/Makefile.in new file mode 100644 index 0000000..c83ca6f --- /dev/null +++ b/application-src/Makefile.in @@ -0,0 +1,1395 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile for Amanda wrapper programs. + +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# SYNOPSIS: +# +# Automake magic to handle the various tasks of building scripts. Scripts can +# be built down to extensionless executables (e.g., foo.pl -> foo), or to +# files with the usual extension (foo-lib.sh.in -> foo.sh). +# +# Files which support it are syntax-checked when the user invokes 'make check'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. +# +# USAGE: +# +# include $(top_srcdir)/config/automake/vars.am +# include $(top_srcdir)/config/automake/scripts.am +# ... +# SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm +# SCRIPTS_SHELL = shell1 shell2 sh-lib.sh +# SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl +# +# with the corresponding files in the repository: +# +# fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in +# shell1.sh shell2.sh sh-lib.sh.in +# talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# To add extra flags to the perl checks (e.g., to add new -I flags), set +# CHECK_PERL_FLAGS. + +# Implementation note: +# +# This file uses config.status to substitute @foo@ in those scripts while +# converting them. It also adds the executable bits (a+x) to extensionless +# files. The substitution works even though the files are not listed in +# configure.in + +# vim:ft=automake +# +# Adjust post-install permissions settings. This rule works off two +# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. +# Each is a whitespace-separated list of commands, all of which are either +# a variable assignment or a filename. Three variables are available: +# +# - dest= sets the destination directory to e.g., $(sbindir) +# - chown= controls changes in ownership; value is first argument to chown +# - chmod= controls changes in permissions; value is first argument to chmod +# +# As a special case, chown=amanda is taken as equivalent to +# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with +# whitespace in the user/group names. +# +# when a filename is seen, the currently active variables are applied. +# +# Note that scripts are data, not executables! +# +# EXAMPLE +# +# sbin_PROGRAMS = foo bar bing +# libexec_PROGRAMS = pro gram +# sbin_SCRIPTS = sk ript +# INSTALLPERMS_exec = \ +# dest=$(sbindir) chown=amanda chmod= \ +# foo bar \ +# chmod=07450 \ +# bing +# dest=$(libexecdir) chmod= \ +# $(libexec_PROGRAMS) +# INSTALLPERMS_data = \ +# dest=$(sbindir) chown=amanda chmod= \ +# $(sbin_SCRIPTS) +# +# This whole operation is not required when making builds for packaging, +# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. + +# vim:ft=automake + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/config/automake/installperms.am \ + $(top_srcdir)/config/automake/precompile.am \ + $(top_srcdir)/config/automake/scripts.am \ + $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) +amlibexec_PROGRAMS = teecount$(EXEEXT) +applicationexec_PROGRAMS = amgtar$(EXEEXT) amstar$(EXEEXT) +@WANT_SETUID_CLIENT_TRUE@am__append_2 = dest=$(applicationdir) chown=root chmod=04750 \ +@WANT_SETUID_CLIENT_TRUE@ amgtar amstar + +subdir = application-src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = \ + $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ + $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ + $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ + $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ + $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ + $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ + $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ + $(top_srcdir)/config/macro-archive/xsltproc.m4 \ + $(top_srcdir)/config/amanda/amplot.m4 \ + $(top_srcdir)/config/amanda/bsd-security.m4 \ + $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ + $(top_srcdir)/config/amanda/bsdudp-security.m4 \ + $(top_srcdir)/config/amanda/changer.m4 \ + $(top_srcdir)/config/amanda/components.m4 \ + $(top_srcdir)/config/amanda/compress.m4 \ + $(top_srcdir)/config/amanda/config.m4 \ + $(top_srcdir)/config/amanda/debugging.m4 \ + $(top_srcdir)/config/amanda/defaults.m4 \ + $(top_srcdir)/config/amanda/devprefix.m4 \ + $(top_srcdir)/config/amanda/dirs.m4 \ + $(top_srcdir)/config/amanda/documentation.m4 \ + $(top_srcdir)/config/amanda/dumpers.m4 \ + $(top_srcdir)/config/amanda/flags.m4 \ + $(top_srcdir)/config/amanda/flock.m4 \ + $(top_srcdir)/config/amanda/funcs.m4 \ + $(top_srcdir)/config/amanda/getfsent.m4 \ + $(top_srcdir)/config/amanda/i18n.m4 \ + $(top_srcdir)/config/amanda/ipv6.m4 \ + $(top_srcdir)/config/amanda/krb4-security.m4 \ + $(top_srcdir)/config/amanda/krb5-security.m4 \ + $(top_srcdir)/config/amanda/lfs.m4 \ + $(top_srcdir)/config/amanda/libs.m4 \ + $(top_srcdir)/config/amanda/net.m4 \ + $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ + $(top_srcdir)/config/amanda/readdir.m4 \ + $(top_srcdir)/config/amanda/readline.m4 \ + $(top_srcdir)/config/amanda/rsh-security.m4 \ + $(top_srcdir)/config/amanda/s3-device.m4 \ + $(top_srcdir)/config/amanda/shmem.m4 \ + $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ + $(top_srcdir)/config/amanda/ssh-security.m4 \ + $(top_srcdir)/config/amanda/summary.m4 \ + $(top_srcdir)/config/amanda/swig.m4 \ + $(top_srcdir)/config/amanda/syshacks.m4 \ + $(top_srcdir)/config/amanda/tape.m4 \ + $(top_srcdir)/config/amanda/types.m4 \ + $(top_srcdir)/config/amanda/userid.m4 \ + $(top_srcdir)/config/amanda/version.m4 \ + $(top_srcdir)/config/gnulib/alloca.m4 \ + $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ + $(top_srcdir)/config/gnulib/base64.m4 \ + $(top_srcdir)/config/gnulib/eoverflow.m4 \ + $(top_srcdir)/config/gnulib/extensions.m4 \ + $(top_srcdir)/config/gnulib/float_h.m4 \ + $(top_srcdir)/config/gnulib/fsusage.m4 \ + $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ + $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ + $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ + $(top_srcdir)/config/gnulib/include_next.m4 \ + $(top_srcdir)/config/gnulib/inet_ntop.m4 \ + $(top_srcdir)/config/gnulib/intmax_t.m4 \ + $(top_srcdir)/config/gnulib/lock.m4 \ + $(top_srcdir)/config/gnulib/longlong.m4 \ + $(top_srcdir)/config/gnulib/malloc.m4 \ + $(top_srcdir)/config/gnulib/mkdtemp.m4 \ + $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ + $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ + $(top_srcdir)/config/gnulib/physmem.m4 \ + $(top_srcdir)/config/gnulib/safe-read.m4 \ + $(top_srcdir)/config/gnulib/safe-write.m4 \ + $(top_srcdir)/config/gnulib/snprintf.m4 \ + $(top_srcdir)/config/gnulib/socklen.m4 \ + $(top_srcdir)/config/gnulib/sockpfaf.m4 \ + $(top_srcdir)/config/gnulib/ssize_t.m4 \ + $(top_srcdir)/config/gnulib/stdbool.m4 \ + $(top_srcdir)/config/gnulib/stdint.m4 \ + $(top_srcdir)/config/gnulib/stdio_h.m4 \ + $(top_srcdir)/config/gnulib/stdlib_h.m4 \ + $(top_srcdir)/config/gnulib/strdup.m4 \ + $(top_srcdir)/config/gnulib/string_h.m4 \ + $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ + $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ + $(top_srcdir)/config/gnulib/sys_time_h.m4 \ + $(top_srcdir)/config/gnulib/tempname.m4 \ + $(top_srcdir)/config/gnulib/unistd_h.m4 \ + $(top_srcdir)/config/gnulib/vasnprintf.m4 \ + $(top_srcdir)/config/gnulib/visibility.m4 \ + $(top_srcdir)/config/gnulib/wchar.m4 \ + $(top_srcdir)/config/gettext-macros/gettext.m4 \ + $(top_srcdir)/config/gettext-macros/iconv.m4 \ + $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ + $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ + $(top_srcdir)/config/gettext-macros/lib-link.m4 \ + $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ + $(top_srcdir)/config/gettext-macros/nls.m4 \ + $(top_srcdir)/config/gettext-macros/po.m4 \ + $(top_srcdir)/config/gettext-macros/progtest.m4 \ + $(top_srcdir)/config/gettext-macros/size_max.m4 \ + $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ + $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ + $(top_srcdir)/config/gettext-macros/wint_t.m4 \ + $(top_srcdir)/config/gettext-macros/xsize.m4 \ + $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(amlibexecdir)" \ + "$(DESTDIR)$(applicationexecdir)" \ + "$(DESTDIR)$(applicationexecdir)" +amlibexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +applicationexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(amlibexec_PROGRAMS) $(applicationexec_PROGRAMS) +amgtar_SOURCES = amgtar.c +amgtar_OBJECTS = amgtar.$(OBJEXT) +amgtar_LDADD = $(LDADD) +amgtar_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ + ../client-src/libamclient.$(LIB_EXTENSION) \ + ../amandad-src/libamandad.$(LIB_EXTENSION) \ + ../common-src/libamanda.$(LIB_EXTENSION) \ + ../gnulib/libgnu.$(LIB_EXTENSION) +amstar_SOURCES = amstar.c +amstar_OBJECTS = amstar.$(OBJEXT) +amstar_LDADD = $(LDADD) +amstar_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ + ../client-src/libamclient.$(LIB_EXTENSION) \ + ../amandad-src/libamandad.$(LIB_EXTENSION) \ + ../common-src/libamanda.$(LIB_EXTENSION) \ + ../gnulib/libgnu.$(LIB_EXTENSION) +teecount_SOURCES = teecount.c +teecount_OBJECTS = teecount.$(OBJEXT) +teecount_LDADD = $(LDADD) +teecount_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ + ../client-src/libamclient.$(LIB_EXTENSION) \ + ../amandad-src/libamandad.$(LIB_EXTENSION) \ + ../common-src/libamanda.$(LIB_EXTENSION) \ + ../gnulib/libgnu.$(LIB_EXTENSION) +applicationexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(applicationexec_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = amgtar.c amstar.c teecount.c +DIST_SOURCES = amgtar.c amstar.c teecount.c +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMANDA_DBGDIR = @AMANDA_DBGDIR@ +AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ +AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ +AMANDA_TMPDIR = @AMANDA_TMPDIR@ +AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ +AMLINT = @AMLINT@ +AMLINTFLAGS = @AMLINTFLAGS@ +AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ +AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ +AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ +AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ +AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ +AR = @AR@ +ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASH = @BASH@ +BINARY_OWNER = @BINARY_OWNER@ +BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ +BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ +BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ +BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ +BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ +CAT = @CAT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ +CHIO = @CHIO@ +CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ +CLIENT_LOGIN = @CLIENT_LOGIN@ +CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ +COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ +CONFIG_DIR = @CONFIG_DIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DD = @DD@ +DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ +DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ +DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ +DEFAULT_SERVER = @DEFAULT_SERVER@ +DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ +DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOC_BUILD_DATE = @DOC_BUILD_DATE@ +DUMP = @DUMP@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EOVERFLOW = @EOVERFLOW@ +EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FLOAT_H = @FLOAT_H@ +GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ +GETTEXT = @GETTEXT@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ +GNULIB_CHOWN = @GNULIB_CHOWN@ +GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ +GNULIB_FCHDIR = @GNULIB_FCHDIR@ +GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ +GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ +GNULIB_FSEEK = @GNULIB_FSEEK@ +GNULIB_FSEEKO = @GNULIB_FSEEKO@ +GNULIB_FTELL = @GNULIB_FTELL@ +GNULIB_FTELLO = @GNULIB_FTELLO@ +GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ +GNULIB_GETCWD = @GNULIB_GETCWD@ +GNULIB_GETDELIM = @GNULIB_GETDELIM@ +GNULIB_GETLINE = @GNULIB_GETLINE@ +GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ +GNULIB_LCHOWN = @GNULIB_LCHOWN@ +GNULIB_LSEEK = @GNULIB_LSEEK@ +GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ +GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ +GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ +GNULIB_MBSCHR = @GNULIB_MBSCHR@ +GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ +GNULIB_MBSLEN = @GNULIB_MBSLEN@ +GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ +GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ +GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ +GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ +GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ +GNULIB_MBSSEP = @GNULIB_MBSSEP@ +GNULIB_MBSSPN = @GNULIB_MBSSPN@ +GNULIB_MBSSTR = @GNULIB_MBSSTR@ +GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ +GNULIB_MEMMEM = @GNULIB_MEMMEM@ +GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ +GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ +GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ +GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ +GNULIB_READLINK = @GNULIB_READLINK@ +GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ +GNULIB_SLEEP = @GNULIB_SLEEP@ +GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ +GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ +GNULIB_STPCPY = @GNULIB_STPCPY@ +GNULIB_STPNCPY = @GNULIB_STPNCPY@ +GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ +GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ +GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRNDUP = @GNULIB_STRNDUP@ +GNULIB_STRNLEN = @GNULIB_STRNLEN@ +GNULIB_STRPBRK = @GNULIB_STRPBRK@ +GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ +GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ +GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ +GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ +GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ +GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ +GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ +GNUPLOT = @GNUPLOT@ +GNUTAR = @GNUTAR@ +GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GZIP = @GZIP@ +HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ +HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ +HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ +HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ +HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ +HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ +HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ +HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ +HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ +HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ +HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ +HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ +HAVE_DUP2 = @HAVE_DUP2@ +HAVE_FSEEKO = @HAVE_FSEEKO@ +HAVE_FTELLO = @HAVE_FTELLO@ +HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ +HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ +HAVE_IO_H = @HAVE_IO_H@ +HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ +HAVE_LSTAT = @HAVE_LSTAT@ +HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ +HAVE_MEMPCPY = @HAVE_MEMPCPY@ +HAVE_MKDTEMP = @HAVE_MKDTEMP@ +HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ +HAVE_READLINK = @HAVE_READLINK@ +HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ +HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ +HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ +HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ +HAVE_SLEEP = @HAVE_SLEEP@ +HAVE_STDINT_H = @HAVE_STDINT_H@ +HAVE_STPCPY = @HAVE_STPCPY@ +HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASESTR = @HAVE_STRCASESTR@ +HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRNDUP = @HAVE_STRNDUP@ +HAVE_STRPBRK = @HAVE_STRPBRK@ +HAVE_STRSEP = @HAVE_STRSEP@ +HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ +HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ +HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ +HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ +HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ +HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ +HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ +HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ +HAVE_VASPRINTF = @HAVE_VASPRINTF@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ +HAVE_WCHAR_H = @HAVE_WCHAR_H@ +HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ +HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ +HAVE__BOOL = @HAVE__BOOL@ +INCLUDE_NEXT = @INCLUDE_NEXT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL = @LIBCURL@ +LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ +LIBOBJS = @LIBOBJS@ +LIBPTH = @LIBPTH@ +LIBS = @LIBS@ +LIBTHREAD = @LIBTHREAD@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ +LTLIBOBJS = @LTLIBOBJS@ +LTLIBPTH = @LTLIBPTH@ +LTLIBTHREAD = @LTLIBTHREAD@ +MAILER = @MAILER@ +MAKEINFO = @MAKEINFO@ +MCUTIL = @MCUTIL@ +MKDIR_P = @MKDIR_P@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +MT = @MT@ +MTX = @MTX@ +MT_FILE_FLAG = @MT_FILE_FLAG@ +NETINET_IN_H = @NETINET_IN_H@ +NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ +NEXT_STDINT_H = @NEXT_STDINT_H@ +NEXT_STDIO_H = @NEXT_STDIO_H@ +NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRING_H = @NEXT_STRING_H@ +NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ +NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ +NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ +NEXT_UNISTD_H = @NEXT_UNISTD_H@ +NEXT_WCHAR_H = @NEXT_WCHAR_H@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCAT = @PCAT@ +PERL = @PERL@ +PERLEXTLIBS = @PERLEXTLIBS@ +PERL_INC = @PERL_INC@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ +PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +REPLACE_CHOWN = @REPLACE_CHOWN@ +REPLACE_FCHDIR = @REPLACE_FCHDIR@ +REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ +REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ +REPLACE_FSEEK = @REPLACE_FSEEK@ +REPLACE_FSEEKO = @REPLACE_FSEEKO@ +REPLACE_FTELL = @REPLACE_FTELL@ +REPLACE_FTELLO = @REPLACE_FTELLO@ +REPLACE_GETCWD = @REPLACE_GETCWD@ +REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ +REPLACE_LCHOWN = @REPLACE_LCHOWN@ +REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ +REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ +REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ +REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ +REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ +REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ +REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ +REPLACE_VPRINTF = @REPLACE_VPRINTF@ +REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ +REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ +REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ +RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ +SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ +SERVICE_SUFFIX = @SERVICE_SUFFIX@ +SETUID_GROUP = @SETUID_GROUP@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ +SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ +SORT = @SORT@ +SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ +STDBOOL_H = @STDBOOL_H@ +STDINT_H = @STDINT_H@ +STRIP = @STRIP@ +SVN = @SVN@ +SWIG = @SWIG@ +SWIG_LIB = @SWIG_LIB@ +SYS_SOCKET_H = @SYS_SOCKET_H@ +SYS_STAT_H = @SYS_STAT_H@ +SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ +USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ +USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ +VDUMP = @VDUMP@ +VERSION = @VERSION@ +VERSION_COMMENT = @VERSION_COMMENT@ +VERSION_MAJOR = @VERSION_MAJOR@ +VERSION_MINOR = @VERSION_MINOR@ +VERSION_PATCH = @VERSION_PATCH@ +VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ +VRESTORE = @VRESTORE@ +VXDUMP = @VXDUMP@ +VXRESTORE = @VXRESTORE@ +WCHAR_H = @WCHAR_H@ +WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ +WINT_T_SUFFIX = @WINT_T_SUFFIX@ +XFSDUMP = @XFSDUMP@ +XFSRESTORE = @XFSRESTORE@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XSLREL = @XSLREL@ +XSLTPROC = @XSLTPROC@ +XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +_libcurl_config = @_libcurl_config@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +amdatadir = @amdatadir@ +amincludedir = @amincludedir@ +amlibdir = @amlibdir@ +amlibexecdir = @amlibexecdir@ +amperldir = @amperldir@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gl_LIBOBJS = @gl_LIBOBJS@ +gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = +BUILT_SOURCES = +MOSTLYCLEANFILES = + +# config.status leaves config.log files around +CLEANFILES = config.log + +# and we'll need to clean up our generated files for distclean +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) $(am__append_1) +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) + +# sed expression to strip leading directories from a filename; this converts e.g., +# src/foo/bar.so to bar.so. +strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" +INCLUDES = -I$(top_builddir)/common-src \ + -I$(top_srcdir)/common-src \ + -I$(top_srcdir)/client-src \ + -I$(top_srcdir)/amandad-src \ + -I$(top_srcdir)/gnulib + +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) +LIB_EXTENSION = la +AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) +AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +CHECK_PERL = amgtar_perl \ + script-email \ + amlog-script \ + amzfs-sendrecv \ + amzfs-snapshot \ + amsamba + +SCRIPTS_PERL = $(CHECK_PERL) +SCRIPTS_SHELL = $(amlibexec_SCRIPTS) + +#We use two variables, applicationdir applicationexecdir, to segregate the +#platform-independent (applicationdir) files installed by install-data from the +#platform-dependent files (applicationexecdir) installed by install-exec. +#Automake recognizes the 'exec' substring in the variable name. From the +#Automake manual: "Any variable using a user-defined directory prefix with +#‘exec’ in the name (e.g., myexecbin_PROGRAMS) is installed by install-exec. +#All other user-defined prefixes are installed by install-data." (section 12.2) +applicationexecdir = $(APPLICATION_DIR) +applicationdir = $(APPLICATION_DIR) +applicationexec_SCRIPTS = $(SCRIPTS_PERL) +LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ + ../client-src/libamclient.$(LIB_EXTENSION) \ + ../amandad-src/libamandad.$(LIB_EXTENSION) \ + ../common-src/libamanda.$(LIB_EXTENSION) \ + ../gnulib/libgnu.$(LIB_EXTENSION) + +INSTALLPERMS_exec = dest=$(amlibexecdir) chown=amanda \ + $(amlibexec_PROGRAMS) dest=$(applicationdir) chown=amanda \ + $(applicationexec_PROGRAMS) dest=$(applicationdir) \ + chown=amanda $(applicationexec_SCRIPTS) $(am__append_2) +INSTALLPERMS_data = dest=$(amlibexecdir) chown=amanda $(amlibexec_SCRIPTS) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu application-src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu application-src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-amlibexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(amlibexecdir)/$$f"; \ + done + +clean-amlibexecPROGRAMS: + @list='$(amlibexec_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +install-applicationexecPROGRAMS: $(applicationexec_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(applicationexecdir)" || $(MKDIR_P) "$(DESTDIR)$(applicationexecdir)" + @list='$(applicationexec_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(applicationexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(applicationexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(applicationexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(applicationexecdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-applicationexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(applicationexec_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(applicationexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(applicationexecdir)/$$f"; \ + done + +clean-applicationexecPROGRAMS: + @list='$(applicationexec_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +amgtar$(EXEEXT): $(amgtar_OBJECTS) $(amgtar_DEPENDENCIES) + @rm -f amgtar$(EXEEXT) + $(LINK) $(amgtar_OBJECTS) $(amgtar_LDADD) $(LIBS) +amstar$(EXEEXT): $(amstar_OBJECTS) $(amstar_DEPENDENCIES) + @rm -f amstar$(EXEEXT) + $(LINK) $(amstar_OBJECTS) $(amstar_LDADD) $(LIBS) +teecount$(EXEEXT): $(teecount_OBJECTS) $(teecount_DEPENDENCIES) + @rm -f teecount$(EXEEXT) + $(LINK) $(teecount_OBJECTS) $(teecount_LDADD) $(LIBS) +install-applicationexecSCRIPTS: $(applicationexec_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(applicationexecdir)" || $(MKDIR_P) "$(DESTDIR)$(applicationexecdir)" + @list='$(applicationexec_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(applicationexecSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(applicationexecdir)/$$f'"; \ + $(applicationexecSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(applicationexecdir)/$$f"; \ + else :; fi; \ + done + +uninstall-applicationexecSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(applicationexec_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(applicationexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(applicationexecdir)/$$f"; \ + done + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amgtar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amstar.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/teecount.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(applicationexecdir)" "$(DESTDIR)$(applicationexecdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-amlibexecPROGRAMS clean-applicationexecPROGRAMS \ + clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook + +install-dvi: install-dvi-am + +install-exec-am: install-amlibexecPROGRAMS \ + install-applicationexecPROGRAMS install-applicationexecSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: installcheck-local + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-amlibexecPROGRAMS \ + uninstall-applicationexecPROGRAMS \ + uninstall-applicationexecSCRIPTS + +.MAKE: install-am install-data-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-amlibexecPROGRAMS clean-applicationexecPROGRAMS \ + clean-generic clean-libtool ctags dist-hook distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-amlibexecPROGRAMS \ + install-applicationexecPROGRAMS install-applicationexecSCRIPTS \ + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installcheck-local installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-amlibexecPROGRAMS \ + uninstall-applicationexecPROGRAMS \ + uninstall-applicationexecSCRIPTS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi + +%.pl: %.pl.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +%.pm: %.pm.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Shell +%: %.sh $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.sh: %.sh.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Awk +%: %.awk $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.awk: %.awk.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# syntax-check perl scripts on 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +installcheck-local: installcheck-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_SHELL; do \ + if $(BASH) -n $$shobj; then \ + echo "$$shobj syntax OK"; \ + else \ + echo "$$shobj syntax error"; \ + exit 1; \ + fi; \ + done; \ + else \ + echo "No 'bash' available -- cannot syntax-check shell scripts"; \ + fi; \ + fi +check-local: check-shell + +# make sure that the sources for all shell and perl scripts get included +# in the distribution +dist-scripts: + SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts + +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" + +# A rule to make precompiler output from C files. This is not used during +# ordinary builds, but but can very useful in debugging problems on strange +# architectures. With this rule, we can ask users to 'make foo.i' and send +# the result to us. +# +# It touches some automake internals ($COMPILE), but since it's not +# build-critical, that's OK. +%.i : %.c + $(COMPILE) -E -o $@ $< +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/application-src/amgtar.c b/application-src/amgtar.c new file mode 100644 index 0000000..c3e5966 --- /dev/null +++ b/application-src/amgtar.c @@ -0,0 +1,1214 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ +/* + * $Id: amgtar.c 8888 2007-10-02 13:40:42Z martineau $ + * + * send estimated backup sizes using dump + */ + +/* PROPERTY: + * + * GNUTAR-PATH (default GNUTAR) + * GNUTAR-LISTDIR (default CNF_GNUTAR_LIST_DIR) + * DIRECTORY (no default, if set, the backup will be from that directory + * instead of from the --device) + * ONE-FILE-SYSTEM (default YES) + * SPARSE (default YES) + * ATIME-PRESERVE (default YES) + * CHECK-DEVICE (default YES) + * INCLUDE-FILE + * INCLUDE-LIST + * INCLUDE-OPTIONAL + * EXCLUDE-FILE + * EXCLUDE-LIST + * EXCLUDE-OPTIONAL + * NORMAL + * IGNORE + * STRANGE + * EXIT-HANDLING (1=GOOD 2=BAD) + * TAR-BLOCKSIZE (default does not add --blocking-factor option, + * using tar's default) + */ + +#include "amanda.h" +#include "pipespawn.h" +#include "amfeatures.h" +#include "clock.h" +#include "util.h" +#include "getfsent.h" +#include "version.h" +#include "client_util.h" +#include "conffile.h" +#include "amandad.h" +#include "getopt.h" +#include "sendbackup.h" + +int debug_application = 1; +#define application_debug(i, ...) do { \ + if ((i) <= debug_application) { \ + dbprintf(__VA_ARGS__); \ + } \ +} while (0) + +static amregex_t init_re_table[] = { + /* tar prints the size in bytes */ + AM_SIZE_RE("^ *Total bytes written: [0-9][0-9]*", 1, 1), + AM_NORMAL_RE("^could not open conf file"), + AM_NORMAL_RE("^Elapsed time:"), + AM_NORMAL_RE("^Throughput"), + AM_IGNORE_RE(": Directory is new$"), + AM_IGNORE_RE(": Directory has been renamed"), + + /* GNU tar 1.13.17 will print this warning when (not) backing up a + Unix named socket. */ + AM_NORMAL_RE(": socket ignored$"), + + /* GNUTAR produces a few error messages when files are modified or + removed while it is running. They may cause data to be lost, but + then they may not. We shouldn't consider them NORMAL until + further investigation. */ + AM_NORMAL_RE(": File .* shrunk by [0-9][0-9]* bytes, padding with zeros"), + AM_NORMAL_RE(": Cannot add file .*: No such file or directory$"), + AM_NORMAL_RE(": Error exit delayed from previous errors"), + + /* catch-all: DMP_STRANGE is returned for all other lines */ + AM_STRANGE_RE(NULL) +}; +static amregex_t *re_table; + +/* local functions */ +int main(int argc, char **argv); + +typedef struct application_argument_s { + char *config; + char *host; + int message; + int collection; + int calcsize; + char *tar_blocksize; + GSList *level; + dle_t dle; + int argc; + char **argv; +} application_argument_t; + +enum { CMD_ESTIMATE, CMD_BACKUP }; + +static void amgtar_support(application_argument_t *argument); +static void amgtar_selfcheck(application_argument_t *argument); +static void amgtar_estimate(application_argument_t *argument); +static void amgtar_backup(application_argument_t *argument); +static void amgtar_restore(application_argument_t *argument); +static void amgtar_validate(application_argument_t *argument); +static void amgtar_build_exinclude(dle_t *dle, int verbose, + int *nb_exclude, char **file_exclude, + int *nb_include, char **file_include); +static char *amgtar_get_incrname(application_argument_t *argument, int level); +static char **amgtar_build_argv(application_argument_t *argument, + char *incrname, int command); +static amregex_t *build_re_table(amregex_t *orig_re_table, + GSList *normal_message, + GSList *ignore_message, + GSList *strange_message); +static void add_type_table(dmpline_t typ, + amregex_t **re_table, amregex_t *orig_re_table, + GSList *normal_message, GSList *ignore_message, + GSList *strange_message); +static void add_list_table(dmpline_t typ, amregex_t **re_table, + GSList *message); +static char *gnutar_path; +static char *gnutar_listdir; +static char *gnutar_directory; +static int gnutar_onefilesystem; +static int gnutar_atimepreserve; +static int gnutar_checkdevice; +static int gnutar_sparse; +static GSList *normal_message = NULL; +static GSList *ignore_message = NULL; +static GSList *strange_message = NULL; +static char *exit_handling; +static int exit_value[256]; + +static struct option long_options[] = { + {"config" , 1, NULL, 1}, + {"host" , 1, NULL, 2}, + {"disk" , 1, NULL, 3}, + {"device" , 1, NULL, 4}, + {"level" , 1, NULL, 5}, + {"index" , 1, NULL, 6}, + {"message" , 1, NULL, 7}, + {"collection" , 0, NULL, 8}, + {"record" , 0, NULL, 9}, + {"gnutar-path" , 1, NULL, 10}, + {"gnutar-listdir" , 1, NULL, 11}, + {"one-file-system" , 1, NULL, 12}, + {"sparse" , 1, NULL, 13}, + {"atime-preserve" , 1, NULL, 14}, + {"check-device" , 1, NULL, 15}, + {"include-file" , 1, NULL, 16}, + {"include-list" , 1, NULL, 17}, + {"include-optional", 1, NULL, 18}, + {"exclude-file" , 1, NULL, 19}, + {"exclude-list" , 1, NULL, 20}, + {"exclude-optional", 1, NULL, 21}, + {"directory" , 1, NULL, 22}, + {"normal" , 1, NULL, 23}, + {"ignore" , 1, NULL, 24}, + {"strange" , 1, NULL, 25}, + {"exit-handling" , 1, NULL, 26}, + {"calcsize" , 0, NULL, 27}, + {"tar-blocksize" , 1, NULL, 28}, + {NULL, 0, NULL, 0} +}; + + +void +add_type_table( + dmpline_t typ, + amregex_t **re_table, + amregex_t *orig_re_table, + GSList *normal_message, + GSList *ignore_message, + GSList *strange_message) +{ + amregex_t *rp; + + for(rp = orig_re_table; rp->regex != NULL; rp++) { + if (rp->typ == typ) { + int found = 0; + GSList *mes; + + for (mes = normal_message; mes != NULL; mes = mes->next) { + if (strcmp(rp->regex, (char *)mes->data) == 0) + found = 1; + } + for (mes = ignore_message; mes != NULL; mes = mes->next) { + if (strcmp(rp->regex, (char *)mes->data) == 0) + found = 1; + } + for (mes = strange_message; mes != NULL; mes = mes->next) { + if (strcmp(rp->regex, (char *)mes->data) == 0) + found = 1; + } + if (found == 0) { + (*re_table)->regex = rp->regex; + (*re_table)->srcline = rp->srcline; + (*re_table)->scale = rp->scale; + (*re_table)->field = rp->field; + (*re_table)->typ = rp->typ; + (*re_table)++; + } + } + } +} + +void +add_list_table( + dmpline_t typ, + amregex_t **re_table, + GSList *message) +{ + GSList *mes; + + for (mes = message; mes != NULL; mes = mes->next) { + (*re_table)->regex = (char *)mes->data; + (*re_table)->srcline = 0; + (*re_table)->scale = 0; + (*re_table)->field = 0; + (*re_table)->typ = typ; + (*re_table)++; + } +} + +amregex_t * +build_re_table( + amregex_t *orig_re_table, + GSList *normal_message, + GSList *ignore_message, + GSList *strange_message) +{ + int nb = 0; + amregex_t *rp; + amregex_t *re_table, *new_re_table; + + for(rp = orig_re_table; rp->regex != NULL; rp++) { + nb++; + } + nb += g_slist_length(normal_message); + nb += g_slist_length(ignore_message); + nb += g_slist_length(strange_message); + nb ++; + + re_table = new_re_table = malloc(nb * sizeof(amregex_t)); + + /* add SIZE from orig_re_table */ + add_type_table(DMP_SIZE, &re_table, orig_re_table, + normal_message, ignore_message, strange_message); + + /* add ignore_message */ + add_list_table(DMP_IGNORE, &re_table, ignore_message); + + /* add IGNORE from orig_re_table */ + add_type_table(DMP_IGNORE, &re_table, orig_re_table, + normal_message, ignore_message, strange_message); + + /* add normal_message */ + add_list_table(DMP_NORMAL, &re_table, normal_message); + + /* add NORMAL from orig_re_table */ + add_type_table(DMP_NORMAL, &re_table, orig_re_table, + normal_message, ignore_message, strange_message); + + /* add strange_message */ + add_list_table(DMP_STRANGE, &re_table, strange_message); + + /* add STRANGE from orig_re_table */ + add_type_table(DMP_STRANGE, &re_table, orig_re_table, + normal_message, ignore_message, strange_message); + + /* Add DMP_STRANGE with NULL regex, */ + /* it is not copied by previous statement */ + re_table->regex = NULL; + re_table->srcline = 0; + re_table->scale = 0; + re_table->field = 0; + re_table->typ = DMP_STRANGE; + + return new_re_table; +} + +int +main( + int argc, + char ** argv) +{ + int c; + char *command; + application_argument_t argument; + int i; + +#ifdef GNUTAR + gnutar_path = GNUTAR; +#else + gnutar_path = NULL; +#endif + gnutar_directory = NULL; + gnutar_onefilesystem = 1; + gnutar_atimepreserve = 1; + gnutar_checkdevice = 1; + gnutar_sparse = 1; + exit_handling = NULL; + + /* initialize */ + + /* + * Configure program for internationalization: + * 1) Only set the message locale for now. + * 2) Set textdomain for all amanda related programs to "amanda" + * We don't want to be forced to support dozens of message catalogs. + */ + setlocale(LC_MESSAGES, "C"); + textdomain("amanda"); + + /* drop root privileges */ + if (!set_root_privs(0)) { + error(_("amgtar must be run setuid root")); + } + + safe_fd(3, 2); + + set_pname("amgtar"); + + /* Don't die when child closes pipe */ + signal(SIGPIPE, SIG_IGN); + +#if defined(USE_DBMALLOC) + malloc_size_1 = malloc_inuse(&malloc_hist_1); +#endif + + erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); + dbopen(DBG_SUBDIR_CLIENT); + startclock(); + dbprintf(_("version %s\n"), version()); + + config_init(CONFIG_INIT_CLIENT, NULL); + + //check_running_as(RUNNING_AS_DUMPUSER_PREFERRED); + //root for amrecover + //RUNNING_AS_CLIENT_LOGIN from selfcheck, sendsize, sendbackup + + /* parse argument */ + command = argv[1]; + + argument.config = NULL; + argument.host = NULL; + argument.message = 0; + argument.collection = 0; + argument.calcsize = 0; + argument.tar_blocksize = NULL; + argument.level = NULL; + init_dle(&argument.dle); + + while (1) { + int option_index = 0; + c = getopt_long (argc, argv, "", long_options, &option_index); + if (c == -1) { + break; + } + switch (c) { + case 1: argument.config = stralloc(optarg); + break; + case 2: argument.host = stralloc(optarg); + break; + case 3: argument.dle.disk = stralloc(optarg); + break; + case 4: argument.dle.device = stralloc(optarg); + break; + case 5: argument.level = g_slist_append(argument.level, + GINT_TO_POINTER(atoi(optarg))); + break; + case 6: argument.dle.create_index = 1; + break; + case 7: argument.message = 1; + break; + case 8: argument.collection = 1; + break; + case 9: argument.dle.record = 1; + break; + case 10: gnutar_path = stralloc(optarg); + break; + case 11: gnutar_listdir = stralloc(optarg); + break; + case 12: if (optarg && strcasecmp(optarg, "YES") != 0) + gnutar_onefilesystem = 0; + break; + case 13: if (optarg && strcasecmp(optarg, "YES") != 0) + gnutar_sparse = 0; + break; + case 14: if (optarg && strcasecmp(optarg, "YES") != 0) + gnutar_atimepreserve = 0; + break; + case 15: if (optarg && strcasecmp(optarg, "YES") != 0) + gnutar_checkdevice = 0; + break; + case 16: if (optarg) + argument.dle.include_file = + append_sl(argument.dle.include_file, optarg); + break; + case 17: if (optarg) + argument.dle.include_list = + append_sl(argument.dle.include_list, optarg); + break; + case 18: argument.dle.include_optional = 1; + break; + case 19: if (optarg) + argument.dle.exclude_file = + append_sl(argument.dle.exclude_file, optarg); + break; + case 20: if (optarg) + argument.dle.exclude_list = + append_sl(argument.dle.exclude_list, optarg); + break; + case 21: argument.dle.exclude_optional = 1; + break; + case 22: gnutar_directory = stralloc(optarg); + break; + case 23: if (optarg) + normal_message = + g_slist_append(normal_message, optarg); + break; + case 24: if (optarg) + ignore_message = + g_slist_append(ignore_message, optarg); + break; + case 25: if (optarg) + strange_message = + g_slist_append(strange_message, optarg); + break; + case 26: if (optarg) + exit_handling = stralloc(optarg); + break; + case 27: argument.calcsize = 1; + break; + case 28: argument.tar_blocksize = stralloc(optarg); + case ':': + case '?': + break; + } + } + + argument.argc = argc - optind; + argument.argv = argv + optind; + + if (argument.config) { + config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, + argument.config); + dbrename(get_config_name(), DBG_SUBDIR_CLIENT); + } + + if (config_errors(NULL) >= CFGERR_ERRORS) { + g_critical(_("errors processing config file")); + } + + re_table = build_re_table(init_re_table, normal_message, ignore_message, + strange_message); + + for(i=0;i<256;i++) + exit_value[i] = 1; /* BAD */ + exit_value[0] = 0; /* GOOD */ + exit_value[1] = 0; /* GOOD */ + if (exit_handling) { + char *s = exit_handling; + while (s) { + char *r = index(s, '='); + if (r) { + int j = atoi(s); + if (j >= 0 && j < 256) { + r++; + if (strncasecmp(r, "GOOD", 4) == 0) { + exit_value[j] = 0; + } + s = index(s, ' '); + } + } + } + } + + gnutar_listdir = getconf_str(CNF_GNUTAR_LIST_DIR); + if (strlen(gnutar_listdir) == 0) + gnutar_listdir = NULL; + + if (gnutar_path) { + dbprintf("GNUTAR-PATH %s\n", gnutar_path); + } else { + dbprintf("GNUTAR-PATH is not set\n"); + } + if (gnutar_listdir) { + dbprintf("GNUTAR-LISTDIR %s\n", gnutar_listdir); + } else { + dbprintf("GNUTAR-LISTDIR is not set\n"); + } + if (gnutar_directory) { + dbprintf("DIRECTORY %s\n", gnutar_directory); + } + dbprintf("ONE-FILE-SYSTEM %s\n", gnutar_onefilesystem? "yes":"no"); + dbprintf("SPARSE %s\n", gnutar_sparse? "yes":"no"); + dbprintf("ATIME-PRESERVE %s\n", gnutar_atimepreserve? "yes":"no"); + dbprintf("CHECK-DEVICE %s\n", gnutar_checkdevice? "yes":"no"); + { + amregex_t *rp; + for (rp = re_table; rp->regex != NULL; rp++) { + switch (rp->typ) { + case DMP_NORMAL : dbprintf("NORMAL %s\n", rp->regex); break; + case DMP_IGNORE : dbprintf("IGNORE %s\n", rp->regex); break; + case DMP_STRANGE: dbprintf("STRANGE %s\n", rp->regex); break; + case DMP_SIZE : dbprintf("SIZE %s\n", rp->regex); break; + case DMP_ERROR : dbprintf("ERROR %s\n", rp->regex); break; + } + } + } + + if (strcmp(command, "support") == 0) { + amgtar_support(&argument); + } else if (strcmp(command, "selfcheck") == 0) { + amgtar_selfcheck(&argument); + } else if (strcmp(command, "estimate") == 0) { + amgtar_estimate(&argument); + } else if (strcmp(command, "backup") == 0) { + amgtar_backup(&argument); + } else if (strcmp(command, "restore") == 0) { + amgtar_restore(&argument); + } else if (strcmp(command, "validate") == 0) { + amgtar_validate(&argument); + } else { + dbprintf("Unknown command `%s'.\n", command); + fprintf(stderr, "Unknown command `%s'.\n", command); + exit (1); + } + return 0; +} + +static void +amgtar_support( + application_argument_t *argument) +{ + (void)argument; + fprintf(stdout, "CONFIG YES\n"); + fprintf(stdout, "HOST YES\n"); + fprintf(stdout, "DISK YES\n"); + fprintf(stdout, "MAX-LEVEL 9\n"); + fprintf(stdout, "INDEX-LINE YES\n"); + fprintf(stdout, "INDEX-XML NO\n"); + fprintf(stdout, "MESSAGE-LINE YES\n"); + fprintf(stdout, "MESSAGE-XML NO\n"); + fprintf(stdout, "RECORD YES\n"); + fprintf(stdout, "INCLUDE-FILE YES\n"); + fprintf(stdout, "INCLUDE-LIST YES\n"); + fprintf(stdout, "INCLUDE-OPTIONAL YES\n"); + fprintf(stdout, "EXCLUDE-FILE YES\n"); + fprintf(stdout, "EXCLUDE-LIST YES\n"); + fprintf(stdout, "EXCLUDE-OPTIONAL YES\n"); + fprintf(stdout, "COLLECTION NO\n"); + fprintf(stdout, "MULTI-ESTIMATE YES\n"); + fprintf(stdout, "CALCSIZE YES\n"); +} + +static void +amgtar_selfcheck( + application_argument_t *argument) +{ + amgtar_build_exinclude(&argument->dle, 1, NULL, NULL, NULL, NULL); + + if (gnutar_path) { + check_file(gnutar_path, X_OK); + } else { + printf(_("ERROR [GNUTAR program not available]\n")); + } + + set_root_privs(1); + if (gnutar_listdir && strlen(gnutar_listdir) == 0) + gnutar_listdir = NULL; + if (gnutar_listdir) { + check_dir(gnutar_listdir, R_OK|W_OK); + } else { + printf(_("ERROR [No GNUTAR-LISTDIR]\n")); + } + + fprintf(stdout, "OK %s\n", argument->dle.disk); + if (gnutar_directory) { + check_dir(gnutar_directory, R_OK); + } else { + check_dir(argument->dle.device, R_OK); + } + set_root_privs(0); +} + +static void +amgtar_estimate( + application_argument_t *argument) +{ + char *incrname = NULL; + char **my_argv = NULL; + char *cmd = NULL; + int nullfd = -1; + int pipefd = -1; + FILE *dumpout = NULL; + off_t size = -1; + char line[32768]; + char *errmsg = NULL; + char *qerrmsg = NULL; + char *qdisk; + amwait_t wait_status; + int tarpid; + amregex_t *rp; + times_t start_time; + int level; + GSList *levels; + + qdisk = quote_string(argument->dle.disk); + + if (argument->calcsize) { + char *dirname; + char *file_exclude; + char *file_include; + int nb_exclude; + int nb_include; + + if (gnutar_directory) { + dirname = gnutar_directory; + } else { + dirname = amname_to_dirname(argument->dle.device); + } + amgtar_build_exinclude(&argument->dle, 1, + &nb_exclude, &file_exclude, + &nb_include, &file_include); + + run_calcsize(argument->config, "GNUTAR", argument->dle.disk, dirname, + argument->level, file_exclude, file_include); + return; + } + + if (!gnutar_path) { + errmsg = vstrallocf(_("GNUTAR-PATH not defined")); + goto common_error; + } + + if (!gnutar_listdir) { + errmsg = vstrallocf(_("GNUTAR-LISTDIR not defined")); + goto common_error; + } + + for (levels = argument->level; levels != NULL; levels = levels->next) { + level = GPOINTER_TO_INT(levels->data); + incrname = amgtar_get_incrname(argument, level); + cmd = stralloc(gnutar_path); + my_argv = amgtar_build_argv(argument, incrname, CMD_ESTIMATE); + + start_time = curclock(); + + if ((nullfd = open("/dev/null", O_RDWR)) == -1) { + errmsg = vstrallocf(_("Cannot access /dev/null : %s"), + strerror(errno)); + goto common_exit; + } + + tarpid = pipespawnv(cmd, STDERR_PIPE, 1, + &nullfd, &nullfd, &pipefd, my_argv); + + dumpout = fdopen(pipefd,"r"); + if (!dumpout) { + error(_("Can't fdopen: %s"), strerror(errno)); + /*NOTREACHED*/ + } + + size = (off_t)-1; + while (size < 0 && (fgets(line, sizeof(line), dumpout) != NULL)) { + if (line[strlen(line)-1] == '\n') /* remove trailling \n */ + line[strlen(line)-1] = '\0'; + if (line[0] == '\0') + continue; + dbprintf("%s\n", line); + /* check for size match */ + /*@ignore@*/ + for(rp = re_table; rp->regex != NULL; rp++) { + if(match(rp->regex, line)) { + if (rp->typ == DMP_SIZE) { + size = ((the_num(line, rp->field)*rp->scale+1023.0)/1024.0); + if(size < 0.0) + size = 1.0; /* found on NeXT -- sigh */ + } + break; + } + } + /*@end@*/ + } + + while (fgets(line, sizeof(line), dumpout) != NULL) { + dbprintf("%s", line); + } + + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), + qdisk, + level, + walltime_str(timessub(curclock(), start_time))); + if(size == (off_t)-1) { + errmsg = vstrallocf(_("no size line match in %s output"), + my_argv[0]); + dbprintf(_("%s for %s\n"), errmsg, qdisk); + dbprintf(".....\n"); + } else if(size == (off_t)0 && argument->level == 0) { + dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), + my_argv[0], argument->dle.disk); + dbprintf(".....\n"); + } + dbprintf(_("estimate size for %s level %d: %lld KB\n"), + qdisk, + level, + (long long)size); + + kill(-tarpid, SIGTERM); + + dbprintf(_("waiting for %s \"%s\" child\n"), my_argv[0], qdisk); + waitpid(tarpid, &wait_status, 0); + if (WIFSIGNALED(wait_status)) { + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), + cmd, WTERMSIG(wait_status), dbfn()); + } else if (WIFEXITED(wait_status)) { + if (exit_value[WEXITSTATUS(wait_status)] == 1) { + errmsg = vstrallocf(_("%s exited with status %d: see %s"), + cmd, WEXITSTATUS(wait_status), dbfn()); + } else { + /* Normal exit */ + } + } else { + errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); + } + dbprintf(_("after %s %s wait\n"), my_argv[0], qdisk); + +common_exit: + if (errmsg) { + dbprintf("%s", errmsg); + fprintf(stdout, "ERROR %s\n", errmsg); + } + + if (incrname) { + unlink(incrname); + } + amfree(my_argv); + amfree(cmd); + + aclose(nullfd); + afclose(dumpout); + + fprintf(stdout, "%d %lld 1\n", level, (long long)size); + } + amfree(qdisk); + return; + +common_error: + qerrmsg = quote_string(errmsg); + amfree(qdisk); + dbprintf("%s", errmsg); + fprintf(stdout, "ERROR %s\n", qerrmsg); + amfree(errmsg); + amfree(qerrmsg); + return; +} + +static void +amgtar_backup( + application_argument_t *argument) +{ + int dumpin; + char *cmd = NULL; + char *qdisk; + char *incrname; + char line[32768]; + amregex_t *rp; + off_t dump_size = -1; + char *type; + char startchr; + + int dataf = 1; + int mesgf = 3; + int indexf = 4; + int outf; + FILE *mesgstream; + FILE *indexstream = NULL; + FILE *outstream; + char *errmsg = NULL; + amwait_t wait_status; + + char **my_argv; + int tarpid; + + if (!gnutar_path) { + error(_("GNUTAR-PATH not defined")); + } + if (!gnutar_listdir) { + error(_("GNUTAR-LISTDIR not defined")); + } + + qdisk = quote_string(argument->dle.disk); + + incrname = amgtar_get_incrname(argument, + GPOINTER_TO_INT(argument->level->data)); + cmd = stralloc(gnutar_path); + my_argv = amgtar_build_argv(argument, incrname, CMD_BACKUP); + + tarpid = pipespawnv(cmd, STDIN_PIPE|STDERR_PIPE, 1, + &dumpin, &dataf, &outf, my_argv); + /* close the write ends of the pipes */ + + aclose(dumpin); + aclose(dataf); + if (argument->dle.create_index) { + indexstream = fdopen(indexf, "w"); + if (!indexstream) { + error(_("error indexstream(%d): %s\n"), indexf, strerror(errno)); + } + } + mesgstream = fdopen(mesgf, "w"); + if (!mesgstream) { + error(_("error mesgstream(%d): %s\n"), mesgf, strerror(errno)); + } + outstream = fdopen(outf, "r"); + if (!outstream) { + error(_("error outstream(%d): %s\n"), outf, strerror(errno)); + } + + while (fgets(line, sizeof(line), outstream) != NULL) { + if (line[strlen(line)-1] == '\n') /* remove trailling \n */ + line[strlen(line)-1] = '\0'; + if (*line == '.' && *(line+1) == '/') { /* filename */ + if (argument->dle.create_index) { + fprintf(indexstream, "%s\n", &line[1]); /* remove . */ + } + } else { /* message */ + for(rp = re_table; rp->regex != NULL; rp++) { + if(match(rp->regex, line)) { + break; + } + } + if(rp->typ == DMP_SIZE) { + dump_size = (long)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0); + } + switch(rp->typ) { + case DMP_NORMAL: + type = "normal"; + startchr = '|'; + break; + case DMP_IGNORE: + continue; + case DMP_STRANGE: + type = "strange"; + startchr = '?'; + break; + case DMP_SIZE: + type = "size"; + startchr = '|'; + break; + case DMP_ERROR: + type = "error"; + startchr = '?'; + break; + default: + type = "unknown"; + startchr = '!'; + break; + } + dbprintf("%3d: %7s(%c): %s\n", rp->srcline, type, startchr, line); + fprintf(mesgstream,"%c %s\n", startchr, line); + } + } + + waitpid(tarpid, &wait_status, 0); + if (WIFSIGNALED(wait_status)) { + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), + cmd, WTERMSIG(wait_status), dbfn()); + } else if (WIFEXITED(wait_status)) { + if (exit_value[WEXITSTATUS(wait_status)] == 1) { + errmsg = vstrallocf(_("%s exited with status %d: see %s"), + cmd, WEXITSTATUS(wait_status), dbfn()); + } else { + /* Normal exit */ + } + } else { + errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); + } + dbprintf(_("after %s %s wait\n"), my_argv[0], qdisk); + dbprintf(_("amgtar: %s: pid %ld\n"), cmd, (long)tarpid); + if (errmsg) { + dbprintf("%s", errmsg); + g_fprintf(mesgstream, "sendbackup: error [%s]\n", errmsg); + } + + if (incrname && strlen(incrname) > 4) { + char *nodotnew; + nodotnew = stralloc(incrname); + nodotnew[strlen(nodotnew)-4] = '\0'; + if (rename(incrname, nodotnew)) { + dbprintf(_("%s: warning [renaming %s to %s: %s]\n"), + get_pname(), incrname, nodotnew, strerror(errno)); + g_fprintf(mesgstream, _("? warning [renaming %s to %s: %s]\n"), + incrname, nodotnew, strerror(errno)); + } + amfree(nodotnew); + } + + dbprintf("sendbackup: size %lld\n", (long long)dump_size); + fprintf(mesgstream, "sendbackup: size %lld\n", (long long)dump_size); + dbprintf("sendbackup: end\n"); + fprintf(mesgstream, "sendbackup: end\n"); + + if (argument->dle.create_index) + fclose(indexstream); + + fclose(mesgstream); + + amfree(incrname); + amfree(qdisk); + amfree(cmd); +} + +static void +amgtar_restore( + application_argument_t *argument) +{ + char *cmd; + char **my_argv; + char **env; + int i, j; + char *e; + + if (!gnutar_path) { + error(_("GNUTAR-PATH not defined")); + } + + cmd = stralloc(gnutar_path); + my_argv = alloc(SIZEOF(char *) * (6 + argument->argc)); + i = 0; + my_argv[i++] = stralloc(gnutar_path); + my_argv[i++] = stralloc("--numeric-owner"); + my_argv[i++] = stralloc("-xpGvf"); + my_argv[i++] = stralloc("-"); + + for (j=1; j< argument->argc; j++) { + my_argv[i++] = stralloc(argument->argv[j]); + } + my_argv[i++] = NULL; + + env = safe_env(); + become_root(); + execve(cmd, my_argv, env); + e = strerror(errno); + error(_("error [exec %s: %s]"), cmd, e); +} + +static void +amgtar_validate( + application_argument_t *argument G_GNUC_UNUSED) +{ + char *cmd; + char **my_argv; + char **env; + int i; + char *e; + + if (!gnutar_path) { + error(_("GNUTAR-PATH not defined")); + } + + cmd = stralloc(gnutar_path); + my_argv = alloc(SIZEOF(char *) * 4); + i = 0; + my_argv[i++] = stralloc(gnutar_path); + my_argv[i++] = stralloc("-tf"); + my_argv[i++] = stralloc("-"); + my_argv[i++] = NULL; + + env = safe_env(); + execve(cmd, my_argv, env); + e = strerror(errno); + error(_("error [exec %s: %s]"), cmd, e); +} + +static void +amgtar_build_exinclude( + dle_t *dle, + int verbose, + int *nb_exclude, + char **file_exclude, + int *nb_include, + char **file_include) +{ + int n_exclude = 0; + int n_include = 0; + char *exclude = NULL; + char *include = NULL; + + if (dle->exclude_file) n_exclude += dle->exclude_file->nb_element; + if (dle->exclude_list) n_exclude += dle->exclude_list->nb_element; + if (dle->include_file) n_include += dle->include_file->nb_element; + if (dle->include_list) n_include += dle->include_list->nb_element; + + if (n_exclude > 0) exclude = build_exclude(dle, verbose); + if (n_include > 0) include = build_include(dle, verbose); + + if (nb_exclude) + *nb_exclude = n_exclude; + if (file_exclude) + *file_exclude = exclude; + else + amfree(exclude); + + if (nb_include) + *nb_include = n_include; + if (file_include) + *file_include = include; + else + amfree(include); +} + +static char * +amgtar_get_incrname( + application_argument_t *argument, + int level) +{ + char *basename = NULL; + char *incrname = NULL; + int infd, outfd; + ssize_t nb; + char *inputname = NULL; + char *errmsg = NULL; + char *buf; + + if (gnutar_listdir) { + char number[NUM_STR_SIZE]; + int baselevel; + char *sdisk = sanitise_filename(argument->dle.disk); + + basename = vstralloc(gnutar_listdir, + "/", + argument->host, + sdisk, + NULL); + amfree(sdisk); + + snprintf(number, SIZEOF(number), "%d", level); + incrname = vstralloc(basename, "_", number, ".new", NULL); + unlink(incrname); + + /* + * Open the listed incremental file from the previous level. Search + * backward until one is found. If none are found (which will also + * be true for a level 0), arrange to read from /dev/null. + */ + baselevel = level; + infd = -1; + while (infd == -1) { + if (--baselevel >= 0) { + snprintf(number, SIZEOF(number), "%d", baselevel); + inputname = newvstralloc(inputname, + basename, "_", number, NULL); + } else { + inputname = newstralloc(inputname, "/dev/null"); + } + if ((infd = open(inputname, O_RDONLY)) == -1) { + + errmsg = vstrallocf(_("amgtar: error opening %s: %s"), + inputname, strerror(errno)); + dbprintf("%s\n", errmsg); + if (baselevel < 0) { + return NULL; + } + amfree(errmsg); + } + } + + /* + * Copy the previous listed incremental file to the new one. + */ + if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) { + errmsg = vstrallocf(_("opening %s: %s"), + incrname, strerror(errno)); + dbprintf("%s\n", errmsg); + return NULL; + } + + while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { + if (full_write(outfd, &buf, (size_t)nb) < (size_t)nb) { + errmsg = vstrallocf(_("writing to %s: %s"), + incrname, strerror(errno)); + dbprintf("%s\n", errmsg); + return NULL; + } + } + + if (nb < 0) { + errmsg = vstrallocf(_("reading from %s: %s"), + inputname, strerror(errno)); + dbprintf("%s\n", errmsg); + return NULL; + } + + if (close(infd) != 0) { + errmsg = vstrallocf(_("closing %s: %s"), + inputname, strerror(errno)); + dbprintf("%s\n", errmsg); + return NULL; + } + if (close(outfd) != 0) { + errmsg = vstrallocf(_("closing %s: %s"), + incrname, strerror(errno)); + dbprintf("%s\n", errmsg); + return NULL; + } + + amfree(inputname); + amfree(basename); + } + return incrname; +} + +char **amgtar_build_argv( + application_argument_t *argument, + char *incrname, + int command) +{ + int i; + int nb_exclude; + int nb_include; + char *file_exclude; + char *file_include; + char *dirname; + char tmppath[PATH_MAX]; + char **my_argv; + + amgtar_build_exinclude(&argument->dle, 1, + &nb_exclude, &file_exclude, + &nb_include, &file_include); + + if (gnutar_directory) { + dirname = gnutar_directory; + } else { + dirname = amname_to_dirname(argument->dle.device); + } + + my_argv = alloc(SIZEOF(char *) * 23); + i = 0; + + my_argv[i++] = gnutar_path; + + my_argv[i++] = "--create"; + if (command == CMD_BACKUP && argument->dle.create_index) + my_argv[i++] = "--verbose"; + my_argv[i++] = "--file"; + if (command == CMD_ESTIMATE) { + my_argv[i++] = "/dev/null"; + } else { + my_argv[i++] = "-"; + } + my_argv[i++] = "--directory"; + canonicalize_pathname(dirname, tmppath); + my_argv[i++] = stralloc(tmppath); + if (gnutar_onefilesystem) + my_argv[i++] = "--one-file-system"; + if (gnutar_atimepreserve) + my_argv[i++] = "--atime-preserve=system"; + if (!gnutar_checkdevice) + my_argv[i++] = "--no-check-device"; + my_argv[i++] = "--listed-incremental"; + my_argv[i++] = incrname; + if (gnutar_sparse) + my_argv[i++] = "--sparse"; + if (argument->tar_blocksize) { + my_argv[i++] = "--blocking-factor"; + my_argv[i++] = argument->tar_blocksize; + } + my_argv[i++] = "--ignore-failed-read"; + my_argv[i++] = "--totals"; + + if(file_exclude) { + my_argv[i++] = "--exclude-from"; + my_argv[i++] = file_exclude; + } + + if(file_include) { + my_argv[i++] = "--files-from"; + my_argv[i++] = file_include; + } + else { + my_argv[i++] = "."; + } + my_argv[i++] = NULL; + + return(my_argv); +} + diff --git a/application-src/amgtar_perl.pl b/application-src/amgtar_perl.pl new file mode 100644 index 0000000..ad0d182 --- /dev/null +++ b/application-src/amgtar_perl.pl @@ -0,0 +1,350 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Getopt::Long; + +package Amanda::Application::amgtar_perl; +use base qw(Amanda::Application); +use File::Copy; +use File::Path; +use IPC::Open3; +use Sys::Hostname; +use Symbol; +use Amanda::Constants; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Debug qw( :logging ); +use Amanda::Paths; +use Amanda::Util qw( :constants ); + +sub new { + my $class = shift; + my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $calcsize) = @_; + my $self = $class->SUPER::new(); + + $self->{runtar} = ${Amanda::Paths::amlibexecdir} ."/runtar" . + $self->{'suf'}; + $self->{gnulist} = $Amanda::Paths::GNUTAR_LISTED_INCREMENTAL_DIR; + $self->{gnutar} = $Amanda::Constants::GNUTAR; + + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{calcsize} = $calcsize; + + return $self; +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MAX-LEVEL 9\n"; + print "INDEX-LINE YES\n"; + print "INDEX-XML NO\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "RECORD YES\n"; + print "COLLECTION NO\n"; + print "MULTI-ESTIMATE YES\n"; + print "CALCSIZE YES\n"; +} + +sub command_selfcheck { + my $self = shift; + + print "OK " . $self->{disk} . "\n"; + print "OK " . $self->{device} . "\n"; + #check binary + #check statefile + #check amdevice + #check property include/exclude +} + +sub command_estimate { + my $self = shift; + + if (defined $self->{calcsize}) { + $self->run_calcsize("GNUTAR", undef); + return; + } + + my($listdir) = $self->{'host'} . $self->{'disk'}; + $listdir =~ s/\//_/g; + my $gnufile; + my $level; + while (defined ($level = shift @{$self->{level}})) { + if($level == 0) { + open($gnufile, ">$self->{gnulist}/${listdir}_${level}.new") || die(); + close($gnufile) || die(); + } + else { + my($prev_level) = $level - 1; + if (-f "$self->{gnulist}/${listdir}_${prev_level}") { + copy("$self->{gnulist}/${listdir}_${prev_level}", "$self->{gnulist}/${listdir}_${level}.new"); + } else { + open($gnufile, ">$self->{gnulist}/${listdir}_${level}.new") || die(); + close($gnufile) || die(); + #print "ERROR file $self->{gnulist}/${listdir}_${level}.new doesn't exist\n"; + } + } + my($size) = -1; + my(@cmd) = ($self->{runtar}, $self->{'config'}, $self->{'gnutar'}, "--create", "--directory", $self->{'device'}, "--listed-incremental", "$self->{gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", "."); + debug("cmd:" . join(" ", @cmd)); + my $wtrfh; + my $estimate_fd = Symbol::gensym; + my $pid = open3($wtrfh, '>&STDOUT', $estimate_fd, @cmd); + close($wtrfh); + + $size = parse_estimate($estimate_fd); + close($estimate_fd); + output_size($level, $size); + unlink "$self->{gnulist}/${listdir}_${level}.new"; + waitpid $pid, 0; + } + exit 0; +} + +sub parse_estimate { + my($fh) = @_; + my($size) = -1; + while(<$fh>) { + if ($_ =~ /^Total bytes written: (\d*)/) { + $size = $1; + last; + } + } + return $size; +} + +sub output_size { + my($level) = shift; + my($size) = shift; + if($size == -1) { + print "$level -1 -1\n"; + #exit 2; + } + else { + my($ksize) = int $size / (1024); + $ksize=32 if ($ksize<32); + print "$level $ksize 1\n"; + } +} + +sub command_backup { + my $self = shift; + + my($listdir) = $self->{'host'} . $self->{'disk'}; + my($verbose) = ""; + $listdir =~ s/\//_/g; + my($level) = $self->{level}[0]; + if($level == 0) { + open(GNULIST, ">$self->{gnulist}/${listdir}_${level}.new") || die(); + close(GNULIST) || die(); + } + else { + my($prev_level) = $level - 1; + copy("$self->{gnulist}/${listdir}_${prev_level}", + "$self->{gnulist}/${listdir}_${level}.new"); + } + + my $mesgout_fd; + open($mesgout_fd, '>&=3') || die(); + $self->{mesgout} = $mesgout_fd; + + if(defined($self->{index})) { + $verbose = "--verbose"; + } + my(@cmd) = ($self->{runtar}, $self->{config}, $self->{gnutar}, "--create", $verbose, "--directory", $self->{device}, "--listed-incremental", "$self->{gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", "."); + + debug("cmd:" . join(" ", @cmd)); + + my $wtrfh; + my $index_fd = Symbol::gensym; + my $pid = open3($wtrfh, '>&STDOUT', $index_fd, @cmd) || die(); + close($wtrfh); + + if(defined($self->{index})) { + my $indexout_fd; + open($indexout_fd, '>&=4') || die(); + $self->parse_backup($index_fd, $mesgout_fd, $indexout_fd); + close($indexout_fd); + } + else { + $self->parse_backup($index_fd, $mesgout_fd, undef); + } + close($index_fd); + + if(defined($self->{record})) { + debug("rename $self->{gnulist}/${listdir}_${level}.new $self->{gnulist}/${listdir}_${level}"); + rename "$self->{gnulist}/${listdir}_${level}.new", + "$self->{gnulist}/${listdir}_${level}"; + } + else { + debug("unlink $self->{gnulist}/${listdir}_${level}.new"); + unlink "$self->{gnulist}/${listdir}_${level}.new"; + } + waitpid $pid, 0; + if( $? != 0 ){ + print $mesgout_fd "? $self->{gnutar} returned error\n"; + die(); + } + exit 0; +} + +sub parse_backup { + my $self = shift; + my($fhin, $fhout, $indexout) = @_; + my $size = -1; + my $ksize = -1; + while(<$fhin>) { + if ( /^\.\//) { + if(defined($indexout)) { + if(defined($self->{index})) { + s/^\.//; + print $indexout $_; + } + } + } + else { + if (/^Total bytes written: (\d*)/) { + $size = $1; + $ksize = int ($size / 1024); + } + elsif(defined($fhout)) { + if (/: Directory is new$/ || + /: Directory has been renamed/) { + # ignore + } else { # strange + print $fhout "? $_"; + } + } + } + } + if(defined($fhout)) { + if ($size == -1) { + } + else { + my($ksize) = int ($size/1024); + print $fhout "sendbackup: size $ksize\n"; + print $fhout "sendbackup: end\n"; + } + } +} + +sub command_index_from_output { + index_from_output(0, 1); + exit 0; +} + +sub index_from_output { + my($fhin, $fhout) = @_; + my($size) = -1; + while(<$fhin>) { + next if /^Total bytes written:/; + next if !/^\.\//; + s/^\.//; + print $fhout $_; + } +} + +sub command_index_from_image { + my $self = shift; + my $index_fd; + open($index_fd, "$self->{gnutar} --list --file - |") || die(); + index_from_output($index_fd, 1); +} + +sub command_restore { + my $self = shift; + + chdir(Amanda::Util::get_original_cwd()); + my(@cmd) = ($self->{gnutar}, "--numeric-owner", "-xpGvf", "-"); + for(my $i=1;defined $ARGV[$i]; $i++) { + my $param = $ARGV[$i]; + $param =~ /^(.*)$/; + push @cmd, $1; + } + debug("cmd:" . join(" ", @cmd)); + exec { $cmd[0] } @cmd; + die("Can't exec '", $cmd[0], "'"); +} + +sub command_validate { + my $self = shift; + + my(@cmd) = ($self->{gnutar}, "-tf", "-"); + debug("cmd:" . join(" ", @cmd)); + my $pid = open3('>&STDIN', '>&STDOUT', '>&STDERR', @cmd) || die("validate", "Unable to run @cmd"); + waitpid $pid, 0; + if( $? != 0 ){ + die("validate", "$self->{gnutar} returned error"); + } + exit(0); +} + +sub command_print_command { +} + +package main; + +sub usage { + print < --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --calcsize. +EOF + exit(1); +} + +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my $opt_calcsize; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record' => \$opt_record, + 'calcsize' => \$opt_calcsize, +) or usage(); + +my $application = Amanda::Application::amgtar_perl->new($opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, $opt_calcsize); + +$application->do($ARGV[0]); diff --git a/application-src/amlog-script.pl b/application-src/amlog-script.pl new file mode 100644 index 0000000..40dc3e6 --- /dev/null +++ b/application-src/amlog-script.pl @@ -0,0 +1,268 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Getopt::Long; +use File::Basename; + +package Amanda::Script::amlog_script; +use base qw(Amanda::Script); +use Amanda::Config qw( :getconf :init ); +use Amanda::Debug qw( :logging ); +use Amanda::Util qw( :constants ); +use Amanda::Paths; +use Amanda::Constants; + + +sub new { + my $class = shift; + my ($execute_where, $config, $host, $disk, $device, $level, $index, $message, $collection, $record, $logfile) = @_; + my $self = $class->SUPER::new($execute_where); + + $self->{execute_where} = $execute_where; + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; # Copy the array + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{logfile} = $logfile; + + return $self; +} + +sub setup() { + my $self = shift; + + if (!defined $self->{logfile}) { + $self->print_to_server_and_die($self->{action}, "property LOGFILE not set", $Amanda::Script_App::ERROR); + } + + my $dirname = File::Basename::dirname($self->{logfile}); + if (! -e $dirname) { + $self->print_to_server_and_die($self->{action}, "Directory '$dirname' doesn't exist", $Amanda::Script_App::ERROR); + } + if (! -d $dirname) { + $self->print_to_server_and_die($self->{action}, "Directory '$dirname' is not a directory", $Amanda::Script_App::ERROR); + } +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "EXECUTE-WHERE YES\n"; +} + +#define a execute_on_* function for every execute_on you want the script to do +#something +sub command_pre_dle_amcheck { + my $self = shift; + + $self->{action} = "check"; + $self->setup(); + $self->log_data("pre-dle-amcheck"); +} + +sub command_pre_host_amcheck { + my $self = shift; + + $self->{action} = "check"; + $self->setup(); + $self->log_data("pre-host-amcheck"); +} + +sub command_post_dle_amcheck { + my $self = shift; + + $self->{action} = "check"; + $self->setup(); + $self->log_data("post-dle-amcheck"); +} + +sub command_post_host_amcheck { + my $self = shift; + + $self->{action} = "check"; + $self->setup(); + $self->log_data("post-host-amcheck"); +} + +sub command_pre_dle_estimate { + my $self = shift; + + $self->{action} = "estimate"; + $self->setup(); + $self->log_data("pre-dle-estimate"); +} + +sub command_pre_host_estimate { + my $self = shift; + + $self->{action} = "estimate"; + $self->setup(); + $self->log_data("pre-host-estimate"); +} + +sub command_post_dle_estimate { + my $self = shift; + + $self->{action} = "estimate"; + $self->setup(); + $self->log_data("post-dle-estimate"); +} + +sub command_post_host_estimate { + my $self = shift; + + $self->{action} = "estimate"; + $self->setup(); + $self->log_data("post-host-estimate"); +} + +sub command_pre_dle_backup { + my $self = shift; + + $self->{action} = "backup"; + $self->setup(); + $self->log_data("pre-dle-backup"); +} + +sub command_pre_host_backup { + my $self = shift; + + $self->{action} = "backup"; + $self->setup(); + $self->log_data("pre-host-backup"); +} + +sub command_post_dle_backup { + my $self = shift; + + $self->{action} = "backup"; + $self->setup(); + $self->log_data("post-dle-backup"); +} + +sub command_post_host_backup { + my $self = shift; + + $self->{action} = "backup"; + $self->setup(); + $self->log_data("post-host-backup"); +} + +sub command_pre_recover { + my $self = shift; + + $self->{action} = "restore"; + $self->setup(); + $self->log_data("pre-recover"); +} + +sub command_post_recover { + my $self = shift; + + $self->{action} = "restore"; + $self->setup(); + $self->log_data("post-recover"); +} + +sub command_pre_level_recover { + my $self = shift; + + $self->{action} = "restore"; + $self->setup(); + $self->log_data("pre-level-recover"); +} + +sub command_post_level_recover { + my $self = shift; + + $self->{action} = "restore"; + $self->setup(); + $self->log_data("post-level-recover"); +} + +sub command_inter_level_recover { + my $self = shift; + + $self->{action} = "restore"; + $self->setup(); + $self->log_data("inter-level-recover"); +} + +sub log_data { + my $self = shift; + my($function) = shift; + my $log; + + open($log, ">>$self->{logfile}") || $self->print_to_server_and_die($self->{action}, "Can't open logfile '$self->{logfile}' for append: $!", $Amanda::Script_App::ERROR); + print $log "$self->{config} $function $self->{execute_where} $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), "\n"; + close $log; +} + +package main; + +sub usage { + print < --execute-where= --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --logfile=. +EOF + exit(1); +} + +my $opt_execute_where; +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my $opt_logfile; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'execute-where=s' => \$opt_execute_where, + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record=s' => \$opt_record, + 'logfile=s' => \$opt_logfile +) or usage(); + +my $script = Amanda::Script::amlog_script->new($opt_execute_where, $opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, $opt_logfile); + +$script->do($ARGV[0]); + diff --git a/application-src/amsamba.pl b/application-src/amsamba.pl new file mode 100644 index 0000000..ba45e27 --- /dev/null +++ b/application-src/amsamba.pl @@ -0,0 +1,691 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Getopt::Long; + +package Amanda::Application::Amsamba; +use base qw(Amanda::Application); +use File::Copy; +use File::Path; +use IPC::Open2; +use IPC::Open3; +use Sys::Hostname; +use Symbol; +use IO::Handle; +use Amanda::Constants; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Debug qw( :logging ); +use Amanda::Paths; +use Amanda::Util qw( :constants :quoting); + +sub new { + my $class = shift; + my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $calcsize, $gnutar_path, $smbclient_path, $amandapass, $exclude_file, $exclude_list, $exclude_optional, $include_file, $include_list, $include_optional, $recover_mode) = @_; + my $self = $class->SUPER::new(); + + if (defined $gnutar_path) { + $self->{gnutar} = $gnutar_path; + } else { + $self->{gnutar} = $Amanda::Constants::GNUTAR; + } + if (defined $smbclient_path) { + $self->{smbclient} = $smbclient_path; + } else { + $self->{smbclient} = $Amanda::Constants::SAMBA_CLIENT; + } + if (defined $amandapass) { + $self->{amandapass} = $amandapass; + } else { + $self->{amandapass} = "$Amanda::Paths::sysconfdir/amandapass"; + } + + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{calcsize} = $calcsize; + $self->{exclude_file} = [ @{$exclude_file} ]; + $self->{exclude_list} = [ @{$exclude_list} ]; + $self->{exclude_optional} = $exclude_optional; + $self->{include_file} = [ @{$include_file} ]; + $self->{include_list} = [ @{$include_list} ]; + $self->{include_optional} = $include_optional; + $self->{recover_mode} = $recover_mode; + + return $self; +} + +# on entry: +# $self->{exclude_file} +# $self->{exclude_list} +# $self->{include_file} +# $self->{include_list} +#on exit: +# $self->{exclude} +# $self->{include} +sub validate_inexclude { + my $self = shift; + + if ($#{$self->{exclude_file}} + $#{$self->{exclude_list}} >= -1 && + $#{$self->{include_file}} + $#{$self->{include_list}} >= -1) { + $self->print_to_server_and_die($self->{action}, + "Can't have both include and exclude", + $Amanda::Script_App::ERROR); + } + + if ($#{$self->{exclude_file}} >= 0) { + $self->{exclude} = [ @{$self->{exclude_file}} ]; + } + foreach my $file (@{$self->{exclude_list}}) { + if (!open(FF, $file)) { + if ($self->{action} eq 'check' && !$self->{exclude_optional}) { + $self->print_to_server($self->{action}, + "Open of '$file' failed: $!", + $Amanda::Script_App::ERROR); + } + next; + } + while () { + chomp; + push @{$self->{exclude}}, $_; + } + close(FF); + } + if ($#{$self->{include_file}} >= 0) { + $self->{include} = [ @{$self->{include_file}} ]; + } + foreach my $file (@{$self->{include_list}}) { + if (open(FF, $file)) { + if ($self->{action} eq 'check') { + $self->print_to_server($self->{action}, + "Open of '$file' failed: $!", + $Amanda::Script_App::ERROR); + } + next; + } + while () { + chomp; + push @{$self->{include}}, $_; + } + close(FF); + } +} + +# on entry: +# $self->disk == //host/share/subdir +# on exit: +# self->{cifshost} = //host +# $self->{share} = //host/share +# $self->{sambashare} = \\host\share +# $self->{subdir} = subdir +sub parsesharename { + my $self = shift; + + return if !defined $self->{disk}; + + if ($self->{disk} =~ m,^(//[^/]+/[^/]+)/(.*)$,) { + $self->{share} = $1; + $self->{subdir} = $2 + } else { + $self->{share} = $self->{disk}; + } + $self->{sambashare} = $self->{share}; + $self->{sambashare} =~ s,/,\\,g; + $self->{disk} =~ m,^(//[^/]+)/[^/]+,; + $self->{cifshost} = $1; +} + + +# Read $self->{amandapass} file. +# on entry: +# $self->{share} == //host/share +# on exit: +# $self->{domain} = domain to connect to. +# $self->{username} = username (-U) +# $self->{password} = password +sub findpass { + my $self = shift; + + my $amandapass; + my $line; + + open($amandapass, $self->{amandapass}); + while ($line = <$amandapass>) { + chomp $line; + next if $line =~ /^#/; + my ($diskname, $userdomain) = Amanda::Util::skip_quoted_string($line); + if (defined $diskname && + ($diskname eq '*' || + ($diskname =~ m,^(//[^/]+)/\*$, && $1 eq $self->{cifshost}) || + $diskname eq $self->{share} || + $diskname eq $self->{sambashare})) { + my ($userpasswd, $domain) = split ' ', $userdomain; + $self->{domain} = $domain; + my ($username, $password) = split('%', $userpasswd); + $self->{username} = $username; + $self->{password} = $password; + close($amandapass); + return; + } + } + close($amandapass); + $self->print_to_server_and_die($self->{action},"Cannot find password for share $self->{share} in $self->{amandapass}", $Amanda::Script_App::ERROR); +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MAX-LEVEL 1\n"; + print "INDEX-LINE YES\n"; + print "INDEX-XML NO\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "RECORD YES\n"; + print "COLLECTION NO\n"; + print "MULTI-ESTIMATE NO\n"; + print "CALCSIZE NO\n"; + print "EXCLUDE-FILE YES\n"; + print "EXCLUDE-LIST YES\n"; + print "EXCLUDE-OPTIONAL YES\n"; + print "INCLUDE-FILE YES\n"; + print "INCLUDE-LIST YES\n"; + print "INCLUDE-OPTIONAL YES\n"; + print "RECOVER-MODE SMB\n"; +} + +sub command_selfcheck { + my $self = shift; + + $self->{action} = 'check'; + $self->parsesharename(); + $self->findpass(); + $self->validate_inexclude(); + + print "OK " . $self->{share} . "\n"; + print "OK " . $self->{disk} . "\n"; + print "OK " . $self->{device} . "\n"; + + my ($child_rdr, $parent_wtr); + $^F=10; + pipe($child_rdr, $parent_wtr); + $parent_wtr->autoflush(1); + my($wtr, $rdr, $err); + $err = Symbol::gensym; + my $pid = open3($wtr, $rdr, $err, "-"); + if ($pid == 0) { + #child + my $ff = $child_rdr->fileno; + debug("child_rdr $ff"); + $parent_wtr->close(); + $ENV{PASSWD_FD} = $child_rdr->fileno; + close(1); + close(2); + my @ARGV = (); + push @ARGV, $self->{smbclient}, $self->{share}, + "-U", $self->{username}, + "-E"; + if (defined $self->{domain}) { + push @ARGV, "-W", $self->{domain}, + } + if (defined $self->{subdir}) { + push @ARGV, "-D", $self->{subdir}, + } + push @ARGV, "-c", "quit"; + debug("execute: " . $self->{smbclient} . " " . + join(" ", @ARGV)); + exec {$self->{smbclient}} @ARGV; + } + #parent + my $ff = $parent_wtr->fileno; + debug("parent_wtr $ff"); + debug("password $self->{password}"); + $parent_wtr->print($self->{password}); + $parent_wtr->close(); + $child_rdr->close(); + close($wtr); + close($rdr); + while (<$err>) { + chomp; + debug("stderr: " . $_); + next if /^Domain=/; + $self->print_to_server($self->{action}, "smbclient: $_", + $Amanda::Script_App::ERROR); + } + close($err); + waitpid($pid, 0); + #check binary + #check statefile + #check amdevice +} + +sub command_estimate { + my $self = shift; + + $self->{action} = 'estimate'; + $self->parsesharename(); + $self->findpass(); + $self->validate_inexclude(); + + my $level = $self->{level}[0]; + my ($child_rdr, $parent_wtr); + $^F=10; + pipe($child_rdr, $parent_wtr); + $parent_wtr->autoflush(1); + my($wtr, $rdr, $err); + $err = Symbol::gensym; + my $pid = open3($wtr, $rdr, $err, "-"); + if ($pid == 0) { + #child + my $ff = $child_rdr->fileno; + debug("child_rdr $ff"); + $parent_wtr->close(); + $ENV{PASSWD_FD} = $child_rdr->fileno; + close(0); + close(1); + my @ARGV = (); + push @ARGV, $self->{smbclient}, $self->{share}, + "-d", "0", + "-U", $self->{username}, + "-E"; + if (defined $self->{domain}) { + push @ARGV, "-W", $self->{domain}, + } + if (defined $self->{subdir}) { + push @ARGV, "-D", $self->{subdir}, + } + if ($level == 0) { + push @ARGV, "-c", "archive 0;recurse;du"; + } else { + push @ARGV, "-c", "archive 1;recurse;du"; + } + debug("execute: " . $self->{smbclient} . " " . + join(" ", @ARGV)); + exec {$self->{smbclient}} @ARGV; + } + #parent + my $ff = $parent_wtr->fileno; + debug("parent_wtr $ff"); + debug("password $self->{password}"); + $parent_wtr->print($self->{password}); + $parent_wtr->close(); + $child_rdr->close(); + close($wtr); + close($rdr); + my $size = $self->parse_estimate($err); + close($err); + output_size($level, $size); + waitpid($pid, 0); +} + +sub parse_estimate { + my $self = shift; + my($fh) = shift; + my($size) = -1; + while(<$fh>) { + chomp; + next if /^\s*$/; + next if /blocks of size/; + next if /blocks available/; + next if /^\s*$/; + next if /^Domain=/; + next if /dumped \d+ files and directories/; + debug("stderr: $_"); + if ($_ =~ /^Total number of bytes: (\d*)/) { + $size = $1; + last; + } else { + $self->print_to_server($self->{action}, "smbclient: $_", + $Amanda::Script_App::ERROR); + } + } + return $size; +} + +sub output_size { + my($level) = shift; + my($size) = shift; + if($size == -1) { + print "$level -1 -1\n"; + #exit 2; + } + else { + my($ksize) = int $size / (1024); + $ksize=32 if ($ksize<32); + print "$level $ksize 1\n"; + } +} + +sub command_backup { + my $self = shift; + + $self->{action} = 'backup'; + $self->parsesharename(); + $self->findpass(); + $self->validate_inexclude(); + + my $level = $self->{level}[0]; + my $mesgout_fd; + open($mesgout_fd, '>&=3') || die(); + $self->{mesgout} = $mesgout_fd; + + my $pid_tee = open3(\*INDEX_IN, '>&STDOUT', \*INDEX_TEE, "-"); + if ($pid_tee == 0) { + close(INDEX_IN); + close(INDEX_TEE); + my $buf; + my $size = -1; + while (($size = POSIX::read(0, $buf, 32768)) > 0) { + POSIX::write(1, $buf, $size); + POSIX::write(2, $buf, $size); + } + exit 0; + } + my ($child_rdr, $parent_wtr); + $^F=10; + pipe($child_rdr, $parent_wtr); + $^F=2; + $parent_wtr->autoflush(1); + my($wtr, $err); + $err = Symbol::gensym; + my $pid = open3($wtr, ">&INDEX_IN", $err, "-"); + if ($pid == 0) { + #child + my $ff = $child_rdr->fileno; + debug("child_rdr $ff"); + $parent_wtr->close(); + $ENV{PASSWD_FD} = $child_rdr->fileno; + close(0); + my @ARGV = (); + push @ARGV, $self->{smbclient}, $self->{share}, + "-d", "0", + "-U", $self->{username}, + "-E"; + if (defined $self->{domain}) { + push @ARGV, "-W", $self->{domain}, + } + if (defined $self->{subdir}) { + push @ARGV, "-D", $self->{subdir}, + } + my $comm ; + if ($level == 0) { + $comm = "-Tqca"; + } else { + $comm = "-Tqcg"; + } + if ($#{$self->{exclude}} >= 0) { + $comm .= "X"; + } + if ($#{$self->{include}} >= 0) { + $comm .= "I"; + } + push @ARGV, $comm, "-"; + if ($#{$self->{exclude}} >= 0) { + push @ARGV, @{$self->{exclude}}; + } + if ($#{$self->{include}} >= 0) { + push @ARGV, @{$self->{include}}; + } + debug("execute: " . $self->{smbclient} . " " . + join(" ", @ARGV)); + exec {$self->{smbclient}} @ARGV; + } + + my $ff = $parent_wtr->fileno; + debug("parent_wtr $ff"); + debug("password $self->{password}"); + $parent_wtr->print($self->{password}); + $parent_wtr->close(); + $child_rdr->close(); + close($wtr); + + #index process + my $index; + debug("$self->{gnutar} -tf -"); + my $pid_index1 = open2($index, '<&INDEX_TEE', $self->{gnutar}, "-tf", "-"); + close(INDEX_IN); + my $size = -1; + my $index_fd = $index->fileno; + debug("index $index_fd"); + if (defined($self->{index})) { + my $indexout_fd; + open($indexout_fd, '>&=4') || die(); + $self->parse_backup($index, $mesgout_fd, $indexout_fd); + close($indexout_fd); + } + else { + $self->parse_backup($index_fd, $mesgout_fd, undef); + } + close($index); + + while (<$err>) { + chomp; + debug("stderr: " . $_); + next if /^Domain=/; + next if /dumped (\d+) files and directories/; + if (/^Total bytes written: (\d*)/) { + $size = $1; + } else { + $self->print_to_server($self->{action}, "smbclient: $_", + $Amanda::Script_App::ERROR); + } + } + if ($size >= 0) { + my $ksize = $size / 1024; + if ($ksize < 32) { + $ksize = 32; + } + print $mesgout_fd "sendbackup: size $ksize\n"; + print $mesgout_fd "sendbackup: end\n"; + } + + waitpid $pid, 0; + if ($? != 0) { + $self->print_to_server_and_die($self->{action}, + "smbclient returned error", + $Amanda::Script_App::ERROR); + } + exit 0; +} + +sub parse_backup { + my $self = shift; + my($fhin, $fhout, $indexout) = @_; + my $size = -1; + while(<$fhin>) { + if ( /^\.\//) { + if(defined($indexout)) { + if(defined($self->{index})) { + s/^\.//; + print $indexout $_; + } + } + } + else { + print $fhout "? $_"; + } + } +} + +sub command_index_from_output { + index_from_output(0, 1); + exit 0; +} + +sub index_from_output { + my($fhin, $fhout) = @_; + my($size) = -1; + while(<$fhin>) { + next if /^Total bytes written:/; + next if !/^\.\//; + s/^\.//; + print $fhout $_; + } +} + +sub command_index_from_image { + my $self = shift; + my $index_fd; + open($index_fd, "$self->{gnutar} --list --file - |") || die(); + index_from_output($index_fd, 1); +} + +sub command_restore { + my $self = shift; + my @cmd = (); + + $self->{restore} = 'backup'; + $self->parsesharename(); + chdir(Amanda::Util::get_original_cwd()); + + if ($self->{recover_mode} eq "smb") { + $self->findpass(); + push @cmd, $self->{smbclient}, $self->{share}, + "-d", "0", + "-U", $self->{username}; + + if (defined $self->{domain}) { + push @cmd, "-W", $self->{domain}; + } + push @cmd, "-Tx", "-"; + for(my $i=1;defined $ARGV[$i]; $i++) { + my $param = $ARGV[$i]; + $param =~ /^(.*)$/; + push @cmd, $1; + } + my ($parent_rdr, $child_wtr); + $^F=10; + pipe($parent_rdr, $child_wtr); + $child_wtr->autoflush(1); + my($wtr, $rdr, $err); + $err = Symbol::gensym; + my $pid = open3($wtr, $rdr, $err, "-"); + if ($pid == 0) { + $child_wtr->print($self->{password}); + $child_wtr->close(); + exit 0; + } + $child_wtr->close(); + $ENV{PASSWD_FD} = $parent_rdr->fileno; + debug("cmd:" . join(" ", @cmd)); + exec { $cmd[0] } @cmd; + die("Can't exec '", $cmd[0], "'"); + } else { + push @cmd, $self->{gnutar}, "-xpvf", "-"; + for(my $i=1;defined $ARGV[$i]; $i++) { + my $param = $ARGV[$i]; + $param =~ /^(.*)$/; + push @cmd, $1; + } + debug("cmd:" . join(" ", @cmd)); + exec { $cmd[0] } @cmd; + die("Can't exec '", $cmd[0], "'"); + } +} + +sub command_validate { + my $self = shift; + + $self->{validate} = 'backup'; + my(@cmd) = ($self->{gnutar}, "-tf", "-"); + debug("cmd:" . join(" ", @cmd)); + my $pid = open3('>&STDIN', '>&STDOUT', '>&STDERR', @cmd) || die("validate", "Unable to run @cmd"); + waitpid $pid, 0; + if( $? != 0 ){ + die("validate", "$self->{gnutar} returned error"); + } + exit(0); +} + +sub command_print_command { +} + +package main; + +sub usage { + print < --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --calcsize. +EOF + exit(1); +} + +my $opt_version; +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my $opt_calcsize; +my $opt_gnutar_path; +my $opt_smbclient_path; +my $opt_amandapass; +my @opt_exclude_file; +my @opt_exclude_list; +my $opt_exclude_optional; +my @opt_include_file; +my @opt_include_list; +my $opt_include_optional; +my $opt_recover_mode; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'version' => \$opt_version, + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record' => \$opt_record, + 'calcsize' => \$opt_calcsize, + 'gnutar_path' => \$opt_gnutar_path, + 'smbclient_path' => \$opt_smbclient_path, + 'amandapass' => \$opt_amandapass, + 'exclude-file=s' => \@opt_exclude_file, + 'exclude-list=s' => \@opt_exclude_list, + 'exclude-optional=s' => \$opt_exclude_optional, + 'include-file=s' => \@opt_include_file, + 'include-list=s' => \@opt_include_list, + 'include-optional=s' => \$opt_include_optional, + 'recover-mode=s' => \$opt_recover_mode, +) or usage(); + +if (defined $opt_version) { + print "amsamba-" . $Amanda::Constants::VERSION , "\n"; + exit(0); +} + +my $application = Amanda::Application::Amsamba->new($opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, $opt_calcsize, $opt_gnutar_path, $opt_smbclient_path, $opt_amandapass, \@opt_exclude_file, \@opt_exclude_list, $opt_exclude_optional, \@opt_include_file, \@opt_include_list, $opt_include_optional, $opt_recover_mode); + +$application->do($ARGV[0]); diff --git a/application-src/amstar.c b/application-src/amstar.c new file mode 100644 index 0000000..eb6e494 --- /dev/null +++ b/application-src/amstar.c @@ -0,0 +1,797 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ +/* + * $Id: amstar.c 8888 2007-10-02 13:40:42Z martineau $ + * + * send estimated backup sizes using dump + */ + +/* PROPERTY: + * + * STAR-PATH (default STAR) + * STAR-TARDUMP + * STAR-DLE-TARDUMP + * ONE-FILE-SYSTEM + * SPARSE + */ + +#include "amanda.h" +#include "pipespawn.h" +#include "amfeatures.h" +#include "amandates.h" +#include "clock.h" +#include "util.h" +#include "getfsent.h" +#include "version.h" +#include "client_util.h" +#include "conffile.h" +#include "amandad.h" +#include "getopt.h" +#include "sendbackup.h" + +int debug_application = 1; +#define application_debug(i, ...) do { \ + if ((i) <= debug_application) { \ + dbprintf(__VA_ARGS__); \ + } \ +} while (0) + +static amregex_t re_table[] = { + /* tar prints the size in bytes */ + AM_SIZE_RE("star: [0-9][0-9]* blocks", 10240, 1), + AM_NORMAL_RE("^could not open conf file"), + AM_NORMAL_RE("^Type of this level "), + AM_NORMAL_RE("^Date of this level "), + AM_NORMAL_RE("^Date of last level "), + AM_NORMAL_RE("^Dump record level "), + AM_NORMAL_RE("^Throughput"), + AM_NORMAL_RE("^.*is sparse$"), + +#ifdef IGNORE_TAR_ERRORS + AM_NORMAL_RE("^.*shrunk*$"), + AM_NORMAL_RE("^.*changed size.*$"), + AM_NORMAL_RE("^.*Cannot listxattr for.*$"), + AM_NORMAL_RE("^.Cannot: stat .*$"), + AM_NORMAL_RE("^.Missing links .*$"), + AM_NORMAL_RE("^.Cannot get xattr.*$"), + AM_NORMAL_RE("^.Cannot.*acl.*$"), +#endif + + AM_NORMAL_RE("^star: dumped [0-9][0-9]* (tar )?files"), + AM_NORMAL_RE("^.*The following problems occurred during .* processing.*$"), + AM_NORMAL_RE("^.*Processed all possible files, despite earlier errors.*$"), + AM_NORMAL_RE("^.*not written due to problems during backup.*$"), + + AM_STRANGE_RE("^Perform a level 0 dump first.*$"), + + /* catch-all: DMP_STRANGE is returned for all other lines */ + AM_STRANGE_RE(NULL) +}; + +/* local functions */ +int main(int argc, char **argv); + +typedef struct application_argument_s { + char *config; + char *host; + int message; + int collection; + int calcsize; + GSList *level; + dle_t dle; + int argc; + char **argv; +} application_argument_t; + +enum { CMD_ESTIMATE, CMD_BACKUP }; + +static void amstar_support(application_argument_t *argument); +static void amstar_selfcheck(application_argument_t *argument); +static void amstar_estimate(application_argument_t *argument); +static void amstar_backup(application_argument_t *argument); +static void amstar_restore(application_argument_t *argument); +static void amstar_validate(application_argument_t *argument); +static char **amstar_build_argv(application_argument_t *argument, + int level, + int command); +char *star_path; +char *star_tardumps; +int star_dle_tardumps; +int star_onefilesystem; +int star_sparse; + +static struct option long_options[] = { + {"config" , 1, NULL, 1}, + {"host" , 1, NULL, 2}, + {"disk" , 1, NULL, 3}, + {"device" , 1, NULL, 4}, + {"level" , 1, NULL, 5}, + {"index" , 1, NULL, 6}, + {"message" , 1, NULL, 7}, + {"collection" , 0, NULL, 8}, + {"record" , 0, NULL, 9}, + {"star-path" , 1, NULL, 10}, + {"star-tardump" , 1, NULL, 11}, + {"star-dle-tardump", 1, NULL, 12}, + {"one-file-system" , 1, NULL, 13}, + {"sparse" , 1, NULL, 14}, + {"calcsize" , 0, NULL, 15}, + { NULL, 0, NULL, 0} +}; + + +int +main( + int argc, + char ** argv) +{ + int c; + char *command; + application_argument_t argument; + +#ifdef STAR + star_path = STAR; +#else + star_path = NULL; +#endif + star_tardumps = "/etc/tardumps"; + star_dle_tardumps = 0; + star_onefilesystem = 1; + star_sparse = 1; + + /* initialize */ + + /* + * Configure program for internationalization: + * 1) Only set the message locale for now. + * 2) Set textdomain for all amanda related programs to "amanda" + * We don't want to be forced to support dozens of message catalogs. + */ + setlocale(LC_MESSAGES, "C"); + textdomain("amanda"); + + /* drop root privileges */ + + if (!set_root_privs(0)) { + error(_("amstar must be run setuid root")); + } + + safe_fd(3, 2); + + set_pname("amstar"); + + /* Don't die when child closes pipe */ + signal(SIGPIPE, SIG_IGN); + +#if defined(USE_DBMALLOC) + malloc_size_1 = malloc_inuse(&malloc_hist_1); +#endif + + erroutput_type = (ERR_INTERACTIVE|ERR_SYSLOG); + dbopen(DBG_SUBDIR_CLIENT); + startclock(); + dbprintf(_("version %s\n"), version()); + + config_init(CONFIG_INIT_CLIENT, NULL); + + //check_running_as(RUNNING_AS_DUMPUSER_PREFERRED); + //root for amrecover + //RUNNING_AS_CLIENT_LOGIN from selfcheck, sendsize, sendbackup + + /* parse argument */ + command = argv[1]; + + argument.config = NULL; + argument.host = NULL; + argument.message = 0; + argument.collection = 0; + argument.calcsize = 0; + argument.level = NULL; + init_dle(&argument.dle); + + opterr = 0; + while (1) { + int option_index = 0; + c = getopt_long (argc, argv, "", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 1: argument.config = stralloc(optarg); + break; + case 2: argument.host = stralloc(optarg); + break; + case 3: argument.dle.disk = stralloc(optarg); + break; + case 4: argument.dle.device = stralloc(optarg); + break; + case 5: argument.level = g_slist_append(argument.level, + GINT_TO_POINTER(atoi(optarg))); + break; + case 6: argument.dle.create_index = 1; + break; + case 7: argument.message = 1; + break; + case 8: argument.collection = 1; + break; + case 9: argument.dle.record = 1; + break; + case 10: star_path = stralloc(optarg); + break; + case 11: star_tardumps = stralloc(optarg); + break; + case 12: if (optarg && strcasecmp(optarg, "YES") == 0) + star_dle_tardumps = 1; + break; + case 13: if (optarg && strcasecmp(optarg, "YES") != 0) + star_onefilesystem = 0; + break; + case 14: if (optarg && strcasecmp(optarg, "YES") != 0) + star_sparse = 1; + break; + case 15: argument.calcsize = 1; + break; + case ':': + case '?': + break; + } + } + + argument.argc = argc - optind; + argument.argv = argv + optind; + + if (argument.config) { + /* overlay this configuration on the existing (nameless) configuration */ + config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, + argument.config); + dbrename(get_config_name(), DBG_SUBDIR_CLIENT); + + } + + if (config_errors(NULL) >= CFGERR_ERRORS) { + g_critical(_("errors processing config file")); + } + + if (strcmp(command, "support") == 0) { + amstar_support(&argument); + } else if (strcmp(command, "selfcheck") == 0) { + amstar_selfcheck(&argument); + } else if (strcmp(command, "estimate") == 0) { + amstar_estimate(&argument); + } else if (strcmp(command, "backup") == 0) { + amstar_backup(&argument); + } else if (strcmp(command, "restore") == 0) { + amstar_restore(&argument); + } else if (strcmp(command, "validate") == 0) { + amstar_validate(&argument); + } else { + fprintf(stderr, "Unknown command `%s'.\n", command); + exit (1); + } + return 0; +} + +static void +amstar_support( + application_argument_t *argument) +{ + (void)argument; + fprintf(stdout, "CONFIG YES\n"); + fprintf(stdout, "HOST YES\n"); + fprintf(stdout, "DISK YES\n"); + fprintf(stdout, "MAX-LEVEL 9\n"); + fprintf(stdout, "INDEX-LINE YES\n"); + fprintf(stdout, "INDEX-XML NO\n"); + fprintf(stdout, "MESSAGE-LINE YES\n"); + fprintf(stdout, "MESSAGE-XML NO\n"); + fprintf(stdout, "RECORD YES\n"); + fprintf(stdout, "INCLUDE-FILE NO\n"); + fprintf(stdout, "INCLUDE-LIST NO\n"); + fprintf(stdout, "EXCLUDE-FILE YES\n"); + fprintf(stdout, "EXCLUDE-LIST YES\n"); + fprintf(stdout, "COLLECTION NO\n"); + fprintf(stdout, "MULTI-ESTIMATE YES\n"); + fprintf(stdout, "CALCSIZE YES\n"); +} + +static void +amstar_selfcheck( + application_argument_t *argument) +{ + char *qdisk; + char *qdevice; + + qdisk = quote_string(argument->dle.disk); + qdevice = quote_string(argument->dle.device); + fprintf(stdout, "OK %s\n", qdisk); + fprintf(stdout, "OK %s\n", qdevice); + + if (!star_path) { + fprintf(stdout, "ERROR STAR-PATH not defined\n"); + } else { + check_file(star_path, X_OK); + } + + { + char *amandates_file; + amandates_file = getconf_str(CNF_AMANDATES); + check_file(amandates_file, R_OK|W_OK); + } + +} + +static void +amstar_estimate( + application_argument_t *argument) +{ + char **my_argv = NULL; + char *cmd = NULL; + int nullfd; + int pipefd; + FILE *dumpout = NULL; + off_t size = -1; + char line[32768]; + char *errmsg = NULL; + char *qerrmsg; + char *qdisk; + amwait_t wait_status; + int starpid; + amregex_t *rp; + times_t start_time; + int level = 0; + GSList *levels = NULL; + + qdisk = quote_string(argument->dle.disk); + if (argument->calcsize) { + char *dirname; + + dirname = amname_to_dirname(argument->dle.device); + run_calcsize(argument->config, "STAR", argument->dle.disk, dirname, + argument->level, NULL, NULL); + return; + } + + if (!star_path) { + errmsg = vstrallocf(_("STAR-PATH not defined")); + goto common_error; + } + cmd = stralloc(star_path); + + start_time = curclock(); + + for (levels = argument->level; levels != NULL; levels = levels->next) { + level = GPOINTER_TO_INT(levels->data); + my_argv = amstar_build_argv(argument, level, CMD_ESTIMATE); + + if ((nullfd = open("/dev/null", O_RDWR)) == -1) { + errmsg = vstrallocf(_("Cannot access /dev/null : %s"), + strerror(errno)); + goto common_error; + } + + starpid = pipespawnv(cmd, STDERR_PIPE, 1, + &nullfd, &nullfd, &pipefd, my_argv); + + dumpout = fdopen(pipefd,"r"); + if (!dumpout) { + errmsg = vstrallocf(_("Can't fdopen: %s"), strerror(errno)); + goto common_error; + } + + size = (off_t)-1; + while (size < 0 && (fgets(line, sizeof(line), dumpout)) != NULL) { + if (line[strlen(line)-1] == '\n') /* remove trailling \n */ + line[strlen(line)-1] = '\0'; + if (line[0] == '\0') + continue; + dbprintf("%s\n", line); + /* check for size match */ + /*@ignore@*/ + for(rp = re_table; rp->regex != NULL; rp++) { + if(match(rp->regex, line)) { + if (rp->typ == DMP_SIZE) { + size = ((the_num(line, rp->field)*rp->scale+1023.0)/1024.0); + if(size < 0.0) + size = 1.0; /* found on NeXT -- sigh */ + } + break; + } + } + /*@end@*/ + } + + while ((fgets(line, sizeof(line), dumpout)) != NULL) { + dbprintf("%s", line); + } + + dbprintf(".....\n"); + dbprintf(_("estimate time for %s level %d: %s\n"), + qdisk, + level, + walltime_str(timessub(curclock(), start_time))); + if(size == (off_t)-1) { + errmsg = vstrallocf(_("no size line match in %s output"), + my_argv[0]); + dbprintf(_("%s for %s\n"), errmsg, qdisk); + dbprintf(".....\n"); + } else if(size == (off_t)0 && argument->level == 0) { + dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), + my_argv[0], argument->dle.disk); + dbprintf(".....\n"); + } + dbprintf(_("estimate size for %s level %d: %lld KB\n"), + qdisk, + level, + (long long)size); + + kill(-starpid, SIGTERM); + + dbprintf(_("waiting for %s \"%s\" child\n"), my_argv[0], qdisk); + waitpid(starpid, &wait_status, 0); + if (WIFSIGNALED(wait_status)) { + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), + cmd, WTERMSIG(wait_status), dbfn()); + } else if (WIFEXITED(wait_status)) { + if (WEXITSTATUS(wait_status) != 0) { + errmsg = vstrallocf(_("%s exited with status %d: see %s"), + cmd, WEXITSTATUS(wait_status), dbfn()); + } else { + /* Normal exit */ + } + } else { + errmsg = vstrallocf(_("%s got bad exit: see %s"), cmd, dbfn()); + } + dbprintf(_("after %s %s wait\n"), my_argv[0], qdisk); + + amfree(my_argv); + + aclose(nullfd); + afclose(dumpout); + + fprintf(stdout, "%d %lld 1\n", level, (long long)size); + } + amfree(qdisk); + amfree(cmd); + return; + +common_error: + dbprintf("%s\n", errmsg); + qerrmsg = quote_string(errmsg); + amfree(qdisk); + dbprintf("%s", errmsg); + fprintf(stdout, "ERROR %s\n", qerrmsg); + amfree(errmsg); + amfree(qerrmsg); + amfree(cmd); +} + +static void +amstar_backup( + application_argument_t *argument) +{ + int dumpin; + char *cmd = NULL; + char *qdisk; + char line[32768]; + amregex_t *rp; + off_t dump_size = -1; + char *type; + char startchr; + char **my_argv; + int starpid; + int dataf = 1; + int mesgf = 3; + int indexf = 4; + int outf; + FILE *mesgstream; + FILE *indexstream = NULL; + FILE *outstream; + int level = GPOINTER_TO_INT(argument->level->data); + + qdisk = quote_string(argument->dle.disk); + + my_argv = amstar_build_argv(argument, level, CMD_BACKUP); + + cmd = stralloc(star_path); + + starpid = pipespawnv(cmd, STDIN_PIPE|STDERR_PIPE, 1, + &dumpin, &dataf, &outf, my_argv); + + /* close the write ends of the pipes */ + aclose(dumpin); + aclose(dataf); + if (argument->dle.create_index) { + indexstream = fdopen(indexf, "w"); + if (!indexstream) { + error(_("error indexstream(%d): %s\n"), indexf, strerror(errno)); + } + } + mesgstream = fdopen(mesgf, "w"); + if (!mesgstream) { + error(_("error mesgstream(%d): %s\n"), mesgf, strerror(errno)); + } + outstream = fdopen(outf, "r"); + if (!outstream) { + error(_("error outstream(%d): %s\n"), outf, strerror(errno)); + } + + while ((fgets(line, sizeof(line), outstream)) != NULL) { + regmatch_t regmatch[3]; + regex_t regex; + int got_match = 0; + + if (line[strlen(line)-1] == '\n') /* remove trailling \n */ + line[strlen(line)-1] = '\0'; + + regcomp(®ex, "^a \\.\\/ directory$", REG_EXTENDED|REG_NEWLINE); + if (regexec(®ex, line, 1, regmatch, 0) == 0) { + got_match = 1; + if (argument->dle.create_index) + fprintf(indexstream, "%s\n", "/\n"); + } + regfree(®ex); + + regcomp(®ex, "^a (.*) directory$", REG_EXTENDED|REG_NEWLINE); + if (regexec(®ex, line, 3, regmatch, 0) == 0) { + got_match = 1; + if (argument->dle.create_index && regmatch[1].rm_so == 2) { + line[regmatch[1].rm_eo+1]='\0'; + fprintf(indexstream, "/%s\n", &line[regmatch[1].rm_so]); + } + } + regfree(®ex); + + regcomp(®ex, "^a (.*) (.*) bytes", REG_EXTENDED|REG_NEWLINE); + if (regexec(®ex, line, 3, regmatch, 0) == 0) { + got_match = 1; + if (argument->dle.create_index && regmatch[1].rm_so == 2) { + line[regmatch[1].rm_eo]='\0'; + fprintf(indexstream, "/%s\n", &line[regmatch[1].rm_so]); + } + } + regfree(®ex); + + regcomp(®ex, "^a (.*) special", REG_EXTENDED|REG_NEWLINE); + if (regexec(®ex, line, 3, regmatch, 0) == 0) { + got_match = 1; + if (argument->dle.create_index && regmatch[1].rm_so == 2) { + line[regmatch[1].rm_eo]='\0'; + fprintf(indexstream, "/%s\n", &line[regmatch[1].rm_so]); + } + } + regfree(®ex); + + regcomp(®ex, "^a (.*) symbolic", REG_EXTENDED|REG_NEWLINE); + if (regexec(®ex, line, 3, regmatch, 0) == 0) { + got_match = 1; + if (argument->dle.create_index && regmatch[1].rm_so == 2) { + line[regmatch[1].rm_eo]='\0'; + fprintf(indexstream, "/%s\n", &line[regmatch[1].rm_so]); + } + } + regfree(®ex); + + if (got_match == 0) { /* message */ + for(rp = re_table; rp->regex != NULL; rp++) { + if(match(rp->regex, line)) { + break; + } + } + if(rp->typ == DMP_SIZE) { + dump_size = (long)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0); + } + switch(rp->typ) { + case DMP_NORMAL: + type = "normal"; + startchr = '|'; + break; + case DMP_STRANGE: + type = "strange"; + startchr = '?'; + break; + case DMP_SIZE: + type = "size"; + startchr = '|'; + break; + case DMP_ERROR: + type = "error"; + startchr = '?'; + break; + default: + type = "unknown"; + startchr = '!'; + break; + } + dbprintf("%3d: %7s(%c): %s\n", rp->srcline, type, startchr, line); + fprintf(mesgstream,"%c %s\n", startchr, line); + } + } + + dbprintf(_("gnutar: %s: pid %ld\n"), cmd, (long)starpid); + + dbprintf("sendbackup: size %lld\n", (long long)dump_size); + fprintf(mesgstream, "sendbackup: size %lld\n", (long long)dump_size); + dbprintf("sendbackup: end\n"); + fprintf(mesgstream, "sendbackup: end\n"); + + fclose(mesgstream); + if (argument->dle.create_index) + fclose(indexstream); + + amfree(qdisk); + amfree(cmd); +} + +static void +amstar_restore( + application_argument_t *argument) +{ + char *cmd; + char **my_argv; + char **env; + int i, j; + char *e; + + if (!star_path) { + error(_("STAR-PATH not defined")); + } + + cmd = stralloc(star_path); + my_argv = alloc(SIZEOF(char *) * (11 + argument->argc)); + i = 0; + my_argv[i++] = stralloc(star_path); + my_argv[i++] = stralloc("-x"); + my_argv[i++] = stralloc("-v"); + my_argv[i++] = stralloc("-xattr"); + my_argv[i++] = stralloc("-acl"); + my_argv[i++] = stralloc("errctl=WARN|SAMEFILE|SETTIME|DIFF|SETACL|SETXATTR|SETMODE|BADACL *"); + my_argv[i++] = stralloc("-no-fifo"); + my_argv[i++] = stralloc("-f"); + my_argv[i++] = stralloc("-"); + + for (j=1; j< argument->argc; j++) + my_argv[i++] = stralloc(argument->argv[j]+2); /* remove ./ */ + my_argv[i++] = NULL; + + env = safe_env(); + become_root(); + execve(cmd, my_argv, env); + e = strerror(errno); + error(_("error [exec %s: %s]"), cmd, e); + +} + +static void +amstar_validate( + application_argument_t *argument G_GNUC_UNUSED) +{ + char *cmd; + char **my_argv; + char **env; + int i; + char *e; + + if (!star_path) { + error(_("STAR-PATH not defined")); + } + + cmd = stralloc(star_path); + my_argv = alloc(SIZEOF(char *) * 5); + i = 0; + my_argv[i++] = stralloc(star_path); + my_argv[i++] = stralloc("-t"); + my_argv[i++] = stralloc("-f"); + my_argv[i++] = stralloc("-"); + my_argv[i++] = NULL; + + env = safe_env(); + execve(cmd, my_argv, env); + e = strerror(errno); + error(_("error [exec %s: %s]"), cmd, e); + +} + +char **amstar_build_argv( + application_argument_t *argument, + int level, + int command) +{ + int i; + char *dirname; + char *fsname; + char levelstr[NUM_STR_SIZE+7]; + char **my_argv; + char *s; + char *tardumpfile; + + dirname = amname_to_dirname(argument->dle.device); + fsname = vstralloc("fs-name=", dirname, NULL); + for (s = fsname; *s != '\0'; s++) { + if (iscntrl((int)*s)) + *s = '-'; + } + snprintf(levelstr, SIZEOF(levelstr), "-level=%d", level); + + if (star_dle_tardumps) { + char *sdisk = sanitise_filename(argument->dle.disk); + tardumpfile = vstralloc(star_tardumps, sdisk, NULL); + amfree(sdisk); + } else { + tardumpfile = stralloc(star_tardumps); + } + + my_argv = alloc(SIZEOF(char *) * 32); + i = 0; + + my_argv[i++] = star_path; + + my_argv[i++] = stralloc("-c"); + my_argv[i++] = stralloc("-f"); + if (command == CMD_ESTIMATE) { + my_argv[i++] = stralloc("/dev/null"); + } else { + my_argv[i++] = stralloc("-"); + } + my_argv[i++] = stralloc("-C"); +#if defined(__CYGWIN__) + { + char tmppath[PATH_MAX]; + + cygwin_conv_to_full_posix_path(dirname, tmppath); + my_argv[i++] = stralloc(tmppath); + } +#else + my_argv[i++] = stralloc(dirname); +#endif + my_argv[i++] = stralloc(fsname); + if (star_onefilesystem) + my_argv[i++] = stralloc("-xdev"); + my_argv[i++] = stralloc("-link-dirs"); + my_argv[i++] = stralloc(levelstr); + my_argv[i++] = stralloc2("tardumps=", tardumpfile); + if (command == CMD_BACKUP) + my_argv[i++] = stralloc("-wtardumps"); + my_argv[i++] = stralloc("-xattr"); + my_argv[i++] = stralloc("-acl"); + my_argv[i++] = stralloc("H=exustar"); + my_argv[i++] = stralloc("errctl=WARN|SAMEFILE|DIFF|GROW|SHRINK|SPECIALFILE|GETXATTR|BADACL *"); + if (star_sparse) + my_argv[i++] = stralloc("-sparse"); + my_argv[i++] = stralloc("-dodesc"); + + if (command == CMD_BACKUP && argument->dle.create_index) + my_argv[i++] = stralloc("-v"); + + my_argv[i++] = stralloc("."); + + my_argv[i] = NULL; + + amfree(tardumpfile); + amfree(fsname); + amfree(dirname); + + return(my_argv); +} diff --git a/application-src/amzfs-sendrecv.pl b/application-src/amzfs-sendrecv.pl new file mode 100644 index 0000000..628f3af --- /dev/null +++ b/application-src/amzfs-sendrecv.pl @@ -0,0 +1,302 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Getopt::Long; + +package Amanda::Application::Amzfs_sendrecv; +use base qw(Amanda::Application Amanda::Application::Zfs); +use File::Copy; +use File::Path; +use IPC::Open3; +use Sys::Hostname; +use Symbol; +use Amanda::Constants; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Debug qw( :logging ); +use Amanda::Paths; +use Amanda::Util qw( :constants ); + +sub new { + my $class = shift; + my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $df_path, $zfs_path, $pfexec_path, $pfexec, $keep_snapshot) = @_; + my $self = $class->SUPER::new(); + + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{df_path} = $df_path; + $self->{zfs_path} = $zfs_path; + $self->{pfexec_path} = $pfexec_path; + $self->{pfexec} = $pfexec; + $self->{keep_snapshot} = $keep_snapshot; + $self->{pfexec_cmd} = undef; + + if ($self->{keep_snapshot} =~ /^YES$/i) { + $self->{keep_snapshot} = "YES"; + if (!defined $self->{record}) { + $self->{keep_snapshot} = "NO"; + } + } + + return $self; +} + +sub check_for_backup_failure { + my $self = shift; + my $action = shift; + + $self->zfs_destroy_snapshot($action); +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MAX-LEVEL 9\n"; + print "INDEX-LINE NO\n"; + print "INDEX-XML NO\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "RECORD YES\n"; + print "COLLECTION NO\n"; +} + +sub command_selfcheck { + my $self = shift; + + $self->zfs_set_value("check"); + if ($self->{error_status} == $Amanda::Script_App::GOOD) { + $self->zfs_create_snapshot("check"); + $self->zfs_destroy_snapshot("check"); + print "OK " . $self->{disk} . "\n"; + print "OK " . $self->{device} . "\n"; + } +} + +sub command_estimate() { + my $self = shift; + + my $level = 0; + + $self->zfs_set_value("estimate"); + $self->zfs_create_snapshot("estimate"); + + while (defined ($level = shift @{$self->{level}})) { + debug "Estimate of level $level"; + my $size = $self->estimate_snapshot($level); + output_size($level, $size); + } + + $self->zfs_destroy_snapshot("estimate"); + + exit 0; +} + +sub output_size { + my($level) = shift; + my($size) = shift; + if($size == -1) { + print "$level -1 -1\n"; + #exit 2; + } + else { + my($ksize) = int $size / (1024); + $ksize=32 if ($ksize<32); + print "$level $ksize 1\n"; + } +} + +sub command_backup { + my $self = shift; + + my $mesgout_fd; + open($mesgout_fd, '>&=3') || die(); + $self->{mesgout} = $mesgout_fd; + + $self->zfs_set_value("backup"); + $self->zfs_create_snapshot("backup"); + + my $size = -1; + my $level = $self->{level}[0]; + my $cmd; + debug "Backup of level $level"; + if ($level == 0) { + $cmd = "$self->{pfexec_cmd} $self->{zfs_path} send $self->{filesystem}\@$self->{snapshot} | $Amanda::Paths::amlibexecdir/teecount"; + } else { + my $refsnapshotname = $self->zfs_find_snapshot_level($level-1); + debug "Referenced snapshot name: $refsnapshotname|"; + if ($refsnapshotname ne "") { + $cmd = "$self->{pfexec_cmd} $self->{zfs_path} send -i $refsnapshotname $self->{filesystem}\@$self->{snapshot} | $Amanda::Paths::amlibexecdir/teecount"; + } else { + $self->print_to_server_and_die("sendbackup", "cannot backup snapshot '$self->{filesystem}\@$self->{snapshot}': reference snapshot doesn't exists for level $level", $Amanda::Script_App::ERROR); + } + } + + debug "running (backup): $cmd"; + my($wtr, $err, $pid); + my($errmsg); + $err = Symbol::gensym; + $pid = open3($wtr, '>&STDOUT', $err, $cmd); + close $wtr; + $errmsg = <$err>; + waitpid $pid, 0; + close $err; + if ($? != 0) { + if (defined $errmsg) { + $self->print_to_server_and_die("sendbackup", $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die("sendbackup", "cannot backup snapshot '$self->{filesystem}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } + $size = $errmsg; + debug "Dump done"; + + my($ksize) = int ($size/1024); + $ksize=32 if ($ksize<32); + + print $mesgout_fd "sendbackup: size $ksize\n"; + print $mesgout_fd "sendbackup: end\n"; + + # destroy all snapshot of this level and higher + $self->zfs_purge_snapshot($level, 9, "backup"); + + if ($self->{keep_snapshot} eq 'YES') { + $self->zfs_rename_snapshot($level, "backup"); + } else { + $self->zfs_destroy_snapshot("backup"); + } + + exit 0; +} + +sub estimate_snapshot +{ + my $self = shift; + my $level = shift; + my $action = shift; + + debug "\$filesystem = $self->{filesystem}"; + debug "\$snapshot = $self->{snapshot}"; + debug "\$level = $level"; + + my $cmd; + if ($level == 0) { + $cmd = "$self->{pfexec_cmd} $self->{zfs_path} get -Hp -o value referenced $self->{filesystem}\@$self->{snapshot}"; + } else { + my $refsnapshotname = $self->zfs_find_snapshot_level($level-1); + debug "Referenced snapshot name: $refsnapshotname|"; + if ($refsnapshotname ne "") { + $cmd = "$self->{pfexec_cmd} $self->{zfs_path} send -i $refsnapshotname $self->{filesystem}\@$self->{snapshot} | /usr/bin/wc -c"; + } else { + return "-1"; + } + } + debug "running (estimate): $cmd"; + my($wtr, $rdr, $err, $pid); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + my ($msg) = <$rdr>; + my ($errmsg) = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if ($? != 0) { + if (defined $msg && defined $errmsg) { + $self->print_to_server_and_die($action, "$msg, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $msg) { + $self->print_to_server_and_die($action, $msg, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, "cannot estimate snapshot '$self->{snapshot}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } + + return $msg; +} + +sub command_index_from_output { +} + +sub command_index_from_image { +} + +sub command_restore { +} + +sub command_print_command { +} + +package main; + +sub usage { + print < --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --df-path= --zfs-path= --pfexec-path= --pfexec= --keep-snapshot=. +EOF + exit(1); +} + +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my $df_path = 'df'; +my $zfs_path = 'zfs'; +my $pfexec_path = 'pfexec'; +my $pfexec = "NO"; +my $opt_keep_snapshot = "YES"; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record' => \$opt_record, + 'df-path=s' => \$df_path, + 'zfs-path=s' => \$zfs_path, + 'pfexec-path=s' => \$pfexec_path, + 'pfexec=s' => \$pfexec, + 'keep-snapshot=s' => \$opt_keep_snapshot +) or usage(); + +my $application = Amanda::Application::Amzfs_sendrecv->new($opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, $df_path, $zfs_path, $pfexec_path, $pfexec, $opt_keep_snapshot); + +$application->do($ARGV[0]); + diff --git a/application-src/amzfs-snapshot.pl b/application-src/amzfs-snapshot.pl new file mode 100644 index 0000000..fefd25a --- /dev/null +++ b/application-src/amzfs-snapshot.pl @@ -0,0 +1,191 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# PROPERTY: +# +# DF-PATH (Default from PATH): Path to the 'df' binary +# ZFS-PATH (Default from PATH): Path to the 'zfs' binary +# PFEXEC-PATH (Default from PATH): Path to the 'pfexec' binary +# PFEXEC (Default NO): Set to "YES" if you want to use pfexec +# +use lib '@amperldir@'; +use strict; +use Getopt::Long; + +package Amanda::Script::Amzfs_snapshot; +use base qw(Amanda::Script Amanda::Application::Zfs); +use Symbol; +use IPC::Open3; +use Amanda::Config qw( :getconf :init ); +use Amanda::Debug qw( :logging ); +use Amanda::Util qw( :constants ); +use Amanda::Paths; +use Amanda::Constants; + +sub new { + my $class = shift; + my ($execute_where, $config, $host, $disk, $device, $level, $index, $message, $collection, $record, $df_path, $zfs_path, $pfexec_path, $pfexec) = @_; + my $self = $class->SUPER::new($execute_where); + + $self->{execute_where} = $execute_where; + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; # Copy the array + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{df_path} = $df_path; + $self->{zfs_path} = $zfs_path; + $self->{pfexec_path} = $pfexec_path; + $self->{pfexec} = $pfexec; + $self->{pfexec_cmd} = undef; + + return $self; +} + +sub zfs_snapshot_set_value() { + my $self = shift; + my $action = shift; + + $self->zfs_set_value($action); + + if (!defined $self->{mountpoint}) { + $self->print_to_server($action, "$self->{disk} is not a directory", $Amanda::Script_App::ERROR); + + } +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "EXECUTE-WHERE YES\n"; +} + +#define a execute_on_* function for every execute_on you want the script to do +#something +sub command_pre_dle_amcheck { + my $self = shift; + + $self->zfs_snapshot_set_value("check"); + + if ($self->{error_status} == $Amanda::Script_App::GOOD) { + if (defined $self->{mountpoint}) { + $self->print_to_server("check", "mountpoint $self->{mountpoint}", $Amanda::Script_App::GOOD); + $self->print_to_server("check", "directory $self->{directory}", $Amanda::Script_App::GOOD); + $self->print_to_server("check", "dir $self->{dir}", $Amanda::Script_App::GOOD); + } + $self->print_to_server("check", "snapshot $self->{snapshot}", $Amanda::Script_App::GOOD); + $self->zfs_create_snapshot("check"); + print "PROPERTY directory $self->{directory}\n"; + } +} + +sub command_post_dle_amcheck { + my $self = shift; + + $self->zfs_snapshot_set_value("check"); + $self->zfs_destroy_snapshot("check"); +} + +sub command_pre_dle_estimate { + my $self = shift; + + $self->zfs_snapshot_set_value("estimate"); + if ($self->{error_status} == $Amanda::Script_App::GOOD) { + $self->zfs_create_snapshot("estimate"); + print "PROPERTY directory $self->{directory}\n"; + } +} + +sub command_post_dle_estimate { + my $self = shift; + + $self->zfs_snapshot_set_value("estimate"); + $self->zfs_destroy_snapshot("estimate"); +} + +sub command_pre_dle_backup { + my $self = shift; + + $self->zfs_snapshot_set_value("backup"); + if ($self->{error_status} == $Amanda::Script_App::GOOD) { + $self->zfs_create_snapshot("backup"); + print "PROPERTY directory $self->{directory}\n"; + } +} + +sub command_post_dle_backup { + my $self = shift; + + $self->zfs_snapshot_set_value("backup"); + $self->zfs_destroy_snapshot("backup"); +} + +package main; + +sub usage { + print < --execute-where=client --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --df-path= --zfs-path= --pfexec-path= --pfexec=. +EOF + exit(1); +} + +my $opt_execute_where; +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my $df_path = 'df'; +my $zfs_path = 'zfs'; +my $pfexec_path = 'pfexec'; +my $pfexec = "NO"; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'execute-where=s' => \$opt_execute_where, + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record=s' => \$opt_record, + 'df-path=s' => \$df_path, + 'zfs-path=s' => \$zfs_path, + 'pfexec-path=s' => \$pfexec_path, + 'pfexec=s' => \$pfexec +) or usage(); + +my $script = Amanda::Script::Amzfs_snapshot->new($opt_execute_where, $opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, $df_path, $zfs_path, $pfexec_path, $pfexec); +$script->do($ARGV[0]); diff --git a/application-src/script-email.pl b/application-src/script-email.pl new file mode 100644 index 0000000..b16f6a6 --- /dev/null +++ b/application-src/script-email.pl @@ -0,0 +1,210 @@ +#!@PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Getopt::Long; + +package Amanda::Script::Script_email; +use base qw(Amanda::Script); +use Amanda::Config qw( :getconf :init ); +use Amanda::Debug qw( :logging ); +use Amanda::Util qw( :constants ); +use Amanda::Paths; +use Amanda::Constants; + + +sub new { + my $class = shift; + my ($execute_where, $config, $host, $disk, $device, $level, $index, $message, $collection, $record, $mailto) = @_; + my $self = $class->SUPER::new($execute_where); + + $self->{execute_where} = $execute_where; + $self->{config} = $config; + $self->{host} = $host; + $self->{disk} = $disk; + $self->{device} = $device; + $self->{level} = [ @{$level} ]; # Copy the array + $self->{index} = $index; + $self->{message} = $message; + $self->{collection} = $collection; + $self->{record} = $record; + $self->{mailto} = [ @{$mailto} ]; # Copy the array + + return $self; +} + +sub command_support { + my $self = shift; + + print "CONFIG YES\n"; + print "HOST YES\n"; + print "DISK YES\n"; + print "MESSAGE-LINE YES\n"; + print "MESSAGE-XML NO\n"; + print "EXECUTE-WHERE YES\n"; +} + +#define a execute_on_* function for every execute_on you want the script to do +#something +sub command_pre_dle_amcheck { + my $self = shift; + $self->sendmail("pre-dle-amcheck"); +} + +sub command_pre_host_amcheck { + my $self = shift; + $self->sendmail("pre-host-amcheck"); +} + +sub command_post_dle_amcheck { + my $self = shift; + $self->sendmail("post-dle-amcheck"); +} + +sub command_post_host_amcheck { + my $self = shift; + $self->sendmail("post-host-amcheck"); +} + +sub command_pre_dle_estimate { + my $self = shift; + $self->sendmail("pre-dle-estimate"); +} + +sub command_pre_host_estimate { + my $self = shift; + $self->sendmail("pre-host-estimate"); +} + +sub command_post_dle_estimate { + my $self = shift; + $self->sendmail("post-dle-estimate"); +} + +sub command_post_host_estimate { + my $self = shift; + $self->sendmail("post-host-estimate"); +} + +sub command_pre_dle_backup { + my $self = shift; + $self->sendmail("pre-dle-backup"); +} + +sub command_pre_host_backup { + my $self = shift; + $self->sendmail("pre-host-backup"); +} + +sub command_post_dle_backup { + my $self = shift; + $self->sendmail("post-dle-backup"); +} + +sub command_post_host_backup { + my $self = shift; + $self->sendmail("post-host-backup"); +} + +sub command_pre_recover { + my $self = shift; + $self->sendmail("pre-recover"); +} + +sub command_post_recover { + my $self = shift; + $self->sendmail("post-recover"); +} + +sub command_pre_level_recover { + my $self = shift; + $self->sendmail("pre-level-recover"); +} + +sub command_post_level_recover { + my $self = shift; + $self->sendmail("post-level-recover"); +} + +sub command_inter_level_recover { + my $self = shift; + $self->sendmail("inter-level-recover"); +} + +sub sendmail { + my $self = shift; + my($function) = @_; + my $dest; + if ($self->{mailto}) { + my $destcheck = join ',', @{$self->{mailto}}; + $destcheck =~ /^([a-zA-Z,]*)$/; + $dest = $1; + } else { + $dest = "root"; + } + my @args = ( "-s", "$self->{config} $function $self->{host} $self->{disk} $self->{device} " . join (" ", @{$self->{level}}), $dest ); + my $args = join(" ", @args); + debug("cmd: $Amanda::Constants::MAILER $args\n"); + my $mail; + open $mail, '|-', $Amanda::Constants::MAILER, @args; + print $mail "$self->{config} $function $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), "\n"; + close $mail; +} + +package main; + +sub usage { + print < --execute-where= --config= --host= --disk= --device= --level= --index= --message= --collection= --record= --mailto=. +EOF + exit(1); +} + +my $opt_execute_where; +my $opt_config; +my $opt_host; +my $opt_disk; +my $opt_device; +my @opt_level; +my $opt_index; +my $opt_message; +my $opt_collection; +my $opt_record; +my @opt_mailto; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'execute-where=s' => \$opt_execute_where, + 'config=s' => \$opt_config, + 'host=s' => \$opt_host, + 'disk=s' => \$opt_disk, + 'device=s' => \$opt_device, + 'level=s' => \@opt_level, + 'index=s' => \$opt_index, + 'message=s' => \$opt_message, + 'collection=s' => \$opt_collection, + 'record=s' => \$opt_record, + 'mailto=s' => \@opt_mailto +) or usage(); + +my $script = Amanda::Script::Script_email->new($opt_execute_where, $opt_config, $opt_host, $opt_disk, $opt_device, \@opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, \@opt_mailto); + +$script->do($ARGV[0]); + diff --git a/application-src/teecount.c b/application-src/teecount.c new file mode 100644 index 0000000..fc0c4c0 --- /dev/null +++ b/application-src/teecount.c @@ -0,0 +1,61 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ +/* + * $Id: teecount.c $ + * + * read stdin and write to to stdout + * print on stderr the number of bytes copied + */ + +#include "amanda.h" + +#define BUFFER 262144 + +int main(int argc, char **argv); +int +main( + int argc G_GNUC_UNUSED, + char **argv G_GNUC_UNUSED) +{ + char buffer[BUFFER]; + off_t total = 0; + off_t size; + off_t sizew; + + while ((size = safe_read(0, buffer, BUFFER)) > 0) { + if ((sizew = full_write(1, buffer, size)) < size) { + total += sizew; + fprintf(stderr, "%ju", (uintmax_t)total); + exit (-1); + } + total += size; + } + fprintf(stderr, "%ju", (uintmax_t)total); + if (size < 0) { + exit(-1); + } + return 0; +} diff --git a/autogen b/autogen index 2e6bf5a..c1204ee 100755 --- a/autogen +++ b/autogen @@ -35,6 +35,17 @@ echo "..creating file lists" echo "..aclocal" aclocal $includes || die "aclocal failed" +echo "...aclocal patches" +# See http://bugzilla.gnome.org/show_bug.cgi?id=418778 +# +# The Glib developers are a bit over-eager in their version requirements, requiring +# an unnecessarily high verison of pkg-config at configure time, when they really +# only need it at autogen time. This patch resets the version number in the file +# just generated by aclocal to the version we've been requiring all along. +sed --in-place -e \ + 's/PKG_PROG_PKG_CONFIG(\[0\.16\])/PKG_PROG_PKG_CONFIG([0.7])/g' \ + aclocal.m4 + echo "..autoconf" autoconf || die "autoconf failed" diff --git a/changer-src/Makefile.am b/changer-src/Makefile.am index 8fa0c37..d37ef2d 100644 --- a/changer-src/Makefile.am +++ b/changer-src/Makefile.am @@ -7,7 +7,7 @@ include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/tape-src \ + -I$(top_srcdir)/device-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) @@ -28,6 +28,7 @@ amlibexec_PROGRAMS = $(CHG_SCSI) EXTRA_PROGRAMS = $(CHIO_SCSI) CHECK_PERL = \ + chg-glue \ chg-chio \ chg-iomega \ chg-rth @@ -48,7 +49,6 @@ SCRIPTS_SHELL = \ SCRIPTS_INCLUDE = \ chg-lib.sh - EXTRA_DIST += chg-lib.sh.in amlibexec_SCRIPTS = $(SCRIPTS_PERL) $(SCRIPTS_SHELL) @@ -62,8 +62,8 @@ amlibexec_DATA = $(SCRIPTS_INCLUDE) ### LDADD = ../common-src/libamanda.la \ - ../tape-src/libamtape.la \ ../common-src/libamanda.la \ + ../device-src/libamdevice.la \ ../gnulib/libgnu.la \ $(READLINE_LIBS) @@ -115,13 +115,12 @@ INSTALLPERMS_data = \ lint: @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ - (cd ../tape-src; make listlibsrc); \ - f="$$f "`cat ../tape-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ diff --git a/changer-src/Makefile.in b/changer-src/Makefile.in index fb70087..24d8dce 100644 --- a/changer-src/Makefile.in +++ b/changer-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ # Makefile for Amanda tape changer programs. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -32,14 +32,14 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -54,8 +54,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -66,7 +66,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -76,12 +80,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -125,7 +132,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -135,7 +142,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -165,21 +180,23 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) amlibexec_PROGRAMS = $(am__EXEEXT_2) EXTRA_PROGRAMS = $(am__EXEEXT_1) -@WANT_SCSI_AIX_TRUE@am__append_1 = scsi-aix.c -@WANT_SCSI_HPUX_NEW_TRUE@am__append_2 = scsi-hpux_new.c -@WANT_SCSI_IRIX_TRUE@am__append_3 = scsi-irix.c -@WANT_SCSI_LINUX_TRUE@am__append_4 = scsi-linux.c -@WANT_SCSI_SOLARIS_TRUE@am__append_5 = scsi-solaris.c -@WANT_SCSI_BSD_TRUE@am__append_6 = scsi-bsd.c -@WANT_SCSI_CAM_TRUE@am__append_7 = scsi-cam.c -@WANT_SCSI_HPUX_TRUE@am__append_8 = scsi-hpux.c -@WANT_SCSI_CHIO_TRUE@am__append_9 = scsi-chio.c +@WANT_SCSI_AIX_TRUE@am__append_2 = scsi-aix.c +@WANT_SCSI_HPUX_NEW_TRUE@am__append_3 = scsi-hpux_new.c +@WANT_SCSI_IRIX_TRUE@am__append_4 = scsi-irix.c +@WANT_SCSI_LINUX_TRUE@am__append_5 = scsi-linux.c +@WANT_SCSI_SOLARIS_TRUE@am__append_6 = scsi-solaris.c +@WANT_SCSI_BSD_TRUE@am__append_7 = scsi-bsd.c +@WANT_SCSI_CAM_TRUE@am__append_8 = scsi-cam.c +@WANT_SCSI_HPUX_TRUE@am__append_9 = scsi-hpux.c +@WANT_SCSI_CHIO_TRUE@am__append_10 = scsi-chio.c subdir = changer-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -213,6 +230,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -235,7 +253,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -263,7 +283,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -274,7 +293,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -314,7 +332,7 @@ chg_scsi_OBJECTS = $(am_chg_scsi_OBJECTS) chg_scsi_LDADD = $(LDADD) am__DEPENDENCIES_1 = chg_scsi_DEPENDENCIES = ../common-src/libamanda.la \ - ../tape-src/libamtape.la ../common-src/libamanda.la \ + ../common-src/libamanda.la ../device-src/libamdevice.la \ ../gnulib/libgnu.la $(am__DEPENDENCIES_1) am__chg_scsi_chio_SOURCES_DIST = libscsi.h chg-scsi-chio.c scsi-hpux.c \ scsi-chio.c @@ -326,11 +344,11 @@ am_chg_scsi_chio_OBJECTS = $(am__objects_11) chg_scsi_chio_OBJECTS = $(am_chg_scsi_chio_OBJECTS) chg_scsi_chio_LDADD = $(LDADD) chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.la \ - ../tape-src/libamtape.la ../common-src/libamanda.la \ + ../common-src/libamanda.la ../device-src/libamdevice.la \ ../gnulib/libgnu.la $(am__DEPENDENCIES_1) amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(amlibexec_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -357,6 +375,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -371,8 +390,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -384,16 +405,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -407,6 +440,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -414,7 +448,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -427,6 +461,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -437,9 +472,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -449,6 +487,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -473,8 +512,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -483,11 +524,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -501,6 +546,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -509,9 +555,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -519,7 +566,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -528,8 +577,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -537,7 +588,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -546,10 +596,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -565,6 +617,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -581,6 +635,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -589,7 +645,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -625,26 +680,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -652,7 +718,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -662,6 +732,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -671,7 +742,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -680,6 +758,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -708,6 +787,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -726,6 +806,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -755,6 +837,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = @@ -766,7 +849,8 @@ MOSTLYCLEANFILES = CLEANFILES = config.log # and we'll need to clean up our generated files for distclean -DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) $(am__append_1) MAINTAINERCLEANFILES = # syntax-check shell scripts on 'make check' @@ -775,9 +859,28 @@ CHECK_SHELL = $(SCRIPTS_SHELL) # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/tape-src \ + -I$(top_srcdir)/device-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) @@ -787,6 +890,7 @@ LINTFLAGS = $(AMLINTFLAGS) @WANT_CHG_SCSI_CHIO_TRUE@CHIO_SCSI = chg-scsi-chio @WANT_CHG_SCSI_TRUE@CHG_SCSI = chg-scsi CHECK_PERL = \ + chg-glue \ chg-chio \ chg-iomega \ chg-rth @@ -817,17 +921,17 @@ amlibexec_DATA = $(SCRIPTS_INCLUDE) # routines, and second to pick up any references in the other libraries. ### LDADD = ../common-src/libamanda.la \ - ../tape-src/libamtape.la \ ../common-src/libamanda.la \ + ../device-src/libamdevice.la \ ../gnulib/libgnu.la \ $(READLINE_LIBS) chg_scsi_CSRC = chg-scsi.c scsi-changer-driver.c sense.c \ - $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) $(am__append_5) $(am__append_6) \ - $(am__append_7) + $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_6) $(am__append_7) \ + $(am__append_8) chg_scsi_SOURCES = libscsi.h scsi-defs.h $(chg_scsi_CSRC) -chg_scsi_chio_CSRC = chg-scsi-chio.c $(am__append_8) $(am__append_9) +chg_scsi_chio_CSRC = chg-scsi-chio.c $(am__append_9) $(am__append_10) chg_scsi_chio_SOURCES = libscsi.h $(chg_scsi_chio_CSRC) INSTALLPERMS_exec = \ chown=amanda \ @@ -882,8 +986,8 @@ install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done @@ -996,8 +1100,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -1009,8 +1113,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -1020,13 +1124,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -1107,8 +1210,6 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am clean-am: clean-amlibexecPROGRAMS clean-generic clean-libtool \ @@ -1151,7 +1252,7 @@ install-pdf: install-pdf-am install-ps: install-ps-am -installcheck-am: +installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) @@ -1187,10 +1288,10 @@ uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-amlibexecDATA \ + installcheck-local installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-amlibexecDATA \ uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS @@ -1198,6 +1299,11 @@ uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \ %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -1223,13 +1329,27 @@ uninstall-am: uninstall-amlibexecDATA uninstall-amlibexecPROGRAMS \ # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl check-shell: $(CHECK_SHELL) @CHECK_SHELL="$(CHECK_SHELL)"; \ if test -n "$$CHECK_SHELL"; then \ @@ -1267,52 +1387,40 @@ dist-scripts: true dist-hook: dist-scripts -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange @@ -1326,13 +1434,12 @@ dist-hook: dist-scripts lint: @ for p in $(amlibexec_PROGRAMS) $(EXTRA_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamandad_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ (cd ../server-src; make listlibsrc); \ f="$$f "`cat ../server-src/listlibsrc.output`; \ - (cd ../tape-src; make listlibsrc); \ - f="$$f "`cat ../tape-src/listlibsrc.output`; \ echo $(LINT) $$f; \ $(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(top_builddir)/config \ $(INCLUDES) $$f; \ diff --git a/changer-src/chg-chs.sh b/changer-src/chg-chs.sh index 8679711..683b12a 100644 --- a/changer-src/chg-chs.sh +++ b/changer-src/chg-chs.sh @@ -377,7 +377,7 @@ echo curloaded $curloaded >> $ourstate # return slot info if [ $slotempty -eq 1 ]; then - answer=`_ ' %s: %s slot is empty' "$pname" "$newslot"` + answer=`_ ' %s: %s slot is empty: %s' "$pname" "$newslot" "$amdevcheck_message"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 diff --git a/changer-src/chg-glue.pl b/changer-src/chg-glue.pl new file mode 100644 index 0000000..fe7e6a6 --- /dev/null +++ b/changer-src/chg-glue.pl @@ -0,0 +1,275 @@ +#! @PERL@ +# Copyright (c) 2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; + +# This script interfaces the C changer library to Amanda::Perl. It reads +# commands from its stdin that are identical to those that would be passed as +# arguments to a changer script, and replies with an encoded exit status and +# the response of the script. +# +# Specifically, the conversation is (P = Parent, C = Child) +# P>C: -$cmd $args +# C>P: EXITSTATUS $exitstatus +# C>P: $slot $message +# P>C: -$cmd $args +# C>P: EXITSTATUS $exitstatus +# C>P: $slot $message +# P>C: (EOF) +# +# The script exits as soon as it reads an EOF on its standard input. + +use Amanda::Changer; +use Amanda::MainLoop; +use Amanda::Config qw( :init ); +use Amanda::Util qw( :constants ); + +my $chg; +my $res; + +sub release_and_then { + my ($release_opts, $andthen) = @_; + if ($res) { + # release the current reservation, then call andthen + $res->release(@$release_opts, + finished_cb => sub { + my ($error) = @_; + $res = undef; + + if ($error) { + print "EXITSTATUS 1\n"; + print " $error\n"; + Amanda::MainLoop::call_later(\&getcmd); + } else { + $andthen->(); + } + } + ); + } else { + # no reservation to release + $andthen->(); + } +} + +sub do_slot { + my ($slot) = @_; + + # handle the special cases we support + if ($slot eq "next" or $slot eq "advance") { + if (!$res) { + $slot = "next"; + } else { + $slot = $res->{'next_slot'}; + } + } elsif ($slot eq "first") { + do_reset(); + return; + } elsif ($slot eq "prev" or $slot eq "last") { + print "EXITSTATUS 1\n"; + print " slot specifier '$slot' is not valid\n"; + Amanda::MainLoop::call_later(\&getcmd); + return; + } + + my $load_slot = sub { + $chg->load(slot => $slot, set_current => 1, + res_cb => sub { + (my $error, $res) = @_; + if ($error) { + print "EXITSTATUS 1\n"; + print " $error\n"; + } else { + print "EXITSTATUS 0\n"; + print $res->{'this_slot'}, " ", $res->{'device_name'}, "\n"; + } + Amanda::MainLoop::call_later(\&getcmd); + } + ); + }; + + release_and_then([], $load_slot); +} + +sub do_info { + $chg->info(info => [ 'num_slots' ], + info_cb => sub { + my $error = shift; + my %results = @_; + + if ($error) { + print "EXITSTATUS 1\n"; + print " $error\n"; + } else { + my $nslots = $results{'num_slots'}; + $nslots = 0 unless defined $nslots; + print "EXITSTATUS 0\n"; + print "current $nslots 0 1\n"; + } + Amanda::MainLoop::call_later(\&getcmd); + } + ); +} + +sub do_reset { + my $do_reset = sub { + $chg->reset( + finished_cb => sub { + my ($error) = @_; + if ($error) { + print "EXITSTATUS 1\n"; + print " $error\n"; + Amanda::MainLoop::call_later(\&getcmd); + } else { + do_slot("current"); + } + } + ); + }; + release_and_then([], $do_reset); +} + +sub do_eject { + release_and_then([ eject => 1 ], + sub { + print "EXITSTATUS 0\n"; + print " OK: no volume loaded\n"; + Amanda::MainLoop::call_later(\&getcmd); + } + ); +} + +sub do_search { + my ($label) = @_; + my $load_label = sub { + $chg->load(label => $label, set_current => 1, + res_cb => sub { + (my $error, $res) = @_; + if ($error) { + print "EXITSTATUS 1\n"; + print " $error\n"; + } else { + print "EXITSTATUS 0\n"; + print $res->{'this_slot'}, " ", $res->{'device_name'}, "\n"; + } + Amanda::MainLoop::call_later(\&getcmd); + } + ); + }; + + release_and_then([], $load_label); +} + +sub do_label { + my ($label) = @_; + if ($res) { + $res->set_label(label => $label, + finished_cb => sub { + my ($err) = @_; + if ($err) { + print "EXITSTATUS 1\n"; + print " $err\n"; + } else { + print "EXITSTATUS 0\n"; + print $res->{'this_slot'}, " ", $res->{'device_name'}, "\n"; + } + Amanda::MainLoop::call_later(\&getcmd); + } + ); + } else { + print "EXITSTATUS 1\n"; + print " No volume loaded\n"; + Amanda::MainLoop::call_later(\&getcmd); + } +} + +sub getcmd { + my ($slot, $label); + my $command = ; + if (!defined($command)) { + finish(); + return; + } + + if (($slot) = ($command =~ /^-slot (.*)$/)) { + do_slot($slot); + } elsif ($command =~ /^-info$/) { + do_info(); + } elsif ($command =~ /^-reset$/) { + do_reset(); + } elsif ($command =~ /^-eject$/) { + do_eject(); + } elsif (($label) = ($command =~ /^-search (.*)/)) { + do_search($label); + } elsif (($label) = ($command =~ /^-label (.*)/)) { + do_label($label); + } else { + print "EXITSTATUS 2\n"; + print " unknown command '$command'\n"; + finish(); + } +} + +sub finish { + if ($res) { + $res->release( + finished_cb => sub { + $res = undef; + Amanda::MainLoop::quit(); + } + ); + } else { + Amanda::MainLoop::quit(); + } +} + +Amanda::Util::setup_application("chg-glue", "server", $CONTEXT_SCRIPTUTIL); + +die("$0 is for internal use only") if (@ARGV < 1); +my $config_name = $ARGV[0]; + +# override die to print a changer-compatible message +$SIG{__DIE__} = sub { + my ($msg) = @_; + die $msg unless defined $^S; + print "EXITSTATUS 2\n"; + print " $msg\n"; + exit 1; +}; + +config_init($CONFIG_INIT_EXPLICIT_NAME, $config_name); +my ($cfgerr_level, @cfgerr_errors) = config_errors(); +if ($cfgerr_level >= $CFGERR_WARNINGS) { + config_print_errors(); + if ($cfgerr_level >= $CFGERR_ERRORS) { + die("errors processing config file"); + } +} +Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER); + +# select unbuffered communication +$| = 1; + +$chg = Amanda::Changer->new(); + +Amanda::MainLoop::call_later(\&getcmd); +Amanda::MainLoop::run(); +if ($res) { + $res->release(); +} diff --git a/changer-src/chg-juke.sh b/changer-src/chg-juke.sh index 9e3809b..35c7a68 100755 --- a/changer-src/chg-juke.sh +++ b/changer-src/chg-juke.sh @@ -153,7 +153,7 @@ load_drives() { count=`expr $count + 1` if [ $count -gt 24 ] then - echo `_ '%s %s never came online' "$slot" "$tapedev"` + echo `_ '%s %s never came online: %s' "$slot" "$tapedev" "$amdevcheck_message"` exit 1 fi sleep 5 diff --git a/changer-src/chg-lib.sh.in b/changer-src/chg-lib.sh.in index 791154c..9c66320 100644 --- a/changer-src/chg-lib.sh.in +++ b/changer-src/chg-lib.sh.in @@ -84,16 +84,22 @@ try_find_mt() { # This function strips the tape: from the front of device names. # Capture its output with ``. tape_device_filename() { - # Easy (?) to express this in Perl. - perl -e '$ARGV[0] =~ /^(?:([^:]+):)?(.*)$/; - print $2 if ($1 || "tape") eq "tape"' "$1" + if echo "$1"|grep '^tape:' >/dev/null; then + echo "$1" | sed 's/^tape://' + else + if echo "$1"|grep '^/' >/dev/null; then + echo "$1" + fi + fi } -# Runs amdevcheck to find out if a particular device is usable. Finds the -# config name based on pwd, so run it from the config directory. The sole -# argument should be the device name to check. Note that amdevcheck can FP -# on device status, since some devices can't differentiate between device -# problems and an unlabeled volume. +# Invoke amdevcheck to determine whether the device is ready for use. +# +# @return 0 if a tape is loaded or error +# @return 1 if a tape is tape offline or busy +# +# @side-effect: $amdevcheck_message is the contents of all MESSAGE lines from +# amdevcheck, suitable for use in higher-level error messages amdevcheck_status() { amdevcheck_message= local amdevcheck_config_dir=`pwd` @@ -109,7 +115,7 @@ amdevcheck_status() { # Return 1 if it's possible that the device is offline or busy; if the device cannot # distinguish this state from an error condition, then our caller will just have to # time out - if echo "$amdevcheck_output" | $EGREP "VOLUME_MISSING" > /dev/null; then + if echo "$amdevcheck_output" | $EGREP "VOLUME_MISSING|DEVICE_BUSY" > /dev/null; then return 1 else return 0 @@ -121,7 +127,7 @@ amdevcheck_status() { # be extended at some later time. try_eject_device() { - if echo "$1" | grep -e '^tape:' > /dev/null; then + if echo "$1" | grep '^tape:' > /dev/null; then try_eject_device_tape="`echo \"$1\" | cut -b6-`" elif echo "$1" | grep -v : > /dev/null; then try_eject_device_tape="$1" @@ -131,7 +137,7 @@ try_eject_device() { if test -n "$try_eject_device_tape"; then if try_find_mt; then - $MT $MTF "$try_eject_device_tape" eject + $MT $MTF "$try_eject_device_tape" offline fi else # Technically we failed to eject the device, but we presume that's diff --git a/changer-src/chg-manual.sh b/changer-src/chg-manual.sh index d480de9..1490a4d 100644 --- a/changer-src/chg-manual.sh +++ b/changer-src/chg-manual.sh @@ -26,14 +26,13 @@ amlibexecdir=@amlibexecdir@ # # - if [ -d "@AMANDA_DBGDIR@" ]; then logfile=@AMANDA_DBGDIR@/changer.debug else logfile=/dev/null fi -myname=$0 +myname=`basename $0` EGREP='@EGREP@' @@ -42,9 +41,9 @@ if ! error=`try_find_mt`; then exit 2 fi -MAILER=@MAILER@ ONLINEREGEX="ONLINE|READY|sense[_ ]key[(]0x0[)]|sense key error = 0|^er=0$|, mt_erreg: 0x0|^Current Driver State: at rest$" REPORTTO=`amgetconf mailto` +MAILER=`amgetconf mailer` tape=`amgetconf tapedev` if [ -z "$tape" ]; then @@ -58,6 +57,8 @@ firstslot=1 lastslot=99 resend_mail=900 # 15 minutes timeout_mail=604800 # 7 days +abort_file="chg-manual.abort" +abort_dir=`pwd` changerfile=`amgetconf changerfile` @@ -83,11 +84,23 @@ slot=`cat $slotfile` request_tty() { if > /dev/tty; then - echo -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty + echo "$amdevcheck_message" >> /dev/tty + # message parsed by ZMC: + echo `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty + echo `_ ' or type "NONE" to abort'` > /dev/tty read ANSWER < /dev/tty + if [ X"$ANSWER" = X"NONE" ]; then + echo `_ 'Aborting request'` > /dev/tty + answer=`_ ' Aborting request'` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 + fi else - echo -n `_ 'no /dev/tty to ask to change tape'` - exit 1 + answer=`_ ' no /dev/tty to ask to change tape'` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 fi } @@ -103,13 +116,23 @@ request_email() { # the E-mail once an hour in case it gets lost. timeout=0 gtimeout=$timeout_mail + rm -f $abort_filename while true;do if [ $gtimeout -le 0 ]; then - echo -n `_ 'timeout waiting for tape online'` - exit 1; + answer=`_ '%s %s: timeout waiting for tape online' "$load" "$myname"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2; + fi + if [ -f $abort_filename ]; then + rm -f $abort_filename + answer=`_ ' Aborting request'` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 fi if [ $timeout -le 0 ]; then - msg=`_ 'insert Amanda tape into slot %s (%s)' "$1" "$tape"` + msg=`_ '%s\nInsert Amanda tape into slot %s (%s)\nor \`touch %s\` to abort.' "$amdevcheck_message" "$1" "$tape" "$abort_filename"` subject=`_ '%s AMANDA TAPE MOUNT REQUEST FOR SLOT %s' "$ORG" "$1"` echo "$msg" | $MAILER -s "$subject" $REPORTTO timeout=$resend_mail @@ -126,8 +149,7 @@ request_email() { request_tty_email() { if > /dev/tty; then - echo -n `_ 'Insert tape into slot %s and press return' "$1"` > /dev/tty - read ANSWER < /dev/tty + request_tty "$1" else request_email "$1" fi @@ -158,7 +180,7 @@ if test -z "$MAILER"; then answer=`_ " %s: Can't send email because MAILER is not defined" "$myname"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer - exit 1 + exit 2 fi fi @@ -172,7 +194,7 @@ eject() { answer="$slot $tape" code=0 else - answer=`_ ' %s: Drive was not loaded' "$myname"` + answer=`_ ' %s: %s' "$myname" "$amdevcheck_message"` code=1 fi echo `_ 'Exit ->'` $answer >> $logfile @@ -180,6 +202,8 @@ eject() { exit $code } +abort_filename="$abort_dir/$abort_file" + # reset() { @@ -187,7 +211,7 @@ reset() { if amdevcheck_status $tape; then answer="$slot $tape" else - answer="0 $tape" + answer="0 $tape $amdevcheck_message" fi echo `_ 'Exit ->'` $answer >> $logfile echo $answer @@ -206,9 +230,6 @@ loadslot() { case $whichslot in current) load=$slot - [ $load -eq 0 ] && load=$firstslot - [ $load -gt $lastslot ] && load=$firstslot - [ $load -lt $firstslot ] && load=$lastslot ;; next|advance) load=`expr $slot + 1` @@ -249,6 +270,13 @@ loadslot() { exit 0 fi + if [ X"$whichslot" = X"current" ]; then + answer=" Current slot not loaded" + echo `_ 'Exit ->'` $answer>> $logfile + echo $answer + exit 1 + fi + expr $accesscount + 1 > $accessfile if [ $tape_status -eq 0 ]; then @@ -313,7 +341,7 @@ while [ $# -ge 1 ];do eject ;; *) - fmt`gettext " %s: Unknown option %s\n"` + fmt=`gettext " %s: Unknown option %s\n"` printf $fmt $myname $1 exit 2 ;; diff --git a/changer-src/chg-multi.sh b/changer-src/chg-multi.sh index ddb5301..19ffb41 100644 --- a/changer-src/chg-multi.sh +++ b/changer-src/chg-multi.sh @@ -125,6 +125,42 @@ if [ -z "$ourstate" ]; then exit 2 fi +if [ -f "$ourstate" -a ! -r "$ourstate" ]; then + answer=`_ " %s: Can't read the statefile %s" "$pname" "$ourstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ -f "$ourstate" -a ! -w "$ourstate" ]; then + answer=`_ " %s: Can't write the statefile %s" "$pname" "$ourstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +dirstate=`dirname $ourstate` +if [ ! -e "$dirstate" ]; then + answer=`_ " %s: Directory %s doesn't exist" "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ ! -d "$dirstate" ]; then + answer=`_ ' %s: %s must be a directory' "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ ! -w "$dirstate" ]; then + answer=`_ " %s: Can't write to %s directory" "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + # needeject and multieject are incompatible if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then answer=`_ ' %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"` @@ -405,7 +441,7 @@ echo curloaded $curloaded >> $ourstate # return slot info if [ $slotempty -eq 1 ]; then - answer=`_ '%s %s: slot is empty' "$newslot" "$pname"` + answer=`_ '%s %s: slot is empty: %s' "$newslot" "$pname" "$amdevcheck_message"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1 diff --git a/changer-src/chg-scsi-chio.c b/changer-src/chg-scsi-chio.c index b5b76bd..3489c67 100644 --- a/changer-src/chg-scsi-chio.c +++ b/changer-src/chg-scsi-chio.c @@ -634,11 +634,14 @@ clean_tape( char * usagetime) { int counter; + char *mailer; if (cleancart == -1 ){ return; } + mailer = getconf_str(CNF_MAILER); + /* Now we should increment the counter */ if (cnt_file != NULL){ counter = get_current_slot(cnt_file); @@ -648,29 +651,29 @@ clean_tape( char *mail_cmd; FILE *mailf; int mail_pipe_opened = 1; -#ifdef MAILER - if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && - validate_mailto(getconf_str(CNF_MAILTO))) { - mail_cmd = vstralloc(MAILER, - " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", - " ", getconf_str(CNF_MAILTO), - NULL); - if((mailf = popen(mail_cmd, "w")) == NULL){ - g_printf(_("Mail failed\n")); - error(_("could not open pipe to \"%s\": %s"), - mail_cmd, strerror(errno)); - /*NOTREACHED*/ - } + if (mailer && *mailer != '\0') { + if (getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && + validate_mailto(getconf_str(CNF_MAILTO))) { + mail_cmd = vstralloc(mailer, + " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", + " ", getconf_str(CNF_MAILTO), + NULL); + if ((mailf = popen(mail_cmd, "w")) == NULL) { + g_printf(_("Mail failed\n")); + error(_("could not open pipe to \"%s\": %s"), + mail_cmd, strerror(errno)); + /*NOTREACHED*/ + } + } else { + mail_pipe_opened = 0; + mailf = stderr; + g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); + } } else { - mail_pipe_opened = 0; - mailf = stderr; - g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); + mail_pipe_opened = 0; + mailf = stderr; + g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); } -#else - mail_pipe_opened = 0; - mailf = stderr; - g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); -#endif g_fprintf(mailf, _("\nThe usage count of your cleaning tape in slot %d"), cleancart); g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean); @@ -749,7 +752,14 @@ main( parse_args(argc,argv,&com); changer = alloc(SIZEOF(changer_t)); - config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL); + config_init(CONFIG_INIT_USE_CWD, NULL); + + if (config_errors(NULL) >= CFGERR_WARNINGS) { + config_print_errors(); + if (config_errors(NULL) >= CFGERR_ERRORS) { + g_critical(_("errors processing config file")); + } + } changer_dev = getconf_str(CNF_CHANGERDEV); changer_file = getconf_str(CNF_CHANGERFILE); diff --git a/changer-src/chg-scsi.c b/changer-src/chg-scsi.c index 46d4801..221f476 100644 --- a/changer-src/chg-scsi.c +++ b/changer-src/chg-scsi.c @@ -69,7 +69,6 @@ static char rcsid[] = "$Id: chg-scsi.c,v 1.52 2006/07/25 18:18:46 martinea Exp $ #include "conffile.h" #include "libscsi.h" #include "scsi-defs.h" -#include "tapeio.h" char *tapestatfile = NULL; FILE *debug_file = NULL; @@ -370,6 +369,11 @@ read_config( chg->emubarcode = 1; break; case DEBUGLEVEL: + if (chg->debuglevel != NULL) { + g_fprintf(stderr,_("Error: debuglevel is specified twice " + "(%s then %s).\n"), chg->debuglevel, value); + amfree(chg->debuglevel); + } chg->debuglevel = stralloc(value); break; case EJECT: @@ -382,9 +386,19 @@ read_config( chg->sleep = (unsigned)atoi(value); break; case LABELFILE: + if (chg->labelfile != NULL) { + g_fprintf(stderr,_("Error: labelfile is specified twice " + "(%s then %s).\n"), chg->labelfile, value); + amfree(chg->labelfile); + } chg->labelfile = stralloc(value); break; case CHANGERDEV: + if (chg->device != NULL) { + g_fprintf(stderr,_("Error: changerdev is specified twice " + "(%s then %s).\n"), chg->device, value); + amfree(chg->device); + } chg->device = stralloc(value); break; case SCSITAPEDEV: @@ -1082,6 +1096,7 @@ clean_tape( char *usagetime) { int counter; + char *mailer; if (cleancart == -1 ){ return; @@ -1089,6 +1104,7 @@ clean_tape( /* Now we should increment the counter */ if (cnt_file != NULL){ + mailer = getconf_str(CNF_MAILER); counter = get_current_slot(cnt_file); counter++; if (counter>=maxclean){ @@ -1096,29 +1112,29 @@ clean_tape( char *mail_cmd = NULL; FILE *mailf = NULL; int mail_pipe_opened = 1; -#ifdef MAILER - if(getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && - validate_mailto(getconf_str(CNF_MAILTO))) { - mail_cmd = vstralloc(MAILER, - " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", - " ", getconf_str(CNF_MAILTO), - NULL); - if((mailf = popen(mail_cmd, "w")) == NULL){ - g_printf(_("Mail failed\n")); - error(_("could not open pipe to \"%s\": %s"), + if (mailer && *mailer != '\0') { + if (getconf_seen(CNF_MAILTO) && strlen(getconf_str(CNF_MAILTO)) > 0 && + validate_mailto(getconf_str(CNF_MAILTO))) { + mail_cmd = vstralloc(mailer, + " -s", " \"", _("AMANDA PROBLEM: PLEASE FIX"), "\"", + " ", getconf_str(CNF_MAILTO), + NULL); + if ((mailf = popen(mail_cmd, "w")) == NULL) { + g_printf(_("Mail failed\n")); + error(_("could not open pipe to \"%s\": %s"), mail_cmd, strerror(errno)); - /*NOTREACHED*/ - } + /*NOTREACHED*/ + } + } else { + mail_pipe_opened = 0; + mailf = stderr; + g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); + } } else { - mail_pipe_opened = 0; + mail_pipe_opened = 0; mailf = stderr; - g_fprintf(mailf, _("\nNo mail recipient specified, output redirected to stderr")); - } -#else - mail_pipe_opened = 0; - mailf = stderr; - g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); -#endif + g_fprintf(mailf, _("\nNo mailer specified; output redirected to stderr")); + } g_fprintf(mailf,_("\nThe usage count of your cleaning tape in slot %d"), cleancart); g_fprintf(mailf,_("\nis more than %d. (cleanmax)"),maxclean); @@ -1254,7 +1270,14 @@ main( break; } - config_init(CONFIG_INIT_USE_CWD | CONFIG_INIT_FATAL, NULL); + config_init(CONFIG_INIT_USE_CWD, NULL); + + if (config_errors(NULL) >= CFGERR_WARNINGS) { + config_print_errors(); + if (config_errors(NULL) >= CFGERR_ERRORS) { + g_critical(_("errors processing config file")); + } + } chg_scsi_conf = getconf_str(CNF_CHANGERFILE); tape_device = getconf_str(CNF_TAPEDEV); diff --git a/changer-src/chg-zd-mtx.sh b/changer-src/chg-zd-mtx.sh index 464c075..dd26273 100644 --- a/changer-src/chg-zd-mtx.sh +++ b/changer-src/chg-zd-mtx.sh @@ -206,6 +206,9 @@ # initial_poll_delay=NN #### initial delay after load before polling for # #### readiness # +# slotinfofile=FILENAME #### record slot information to this file, in +# #### the line-based format "SLOT LABEL\n" +# #### #### @@ -376,7 +379,7 @@ Exit() { if [ $call_type = Return ]; then return $code fi - amgetconf dbclose.$argv0:$DBGFILE > /dev/null 2>&1 + amgetconf dbclose.$myname:$DBGFILE > /dev/null 2>&1 exit $code } @@ -411,7 +414,7 @@ Run() { IsNumeric() { test -z "$1" && return 1 - x="`expr "$1" : '\([-0-9][0-9]*\)' 2>/dev/null`" + x="`expr -- "$1" : "\([-0-9][0-9]*\)" 2>/dev/null`" return `expr X"$1" != X"$x"` } @@ -431,6 +434,11 @@ get_mtx_status() { if [ $status -eq 0 ]; then mtx_status_valid=1 fi + + # shim this in here so that we get a completely new slotinfofile + # every time we run mtx status + regenerate_slotinfo_from_mtx + return $status } @@ -443,6 +451,12 @@ get_mtx_status() { get_loaded_info() { test -n "$DEBUG" && set -x get_mtx_status + if [ $mtx_status_valid -eq 0 ]; then + Exit 2 \ + `_ ''` \ + `head -1 $mtx_status` + return $? + fi set x `sed -n ' /^Data Transfer Element:Empty/ { @@ -560,6 +574,12 @@ get_slot_list() { return fi get_mtx_status + if [ $mtx_status_valid -eq 0 ]; then + Exit 2 \ + `_ ''` \ + `head -1 $mtx_status` + return $? + fi slot_list=`sed -n ' /^Data Transfer Element:Full (Storage Element \([0-9][0-9]*\) Loaded)/ { s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/p @@ -628,7 +648,195 @@ get_slot_list() { slot_list="$amanda_slot_list" } -DBGFILE=`amgetconf dbopen.$argv0 2>/dev/null` +### +# Read the labelfile and scan for a particular entry. +### + +read_labelfile() { + labelfile_entry_found=0 + labelfile_label= + labelfile_barcode= + + lbl_search=$1 + bc_search=$2 + + line=0 + while read lbl bc junk; do + line=`expr $line + 1` + if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then + Log `_ 'ERROR -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"` + LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` + Exit 2 \ + `_ ''` \ + `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"` + return $? # in case we are internal + fi + if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then + if [ $labelfile_entry_found -ne 0 ]; then + Log `_ 'ERROR -> Duplicate entries: %s line %s' "$labelfile" "$line"` + LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` + Exit 2 \ + `_ ''` \ + `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"` + return $? # in case we are internal + fi + labelfile_entry_found=1 + labelfile_label=$lbl + labelfile_barcode=$bc + fi + done +} + +lookup_label_by_barcode() { + [ -z "$1" ] && return + read_labelfile "" "$1" < $labelfile + echo "$labelfile_label" +} + +lookup_barcode_by_label() { + [ -z "$1" ] && return + read_labelfile "$1" "" < $labelfile + echo "$labelfile_barcode" +} + +remove_from_labelfile() { + labelfile=$1 + lbl_search=$2 + bc_search=$3 + + internal_remove_from_labelfile "$lbl_search" "$bc_search" < $labelfile >$labelfile.new + if [ $labelfile_entry_found -ne 0 ]; then + mv -f $labelfile.new $labelfile + LogAppend `_ 'Removed Entry "%s %s" from barcode database' "$labelfile_label" "$labelfile_barcode"` + fi +} + +internal_remove_from_labelfile() { + labelfile_entry_found=0 + labelfile_label= + labelfile_barcode= + + lbl_search=$1 + bc_search=$2 + + line=0 + while read lbl bc junk; do + line=`expr $line + 1` + if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then + Log `_ 'ERROR -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"` + LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` + Exit 2 \ + `_ ''` \ + `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"` + return $? # in case we are internal + fi + if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then + if [ $labelfile_entry_found -ne 0 ]; then + Log `_ 'ERROR -> Duplicate entries: %s line %s' "$labelfile" "$line"` + LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` + Exit 2 \ + `_ ''` \ + `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"` + return $? # in case we are internal + fi + labelfile_entry_found=1 + labelfile_label=$lbl + labelfile_barcode=$bc + else + echo $lbl $bc + fi + done +} + +### +# Add a new slot -> label correspondance to the slotinfo file, removing any previous +# information about that slot. +### + +record_label_in_slot() { + [ -z "$slotinfofile" ] && return + newlabel="$1" + newslot="$2" + + ( + if [ -f "$slotinfofile" ]; then + grep -v "^$newslot " < "$slotinfofile" + fi + echo "$newslot $newlabel" + ) > "$slotinfofile~" + mv "$slotinfofile~" "$slotinfofile" +} + +### +# Remove a slot from the slotinfo file +### + +remove_slot_from_slotinfo() { + [ -z "$slotinfofile" ] && return + emptyslot="$1" + + ( + if [ -f "$slotinfofile" ]; then + grep -v "^$emptyslot " < "$slotinfofile" + fi + ) > "$slotinfofile~" + mv "$slotinfofile~" "$slotinfofile" +} + +### +# Assuming get_mtx_status has been run, +# - if we have barcodes, regenerate the slotinfo file completely by +# mapping barcodes in the status into labels using the labelfile +# - otherwise, remove all empty slots from the slotinfo file +### + +regenerate_slotinfo_from_mtx() { + [ -z "$slotinfofile" ] && return + [ "$mtx_status_valid" = "1" ] || return + + if [ "$havereader" = "1" ]; then + # rewrite slotinfo entirely based on the status, since it has barcodes + :> "$slotinfofile~" + sed -n '/.*Storage Element \([0-9][0-9]*\).*VolumeTag *= *\([^ ]*\) *$/{ +s/.*Storage Element \([0-9][0-9]*\).*VolumeTag *= *\([^ ]*\) *$/\1 \2/ +p +}' < $mtx_status | while read newslot newbarcode; do + newlabel=`lookup_label_by_barcode "$newbarcode"` + if [ -n "$newlabel" ]; then + echo "$newslot $newlabel" >> "$slotinfofile~" + fi + done + mv "$slotinfofile~" "$slotinfofile" + else + # just remove empty slots from slotinfo + + # first determine which slots are not really empty, but are + # loaded into a data transfer element +loadedslots=`sed -n '/.*(Storage Element \([0-9][0-9]*\) Loaded).*/{ +s/.*(Storage Element \([0-9][0-9]*\) Loaded).*/\1/g +p +}' < $mtx_status` + + # now look for any slots which are empty, but which aren't + # in the set of loaded slots + sed -n '/.*Storage Element \([0-9][0-9]*\): *Empty.*/{ +s/.*Storage Element \([0-9][0-9]*\): *Empty.*/\1/g +p +}' < $mtx_status | while read emptyslot; do + reallyempty=1 + if [ -n "$loadedslots" ]; then + for loadedslot in $loadedslots; do + [ "$loadedslot" = "$emptyslot" ] && reallyempty=0 + done + fi + if [ "$reallyempty" = "1" ]; then + remove_slot_from_slotinfo "$emptyslot" + fi + done + fi +} + +DBGFILE=`amgetconf dbopen.$myname 2>/dev/null` if [ -z "$DBGFILE" ] then DBGFILE=/dev/null # will try this again below @@ -698,6 +906,7 @@ cleanfile=$changerfile-clean accessfile=$changerfile-access slotfile=$changerfile-slot labelfile=$changerfile-barcodes +slotinfofile="" [ ! -s $cleanfile ] && echo 0 > $cleanfile [ ! -s $accessfile ] && echo 0 > $accessfile [ ! -s $slotfile ] && echo -1 > $slotfile @@ -723,6 +932,7 @@ varlist="$varlist driveslot" varlist="$varlist poll_drive_ready" varlist="$varlist initial_poll_delay" varlist="$varlist max_drive_wait" +varlist="$varlist slotinfofile" for var in $varlist do @@ -797,7 +1007,7 @@ initial_poll_delay=${initial_poll_delay:-'0'} # default: zero zeconds max_drive_wait=${max_drive_wait:-'120'} # default: two minutes # check MT and MTX for sanity -if test "${MTX:0:1}" = "/"; then +if test "${MTX%${MTX#?}}" = "/"; then if ! test -f "${MTX}"; then Exit 2 \ `_ ''` \ @@ -831,6 +1041,8 @@ for var in $varlist; do continue # old name elif [ $var = "AUTOCLEAN" ]; then continue # old name + elif [ $var = "slotinfofile" ]; then + continue # not numeric fi eval val=\"'$'$var\" if [ -z "$val" ]; then @@ -1132,7 +1344,7 @@ loadslot() { waittime=`expr $waittime + $poll_drive_ready` done if [ $ready -eq 0 ]; then - Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds, rewind said "%s"' "$max_drive_wait" "$result"` + Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds: %s' "$max_drive_wait" "$amdevcheck_message"` return $? # in case we are internal fi @@ -1179,45 +1391,6 @@ info() { return $? # in case we are internal } -### -# Read the labelfile and scan for a particular entry. -### - -read_labelfile() { - labelfile_entry_found=0 - labelfile_label= - labelfile_barcode= - - lbl_search=$1 - bc_search=$2 - - line=0 - while read lbl bc junk; do - line=`expr $line + 1` - if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then - Log `_ 'ERROR -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"` - LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` - Exit 2 \ - `_ ''` \ - `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"` - return $? # in case we are internal - fi - if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then - if [ $labelfile_entry_found -ne 0 ]; then - Log `_ 'ERROR -> Duplicate entries: %s line %s' "$labelfile" "$line"` - LogAppend `_ ' -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"` - Exit 2 \ - `_ ''` \ - `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"` - return $? # in case we are internal - fi - labelfile_entry_found=1 - labelfile_label=$lbl - labelfile_barcode=$bc - fi - done -} - ### # Adds the label and barcode for the currently loaded tape to the # barcode file. Return an error if the database is messed up. @@ -1230,15 +1403,16 @@ addlabel() { return $? # in case we are internal fi tapelabel=$1 - if [ $havereader -eq 0 ]; then - Exit 2 `_ ''` `_ 'Not configured with barcode reader'` - return $? # in case we are internal - fi get_loaded_info if [ $loadedslot -lt 0 ]; then Exit 1 `_ ''` `_ 'No tape currently loaded'` return $? # in case we are internal fi + record_label_in_slot "$tapelabel" "$loadedslot" + if [ $havereader -eq 0 ]; then + Exit 0 "$loadedslot" "$rawtape" # that's all we needed + return $? # in case we are internal + fi if [ -z "$loadedbarcode" ]; then Exit 1 `_ ''` `_ 'No barcode found for tape %s.' $tapelabel` return $? # in case we are internal @@ -1261,14 +1435,16 @@ addlabel() { new_val=$tapelabel fi if [ -n "$lf_val" ]; then - LogAppend `_ 'ERROR -> !!! Label database corrupted !!!'` - LogAppend `_ ' -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` - Exit 2 \ - `_ ''` \ - `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"` - return $? # in case we are internal + if [ "$val_type" = "barcode" ]; then + remove_from_labelfile $labelfile "" "$old_val" + else + remove_from_labelfile $labelfile "$old_val" "" + fi + echo "$tapelabel $loadedbarcode" >> $labelfile + LogAppend `_ ' -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"` + else + LogAppend `_ " -> already synced"` fi - LogAppend `_ " -> already synced"` else echo "$tapelabel $loadedbarcode" >> $labelfile LogAppend `_ ' -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"` @@ -1305,6 +1481,12 @@ searchtape() { fi LogAppend `_ ' -> barcode is "%s"' "$labelfile_barcode"` get_mtx_status + if [ $mtx_status_valid -eq 0 ]; then + Exit 2 \ + `_ ''` \ + `head -1 $mtx_status` + return $? + fi foundslot=`sed -n ' /VolumeTag *= *'$labelfile_barcode' *$/ { s/.*Storage Element \([0-9][0-9]*\).*/\1/p diff --git a/changer-src/scsi-changer-driver.c b/changer-src/scsi-changer-driver.c index 93ed793..d53c804 100644 --- a/changer-src/scsi-changer-driver.c +++ b/changer-src/scsi-changer-driver.c @@ -11,7 +11,7 @@ static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52 2006/07/21 00:25:50 mar #include "scsi-defs.h" -#include "tapeio.h" +#include "device.h" extern FILE *debug_file; extern changer_t *changer; /* Needed for the infos about emubarcode and labelfile */ @@ -452,6 +452,38 @@ char *chgscsi_datestamp = NULL; /* Result pointer for tape_rdlabel */ char *chgscsi_label = NULL; /* Result pointer for tape_rdlabel */ char *chgscsi_result = NULL; /* Needed for the result string of MapBarCode */ +/* + * This used to be in tape-src/tapeio.c; this is the Device API version. + */ + +static char * +tape_rdlabel( + char *devname, + char **datestamp, + char **label) +{ + Device *dev; + char *r = NULL; + + dev = device_open(devname); + if (dev->status != DEVICE_STATUS_SUCCESS) { + r = g_strdup(device_error_or_status(dev)); + g_object_unref(dev); + return r; + } + + if (!device_configure(dev, TRUE) || !device_read_label(dev)) { + r = g_strdup(device_error_or_status(dev)); + g_object_unref(dev); + return r; + } + + *datestamp = g_strdup(dev->volume_time); + *label = g_strdup(dev->volume_label); + + return NULL; +} + /* * First all functions which are called from extern */ @@ -2592,7 +2624,6 @@ GenericRewind( CDB_T CDB; extern OpenFiles_T *pDev; RequestSense_T *pRequestSense; - char *errstr; /* Used by tape_rewind */ int ret; int cnt = 0; int done; @@ -2790,15 +2821,7 @@ GenericRewind( DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Close Device\n")); SCSI_CloseDevice(DeviceFD); } - /* We don't retry if it fails; that is left to the vtape driver. */ - if ((errstr = tape_rewind(pDev[DeviceFD].dev)) == NULL) { - DebugPrint(DEBUG_INFO, SECTION_TAPE,_("Rewind OK,\n"), cnt); - } else { - DebugPrint(DEBUG_ERROR, SECTION_TAPE,_("Rewind failed %s\n"),errstr); - DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (-1)\n")); - return(-1); - /*NOTREACHED*/ - } + /* no actual rewind operation here -- the device itself will handle that */ DebugPrint(DEBUG_INFO, SECTION_TAPE,_("##### STOP GenericRewind (0)\n")); } diff --git a/client-src/Makefile.am b/client-src/Makefile.am index e21b7bb..b0942bd 100644 --- a/client-src/Makefile.am +++ b/client-src/Makefile.am @@ -70,12 +70,13 @@ INSTALLPERMS_data = chown=amanda \ dest=$(amlibexecdir) $(amlibexec_SCRIPTS) if WANT_SETUID_CLIENT -INSTALLPERMS_exec += dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \ +INSTALLPERMS_exec += dest=$(amlibexecdir) chown=root chmod=04750 \ calcsize killpgrp rundump runtar endif lint: @ for p in $(amlibexec_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamclient_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ diff --git a/client-src/Makefile.in b/client-src/Makefile.in index e830366..57cde70 100644 --- a/client-src/Makefile.in +++ b/client-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ # Makefile for Amanda client programs. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -32,14 +32,14 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -54,8 +54,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -66,7 +66,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -76,12 +80,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -125,7 +132,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -135,7 +142,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -167,18 +182,20 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) amlibexec_PROGRAMS = noop$(EXEEXT) calcsize$(EXEEXT) killpgrp$(EXEEXT) \ rundump$(EXEEXT) runtar$(EXEEXT) selfcheck$(EXEEXT) \ sendbackup$(EXEEXT) sendsize$(EXEEXT) versionsuffix$(EXEEXT) -@WANT_SAMBA_TRUE@am__append_1 = findpass.c +@WANT_SAMBA_TRUE@am__append_2 = findpass.c EXTRA_PROGRAMS = $(am__EXEEXT_1) -@WANT_SETUID_CLIENT_TRUE@am__append_2 = dest=$(amlibexecdir) chown=root chmod=u+s,o-rwx \ +@WANT_SETUID_CLIENT_TRUE@am__append_3 = dest=$(amlibexecdir) chown=root chmod=04750 \ @WANT_SETUID_CLIENT_TRUE@ calcsize killpgrp rundump runtar subdir = client-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -212,6 +229,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -234,7 +252,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -262,7 +282,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -273,7 +292,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -374,7 +392,7 @@ versionsuffix_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \ ../gnulib/libgnu.la amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(amlibexec_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -397,6 +415,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -411,8 +430,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -424,16 +445,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -447,6 +480,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -454,7 +488,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -467,6 +501,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -477,9 +512,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -489,6 +527,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -513,8 +552,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -523,11 +564,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -541,6 +586,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -549,9 +595,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -559,7 +606,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -568,8 +617,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -577,7 +628,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -586,10 +636,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -605,6 +657,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -621,6 +675,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -629,7 +685,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -665,26 +720,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -692,7 +758,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -702,6 +772,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -711,7 +782,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -720,6 +798,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -748,6 +827,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -766,6 +846,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -795,6 +877,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = @@ -806,7 +889,8 @@ MOSTLYCLEANFILES = CLEANFILES = config.log *.test.c # and we'll need to clean up our generated files for distclean -DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) $(am__append_1) MAINTAINERCLEANFILES = # syntax-check shell scripts on 'make check' @@ -815,6 +899,25 @@ CHECK_SHELL = $(SCRIPTS_SHELL) # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/amandad-src \ @@ -830,7 +933,7 @@ CHECK_PERL = $(sbin_SCRIPTS) SCRIPTS_PERL = $(CHECK_PERL) SCRIPTS_SHELL = $(amlibexec_SCRIPTS) libamclient_la_SOURCES = amandates.c getfsent.c unctime.c \ - client_util.c $(am__append_1) + client_util.c $(am__append_2) libamclient_la_LDFLAGS = -release $(VERSION) libamclient_la_LIBADD = ../common-src/libamanda.la @@ -856,7 +959,7 @@ noinst_HEADERS = amandates.h getfsent.h \ findpass.h client_util.h INSTALLPERMS_exec = chown=amanda dest=$(amlibexecdir) \ - $(amlibexec_PROGRAMS) $(am__append_2) + $(amlibexec_PROGRAMS) $(am__append_3) INSTALLPERMS_data = chown=amanda \ dest=$(sbindir) $(sbin_SCRIPTS) \ dest=$(amlibexecdir) $(amlibexec_SCRIPTS) @@ -902,8 +1005,8 @@ install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done @@ -911,8 +1014,8 @@ uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done clean-amlibLTLIBRARIES: @@ -934,8 +1037,8 @@ install-amlibexecPROGRAMS: $(amlibexec_PROGRAMS) || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(amlibexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(amlibexecdir)/$$f" || exit 1; \ else :; fi; \ done @@ -1059,8 +1162,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -1072,8 +1175,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -1083,13 +1186,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -1170,8 +1272,6 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-amlibexecPROGRAMS clean-generic \ @@ -1213,7 +1313,7 @@ install-pdf: install-pdf-am install-ps: install-ps-am -installcheck-am: +installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) @@ -1249,17 +1349,23 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-amlibLTLIBRARIES \ - uninstall-amlibexecPROGRAMS uninstall-amlibexecSCRIPTS + installcheck installcheck-am installcheck-local installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ + uninstall-amlibexecSCRIPTS # Perl %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -1285,13 +1391,27 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \ # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl check-shell: $(CHECK_SHELL) @CHECK_SHELL="$(CHECK_SHELL)"; \ if test -n "$$CHECK_SHELL"; then \ @@ -1329,52 +1449,40 @@ dist-scripts: true dist-hook: dist-scripts -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange @@ -1388,6 +1496,7 @@ dist-hook: dist-scripts lint: @ for p in $(amlibexec_PROGRAMS); do \ + p=`basename $$p $(EXEEXT)`; \ f="$$p.c $(libamclient_la_SOURCES)"; \ (cd ../common-src; make listlibsrc); \ f="$$f "`cat ../common-src/listlibsrc.output`; \ diff --git a/client-src/amandates.c b/client-src/amandates.c index abbef36..c16b246 100644 --- a/client-src/amandates.c +++ b/client-src/amandates.c @@ -57,8 +57,10 @@ start_amandates( int ch; char *qname; - if (amandates_file == NULL) + if (amandates_file == NULL) { + errno = 0; return 0; + } /* clean up from previous invocation */ diff --git a/client-src/client_util.c b/client-src/client_util.c index 7765532..ef28c1a 100644 --- a/client-src/client_util.c +++ b/client-src/client_util.c @@ -33,8 +33,14 @@ #include "client_util.h" #include "getfsent.h" #include "util.h" +#include "glib-util.h" #include "timestamp.h" #include "pipespawn.h" +#include "amxml.h" +#include "glob.h" +#include "clock.h" +#include "amandates.h" +#include "version.h" #define MAXMAXDUMPS 16 @@ -210,7 +216,8 @@ add_include( int nb_exp=0; char *quoted, *file; - (void)disk; /* Quiet unused parameter warning */ + (void)disk; /* Quiet unused parameter warning */ + (void)device; /* Quiet unused parameter warning */ l = strlen(ainc); if(ainc[l-1] == '\n') { @@ -227,8 +234,11 @@ add_include( } else { char *incname = ainc+2; + int set_root; - if(strchr(incname, '/')) { + set_root = set_root_privs(1); + /* Take as is if not root && many '/' */ + if(!set_root && strchr(incname, '/')) { file = quoted = quote_string(ainc); if (*file == '"') { file[strlen(file) - 1] = '\0'; @@ -239,40 +249,34 @@ add_include( nb_exp++; } else { - char *regex; - DIR *d; - struct dirent *entry; - - regex = glob_to_regex(incname); - if((d = opendir(device)) == NULL) { - quoted = quote_string(device); - dbprintf(_("Can't open disk %s\n"), quoted); - if(verbose) { - g_printf(_("ERROR [Can't open disk %s]\n"), quoted); - } - amfree(quoted); + int nb; + glob_t globbuf; + char *cwd; + + globbuf.gl_offs = 0; + + cwd = g_get_current_dir(); + if (chdir(device) != 0) { + error(_("Failed to chdir(%s): %s\n"), device, strerror(errno)); } - else { - while((entry = readdir(d)) != NULL) { - if(is_dot_or_dotdot(entry->d_name)) { - continue; - } - if(match(regex, entry->d_name)) { - incname = vstralloc("./", entry->d_name, NULL); - file = quoted = quote_string(incname); - if (*file == '"') { - file[strlen(file) - 1] = '\0'; - file++; - } - g_fprintf(file_include, "%s\n", file); - amfree(quoted); - amfree(incname); - nb_exp++; - } + glob(incname, 0, NULL, &globbuf); + if (chdir(cwd) != 0) { + error(_("Failed to chdir(%s): %s\n"), cwd, strerror(errno)); + } + if (set_root) + set_root_privs(0); + nb_exp = globbuf.gl_pathc; + for (nb=0; nb < nb_exp; nb++) { + file = stralloc2("./", globbuf.gl_pathv[nb]); + quoted = quote_string(file); + if (*file == '"') { + file[strlen(file) - 1] = '\0'; + file++; } - closedir(d); + g_fprintf(file_include, "%s\n", file); + amfree(quoted); + amfree(file); } - amfree(regex); } } return nb_exp; @@ -280,10 +284,8 @@ add_include( char * build_exclude( - char * disk, - char * device, - option_t * options, - int verbose) + dle_t *dle, + int verbose) { char *filename; FILE *file_exclude; @@ -293,26 +295,26 @@ build_exclude( int nb_exclude = 0; char *quoted; - if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; - if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; + if (dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; + if (dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; - if(nb_exclude == 0) return NULL; + if (nb_exclude == 0) return NULL; - if((filename = build_name(disk, "exclude", verbose)) != NULL) { - if((file_exclude = fopen(filename,"w")) != NULL) { + if ((filename = build_name(dle->disk, "exclude", verbose)) != NULL) { + if ((file_exclude = fopen(filename,"w")) != NULL) { - if(options->exclude_file) { - for(excl = options->exclude_file->first; excl != NULL; + if (dle->exclude_file) { + for(excl = dle->exclude_file->first; excl != NULL; excl = excl->next) { add_exclude(file_exclude, excl->name, - verbose && options->exclude_optional == 0); + verbose && dle->exclude_optional == 0); } } - if(options->exclude_list) { - for(excl = options->exclude_list->first; excl != NULL; + if (dle->exclude_list) { + for(excl = dle->exclude_list->first; excl != NULL; excl = excl->next) { - char *exclname = fixup_relative(excl->name, device); + char *exclname = fixup_relative(excl->name, dle->device); if((exclude = fopen(exclname, "r")) != NULL) { while ((aexc = agets(exclude)) != NULL) { if (aexc[0] == '\0') { @@ -320,7 +322,7 @@ build_exclude( continue; } add_exclude(file_exclude, aexc, - verbose && options->exclude_optional == 0); + verbose && dle->exclude_optional == 0); amfree(aexc); } fclose(exclude); @@ -329,7 +331,7 @@ build_exclude( quoted = quote_string(exclname); dbprintf(_("Can't open exclude file %s (%s)\n"), quoted, strerror(errno)); - if(verbose && (options->exclude_optional == 0 || + if(verbose && (dle->exclude_optional == 0 || errno != ENOENT)) { g_printf(_("ERROR [Can't open exclude file %s (%s)]\n"), quoted, strerror(errno)); @@ -340,12 +342,11 @@ build_exclude( } } fclose(file_exclude); - } - else { + } else { quoted = quote_string(filename); dbprintf(_("Can't create exclude file %s (%s)\n"), quoted, strerror(errno)); - if(verbose) { + if (verbose) { g_printf(_("ERROR [Can't create exclude file %s (%s)]\n"), quoted, strerror(errno)); } @@ -358,10 +359,8 @@ build_exclude( char * build_include( - char * disk, - char * device, - option_t * options, - int verbose) + dle_t *dle, + int verbose) { char *filename; FILE *file_include; @@ -372,36 +371,36 @@ build_include( int nb_exp = 0; char *quoted; - if(options->include_file) nb_include += options->include_file->nb_element; - if(options->include_list) nb_include += options->include_list->nb_element; + if (dle->include_file) nb_include += dle->include_file->nb_element; + if (dle->include_list) nb_include += dle->include_list->nb_element; - if(nb_include == 0) return NULL; + if (nb_include == 0) return NULL; - if((filename = build_name(disk, "include", verbose)) != NULL) { - if((file_include = fopen(filename,"w")) != NULL) { + if ((filename = build_name(dle->disk, "include", verbose)) != NULL) { + if ((file_include = fopen(filename,"w")) != NULL) { - if(options->include_file) { - for(incl = options->include_file->first; incl != NULL; + if (dle->include_file) { + for (incl = dle->include_file->first; incl != NULL; incl = incl->next) { - nb_exp += add_include(disk, device, file_include, + nb_exp += add_include(dle->disk, dle->device, file_include, incl->name, - verbose && options->include_optional == 0); + verbose && dle->include_optional == 0); } } - if(options->include_list) { - for(incl = options->include_list->first; incl != NULL; + if (dle->include_list) { + for (incl = dle->include_list->first; incl != NULL; incl = incl->next) { - char *inclname = fixup_relative(incl->name, device); - if((include = fopen(inclname, "r")) != NULL) { + char *inclname = fixup_relative(incl->name, dle->device); + if ((include = fopen(inclname, "r")) != NULL) { while ((ainc = agets(include)) != NULL) { if (ainc[0] == '\0') { amfree(ainc); continue; } - nb_exp += add_include(disk, device, + nb_exp += add_include(dle->disk, dle->device, file_include, ainc, - verbose && options->include_optional == 0); + verbose && dle->include_optional == 0); amfree(ainc); } fclose(include); @@ -410,7 +409,7 @@ build_include( quoted = quote_string(inclname); dbprintf(_("Can't open include file %s (%s)\n"), quoted, strerror(errno)); - if(verbose && (options->include_optional == 0 || + if (verbose && (dle->include_optional == 0 || errno != ENOENT)) { g_printf(_("ERROR [Can't open include file %s (%s)]\n"), quoted, strerror(errno)); @@ -421,12 +420,11 @@ build_include( } } fclose(file_include); - } - else { + } else { quoted = quote_string(filename); dbprintf(_("Can't create include file %s (%s)\n"), quoted, strerror(errno)); - if(verbose) { + if (verbose) { g_printf(_("ERROR [Can't create include file %s (%s)]\n"), quoted, strerror(errno)); } @@ -434,10 +432,10 @@ build_include( } } - if(nb_exp == 0) { - quoted = quote_string(disk); + if (nb_exp == 0) { + quoted = quote_string(dle->disk); dbprintf(_("No include for %s\n"), quoted); - if(verbose && options->include_optional == 0) { + if (verbose && dle->include_optional == 0) { g_printf(_("ERROR [No include for %s]\n"), quoted); } amfree(quoted); @@ -448,59 +446,24 @@ build_include( void -init_options( - option_t *options) -{ - options->str = NULL; - options->compress = COMP_NONE; - options->srvcompprog = NULL; - options->clntcompprog = NULL; - options->encrypt = ENCRYPT_NONE; - options->kencrypt = 0; - options->srv_encrypt = NULL; - options->clnt_encrypt = NULL; - options->srv_decrypt_opt = NULL; - options->clnt_decrypt_opt = NULL; - options->no_record = 0; - options->createindex = 0; - options->auth = NULL; - options->exclude_file = NULL; - options->exclude_list = NULL; - options->include_file = NULL; - options->include_list = NULL; - options->exclude_optional = 0; - options->include_optional = 0; -} - - -option_t * parse_options( - char *str, - char *disk, - char *device, + char *str, + dle_t *dle, am_feature_t *fs, - int verbose) + int verbose) { char *exc; char *inc; - option_t *options; char *p, *tok; char *quoted; - (void)disk; /* Quiet unused parameter warning */ - (void)device; /* Quiet unused parameter warning */ - - options = alloc(SIZEOF(option_t)); - init_options(options); - options->str = stralloc(str); - p = stralloc(str); tok = strtok(p,";"); while (tok != NULL) { if(am_has_feature(fs, fe_options_auth) && BSTRNCMP(tok,"auth=") == 0) { - if(options->auth != NULL) { + if (dle->auth != NULL) { quoted = quote_string(tok + 5); dbprintf(_("multiple auth option %s\n"), quoted); if(verbose) { @@ -508,174 +471,174 @@ parse_options( } amfree(quoted); } - options->auth = stralloc(&tok[5]); + dle->auth = stralloc(&tok[5]); } else if(am_has_feature(fs, fe_options_bsd_auth) && BSTRNCMP(tok, "bsd-auth") == 0) { - if(options->auth != NULL) { + if (dle->auth != NULL) { dbprintf(_("multiple auth option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple auth option]\n")); } } - options->auth = stralloc("bsd"); + dle->auth = stralloc("bsd"); } - else if(am_has_feature(fs, fe_options_krb4_auth) + else if (am_has_feature(fs, fe_options_krb4_auth) && BSTRNCMP(tok, "krb4-auth") == 0) { - if(options->auth != NULL) { + if (dle->auth != NULL) { dbprintf(_("multiple auth option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple auth option]\n")); } } - options->auth = stralloc("krb4"); + dle->auth = stralloc("krb4"); } - else if(BSTRNCMP(tok, "compress-fast") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "compress-fast") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->compress = COMP_FAST; + dle->compress = COMP_FAST; } - else if(BSTRNCMP(tok, "compress-best") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "compress-best") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->compress = COMP_BEST; + dle->compress = COMP_BEST; } - else if(BSTRNCMP(tok, "srvcomp-fast") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "srvcomp-fast") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->compress = COMP_SERVER_FAST; + dle->compress = COMP_SERVER_FAST; } - else if(BSTRNCMP(tok, "srvcomp-best") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "srvcomp-best") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->compress = COMP_SERVER_BEST; + dle->compress = COMP_SERVER_BEST; } - else if(BSTRNCMP(tok, "srvcomp-cust=") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "srvcomp-cust=") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->srvcompprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1); - options->compress = COMP_SERVER_CUST; + dle->compprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1); + dle->compress = COMP_SERVER_CUST; } - else if(BSTRNCMP(tok, "comp-cust=") == 0) { - if(options->compress != COMP_NONE) { + else if (BSTRNCMP(tok, "comp-cust=") == 0) { + if (dle->compress != COMP_NONE) { dbprintf(_("multiple compress option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple compress option]\n")); } } - options->clntcompprog = stralloc(tok + SIZEOF("comp-cust=") -1); - options->compress = COMP_CUST; + dle->compprog = stralloc(tok + SIZEOF("comp-cust=") -1); + dle->compress = COMP_CUST; /* parse encryption options */ } - else if(BSTRNCMP(tok, "encrypt-serv-cust=") == 0) { - if(options->encrypt != ENCRYPT_NONE) { + else if (BSTRNCMP(tok, "encrypt-serv-cust=") == 0) { + if (dle->encrypt != ENCRYPT_NONE) { dbprintf(_("multiple encrypt option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple encrypt option]\n")); } } - options->srv_encrypt = stralloc(tok + SIZEOF("encrypt-serv-cust=") -1); - options->encrypt = ENCRYPT_SERV_CUST; + dle->srv_encrypt = stralloc(tok + SIZEOF("encrypt-serv-cust=") -1); + dle->encrypt = ENCRYPT_SERV_CUST; } - else if(BSTRNCMP(tok, "encrypt-cust=") == 0) { - if(options->encrypt != ENCRYPT_NONE) { + else if (BSTRNCMP(tok, "encrypt-cust=") == 0) { + if (dle->encrypt != ENCRYPT_NONE) { dbprintf(_("multiple encrypt option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple encrypt option]\n")); } } - options->clnt_encrypt= stralloc(tok + SIZEOF("encrypt-cust=") -1); - options->encrypt = ENCRYPT_CUST; + dle->clnt_encrypt= stralloc(tok + SIZEOF("encrypt-cust=") -1); + dle->encrypt = ENCRYPT_CUST; } - else if(BSTRNCMP(tok, "server-decrypt-option=") == 0) { - options->srv_decrypt_opt = stralloc(tok + SIZEOF("server-decrypt-option=") -1); + else if (BSTRNCMP(tok, "server-decrypt-option=") == 0) { + dle->srv_decrypt_opt = stralloc(tok + SIZEOF("server-decrypt-option=") -1); } - else if(BSTRNCMP(tok, "client-decrypt-option=") == 0) { - options->clnt_decrypt_opt = stralloc(tok + SIZEOF("client-decrypt-option=") -1); + else if (BSTRNCMP(tok, "client-decrypt-option=") == 0) { + dle->clnt_decrypt_opt = stralloc(tok + SIZEOF("client-decrypt-option=") -1); } - else if(BSTRNCMP(tok, "no-record") == 0) { - if(options->no_record != 0) { + else if (BSTRNCMP(tok, "no-record") == 0) { + if (dle->record != 1) { dbprintf(_("multiple no-record option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple no-record option]\n")); } } - options->no_record = 1; + dle->record = 0; } - else if(BSTRNCMP(tok, "index") == 0) { - if(options->createindex != 0) { + else if (BSTRNCMP(tok, "index") == 0) { + if (dle->create_index != 0) { dbprintf(_("multiple index option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple index option]\n")); } } - options->createindex = 1; + dle->create_index = 1; } - else if(BSTRNCMP(tok, "exclude-optional") == 0) { - if(options->exclude_optional != 0) { + else if (BSTRNCMP(tok, "exclude-optional") == 0) { + if (dle->exclude_optional != 0) { dbprintf(_("multiple exclude-optional option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple exclude-optional option]\n")); } } - options->exclude_optional = 1; + dle->exclude_optional = 1; } - else if(strcmp(tok, "include-optional") == 0) { - if(options->include_optional != 0) { + else if (strcmp(tok, "include-optional") == 0) { + if (dle->include_optional != 0) { dbprintf(_("multiple include-optional option\n")); - if(verbose) { + if (verbose) { g_printf(_("ERROR [multiple include-optional option]\n")); } } - options->include_optional = 1; + dle->include_optional = 1; } - else if(BSTRNCMP(tok,"exclude-file=") == 0) { + else if (BSTRNCMP(tok,"exclude-file=") == 0) { exc = unquote_string(&tok[13]); - options->exclude_file = append_sl(options->exclude_file, exc); + dle->exclude_file = append_sl(dle->exclude_file, exc); amfree(exc); } - else if(BSTRNCMP(tok,"exclude-list=") == 0) { + else if (BSTRNCMP(tok,"exclude-list=") == 0) { exc = unquote_string(&tok[13]); - options->exclude_list = append_sl(options->exclude_list, exc); + dle->exclude_list = append_sl(dle->exclude_list, exc); amfree(exc); } - else if(BSTRNCMP(tok,"include-file=") == 0) { + else if (BSTRNCMP(tok,"include-file=") == 0) { inc = unquote_string(&tok[13]); - options->include_file = append_sl(options->include_file, inc); + dle->include_file = append_sl(dle->include_file, inc); amfree(inc); } - else if(BSTRNCMP(tok,"include-list=") == 0) { + else if (BSTRNCMP(tok,"include-list=") == 0) { inc = unquote_string(&tok[13]); - options->include_list = append_sl(options->include_list, inc); + dle->include_list = append_sl(dle->include_list, inc); amfree(inc); } - else if(BSTRNCMP(tok,"kencrypt") == 0) { - options->kencrypt = 1; + else if (BSTRNCMP(tok,"kencrypt") == 0) { + dle->kencrypt = 1; } - else if(strcmp(tok,"|") != 0) { + else if (strcmp(tok,"|") != 0) { quoted = quote_string(tok); dbprintf(_("unknown option %s\n"), quoted); - if(verbose) { + if (verbose) { g_printf(_("ERROR [unknown option: %s]\n"), quoted); } amfree(quoted); @@ -683,64 +646,93 @@ parse_options( tok = strtok(NULL, ";"); } amfree(p); - return options; } -void -output_tool_property( - FILE *tool, - option_t *options) +int +application_property_argv_size(dle_t *dle) { + int nb; + + nb = 0; + if (dle->include_list) + nb += dle->include_list->nb_element; + if (dle->include_file) + nb += dle->include_file->nb_element; + nb++; /* include optional */ + if (dle->exclude_list) + nb += dle->exclude_list->nb_element; + if (dle->exclude_file) + nb += dle->exclude_file->nb_element; + nb++; /* exclude optional */ + nb *= 2; /*name + value */ + nb += property_argv_size(dle->application_property); + + return nb; +} + +int +application_property_add_to_argv( + char **argvchild, + dle_t *dle, + backup_support_option_t *bsu) { - sle_t *sle; - char *q; + char **argv = argvchild; + sle_t *incl, *excl; - if (!is_empty_sl(options->exclude_file)) { - for(sle = options->exclude_file->first ; sle != NULL; sle=sle->next) { - q = quote_string(sle->name); - g_fprintf(tool, "EXCLUDE-FILE %s\n", q); - amfree(q); + if (bsu) { + if (bsu->include_file && dle->include_file) { + for (incl = dle->include_file->first; incl != NULL; + incl = incl->next) { + *argv = stralloc("--include-file"); + argv++; + *argv = stralloc(incl->name); + argv++; + } } - } - - if (!is_empty_sl(options->exclude_list)) { - for(sle = options->exclude_list->first ; sle != NULL; sle=sle->next) { - q = quote_string(sle->name); - g_fprintf(tool, "EXCLUDE-LIST %s\n", q); - amfree(q); + if (bsu->include_list && dle->include_list) { + for (incl = dle->include_list->first; incl != NULL; + incl = incl->next) { + *argv = stralloc("--include-list"); + argv++; + *argv = stralloc(incl->name); + argv++; + } } - } - - if (!is_empty_sl(options->include_file)) { - for(sle = options->include_file->first ; sle != NULL; sle=sle->next) { - q = quote_string(sle->name); - g_fprintf(tool, "INCLUDE-FILE %s\n", q); - amfree(q); + if (bsu->include_optional && dle->include_optional) { + *argv = stralloc("--include-optional"); + argv++; + *argv = stralloc("yes"); + argv++; } - } - if (!is_empty_sl(options->include_list)) { - for(sle = options->include_list->first ; sle != NULL; sle=sle->next) { - q = quote_string(sle->name); - g_fprintf(tool, "INCLUDE-LIST %s\n", q); - amfree(q); + if (bsu->exclude_file && dle->exclude_file) { + for (excl = dle->exclude_file->first; excl != NULL; + excl = excl->next) { + *argv = stralloc("--exclude-file"); + argv++; + *argv = stralloc(excl->name); + argv++; + } + } + if (bsu->exclude_list && dle->exclude_list) { + for (excl = dle->exclude_list->first; excl != NULL; + excl = excl->next) { + *argv = stralloc("--exclude-list"); + argv++; + *argv = stralloc(excl->name); + argv++; + } + } + if (bsu->exclude_optional && dle->exclude_optional) { + *argv = stralloc("--exclude-optional"); + argv++; + *argv = stralloc("yes"); + argv++; } } - if (!is_empty_sl(options->exclude_file) || - !is_empty_sl(options->exclude_list)) { - if (options->exclude_optional) - g_fprintf(tool, "EXCLUDE-OPTIONAL YES\n"); - else - g_fprintf(tool, "EXCLUDE-OPTIONAL NO\n"); - } - - if (!is_empty_sl(options->include_file) || - !is_empty_sl(options->include_list)) { - if (options->include_optional) - g_fprintf(tool, "INCLUDE-OPTIONAL YES\n"); - else - g_fprintf(tool, "INCLUDE-OPTIONAL NO\n"); - } + g_hash_table_foreach(dle->application_property, + &proplist_add_to_argv, &argv); + return (argv - argvchild); } backup_support_option_t * @@ -748,7 +740,8 @@ backup_support_option( char *program, g_option_t *g_options, char *disk, - char *amdevice) + char *amdevice, + GPtrArray **errarray) { pid_t supportpid; int supportin, supportout, supporterr; @@ -756,11 +749,15 @@ backup_support_option( char **argvchild; int i; FILE *streamout; + FILE *streamerr; char *line; + int status; + char *err = NULL; backup_support_option_t *bsu; - cmd = vstralloc(DUMPER_DIR, "/", program, NULL); - argvchild = malloc(5 * SIZEOF(char *)); + *errarray = g_ptr_array_new(); + cmd = vstralloc(APPLICATION_DIR, "/", program, NULL); + argvchild = g_new0(char *, 12); i = 0; argvchild[i++] = program; argvchild[i++] = "support"; @@ -778,19 +775,25 @@ backup_support_option( } if (amdevice) { argvchild[i++] = "--device"; - argvchild[i++] = amdevice; + argvchild[i++] = stralloc(amdevice); } argvchild[i++] = NULL; supporterr = fileno(stderr); - supportpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE, &supportin, - &supportout, &supporterr, argvchild); + supportpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE|STDERR_PIPE, 0, + &supportin, &supportout, &supporterr, argvchild); aclose(supportin); - bsu = malloc(SIZEOF(*bsu)); - memset(bsu, '\0', SIZEOF(*bsu)); + bsu = g_new0(backup_support_option_t, 1); + bsu->config = 1; + bsu->host = 1; + bsu->disk = 1; streamout = fdopen(supportout, "r"); + if (!streamout) { + error(_("Error opening pipe to child: %s"), strerror(errno)); + /* NOTREACHED */ + } while((line = agets(streamout)) != NULL) { dbprintf(_("support line: %s\n"), line); if (strncmp(line,"CONFIG ", 7) == 0) { @@ -801,7 +804,7 @@ backup_support_option( bsu->host = 1; } else if (strncmp(line,"DISK ", 5) == 0) { if (strcmp(line+5, "YES") == 0) - bsu->host = 1; + bsu->disk = 1; } else if (strncmp(line,"INDEX-LINE ", 11) == 0) { if (strcmp(line+11, "YES") == 0) bsu->index_line = 1; @@ -823,24 +826,712 @@ backup_support_option( } else if (strncmp(line,"INCLUDE-LIST ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->include_list = 1; + } else if (strncmp(line,"INCLUDE-OPTIONAL ", 17) == 0) { + if (strcmp(line+17, "YES") == 0) + bsu->include_optional = 1; } else if (strncmp(line,"EXCLUDE-FILE ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->exclude_file = 1; } else if (strncmp(line,"EXCLUDE-LIST ", 13) == 0) { if (strcmp(line+13, "YES") == 0) bsu->exclude_list = 1; + } else if (strncmp(line,"EXCLUDE-OPTIONAL ", 17) == 0) { + if (strcmp(line+17, "YES") == 0) + bsu->exclude_optional = 1; } else if (strncmp(line,"COLLECTION ", 11) == 0) { if (strcmp(line+11, "YES") == 0) bsu->collection = 1; + } else if (strncmp(line,"CALCSIZE ", 9) == 0) { + if (strcmp(line+9, "YES") == 0) + bsu->calcsize = 1; + } else if (strncmp(line,"MULTI-ESTIMATE ", 15) == 0) { + if (strcmp(line+15, "YES") == 0) + bsu->multi_estimate = 1; } else if (strncmp(line,"MAX-LEVEL ", 10) == 0) { bsu->max_level = atoi(line+10); + } else if (strncmp(line,"RECOVER-MODE ", 13) == 0) { + if (strcasecmp(line+13, "SMB") == 0) + bsu->smb_recover_mode = 1; } else { dbprintf(_("Invalid support line: %s\n"), line); } amfree(line); } aclose(supportout); + streamerr = fdopen(supporterr, "r"); + if (!streamerr) { + error(_("Error opening pipe to child: %s"), strerror(errno)); + /* NOTREACHED */ + } + while((line = agets(streamerr)) != NULL) { + if (strlen(line) > 0) { + g_ptr_array_add(*errarray, line); + dbprintf("Application '%s': %s\n", program, line); + } + amfree(bsu); + } + aclose(supporterr); + + if (waitpid(supportpid, &status, 0) < 0) { + err = vstrallocf(_("waitpid failed: %s"), strerror(errno)); + } else if (!WIFEXITED(status)) { + err = vstrallocf(_("exited with signal %d"), WTERMSIG(status)); + } else if (WEXITSTATUS(status) != 0) { + err = vstrallocf(_("exited with status %d"), WEXITSTATUS(status)); + } + + if (err) { + g_ptr_array_add(*errarray, err); + dbprintf("Application '%s': %s\n", program, err); + amfree(bsu); + } + return bsu; +} + +void +run_client_script( + script_t *script, + execute_on_t execute_on, + g_option_t *g_options, + dle_t *dle) +{ + pid_t scriptpid; + int scriptin, scriptout, scripterr; + char *cmd; + char **argvchild; + int i; + FILE *streamout; + FILE *streamerr; + char *line; + int argv_size; + amwait_t wait_status; + + if ((script->execute_on & execute_on) == 0) + return; + if (script->execute_where != ES_CLIENT) + return; + + cmd = vstralloc(APPLICATION_DIR, "/", script->plugin, NULL); + argv_size = 14 + property_argv_size(script->property); + if (dle->level) + argv_size += 2 * g_slist_length(dle->level); + argvchild = g_new0(char *, argv_size); + i = 0; + argvchild[i++] = script->plugin; + + switch (execute_on) { + case EXECUTE_ON_PRE_DLE_AMCHECK: + argvchild[i++] = "PRE-DLE-AMCHECK"; break; + case EXECUTE_ON_PRE_HOST_AMCHECK: + argvchild[i++] = "PRE-HOST-AMCHECK"; break; + case EXECUTE_ON_POST_DLE_AMCHECK: + argvchild[i++] = "POST-DLE-AMCHECK"; break; + case EXECUTE_ON_POST_HOST_AMCHECK: + argvchild[i++] = "POST-HOST-AMCHECK"; break; + case EXECUTE_ON_PRE_DLE_ESTIMATE: + argvchild[i++] = "PRE-DLE-ESTIMATE"; break; + case EXECUTE_ON_PRE_HOST_ESTIMATE: + argvchild[i++] = "PRE-HOST-ESTIMATE"; break; + case EXECUTE_ON_POST_DLE_ESTIMATE: + argvchild[i++] = "POST-DLE-ESTIMATE"; break; + case EXECUTE_ON_POST_HOST_ESTIMATE: + argvchild[i++] = "POST-HOST-ESTIMATE"; break; + case EXECUTE_ON_PRE_DLE_BACKUP: + argvchild[i++] = "PRE-DLE-BACKUP"; break; + case EXECUTE_ON_PRE_HOST_BACKUP: + argvchild[i++] = "PRE-HOST-BACKUP"; break; + case EXECUTE_ON_POST_DLE_BACKUP: + argvchild[i++] = "POST-DLE-BACKUP"; break; + case EXECUTE_ON_POST_HOST_BACKUP: + argvchild[i++] = "POST-HOST-BACKUP"; break; + case EXECUTE_ON_PRE_RECOVER: + argvchild[i++] = "PRE-RECOVER"; break; + case EXECUTE_ON_POST_RECOVER: + argvchild[i++] = "POST-RECOVER"; break; + case EXECUTE_ON_PRE_LEVEL_RECOVER: + argvchild[i++] = "PRE-LEVEL-RECOVER"; break; + case EXECUTE_ON_POST_LEVEL_RECOVER: + argvchild[i++] = "POST-LEVEL-RECOVER"; break; + case EXECUTE_ON_INTER_LEVEL_RECOVER: + argvchild[i++] = "INTER-LEVEL-RECOVER"; break; + } + + argvchild[i++] = "--execute-where"; + argvchild[i++] = "client"; + + if (g_options->config) { + argvchild[i++] = "--config"; + argvchild[i++] = g_options->config; + } + if (g_options->hostname) { + argvchild[i++] = "--host"; + argvchild[i++] = g_options->hostname; + } + if (dle->disk) { + argvchild[i++] = "--disk"; + argvchild[i++] = dle->disk; + } + if (dle->device) { + argvchild[i++] = "--device"; + argvchild[i++] = stralloc(dle->device); + } + if (dle->level) { + GSList *level; + char number[NUM_STR_SIZE]; + for (level=dle->level; level; level=level->next) { + argvchild[i++] = "--level"; + g_snprintf(number, SIZEOF(number), "%d", + GPOINTER_TO_INT(level->data)); + argvchild[i++] = stralloc(number); + } + } + i += property_add_to_argv(&argvchild[i], script->property); + argvchild[i++] = NULL; + + scriptpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE|STDERR_PIPE, 0, + &scriptin, &scriptout, &scripterr, argvchild); + + close(scriptin); + + script->result = g_new0(client_script_result_t, 1); + script->result->proplist = + g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); + script->result->output = g_ptr_array_new(); + script->result->err = g_ptr_array_new(); + + streamout = fdopen(scriptout, "r"); + if (streamout) { + while((line = agets(streamout)) != NULL) { + dbprintf("script: %s\n", line); + if (BSTRNCMP(line, "PROPERTY ") == 0) { + char *property_name, *property_value; + property_name = line + 9; + property_value = index(property_name,' '); + if (property_value == NULL) { + char *msg = g_strdup_printf( + "ERROR %s: Bad output property: %s", + script->plugin, line); + g_ptr_array_add(script->result->output, msg); + } else { + property_t *property; + + *property_value++ = '\0'; + property_name = stralloc(property_name); + property_value = stralloc(property_value); + property = g_hash_table_lookup(script->result->proplist, + property_name); + if (!property) { + property = g_new0(property_t, 1); + g_hash_table_insert(script->result->proplist, + property_name, property); + } + property->values = g_slist_append(property->values, + property_value); + } + amfree(line); + } else { + g_ptr_array_add(script->result->output, line); + } + } + } + fclose(streamout); + + streamerr = fdopen(scripterr, "r"); + if (streamerr) { + while((line = agets(streamerr)) != NULL) { + g_ptr_array_add(script->result->err, + g_strdup_printf(_("Script '%s' command '%s': %s"), + script->plugin, argvchild[1], + line)); + amfree(line); + } + } + + waitpid(scriptpid, &wait_status, 0); + if (WIFSIGNALED(wait_status)) { + g_ptr_array_add(script->result->err, + g_strdup_printf(_("Script '%s' command '%s' terminated with signal %d: see %s"), + script->plugin, argvchild[1], + WTERMSIG(wait_status), + dbfn())); + } else if (WIFEXITED(wait_status)) { + if (WEXITSTATUS(wait_status) != 0) { + g_ptr_array_add(script->result->err, + g_strdup_printf(_("Script '%s' command '%s' exited with status %d: see %s"), + script->plugin, argvchild[1], + WEXITSTATUS(wait_status), + dbfn())); + } else { + /* Normal exit */ + } + } + +} + +void run_client_script_output(gpointer data, gpointer user_data); +void run_client_script_err_amcheck(gpointer data, gpointer user_data); +void run_client_script_err_estimate(gpointer data, gpointer user_data); +void run_client_script_err_backup(gpointer data, gpointer user_data); +void run_client_script_err_recover(gpointer data, gpointer user_data); + +typedef struct script_output_s { + FILE *stream; + dle_t *dle; +} script_output_t; + +void +run_client_script_output( + gpointer data, + gpointer user_data) +{ + char *line = data; + script_output_t *so = user_data; + + if (line && so->stream) { + g_fprintf(so->stream, "%s\n", line); + } +} + +void +run_client_script_err_amcheck( + gpointer data, + gpointer user_data) +{ + char *line = data; + script_output_t *so = user_data; - return NULL; + if (line && so->stream) { + g_fprintf(so->stream, "ERROR %s\n", line); + } } +void +run_client_script_err_estimate( + gpointer data, + gpointer user_data) +{ + char *line = data; + script_output_t *so = user_data; + + if (line && so->stream) { + char *qdisk = quote_string(so->dle->disk); + g_fprintf(so->stream, "%s 0 WARNING \"%s\"\n", qdisk, line); + amfree(qdisk); + } +} + +void +run_client_script_err_backup( + gpointer data, + gpointer user_data) +{ + char *line = data; + script_output_t *so = user_data; + + if (line && so->stream) { + g_fprintf(so->stream, "? %s\n", line); + } +} + +void +run_client_script_err_recover( + gpointer data, + gpointer user_data) +{ + char *line = data; + script_output_t *so = user_data; + + if (line && so->stream) { + g_fprintf(so->stream, "%s\n", line); + } +} + +void +run_client_scripts( + execute_on_t execute_on, + g_option_t *g_options, + dle_t *dle, + FILE *streamout) +{ + GSList *scriptlist; + script_t *script; + GFunc client_script_err = NULL; + script_output_t so = { streamout, dle }; + + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + run_client_script(script, execute_on, g_options, dle); + if (script->result && script->result->output) { + g_ptr_array_foreach(script->result->output, + run_client_script_output, + &so); + g_ptr_array_free(script->result->output, TRUE); + script->result->output = NULL; + } + if (script->result && script->result->err) { + switch (execute_on) { + case EXECUTE_ON_PRE_DLE_AMCHECK: + case EXECUTE_ON_PRE_HOST_AMCHECK: + case EXECUTE_ON_POST_DLE_AMCHECK: + case EXECUTE_ON_POST_HOST_AMCHECK: + client_script_err = run_client_script_err_amcheck; + break; + case EXECUTE_ON_PRE_DLE_ESTIMATE: + case EXECUTE_ON_PRE_HOST_ESTIMATE: + case EXECUTE_ON_POST_DLE_ESTIMATE: + case EXECUTE_ON_POST_HOST_ESTIMATE: + if (am_has_feature(g_options->features, + fe_sendsize_rep_warning)) { + client_script_err = run_client_script_err_estimate; + } + break; + case EXECUTE_ON_PRE_DLE_BACKUP: + case EXECUTE_ON_PRE_HOST_BACKUP: + case EXECUTE_ON_POST_DLE_BACKUP: + case EXECUTE_ON_POST_HOST_BACKUP: + client_script_err = run_client_script_err_backup; + break; + case EXECUTE_ON_PRE_RECOVER: + case EXECUTE_ON_POST_RECOVER: + case EXECUTE_ON_PRE_LEVEL_RECOVER: + case EXECUTE_ON_POST_LEVEL_RECOVER: + case EXECUTE_ON_INTER_LEVEL_RECOVER: + client_script_err = run_client_script_err_recover; + } + if (client_script_err != NULL) { + g_ptr_array_foreach(script->result->err, + client_script_err, + &so); + } + g_ptr_array_free(script->result->err, TRUE); + script->result->err = NULL; + } + } +} + + +void +run_calcsize( + char *config, + char *program, + char *disk, + char *dirname, + GSList *levels, + char *file_exclude, + char *file_include) +{ + char *cmd, *cmdline; + char *my_argv[DUMP_LEVELS*2+22]; + int my_argc; + char tmppath[PATH_MAX]; + char number[NUM_STR_SIZE]; + GSList *alevel; + int level; + int i; + char *match_expr; + int pipefd = -1, nullfd = -1; + pid_t calcpid; + times_t start_time; + FILE *dumpout = NULL; + int dumpsince; + char *errmsg = NULL; + off_t size = (off_t)1; + char *line = NULL; + amwait_t wait_status; + int len; + char *qdisk; + amandates_t *amdp; + char *amandates_file; + + qdisk = quote_string(disk); + + amandates_file = getconf_str(CNF_AMANDATES); + if(!start_amandates(amandates_file, 0)) { + char *errstr = strerror(errno); + char *errmsg = vstrallocf(_("could not open %s: %s"), amandates_file, errstr); + char *qerrmsg = quote_string(errmsg); + g_printf(_("ERROR %s\n"), qerrmsg); + amfree(qdisk); + amfree(errmsg); + amfree(qerrmsg); + return; + } + + startclock(); + cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL); + + my_argc = 0; + + my_argv[my_argc++] = stralloc("calcsize"); + if (config) + my_argv[my_argc++] = stralloc(config); + else + my_argv[my_argc++] = stralloc("NOCONFIG"); + + my_argv[my_argc++] = stralloc(program); + + canonicalize_pathname(disk, tmppath); + my_argv[my_argc++] = stralloc(tmppath); + canonicalize_pathname(dirname, tmppath); + my_argv[my_argc++] = stralloc(tmppath); + + if (file_exclude) { + my_argv[my_argc++] = stralloc("-X"); + my_argv[my_argc++] = file_exclude; + } + + if (file_include) { + my_argv[my_argc++] = stralloc("-I"); + my_argv[my_argc++] = file_include; + } + + for (alevel = levels; alevel != NULL; alevel = alevel->next) { + amdp = amandates_lookup(disk); + level = GPOINTER_TO_INT(alevel->data); + dbprintf("level: %d\n", level); + dumpsince = 0; + for (i=0; i < level; i++) { + if (dumpsince < amdp->dates[i]) + dumpsince = amdp->dates[i]; + } + g_snprintf(number, SIZEOF(number), "%d", level); + my_argv[my_argc++] = stralloc(number); + g_snprintf(number, SIZEOF(number), "%d", dumpsince); + my_argv[my_argc++] = stralloc(number); + } + + my_argv[my_argc] = NULL; + cmdline = stralloc(my_argv[0]); + for(i = 1; i < my_argc; i++) + cmdline = vstrextend(&cmdline, " ", my_argv[i], NULL); + dbprintf(_("running: \"%s\"\n"), cmdline); + amfree(cmdline); + + start_time = curclock(); + + fflush(stderr); fflush(stdout); + + if ((nullfd = open("/dev/null", O_RDWR)) == -1) { + errmsg = vstrallocf(_("Cannot access /dev/null : %s"), + strerror(errno)); + dbprintf("%s\n", errmsg); + goto common_exit; + } + + calcpid = pipespawnv(cmd, STDERR_PIPE, 0, + &nullfd, &nullfd, &pipefd, my_argv); + amfree(cmd); + + dumpout = fdopen(pipefd,"r"); + if (!dumpout) { + error(_("Can't fdopen: %s"), strerror(errno)); + /*NOTREACHED*/ + } + + match_expr = vstralloc(" %d SIZE %lld", NULL); + len = strlen(qdisk); + for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { + long long size_ = (long long)0; + if (line[0] == '\0' || (int)strlen(line) <= len) + continue; + /* Don't use sscanf for qdisk because it can have a '%'. */ + if (strncmp(line, qdisk, len) == 0 && + sscanf(line+len, match_expr, &level, &size_) == 2) { + g_printf("%d %lld %d\n", level, size_, 1); /* write to sendsize */ + dbprintf(_("estimate size for %s level %d: %lld KB\n"), + qdisk, level, size_); + } + size = (off_t)size_; + } + amfree(match_expr); + + dbprintf(_("waiting for %s %s child (pid=%d)\n"), + my_argv[0], qdisk, (int)calcpid); + waitpid(calcpid, &wait_status, 0); + if (WIFSIGNALED(wait_status)) { + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), + "calcsize", WTERMSIG(wait_status), + dbfn()); + } else if (WIFEXITED(wait_status)) { + if (WEXITSTATUS(wait_status) != 0) { + errmsg = vstrallocf(_("%s exited with status %d: see %s"), + "calcsize", WEXITSTATUS(wait_status), + dbfn()); + } else { + /* Normal exit */ + } + } else { + errmsg = vstrallocf(_("%s got bad exit: see %s"), + "calcsize", dbfn()); + } + + dbprintf(_("after %s %s wait: child pid=%d status=%d\n"), + my_argv[0], qdisk, + (int)calcpid, WEXITSTATUS(wait_status)); + + dbprintf(_(".....\n")); + dbprintf(_("estimate time for %s: %s\n"), + qdisk, + walltime_str(timessub(curclock(), start_time))); + +common_exit: + if (errmsg && errmsg[0] != '\0') { + char *qerrmsg = quote_string(errmsg); + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf("ERROR %s\n", qerrmsg); + amfree(qerrmsg); + } + amfree(qdisk); + amfree(errmsg); + for(i = 0; i < my_argc; i++) { + amfree(my_argv[i]); + } + amfree(cmd); + +} + + +void +check_access( + char * filename, + int mode) +{ + char *noun, *adjective; + char *quoted = quote_string(filename); + + if(mode == F_OK) + noun = "find", adjective = "exists"; + else if((mode & X_OK) == X_OK) + noun = "execute", adjective = "executable"; + else if((mode & (W_OK|R_OK)) == (W_OK|R_OK)) + noun = "read/write", adjective = "read/writable"; + else + noun = "access", adjective = "accessible"; + + if(access(filename, mode) == -1) + g_printf(_("ERROR [can not %s %s: %s]\n"), noun, quoted, strerror(errno)); + else + g_printf(_("OK %s %s\n"), quoted, adjective); + amfree(quoted); +} + +void +check_file( + char * filename, + int mode) +{ + struct stat stat_buf; + char *quoted; + + if(!stat(filename, &stat_buf)) { + if(!S_ISREG(stat_buf.st_mode)) { + quoted = quote_string(filename); + g_printf(_("ERROR [%s is not a file]\n"), quoted); + amfree(quoted); + } + } + if (getuid() == geteuid()) { + check_access(filename, mode); + } +} + +void +check_dir( + char * dirname, + int mode) +{ + struct stat stat_buf; + char *quoted; + char *dir; + + if(!stat(dirname, &stat_buf)) { + if(!S_ISDIR(stat_buf.st_mode)) { + quoted = quote_string(dirname); + g_printf(_("ERROR [%s is not a directory]\n"), quoted); + amfree(quoted); + } + } else { + quoted = quote_string(dirname); + g_printf(_("ERROR [%s: %s]\n"), quoted, strerror(errno)); + amfree(quoted); + } + if (getuid() == geteuid()) { + dir = stralloc2(dirname, "/."); + check_access(dir, mode); + amfree(dir); + } +} + +void +check_suid( + char * filename) +{ +#ifndef SINGLE_USERID + struct stat stat_buf; + char *quoted = quote_string(filename); + + if(!stat(filename, &stat_buf)) { + if(stat_buf.st_uid != 0 ) { + g_printf(_("ERROR [%s is not owned by root]\n"), quoted); + } + if((stat_buf.st_mode & S_ISUID) != S_ISUID) { + g_printf(_("ERROR [%s is not SUID root]\n"), quoted); + } + } + else { + g_printf(_("ERROR [can not stat %s]\n"), quoted); + } + amfree(quoted); +#else + (void)filename; /* Quiet unused parameter warning */ +#endif +} + +/* + * Returns the value of the first integer in a string. + */ + +double +the_num( + char * str, + int pos) +{ + char *num; + int ch; + double d; + + do { + ch = *str++; + while(ch && !isdigit(ch)) ch = *str++; + if (pos == 1) break; + pos--; + while(ch && (isdigit(ch) || ch == '.')) ch = *str++; + } while (ch); + num = str - 1; + while(isdigit(ch) || ch == '.') ch = *str++; + str[-1] = '\0'; + d = atof(num); + str[-1] = (char)ch; + return d; +} + + +char * +config_errors_to_error_string( + GSList *errlist) +{ + char *errmsg; + gboolean multiple_errors = FALSE; + + if (errlist) { + errmsg = (char *)errlist->data; + if (errlist->next) + multiple_errors = TRUE; + } else { + errmsg = _("(no error message)"); + } + + return vstrallocf("ERROR %s%s", errmsg, + multiple_errors? _(" (additional errors not displayed)"):""); +} diff --git a/client-src/client_util.h b/client-src/client_util.h index b5ed362..ed686c6 100644 --- a/client-src/client_util.h +++ b/client-src/client_util.h @@ -37,28 +37,7 @@ #include "sl.h" #include "util.h" /* for bstrncmp() */ #include "amandad.h" /* for g_option_t */ - -typedef struct option_s { - char *str; - int compress; - int encrypt; - char *srvcompprog; - char *clntcompprog; - char *srv_encrypt; - char *clnt_encrypt; - char *srv_decrypt_opt; - char *clnt_decrypt_opt; - int no_record; - int createindex; - char *auth; - sl_t *exclude_file; - sl_t *exclude_list; - sl_t *include_file; - sl_t *include_list; - int exclude_optional; - int include_optional; - int kencrypt; -} option_t; +#include "amxml.h" /* for dle_t */ typedef struct backup_support_option_s { int config; @@ -77,21 +56,79 @@ typedef struct backup_support_option_s { int exclude_list; int exclude_optional; int collection; + int calcsize; + int multi_estimate; + int smb_recover_mode; } backup_support_option_t; -char *build_exclude(char *disk, char *device, option_t *options, int verbose); -char *build_include(char *disk, char *device, option_t *options, int verbose); -void init_options(option_t *options); -option_t *parse_options(char *str, - char *disk, - char *device, - am_feature_t *features, - int verbose); -void output_tool_property(FILE *tool, option_t *options); +typedef struct client_script_result_s { + int exit_code; + proplist_t proplist; + GPtrArray *output; + GPtrArray *err; +} client_script_result_t; + +char *build_exclude(dle_t *dle, int verbose); +char *build_include(dle_t *dle, int verbose); +void parse_options(char *str, + dle_t *dle, + am_feature_t *features, + int verbose); + +/* Count the size of an ARGV to store all properties of an application for + * a dle. include/exclude options are converted to properties. + * + * @param dle: the dle + * @returns: size of an ARGV needed. + */ +int application_property_argv_size(dle_t *dle); + +/* Add all properties of an application for a dle to an ARGV. + * include/exclude options are converted to properties. + * + * @param argvchild: the ARGV where to store properties. + * @param dle: the dle. + * @returns: Number of argument added to ARGV. + */ +int application_property_add_to_argv(char **argvchild, + dle_t *dle, + backup_support_option_t *bsu); + char *fixup_relative(char *name, char *device); backup_support_option_t *backup_support_option(char *program, g_option_t *g_options, char *disk, - char *amdevice); + char *amdevice, + GPtrArray **errarray); + +void run_client_script(script_t *script, + execute_on_t execute_on, + g_option_t *g_options, + dle_t *dle); + +void run_client_scripts(execute_on_t execute_on, + g_option_t *g_options, + dle_t *dle, + FILE *streamout); + +void run_calcsize(char *config, char *program, char *disk, + char *dirname, GSList *levels, + char *file_exclude, char *file_include); + +void check_access(char *filename, int mode); +void check_file(char *filename, int mode); +void check_dir(char *dirname, int mode); +void check_suid(char *filename); +double the_num(char * str, int pos); + +/* Convert a GSList returned from config_errors into an "ERROR " + * line suitable for inclusion in a NAK or REP packet. Because we only + * get one ERROR line per packet, this includes only the first + * error, with an indication that there are more to follow. + * + * @param errlist: the list of errors from config_errors + * @returns: newly allocated string containing the error messages + */ +char *config_errors_to_error_string(GSList *errlist); #endif diff --git a/client-src/noop.c b/client-src/noop.c index fb3acbd..1edf46f 100644 --- a/client-src/noop.c +++ b/client-src/noop.c @@ -81,7 +81,7 @@ main( amfree(our_feature_string); am_release_feature_set(our_features); our_features = NULL; - if (fullwrite(1, options, strlen(options)) < 0) { + if (full_write(1, options, strlen(options)) < strlen(options)) { error(_("error sending noop response: %s"), strerror(errno)); /*NOTREACHED*/ } diff --git a/client-src/runtar.c b/client-src/runtar.c index 144d6bf..cc4705f 100644 --- a/client-src/runtar.c +++ b/client-src/runtar.c @@ -112,11 +112,6 @@ main( } } while(0); - if(get_client_uid() == (uid_t) -1) { - error(_("error [cannot find user %s in passwd file]\n"), CLIENT_LOGIN); - /*NOTREACHED*/ - } - #ifdef WANT_SETUID_CLIENT check_running_as(RUNNING_AS_CLIENT_LOGIN | RUNNING_AS_UID_ONLY); if (!become_root()) { diff --git a/client-src/selfcheck.c b/client-src/selfcheck.c index 8787a82..416daf2 100644 --- a/client-src/selfcheck.c +++ b/client-src/selfcheck.c @@ -25,7 +25,7 @@ * University of Maryland at College Park */ /* - * $Id: selfcheck.c,v 1.95 2006/08/29 11:21:00 martinea Exp $ + * $Id: selfcheck.c 10421 2008-03-06 18:48:30Z martineau $ * * do self-check and send back any error messages */ @@ -42,6 +42,8 @@ #include "client_util.h" #include "conffile.h" #include "amandad.h" +#include "amxml.h" +#include "base64.h" #ifdef SAMBA_CLIENT #include "findpass.h" @@ -61,7 +63,7 @@ int need_runtar=0; int need_gnutar=0; int need_compress_path=0; int need_calcsize=0; -int program_is_backup_api=0; +int program_is_application_api=0; static char *amandad_auth = NULL; static am_feature_t *our_features = NULL; @@ -71,14 +73,10 @@ static g_option_t *g_options = NULL; /* local functions */ int main(int argc, char **argv); -static void check_options(char *program, char *calcprog, char *disk, char *amdevice, option_t *options); -static void check_disk(char *program, char *calcprog, char *disk, char *amdevice, int level, option_t *options); +static void check_options(dle_t *dle); +static void check_disk(dle_t *dle); static void check_overall(void); -static void check_access(char *filename, int mode); static int check_file_exist(char *filename); -static void check_file(char *filename, int mode); -static void check_dir(char *dirname, int mode); -static void check_suid(char *filename); static void check_space(char *dir, off_t kbytes); int @@ -86,19 +84,16 @@ main( int argc, char ** argv) { - int level; char *line = NULL; - char *program = NULL; - char *calcprog = NULL; - char *disk = NULL; char *qdisk = NULL; - char *amdevice = NULL; char *qamdevice = NULL; char *optstr = NULL; char *err_extra = NULL; char *s, *fp; - option_t *options; int ch; + dle_t *dle; + int level; + GSList *errlist; /* initialize */ @@ -129,6 +124,7 @@ main( } config_init(CONFIG_INIT_CLIENT, NULL); + /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); @@ -166,12 +162,24 @@ main( config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); - dbrename(config_name, DBG_SUBDIR_CLIENT); + dbrename(get_config_name(), DBG_SUBDIR_CLIENT); + } + + /* check for any config errors now */ + if (config_errors(&errlist) >= CFGERR_ERRORS) { + char *errstr = config_errors_to_error_string(errlist); + g_printf("%s\n", errstr); + dbclose(); + return 1; } + if (am_has_feature(g_options->features, fe_req_xml)) { + break; + } continue; } + dle = alloc_dle(); s = line; ch = *s++; @@ -179,33 +187,34 @@ main( if (ch == '\0') { goto err; /* no program */ } - program = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the program name */ - program_is_backup_api = 0; - if(strcmp(program,"BACKUP")==0) { - program_is_backup_api = 1; + dle->program_is_application_api = 0; + if(strcmp(dle->program,"APPLICATION")==0) { + dle->program_is_application_api = 1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } - program = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; /* terminate the program name */ } - if(strncmp_const(program, "CALCSIZE") == 0) { + if(strncmp_const(dle->program, "CALCSIZE") == 0) { skip_whitespace(s, ch); /* find program name */ if (ch == '\0') { goto err; /* no program */ } - calcprog = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; + dle->calcsize = 1; } else { - calcprog = NULL; + dle->calcsize = 0; } skip_whitespace(s, ch); /* find disk name */ @@ -215,7 +224,7 @@ main( qdisk = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the disk name */ - disk = unquote_string(qdisk); + dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { @@ -226,17 +235,19 @@ main( skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the device */ qamdevice = stralloc(fp); - amdevice = unquote_string(qamdevice); + dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { - amdevice = stralloc(disk); + dle->device = stralloc(dle->disk); + qamdevice = stralloc(qdisk); } /* find level number */ if (ch == '\0' || sscanf(s - 1, "%d", &level) != 1) { goto err; /* bad level */ } + dle->level = g_slist_append(dle->level, GINT_TO_POINTER(level)); skip_integer(s, ch); skip_whitespace(s, ch); @@ -248,18 +259,13 @@ main( optstr = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the options */ - options = parse_options(optstr, disk, amdevice, g_options->features, 1); + parse_options(optstr, dle, g_options->features, 1); /*@ignore@*/ - check_options(program, calcprog, disk, amdevice, options); - check_disk(program, calcprog, disk, amdevice, level, options); + + check_options(dle); + check_disk(dle); + /*@end@*/ - free_sl(options->exclude_file); - free_sl(options->exclude_list); - free_sl(options->include_file); - free_sl(options->include_list); - amfree(options->auth); - amfree(options->str); - amfree(options); } else if (ch == '\0') { /* check all since no option */ need_samba=1; @@ -277,21 +283,46 @@ main( need_compress_path=1; need_calcsize=1; /*@ignore@*/ - check_disk(program, calcprog, disk, amdevice, level, NULL); + check_disk(dle); /*@end@*/ } else { goto err; /* bad syntax */ } - amfree(disk); amfree(qamdevice); - amfree(amdevice); } if (g_options == NULL) { - printf(_("ERROR [Missing OPTIONS line in selfcheck input]\n")); + g_printf(_("ERROR [Missing OPTIONS line in selfcheck input]\n")); error(_("Missing OPTIONS line in selfcheck input\n")); /*NOTREACHED*/ } + if (am_has_feature(g_options->features, fe_req_xml)) { + char *errmsg = NULL; + dle_t *dles, *dle; + + dles = amxml_parse_node_FILE(stdin, &errmsg); + if (errmsg) { + err_extra = errmsg; + goto err; + } + for (dle = dles; dle != NULL; dle = dle->next) { + run_client_scripts(EXECUTE_ON_PRE_HOST_AMCHECK, g_options, dle, + stdout); + } + for (dle = dles; dle != NULL; dle = dle->next) { + check_options(dle); + run_client_scripts(EXECUTE_ON_PRE_DLE_AMCHECK, g_options, dle, + stdout); + check_disk(dle); + run_client_scripts(EXECUTE_ON_POST_DLE_AMCHECK, g_options, dle, + stdout); + } + for (dle = dles; dle != NULL; dle = dle->next) { + run_client_scripts(EXECUTE_ON_POST_HOST_AMCHECK, g_options, dle, + stdout); + } + } + check_overall(); amfree(line); @@ -304,10 +335,13 @@ main( return 0; err: - g_printf(_("ERROR [BOGUS REQUEST PACKET]\n")); - dbprintf(_("REQ packet is bogus%s%s\n"), - err_extra ? ": " : "", - err_extra ? err_extra : ""); + if (err_extra) { + g_printf(_("ERROR [FORMAT ERROR IN REQUEST PACKET %s]\n"), err_extra); + dbprintf(_("REQ packet is bogus: %s\n"), err_extra); + } else { + g_printf(_("ERROR [FORMAT ERROR IN REQUEST PACKET]\n")); + dbprintf(_("REQ packet is bogus\n")); + } dbclose(); return 1; } @@ -315,71 +349,43 @@ main( static void check_options( - char * program, - char * calcprog, - char * disk, - char * amdevice, - option_t * options) + dle_t *dle) { - char *myprogram = program; - - if(strcmp(myprogram,"CALCSIZE") == 0) { - int nb_exclude = 0; - int nb_include = 0; - char *file_exclude = NULL; - char *file_include = NULL; - - if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; - if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; - if(options->include_file) nb_include += options->include_file->nb_element; - if(options->include_list) nb_include += options->include_list->nb_element; - - if(nb_exclude > 0) file_exclude = build_exclude(disk, amdevice, options, 1); - if(nb_include > 0) file_include = build_include(disk, amdevice, options, 1); - - amfree(file_exclude); - amfree(file_include); - + if (dle->calcsize == 1) { need_calcsize=1; - if (calcprog == NULL) { - g_printf(_("ERROR [no program name for calcsize]\n")); - } else { - myprogram = calcprog; - } } - if(strcmp(myprogram,"GNUTAR") == 0) { + if (strcmp(dle->program,"GNUTAR") == 0) { need_gnutar=1; - if(amdevice[0] == '/' && amdevice[1] == '/') { - if(options->exclude_file && options->exclude_file->nb_element > 1) { + if(dle->device[0] == '/' && dle->device[1] == '/') { + if(dle->exclude_file && dle->exclude_file->nb_element > 1) { g_printf(_("ERROR [samba support only one exclude file]\n")); } - if(options->exclude_list && options->exclude_list->nb_element > 0 && - options->exclude_optional==0) { + if (dle->exclude_list && dle->exclude_list->nb_element > 0 && + dle->exclude_optional==0) { g_printf(_("ERROR [samba does not support exclude list]\n")); } - if(options->include_file && options->include_file->nb_element > 0) { + if (dle->include_file && dle->include_file->nb_element > 0) { g_printf(_("ERROR [samba does not support include file]\n")); } - if(options->include_list && options->include_list->nb_element > 0 && - options->include_optional==0) { + if (dle->include_list && dle->include_list->nb_element > 0 && + dle->include_optional==0) { g_printf(_("ERROR [samba does not support include list]\n")); } need_samba=1; - } - else { + } else { int nb_exclude = 0; int nb_include = 0; char *file_exclude = NULL; char *file_include = NULL; - if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; - if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; - if(options->include_file) nb_include += options->include_file->nb_element; - if(options->include_list) nb_include += options->include_list->nb_element; + if (dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; + if (dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; + if (dle->include_file) nb_include += dle->include_file->nb_element; + if (dle->include_list) nb_include += dle->include_list->nb_element; - if(nb_exclude > 0) file_exclude = build_exclude(disk, amdevice, options, 1); - if(nb_include > 0) file_include = build_include(disk, amdevice, options, 1); + if (nb_exclude > 0) file_exclude = build_exclude(dle, 1); + if (nb_include > 0) file_include = build_include(dle, 1); amfree(file_exclude); amfree(file_include); @@ -388,17 +394,17 @@ check_options( } } - if(strcmp(myprogram,"DUMP") == 0) { - if(options->exclude_file && options->exclude_file->nb_element > 0) { + if (strcmp(dle->program,"DUMP") == 0) { + if (dle->exclude_file && dle->exclude_file->nb_element > 0) { g_printf(_("ERROR [DUMP does not support exclude file]\n")); } - if(options->exclude_list && options->exclude_list->nb_element > 0) { + if (dle->exclude_list && dle->exclude_list->nb_element > 0) { g_printf(_("ERROR [DUMP does not support exclude list]\n")); } - if(options->include_file && options->include_file->nb_element > 0) { + if (dle->include_file && dle->include_file->nb_element > 0) { g_printf(_("ERROR [DUMP does not support include file]\n")); } - if(options->include_list && options->include_list->nb_element > 0) { + if (dle->include_list && dle->include_list->nb_element > 0) { g_printf(_("ERROR [DUMP does not support include list]\n")); } #ifdef USE_RUNDUMP @@ -407,66 +413,66 @@ check_options( #ifndef AIX_BACKUP #ifdef VDUMP #ifdef DUMP - if (strcmp(amname_to_fstype(amdevice), "advfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else if (1) #endif { need_vdump=1; need_rundump=1; - if (options->createindex) + if (dle->create_index) need_vrestore=1; } else #endif /* VDUMP */ #ifdef XFSDUMP #ifdef DUMP - if (strcmp(amname_to_fstype(amdevice), "xfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "xfs") == 0) #else if (1) #endif { need_xfsdump=1; need_rundump=1; - if (options->createindex) + if (dle->create_index) need_xfsrestore=1; } else #endif /* XFSDUMP */ #ifdef VXDUMP #ifdef DUMP - if (strcmp(amname_to_fstype(amdevice), "vxfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "vxfs") == 0) #else if (1) #endif { need_vxdump=1; - if (options->createindex) + if (dle->create-index) need_vxrestore=1; } else #endif /* VXDUMP */ { need_dump=1; - if (options->createindex) + if (dle->create_index) need_restore=1; } #else /* AIX backup program */ need_dump=1; - if (options->createindex) + if (dle->create_index) need_restore=1; #endif } - if ((options->compress == COMP_BEST) || (options->compress == COMP_FAST) - || (options->compress == COMP_CUST)) { + if ((dle->compress == COMP_BEST) || (dle->compress == COMP_FAST) + || (dle->compress == COMP_CUST)) { need_compress_path=1; } - if(options->auth && amandad_auth) { - if(strcasecmp(options->auth, amandad_auth) != 0) { + if (dle->auth && amandad_auth) { + if (strcasecmp(dle->auth, amandad_auth) != 0) { g_fprintf(stdout,_("ERROR [client configured for auth=%s while server requested '%s']\n"), - amandad_auth, options->auth); - if(strcmp(options->auth, "ssh") == 0) { + amandad_auth, dle->auth); + if (strcmp(dle->auth, "ssh") == 0) { g_fprintf(stderr, _("ERROR [The auth in ~/.ssh/authorized_keys " "should be \"--auth=ssh\", or use another auth " " for the DLE]\n")); @@ -481,12 +487,7 @@ check_options( static void check_disk( - char * program, - char * calcprog, - char * disk, - char * amdevice, - int level, - option_t *options) + dle_t *dle) { char *device = stralloc("nodevice"); char *err = NULL; @@ -498,31 +499,21 @@ check_disk( int access_result; char *access_type; char *extra_info = NULL; - char *myprogram = program; - char *qdisk = quote_string(disk); - char *qamdevice = quote_string(amdevice); + char *qdisk = quote_string(dle->disk); + char *qamdevice = quote_string(dle->device); char *qdevice = NULL; - FILE *toolin; - - (void)level; /* Quiet unused parameter warning */ dbprintf(_("checking disk %s\n"), qdisk); - - if(strcmp(myprogram,"CALCSIZE") == 0) { - if(amdevice[0] == '/' && amdevice[1] == '/') { + if (dle->calcsize == 1) { + if (dle->device[0] == '/' && dle->device[1] == '/') { err = vstrallocf(_("Can't use CALCSIZE for samba estimate, use CLIENT: %s"), - amdevice); - goto common_exit; - } - if (calcprog == NULL) { - err = _("no program for calcsize"); + dle->device); goto common_exit; } - myprogram = calcprog; } - if (strcmp(myprogram, "GNUTAR")==0) { - if(amdevice[0] == '/' && amdevice[1] == '/') { + if (strcmp(dle->program, "GNUTAR")==0) { + if(dle->device[0] == '/' && dle->device[1] == '/') { #ifdef SAMBA_CLIENT int nullfd, checkerr; int passwdfd; @@ -538,23 +529,23 @@ check_disk( char *pw_fd_env; int errdos; - parsesharename(amdevice, &share, &subdir); + parsesharename(dle->device, &share, &subdir); if (!share) { - err = vstrallocf(_("cannot parse for share/subdir disk entry %s"), amdevice); + err = vstrallocf(_("cannot parse for share/subdir disk entry %s"), dle->device); goto common_exit; } if ((subdir) && (SAMBA_VERSION < 2)) { err = vstrallocf(_("subdirectory specified for share '%s' but, samba is not v2 or better"), - amdevice); + dle->device); goto common_exit; } if ((user_and_password = findpass(share, &domain)) == NULL) { - err = vstrallocf(_("cannot find password for %s"), amdevice); + err = vstrallocf(_("cannot find password for %s"), dle->device); goto common_exit; } lpass = strlen(user_and_password); if ((pwtext = strchr(user_and_password, '%')) == NULL) { - err = vstrallocf(_("password field not \'user%%pass\' for %s"), amdevice); + err = vstrallocf(_("password field not \'user%%pass\' for %s"), dle->device); goto common_exit; } *pwtext++ = '\0'; @@ -575,7 +566,7 @@ check_disk( } else { pw_fd_env = "dummy_PASSWD_FD"; } - checkpid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, + checkpid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, 0, &nullfd, &nullfd, &checkerr, pw_fd_env, &passwdfd, "smbclient", @@ -595,9 +586,9 @@ check_disk( aclose(nullfd); /*@ignore@*/ if ((pwtext_len > 0) - && fullwrite(passwdfd, pwtext, (size_t)pwtext_len) < 0) { + && full_write(passwdfd, pwtext, pwtext_len) < pwtext_len) { err = vstrallocf(_("password write failed: %s: %s"), - amdevice, strerror(errno)); + dle->device, strerror(errno)); aclose(passwdfd); goto common_exit; } @@ -630,7 +621,8 @@ check_disk( while ((wpid = wait(&retstat)) != -1) { if (!WIFEXITED(retstat) || WEXITSTATUS(retstat) != 0) { char *exitstr = str_exit_status("smbclient", retstat); - err = newvstralloc(err, err, sep, exitstr); + strappend(err, sep); + strappend(err, exitstr); sep = "\n"; amfree(exitstr); @@ -641,11 +633,11 @@ check_disk( if (extra_info) { err = newvstrallocf(err, _("samba access error: %s: %s %s"), - amdevice, extra_info, err); + dle->device, extra_info, err); amfree(extra_info); } else { err = newvstrallocf(err, _("samba access error: %s: %s"), - amdevice, err); + dle->device, err); } } #else @@ -656,9 +648,9 @@ check_disk( } amode = F_OK; amfree(device); - device = amname_to_dirname(amdevice); - } else if (strcmp(myprogram, "DUMP") == 0) { - if(amdevice[0] == '/' && amdevice[1] == '/') { + device = amname_to_dirname(dle->device); + } else if (strcmp(dle->program, "DUMP") == 0) { + if(dle->device[0] == '/' && dle->device[1] == '/') { err = vstrallocf( _("The DUMP program cannot handle samba shares, use GNUTAR: %s"), qdisk); @@ -666,19 +658,19 @@ check_disk( } #ifdef VDUMP /* { */ #ifdef DUMP /* { */ - if (strcmp(amname_to_fstype(amdevice), "advfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else /* }{ */ if (1) #endif /* } */ { amfree(device); - device = amname_to_dirname(amdevice); + device = amname_to_dirname(dle->device); amode = F_OK; } else #endif /* } */ { amfree(device); - device = amname_to_devname(amdevice); + device = amname_to_devname(dle->device); #ifdef USE_RUNDUMP amode = F_OK; #else @@ -686,30 +678,97 @@ check_disk( #endif } } - else { /* program_is_backup_api==1 */ - pid_t backup_api_pid; - int property_pipe[2]; + else { /* program_is_application_api==1 */ + pid_t application_api_pid; backup_support_option_t *bsu; + int app_err[2]; + GPtrArray *errarray; + + bsu = backup_support_option(dle->program, g_options, dle->disk, + dle->device, &errarray); + + if (!bsu) { + char *line; + guint i; + for (i=0; i < errarray->len; i++) { + line = g_ptr_array_index(errarray, i); + fprintf(stdout, _("ERROR Application '%s': %s\n"), + dle->program, line); + amfree(line); + } + err = vstrallocf(_("Application '%s': can't run support command"), + dle->program); + goto common_exit; + } - bsu = backup_support_option(program, g_options, disk, amdevice); + if (dle->calcsize && !bsu->calcsize) { + g_printf("ERROR application %s doesn't support calcsize estimate\n", + dle->program); + } + if (dle->include_file && dle->include_file->nb_element > 0 && + !bsu->include_file) { + g_printf("ERROR application %s doesn't support include-file\n", + dle->program); + } + if (dle->include_list && dle->include_list->nb_element > 0 && + !bsu->include_list) { + g_printf("ERROR application %s doesn't support include-list\n", + dle->program); + } + if (dle->include_optional && !bsu->include_optional) { + g_printf("ERROR application %s doesn't support optional include\n", + dle->program); + } + if (dle->exclude_file && dle->exclude_file->nb_element > 0 && + !bsu->exclude_file) { + g_printf("ERROR application %s doesn't support exclude-file\n", + dle->program); + } + if (dle->exclude_list && dle->exclude_list->nb_element > 0 && + !bsu->exclude_list) { + g_printf("ERROR application %s doesn't support exclude-list\n", + dle->program); + } + if (dle->exclude_optional && !bsu->exclude_optional) { + g_printf("ERROR application %s doesn't support optional exclude\n", + dle->program); + } + fflush(stdout);fflush(stderr); - if (pipe(property_pipe) < 0) { - err = vstrallocf(_("pipe failed: %s"), strerror(errno)); + if (pipe(app_err) < 0) { + err = vstrallocf(_("Application '%s': can't create pipe"), + dle->program); goto common_exit; } - fflush(stdout);fflush(stderr); - - switch (backup_api_pid = fork()) { + + switch (application_api_pid = fork()) { case -1: err = vstrallocf(_("fork failed: %s"), strerror(errno)); goto common_exit; case 0: /* child */ { - char *argvchild[14]; - char *cmd = vstralloc(DUMPER_DIR, "/", program, NULL); + char **argvchild, **arg; + char *cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); + GSList *scriptlist; + script_t *script; + char *cmdline; int j=0; - argvchild[j++] = program; + int k; + + aclose(app_err[0]); + dup2(app_err[1], 2); + + k = application_property_argv_size(dle); + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + k += property_argv_size(script->result->proplist); + } + } + argvchild = g_new0(char *, 18 + k); + argvchild[j++] = dle->program; argvchild[j++] = "selfcheck"; if (bsu->message_line == 1) { argvchild[j++] = "--message"; @@ -723,49 +782,76 @@ check_disk( argvchild[j++] = "--host"; argvchild[j++] = g_options->hostname; } - if (disk != NULL && bsu->disk == 1) { + if (dle->disk != NULL && bsu->disk == 1) { argvchild[j++] = "--disk"; - argvchild[j++] = disk; + argvchild[j++] = dle->disk; } argvchild[j++] = "--device"; - argvchild[j++] = amdevice; - if(options && options->createindex && bsu->index_line == 1) { + argvchild[j++] = dle->device; + if (dle->create_index && bsu->index_line == 1) { argvchild[j++] = "--index"; argvchild[j++] = "line"; } - if (!options->no_record && bsu->record == 1) { + if (dle->record && bsu->record == 1) { argvchild[j++] = "--record"; } + if (dle->calcsize && bsu->calcsize == 1) { + argvchild[j++] = "--calcsize"; + } + j += application_property_add_to_argv(&argvchild[j], dle, bsu); + + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + j += property_add_to_argv(&argvchild[j], + script->result->proplist); + } + } + argvchild[j++] = NULL; - dup2(property_pipe[0], 0); - aclose(property_pipe[1]); + + cmdline = stralloc(cmd); + for(arg = argvchild; *arg != NULL; arg++) { + char *quoted = quote_string(*arg); + cmdline = vstrextend(&cmdline, " ", quoted, NULL); + amfree(quoted); + } + dbprintf(_("Spawning \"%s\" in pipeline\n"), cmdline); + amfree(cmdline); + safe_fd(-1, 0); - execve(cmd,argvchild,safe_env()); + execve(cmd, argvchild, safe_env()); g_printf(_("ERROR [Can't execute %s: %s]\n"), cmd, strerror(errno)); exit(127); } default: /* parent */ { - int status; - aclose(property_pipe[0]); - toolin = fdopen(property_pipe[1],"w"); - if (!toolin) { - err = vstrallocf(_("Can't fdopen: %s"), strerror(errno)); - goto common_exit; - } - output_tool_property(toolin, options); - fflush(toolin); - fclose(toolin); - if (waitpid(backup_api_pid, &status, 0) < 0) { - if (!WIFEXITED(status)) { - err = vstrallocf(_("Tool exited with signal %d"), - WTERMSIG(status)); - } else if (WEXITSTATUS(status) != 0) { - err = vstrallocf(_("Tool exited with status %d"), - WEXITSTATUS(status)); - } else { - err = vstrallocf(_("waitpid returned negative value")); + int status; + FILE *app_stderr; + char *line; + + aclose(app_err[1]); + app_stderr = fdopen(app_err[0], "r"); + while((line = agets(app_stderr)) != NULL) { + if (strlen(line) > 0) { + fprintf(stdout, "ERROR Application '%s': %s\n", + dle->program, line); + dbprintf("ERROR %s\n", line); } + amfree(line); + } + if (waitpid(application_api_pid, &status, 0) < 0) { + err = vstrallocf(_("waitpid failed: %s"), + strerror(errno)); + goto common_exit; + } else if (!WIFEXITED(status)) { + err = vstrallocf(_("Application '%s': exited with signal %d"), + dle->program, WTERMSIG(status)); + goto common_exit; + } else if (WEXITSTATUS(status) != 0) { + err = vstrallocf(_("Application '%s': exited with status %d"), + dle->program, WEXITSTATUS(status)); goto common_exit; } } @@ -801,6 +887,9 @@ check_disk( common_exit: + if (!qdevice) + qdevice = quote_string(device); + amfree(share); amfree(subdir); if(user_and_password) { @@ -810,7 +899,7 @@ common_exit: amfree(domain); if(err) { - g_printf(_("ERROR [%s]\n"), err); + g_printf(_("ERROR %s\n"), err); dbprintf(_("%s\n"), err); amfree(err); } else { @@ -928,19 +1017,18 @@ check_overall(void) #else g_printf(_("ERROR [GNUTAR program not available]\n")); #endif - need_amandates = 1; gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); if (strlen(gnutar_list_dir) == 0) gnutar_list_dir = NULL; - if (gnutar_list_dir) + if (gnutar_list_dir) { + /* make sure our listed-incremental dir is ready */ check_dir(gnutar_list_dir, R_OK|W_OK); + } else { + /* no listed-incremental dir, so check that amandates is ready */ + need_amandates = 1; + } } - if (need_amandates) { - char *amandates_file; - amandates_file = getconf_str(CNF_AMANDATES); - check_file(amandates_file, R_OK|W_OK); - } if( need_calcsize ) { char *cmd; @@ -949,6 +1037,15 @@ check_overall(void) check_file(cmd, X_OK); amfree(cmd); + + /* calcsize uses amandates */ + need_amandates = 1; + } + + if (need_amandates) { + char *amandates_file; + amandates_file = getconf_str(CNF_AMANDATES); + check_file(amandates_file, R_OK|W_OK); } if( need_samba ) { @@ -1045,30 +1142,6 @@ check_space( amfree(quoted); } -static void -check_access( - char * filename, - int mode) -{ - char *noun, *adjective; - char *quoted = quote_string(filename); - - if(mode == F_OK) - noun = "find", adjective = "exists"; - else if((mode & X_OK) == X_OK) - noun = "execute", adjective = "executable"; - else if((mode & (W_OK|R_OK)) == (W_OK|R_OK)) - noun = "read/write", adjective = "read/writable"; - else - noun = "access", adjective = "accessible"; - - if(access(filename, mode) == -1) - g_printf(_("ERROR [can not %s %s: %s]\n"), noun, quoted, strerror(errno)); - else - g_printf(_("OK %s %s\n"), quoted, adjective); - amfree(quoted); -} - static int check_file_exist( char *filename) @@ -1083,66 +1156,3 @@ check_file_exist( return 1; } -static void -check_file( - char * filename, - int mode) -{ - struct stat stat_buf; - char *quoted; - - if(!stat(filename, &stat_buf)) { - if(!S_ISREG(stat_buf.st_mode)) { - quoted = quote_string(filename); - g_printf(_("ERROR [%s is not a file]\n"), quoted); - amfree(quoted); - } - } - check_access(filename, mode); -} - -static void -check_dir( - char * dirname, - int mode) -{ - struct stat stat_buf; - char *quoted; - char *dir; - - if(!stat(dirname, &stat_buf)) { - if(!S_ISDIR(stat_buf.st_mode)) { - quoted = quote_string(dirname); - g_printf(_("ERROR [%s is not a directory]\n"), quoted); - amfree(quoted); - } - } - dir = stralloc2(dirname, "/."); - check_access(dir, mode); - amfree(dir); -} - -static void -check_suid( - char * filename) -{ -#ifndef SINGLE_USERID - struct stat stat_buf; - char *quoted = quote_string(filename); - - if(!stat(filename, &stat_buf)) { - if(stat_buf.st_uid != 0 ) { - g_printf(_("ERROR [%s is not owned by root]\n"), quoted); - } - if((stat_buf.st_mode & S_ISUID) != S_ISUID) { - g_printf(_("ERROR [%s is not SUID root]\n"), quoted); - } - } - else { - g_printf(_("ERROR [can not stat %s]\n"), quoted); - } - amfree(quoted); -#else - (void)filename; /* Quiet unused parameter warning */ -#endif -} diff --git a/client-src/sendbackup-dump.c b/client-src/sendbackup-dump.c index 1ec5a7f..b0a8ec7 100644 --- a/client-src/sendbackup-dump.c +++ b/client-src/sendbackup-dump.c @@ -116,9 +116,9 @@ static amregex_t re_table[] = { AM_STRANGE_RE(NULL) }; -static void start_backup(char *host, char *disk, char *amdevice, int level, - char *dumpdate, int dataf, int mesgf, int indexf); -static void end_backup(int status); +static void start_backup(dle_t *dle, char *host, + int dataf, int mesgf, int indexf); +static void end_backup(dle_t *dle, int status); /* * doing similar to $ dump | compression | encryption @@ -126,11 +126,8 @@ static void end_backup(int status); static void start_backup( - char * host, - char * disk, - char * amdevice, - int level, - char * dumpdate, + dle_t *dle, + char *host, int dataf, int mesgf, int indexf) @@ -148,23 +145,21 @@ start_backup( char *qdisk; char *config; - (void)dumpdate; /* Quiet unused parameter warning */ + g_snprintf(level_str, SIZEOF(level_str), "%d", GPOINTER_TO_INT(dle->level->data)); - g_snprintf(level_str, SIZEOF(level_str), "%d", level); - - qdisk = quote_string(disk); - dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); + qdisk = quote_string(dle->disk); + dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, GPOINTER_TO_INT(dle->level->data)); g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), - get_pname(), host, qdisk, level); + get_pname(), host, qdisk, GPOINTER_TO_INT(dle->level->data)); amfree(qdisk); /* apply client-side encryption here */ - if ( options->encrypt == ENCRYPT_CUST ) { - encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE, - &compout, &dataf, &mesgf, - options->clnt_encrypt, encryptopt, NULL); - dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt); + if (dle->encrypt == ENCRYPT_CUST ) { + encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, + &compout, &dataf, &mesgf, + dle->clnt_encrypt, encryptopt, NULL); + dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); } else { compout = dataf; encpid = -1; @@ -172,17 +167,17 @@ start_backup( /* now do the client-side compression */ - if(options->compress == COMP_FAST || options->compress == COMP_BEST) { + if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { compopt = skip_argument; #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) - if(options->compress == COMP_BEST) { + if(dle->compress == COMP_BEST) { compopt = COMPRESS_BEST_OPT; } else { compopt = COMPRESS_FAST_OPT; } #endif - comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, + comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); dbprintf(_("dump: pid %ld: %s"), (long)comppid, COMPRESS_PATH); @@ -190,13 +185,13 @@ start_backup( dbprintf(" %s", compopt); } dbprintf("\n"); - } else if (options->compress == COMP_CUST) { + } else if (dle->compress == COMP_CUST) { compopt = skip_argument; - comppid = pipespawn(options->clntcompprog, STDIN_PIPE, + comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, - options->clntcompprog, compopt, NULL); + dle->compprog, compopt, NULL); dbprintf(_("gnutar-cust: pid %ld: %s"), - (long)comppid, options->clntcompprog); + (long)comppid, dle->compprog); if(compopt != skip_argument) { dbprintf(" %s", compopt); } @@ -207,8 +202,8 @@ start_backup( } /* invoke dump */ - device = amname_to_devname(amdevice); - fstype = amname_to_fstype(amdevice); + device = amname_to_devname(dle->device); + fstype = amname_to_fstype(dle->device); dbprintf(_("dumping device '%s' with '%s'\n"), device, fstype); @@ -229,7 +224,7 @@ start_backup( /* normal dump */ #ifdef XFSDUMP /* { */ #ifdef DUMP /* { */ - if (strcmp(amname_to_fstype(amdevice), "xfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "xfs") == 0) #else /* } { */ if (1) #endif /* } */ @@ -253,16 +248,16 @@ start_backup( " | sed", " -e", " \'s/^/\\//\'", NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); dumpkeys = stralloc(level_str); - dumppid = pipespawn(progname, STDIN_PIPE, + dumppid = pipespawn(progname, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "xfsdump", - options->no_record ? "-J" : skip_argument, + !dle->record ? "-J" : skip_argument, "-F", "-l", dumpkeys, "-", @@ -273,7 +268,7 @@ start_backup( #endif /* } */ #ifdef VXDUMP /* { */ #ifdef DUMP - if (strcmp(amname_to_fstype(amdevice), "vxfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "vxfs") == 0) #else if (1) #endif @@ -295,7 +290,7 @@ start_backup( program->restore_name = VXRESTORE; dumpkeys = vstralloc(level_str, - options->no_record ? "" : "u", + !dle->record ? "" : "u", "s", "f", NULL); @@ -306,11 +301,11 @@ start_backup( " | ", LEAF_AND_DIRS, NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); - dumppid = pipespawn(progname, STDIN_PIPE, + dumppid = pipespawn(progname, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "vxdump", @@ -325,7 +320,7 @@ start_backup( #ifdef VDUMP /* { */ #ifdef DUMP - if (strcmp(amname_to_fstype(amdevice), "advfs") == 0) + if (strcmp(amname_to_fstype(dle->device), "advfs") == 0) #else if (1) #endif @@ -337,12 +332,12 @@ start_backup( config = g_options->config; else config = "NOCONFIG"; - device = newstralloc(device, amname_to_dirname(amdevice)); + device = newstralloc(device, amname_to_dirname(dle->device)); program->backup_name = VDUMP; program->restore_name = VRESTORE; dumpkeys = vstralloc(level_str, - options->no_record ? "" : "u", + !dle->record ? "" : "u", "b", "f", NULL); @@ -353,11 +348,11 @@ start_backup( " | ", "sed -e \'\n/^\\./ {\ns/^\\.//\ns/, [0-9]*$//\ns/^\\.//\ns/ @-> .*$//\nt\n}\nd\n\'", NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create-index, dumpout, mesgf, indexf, indexcmd); - dumppid = pipespawn(cmd, STDIN_PIPE, + dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "vdump", @@ -380,8 +375,20 @@ start_backup( #else # define PARAM_HONOR_NODUMP "" #endif + +#ifdef __FreeBSD__ +# if defined(__FreeBSD_version) && (__FreeBSD_version >= 500043) +# define FREEBSD_EXTRA_KEYS "bL" +# else +# define FREEBSD_EXTRA_KEYS "b" +# endif +#else +# define FREEBSD_EXTRA_KEYS "" +#endif + dumpkeys = vstralloc(level_str, - options->no_record ? "" : "u", + !dle->record ? "" : "u", + FREEBSD_EXTRA_KEYS, "s", PARAM_HONOR_NODUMP, "f", @@ -394,15 +401,18 @@ start_backup( " | ", LEAF_AND_DIRS, NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); - dumppid = pipespawn(cmd, STDIN_PIPE, + dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "dump", dumpkeys, +#ifdef __FreeBSD__ + "64", +#endif "1048576", #ifdef HAVE_HONOR_NODUMP "0", @@ -415,7 +425,7 @@ start_backup( /* AIX backup program */ dumpkeys = vstralloc("-", level_str, - options->no_record ? "" : "u", + !dle->record ? "" : "u", "f", NULL); @@ -426,11 +436,11 @@ start_backup( " | ", LEAF_AND_DIRS, NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); - dumppid = pipespawn(cmd, STDIN_PIPE, + dumppid = pipespawn(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, cmdX, config, "backup", @@ -453,14 +463,16 @@ start_backup( aclose(compout); aclose(dataf); aclose(mesgf); - if (options->createindex) + if (dle->create_index) aclose(indexf); } static void end_backup( + dle_t *dle, int status) { + (void)dle; (void)status; /* Quiet unused parameter warning */ /* don't need to do anything for dump */ diff --git a/client-src/sendbackup-gnutar.c b/client-src/sendbackup-gnutar.c index c11b55c..4439f30 100644 --- a/client-src/sendbackup-gnutar.c +++ b/client-src/sendbackup-gnutar.c @@ -126,17 +126,13 @@ time_t cur_dumptime; static char *gnutar_list_dir = NULL; static char *incrname = NULL; -static char *amandates_file; /* * doing similar to $ gtar | compression | encryption */ static void start_backup( - char * host, - char * disk, - char * amdevice, - int level, - char * dumpdate, + dle_t *dle, + char *host, int dataf, int mesgf, int indexf) @@ -147,10 +143,10 @@ start_backup( char *indexcmd = NULL; char *dirname = NULL; int l; - char dumptimestr[80]; + char dumptimestr[80] = "UNUSED"; struct tm *gmtm; - amandates_t *amdates; - time_t prev_dumptime; + amandates_t *amdates = NULL; + time_t prev_dumptime = 0; char *error_pn = NULL; char *compopt = NULL; char *encryptopt = skip_argument; @@ -160,38 +156,37 @@ start_backup( int infd, outfd; ssize_t nb; char buf[32768]; - - (void)dumpdate; /* Quiet unused parameter warning */ + char *amandates_file = NULL; error_pn = stralloc2(get_pname(), "-smbclient"); - qdisk = quote_string(disk); - dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, level); + qdisk = quote_string(dle->disk); + dbprintf(_("start: %s:%s lev %d\n"), host, qdisk, GPOINTER_TO_INT(dle->level->data)); g_fprintf(stderr, _("%s: start [%s:%s level %d]\n"), - get_pname(), host, qdisk, level); + get_pname(), host, qdisk, GPOINTER_TO_INT(dle->level->data)); /* apply client-side encryption here */ - if ( options->encrypt == ENCRYPT_CUST ) { - encpid = pipespawn(options->clnt_encrypt, STDIN_PIPE, + if ( dle->encrypt == ENCRYPT_CUST ) { + encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, &compout, &dataf, &mesgf, - options->clnt_encrypt, encryptopt, NULL); - dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, options->clnt_encrypt); + dle->clnt_encrypt, encryptopt, NULL); + dbprintf(_("gnutar: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); } else { compout = dataf; encpid = -1; } /* now do the client-side compression */ - if(options->compress == COMP_FAST || options->compress == COMP_BEST) { + if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { compopt = skip_argument; #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) - if(options->compress == COMP_BEST) { + if(dle->compress == COMP_BEST) { compopt = COMPRESS_BEST_OPT; } else { compopt = COMPRESS_FAST_OPT; } #endif - comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, + comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, COMPRESS_PATH, compopt, NULL); dbprintf(_("gnutar: pid %ld: %s"), (long)comppid, COMPRESS_PATH); @@ -201,16 +196,16 @@ start_backup( } else { dbprintf(_("pid %ld: %s\n"), (long)comppid, COMPRESS_PATH); } - } else if (options->compress == COMP_CUST) { + } else if (dle->compress == COMP_CUST) { compopt = skip_argument; - comppid = pipespawn(options->clntcompprog, STDIN_PIPE, + comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, &dumpout, &compout, &mesgf, - options->clntcompprog, compopt, NULL); + dle->compprog, compopt, NULL); if(compopt != skip_argument) { dbprintf(_("pid %ld: %s %s\n"), - (long)comppid, options->clntcompprog, compopt); + (long)comppid, dle->compprog, compopt); } else { - dbprintf(_("pid %ld: %s\n"), (long)comppid, options->clntcompprog); + dbprintf(_("pid %ld: %s\n"), (long)comppid, dle->compprog); } } else { dumpout = compout; @@ -222,7 +217,7 @@ start_backup( gnutar_list_dir = NULL; #ifdef SAMBA_CLIENT /* { */ - if (amdevice[0] == '/' && amdevice[1]=='/') + if (dle->device[0] == '/' && dle->device[1]=='/') amfree(incrname); else #endif /* } */ @@ -231,7 +226,7 @@ start_backup( char number[NUM_STR_SIZE]; char *inputname = NULL; int baselevel; - char *sdisk = sanitise_filename(disk); + char *sdisk = sanitise_filename(dle->disk); basename = vstralloc(gnutar_list_dir, "/", @@ -240,7 +235,7 @@ start_backup( NULL); amfree(sdisk); - g_snprintf(number, SIZEOF(number), "%d", level); + g_snprintf(number, SIZEOF(number), "%d", GPOINTER_TO_INT(dle->level->data)); incrname = vstralloc(basename, "_", number, ".new", NULL); unlink(incrname); @@ -249,7 +244,7 @@ start_backup( * backward until one is found. If none are found (which will also * be true for a level 0), arrange to read from /dev/null. */ - baselevel = level; + baselevel = GPOINTER_TO_INT(dle->level->data); infd = -1; while (infd == -1) { if (--baselevel >= 0) { @@ -283,7 +278,7 @@ start_backup( } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { - if (fullwrite(outfd, &buf, (size_t)nb) < nb) { + if (full_write(outfd, &buf, (size_t)nb) < (size_t)nb) { error(_("error [writing to '%s': %s]"), incrname, strerror(errno)); /*NOTREACHED*/ @@ -308,50 +303,51 @@ start_backup( if(baselevel >= 0) { fquoted = quote_string(inputname); dbprintf(_("doing level %d dump as listed-incremental from '%s' to '%s'\n"), - level, fquoted, tquoted); + GPOINTER_TO_INT(dle->level->data), fquoted, tquoted); amfree(fquoted); } else { dbprintf(_("doing level %d dump as listed-incremental to '%s'\n"), - level, tquoted); + GPOINTER_TO_INT(dle->level->data), tquoted); } amfree(tquoted); amfree(inputname); amfree(basename); - } - - /* find previous dump time */ + } else { + /* no gnutar-listdir, so we're using amandates */ - amandates_file = getconf_str(CNF_AMANDATES); - if(!start_amandates(amandates_file, 0)) { - error(_("error [opening %s: %s]"), amandates_file, strerror(errno)); - /*NOTREACHED*/ - } + /* find previous dump time, failing completely if there's a problem */ + amandates_file = getconf_str(CNF_AMANDATES); + if(!start_amandates(amandates_file, 0)) { + error(_("error [opening %s: %s]"), amandates_file, strerror(errno)); + /*NOTREACHED*/ + } - amdates = amandates_lookup(disk); + amdates = amandates_lookup(dle->disk); - prev_dumptime = EPOCH; - for(l = 0; l < level; l++) { - if(amdates->dates[l] > prev_dumptime) - prev_dumptime = amdates->dates[l]; - } + prev_dumptime = EPOCH; + for(l = 0; l < GPOINTER_TO_INT(dle->level->data); l++) { + if(amdates->dates[l] > prev_dumptime) + prev_dumptime = amdates->dates[l]; + } - finish_amandates(); - free_amandates(); + finish_amandates(); + free_amandates(); - gmtm = gmtime(&prev_dumptime); - g_snprintf(dumptimestr, SIZEOF(dumptimestr), - "%04d-%02d-%02d %2d:%02d:%02d GMT", - gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, - gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); + gmtm = gmtime(&prev_dumptime); + g_snprintf(dumptimestr, SIZEOF(dumptimestr), + "%04d-%02d-%02d %2d:%02d:%02d GMT", + gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, + gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); - dbprintf(_("gnutar: doing level %d dump from date: %s\n"), - level, dumptimestr); + dbprintf(_("gnutar: doing level %d dump from amandates-derived date: %s\n"), + GPOINTER_TO_INT(dle->level->data), dumptimestr); + } - dirname = amname_to_dirname(amdevice); + dirname = amname_to_dirname(dle->device); cur_dumptime = time(0); - cur_level = level; - cur_disk = stralloc(disk); + cur_level = GPOINTER_TO_INT(dle->level->data); + cur_disk = stralloc(dle->disk); #ifdef GNUTAR # define PROGRAM_GNUTAR GNUTAR #else @@ -367,7 +363,7 @@ start_backup( #ifdef SAMBA_CLIENT /* { */ /* Use sambatar if the disk to back up is a PC disk */ - if (amdevice[0] == '/' && amdevice[1]=='/') { + if (dle->device[0] == '/' && dle->device[1]=='/') { char *sharename = NULL, *user_and_password = NULL, *domain = NULL; char *share = NULL, *subdir = NULL; char *pwtext = NULL; @@ -377,7 +373,7 @@ start_backup( size_t pwtext_len; char *pw_fd_env; - parsesharename(amdevice, &share, &subdir); + parsesharename(dle->device, &share, &subdir); if (!share) { amfree(share); amfree(subdir); @@ -433,16 +429,16 @@ start_backup( } taropt = stralloc("-T"); - if(options->exclude_file && options->exclude_file->nb_element == 1) { + if(dle->exclude_file && dle->exclude_file->nb_element == 1) { strappend(taropt, "X"); } #if SAMBA_VERSION >= 2 strappend(taropt, "q"); #endif strappend(taropt, "c"); - if (level != 0) { + if (GPOINTER_TO_INT(dle->level->data) != 0) { strappend(taropt, "g"); - } else if (!options->no_record) { + } else if (dle->record) { strappend(taropt, "a"); } @@ -454,16 +450,16 @@ start_backup( program->backup_name = program->restore_name = SAMBA_CLIENT; cmd = stralloc(program->backup_name); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); if (pwtext_len > 0) { pw_fd_env = "PASSWD_FD"; } else { pw_fd_env = "dummy_PASSWD_FD"; } - dumppid = pipespawn(cmd, STDIN_PIPE|PASSWD_PIPE, + dumppid = pipespawn(cmd, STDIN_PIPE|PASSWD_PIPE, 0, &dumpin, &dumpout, &mesgf, pw_fd_env, &passwdf, "smbclient", @@ -480,13 +476,13 @@ start_backup( "-d0", taropt, "-", - options->exclude_file && options->exclude_file->nb_element == 1 ? options->exclude_file->first->name : skip_argument, + dle->exclude_file && dle->exclude_file->nb_element == 1 ? dle->exclude_file->first->name : skip_argument, NULL); if(domain) { memset(domain, '\0', strlen(domain)); amfree(domain); } - if(pwtext_len > 0 && fullwrite(passwdf, pwtext, pwtext_len) < 0) { + if(pwtext_len > 0 && full_write(passwdf, pwtext, pwtext_len) < pwtext_len) { int save_errno = errno; aclose(passwdf); @@ -516,20 +512,20 @@ start_backup( char *file_exclude = NULL; char *file_include = NULL; - if(options->exclude_file) nb_exclude+=options->exclude_file->nb_element; - if(options->exclude_list) nb_exclude+=options->exclude_list->nb_element; - if(options->include_file) nb_include+=options->include_file->nb_element; - if(options->include_list) nb_include+=options->include_list->nb_element; + if (dle->exclude_file) nb_exclude+=dle->exclude_file->nb_element; + if (dle->exclude_list) nb_exclude+=dle->exclude_list->nb_element; + if (dle->include_file) nb_include+=dle->include_file->nb_element; + if (dle->include_list) nb_include+=dle->include_list->nb_element; - if(nb_exclude > 0) file_exclude = build_exclude(disk, amdevice, options, 0); - if(nb_include > 0) file_include = build_include(disk, amdevice, options, 0); + if (nb_exclude > 0) file_exclude = build_exclude(dle, 0); + if (nb_include > 0) file_include = build_include(dle, 0); my_argv = alloc(SIZEOF(char *) * (22 + (nb_exclude*2)+(nb_include*2))); cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL); - info_tapeheader(); + info_tapeheader(dle); - start_index(options->createindex, dumpout, mesgf, indexf, indexcmd); + start_index(dle->create_index, dumpout, mesgf, indexf, indexcmd); my_argv[i++] = "runtar"; if (g_options->config) @@ -581,7 +577,7 @@ start_backup( my_argv[i++] = "."; } my_argv[i++] = NULL; - dumppid = pipespawnv(cmd, STDIN_PIPE, + dumppid = pipespawnv(cmd, STDIN_PIPE, 0, &dumpin, &dumpout, &mesgf, my_argv); tarpid = dumppid; amfree(file_exclude); @@ -603,15 +599,18 @@ start_backup( aclose(compout); aclose(dataf); aclose(mesgf); - if (options->createindex) + if (dle->create_index) aclose(indexf); } static void end_backup( + dle_t *dle, int goterror) { - if(!options->no_record && !goterror) { + char *amandates_file = NULL; + + if(dle->record && !goterror) { if (incrname != NULL && strlen(incrname) > 4) { char *nodotnew; @@ -625,14 +624,22 @@ end_backup( amfree(incrname); } - if(!start_amandates(amandates_file, 1)) { - g_fprintf(stderr, _("%s: warning [opening %s: %s]"), get_pname(), - amandates_file, strerror(errno)); - } - else { + /* update the amandates file */ + amandates_file = getconf_str(CNF_AMANDATES); + if(start_amandates(amandates_file, 1)) { amandates_updateone(cur_disk, cur_level, cur_dumptime); finish_amandates(); free_amandates(); + } else { + /* failure is only fatal if we didn't get a gnutar-listdir */ + char *gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); + if (!gnutar_list_dir || !*gnutar_list_dir) { + error(_("error [opening %s for writing: %s]"), amandates_file, strerror(errno)); + /* NOTREACHED */ + } else { + g_debug(_("non-fatal error opening '%s' for writing: %s]"), + amandates_file, strerror(errno)); + } } } } diff --git a/client-src/sendbackup.c b/client-src/sendbackup.c index 9f26daf..6da1326 100644 --- a/client-src/sendbackup.c +++ b/client-src/sendbackup.c @@ -39,6 +39,7 @@ #include "getfsent.h" #include "version.h" #include "conffile.h" +#include "amandates.h" #define sendbackup_debug(i, ...) do { \ if ((i) <= debug_sendbackup) { \ @@ -53,18 +54,19 @@ pid_t dumppid = (pid_t)-1; pid_t tarpid = (pid_t)-1; pid_t encpid = (pid_t)-1; pid_t indexpid = (pid_t)-1; +pid_t application_api_pid = (pid_t)-1; char *errorstr = NULL; int datafd; int mesgfd; int indexfd; -option_t *options; g_option_t *g_options = NULL; long dump_size = -1; backup_program_t *program = NULL; +dle_t *gdle = NULL; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; @@ -72,110 +74,38 @@ static char *amandad_auth = NULL; /* local functions */ int main(int argc, char **argv); -char *optionstr(option_t *options); char *childstr(pid_t pid); -int check_status(pid_t pid, amwait_t w); +int check_status(pid_t pid, amwait_t w, int mesgfd); pid_t pipefork(void (*func)(void), char *fname, int *stdinfd, int stdoutfd, int stderrfd); -void parse_backup_messages(int mesgin); +int check_result(int mesgfd); +void parse_backup_messages(dle_t *dle, int mesgin); static void process_dumpline(char *str); static void save_fd(int *, int); -void backup_api_info_tapeheader(int mesgfd, char *prog, option_t *options); +void application_api_info_tapeheader(int mesgfd, char *prog, dle_t *dle); -double the_num(char *str, int pos); +int fdprintf(int fd, char *format, ...) G_GNUC_PRINTF(2, 3); - -char * -optionstr( - option_t * options) +int +fdprintf( + int fd, + char *format, + ...) { - static char *optstr = NULL; - char *compress_opt; - char *encrypt_opt; - char *decrypt_opt; - char *record_opt = ""; - char *index_opt = ""; - char *auth_opt; - char *exclude_file_opt; - char *exclude_list_opt; - char *exc = NULL; - sle_t *excl; - - if(options->compress == COMP_BEST) - compress_opt = stralloc("compress-best;"); - else if(options->compress == COMP_FAST) - compress_opt = stralloc("compress-fast;"); - else if(options->compress == COMP_SERVER_BEST) - compress_opt = stralloc("srvcomp-best;"); - else if(options->compress == COMP_SERVER_FAST) - compress_opt = stralloc("srvcomp-fast;"); - else if(options->compress == COMP_SERVER_CUST) - compress_opt = vstralloc("srvcomp-cust=", options->srvcompprog, ";", NULL); - else if(options->compress == COMP_CUST) - compress_opt = vstralloc("comp-cust=", options->clntcompprog, ";", NULL); - else - compress_opt = stralloc(""); - - if(options->encrypt == ENCRYPT_CUST) { - encrypt_opt = vstralloc("encrypt-cust=", options->clnt_encrypt, ";", NULL); - if (options->clnt_decrypt_opt) - decrypt_opt = vstralloc("client-decrypt-option=", options->clnt_decrypt_opt, ";", NULL); - else - decrypt_opt = stralloc(""); - } - else if(options->encrypt == ENCRYPT_SERV_CUST) { - encrypt_opt = vstralloc("encrypt-serv-cust=", options->srv_encrypt, ";", NULL); - if(options->srv_decrypt_opt) - decrypt_opt = vstralloc("server-decrypt-option=", options->srv_decrypt_opt, ";", NULL); - else - decrypt_opt = stralloc(""); - } - else { - encrypt_opt = stralloc(""); - decrypt_opt = stralloc(""); - } + va_list argp; + char *s; + int r; - if(options->no_record) record_opt = "no-record;"; - if(options->auth) auth_opt = vstralloc("auth=", options->auth, ";", NULL); - else auth_opt = stralloc(""); - if(options->createindex) index_opt = "index;"; + arglist_start(argp, format); + s = g_strdup_vprintf(format, argp); + arglist_end(argp); - exclude_file_opt = stralloc(""); - if(options->exclude_file) { - for(excl = options->exclude_file->first; excl != NULL; excl=excl->next){ - exc = newvstralloc(exc, "exclude-file=", excl->name, ";", NULL); - strappend(exclude_file_opt, exc); - } - } - exclude_list_opt = stralloc(""); - if(options->exclude_list) { - for(excl = options->exclude_list->first; excl != NULL; excl=excl->next){ - exc = newvstralloc(exc, "exclude-list=", excl->name, ";", NULL); - strappend(exclude_list_opt, exc); - } - } - amfree(exc); - optstr = newvstralloc(optstr, - compress_opt, - encrypt_opt, - decrypt_opt, - record_opt, - index_opt, - auth_opt, - exclude_file_opt, - exclude_list_opt, - NULL); - amfree(compress_opt); - amfree(encrypt_opt); - amfree(decrypt_opt); - amfree(auth_opt); - amfree(exclude_file_opt); - amfree(exclude_list_opt); - return optstr; + r = full_write(fd, s, strlen(s)); + amfree(s); + return r; } - int main( int argc, @@ -184,22 +114,19 @@ main( int interactive = 0; int level = 0; int mesgpipe[2]; - char *prog, *dumpdate, *stroptions; - int program_is_backup_api; - char *disk = NULL; + dle_t *dle = NULL; + char *dumpdate, *stroptions; char *qdisk = NULL; - char *amdevice = NULL; char *qamdevice = NULL; char *line = NULL; char *err_extra = NULL; char *s; int i; int ch; - FILE *toolin; - int status; + GSList *errlist; + FILE *mesgstream; /* initialize */ - /* * Configure program for internationalization: * 1) Only set the message locale for now. @@ -242,6 +169,7 @@ main( our_feature_string = am_feature_to_string(our_features); config_init(CONFIG_INIT_CLIENT, NULL); + /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); @@ -256,13 +184,9 @@ main( fflush(stderr); } - prog = NULL; - disk = NULL; qdisk = NULL; - amdevice = NULL; dumpdate = NULL; stroptions = NULL; - program_is_backup_api=0; for(; (line = agets(stdin)) != NULL; free(line)) { if (line[0] == '\0') @@ -284,17 +208,31 @@ main( config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); - dbrename(config_name, DBG_SUBDIR_CLIENT); + dbrename(get_config_name(), DBG_SUBDIR_CLIENT); + } + + /* check for any config errors now */ + if (config_errors(&errlist) >= CFGERR_ERRORS) { + char *errstr = config_errors_to_error_string(errlist); + g_printf("%s\n", errstr); + dbclose(); + return 1; + } + + if (am_has_feature(g_options->features, fe_req_xml)) { + break; } continue; } - if (prog != NULL) { + if (dle && dle->program != NULL) { err_extra = _("multiple requests"); goto err; } dbprintf(_(" sendbackup req: <%s>\n"), line); + dle = alloc_dle(); + s = line; ch = *s++; @@ -303,21 +241,21 @@ main( err_extra = _("no program name"); goto err; /* no program name */ } - prog = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; - if(strcmp(prog,"BACKUP")==0) { - program_is_backup_api=1; - skip_whitespace(s, ch); /* find dumper name */ - if (ch == '\0') { - goto err; /* no program */ - } - prog = s - 1; - skip_non_whitespace(s, ch); - s[-1] = '\0'; - } - prog = stralloc(prog); + if (strcmp(dle->program, "APPLICATION")==0) { + dle->program_is_application_api=1; + skip_whitespace(s, ch); /* find dumper name */ + if (ch == '\0') { + goto err; /* no program */ + } + dle->program = s - 1; + skip_non_whitespace(s, ch); + s[-1] = '\0'; + } + dle->program = stralloc(dle->program); skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { @@ -325,14 +263,13 @@ main( goto err; /* no disk name */ } - amfree(disk); amfree(qdisk); qdisk = s - 1; ch = *qdisk; skip_quoted_string(s, ch); s[-1] = '\0'; qdisk = stralloc(qdisk); - disk = unquote_string(qdisk); + dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { @@ -341,18 +278,17 @@ main( } if(!isdigit((int)s[-1])) { - amfree(amdevice); amfree(qamdevice); qamdevice = s - 1; ch = *qamdevice; skip_quoted_string(s, ch); s[-1] = '\0'; qamdevice = stralloc(qamdevice); - amdevice = unquote_string(qamdevice); + dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { - amdevice = stralloc(disk); + dle->device = stralloc(dle->disk); qamdevice = stralloc(qdisk); } /* find the level number */ @@ -361,6 +297,7 @@ main( goto err; /* bad level */ } skip_integer(s, ch); + dle->level = g_slist_append(dle->level, GINT_TO_POINTER(level)); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { @@ -392,63 +329,95 @@ main( } amfree(line); if (g_options == NULL) { - printf(_("ERROR [Missing OPTIONS line in sendbackup input]\n")); + g_printf(_("ERROR [Missing OPTIONS line in sendbackup input]\n")); error(_("Missing OPTIONS line in sendbackup input\n")); /*NOTREACHED*/ } - if (prog == NULL || - disk == NULL || - amdevice == NULL || - dumpdate == NULL || - stroptions == NULL) { + if (am_has_feature(g_options->features, fe_req_xml)) { + char *errmsg = NULL; + + dle = amxml_parse_node_FILE(stdin, &errmsg); + if (errmsg) { + err_extra = errmsg; + goto err; + } + if (!dle) { + err_extra = _("One DLE required"); + goto err; + } else if (dle->next) { + err_extra = _("Only one DLE allowed"); + goto err; + } + + qdisk = quote_string(dle->disk); + if (dle->device == NULL) + dle->device = stralloc(dle->disk); + qamdevice = quote_string(dle->device); + dumpdate = stralloc("NODATE"); + stroptions = stralloc(""); + } else { + parse_options(stroptions, dle, g_options->features, 0); + } + gdle = dle; + + if (dle->program == NULL || + dle->disk == NULL || + dle->device == NULL || + dle->level == NULL || + dumpdate == NULL) { err_extra = _("no valid sendbackup request"); goto err; } - - dbprintf(_(" Parsed request as: program `%s'\n"), prog); + + if (g_slist_length(dle->level) != 1) { + err_extra = _("Too many level"); + goto err; + } + + level = GPOINTER_TO_INT(dle->level->data); + dbprintf(_(" Parsed request as: program `%s'\n"), dle->program); dbprintf(_(" disk `%s'\n"), qdisk); dbprintf(_(" device `%s'\n"), qamdevice); dbprintf(_(" level %d\n"), level); dbprintf(_(" since %s\n"), dumpdate); dbprintf(_(" options `%s'\n"), stroptions); - if(program_is_backup_api==1) { - /* check that the backup_api exist */ - } - else { + if (dle->program_is_application_api==1) { + /* check that the application_api exist */ + } else { for(i = 0; programs[i]; i++) { - if (strcmp(programs[i]->name, prog) == 0) { + if (strcmp(programs[i]->name, dle->program) == 0) { break; } } if (programs[i] == NULL) { - dbprintf(_("ERROR [%s: unknown program %s]\n"), get_pname(), prog); - error(_("ERROR [%s: unknown program %s]"), get_pname(), prog); + dbprintf(_("ERROR [%s: unknown program %s]\n"), get_pname(), + dle->program); + error(_("ERROR [%s: unknown program %s]"), get_pname(), + dle->program); /*NOTREACHED*/ } program = programs[i]; } - options = parse_options(stroptions, disk, amdevice, g_options->features, 0); - if(!interactive) { datafd = DATA_FD_OFFSET + 0; mesgfd = DATA_FD_OFFSET + 2; indexfd = DATA_FD_OFFSET + 4; } - if (!options->createindex) + if (!dle->create_index) indexfd = -1; - if(options->auth && amandad_auth) { - if(strcasecmp(options->auth, amandad_auth) != 0) { + if (dle->auth && amandad_auth) { + if(strcasecmp(dle->auth, amandad_auth) != 0) { g_printf(_("ERROR [client configured for auth=%s while server requested '%s']\n"), - amandad_auth, options->auth); + amandad_auth, dle->auth); exit(-1); } } - if (options->kencrypt) { + if (dle->kencrypt) { g_printf("KENCRYPT\n"); } @@ -462,9 +431,6 @@ main( if(am_has_feature(g_options->features, fe_rep_options_hostname)) { g_printf("hostname=%s;", g_options->hostname); } - if(am_has_feature(g_options->features, fe_rep_options_sendbackup_options)) { - g_printf("%s", optionstr(options)); - } g_printf("\n"); fflush(stdout); if (freopen("/dev/null", "w", stdout) == NULL) { @@ -484,56 +450,135 @@ main( } if(!interactive) { - if(datafd == -1 || mesgfd == -1 || (options->createindex && indexfd == -1)) { + if(datafd == -1 || mesgfd == -1 || (dle->create_index && indexfd == -1)) { dbclose(); exit(1); } } - if(program_is_backup_api==1) { - pid_t backup_api_pid; - int i, j; + mesgstream = fdopen(mesgfd,"w"); + run_client_scripts(EXECUTE_ON_PRE_DLE_BACKUP, g_options, dle, mesgstream); + fflush(mesgstream); + + if (dle->program_is_application_api==1) { + int i, j, k; char *cmd=NULL; - char *argvchild[20]; + char **argvchild; char levelstr[20]; - int property_pipe[2]; backup_support_option_t *bsu; - - if (pipe(property_pipe) < 0) { - error(_("Can't create pipe: %s"),strerror(errno)); - /*NOTREACHED*/ + char *compopt = NULL; + char *encryptopt = skip_argument; + int compout, dumpout; + GSList *scriptlist; + script_t *script; + time_t cur_dumptime; + int result; + GPtrArray *errarray; + int errfd[2]; + FILE *dumperr; + + /* apply client-side encryption here */ + if ( dle->encrypt == ENCRYPT_CUST ) { + encpid = pipespawn(dle->clnt_encrypt, STDIN_PIPE, 0, + &compout, &datafd, &mesgfd, + dle->clnt_encrypt, encryptopt, NULL); + dbprintf(_("encrypt: pid %ld: %s\n"), (long)encpid, dle->clnt_encrypt); + } else { + compout = datafd; + encpid = -1; } - bsu = backup_support_option(prog, g_options, disk, amdevice); - switch(backup_api_pid=fork()) { - case 0: - aclose(property_pipe[1]); - if(dup2(property_pipe[0], 0) == -1) { - error(_("Can't dup2: %s"),strerror(errno)); - /*NOTREACHED*/ + /* now do the client-side compression */ + if(dle->compress == COMP_FAST || dle->compress == COMP_BEST) { + compopt = skip_argument; +#if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT) + if(dle->compress == COMP_BEST) { + compopt = COMPRESS_BEST_OPT; + } else { + compopt = COMPRESS_FAST_OPT; } - if(dup2(datafd, 1) == -1) { - error(_("Can't dup2: %s"),strerror(errno)); - /*NOTREACHED*/ +#endif + comppid = pipespawn(COMPRESS_PATH, STDIN_PIPE, 0, + &dumpout, &compout, &mesgfd, + COMPRESS_PATH, compopt, NULL); + dbprintf(_("gnutar: pid %ld: %s"), (long)comppid, COMPRESS_PATH); + if(compopt != skip_argument) { + dbprintf(_("pid %ld: %s %s\n"), + (long)comppid, COMPRESS_PATH, compopt); + } else { + dbprintf(_("pid %ld: %s\n"), (long)comppid, COMPRESS_PATH); } - if(dup2(mesgfd, 2) == -1) { - error(_("Can't dup2: %s"),strerror(errno)); - /*NOTREACHED*/ + } else if (dle->compress == COMP_CUST) { + compopt = skip_argument; + comppid = pipespawn(dle->compprog, STDIN_PIPE, 0, + &dumpout, &compout, &mesgfd, + dle->compprog, compopt, NULL); + if(compopt != skip_argument) { + dbprintf(_("pid %ld: %s %s\n"), + (long)comppid, dle->compprog, compopt); + } else { + dbprintf(_("pid %ld: %s\n"), (long)comppid, dle->compprog); } - if(indexfd != 0) { - if(dup2(indexfd, 3) == -1) { - error(_("Can't dup2: %s"),strerror(errno)); - /*NOTREACHED*/ + } else { + dumpout = compout; + comppid = -1; + } + + cur_dumptime = time(0); + bsu = backup_support_option(dle->program, g_options, dle->disk, + dle->device, &errarray); + if (!bsu) { + char *errmsg; + char *qerrmsg; + guint i; + for (i=0; i < errarray->len; i++) { + errmsg = g_ptr_array_index(errarray, i); + qerrmsg = quote_string(errmsg); + fdprintf(mesgfd, + _("sendbackup: error [Application '%s': %s]\n"), + dle->program, errmsg); + dbprintf("aa: %s\n",qerrmsg); + amfree(qerrmsg); + } + if (i == 0) { /* no errarray */ + errmsg = vstrallocf(_("Can't execute application '%s'"), + dle->program); + qerrmsg = quote_string(errmsg); + fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg); + dbprintf(_("ERROR %s\n"), qerrmsg); + amfree(qerrmsg); + amfree(errmsg); + } + return 0; + } + + if (pipe(errfd) < 0) { + char *errmsg; + char *qerrmsg; + errmsg = vstrallocf(_("Application '%s': can't create pipe"), + dle->program); + qerrmsg = quote_string(errmsg); + fdprintf(mesgfd, _("sendbackup: error [%s]\n"), errmsg); + dbprintf(_("ERROR %s\n"), qerrmsg); + amfree(qerrmsg); + amfree(errmsg); + return 0; + } + + switch(application_api_pid=fork()) { + case 0: + cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); + k = application_property_argv_size(dle); + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + k += property_argv_size(script->result->proplist); } - fcntl(indexfd, F_SETFD, 0); - fcntl(3, F_SETFD, 0); - safe_fd(3, 1); - } else { - safe_fd(-1, 0); } - cmd = vstralloc(DUMPER_DIR, "/", prog, NULL); + argvchild = g_new0(char *, 20 + k); i=0; - argvchild[i++] = prog; + argvchild[i++] = dle->program; argvchild[i++] = "backup"; if (bsu->message_line == 1) { argvchild[i++] = "--message"; @@ -547,59 +592,110 @@ main( argvchild[i++] = "--host"; argvchild[i++] = g_options->hostname; } - if (disk && bsu->disk == 1) { + if (dle->disk && bsu->disk == 1) { argvchild[i++] = "--disk"; - argvchild[i++] = disk; + argvchild[i++] = dle->disk; } argvchild[i++] = "--device"; - argvchild[i++] = amdevice; + argvchild[i++] = dle->device; if (level <= bsu->max_level) { argvchild[i++] = "--level"; g_snprintf(levelstr,19,"%d",level); argvchild[i++] = levelstr; } - if (indexfd != 0 && bsu->index_line == 1) { + if (indexfd != -1 && bsu->index_line == 1) { argvchild[i++] = "--index"; argvchild[i++] = "line"; } - if (!options->no_record && bsu->record == 1) { + if (dle->record && bsu->record == 1) { argvchild[i++] = "--record"; } + i += application_property_add_to_argv(&argvchild[i], dle, bsu); + + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + i += property_add_to_argv(&argvchild[i], + script->result->proplist); + } + } + argvchild[i] = NULL; - dbprintf(_("%s: running \"%s"), get_pname(), cmd); - for(j=1;j 0) { + if(dup2(indexfd, 4) == -1) { + error(_("Can't dup2: %s"),strerror(errno)); + /*NOTREACHED*/ + } + fcntl(indexfd, F_SETFD, 0); + } + application_api_info_tapeheader(mesgfd, dle->program, dle); + if (indexfd != 0) { + safe_fd(3, 2); + } else { + safe_fd(3, 1); + } execve(cmd, argvchild, safe_env()); exit(1); break; default: - aclose(property_pipe[0]); - toolin = fdopen(property_pipe[1],"w"); - if (!toolin) { - error(_("Can't fdopen: %s"), strerror(errno)); - /*NOTREACHED*/ - } - output_tool_property(toolin, options); - fflush(toolin); - fclose(toolin); break; case -1: error(_("%s: fork returned: %s"), get_pname(), strerror(errno)); } - amfree(bsu); - if (waitpid(backup_api_pid, &status, 0) < 0) { - if (!WIFEXITED(status)) { - dbprintf(_("Tool exited with signal %d"), WTERMSIG(status)); - } else if (WEXITSTATUS(status) != 0) { - dbprintf(_("Tool exited with status %d"), WEXITSTATUS(status)); + + close(errfd[1]); + dumperr = fdopen(errfd[0],"r"); + if (!dumperr) { + error(_("Can't fdopen: %s"), strerror(errno)); + /*NOTREACHED*/ + } + + while ((line = agets(dumperr)) != NULL) { + if (strlen(line) > 0) { + fdprintf(mesgfd, "sendbackup: error [%s]\n", line); + dbprintf("error: %s\n", line); + } + amfree(line); + } + + result = check_result(mesgfd); + if (result == 0) { + char *amandates_file; + + amandates_file = getconf_str(CNF_AMANDATES); + if(start_amandates(amandates_file, 1)) { + amandates_updateone(dle->disk, level, cur_dumptime); + finish_amandates(); + free_amandates(); } else { - dbprintf(_("waitpid returned negative value")); + if (dle->calcsize && bsu->calcsize) { + error(_("error [opening %s for writing: %s]"), + amandates_file, strerror(errno)); + } else { + g_debug(_("non-fatal error opening '%s' for writing: %s]"), + amandates_file, strerror(errno)); + } } } - } - else { + amfree(bsu); + } else { if(!interactive) { /* redirect stderr */ if(dup2(mesgfd, 2) == -1) { @@ -616,17 +712,17 @@ main( error(_("error [opening mesg pipe: %s]"), s); } - program->start_backup(g_options->hostname, disk, amdevice, level, - dumpdate, datafd, mesgpipe[1], indexfd); + program->start_backup(dle, g_options->hostname, + datafd, mesgpipe[1], indexfd); dbprintf(_("Started backup\n")); - parse_backup_messages(mesgpipe[0]); + parse_backup_messages(dle, mesgpipe[0]); dbprintf(_("Parsed backup messages\n")); } - amfree(prog); - amfree(disk); + run_client_scripts(EXECUTE_ON_POST_DLE_BACKUP, g_options, dle, mesgstream); + fflush(mesgstream); + amfree(qdisk); - amfree(amdevice); amfree(qamdevice); amfree(dumpdate); amfree(stroptions); @@ -640,10 +736,20 @@ main( return 0; err: - g_printf(_("FORMAT ERROR IN REQUEST PACKET\n")); - dbprintf(_("REQ packet is bogus%s%s\n"), - err_extra ? ": " : "", - err_extra ? err_extra : ""); + if (err_extra) { + g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET '%s'\n"), err_extra); + dbprintf(_("REQ packet is bogus: %s\n"), err_extra); + } else { + g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET\n")); + dbprintf(_("REQ packet is bogus\n")); + } + + amfree(qdisk); + amfree(qamdevice); + amfree(dumpdate); + amfree(stroptions); + amfree(our_feature_string); + dbclose(); return 1; } @@ -662,6 +768,13 @@ childstr( if(pid == comppid) return "compress"; if(pid == encpid) return "encrypt"; if(pid == indexpid) return "index"; + if(pid == application_api_pid) { + if (!gdle) { + dbprintf("gdle == NULL\n"); + return "gdle == NULL"; + } + return gdle->program; + } return "unknown"; } @@ -675,7 +788,8 @@ childstr( int check_status( pid_t pid, - amwait_t w) + amwait_t w, + int mesgfd) { char *thiserr = NULL; char *str, *strX; @@ -698,11 +812,11 @@ check_status( * but the failure is noted. */ if(ret != 0) { - g_fprintf(stderr, _("? index %s returned %d\n"), str, ret); + fdprintf(mesgfd, _("? index %s returned %d\n"), str, ret); rc = 0; } indexpid = -1; - strX = "index "; + strX = "index"; } else if(pid == comppid) { /* * compress returns 2 sometimes, but it is ok. @@ -713,7 +827,7 @@ check_status( } #endif comppid = -1; - strX = "compress "; + strX = "compress"; } else if(pid == dumppid && tarpid == -1) { /* * Ultrix dump returns 1 sometimes, but it is ok. @@ -724,7 +838,7 @@ check_status( } #endif dumppid = -1; - strX = "dump "; + strX = "dump"; } else if(pid == tarpid) { if (ret == 1) { rc = 0; @@ -738,9 +852,11 @@ check_status( } #endif dumppid = tarpid = -1; - strX = "dump "; + strX = "dump"; + } else if(pid == application_api_pid) { + strX = "Application"; } else { - strX = "unknown "; + strX = "unknown"; } if(rc == 0) { @@ -754,6 +870,8 @@ check_status( thiserr = vstrallocf(_("%s (%d) %s returned %d"), strX, (int)pid, str, ret); } + fdprintf(mesgfd, "? %s\n", thiserr); + if(errorstr) { errorstr = newvstrallocf(errorstr, "%s, %s", errorstr, thiserr); amfree(thiserr); @@ -769,12 +887,13 @@ check_status( *Send header info to the message file. */ void -info_tapeheader(void) +info_tapeheader( + dle_t *dle) { g_fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name); g_fprintf(stderr, "%s: info RECOVER_CMD=", get_pname()); - if (options->compress == COMP_FAST || options->compress == COMP_BEST) + if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) g_fprintf(stderr, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT @@ -785,7 +904,7 @@ info_tapeheader(void) g_fprintf(stderr, "%s -xpGf - ...\n", program->restore_name); - if (options->compress == COMP_FAST || options->compress == COMP_BEST) + if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) g_fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); @@ -793,32 +912,32 @@ info_tapeheader(void) } void -backup_api_info_tapeheader( +application_api_info_tapeheader( int mesgfd, char *prog, - option_t *options) + dle_t *dle) { char line[1024]; - g_snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname()); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + g_snprintf(line, 1024, "%s: info BACKUP=APPLICATION\n", get_pname()); + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } - g_snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + g_snprintf(line, 1024, "%s: info APPLICATION=%s\n", get_pname(), prog); + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } g_snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname()); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } - if (options->compress) { + if (dle->compress == COMP_FAST || dle->compress == COMP_BEST) { g_snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH, #ifdef UNCOMPRESS_OPT UNCOMPRESS_OPT @@ -826,28 +945,29 @@ backup_api_info_tapeheader( "" #endif ); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } - g_snprintf(line, 1024, "%s -f... -\n", prog); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + g_snprintf(line, 1024, "%s/%s restore [./file-to-restore]+\n", + APPLICATION_DIR, prog); + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } - if (options->compress) { + if (dle->compress) { g_snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n", get_pname(), COMPRESS_SUFFIX); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } } g_snprintf(line, 1024, "%s: info end\n", get_pname()); - if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) { + if (full_write(mesgfd, line, strlen(line)) != strlen(line)) { dbprintf(_("error writing to mesgfd socket: %s"), strerror(errno)); return; } @@ -905,35 +1025,25 @@ pipefork( return pid; } -void -parse_backup_messages( - int mesgin) +int +check_result( + int mesgfd) { int goterror; pid_t wpid; amwait_t retstat; - char *line; goterror = 0; - amfree(errorstr); - - for(; (line = areads(mesgin)) != NULL; free(line)) { - process_dumpline(line); - } - if(errno) { - error(_("error [read mesg pipe: %s]"), strerror(errno)); - /*NOTREACHED*/ - } while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { - if(check_status(wpid, retstat)) goterror = 1; + if(check_status(wpid, retstat, mesgfd)) goterror = 1; } if (dumppid != -1) { sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { - if(check_status(wpid, retstat)) goterror = 1; + if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } if (dumppid != -1) { @@ -948,7 +1058,7 @@ parse_backup_messages( } sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { - if(check_status(wpid, retstat)) goterror = 1; + if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } if (dumppid != -1) { @@ -963,10 +1073,34 @@ parse_backup_messages( } sleep(5); while((wpid = waitpid((pid_t)-1, &retstat, WNOHANG)) > 0) { - if(check_status(wpid, retstat)) goterror = 1; + if(check_status(wpid, retstat, mesgfd)) goterror = 1; } } + return goterror; +} + +void +parse_backup_messages( + dle_t *dle, + int mesgin) +{ + int goterror; + char *line; + + amfree(errorstr); + + for(; (line = areads(mesgin)) != NULL; free(line)) { + process_dumpline(line); + } + + if(errno) { + error(_("error [read mesg pipe: %s]"), strerror(errno)); + /*NOTREACHED*/ + } + + goterror = check_result(mesgfd); + if(errorstr) { error(_("error [%s]"), errorstr); /*NOTREACHED*/ @@ -975,39 +1109,10 @@ parse_backup_messages( /*NOTREACHED*/ } - program->end_backup(goterror); + program->end_backup(dle, goterror); - g_fprintf(stderr, _("%s: size %ld\n"), get_pname(), dump_size); - g_fprintf(stderr, _("%s: end\n"), get_pname()); -} - - -/* - * Returns the value of the first integer in a string. - */ - -double -the_num( - char * str, - int pos) -{ - char *num; - int ch; - double d; - - do { - ch = *str++; - while(ch && !isdigit(ch)) ch = *str++; - if (pos == 1) break; - pos--; - while(ch && (isdigit(ch) || ch == '.')) ch = *str++; - } while (ch); - num = str - 1; - while(isdigit(ch) || ch == '.') ch = *str++; - str[-1] = '\0'; - d = atof(num); - str[-1] = (char)ch; - return d; + fdprintf(mesgfd, _("%s: size %ld\n"), get_pname(), dump_size); + fdprintf(mesgfd, _("%s: end\n"), get_pname()); } @@ -1057,7 +1162,7 @@ process_dumpline( type, startchr, str); - g_fprintf(stderr, "%c %s\n", startchr, str); + fdprintf(mesgfd, "%c %s\n", startchr, str); } @@ -1161,7 +1266,7 @@ start_index( char buffer[BUFSIZ], *ptr; ssize_t bytes_read; size_t bytes_written; - ssize_t just_written; + size_t just_written; do { bytes_read = read(0, buffer, SIZEOF(buffer)); @@ -1178,8 +1283,8 @@ start_index( /* write the stuff to the subprocess */ ptr = buffer; bytes_written = 0; - just_written = fullwrite(fileno(pipe_fp), ptr, (size_t)bytes_read); - if (just_written < 0) { + just_written = full_write(fileno(pipe_fp), ptr, (size_t)bytes_read); + if (just_written < (size_t)bytes_read) { /* * just as we waited for write() to complete. */ @@ -1196,8 +1301,8 @@ start_index( occurs */ ptr = buffer; bytes_written = 0; - just_written = fullwrite(3, ptr, (size_t)bytes_read); - if (just_written < 0) { + just_written = full_write(3, ptr, bytes_read); + if (just_written < (size_t)bytes_read) { error(_("index tee cannot write [%s]"), strerror(errno)); /*NOTREACHED*/ } else { diff --git a/client-src/sendbackup.h b/client-src/sendbackup.h index 134e6fb..ceff2d9 100644 --- a/client-src/sendbackup.h +++ b/client-src/sendbackup.h @@ -36,7 +36,7 @@ #include "client_util.h" #include "amandad.h" -void info_tapeheader(void); +void info_tapeheader(dle_t *dle); void start_index(int createindex, int input, int mesg, int index, char *cmd); @@ -57,7 +57,7 @@ void start_index(int createindex, int input, int mesg, */ typedef enum { - DMP_NORMAL, DMP_STRANGE, DMP_SIZE, DMP_ERROR + DMP_NORMAL, DMP_IGNORE, DMP_STRANGE, DMP_SIZE, DMP_ERROR } dmpline_t; typedef struct regex_s { @@ -69,20 +69,20 @@ typedef struct regex_s { } amregex_t; #define AM_NORMAL_RE(re) {(re), __LINE__, 0, 0, DMP_NORMAL} +#define AM_IGNORE_RE(re) {(re), __LINE__, 0, 0, DMP_IGNORE} #define AM_STRANGE_RE(re) {(re), __LINE__, 0, 0, DMP_STRANGE} #define AM_SIZE_RE(re,s,f) {(re), __LINE__, (s), (f), DMP_SIZE} #define AM_ERROR_RE(re) {(re), __LINE__, 0, 0, DMP_ERROR} extern pid_t comppid, dumppid, encpid, tarpid; extern pid_t indexpid; -extern option_t *options; extern g_option_t *g_options; typedef struct backup_program_s { char *name, *backup_name, *restore_name; amregex_t *re_table; - void (*start_backup)(char *host, char *disk, char *amdevice, int level, char *dumpdate, int dataf, int mesgf, int indexf); - void (*end_backup)(int goterror); + void (*start_backup)(dle_t *dle, char *host, int dataf, int mesgf, int indexf); + void (*end_backup)(dle_t *dle, int goterror); } backup_program_t; extern backup_program_t *programs[], *program; diff --git a/client-src/sendsize.c b/client-src/sendsize.c index 4a335b7..359688c 100644 --- a/client-src/sendsize.c +++ b/client-src/sendsize.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: sendsize.c,v 1.171 2006/08/24 01:57:15 paddy_s Exp $ + * $Id: sendsize.c 10421 2008-03-06 18:48:30Z martineau $ * * send estimated backup sizes using dump */ @@ -83,19 +83,13 @@ typedef struct level_estimates_s { typedef struct disk_estimates_s { struct disk_estimates_s *next; - char *amname; char *qamname; - char *amdevice; char *qamdevice; char *dirname; char *qdirname; - char *program; - char *calcprog; - int program_is_backup_api; - int spindle; pid_t child; int done; - option_t *options; + dle_t *dle; level_estimate_t est[DUMP_LEVELS]; } disk_estimates_t; @@ -104,31 +98,27 @@ disk_estimates_t *est_list; static am_feature_t *our_features = NULL; static char *our_feature_string = NULL; static g_option_t *g_options = NULL; +static gboolean amandates_started = FALSE; /* local functions */ int main(int argc, char **argv); -void add_diskest(char *disk, char *amdevice, int level, int spindle, - int program_is_backup_api, char *prog, char *calcprog, - option_t *options); +void dle_add_diskest(dle_t *dle); void calc_estimates(disk_estimates_t *est); void free_estimates(disk_estimates_t *est); void dump_calc_estimates(disk_estimates_t *); void star_calc_estimates(disk_estimates_t *); void smbtar_calc_estimates(disk_estimates_t *); void gnutar_calc_estimates(disk_estimates_t *); -void backup_api_calc_estimate(disk_estimates_t *); +void application_api_calc_estimate(disk_estimates_t *); void generic_calc_estimates(disk_estimates_t *); - int main( int argc, char ** argv) { - int level, spindle; - char *prog, *calcprog, *dumpdate; - option_t *options = NULL; - int program_is_backup_api; + int level; + char *dumpdate; disk_estimates_t *est; disk_estimates_t *est1; disk_estimates_t *est_prev; @@ -139,13 +129,11 @@ main( int done; int need_wait; int dumpsrunning; - char *disk = NULL; char *qdisk = NULL; char *qlist = NULL; - char *amdevice = NULL; char *qamdevice = NULL; - char *amandates_file; - int amandates_read = 0; + dle_t *dle; + GSList *errlist; (void)argc; /* Quiet unused parameter warning */ (void)argv; /* Quiet unused parameter warning */ @@ -178,6 +166,7 @@ main( our_feature_string = am_feature_to_string(our_features); config_init(CONFIG_INIT_CLIENT, NULL); + /* (check for config errors comes later) */ check_running_as(RUNNING_AS_CLIENT_LOGIN); @@ -212,20 +201,24 @@ main( config_init(CONFIG_INIT_CLIENT | CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_OVERLAY, g_options->config); - dbrename(config_name, DBG_SUBDIR_CLIENT); + dbrename(get_config_name(), DBG_SUBDIR_CLIENT); } - continue; - } + /* check for any config errors now */ + if (config_errors(&errlist) >= CFGERR_ERRORS) { + char *errstr = config_errors_to_error_string(errlist); + g_printf("%s\n", errstr); + dbclose(); + return 1; + } - if (amandates_read == 0) { - amandates_file = getconf_str(CNF_AMANDATES); - if(!start_amandates(amandates_file, 0)) - error("error [opening %s: %s]", amandates_file, - strerror(errno)); - amandates_read = 1; + if (am_has_feature(g_options->features, fe_req_xml)) { + break; + } + continue; } + dle = alloc_dle(); s = line; ch = *s++; @@ -234,44 +227,46 @@ main( err_extra = stralloc(_("no program name")); goto err; /* no program name */ } - prog = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; - program_is_backup_api=0; - if(strncmp_const(prog, "CALCSIZE") == 0) { + dle->program_is_application_api=0; + if(strncmp_const(dle->program, "CALCSIZE") == 0) { skip_whitespace(s, ch); /* find the program name */ if(ch == '\0') { err_extra = stralloc(_("no program name")); goto err; } - calcprog = s - 1; + dle->calcsize = 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; - if (strcmp(calcprog,"BACKUP") == 0) { - program_is_backup_api=1; + if (strcmp(dle->program,"APPLICATION") == 0) { + dle->program_is_application_api=1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } - calcprog = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; } } else { - calcprog = NULL; - if (strcmp(prog,"BACKUP") == 0) { - program_is_backup_api=1; + dle->calcsize = 0; + if (strcmp(dle->program,"APPLICATION") == 0) { + dle->program_is_application_api=1; skip_whitespace(s, ch); /* find dumper name */ if (ch == '\0') { goto err; /* no program */ } - prog = s - 1; + dle->program = s - 1; skip_non_whitespace(s, ch); s[-1] = '\0'; } } + dle->program = stralloc(dle->program); skip_whitespace(s, ch); /* find the disk name */ if(ch == '\0') { @@ -281,14 +276,12 @@ main( if (qdisk != NULL) amfree(qdisk); - if (disk != NULL) - amfree(disk); fp = s - 1; skip_quoted_string(s, ch); s[-1] = '\0'; /* terminate the disk name */ qdisk = stralloc(fp); - disk = unquote_string(qdisk); + dle->disk = unquote_string(qdisk); skip_whitespace(s, ch); /* find the device or level */ if (ch == '\0') { @@ -300,11 +293,11 @@ main( skip_quoted_string(s, ch); s[-1] = '\0'; qamdevice = stralloc(fp); - amdevice = unquote_string(qamdevice); + dle->device = unquote_string(qamdevice); skip_whitespace(s, ch); /* find level number */ } else { - amdevice = stralloc(disk); + dle->device = stralloc(dle->disk); qamdevice = stralloc(qdisk); } @@ -318,6 +311,7 @@ main( goto err; } skip_integer(s, ch); + dle->level = g_slist_append(dle->level, GINT_TO_POINTER(level)); skip_whitespace(s, ch); /* find the dump date */ if(ch == '\0') { @@ -329,11 +323,11 @@ main( s[-1] = '\0'; (void)dumpdate; /* XXX: Set but not used */ - spindle = 0; /* default spindle */ + dle->spindle = 0; /* default spindle */ skip_whitespace(s, ch); /* find the spindle */ if(ch != '\0') { - if(sscanf(s - 1, "%d", &spindle) != 1) { + if(sscanf(s - 1, "%d", &dle->spindle) != 1) { err_extra = stralloc(_("bad spindle")); goto err; /* bad spindle */ } @@ -342,35 +336,32 @@ main( skip_whitespace(s, ch); /* find the parameters */ if(ch != '\0') { if(strncmp_const(s-1, "OPTIONS |;") == 0) { - options = parse_options(s + 8, - disk, - amdevice, - g_options->features, - 0); + parse_options(s + 8, + dle, + g_options->features, + 0); } else { - options = alloc(SIZEOF(option_t)); - init_options(options); while (ch != '\0') { if(strncmp_const(s-1, "exclude-file=") == 0) { qlist = unquote_string(s+12); - options->exclude_file = - append_sl(options->exclude_file, qlist); + dle->exclude_file = + append_sl(dle->exclude_file, qlist); amfree(qlist); } else if(strncmp_const(s-1, "exclude-list=") == 0) { qlist = unquote_string(s+12); - options->exclude_list = - append_sl(options->exclude_list, qlist); + dle->exclude_list = + append_sl(dle->exclude_list, qlist); amfree(qlist); } else if(strncmp_const(s-1, "include-file=") == 0) { qlist = unquote_string(s+12); - options->include_file = - append_sl(options->include_file, qlist); + dle->include_file = + append_sl(dle->include_file, qlist); amfree(qlist); } else if(strncmp_const(s-1, "include-list=") == 0) { qlist = unquote_string(s+12); - options->include_list = - append_sl(options->include_list, qlist); + dle->include_list = + append_sl(dle->include_list, qlist); amfree(qlist); } else { err_extra = vstrallocf(_("Invalid parameter (%s)"), s-1); @@ -382,33 +373,43 @@ main( } } } - else { - options = alloc(SIZEOF(option_t)); - init_options(options); - } - } - else { - options = alloc(SIZEOF(option_t)); - init_options(options); } /*@ignore@*/ - add_diskest(disk, amdevice, level, spindle, program_is_backup_api, prog, calcprog, options); + dle_add_diskest(dle); /*@end@*/ - amfree(disk); - amfree(qdisk); - amfree(amdevice); - amfree(qamdevice); } if (g_options == NULL) { - printf(_("ERROR [Missing OPTIONS line in sendsize input]\n")); + g_printf(_("ERROR [Missing OPTIONS line in sendsize input]\n")); error(_("Missing OPTIONS line in sendsize input\n")); /*NOTREACHED*/ } amfree(line); - finish_amandates(); - free_amandates(); + if (am_has_feature(g_options->features, fe_req_xml)) { + char *errmsg = NULL; + dle_t *dles, *dle; + + dles = amxml_parse_node_FILE(stdin, &errmsg); + if (errmsg) { + err_extra = errmsg; + goto err; + } + for (dle = dles; dle != NULL; dle = dle->next) { + dle_add_diskest(dle); + } + } + + if (amandates_started) { + finish_amandates(); + free_amandates(); + amandates_started = FALSE; + } + + for(est = est_list; est != NULL; est = est->next) { + run_client_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE, g_options, est->dle, + stdout); + } dumpsrunning = 0; need_wait = 0; @@ -454,6 +455,8 @@ main( est->done = 1; est->child = 0; dumpsrunning--; + run_client_scripts(EXECUTE_ON_POST_DLE_ESTIMATE, g_options, + est->dle, stdout); } } /* @@ -478,7 +481,7 @@ main( /* * Make sure there is no spindle conflict. */ - if(est->spindle != -1) { + if(est->dle->spindle != -1) { for(est1 = est_list; est1 != NULL; est1 = est1->next) { if(est1->child == 0 || est == est1 || est1->done) { /* @@ -487,7 +490,7 @@ main( */ continue; } - if(est1->spindle == est->spindle) { + if(est1->dle->spindle == est->dle->spindle) { break; /* oops -- they match */ } } @@ -503,6 +506,9 @@ main( } } else { done = 0; + run_client_scripts(EXECUTE_ON_PRE_DLE_ESTIMATE, g_options, + est->dle, stdout); + if((est->child = fork()) == 0) { calc_estimates(est); /* child does the estimate */ exit(0); @@ -514,6 +520,11 @@ main( } } + for(est = est_list; est != NULL; est = est->next) { + run_client_scripts(EXECUTE_ON_POST_HOST_ESTIMATE, g_options, est->dle, + stdout); + } + est_prev = NULL; for(est = est_list; est != NULL; est = est->next) { free_estimates(est); @@ -529,52 +540,87 @@ main( dbclose(); return 0; err: - g_printf(_("FORMAT ERROR IN REQUEST PACKET\n")); if (err_extra) { + g_printf(_("FORMAT ERROR IN REQUEST PACKET '%s'\n"), err_extra); dbprintf(_("REQ packet is bogus: %s\n"), err_extra); amfree(err_extra); } else { + g_printf(_("ERROR FORMAT ERROR IN REQUEST PACKET\n")); dbprintf(_("REQ packet is bogus\n")); } + + free_g_options(g_options); + dbclose(); return 1; } void -add_diskest( - char * disk, - char * amdevice, - int level, - int spindle, - int program_is_backup_api, - char * prog, - char * calcprog, - option_t * options) +dle_add_diskest( + dle_t *dle) { disk_estimates_t *newp, *curp; amandates_t *amdp; int dumplev, estlev; time_t dumpdate; + GSList *level; + char *amandates_file; + gboolean need_amandates = FALSE; - if (level < 0) - level = 0; - if (level >= DUMP_LEVELS) - level = DUMP_LEVELS - 1; + level = dle->level; + if (level == NULL) { + g_printf(_("ERROR Missing level in request\n")); + return; + } + + /* should we use amandates for this? */ + if (dle->calcsize) + need_amandates = TRUE; + if (strcmp(dle->program, "GNUTAR") == 0) { + /* GNUTAR only needs amandates if gnutar_list_dir is NULL */ + char *gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR); + if (!gnutar_list_dir || !*gnutar_list_dir) + need_amandates = TRUE; + } + + /* start amandates here, before adding this DLE to est_list, in case + * we encounter an error. */ + if (need_amandates) { + if (!amandates_started) { + amandates_file = getconf_str(CNF_AMANDATES); + if(!start_amandates(amandates_file, 0)) { + char *errstr = strerror(errno); + char *qamname = quote_string(dle->disk); + char *errmsg = vstrallocf(_("could not open %s: %s"), amandates_file, errstr); + char *qerrmsg = quote_string(errmsg); + g_printf(_("%s %d ERROR %s\n"), qamname, 0, qerrmsg); + amfree(qamname); + amfree(errmsg); + amfree(qerrmsg); + return; + } + amandates_started = TRUE; + } + } + + while (level != NULL) { + if (GPOINTER_TO_INT(level->data) < 0) + level->data = GINT_TO_POINTER(0); + if (GPOINTER_TO_INT(level->data) >= DUMP_LEVELS) + level->data = GINT_TO_POINTER(DUMP_LEVELS - 1); + level = g_slist_next(level); + } for(curp = est_list; curp != NULL; curp = curp->next) { - if(strcmp(curp->amname, disk) == 0) { + if(strcmp(curp->dle->disk, dle->disk) == 0) { /* already have disk info, just note the level request */ - curp->est[level].needestimate = 1; - if(options) { - free_sl(options->exclude_file); - free_sl(options->exclude_list); - free_sl(options->include_file); - free_sl(options->include_list); - amfree(options->auth); - amfree(options->str); - amfree(options); + level = dle->level; + while (level != NULL) { + curp->est[GPOINTER_TO_INT(level->data)].needestimate = 1; + level = g_slist_next(level); } + return; } } @@ -583,32 +629,39 @@ add_diskest( memset(newp, 0, SIZEOF(*newp)); newp->next = est_list; est_list = newp; - newp->amname = stralloc(disk); - newp->qamname = quote_string(disk); - newp->amdevice = stralloc(amdevice); - newp->qamdevice = quote_string(amdevice); - newp->dirname = amname_to_dirname(newp->amdevice); - newp->qdirname = quote_string(newp->dirname); - newp->program = stralloc(prog); - if(calcprog != NULL) - newp->calcprog = stralloc(calcprog); - else - newp->calcprog = NULL; - newp->program_is_backup_api = program_is_backup_api; - newp->spindle = spindle; - newp->est[level].needestimate = 1; - newp->options = options; + newp->qamname = quote_string(dle->disk); + if (dle->device) { + newp->qamdevice = quote_string(dle->device); + newp->dirname = amname_to_dirname(dle->device); + newp->qdirname = quote_string(newp->dirname); + } else { + newp->qamdevice = stralloc(""); + newp->dirname = stralloc(""); + newp->qdirname = stralloc(""); + } + level = dle->level; + while (level != NULL) { + newp->est[GPOINTER_TO_INT(level->data)].needestimate = 1; + level = g_slist_next(level); + } + newp->dle = dle; /* fill in dump-since dates */ - - amdp = amandates_lookup(newp->amname); - - newp->est[0].dumpsince = EPOCH; - for(dumplev = 0; dumplev < DUMP_LEVELS; dumplev++) { - dumpdate = amdp->dates[dumplev]; - for(estlev = dumplev+1; estlev < DUMP_LEVELS; estlev++) { - if(dumpdate > newp->est[estlev].dumpsince) - newp->est[estlev].dumpsince = dumpdate; + if (need_amandates) { + amdp = amandates_lookup(newp->dle->disk); + + newp->est[0].dumpsince = EPOCH; + for(dumplev = 0; dumplev < DUMP_LEVELS; dumplev++) { + dumpdate = amdp->dates[dumplev]; + for(estlev = dumplev+1; estlev < DUMP_LEVELS; estlev++) { + if(dumpdate > newp->est[estlev].dumpsince) + newp->est[estlev].dumpsince = dumpdate; + } + } + } else { + /* just zero everything out */ + for(dumplev = 0; dumplev < DUMP_LEVELS; dumplev++) { + newp->est[dumplev].dumpsince = 0; } } } @@ -618,21 +671,12 @@ void free_estimates( disk_estimates_t * est) { - amfree(est->amname); amfree(est->qamname); - amfree(est->amdevice); amfree(est->qamdevice); amfree(est->dirname); amfree(est->qdirname); - amfree(est->program); - if(est->options) { - free_sl(est->options->exclude_file); - free_sl(est->options->exclude_list); - free_sl(est->options->include_file); - free_sl(est->options->include_list); - amfree(est->options->str); - amfree(est->options->auth); - amfree(est->options); + if(est->dle) { +/* free DLE */ } } @@ -645,38 +689,40 @@ void calc_estimates( disk_estimates_t * est) { - dbprintf(_("calculating for amname %s, dirname %s, spindle %d\n"), - est->qamname, est->qdirname, est->spindle); - - if(est->program_is_backup_api == 1) - backup_api_calc_estimate(est); + dbprintf(_("calculating for amname %s, dirname %s, spindle %d %s\n"), + est->qamname, est->qdirname, est->dle->spindle, est->dle->program); + + if(est->dle->program_is_application_api == 1) + application_api_calc_estimate(est); + else + if(est->dle->calcsize == 1) + if (est->dle->device[0] == '/' && est->dle->device[1] == '/') + dbprintf(_("Can't use CALCSIZE for samba estimate: %s %s\n"), + est->qamname, est->qdirname); + else + generic_calc_estimates(est); else #ifndef USE_GENERIC_CALCSIZE - if(strcmp(est->program, "DUMP") == 0) + if(strcmp(est->dle->program, "DUMP") == 0) dump_calc_estimates(est); else #endif #ifdef SAMBA_CLIENT - if (strcmp(est->program, "GNUTAR") == 0 && - est->amdevice[0] == '/' && est->amdevice[1] == '/') + if (strcmp(est->dle->program, "GNUTAR") == 0 && + est->dle->device[0] == '/' && est->dle->device[1] == '/') smbtar_calc_estimates(est); else #endif #ifdef GNUTAR - if (strcmp(est->program, "GNUTAR") == 0) + if (strcmp(est->dle->program, "GNUTAR") == 0) gnutar_calc_estimates(est); else #endif -#ifdef SAMBA_CLIENT - if (est->amdevice[0] == '/' && est->amdevice[1] == '/') - dbprintf(_("Can't use CALCSIZE for samba estimate: %s %s\n"), - est->qamname, est->qdirname); - else -#endif - generic_calc_estimates(est); + dbprintf(_("Invalid program: %s %s %s\n"), + est->qamname, est->qdirname, est->dle->program); dbprintf(_("done with amname %s dirname %s spindle %d\n"), - est->qamname, est->qdirname, est->spindle); + est->qamname, est->qdirname, est->dle->spindle); } /* @@ -685,51 +731,114 @@ calc_estimates( */ /* local functions */ -off_t getsize_dump(char *disk, char *amdevice, int level, option_t *options, - char **errmsg); -off_t getsize_smbtar(char *disk, char *amdevice, int level, option_t *options, - char **errmsg); -off_t getsize_gnutar(char *disk, char *amdevice, int level, - option_t *options, time_t dumpsince, char **errmsg); -off_t getsize_backup_api(char *program, char *disk, char *amdevice, int level, - option_t *options, time_t dumpsince, char **errmsg); +off_t getsize_dump(dle_t *dle, int level, char **errmsg); +off_t getsize_smbtar(dle_t *dle, int level, char **errmsg); +off_t getsize_gnutar(dle_t *dle, int level, time_t dumpsince, char **errmsg); +off_t getsize_star(dle_t *dle, int level, time_t dumpsince, char **errmsg); +off_t getsize_application_api(disk_estimates_t *est, int nb_level, + int *levels, backup_support_option_t *bsu); off_t handle_dumpline(char *str); double first_num(char *str); void -backup_api_calc_estimate( +application_api_calc_estimate( disk_estimates_t * est) { int level; - off_t size; - char *errmsg = NULL, *qerrmsg; + int i; + int levels[DUMP_LEVELS]; + int nb_level = 0; + backup_support_option_t *bsu; + GPtrArray *errarray; + + bsu = backup_support_option(est->dle->program, g_options, est->dle->disk, + est->dle->device, &errarray); + if (!bsu) { + guint i; + for (i=0; i < errarray->len; i++) { + char *line; + char *errmsg; + char *qerrmsg; + line = g_ptr_array_index(errarray, i); + if(am_has_feature(g_options->features, + fe_rep_sendsize_quoted_error)) { + errmsg = g_strdup_printf(_("Application '%s': %s"), + est->dle->program, line); + qerrmsg = quote_string(errmsg); + for (level = 0; level < DUMP_LEVELS; level++) { + if (est->est[level].needestimate) { + g_printf(_("%s %d ERROR %s\n"), + est->dle->disk, level, qerrmsg); + dbprintf(_("%s %d ERROR A %s\n"), + est->qamname, level, qerrmsg); + } + } + amfree(errmsg); + amfree(qerrmsg); + } + } + if (i == 0) { /* nothing in errarray */ + char *errmsg; + char *qerrmsg; + errmsg = g_strdup_printf( + _("Application '%s': cannon execute support command"), + est->dle->program); + qerrmsg = quote_string(errmsg); + for (level = 0; level < DUMP_LEVELS; level++) { + if (est->est[level].needestimate) { + g_printf(_("%s %d ERROR %s\n"), + est->dle->disk, level, qerrmsg); + dbprintf(_("%s %d ERROR %s\n"), + est->qamname, level, qerrmsg); + } + } + amfree(errmsg); + amfree(qerrmsg); + } + for (level = 0; level < DUMP_LEVELS; level++) { + est->est[level].needestimate = 0; + } + g_ptr_array_free(errarray, TRUE); + } for(level = 0; level < DUMP_LEVELS; level++) { if (est->est[level].needestimate) { - dbprintf(_("getting size via application API for %s %s level %d\n"), - est->qamname, est->qamdevice, level); - size = getsize_backup_api(est->program, est->amname, est->amdevice, - level, est->options, - est->est[level].dumpsince, &errmsg); + if (level > bsu->max_level) { + /* planner will not even consider this level */ + g_printf("%s %d SIZE %lld\n", est->qamname, level, + (long long)-2); + est->est[level].needestimate = 0; + } else if (est->dle->estimate == ES_SERVER) { + /* planner will consider this level, */ + /* but use a server-side estimate */ + g_printf("%s %d SIZE %lld\n", est->qamname, level, + (long long)-1); + est->est[level].needestimate = 0; + } else { + levels[nb_level++] = level; + } + } + } - amflock(1, "size"); + if (nb_level == 0) + return; - g_printf(_("%s %d SIZE %lld\n"), est->qamname, level, - (long long)size); - if (errmsg && errmsg[0] != '\0') { - if(am_has_feature(g_options->features, - fe_rep_sendsize_quoted_error)) { - qerrmsg = quote_string(errmsg); - dbprintf(_("errmsg is %s\n"), errmsg); - g_printf(_("%s %d ERROR %s\n"), - est->qamname, level, qerrmsg); - amfree(qerrmsg); - } - } - amfree(errmsg); - fflush(stdout); + if (bsu->multi_estimate) { + for (i=0;iqamname, est->qamdevice, levels[i]); + } + getsize_application_api(est, nb_level, levels, bsu); - amfunlock(1, "size"); + } else { + for(level = 0; level < DUMP_LEVELS; level++) { + if (est->est[level].needestimate) { + dbprintf( + _("getting size via application API for %s %s level %d\n"), + est->qamname, est->qamdevice, level); + levels[0] = level; + getsize_application_api(est, 1, levels, bsu); + } } } } @@ -758,6 +867,7 @@ generic_calc_estimates( amwait_t wait_status; char *errmsg = NULL, *qerrmsg; char tmppath[PATH_MAX]; + int len; cmd = vstralloc(amlibexecdir, "/", "calcsize", versionsuffix(), NULL); @@ -769,28 +879,25 @@ generic_calc_estimates( else my_argv[my_argc++] = stralloc("NOCONFIG"); - my_argv[my_argc++] = stralloc(est->calcprog); - - my_argv[my_argc++] = stralloc(est->amname); + my_argv[my_argc++] = stralloc(est->dle->program); + canonicalize_pathname(est->dle->disk, tmppath); + my_argv[my_argc++] = stralloc(tmppath); canonicalize_pathname(est->dirname, tmppath); my_argv[my_argc++] = stralloc(tmppath); + if (est->dle->exclude_file) + nb_exclude += est->dle->exclude_file->nb_element; + if (est->dle->exclude_list) + nb_exclude += est->dle->exclude_list->nb_element; + if (est->dle->include_file) + nb_include += est->dle->include_file->nb_element; + if (est->dle->include_list) + nb_include += est->dle->include_list->nb_element; - if(est->options->exclude_file) - nb_exclude += est->options->exclude_file->nb_element; - if(est->options->exclude_list) - nb_exclude += est->options->exclude_list->nb_element; - if(est->options->include_file) - nb_include += est->options->include_file->nb_element; - if(est->options->include_list) - nb_include += est->options->include_list->nb_element; - - if(nb_exclude > 0) - file_exclude = build_exclude(est->amname, - est->amdevice, est->options, 0); - if(nb_include > 0) - file_include = build_include(est->amname, - est->amdevice, est->options, 0); + if (nb_exclude > 0) + file_exclude = build_exclude(est->dle, 0); + if (nb_include > 0) + file_include = build_include(est->dle, 0); if(file_exclude) { my_argv[my_argc++] = stralloc("-X"); @@ -832,7 +939,8 @@ generic_calc_estimates( goto common_exit; } - calcpid = pipespawnv(cmd, STDERR_PIPE, &nullfd, &nullfd, &pipefd, my_argv); + calcpid = pipespawnv(cmd, STDERR_PIPE, 0, + &nullfd, &nullfd, &pipefd, my_argv); amfree(cmd); dumpout = fdopen(pipefd,"r"); @@ -840,12 +948,15 @@ generic_calc_estimates( error(_("Can't fdopen: %s"), strerror(errno)); /*NOTREACHED*/ } - match_expr = vstralloc(est->qamname," %d SIZE %lld", NULL); + match_expr = vstralloc(" %d SIZE %lld", NULL); + len = strlen(est->qamname); for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { long long size_ = (long long)0; - if (line[0] == '\0') + if (line[0] == '\0' || (int)strlen(line) <= len) continue; - if(sscanf(line, match_expr, &level, &size_) == 2) { + /* Don't use sscanf for est->qamname because it can have a '%'. */ + if (strncmp(line, est->qamname, len) == 0 && + sscanf(line+len, match_expr, &level, &size_) == 2) { g_printf("%s\n", line); /* write to amandad */ dbprintf(_("estimate size for %s level %d: %lld KB\n"), est->qamname, @@ -914,8 +1025,7 @@ dump_calc_estimates( if(est->est[level].needestimate) { dbprintf(_("getting size via dump for %s level %d\n"), est->qamname, level); - size = getsize_dump(est->amname, est->amdevice, - level, est->options, &errmsg); + size = getsize_dump(est->dle, level, &errmsg); amflock(1, "size"); @@ -952,8 +1062,7 @@ smbtar_calc_estimates( if(est->est[level].needestimate) { dbprintf(_("getting size via smbclient for %s level %d\n"), est->qamname, level); - size = getsize_smbtar(est->amname, est->amdevice, level, - est->options, &errmsg); + size = getsize_smbtar(est->dle, level, &errmsg); amflock(1, "size"); @@ -991,8 +1100,8 @@ gnutar_calc_estimates( if (est->est[level].needestimate) { dbprintf(_("getting size via gnutar for %s level %d\n"), est->qamname, level); - size = getsize_gnutar(est->amname, est->amdevice, level, - est->options, est->est[level].dumpsince, + size = getsize_gnutar(est->dle, level, + est->est[level].dumpsince, &errmsg); amflock(1, "size"); @@ -1084,10 +1193,8 @@ regex_scale_t re_size[] = { off_t getsize_dump( - char *disk, - char *amdevice, + dle_t *dle, int level, - option_t *options G_GNUC_UNUSED, char **errmsg) { int pipefd[2], nullfd, stdoutfd, killctl[2]; @@ -1104,7 +1211,7 @@ getsize_dump( char level_str[NUM_STR_SIZE]; int s; times_t start_time; - char *qdisk = quote_string(disk); + char *qdisk = quote_string(dle->disk); char *qdevice; char *config; amwait_t wait_status; @@ -1112,11 +1219,17 @@ getsize_dump( int is_rundump = 1; #endif + if (level > 9) + return -2; /* planner will not even consider this level */ + if (dle->estimate == ES_SERVER) + return -1; /* planner will consider this level, */ + /* but use a server-side estimate */ + g_snprintf(level_str, SIZEOF(level_str), "%d", level); - device = amname_to_devname(amdevice); + device = amname_to_devname(dle->device); qdevice = quote_string(device); - fstype = amname_to_fstype(amdevice); + fstype = amname_to_fstype(dle->device); dbprintf(_("calculating for device %s with %s\n"), qdevice, fstype); @@ -1455,7 +1568,7 @@ getsize_dump( cmd, name); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s%s problem -- is \"%s\" really empty?\n"), - cmd, name, disk); + cmd, name, dle->disk); dbprintf(".....\n"); } else { dbprintf(_("estimate size for %s level %d: %lld KB\n"), @@ -1536,10 +1649,8 @@ getsize_dump( #ifdef SAMBA_CLIENT off_t getsize_smbtar( - char *disk, - char *amdevice, + dle_t *dle, int level, - option_t *options, char **errmsg) { int pipefd = -1, nullfd = -1, passwdfd = -1; @@ -1555,14 +1666,18 @@ getsize_smbtar( char *pw_fd_env; times_t start_time; char *error_pn = NULL; - char *qdisk = quote_string(disk); + char *qdisk = quote_string(dle->disk); amwait_t wait_status; - (void)options; /* Quiet unused parameter warning */ - error_pn = stralloc2(get_pname(), "-smbclient"); - parsesharename(amdevice, &share, &subdir); + if (level > 1) + return -2; /* planner will not even consider this level */ + if (dle->estimate == ES_SERVER) + return -1; /* planner will consider this level, */ + /* but use a server-side estimate */ + + parsesharename(dle->device, &share, &subdir); if (!share) { amfree(share); amfree(subdir); @@ -1587,7 +1702,7 @@ getsize_smbtar( } set_pname(error_pn); amfree(error_pn); - error(_("cannot find password for %s"), disk); + error(_("cannot find password for %s"), dle->disk); /*NOTREACHED*/ } lpass = strlen(user_and_password); @@ -1600,7 +1715,7 @@ getsize_smbtar( } set_pname(error_pn); amfree(error_pn); - error(_("password field not \'user%%pass\' for %s"), disk); + error(_("password field not \'user%%pass\' for %s"), dle->disk); /*NOTREACHED*/ } *pwtext++ = '\0'; @@ -1651,7 +1766,7 @@ getsize_smbtar( } else { pw_fd_env = "dummy_PASSWD_FD"; } - dumppid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, + dumppid = pipespawn(SAMBA_CLIENT, STDERR_PIPE|PASSWD_PIPE, 0, &nullfd, &nullfd, &pipefd, pw_fd_env, &passwdfd, "smbclient", @@ -1673,7 +1788,7 @@ getsize_smbtar( amfree(domain); } aclose(nullfd); - if(pwtext_len > 0 && fullwrite(passwdfd, pwtext, (size_t)pwtext_len) < 0) { + if(pwtext_len > 0 && full_write(passwdfd, pwtext, pwtext_len) < pwtext_len) { int save_errno = errno; memset(user_and_password, '\0', (size_t)lpass); @@ -1730,7 +1845,7 @@ getsize_smbtar( dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), - SAMBA_CLIENT, disk); + SAMBA_CLIENT, dle->disk); dbprintf(".....\n"); } dbprintf(_("estimate size for %s level %d: %lld KB\n"), @@ -1772,10 +1887,8 @@ getsize_smbtar( #ifdef GNUTAR off_t getsize_gnutar( - char *disk, - char *amdevice, + dle_t *dle, int level, - option_t *options, time_t dumpsince, char **errmsg) { @@ -1803,18 +1916,24 @@ getsize_gnutar( int infd, outfd; ssize_t nb; char buf[32768]; - char *qdisk = quote_string(disk); + char *qdisk = quote_string(dle->disk); char *gnutar_list_dir; amwait_t wait_status; char tmppath[PATH_MAX]; - if(options->exclude_file) nb_exclude += options->exclude_file->nb_element; - if(options->exclude_list) nb_exclude += options->exclude_list->nb_element; - if(options->include_file) nb_include += options->include_file->nb_element; - if(options->include_list) nb_include += options->include_list->nb_element; + if (level > 9) + return -2; /* planner will not even consider this level */ + if (dle->estimate == ES_SERVER) + return -1; /* planner will consider this level, */ + /* but use a server-side estimate */ + + if(dle->exclude_file) nb_exclude += dle->exclude_file->nb_element; + if(dle->exclude_list) nb_exclude += dle->exclude_list->nb_element; + if(dle->include_file) nb_include += dle->include_file->nb_element; + if(dle->include_list) nb_include += dle->include_list->nb_element; - if(nb_exclude > 0) file_exclude = build_exclude(disk, amdevice, options, 0); - if(nb_include > 0) file_include = build_include(disk, amdevice, options, 0); + if(nb_exclude > 0) file_exclude = build_exclude(dle, 0); + if(nb_include > 0) file_include = build_include(dle, 0); my_argv = alloc(SIZEOF(char *) * 22); i = 0; @@ -1825,7 +1944,7 @@ getsize_gnutar( if (gnutar_list_dir) { char number[NUM_STR_SIZE]; int baselevel; - char *sdisk = sanitise_filename(disk); + char *sdisk = sanitise_filename(dle->disk); basename = vstralloc(gnutar_list_dir, "/", @@ -1876,7 +1995,7 @@ getsize_gnutar( } while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) { - if (fullwrite(outfd, &buf, (size_t)nb) < nb) { + if (full_write(outfd, &buf, (size_t)nb) < (size_t)nb) { *errmsg = vstrallocf(_("writing to %s: %s"), incrname, strerror(errno)); dbprintf("%s\n", *errmsg); @@ -1914,7 +2033,7 @@ getsize_gnutar( gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); - dirname = amname_to_dirname(amdevice); + dirname = amname_to_dirname(dle->device); cmd = vstralloc(amlibexecdir, "/", "runtar", versionsuffix(), NULL); my_argv[i++] = "runtar"; @@ -1931,6 +2050,9 @@ getsize_gnutar( my_argv[i++] = "--create"; my_argv[i++] = "--file"; my_argv[i++] = "/dev/null"; + /* use --numeric-owner for estimates, to reduce the number of user/group + * lookups required */ + my_argv[i++] = "--numeric-owner"; my_argv[i++] = "--directory"; canonicalize_pathname(dirname, tmppath); my_argv[i++] = tmppath; @@ -1978,7 +2100,8 @@ getsize_gnutar( goto common_exit; } - dumppid = pipespawnv(cmd, STDERR_PIPE, &nullfd, &nullfd, &pipefd, my_argv); + dumppid = pipespawnv(cmd, STDERR_PIPE, 0, + &nullfd, &nullfd, &pipefd, my_argv); dumpout = fdopen(pipefd,"r"); if (!dumpout) { @@ -2019,7 +2142,7 @@ getsize_gnutar( dbprintf(".....\n"); } else if(size == (off_t)0 && level == 0) { dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), - my_argv[0], disk); + my_argv[0], dle->disk); dbprintf(".....\n"); } dbprintf(_("estimate size for %s level %d: %lld KB\n"), @@ -2072,48 +2195,47 @@ common_exit: #endif off_t -getsize_backup_api( - char *program, - char *disk, - char *amdevice, - int level, - option_t *options, - time_t dumpsince, - char **errmsg) +getsize_application_api( + disk_estimates_t *est, + int nb_level, + int *levels, + backup_support_option_t *bsu) { - int pipeinfd[2], pipeoutfd[2], nullfd; + dle_t *dle = est->dle; + int pipeinfd[2], pipeoutfd[2], pipeerrfd[2]; pid_t dumppid; off_t size = (off_t)-1; - FILE *dumpout, *toolin; + FILE *dumpout; + FILE *dumperr; char *line = NULL; char *cmd = NULL; char *cmdline; - char dumptimestr[80]; - struct tm *gmtm; - int i, j; - char *argvchild[10]; + int i, j, k; + char **argvchild; char *newoptstr = NULL; off_t size1, size2; times_t start_time; - char *qdisk = quote_string(disk); - char *qamdevice = quote_string(amdevice); + char *qdisk = quote_string(dle->disk); + char *qamdevice = quote_string(dle->device); amwait_t wait_status; char levelstr[NUM_STR_SIZE]; - backup_support_option_t *bsu; + GSList *scriptlist; + script_t *script; + char *errmsg = NULL; - (void)options; - gmtm = gmtime(&dumpsince); - g_snprintf(dumptimestr, SIZEOF(dumptimestr), - "%04d-%02d-%02d %2d:%02d:%02d GMT", - gmtm->tm_year + 1900, gmtm->tm_mon+1, gmtm->tm_mday, - gmtm->tm_hour, gmtm->tm_min, gmtm->tm_sec); - - cmd = vstralloc(DUMPER_DIR, "/", program, NULL); - - bsu = backup_support_option(program, g_options, disk, amdevice); + cmd = vstralloc(APPLICATION_DIR, "/", dle->program, NULL); i=0; - argvchild[i++] = program; + k = application_property_argv_size(dle); + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + k += property_argv_size(script->result->proplist); + } + } + argvchild = g_new0(char *, 16 + k + DUMP_LEVELS*2); + argvchild[i++] = dle->program; argvchild[i++] = "estimate"; if (bsu->message_line == 1) { argvchild[i++] = "--message"; @@ -2128,43 +2250,54 @@ getsize_backup_api( argvchild[i++] = g_options->hostname; } argvchild[i++] = "--device"; - argvchild[i++] = amdevice; - if (disk && bsu->disk == 1) { + argvchild[i++] = dle->device; + if (dle->disk && bsu->disk == 1) { argvchild[i++] = "--disk"; - argvchild[i++] = disk; + argvchild[i++] = dle->disk; } - if (level <= bsu->max_level) { + for (j=0; j < nb_level; j++) { argvchild[i++] = "--level"; - g_snprintf(levelstr,SIZEOF(levelstr),"%d",level); - argvchild[i++] = levelstr; + g_snprintf(levelstr,SIZEOF(levelstr),"%d", levels[j]); + argvchild[i++] = stralloc(levelstr); + } + if (dle->calcsize && bsu->calcsize) { + argvchild[i++] = "--calcsize"; + } + + i += application_property_add_to_argv(&argvchild[i], dle, bsu); + + for (scriptlist = dle->scriptlist; scriptlist != NULL; + scriptlist = scriptlist->next) { + script = (script_t *)scriptlist->data; + if (script->result && script->result->proplist) { + i += property_add_to_argv(&argvchild[i], + script->result->proplist); + } } argvchild[i] = NULL; cmdline = stralloc(cmd); for(j = 1; j < i; j++) - cmdline = vstrextend(&cmdline, " ", argvchild[i], NULL); + cmdline = vstrextend(&cmdline, " ", argvchild[j], NULL); dbprintf("running: \"%s\"\n", cmdline); amfree(cmdline); - if ((nullfd = open("/dev/null", O_RDWR)) == -1) { - *errmsg = vstrallocf(_("Cannot access /dev/null : %s"), - strerror(errno)); - dbprintf("%s\n", *errmsg); + if (pipe(pipeerrfd) < 0) { + errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), + strerror(errno)); goto common_exit; } if (pipe(pipeinfd) < 0) { - *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"), - strerror(errno)); - dbprintf("%s\n", *errmsg); + errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), + strerror(errno)); goto common_exit; } if (pipe(pipeoutfd) < 0) { - *errmsg = vstrallocf(_("getsize_backup_api could create data pipes: %s"), - strerror(errno)); - dbprintf("%s\n", *errmsg); + errmsg = vstrallocf(_("getsize_application_api could not create data pipes: %s"), + strerror(errno)); goto common_exit; } @@ -2179,9 +2312,10 @@ getsize_backup_api( case 0: dup2(pipeinfd[0], 0); dup2(pipeoutfd[1], 1); - dup2(nullfd, 2); + dup2(pipeerrfd[1], 2); aclose(pipeinfd[1]); aclose(pipeoutfd[0]); + aclose(pipeerrfd[0]); safe_fd(-1, 0); execve(cmd, argvchild, safe_env()); @@ -2192,16 +2326,8 @@ getsize_backup_api( aclose(pipeinfd[0]); aclose(pipeoutfd[1]); - - toolin = fdopen(pipeinfd[1],"w"); - if (!toolin) { - error("Can't fdopen: %s", strerror(errno)); - /*NOTREACHED*/ - } - - output_tool_property(toolin, options); - fflush(toolin); - fclose(toolin); + aclose(pipeerrfd[1]); + aclose(pipeinfd[1]); dumpout = fdopen(pipeoutfd[0],"r"); if (!dumpout) { @@ -2212,69 +2338,102 @@ getsize_backup_api( for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) { long long size1_ = (long long)0; long long size2_ = (long long)0; + int level = 0; if (line[0] == '\0') continue; dbprintf("%s\n", line); - i = sscanf(line, "%lld %lld", &size1_, &size2_); + if (strncmp(line,"ERROR ", 6) == 0) { + char *errmsg, *qerrmsg; + + errmsg = stralloc(line+6); + qerrmsg = quote_string(errmsg); + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[0], qerrmsg); + amfree(qerrmsg); + continue; + } + i = sscanf(line, "%d %lld %lld", &level, &size1_, &size2_); + if (i != 3) { + i = sscanf(line, "%lld %lld", &size1_, &size2_); + level = levels[0]; + if (i != 2) { + char *errmsg, *qerrmsg; + + errmsg = vstrallocf(_("bad line %s"), line); + qerrmsg = quote_string(errmsg); + dbprintf(_("errmsg is %s\n"), errmsg); + g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[0], qerrmsg); + amfree(qerrmsg); + continue; + } + } size1 = (off_t)size1_; size2 = (off_t)size2_; - if(i == 2) { + if (size1 <= 0 || size2 <=0) + size = -1; + else if (size1 * size2 > 0) size = size1 * size2; - } - if(size > -1) { - amfree(line); - while ((line = agets(dumpout)) != NULL) { - if (line[0] != '\0') - break; - amfree(line); - } - if(line != NULL) { - dbprintf(_("%s\n"), line); + dbprintf(_("estimate size for %s level %d: %lld KB\n"), + qamdevice, + level, + (long long)size); + g_printf("%s %d SIZE %lld\n", est->qamname, level, (long long)size); + } + amfree(line); + + dumperr = fdopen(pipeerrfd[0],"r"); + if (!dumperr) { + error(_("Can't fdopen: %s"), strerror(errno)); + /*NOTREACHED*/ + } + + while ((line = agets(dumperr)) != NULL) { + if (strlen(line) > 0) { + char *err = g_strdup_printf(_("Application '%s': %s"), + dle->program, line); + char *qerr = quote_string(err); + for (j=0; j < nb_level; j++) { + fprintf(stdout, "%s %d ERROR %s\n", + est->qamname, levels[j], qerr); } - break; + dbprintf("ERROR %s", qerr); + amfree(err); + amfree(qerr); } + amfree(line); } - amfree(line); dbprintf(".....\n"); - dbprintf(_("estimate time for %s level %d: %s\n"), qamdevice, level, - walltime_str(timessub(curclock(), start_time))); - if(size == (off_t)-1) { - *errmsg = vstrallocf(_("no size line match in %s output"), cmd); - dbprintf(_("%s for %s\n"), cmd, qdisk); - dbprintf(".....\n"); - } else if(size == (off_t)0 && level == 0) { - dbprintf(_("possible %s problem -- is \"%s\" really empty?\n"), - cmd, qdisk); - dbprintf(".....\n"); + if (nb_level == 1) { + dbprintf(_("estimate time for %s level %d: %s\n"), qamdevice, + levels[0], walltime_str(timessub(curclock(), start_time))); + } else { + dbprintf(_("estimate time for %s all level: %s\n"), qamdevice, + walltime_str(timessub(curclock(), start_time))); } - dbprintf(_("estimate size for %s level %d: %lld KB\n"), - qamdevice, - level, - (long long)size); kill(-dumppid, SIGTERM); dbprintf(_("waiting for %s \"%s\" child\n"), cmd, qdisk); waitpid(dumppid, &wait_status, 0); if (WIFSIGNALED(wait_status)) { - *errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), - cmd, WTERMSIG(wait_status), dbfn()); + errmsg = vstrallocf(_("%s terminated with signal %d: see %s"), + cmd, WTERMSIG(wait_status), dbfn()); } else if (WIFEXITED(wait_status)) { if (WEXITSTATUS(wait_status) != 0) { - *errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd, - WEXITSTATUS(wait_status), dbfn()); + errmsg = vstrallocf(_("%s exited with status %d: see %s"), cmd, + WEXITSTATUS(wait_status), dbfn()); } else { /* Normal exit */ } } else { - *errmsg = vstrallocf(_("%s got bad exit: see %s"), - cmd, dbfn()); + errmsg = vstrallocf(_("%s got bad exit: see %s"), + cmd, dbfn()); } dbprintf(_("after %s %s wait\n"), cmd, qdisk); - aclose(nullfd); afclose(dumpout); + afclose(dumperr); common_exit: @@ -2282,6 +2441,15 @@ common_exit: amfree(newoptstr); amfree(qdisk); amfree(qamdevice); + if (errmsg) { + char *qerrmsg = quote_string(errmsg); + dbprintf(_("errmsg is %s\n"), errmsg); + for (j=0; j < nb_level; j++) { + g_printf(_("%s %d ERROR %s\n"), est->qamname, levels[j], qerrmsg); + } + amfree(errmsg); + amfree(qerrmsg); + } return size; } diff --git a/common-src/Makefile.am b/common-src/Makefile.am index 91a42a1..daaf7b4 100644 --- a/common-src/Makefile.am +++ b/common-src/Makefile.am @@ -19,6 +19,7 @@ libamanda_la_SOURCES = \ alloc.c \ amfeatures.c \ amflock.c \ + amxml.c \ clock.c \ columnar.c \ conffile.c \ @@ -32,14 +33,16 @@ libamanda_la_SOURCES = \ packet.c \ pipespawn.c \ protocol.c \ + queueing.c \ + semaphore.c \ security.c \ security-util.c \ + simpleprng.c \ sl.c \ sockaddr-util.c \ stream.c \ tapelist.c \ timestamp.c \ - token.c \ util.c \ versuff.c # version.c is generated; see below @@ -94,6 +97,7 @@ libamanda_la_LDFLAGS = -release $(VERSION) noinst_HEADERS = \ amanda.h \ amfeatures.h \ + amxml.h \ arglist.h \ clock.h \ columnar.h \ @@ -109,14 +113,16 @@ noinst_HEADERS = \ pipespawn.h \ protocol.h \ queue.h \ + queueing.h \ + semaphore.h \ security.h \ security-util.h \ + simpleprng.h \ sl.h \ sockaddr-util.h \ stream.h \ tapelist.h \ timestamp.h \ - token.h \ util.h \ version.h @@ -150,7 +156,7 @@ version.c: genversion$(EXEEXT) BUILT_SOURCES += genversion.h version.c # these are used for testing only: -TEST_PROGS = token file bsdsecurity amfeatures +TEST_PROGS = file bsdsecurity amfeatures CLEANFILES += *.test.c DISTCLEANFILES += version.c genversion genversion.h @@ -169,9 +175,6 @@ STANDARD_COMMON_STUFF = \ $(STANDARD_COMMON_STUFF_NOT_FILE) \ file.lo -token_SOURCES = token.test.c -token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) - file_SOURCES = file.test.c file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE) @@ -191,20 +194,52 @@ bsdsecurity_LDADD = $(libamanda_a_LIBADD) \ amfeatures_SOURCES = amfeatures.test.c amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) +# libtestutils.la +# +# Convenience library (never installed) for 'make check'-based tests. + +noinst_LTLIBRARIES = libtestutils.la +libtestutils_la_SOURCES = \ + testutils.c \ + testutils.h + # automake-style tests -TESTS = amflock-test +# automake-style tests + +TESTS = amflock-test event-test semaphore-test queueing-test quoting-test noinst_PROGRAMS = $(TESTS) amflock_test_SOURCES = amflock-test.c -amflock_test_LDADD = libamanda.la +amflock_test_LDADD = libamanda.la libtestutils.la + +event_test_SOURCES = event-test.c +event_test_LDADD = libamanda.la libtestutils.la + +semaphore_test_SOURCES = semaphore-test.c +semaphore_test_LDADD = libamanda.la libtestutils.la + +queueing_test_SOURCES = queueing-test.c +queueing_test_LDADD = libamanda.la libtestutils.la + +quoting_test_SOURCES = quoting-test.c +quoting_test_LDADD = libamanda.la libtestutils.la # scripts -# divide scripts up both by language and by destination directory. -sbin_SCRIPTS_PERL = \ +# divide scripts up both by language, by destination directory, and by whether they +# should get checked (stuff in *_SCRIPTS_* isn't syntax checked; this is necessary +# for perl scripts that use Amanda::* packages) +sbin_CHECK_PERL = \ amgpgcrypt \ - amcryptsimple + amcryptsimple \ + amgetconf +sbin_SCRIPTS_PERL = \ + $(sbin_CHECK_PERL) + +amlibexec_CHECK_PERL = +amlibexec_SCRIPTS_PERL = \ + $(amlibexec_CHECK_PERL) sbin_SCRIPTS_SHELL = \ amcrypt \ @@ -212,16 +247,17 @@ sbin_SCRIPTS_SHELL = \ amcrypt-ossl \ amcrypt-ossl-asym -amlibexec_SCRIPTS_PERL = +amlibexec_SCRIPTS_SHELL = SCRIPTS_INCLUDE = \ amanda-sh-lib.sh EXTRA_DIST += amanda-sh-lib.sh.in -CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) -SCRIPTS_PERL = $(CHECK_PERL) +CHECK_PERL = $(sbin_CHECK_PERL) $(amlibexec_CHECK_PERL) +SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL) + amlibexec_DATA = $(SCRIPTS_INCLUDE) amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL) sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL) @@ -246,3 +282,7 @@ listlibsrc: %.test.c: $(srcdir)/%.c echo '#define TEST' >$@ echo '#include "$<"' >>$@ + +distclean-local: + if test `cd $(srcdir) && pwd` != `pwd`; then rm -f svn-info.h; fi +MAINTAINERCLEANFILES+=svn-info.h diff --git a/common-src/Makefile.in b/common-src/Makefile.in index b88a973..b645793 100644 --- a/common-src/Makefile.in +++ b/common-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,7 +17,7 @@ # Makefile for Amanda library. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -32,14 +32,14 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -54,8 +54,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -66,7 +66,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -76,12 +80,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -125,7 +132,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -135,7 +142,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -168,24 +183,28 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(top_srcdir)/config/automake/precompile.am \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am -@WANT_AMFLOCK_POSIX_TRUE@am__append_1 = amflock-posix.c -@WANT_AMFLOCK_FLOCK_TRUE@am__append_2 = amflock-flock.c -@WANT_AMFLOCK_LOCKF_TRUE@am__append_3 = amflock-lockf.c -@WANT_AMFLOCK_LNLOCK_TRUE@am__append_4 = amflock-lnlock.c -@WANT_RSH_SECURITY_TRUE@am__append_5 = rsh-security.c -@WANT_SSH_SECURITY_TRUE@am__append_6 = ssh-security.c -@WANT_BSD_SECURITY_TRUE@am__append_7 = bsd-security.c -@WANT_BSDTCP_SECURITY_TRUE@am__append_8 = bsdtcp-security.c -@WANT_BSDUDP_SECURITY_TRUE@am__append_9 = bsdudp-security.c -@WANT_KRB4_SECURITY_TRUE@am__append_10 = krb4-security.c -@WANT_KRB5_SECURITY_TRUE@am__append_11 = krb5-security.c +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) +@WANT_AMFLOCK_POSIX_TRUE@am__append_2 = amflock-posix.c +@WANT_AMFLOCK_FLOCK_TRUE@am__append_3 = amflock-flock.c +@WANT_AMFLOCK_LOCKF_TRUE@am__append_4 = amflock-lockf.c +@WANT_AMFLOCK_LNLOCK_TRUE@am__append_5 = amflock-lnlock.c +@WANT_RSH_SECURITY_TRUE@am__append_6 = rsh-security.c +@WANT_SSH_SECURITY_TRUE@am__append_7 = ssh-security.c +@WANT_BSD_SECURITY_TRUE@am__append_8 = bsd-security.c +@WANT_BSDTCP_SECURITY_TRUE@am__append_9 = bsdtcp-security.c +@WANT_BSDUDP_SECURITY_TRUE@am__append_10 = bsdudp-security.c +@WANT_KRB4_SECURITY_TRUE@am__append_11 = krb4-security.c +@WANT_KRB5_SECURITY_TRUE@am__append_12 = krb5-security.c EXTRA_PROGRAMS = genversion$(EXEEXT) $(am__EXEEXT_1) -TESTS = amflock-test$(EXEEXT) +TESTS = amflock-test$(EXEEXT) event-test$(EXEEXT) \ + semaphore-test$(EXEEXT) queueing-test$(EXEEXT) \ + quoting-test$(EXEEXT) noinst_PROGRAMS = $(am__EXEEXT_2) subdir = common-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -219,6 +238,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -241,7 +261,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -269,7 +291,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -280,7 +301,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -304,17 +324,17 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)" amlibLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(amlib_LTLIBRARIES) +LTLIBRARIES = $(amlib_LTLIBRARIES) $(noinst_LTLIBRARIES) libamanda_la_DEPENDENCIES = ../gnulib/libgnu.la -am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c clock.c \ - columnar.c conffile.c debug.c dgram.c event.c file.c \ +am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c amxml.c \ + clock.c columnar.c conffile.c debug.c dgram.c event.c file.c \ fileheader.c glib-util.c match.c packet.c pipespawn.c \ - protocol.c security.c security-util.c sl.c sockaddr-util.c \ - stream.c tapelist.c timestamp.c token.c util.c versuff.c \ - amflock-posix.c amflock-flock.c amflock-lockf.c \ - amflock-lnlock.c rsh-security.c ssh-security.c bsd-security.c \ - bsdtcp-security.c bsdudp-security.c krb4-security.c \ - krb5-security.c local-security.c + protocol.c queueing.c semaphore.c security.c security-util.c \ + simpleprng.c sl.c sockaddr-util.c stream.c tapelist.c \ + timestamp.c util.c versuff.c amflock-posix.c amflock-flock.c \ + amflock-lockf.c amflock-lnlock.c rsh-security.c ssh-security.c \ + bsd-security.c bsdtcp-security.c bsdudp-security.c \ + krb4-security.c krb5-security.c local-security.c @WANT_AMFLOCK_POSIX_TRUE@am__objects_1 = amflock-posix.lo @WANT_AMFLOCK_FLOCK_TRUE@am__objects_2 = amflock-flock.lo @WANT_AMFLOCK_LOCKF_TRUE@am__objects_3 = amflock-lockf.lo @@ -326,25 +346,29 @@ am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c clock.c \ @WANT_BSDUDP_SECURITY_TRUE@am__objects_9 = bsdudp-security.lo @WANT_KRB4_SECURITY_TRUE@am__objects_10 = krb4-security.lo @WANT_KRB5_SECURITY_TRUE@am__objects_11 = krb5-security.lo -am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo clock.lo \ - columnar.lo conffile.lo debug.lo dgram.lo event.lo file.lo \ - fileheader.lo glib-util.lo match.lo packet.lo pipespawn.lo \ - protocol.lo security.lo security-util.lo sl.lo \ - sockaddr-util.lo stream.lo tapelist.lo timestamp.lo token.lo \ - util.lo versuff.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) $(am__objects_4) $(am__objects_5) \ - $(am__objects_6) $(am__objects_7) $(am__objects_8) \ - $(am__objects_9) $(am__objects_10) $(am__objects_11) \ - local-security.lo +am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo amxml.lo \ + clock.lo columnar.lo conffile.lo debug.lo dgram.lo event.lo \ + file.lo fileheader.lo glib-util.lo match.lo packet.lo \ + pipespawn.lo protocol.lo queueing.lo semaphore.lo security.lo \ + security-util.lo simpleprng.lo sl.lo sockaddr-util.lo \ + stream.lo tapelist.lo timestamp.lo util.lo versuff.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_7) $(am__objects_8) $(am__objects_9) \ + $(am__objects_10) $(am__objects_11) local-security.lo nodist_libamanda_la_OBJECTS = version.lo libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS) \ $(nodist_libamanda_la_OBJECTS) libamanda_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamanda_la_LDFLAGS) $(LDFLAGS) -o $@ -am__EXEEXT_1 = token$(EXEEXT) file$(EXEEXT) bsdsecurity$(EXEEXT) \ - amfeatures$(EXEEXT) -am__EXEEXT_2 = amflock-test$(EXEEXT) +libtestutils_la_LIBADD = +am_libtestutils_la_OBJECTS = testutils.lo +libtestutils_la_OBJECTS = $(am_libtestutils_la_OBJECTS) +am__EXEEXT_1 = file$(EXEEXT) bsdsecurity$(EXEEXT) amfeatures$(EXEEXT) +am__EXEEXT_2 = amflock-test$(EXEEXT) event-test$(EXEEXT) \ + semaphore-test$(EXEEXT) queueing-test$(EXEEXT) \ + quoting-test$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_amfeatures_OBJECTS = amfeatures.test.$(OBJEXT) amfeatures_OBJECTS = $(am_amfeatures_OBJECTS) @@ -352,12 +376,15 @@ amfeatures_DEPENDENCIES = $(libamanda_la_LIBADD) \ $(STANDARD_COMMON_STUFF) am_amflock_test_OBJECTS = amflock-test.$(OBJEXT) amflock_test_OBJECTS = $(am_amflock_test_OBJECTS) -amflock_test_DEPENDENCIES = libamanda.la +amflock_test_DEPENDENCIES = libamanda.la libtestutils.la am_bsdsecurity_OBJECTS = bsd-security.test.$(OBJEXT) bsdsecurity_OBJECTS = $(am_bsdsecurity_OBJECTS) bsdsecurity_DEPENDENCIES = alloc.lo clock.lo debug.lo dgram.lo \ event.lo file.lo packet.lo security.lo ssh-security.lo \ versuff.lo +am_event_test_OBJECTS = event-test.$(OBJEXT) +event_test_OBJECTS = $(am_event_test_OBJECTS) +event_test_DEPENDENCIES = libamanda.la libtestutils.la am_file_OBJECTS = file.test.$(OBJEXT) file_OBJECTS = $(am_file_OBJECTS) file_DEPENDENCIES = $(libamanda_la_LIBADD) \ @@ -366,13 +393,19 @@ am_genversion_OBJECTS = genversion.$(OBJEXT) genversion_OBJECTS = $(am_genversion_OBJECTS) genversion_DEPENDENCIES = $(libamanda_la_LIBADD) versuff.lo \ ../gnulib/libgnu.la -am_token_OBJECTS = token.test.$(OBJEXT) -token_OBJECTS = $(am_token_OBJECTS) -token_DEPENDENCIES = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) +am_queueing_test_OBJECTS = queueing-test.$(OBJEXT) +queueing_test_OBJECTS = $(am_queueing_test_OBJECTS) +queueing_test_DEPENDENCIES = libamanda.la libtestutils.la +am_quoting_test_OBJECTS = quoting-test.$(OBJEXT) +quoting_test_OBJECTS = $(am_quoting_test_OBJECTS) +quoting_test_DEPENDENCIES = libamanda.la libtestutils.la +am_semaphore_test_OBJECTS = semaphore-test.$(OBJEXT) +semaphore_test_OBJECTS = $(am_semaphore_test_OBJECTS) +semaphore_test_DEPENDENCIES = libamanda.la libtestutils.la amlibexecSCRIPT_INSTALL = $(INSTALL_SCRIPT) sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -385,12 +418,17 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libamanda_la_SOURCES) $(nodist_libamanda_la_SOURCES) \ - $(amfeatures_SOURCES) $(amflock_test_SOURCES) \ - $(bsdsecurity_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \ - $(token_SOURCES) -DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) $(amfeatures_SOURCES) \ - $(amflock_test_SOURCES) $(bsdsecurity_SOURCES) $(file_SOURCES) \ - $(genversion_SOURCES) $(token_SOURCES) + $(libtestutils_la_SOURCES) $(amfeatures_SOURCES) \ + $(amflock_test_SOURCES) $(bsdsecurity_SOURCES) \ + $(event_test_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \ + $(queueing_test_SOURCES) $(quoting_test_SOURCES) \ + $(semaphore_test_SOURCES) +DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) \ + $(libtestutils_la_SOURCES) $(amfeatures_SOURCES) \ + $(amflock_test_SOURCES) $(bsdsecurity_SOURCES) \ + $(event_test_SOURCES) $(file_SOURCES) $(genversion_SOURCES) \ + $(queueing_test_SOURCES) $(quoting_test_SOURCES) \ + $(semaphore_test_SOURCES) amlibexecDATA_INSTALL = $(INSTALL_DATA) DATA = $(amlibexec_DATA) HEADERS = $(noinst_HEADERS) @@ -398,6 +436,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -412,8 +451,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -425,16 +466,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -448,6 +501,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -455,7 +509,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -468,6 +522,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -478,9 +533,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -490,6 +548,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -514,8 +573,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -524,11 +585,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -542,6 +607,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -550,9 +616,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -560,7 +627,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -569,8 +638,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -578,7 +649,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -587,10 +657,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -606,6 +678,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -622,6 +696,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -630,7 +706,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -666,26 +741,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -693,7 +779,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -703,6 +793,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -712,7 +803,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -721,6 +819,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -749,6 +848,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -767,6 +867,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -796,6 +898,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = @@ -808,8 +911,9 @@ CLEANFILES = config.log *.test.c # and we'll need to clean up our generated files for distclean DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ - version.c genversion genversion.h -MAINTAINERCLEANFILES = + $(SCRIPTS_INCLUDE) $(am__append_1) version.c genversion \ + genversion.h +MAINTAINERCLEANFILES = svn-info.h # syntax-check shell scripts on 'make check' CHECK_SHELL = $(SCRIPTS_SHELL) @@ -817,21 +921,41 @@ CHECK_SHELL = $(SCRIPTS_SHELL) # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" INCLUDES = -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) amlib_LTLIBRARIES = libamanda.la LINT = $(AMLINT) LINTFLAGS = $(AMLINTFLAGS) -libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c clock.c \ +libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c amxml.c clock.c \ columnar.c conffile.c debug.c dgram.c event.c file.c \ fileheader.c glib-util.c match.c packet.c pipespawn.c \ - protocol.c security.c security-util.c sl.c sockaddr-util.c \ - stream.c tapelist.c timestamp.c token.c util.c versuff.c \ - $(am__append_1) $(am__append_2) $(am__append_3) \ + protocol.c queueing.c semaphore.c security.c security-util.c \ + simpleprng.c sl.c sockaddr-util.c stream.c tapelist.c \ + timestamp.c util.c versuff.c $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_5) $(am__append_6) \ $(am__append_7) $(am__append_8) $(am__append_9) \ - $(am__append_10) $(am__append_11) local-security.c + $(am__append_10) $(am__append_11) $(am__append_12) \ + local-security.c # version.c is generated; see below nodist_libamanda_la_SOURCES = version.c libamanda_la_LIBADD = \ @@ -841,6 +965,7 @@ libamanda_la_LDFLAGS = -release $(VERSION) noinst_HEADERS = \ amanda.h \ amfeatures.h \ + amxml.h \ arglist.h \ clock.h \ columnar.h \ @@ -856,14 +981,16 @@ noinst_HEADERS = \ pipespawn.h \ protocol.h \ queue.h \ + queueing.h \ + semaphore.h \ security.h \ security-util.h \ + simpleprng.h \ sl.h \ sockaddr-util.h \ stream.h \ tapelist.h \ timestamp.h \ - token.h \ util.h \ version.h @@ -883,7 +1010,7 @@ genversion_LDADD = $(libamanda_la_LIBADD) \ # these are used for testing only: -TEST_PROGS = token file bsdsecurity amfeatures +TEST_PROGS = file bsdsecurity amfeatures # used for testing only STANDARD_COMMON_STUFF_NOT_FILE = \ @@ -898,8 +1025,6 @@ STANDARD_COMMON_STUFF = \ $(STANDARD_COMMON_STUFF_NOT_FILE) \ file.lo -token_SOURCES = token.test.c -token_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) file_SOURCES = file.test.c file_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF_NOT_FILE) bsdsecurity_SOURCES = bsd-security.test.c @@ -917,15 +1042,42 @@ bsdsecurity_LDADD = $(libamanda_a_LIBADD) \ amfeatures_SOURCES = amfeatures.test.c amfeatures_LDADD = $(libamanda_la_LIBADD) $(STANDARD_COMMON_STUFF) + +# libtestutils.la +# +# Convenience library (never installed) for 'make check'-based tests. +noinst_LTLIBRARIES = libtestutils.la +libtestutils_la_SOURCES = \ + testutils.c \ + testutils.h + amflock_test_SOURCES = amflock-test.c -amflock_test_LDADD = libamanda.la +amflock_test_LDADD = libamanda.la libtestutils.la +event_test_SOURCES = event-test.c +event_test_LDADD = libamanda.la libtestutils.la +semaphore_test_SOURCES = semaphore-test.c +semaphore_test_LDADD = libamanda.la libtestutils.la +queueing_test_SOURCES = queueing-test.c +queueing_test_LDADD = libamanda.la libtestutils.la +quoting_test_SOURCES = quoting-test.c +quoting_test_LDADD = libamanda.la libtestutils.la # scripts -# divide scripts up both by language and by destination directory. -sbin_SCRIPTS_PERL = \ +# divide scripts up both by language, by destination directory, and by whether they +# should get checked (stuff in *_SCRIPTS_* isn't syntax checked; this is necessary +# for perl scripts that use Amanda::* packages) +sbin_CHECK_PERL = \ amgpgcrypt \ - amcryptsimple + amcryptsimple \ + amgetconf + +sbin_SCRIPTS_PERL = \ + $(sbin_CHECK_PERL) + +amlibexec_CHECK_PERL = +amlibexec_SCRIPTS_PERL = \ + $(amlibexec_CHECK_PERL) sbin_SCRIPTS_SHELL = \ amcrypt \ @@ -933,12 +1085,12 @@ sbin_SCRIPTS_SHELL = \ amcrypt-ossl \ amcrypt-ossl-asym -amlibexec_SCRIPTS_PERL = +amlibexec_SCRIPTS_SHELL = SCRIPTS_INCLUDE = \ amanda-sh-lib.sh -CHECK_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) -SCRIPTS_PERL = $(CHECK_PERL) +CHECK_PERL = $(sbin_CHECK_PERL) $(amlibexec_CHECK_PERL) +SCRIPTS_PERL = $(sbin_SCRIPTS_PERL) $(amlibexec_SCRIPTS_PERL) SCRIPTS_SHELL = $(sbin_SCRIPTS_SHELL) $(amlibexec_SCRIPTS_SHELL) amlibexec_DATA = $(SCRIPTS_INCLUDE) amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL) @@ -990,8 +1142,8 @@ install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done @@ -999,8 +1151,8 @@ uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done clean-amlibLTLIBRARIES: @@ -1011,8 +1163,19 @@ clean-amlibLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done libamanda.la: $(libamanda_la_OBJECTS) $(libamanda_la_DEPENDENCIES) $(libamanda_la_LINK) -rpath $(amlibdir) $(libamanda_la_OBJECTS) $(libamanda_la_LIBADD) $(LIBS) +libtestutils.la: $(libtestutils_la_OBJECTS) $(libtestutils_la_DEPENDENCIES) + $(LINK) $(libtestutils_la_OBJECTS) $(libtestutils_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ @@ -1029,15 +1192,24 @@ amflock-test$(EXEEXT): $(amflock_test_OBJECTS) $(amflock_test_DEPENDENCIES) bsdsecurity$(EXEEXT): $(bsdsecurity_OBJECTS) $(bsdsecurity_DEPENDENCIES) @rm -f bsdsecurity$(EXEEXT) $(LINK) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS) +event-test$(EXEEXT): $(event_test_OBJECTS) $(event_test_DEPENDENCIES) + @rm -f event-test$(EXEEXT) + $(LINK) $(event_test_OBJECTS) $(event_test_LDADD) $(LIBS) file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) @rm -f file$(EXEEXT) $(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS) genversion$(EXEEXT): $(genversion_OBJECTS) $(genversion_DEPENDENCIES) @rm -f genversion$(EXEEXT) $(LINK) $(genversion_OBJECTS) $(genversion_LDADD) $(LIBS) -token$(EXEEXT): $(token_OBJECTS) $(token_DEPENDENCIES) - @rm -f token$(EXEEXT) - $(LINK) $(token_OBJECTS) $(token_LDADD) $(LIBS) +queueing-test$(EXEEXT): $(queueing_test_OBJECTS) $(queueing_test_DEPENDENCIES) + @rm -f queueing-test$(EXEEXT) + $(LINK) $(queueing_test_OBJECTS) $(queueing_test_LDADD) $(LIBS) +quoting-test$(EXEEXT): $(quoting_test_OBJECTS) $(quoting_test_DEPENDENCIES) + @rm -f quoting-test$(EXEEXT) + $(LINK) $(quoting_test_OBJECTS) $(quoting_test_LDADD) $(LIBS) +semaphore-test$(EXEEXT): $(semaphore_test_OBJECTS) $(semaphore_test_DEPENDENCIES) + @rm -f semaphore-test$(EXEEXT) + $(LINK) $(semaphore_test_OBJECTS) $(semaphore_test_LDADD) $(LIBS) install-amlibexecSCRIPTS: $(amlibexec_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(amlibexecdir)" || $(MKDIR_P) "$(DESTDIR)$(amlibexecdir)" @@ -1092,6 +1264,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-posix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflock.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amxml.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd-security.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdtcp-security.Plo@am__quote@ @@ -1101,6 +1274,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgram.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.test.Po@am__quote@ @@ -1114,17 +1288,22 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipespawn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quoting-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsh-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleprng.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ssh-security.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tapelist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timestamp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/versuff.Plo@am__quote@ @@ -1178,8 +1357,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -1191,8 +1370,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -1202,13 +1381,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -1363,18 +1541,16 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ - clean-noinstPROGRAMS mostlyclean-am + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-local distclean-tags dvi: dvi-am @@ -1407,7 +1583,7 @@ install-pdf: install-pdf-am install-ps: install-ps-am -installcheck-am: +installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) @@ -1434,16 +1610,17 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \ .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-local \ clean clean-amlibLTLIBRARIES clean-generic clean-libtool \ - clean-noinstPROGRAMS ctags dist-hook distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-amlibLTLIBRARIES \ - install-amlibexecDATA install-amlibexecSCRIPTS install-data \ - install-data-am install-data-hook install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-hook install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sbinSCRIPTS install-strip installcheck installcheck-am \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags dist-hook \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-local distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-amlibLTLIBRARIES install-amlibexecDATA \ + install-amlibexecSCRIPTS install-data install-data-am \ + install-data-hook install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \ + install-strip installcheck installcheck-am installcheck-local \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ @@ -1456,6 +1633,11 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \ %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -1481,13 +1663,27 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \ # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl check-shell: $(CHECK_SHELL) @CHECK_SHELL="$(CHECK_SHELL)"; \ if test -n "$$CHECK_SHELL"; then \ @@ -1525,52 +1721,40 @@ dist-scripts: true dist-hook: dist-scripts -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange @@ -1608,6 +1792,9 @@ listlibsrc: %.test.c: $(srcdir)/%.c echo '#define TEST' >$@ echo '#include "$<"' >>$@ + +distclean-local: + if test `cd $(srcdir) && pwd` != `pwd`; then rm -f svn-info.h; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/common-src/amaespipe.sh b/common-src/amaespipe.sh index 8d3aa1c..26953c6 100755 --- a/common-src/amaespipe.sh +++ b/common-src/amaespipe.sh @@ -1,6 +1,6 @@ #! @SHELL@ # -# Copyright (c) 2005 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -15,8 +15,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # prefix="@prefix@" diff --git a/common-src/amanda-sh-lib.sh.in b/common-src/amanda-sh-lib.sh.in index 0c82190..ab93255 100644 --- a/common-src/amanda-sh-lib.sh.in +++ b/common-src/amanda-sh-lib.sh.in @@ -19,7 +19,6 @@ STAR="@STAR@" SAMBA_CLIENT="@SAMBA_CLIENT@" GZIP="@GZIP@" SORT="@SORT@" -MAILER="@MAILER@" PERL="@PERL@" AWK="@AWK@" @@ -40,7 +39,7 @@ if test -n "$GETTEXT"; then _() { fmt=`$GETTEXT -d amanda "$1"` shift - printf "$fmt" $* + printf "$fmt" "$@" } else _() { diff --git a/common-src/amanda.h b/common-src/amanda.h index 9aa3d6a..ec06533 100644 --- a/common-src/amanda.h +++ b/common-src/amanda.h @@ -31,16 +31,16 @@ #ifndef AMANDA_H #define AMANDA_H -#include -#include - -#include "amflock.h" - #ifdef HAVE_CONFIG_H /* use a relative path here to avoid conflicting with Perl's config.h. */ #include "../config/config.h" #endif +#include +#include + +#include "amflock.h" + /* * Force large file source even if configure guesses wrong. */ @@ -71,9 +71,6 @@ * Also, some systems put key files in different places, so by including * everything here the rest of the system is isolated from such things. */ -#ifdef HAVE_ALLOCA_H -# include -#endif /* from the autoconf documentation */ #ifdef HAVE_DIRENT_H @@ -404,11 +401,6 @@ extern int errno; #define DISK_BLOCK_KB 32 #define DISK_BLOCK_BYTES (DISK_BLOCK_KB * 1024) -/* Maximum size of a tape block */ -/* MAX_TAPE_BLOCK_KB is defined in config.h */ -/* by configure --with-maxtapeblocksize */ -#define MAX_TAPE_BLOCK_BYTES (MAX_TAPE_BLOCK_KB*1024) - /* Maximum length of tape label, plus one for null-terminator. */ #define MAX_TAPE_LABEL_LEN (10240) #define MAX_TAPE_LABEL_BUF (MAX_TAPE_LABEL_LEN+1) @@ -494,6 +486,7 @@ char * validate_regexp(const char *regex); char * validate_glob(const char *glob); char * clean_regex(const char *regex); int match(const char *regex, const char *str); +int match_no_newline(const char *regex, const char *str); int match_glob(const char *glob, const char *str); char * glob_to_regex(const char *glob); int match_tar(const char *glob, const char *str); @@ -625,15 +618,15 @@ time_t unctime(char *timestr); #define NUM_STR_SIZE 128 /* a generic number buffer size */ #define skip_whitespace(ptr,c) do { \ - while((c) != '\n' && isspace((int)c)) (c) = *(ptr)++; \ + while((c) != '\n' && g_ascii_isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace(ptr,c) do { \ - while((c) != '\0' && !isspace((int)c)) (c) = *(ptr)++; \ + while((c) != '\0' && !g_ascii_isspace((int)c)) (c) = *(ptr)++; \ } while(0) #define skip_non_whitespace_cs(ptr,c) do { \ - while((c) != '\0' && (c) != '#' && !isspace((int)c)) (c) = *(ptr)++;\ + while((c) != '\0' && (c) != '#' && !g_ascii_isspace((int)c)) (c) = *(ptr)++;\ } while(0) #define skip_non_integer(ptr,c) do { \ @@ -647,11 +640,12 @@ time_t unctime(char *timestr); #define skip_quoted_string(ptr, c) do { \ int iq = 0; \ - while (((c) != '\0') && !((iq == 0) && isspace((int)c))) { \ + while (((c) != '\0') && !((iq == 0) && g_ascii_isspace((int)c))) { \ if ((c) == '"') { \ iq = !iq; \ - } else if (((c) == '\\') && (*(ptr) == '"')) { \ - (ptr)++; \ + } else if ((c) == '\\') { \ + if (*ptr) /* not last character */ \ + (ptr)++; \ } \ (c) = *(ptr)++; \ } \ @@ -677,7 +671,7 @@ time_t unctime(char *timestr); #define copy_string(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && !isspace((int)c)) { \ + while((c) != '\0' && !g_ascii_isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -693,7 +687,7 @@ time_t unctime(char *timestr); #define copy_string_cs(ptr,c,f,l,fp) do { \ (fp) = (f); \ - while((c) != '\0' && (c) != '#' && !isspace((int)c)) { \ + while((c) != '\0' && (c) != '#' && !g_ascii_isspace((int)c)) { \ if((fp) >= (f) + (l) - 1) { \ *(fp) = '\0'; \ (fp) = NULL; \ @@ -1076,6 +1070,9 @@ extern int vprintf(const char *format, va_list ap); /* gnulib-only includes (hence "" instead of <>) */ #include "getaddrinfo.h" #include "inet_ntop.h" +#include "safe-read.h" +#include "full-read.h" +#include "full-write.h" #if !defined(S_ISCHR) && defined(_S_IFCHR) && defined(_S_IFMT) #define S_ISCHR(mode) (((mode) & _S_IFMT) == _S_IFCHR) @@ -1181,68 +1178,6 @@ extern ssize_t writev(int fd, const struct iovec *iov, int iovcnt); # endif #endif -#if SIZEOF_OFF_T == 8 -# ifdef OFF_MAX -# define AM64_MAX (off_t)(OFF_MAX) -# else -# define AM64_MAX (off_t)(9223372036854775807LL) -# endif -# ifdef OFF_MIN -# define AM64_MIN (off_t)(OFF_MIN) -# else -# define AM64_MIN (off_t)(-9223372036854775807LL -1LL) -# endif -#else -#if SIZEOF_LONG == 8 -# ifdef LONG_MAX -# define AM64_MAX (off_t)(LONG_MAX) -# else -# define AM64_MAX (off_t)9223372036854775807L -# endif -# ifdef LONG_MIN -# define AM64_MIN (off_t)(LONG_MIN) -# else -# define AM64_MIN (off_t)(-9223372036854775807L -1L) -# endif -#else -#if SIZEOF_LONG_LONG == 8 -# ifdef LONG_LONG_MAX -# define AM64_MAX (off_t)(LONG_LONG_MAX) -# else -# define AM64_MAX (off_t)9223372036854775807LL -# endif -# ifdef LONG_LONG_MIN -# define AM64_MIN (off_t)(LONG_LONG_MIN) -# else -# define AM64_MIN (off_t)(-9223372036854775807LL -1LL) -# endif -#else -#if SIZEOF_INTMAX_T == 8 -# ifdef INTMAX_MAX -# define AM64_MAX (off_t)(INTMAX_MAX) -# else -# define AM64_MAX (off_t)9223372036854775807LL -# endif -# ifdef INTMAX_MIN -# define AM64_MIN (off_t)(INTMAX_MIN) -# else -# define AM64_MIN (off_t)(-9223372036854775807LL -1LL) -# endif -#else /* no 64 bits type found, use long. */ -# ifdef LONG_MAX -# define AM64_MAX (off_t)(LONG_MAX) -# else -# define AM64_MAX (off_t)2147483647 -# endif -# ifdef LONG_MIN -# define AM64_MIN (off_t)(LONG_MIN) -# else -# define AM64_MIN (off_t)(-2147483647 -1) -# endif -#endif -#endif -#endif -#endif #define BIND_CYCLE_RETRIES 120 /* Total of 30 minutes */ diff --git a/common-src/amcryptsimple.pl b/common-src/amcryptsimple.pl index 05e50e5..ef5b7d6 100755 --- a/common-src/amcryptsimple.pl +++ b/common-src/amcryptsimple.pl @@ -1,6 +1,6 @@ #!@PERL@ -w # -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -15,8 +15,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # diff --git a/common-src/amfeatures.c b/common-src/amfeatures.c index 675a647..5d03ed5 100644 --- a/common-src/amfeatures.c +++ b/common-src/amfeatures.c @@ -72,7 +72,7 @@ am_init_feature_set(void) am_add_feature(f, fe_program_dump); am_add_feature(f, fe_program_gnutar); - am_add_feature(f, fe_program_backup_api); + am_add_feature(f, fe_program_application_api); am_add_feature(f, fe_options_compress_fast); am_add_feature(f, fe_options_compress_best); @@ -147,6 +147,13 @@ am_init_feature_set(void) am_add_feature(f, fe_req_options_config); am_add_feature(f, fe_rep_sendsize_quoted_error); + am_add_feature(f, fe_req_xml); + am_add_feature(f, fe_pp_script); + am_add_feature(f, fe_amindexd_DLE); + am_add_feature(f, fe_amrecover_dle_in_header); + am_add_feature(f, fe_xml_estimate); + am_add_feature(f, fe_xml_property_priority); + am_add_feature(f, fe_sendsize_rep_warning); } return f; } @@ -426,7 +433,7 @@ am_string_to_feature( ch2 -= 'a'; ch2 += 10; } else { - amfree(f); /* bad conversion */ + am_release_feature_set(f); /* bad conversion */ break; } f->bytes[i] = (unsigned char)((ch1 << 4) | ch2); diff --git a/common-src/amfeatures.h b/common-src/amfeatures.h index 1398c64..4d007e8 100644 --- a/common-src/amfeatures.h +++ b/common-src/amfeatures.h @@ -93,7 +93,7 @@ typedef enum { fe_program_dump, fe_program_gnutar, - fe_program_backup_api, /* require fe_sendsize_req_options */ + fe_program_application_api, /* require fe_sendsize_req_options */ fe_options_compress_fast, fe_options_compress_best, @@ -172,6 +172,13 @@ typedef enum { fe_req_options_config, fe_rep_sendsize_quoted_error, + fe_req_xml, + fe_pp_script, // only in XML + fe_amindexd_DLE, + fe_amrecover_dle_in_header, + fe_xml_estimate, + fe_xml_property_priority, + fe_sendsize_rep_warning, /* * All new features must be inserted immediately *before* this entry. diff --git a/common-src/amflock-test.c b/common-src/amflock-test.c index 4becf5c..2c5b151 100644 --- a/common-src/amflock-test.c +++ b/common-src/amflock-test.c @@ -25,12 +25,16 @@ */ #include "amanda.h" +#include "testutils.h" /* from amflock.c */ extern amflock_impl_t *amflock_impls[]; -int -main(void) +/* Test all amflock implementations available for basic + * functionality + */ +static int +test_impls(void) { amflock_impl_t **imp = amflock_impls; char *filename = "./amflocktest.file"; @@ -43,43 +47,57 @@ main(void) _lnlock_dir = "."; while (*imp) { - g_fprintf(stderr, _("Testing amflock-%s\n"), (*imp)->impl_name); - alarm(5); /* time out after 5 seconds */ + tu_dbg("Testing amflock-%s\n", (*imp)->impl_name); for (lock_ro = 0; lock_ro < 2; lock_ro++) { /* false (0) or true (1) */ if (unlink(filename) == -1 && errno != ENOENT) { perror("unlink"); - return 1; + return 0; } if ((fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) { perror("open"); - return 1; + return 0; } if (lock_ro) { if ((*imp)->amroflock_impl(fd, resource) != 0) { perror("amroflock"); - return 1; + return 0; } } else { if ((*imp)->amflock_impl(fd, resource) != 0) { perror("amflock"); - return 1; + return 0; } } if ((*imp)->amfunlock_impl(fd, resource) != 0) { perror("amfunlock"); - return 1; + return 0; } close(fd); /* ignore error */ unlink(filename); /* ignore error */ } + fprintf(stderr, " PASS amflock-%s\n", (*imp)->impl_name); + imp++; } - return 0; + return 1; +} + +/* TODO: a more serious test of exclusion using multiple processes */ + +int +main(int argc, char **argv) +{ + static TestUtilsTest tests[] = { + TU_TEST(test_impls, 10), + TU_END() + }; + + return testutils_run_tests(argc, argv, tests); } diff --git a/common-src/amgetconf.pl b/common-src/amgetconf.pl new file mode 100644 index 0000000..86870e1 --- /dev/null +++ b/common-src/amgetconf.pl @@ -0,0 +1,303 @@ +#! @PERL@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use lib '@amperldir@'; +use strict; +use Amanda::Config qw( :getconf :init ); +use Amanda::Debug qw( :logging ); +use Amanda::Util qw( :constants ); +use Amanda::Paths; +use Amanda::Constants; +use Getopt::Long; + +# Implementation note: this application is a bit funny, because it does not +# set up Amanda fully until some time into processing. This lets it respond +# with build configuration information without a config file, and lets it set +# up debugging for the caller. +# +# The most obvious consequence is that, rather than calling die (which interfaces +# with Amanda::Debug), this file uses a locally defined 'fail' to print error +# messages. + +sub usage { + print < + (any ordering of options and arguments is acceptable) + +--client is equivalent to --execute-where client + +--execute-where tells amgetconf whether to operate on the client or the +server; the server is the default. + +paramname can be one of + dbopen.APPNAME -- open a debug file + dbclose.APPNAME:FILENAME -- close debug file FILENAME + build.PARAM -- get a build parameter + PARAM -- get an Amanda configuration parameter + +For all but Amanda configuration parameters, the option is +ignored, but must be present. For Amanda configuration parameters, +values in subsections are specified in the form TYPE:NAME:PARAMETER. + +With --list, PARAM can be one of +EOF + for my $name (keys %Amanda::Config::subsection_names) { + print " $name\n"; + } + exit(1); +} + +sub fail { + print STDERR @_, "\n"; + exit(1); +} + +sub no_such_param { + my ($parameter) = @_; + fail("amgetconf: no such parameter \"$parameter\""); +} + +## build parameters + +my %build_info = ( + # NOTE TO MAINTAINERS: + # If you add to this list, be sure to also add the new parameter + # amgetconf(8) manual page. Note that all keys are lower-case. + + ## directories from Amanda::Paths + + 'bindir' => $bindir, + 'sbindir' => $sbindir, + 'libexecdir' => $libexecdir, + 'amlibexecdir' => $amlibexecdir, + 'mandir' => $mandir, + 'amanda_tmpdir' => $AMANDA_TMPDIR, + 'config_dir' => $CONFIG_DIR, + 'amanda_dbgdir' => $AMANDA_DBGDIR, + 'application_dir' => $APPLICATION_DIR, + 'gnutar_listed_incremental_dir' => $GNUTAR_LISTED_INCREMENTAL_DIR, + 'listed_inc_dir' => $GNUTAR_LISTED_INCREMENTAL_DIR, # (historical alias) + + ## constants from Amanda::Constants + + # build environment info + + 'cc' => $Amanda::Constants::CC, + 'version' => $Amanda::Constants::VERSION, + 'assertions' => $Amanda::Constants::ASSERTIONS, + 'use_version_suffixes' => $Amanda::Constants::USE_VERSION_SUFFIXES, + 'locking' => $Amanda::Constants::LOCKING, + + # executable paths + + 'dump' => $Amanda::Constants::DUMP, + 'restore' => $Amanda::Constants::RESTORE, + 'vdump' => $Amanda::Constants::VDUMP, + 'vrestore' => $Amanda::Constants::VRESTORE, + 'xfsdump' => $Amanda::Constants::XFSDUMP, + 'xfsrestore' => $Amanda::Constants::XFSRESTORE, + 'vxdump' => $Amanda::Constants::VXDUMP, + 'vxrestore' => $Amanda::Constants::VXRESTORE, + 'samba_client' => $Amanda::Constants::SAMBA_CLIENT, + 'gnutar' => $Amanda::Constants::GNUTAR, + 'star' => $Amanda::Constants::STAR, + 'compress_path' => $Amanda::Constants::COMPRESS_PATH, + 'uncompress_path' => $Amanda::Constants::UNCOMPRESS_PATH, + 'aix_backup' => $Amanda::Constants::AIX_BACKUP, + 'dump_returns_1' => $Amanda::Constants::DUMP_RETURNS_1, + + # amanda modules + + 'bsd_security' => $Amanda::Constants::BSD_SECURITY, + 'bsdudp_security' => $Amanda::Constants::BSDUDP_SECURITY, + 'bsdtcp_security' => $Amanda::Constants::BSDTCP_SECURITY, + 'krb4_security' => $Amanda::Constants::KRB4_SECURITY, + 'krb5_security' => $Amanda::Constants::KRB5_SECURITY, + 'ssh_security' => $Amanda::Constants::SSH_SECURITY, + 'rsh_security' => $Amanda::Constants::RSH_SECURITY, + 'use_amandahosts' => $Amanda::Constants::USE_AMANDAHOSTS, + + # build-time constants + + 'amanda_debug_days' => $Amanda::Constants::AMANDA_DEBUG_DAYS, + 'default_server' => $Amanda::Constants::DEFAULT_SERVER, + 'default_amandates_file' => $Amanda::Constants::DEFAULT_AMANDATES_FILE, + 'default_config' => $Amanda::Constants::DEFAULT_CONFIG, + 'default_tape_server' => $Amanda::Constants::DEFAULT_TAPE_SERVER, + 'default_tape_device' => $Amanda::Constants::DEFAULT_TAPE_DEVICE, + 'client_login' => $Amanda::Constants::CLIENT_LOGIN, + 'use_rundump' => $Amanda::Constants::USE_RUNDUMP, + 'check_userid' => $Amanda::Constants::CHECK_USERID, + + # compression information + + 'compress_suffix' => $Amanda::Constants::COMPRESS_SUFFIX, + 'compress_fast_opt' => $Amanda::Constants::COMPRESS_FAST_OPT, + 'compress_best_opt' => $Amanda::Constants::COMPRESS_BEST_OPT, + 'uncompress_opt' => $Amanda::Constants::UNCOMPRESS_OPT, + + # kerberos information + + 'ticket_lifetime' => $Amanda::Constants::TICKET_LIFETIME, + 'server_host_principal' => $Amanda::Constants::SERVER_HOST_PRINCIPAL, + 'server_host_instance' => $Amanda::Constants::SERVER_HOST_INSTANCE, + 'server_host_key_file' => $Amanda::Constants::SERVER_HOST_KEY_FILE, + 'client_host_principal' => $Amanda::Constants::CLIENT_HOST_PRINCIPAL, + 'client_host_instance' => $Amanda::Constants::CLIENT_HOST_INSTANCE, + 'client_host_key_file' => $Amanda::Constants::CLIENT_HOST_KEY_FILE, + # (historical typos:) + 'server_host_principle' => $Amanda::Constants::SERVER_HOST_PRINCIPAL, + 'client_host_principle' => $Amanda::Constants::CLIENT_HOST_PRINCIPAL, + # (for testing purposes) + '__empty' => '', + +); + +sub build_param { + my ($parameter, $opt_list) = @_; + + if ($opt_list) { + usage() unless ($parameter eq "build"); + + for my $pname (sort keys %build_info) { + print "$pname\n"; + } + } else { + my ($pname) = $parameter =~ /^build\.(.*)/; + + my $val = $build_info{lc $pname}; + no_such_param($parameter) unless (defined($val)); + + print "$val\n"; + } +} + +## dbopen or dbclose + +sub db_param { + my ($parameter, $opt_list) = @_; + my ($appname, $filename); + if (($appname) = $parameter =~ /^dbopen\.(.*)/) { + $appname =~ s/[^[:alnum:]]/_/g; + Amanda::Util::setup_application($appname, "server", $CONTEXT_CMDLINE); + print Amanda::Debug::dbfn(), "\n"; + } elsif (($appname, $filename) = $parameter =~ /^dbclose\.([^:]*):(.*)/) { + fail("debug file $filename does not exist") unless (-f $filename); + Amanda::Debug::dbreopen($filename, ''); + Amanda::Debug::dbclose(); + print "$filename\n"; + } else { + fail("cannot parse $parameter"); + } +} + +## regular configuration parameters + +sub conf_param { + my ($parameter, $opt_list) = @_; + + if ($opt_list) { + # getconf_list will return an empty list for any unrecognized name, + # so first check that the user has supplied a real subsection + no_such_param($parameter) + unless defined($Amanda::Config::subsection_names{$parameter}); + my @list = getconf_list($parameter); + + for my $subsec (@list) { + print "$subsec\n"; + } + } else { + no_such_param($parameter) + unless defined(getconf_byname($parameter)); + my @strs = getconf_byname_strs($parameter, 0); + + for my $str (@strs) { + print "$str\n"; + } + } +} + +## Command-line parsing + +my $opt_list = ''; +my $config_overwrites = new_config_overwrites($#ARGV+1); +my $execute_where = undef; + +Getopt::Long::Configure(qw{bundling}); +GetOptions( + 'list|l' => \$opt_list, + 'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); }, + 'execute-where=s' => sub { + my $where = lc($_[1]); + fail("Invalid value ($_[1]) for --execute-where. Must be client or server.") + unless $where eq 'client' or $where eq 'server'; + fail("--execute-where=server conflicts with --execute-where=client or --client.") + unless !defined($execute_where) || ( + ($where eq 'client' && $execute_where) || + ($where eq 'server' && !$execute_where)); + $execute_where = ($where eq 'client')? $CONFIG_INIT_CLIENT : 0; + }, + 'client' => sub { + fail("--execute-where=server conflicts with --execute-where=client or --client.") + unless !defined($execute_where) || $execute_where; + $execute_where = $CONFIG_INIT_CLIENT; + } +) or usage(); + +my $config_name; +my $parameter; + +if (@ARGV == 1) { + $parameter = $ARGV[0]; +} elsif (@ARGV >= 2) { + # note that we ignore any arguments past these two. Amdump lazily passes + # such arguments on to us, so we have no choice. + $config_name = $ARGV[0]; + $parameter = $ARGV[1]; +} else { + usage(); +} + +## Now start looking at the parameter. + +if ($parameter =~ /^build(?:\..*)?/) { + build_param($parameter, $opt_list); + exit(0); +} + +if ($parameter =~ /^db(open|close)\./) { + db_param($parameter, $opt_list); + exit(0); +} + +# finally, finish up the application startup procedure +Amanda::Util::setup_application("amgetconf", "server", $CONTEXT_SCRIPTUTIL); +config_init($CONFIG_INIT_EXPLICIT_NAME | $CONFIG_INIT_USE_CWD | $execute_where, $config_name); +apply_config_overwrites($config_overwrites); +my ($cfgerr_level, @cfgerr_errors) = config_errors(); +if ($cfgerr_level >= $CFGERR_WARNINGS) { + config_print_errors(); + if ($cfgerr_level >= $CFGERR_ERRORS) { + die("errors processing config file"); + } +} + +Amanda::Util::finish_setup($RUNNING_AS_ANY); + +conf_param($parameter, $opt_list); diff --git a/common-src/amgpgcrypt.pl b/common-src/amgpgcrypt.pl index 2852670..e746c0e 100755 --- a/common-src/amgpgcrypt.pl +++ b/common-src/amgpgcrypt.pl @@ -1,6 +1,6 @@ #!@PERL@ -w # -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -15,8 +15,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # # Amanda has problem with gpg mdc(modification detection code) in the binary mode. diff --git a/common-src/amxml.c b/common-src/amxml.c new file mode 100644 index 0000000..b6e96c4 --- /dev/null +++ b/common-src/amxml.c @@ -0,0 +1,927 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* + * $Id: amxml.c 5151 2007-02-06 15:41:53Z martineau $ + * + * xml parsing of amanda protocol packet + */ + +#include "amanda.h" +#include "util.h" +#include "amxml.h" +#include "glib.h" +#include "conffile.h" +#include "base64.h" + +typedef struct amgxml_s { + dle_t *dles; + dle_t *dle; + GSList *element_names; + int has_calcsize; + int has_estimate; + int has_record; + int has_spindle; + int has_compress; + int has_encrypt; + int has_kencrypt; + int has_exclude; + int has_include; + int has_index; + int has_backup_program; + int has_plugin; + int has_optional; + char *property_name; + property_t *property_data; + proplist_t property; + script_t *script; + char *encoding; + char *raw; + +} amgxml_t; + + +dle_t * +alloc_dle(void) +{ + dle_t *dle; + + dle = malloc(sizeof(dle_t)); + init_dle(dle); + return dle; +} + +void +init_dle( + dle_t *dle) +{ + dle->disk = NULL; + dle->device = NULL; + dle->program_is_application_api = 0; + dle->program = NULL; + dle->calcsize = 0; + dle->estimate = 0; + dle->record = 1; + dle->spindle = 0; + dle->compress = COMP_NONE; + dle->encrypt = ENCRYPT_NONE; + dle->kencrypt = 0; + dle->level = NULL; + dle->dumpdate = NULL; + dle->compprog = NULL; + dle->srv_encrypt = NULL; + dle->clnt_encrypt = NULL; + dle->srv_decrypt_opt = NULL; + dle->clnt_decrypt_opt = NULL; + dle->create_index = 0; + dle->auth = NULL; + dle->exclude_file = NULL; + dle->exclude_list = NULL; + dle->include_file = NULL; + dle->include_list = NULL; + dle->exclude_optional = 0; + dle->include_optional = 0; + dle->application_property = NULL; + dle->scriptlist = NULL; + dle->next = NULL; +} + + +/* Called for open tags */ +static void amstart_element(GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + gpointer user_data, + GError **gerror); + +/* Called for close tags */ +static void amend_element(GMarkupParseContext *context, + const gchar *element_name, + gpointer user_data, + GError **gerror); + +/* Called for character data */ +/* text is not nul-terminated */ +static void amtext(GMarkupParseContext *context, + const gchar *text, + gsize text_len, + gpointer user_data, + GError **gerror); + +/* Called for open tags */ +static void +amstart_element( + G_GNUC_UNUSED GMarkupParseContext *context, + const gchar *element_name, + G_GNUC_UNUSED const gchar **attribute_names, + G_GNUC_UNUSED const gchar **attribute_values, + gpointer user_data, + GError **gerror) +{ + amgxml_t *data_user = user_data; + dle_t *adle; + GSList *last_element = data_user->element_names; + char *last_element_name = NULL; + dle_t *dle = data_user->dle; + const gchar **at_names, **at_values; + + if (last_element) + last_element_name = last_element->data; + + data_user->raw = NULL; + data_user->encoding = NULL; + + if (attribute_names) { + for(at_names = attribute_names, at_values = attribute_values; + *at_names != NULL && at_values != NULL; + at_names++, at_values++) { + if (strcmp(*at_names, "encoding") == 0) { + data_user->encoding = stralloc(*at_values); + } else if (strcmp(*at_names, "raw") == 0) { + data_user->raw = base64_decode_alloc_string((char *)*at_values); + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid attribute '%s' for %s element", + *at_names, element_name); + return; + } + } + } + + if (strcmp(element_name, "dle") == 0) { + if (last_element != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid dle element"); + return; + } + for(adle = data_user->dles; adle != NULL && adle->next != NULL; + adle = adle->next); + data_user->dle = alloc_dle(); + if (adle == NULL) { + data_user->dles = data_user->dle; + } else { + adle->next = data_user->dle; + } + data_user->has_calcsize = 0; + data_user->has_estimate = 0; + data_user->has_record = 0; + data_user->has_spindle = 0; + data_user->has_compress = 0; + data_user->has_encrypt = 0; + data_user->has_kencrypt = 0; + data_user->has_exclude = 0; + data_user->has_include = 0; + data_user->has_index = 0; + data_user->has_backup_program = 0; + data_user->has_plugin = 0; + data_user->has_optional = 0; + data_user->property_name = NULL; + data_user->property_data = NULL; + } else if(strcmp(element_name, "disk" ) == 0 || + strcmp(element_name, "diskdevice" ) == 0 || + strcmp(element_name, "calcsize" ) == 0 || + strcmp(element_name, "estimate" ) == 0 || + strcmp(element_name, "program" ) == 0 || + strcmp(element_name, "auth" ) == 0 || + strcmp(element_name, "index" ) == 0 || + strcmp(element_name, "dumpdate" ) == 0 || + strcmp(element_name, "level" ) == 0 || + strcmp(element_name, "record" ) == 0 || + strcmp(element_name, "spindle" ) == 0 || + strcmp(element_name, "compress" ) == 0 || + strcmp(element_name, "encrypt" ) == 0 || + strcmp(element_name, "kencrypt" ) == 0 || + strcmp(element_name, "exclude" ) == 0 || + strcmp(element_name, "include" ) == 0) { + if (strcmp(last_element_name, "dle") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if ((strcmp(element_name, "disk" ) == 0 && dle->disk) || + (strcmp(element_name, "diskdevice" ) == 0 && dle->device) || + (strcmp(element_name, "calcsize" ) == 0 && data_user->has_calcsize) || + (strcmp(element_name, "estimate" ) == 0 && data_user->has_estimate) || + (strcmp(element_name, "record" ) == 0 && data_user->has_record) || + (strcmp(element_name, "spindle" ) == 0 && data_user->has_spindle) || + (strcmp(element_name, "program" ) == 0 && dle->program) || + (strcmp(element_name, "auth" ) == 0 && dle->auth) || + (strcmp(element_name, "index" ) == 0 && data_user->has_index) || + (strcmp(element_name, "dumpdate" ) == 0 && dle->dumpdate) || + (strcmp(element_name, "compress" ) == 0 && data_user->has_compress) || + (strcmp(element_name, "encrypt" ) == 0 && data_user->has_encrypt) || + (strcmp(element_name, "kencrypt" ) == 0 && data_user->has_kencrypt) || + (strcmp(element_name, "exclude" ) == 0 && data_user->has_exclude) || + (strcmp(element_name, "include" ) == 0 && data_user->has_include)) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } + if (strcmp(element_name, "calcsize" ) == 0) data_user->has_calcsize = 1; + if (strcmp(element_name, "estimate" ) == 0) data_user->has_estimate = 1; + if (strcmp(element_name, "record" ) == 0) data_user->has_record = 1; + if (strcmp(element_name, "spindle" ) == 0) data_user->has_spindle = 1; + if (strcmp(element_name, "index" ) == 0) data_user->has_index = 1; + if (strcmp(element_name, "compress" ) == 0) data_user->has_compress = 1; + if (strcmp(element_name, "encrypt" ) == 0) data_user->has_encrypt = 1; + if (strcmp(element_name, "kencrypt" ) == 0) data_user->has_kencrypt = 1; + if (strcmp(element_name, "exclude" ) == 0) data_user->has_exclude = 1; + if (strcmp(element_name, "include" ) == 0) data_user->has_include = 1; + if (strcmp(element_name, "exclude") == 0 || strcmp(element_name, "include") == 0) + data_user->has_optional = 0; + } else if(strcmp(element_name, "custom-compress-program") == 0) { + if (strcmp(last_element_name, "compress") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if (dle->compprog) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } + } else if (strcmp(element_name, "custom-encrypt-program") == 0 || + strcmp(element_name, "decrypt-option") == 0) { + if (strcmp(last_element_name, "encrypt") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if (strcmp(element_name, "custom-encrypt-program") == 0 && + dle->clnt_encrypt) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } + if (strcmp(element_name, "decrypt-option") == 0 && + dle->clnt_decrypt_opt) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } + } else if(strcmp(element_name, "plugin") == 0) { + if (strcmp(last_element_name, "backup-program") != 0 && + strcmp(last_element_name, "script") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if (data_user->has_plugin) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element in '%s'", element_name, + last_element_name); + return; + } + } else if(strcmp(element_name, "property") == 0) { + if (strcmp(last_element_name, "backup-program") != 0 && + strcmp(last_element_name, "script") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + data_user->property_data = malloc(sizeof(property_t)); + data_user->property_data->append = 0; + data_user->property_data->priority = 0; + data_user->property_data->values = NULL; + } else if(strcmp(element_name, "name") == 0) { + if (strcmp(last_element_name, "property") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if (data_user->property_name) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element in '%s'", element_name, + last_element_name); + return; + } + } else if(strcmp(element_name, "priority") == 0) { + if (strcmp(last_element_name, "property") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + } else if(strcmp(element_name, "value") == 0) { + if (strcmp(last_element_name, "property") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + } else if(strcmp(element_name, "file") == 0 || + strcmp(element_name, "list") == 0 || + strcmp(element_name, "optional") == 0) { + if (strcmp(last_element_name, "exclude") != 0 && + strcmp(last_element_name, "include") != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + if (strcmp(element_name, "optional") == 0 && data_user->has_optional) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } + if (strcmp(element_name, "optional") == 0) data_user->has_optional = 1; + } else if (strcmp(element_name, "backup-program") == 0) { + if (data_user->has_backup_program) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Duplicate %s element", element_name); + return; + } else { + data_user->has_backup_program = 1; + data_user->property = + g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); + data_user->has_plugin = 0; + } + } else if (strcmp(element_name, "script") == 0) { + data_user->property = + g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); + data_user->script = malloc(sizeof(script_t)); + data_user->script->plugin = NULL; + data_user->script->execute_on = 0; + data_user->script->execute_where = ES_CLIENT; + data_user->script->property = NULL; + data_user->script->result = NULL; + data_user->has_plugin = 0; + } else if (strcmp(element_name, "execute_on") == 0) { + } else if (strcmp(element_name, "execute_where") == 0) { + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s element", element_name); + return; + } + data_user->element_names = g_slist_prepend(data_user->element_names, + stralloc(element_name)); +} + +/* Called for close tags */ +static void +amend_element( + G_GNUC_UNUSED GMarkupParseContext *context, + const gchar *element_name, + gpointer user_data, + GError **gerror) +{ + amgxml_t *data_user = user_data; + GSList *last_element = data_user->element_names; + char *last_element_name = NULL; + dle_t *dle = data_user->dle; + + if (!last_element) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid closing tag"); + return; + } + last_element_name = last_element->data; + if (strcmp(last_element_name, element_name) != 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid closing tag '%s'", element_name); + return; + } + + if (strcmp(element_name, "property") == 0) { + g_hash_table_insert(data_user->property, + data_user->property_name, + data_user->property_data); + data_user->property_name = NULL; + data_user->property_data = NULL; + } else if (strcmp(element_name, "dle") == 0) { + if (dle->disk == NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: No disk provided in DLE element"); + return; + } + if (dle->program_is_application_api && + !dle->program) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: program set to APPLICATION but no application set"); + return; + } + if (dle->device == NULL && dle->disk) + dle->device = stralloc(dle->disk); +/* Add check of required field */ + data_user->dle = NULL; + } else if (strcmp(element_name, "backup-program") == 0) { + if (dle->program == NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: No plugin set for application"); + return; + } + dle->application_property = data_user->property; + data_user->property = NULL; + } else if (strcmp(element_name, "script") == 0) { + if (data_user->script->plugin == NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: No plugin set for script"); + return; + } + data_user->script->property = data_user->property; + data_user->property = NULL; + dle->scriptlist = g_slist_append(dle->scriptlist, data_user->script); + data_user->script = NULL; + } + g_free(data_user->element_names->data); + data_user->element_names = g_slist_delete_link(data_user->element_names, + data_user->element_names); +} + +/* Called for character data */ +/* text is not nul-terminated */ +static void +amtext( + G_GNUC_UNUSED GMarkupParseContext *context, + const gchar *text, + gsize text_len, + gpointer user_data, + GError **gerror) +{ + char *tt; + amgxml_t *data_user = user_data; + GSList *last_element = data_user->element_names; + char *last_element_name; + GSList *last_element2; + char *last_element2_name; + dle_t *dle = data_user->dle; + int i; + + if (!last_element) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid text"); + return; + } + last_element_name = last_element->data; + + tt = malloc(text_len + 1); + strncpy(tt,text,text_len); + tt[text_len] = '\0'; + + //check if it is only space + if (match_no_newline("^[ \f\n\r\t\v]*$", tt)) { + amfree(tt); + return; + } + + if (data_user->raw) { + amfree(tt); + tt = stralloc(data_user->raw); + } + + //check if it is only space + if (match_no_newline("^[ \f\n\r\t\v]*$", tt)) { + amfree(tt); + return; + } + + if (strcmp(last_element_name, "dle") == 0 || + strcmp(last_element_name, "backup-program") == 0 || + strcmp(last_element_name, "exclude") == 0 || + strcmp(last_element_name, "include") == 0) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: %s doesn't have text '%s'", last_element_name, tt); + return; + } else if(strcmp(last_element_name, "disk") == 0) { + if (dle->disk != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + return; + } + dle->disk = tt; + } else if(strcmp(last_element_name, "diskdevice") == 0) { + if (dle->device != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + return; + } + dle->device = tt; + } else if(strcmp(last_element_name, "calcsize") == 0) { + if (strcasecmp(tt,"yes") == 0) { + dle->calcsize = 1; + } + amfree(tt); + } else if(strcmp(last_element_name, "estimate") == 0) { + if (strcasecmp(tt,"client") == 0) { + dle->estimate = ES_CLIENT; + } else if (strcasecmp(tt,"calcsize") == 0) { + dle->estimate = ES_CALCSIZE; + dle->calcsize = 1; + } else if (strcasecmp(tt,"server") == 0) { + dle->estimate = ES_SERVER; + } + amfree(tt); + } else if(strcmp(last_element_name, "program") == 0) { + if (dle->program != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + return; + } + dle->program = tt; + if (strcmp(tt, "APPLICATION") == 0) { + dle->program_is_application_api = 1; + dle->program = NULL; + } + } else if(strcmp(last_element_name, "plugin") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("Invalid name text"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "backup-program") == 0) { + dle->program = tt; + } else if (strcmp(last_element2_name, "script") == 0) { + data_user->script->plugin = tt; + } else { + error("plugin outside of backup-program"); + } + data_user->has_plugin = 1; + } else if(strcmp(last_element_name, "name") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("Invalid name text"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "property") == 0) { + data_user->property_name = tt; + } else { + error("name outside of property"); + } + } else if(strcmp(last_element_name, "priority") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("Invalid priority text"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "property") == 0) { + if (strcasecmp(tt,"yes") == 0) { + data_user->property_data->priority = 1; + } + } else { + error("priority outside of property"); + } + } else if(strcmp(last_element_name, "value") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("Invalid name text"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "property") == 0) { + data_user->property_data->values = + g_slist_append(data_user->property_data->values, tt); + } else { + error("value outside of property"); + } + } else if(strcmp(last_element_name, "auth") == 0) { + if (dle->auth != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + return; + } + dle->auth = tt; + } else if(strcmp(last_element_name, "level") == 0) { + dle->level = g_slist_append(dle->level, GINT_TO_POINTER(atoi(tt))); + amfree(tt); + } else if(strcmp(last_element_name, "index") == 0) { + if (strcasecmp(tt,"no") == 0) { + dle->create_index = 0; + } else if (strcasecmp(tt,"yes") == 0) { + dle->create_index = 1; + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s (%s)", last_element_name, tt); + amfree(tt); + return; + } + amfree(tt); + } else if(strcmp(last_element_name, "dumpdate") == 0) { + if (dle->dumpdate != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + amfree(tt); + return; + } + dle->dumpdate = tt; + } else if(strcmp(last_element_name, "record") == 0) { + if (strcasecmp(tt, "no") == 0) { + dle->record = 0; + } else if (strcasecmp(tt, "yes") == 0) { + dle->record = 1; + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s (%s)", last_element_name, tt); + return; + } + } else if(strcmp(last_element_name, "spindle") == 0) { + dle->spindle = atoi(tt); + } else if(strcmp(last_element_name, "compress") == 0) { + if (strcmp(tt, "FAST") == 0) { + dle->compress = COMP_FAST; + } else if (strcmp(tt, "BEST") == 0) { + dle->compress = COMP_BEST; + } else if (BSTRNCMP(tt, "CUSTOM") == 0) { + dle->compress = COMP_CUST; + } else if (strcmp(tt, "SERVER-FAST") == 0) { + dle->compress = COMP_SERVER_FAST; + } else if (strcmp(tt, "SERVER-BEST") == 0) { + dle->compress = COMP_SERVER_BEST; + } else if (BSTRNCMP(tt, "SERVER-CUSTOM") == 0) { + dle->compress = COMP_SERVER_CUST; + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s (%s)", last_element_name, tt); + amfree(tt); + return; + } + amfree(tt); + } else if(strcmp(last_element_name, "custom-compress-program") == 0) { + if (dle->compprog != NULL) { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: multiple text in %s", last_element_name); + amfree(tt); + return; + } + dle->compprog = tt; + } else if(strcmp(last_element_name, "encrypt") == 0) { + if (BSTRNCMP(tt,"NO") == 0) { + dle->encrypt = ENCRYPT_NONE; + } else if (BSTRNCMP(tt, "CUSTOM") == 0) { + dle->encrypt = ENCRYPT_CUST; + } else if (BSTRNCMP(tt, "SERVER-CUSTOM") == 0) { + dle->encrypt = ENCRYPT_SERV_CUST; + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s (%s)", last_element_name, tt); + amfree(tt); + return; + } + amfree(tt); + } else if(strcmp(last_element_name, "kencrypt") == 0) { + if (strcasecmp(tt,"no") == 0) { + dle->kencrypt = 0; + } else if (strcasecmp(tt,"yes") == 0) { + dle->kencrypt = 1; + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: Invalid %s (%s)", last_element_name, tt); + amfree(tt); + return; + } + amfree(tt); + } else if(strcmp(last_element_name, "custom-encrypt-program") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("XML: optional"); + } + last_element2_name = last_element2->data; + dle->clnt_encrypt = tt; + } else if(strcmp(last_element_name, "decrypt-option") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("XML: optional"); + } + last_element2_name = last_element2->data; + dle->clnt_decrypt_opt = tt; + } else if(strcmp(last_element_name, "exclude") == 0 || + strcmp(last_element_name, "include") == 0) { + data_user->has_optional = 0; + } else if(strcmp(last_element_name, "file") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("XML: optional"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "exclude") == 0) { + dle->exclude_file = append_sl(dle->exclude_file, tt); + } else if (strcmp(last_element2_name, "include") == 0) { + dle->include_file = append_sl(dle->include_file, tt); + } else { + error("bad file"); + } + } else if(strcmp(last_element_name, "list") == 0) { + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("XML: optional"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "exclude") == 0) { + dle->exclude_list = append_sl(dle->exclude_list, tt); + } else if (strcmp(last_element2_name, "include") == 0) { + dle->include_list = append_sl(dle->include_list, tt); + } else { + error("bad list"); + } + } else if(strcmp(last_element_name, "optional") == 0) { + i = atoi(tt); + last_element2 = g_slist_nth(data_user->element_names, 1); + if (!last_element2) { + error("XML: optional"); + } + last_element2_name = last_element2->data; + if (strcmp(last_element2_name, "exclude") == 0) { + dle->exclude_optional = 1; + } else if (strcmp(last_element2_name, "include") == 0) { + dle->include_optional = 1; + } else { + error("bad optional"); + } + data_user->has_optional = 1; + amfree(tt); + } else if(strcmp(last_element_name, "script") == 0) { + } else if(strcmp(last_element_name, "execute_on") == 0) { + char *sep; + char *tt1 = tt; + do { + sep = strchr(tt1,','); + if (sep) + *sep = '\0'; + if (strcmp(tt1,"PRE-DLE-AMCHECK") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_AMCHECK; + else if (strcmp(tt1,"PRE-HOST-AMCHECK") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_AMCHECK; + else if (strcmp(tt1,"POST-DLE-AMCHECK") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_DLE_AMCHECK; + else if (strcmp(tt1,"POST-HOST-AMCHECK") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_HOST_AMCHECK; + else if (strcmp(tt1,"PRE-DLE-ESTIMATE") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_ESTIMATE; + else if (strcmp(tt1,"PRE-HOST-ESTIMATE") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_ESTIMATE; + else if (strcmp(tt1,"POST-DLE-ESTIMATE") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_DLE_ESTIMATE; + else if (strcmp(tt1,"POST-HOST-ESTIMATE") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_HOST_ESTIMATE; + else if (strcmp(tt1,"PRE-DLE-BACKUP") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_BACKUP; + else if (strcmp(tt1,"PRE-HOST-BACKUP") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_BACKUP; + else if (strcmp(tt1,"POST-DLE-BACKUP") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_DLE_BACKUP; + else if (strcmp(tt1,"POST-HOST-BACKUP") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_HOST_BACKUP; + else if (strcmp(tt1,"PRE-RECOVER") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_RECOVER; + else if (strcmp(tt1,"POST-RECOVER") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_RECOVER; + else if (strcmp(tt1,"PRE-LEVEL-RECOVER") == 0) + data_user->script->execute_on |= EXECUTE_ON_PRE_LEVEL_RECOVER; + else if (strcmp(tt1,"POST-LEVEL-RECOVER") == 0) + data_user->script->execute_on |= EXECUTE_ON_POST_LEVEL_RECOVER; + else if (strcmp(tt1,"INTER-LEVEL-RECOVER") == 0) + data_user->script->execute_on |= EXECUTE_ON_INTER_LEVEL_RECOVER; + else + dbprintf("BAD EXECUTE_ON: %s\n", tt1); + if (sep) + tt1 = sep+1; + } while (sep); + amfree(tt); + } else if(strcmp(last_element_name, "execute_where") == 0) { + if (strcmp(tt, "CLIENT") == 0) { + data_user->script->execute_where = ES_CLIENT; + } else { + data_user->script->execute_where = ES_SERVER; + } + } else { + g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "XML: amtext not defined for '%s'", last_element_name); + return; + } +} + +dle_t * +amxml_parse_node_CHAR( + char *txt, + char **errmsg) +{ + amgxml_t amgxml = {NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL}; + GMarkupParser parser = {&amstart_element, &amend_element, &amtext, + NULL, NULL}; + GMarkupParseFlags flags = 0; + GMarkupParseContext *context; + GError *gerror = NULL; + + (void)errmsg; + + context = g_markup_parse_context_new(&parser, flags, &amgxml, NULL); + + g_markup_parse_context_parse(context, txt, strlen(txt), &gerror); + if (!gerror) + g_markup_parse_context_end_parse(context, &gerror); + g_markup_parse_context_free(context); + if (gerror) { + if (errmsg) + *errmsg = stralloc(gerror->message); + g_error_free(gerror); + } + return amgxml.dles; + +} + +dle_t * +amxml_parse_node_FILE( + FILE *file, + char **errmsg) +{ + amgxml_t amgxml = {NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL}; + GMarkupParser parser = {&amstart_element, &amend_element, &amtext, + NULL, NULL}; + GMarkupParseFlags flags = 0; + GMarkupParseContext *context; + GError *gerror = NULL; + char *line; + + (void)errmsg; + + context = g_markup_parse_context_new(&parser, flags, &amgxml, NULL); + + while ((line = agets(file)) != NULL && !gerror) { + g_markup_parse_context_parse(context, line, strlen(line), &gerror); + amfree(line); + } + if (!gerror) + g_markup_parse_context_end_parse(context, &gerror); + g_markup_parse_context_free(context); + if (gerror) { + if (errmsg) + *errmsg = stralloc(gerror->message); + g_error_free(gerror); + } + return amgxml.dles; +} + +char * +amxml_format_tag( + char *tag, + char *value) +{ + char *b64value; + char *c; + int need_raw; + char *result; + char *quoted_value; + char *q; + + quoted_value = malloc(strlen(value)+1); + q = quoted_value; + need_raw = 0; + for(c=value; *c != '\0'; c++) { + // Check include negative value, with the 8th bit set. + if (*c <= ' ' || + (unsigned char)*c > 127 || + *c == '<' || + *c == '>' || + *c == '"' || + *c == '&' || + *c == '\\' || + *c == '\'' || + *c == '\t' || + *c == '\f' || + *c == '\r' || + *c == '\n') { + need_raw = 1; + *q++ = '_'; + } else { + *q++ = *c; + } + } + *q = '\0'; + + if (need_raw) { + base64_encode_alloc(value, strlen(value), &b64value); + result = vstralloc("<", tag, + " encoding=\"raw\" raw=\"", b64value, "\">", + quoted_value, + "", + NULL); + amfree(b64value); + } else { + result = vstralloc("<", tag, ">", + value, + "", + NULL); + } + amfree(quoted_value); + + return result; +} diff --git a/common-src/amxml.h b/common-src/amxml.h new file mode 100644 index 0000000..82dc010 --- /dev/null +++ b/common-src/amxml.h @@ -0,0 +1,86 @@ +/* + * Amanda, The Advanced Maryland Automatic Network Disk Archiver + * Copyright (c) 1991-1998 University of Maryland at College Park + * All Rights Reserved. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of U.M. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. U.M. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Authors: the Amanda Development Team. Its members are listed in a + * file named AUTHORS, in the root directory of this distribution. + */ + +/* + * $Id: amxml.h 5151 2007-02-06 15:41:53Z martineau $ + * + * xml parsing of amanda protocol packet + */ + +#ifndef AMXML_H +#define AMXML_H + +#include "conffile.h" + +typedef struct script_s { + char *plugin; + execute_on_t execute_on; + int execute_where; + proplist_t property; + struct client_script_result_s *result; +} script_t; + +typedef GSList *scriptlist_t; + +typedef struct a_dle_s { + char *disk; + char *device; + int program_is_application_api; + char *program; + int calcsize; + estimate_t estimate; + int spindle; + int compress; + int encrypt; + int kencrypt; + GSList *level; + int nb_level; + char *dumpdate; + char *compprog; + char *srv_encrypt; + char *clnt_encrypt; + char *srv_decrypt_opt; + char *clnt_decrypt_opt; + int record; + int create_index; + char *auth; + sl_t *exclude_file; + sl_t *exclude_list; + sl_t *include_file; + sl_t *include_list; + int exclude_optional; + int include_optional; + proplist_t application_property; + scriptlist_t scriptlist; + struct a_dle_s *next; +} dle_t; + +dle_t *alloc_dle(void); +void init_dle(dle_t *dle); +dle_t *amxml_parse_node_CHAR(char *txt, char **errmsg); +dle_t *amxml_parse_node_FILE(FILE *file, char **errmsg); +char *amxml_format_tag(char *tag, char *value); +#endif diff --git a/common-src/bsd-security.c b/common-src/bsd-security.c index 4be7948..46bdca9 100644 --- a/common-src/bsd-security.c +++ b/common-src/bsd-security.c @@ -156,15 +156,16 @@ bsd_connect( security_seterror(&bh->sech, _("resolve_hostname(%s) did not return a canonical name\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); - return; + if (res) freeaddrinfo(res); + return; } if (res == NULL) { dbprintf(_("resolve_hostname(%s): no results\n"), hostname); security_seterror(&bh->sech, _("resolve_hostname(%s): no results\n"), hostname); (*fn)(arg, &bh->sech, S_ERROR); - amfree(canonname); - return; + amfree(canonname); + return; } for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) { @@ -576,7 +577,7 @@ stream_read_sync_callback( n = read(bs->fd, bs->databuf, sizeof(bs->databuf)); } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) - security_stream_seterror(&bs->secstr, strerror(errno)); + security_stream_seterror(&bs->secstr, "%s", strerror(errno)); bs->len = n; } @@ -618,7 +619,7 @@ stream_read_callback( } while ((n < 0) && ((errno == EINTR) || (errno == EAGAIN))); if (n < 0) - security_stream_seterror(&bs->secstr, strerror(errno)); + security_stream_seterror(&bs->secstr, "%s", strerror(errno)); (*bs->fn)(bs->arg, bs->databuf, n); } diff --git a/common-src/clock.c b/common-src/clock.c index 5362ac8..33bcaba 100644 --- a/common-src/clock.c +++ b/common-src/clock.c @@ -34,7 +34,6 @@ #include "clock.h" /* local functions */ -times_t times_zero; times_t start_time; static int clock_running = 0; diff --git a/common-src/clock.h b/common-src/clock.h index 0f7ce1e..764df90 100644 --- a/common-src/clock.h +++ b/common-src/clock.h @@ -36,8 +36,6 @@ typedef GTimeVal times_t; -extern times_t times_zero, start_time; - /* NOT THREAD SAFE */ void startclock(void); times_t stopclock(void); diff --git a/common-src/conffile.c b/common-src/conffile.c index 18afa9e..cf88dd8 100644 --- a/common-src/conffile.c +++ b/common-src/conffile.c @@ -35,6 +35,7 @@ #include "util.h" #include "conffile.h" #include "clock.h" +#include /* * Lexical analysis @@ -53,7 +54,7 @@ typedef enum { CONF_UNKNOWN, CONF_ANY, CONF_COMMA, CONF_LBRACE, CONF_RBRACE, CONF_NL, CONF_END, CONF_IDENT, CONF_INT, - CONF_AM64, CONF_BOOL, CONF_REAL, + CONF_INT64, CONF_BOOL, CONF_REAL, CONF_STRING, CONF_TIME, CONF_SIZE, /* config parameters */ @@ -63,16 +64,18 @@ typedef enum { CONF_BUMPPERCENT, CONF_BUMPSIZE, CONF_BUMPDAYS, CONF_BUMPMULT, CONF_ETIMEOUT, CONF_DTIMEOUT, CONF_CTIMEOUT, CONF_TAPEBUFS, CONF_TAPELIST, - CONF_DEVICE_OUTPUT_BUFFER_SIZE, + CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONF_RAWTAPEDEV, CONF_DISKFILE, CONF_INFOFILE, CONF_LOGDIR, CONF_LOGFILE, CONF_DISKDIR, CONF_DISKSIZE, CONF_INDEXDIR, CONF_NETUSAGE, CONF_INPARALLEL, CONF_DUMPORDER, CONF_TIMEOUT, CONF_TPCHANGER, CONF_RUNTAPES, CONF_DEFINE, CONF_DUMPTYPE, CONF_TAPETYPE, CONF_INTERFACE, CONF_PRINTER, + CONF_MAILER, CONF_AUTOFLUSH, CONF_RESERVE, CONF_MAXDUMPSIZE, CONF_COLUMNSPEC, CONF_AMRECOVER_DO_FSF, CONF_AMRECOVER_CHECK_LABEL, CONF_AMRECOVER_CHANGER, CONF_LABEL_NEW_TAPES, CONF_USETIMESTAMPS, + CONF_CHANGER, CONF_TAPERALGO, CONF_FIRST, CONF_FIRSTFIT, CONF_LARGEST, CONF_LARGESTFIT, CONF_SMALLEST, @@ -81,7 +84,22 @@ typedef enum { CONF_TAPERFLUSH, CONF_FLUSH_THRESHOLD_DUMPED, CONF_FLUSH_THRESHOLD_SCHEDULED, - CONF_DEVICE_PROPERTY, + CONF_DEVICE_PROPERTY, CONF_PROPERTY, CONF_PLUGIN, + CONF_APPLICATION, CONF_APPLICATION_TOOL, + CONF_PP_SCRIPT, CONF_PP_SCRIPT_TOOL, + CONF_EXECUTE_ON, CONF_EXECUTE_WHERE, CONF_SEND_AMREPORT_ON, + CONF_DEVICE, + + /* execute on */ + CONF_PRE_DLE_AMCHECK, CONF_PRE_HOST_AMCHECK, + CONF_POST_DLE_AMCHECK, CONF_POST_HOST_AMCHECK, + CONF_PRE_DLE_ESTIMATE, CONF_PRE_HOST_ESTIMATE, + CONF_POST_DLE_ESTIMATE, CONF_POST_HOST_ESTIMATE, + CONF_PRE_DLE_BACKUP, CONF_PRE_HOST_BACKUP, + CONF_POST_DLE_BACKUP, CONF_POST_HOST_BACKUP, + CONF_PRE_RECOVER, CONF_POST_RECOVER, + CONF_PRE_LEVEL_RECOVER, CONF_POST_LEVEL_RECOVER, + CONF_INTER_LEVEL_RECOVER, /* kerberos 5 */ CONF_KRB5KEYTAB, CONF_KRB5PRINCIPAL, @@ -139,6 +157,9 @@ typedef enum { /* holdingdisk */ CONF_NEVER, CONF_AUTO, CONF_REQUIRED, + /* send_amreport */ + CONF_ALL, CONF_STRANGE, CONF_ERROR, + /* priority */ CONF_LOW, CONF_MEDIUM, CONF_HIGH, @@ -210,6 +231,12 @@ static void unget_conftoken(void); static int conftoken_getc(void); static int conftoken_ungetc(int c); +static void copy_proplist(gpointer key_p, + gpointer value_p, + gpointer user_data_p); +static void copy_pp_scriptlist(gpointer data_p, + gpointer user_data_p); + /* * Parser */ @@ -226,6 +253,13 @@ typedef struct conf_var_s { void (*validate_function) (struct conf_var_s *, val_t *); } conf_var_t; +/* This is a list of filenames that are used in 'seen_t' structs. */ +static GSList *seen_filenames = NULL; + +/* get a copy of filename that's stored in seen_filenames so that it won't go + * away until config_uninit. */ +static char *get_seen_filename(char *filename); + /* If allow_overwrites is true, the a parameter which has already been * seen will simply overwrite the old value, rather than triggering an * error. Note that this does not apply to all parameters, e.g., @@ -240,7 +274,7 @@ static int allow_overwrites; */ struct tapetype_s { struct tapetype_s *next; - int seen; + seen_t seen; char *name; val_t value[TAPETYPE_TAPETYPE]; @@ -248,7 +282,7 @@ struct tapetype_s { struct dumptype_s { struct dumptype_s *next; - int seen; + seen_t seen; char *name; val_t value[DUMPTYPE_DUMPTYPE]; @@ -256,7 +290,7 @@ struct dumptype_s { struct interface_s { struct interface_s *next; - int seen; + seen_t seen; char *name; val_t value[INTER_INTER]; @@ -264,12 +298,44 @@ struct interface_s { struct holdingdisk_s { struct holdingdisk_s *next; - int seen; + seen_t seen; char *name; val_t value[HOLDING_HOLDING]; }; +struct application_s { + struct application_s *next; + seen_t seen; + char *name; + + val_t value[APPLICATION_APPLICATION]; +}; + +struct pp_script_s { + struct pp_script_s *next; + seen_t seen; + char *name; + + val_t value[PP_SCRIPT_PP_SCRIPT]; +}; + +struct device_config_s { + struct device_config_s *next; + seen_t seen; + char *name; + + val_t value[DEVICE_CONFIG_DEVICE_CONFIG]; +}; + +struct changer_config_s { + struct changer_config_s *next; + int seen; + char *name; + + val_t value[CHANGER_CONFIG_CHANGER_CONFIG]; +}; + /* The current parser table */ static conf_var_t *parsetable = NULL; @@ -279,27 +345,33 @@ static conf_var_t *parsetable = NULL; * * @param filename: configuration file to read * @param is_client: true if this is a client - * @returns: false if an error occurred + * @param missing_ok: is it OK if the file is missing? */ -static gboolean read_conffile(char *filename, - gboolean is_client); +static void read_conffile(char *filename, + gboolean is_client, + gboolean missing_ok); /* Read and process a line of input from the current file, using the * current keytable and parsetable. For blocks, this recursively * reads the entire block. * * @param is_client: true if this is a client - * @returns: true on success, false on EOF or error + * @returns: true on success, false on EOF */ static gboolean read_confline(gboolean is_client); -/* Handle an invalid token, by issuing a warning or an error, depending - * on how long the token has been deprecated. +/* Handle an invalid token, recognizing deprecated tokens as such, + * and producing an appropriate error message. * * @param token: the identifier */ static void handle_invalid_keyword(const char * token); +/* Check whether token is deprecated, and issue a warning if it + * is. This consults the global variables 'tok' and 'tokenval' + */ +static void handle_deprecated_keyword(void); + /* Read a brace-delimited block using the given parse table. This * function is used to read brace-delimited subsections in the config * files and also (via read_dumptype) to read dumptypes from @@ -357,13 +429,37 @@ static void init_interface_defaults(void); static void save_interface(void); static void copy_interface(void); +static application_t apcur; +static void get_application(void); +static void init_application_defaults(void); +static void save_application(void); +static void copy_application(void); + +static pp_script_t pscur; +static void get_pp_script(void); +static void init_pp_script_defaults(void); +static void save_pp_script(void); +static void copy_pp_script(void); + +static device_config_t dccur; +static void get_device_config(void); +static void init_device_config_defaults(void); +static void save_device_config(void); +static void copy_device_config(void); + +static changer_config_t cccur; +static void get_changer_config(void); +static void init_changer_config_defaults(void); +static void save_changer_config(void); +static void copy_changer_config(void); + /* read_functions -- these fit into the read_function slot in a parser * table entry, and are responsible for calling getconf_token as necessary * to consume their arguments, and setting their second argument with the * result. The first argument is a copy of the parser table entry, if * needed. */ static void read_int(conf_var_t *, val_t *); -static void read_am64(conf_var_t *, val_t *); +static void read_int64(conf_var_t *, val_t *); static void read_real(conf_var_t *, val_t *); static void read_str(conf_var_t *, val_t *); static void read_ident(conf_var_t *, val_t *); @@ -376,11 +472,16 @@ static void read_holding(conf_var_t *, val_t *); static void read_estimate(conf_var_t *, val_t *); static void read_strategy(conf_var_t *, val_t *); static void read_taperalgo(conf_var_t *, val_t *); +static void read_send_amreport_on(conf_var_t *, val_t *); static void read_priority(conf_var_t *, val_t *); static void read_rate(conf_var_t *, val_t *); static void read_exinclude(conf_var_t *, val_t *); static void read_intrange(conf_var_t *, val_t *); +static void read_dapplication(conf_var_t *, val_t *); +static void read_dpp_script(conf_var_t *, val_t *); static void read_property(conf_var_t *, val_t *); +static void read_execute_on(conf_var_t *, val_t *); +static void read_execute_where(conf_var_t *, val_t *); /* Functions to get various types of values. These are called by * read_functions to take care of any variations in the way that these @@ -390,7 +491,7 @@ static void read_property(conf_var_t *, val_t *); static time_t get_time(void); static int get_int(void); static ssize_t get_size(void); -static off_t get_am64_t(void); +static gint64 get_int64(void); static int get_bool(void); /* Check the given 'seen', flagging an error if this value has already @@ -399,7 +500,7 @@ static int get_bool(void); * * @param seen: (in/out) seen value to adjust */ -static void ckseen(int *seen); +static void ckseen(seen_t *seen); /* validate_functions -- these fit into the validate_function solt in * a parser table entry. They call conf_parserror if the value in their @@ -419,19 +520,26 @@ static void validate_debug(conf_var_t *, val_t *); static void validate_port_range(val_t *, int, int); static void validate_reserved_port_range(conf_var_t *, val_t *); static void validate_unreserved_port_range(conf_var_t *, val_t *); +static void validate_program(conf_var_t *, val_t *); /* * Initialization */ -/* Name of the current configuration (part of API) */ -char *config_name = NULL; +/* The name of the configuration under which this application is running. + * This variable is initialized by config_init. + */ +static char *config_name = NULL; -/* Current configuration directory (part of API) */ -char *config_dir = NULL; +/* The directory containing the configuration for this application. This + * variable is initialized by config_init + */ +static char *config_dir = NULL; -/* Current toplevel configuration file (part of API) */ -char *config_filename = NULL; +/* The most recently read top-level configuration file. This variable is + * initialized by config_init + */ +static char *config_filename = NULL; /* Has the config been initialized? */ static gboolean config_initialized = FALSE; @@ -451,6 +559,10 @@ static holdingdisk_t *holdinglist = NULL; static dumptype_t *dumplist = NULL; static tapetype_t *tapelist = NULL; static interface_t *interface_list = NULL; +static application_t *application_list = NULL; +static pp_script_t *pp_script_list = NULL; +static device_config_t *device_config_list = NULL; +static changer_config_t *changer_config_list = NULL; /* storage for derived values */ static long int unit_divisor = 1; @@ -491,7 +603,7 @@ static void update_derived_values(gboolean is_client); * the relevant value into the 'v' field. */ static void conf_init_int(val_t *val, int i); -static void conf_init_am64(val_t *val, off_t l); +static void conf_init_int64(val_t *val, gint64 l); static void conf_init_real(val_t *val, float r); static void conf_init_str(val_t *val, char *s); static void conf_init_ident(val_t *val, char *s); @@ -502,6 +614,9 @@ static void conf_init_compress(val_t *val, comp_t i); static void conf_init_encrypt(val_t *val, encrypt_t i); static void conf_init_holding(val_t *val, dump_holdingdisk_t i); static void conf_init_estimate(val_t *val, estimate_t i); +static void conf_init_execute_on(val_t *, int); +static void conf_init_execute_where(val_t *, int); +static void conf_init_send_amreport(val_t *val, send_amreport_t i); static void conf_init_strategy(val_t *val, strategy_t); static void conf_init_taperalgo(val_t *val, taperalgo_t i); static void conf_init_priority(val_t *val, int i); @@ -509,6 +624,8 @@ static void conf_init_rate(val_t *val, float r1, float r2); static void conf_init_exinclude(val_t *val); /* to empty list */ static void conf_init_intrange(val_t *val, int i1, int i2); static void conf_init_proplist(val_t *val); /* to empty list */ +static void conf_init_pp_scriptlist(val_t *); +static void conf_init_application(val_t *val); /* * Command-line Handling @@ -540,6 +657,7 @@ static void free_val_t(val_t *); /* Utility functions/structs for val_t_display_strs */ static char *exinclude_display_str(val_t *val, int file); static void proplist_display_str_foreach_fn(gpointer key_p, gpointer value_p, gpointer user_data_p); +static void pp_scriptlist_display_str_foreach_fn(gpointer data_p, gpointer user_data_p); static void val_t_print_token(FILE *output, char *prefix, char *format, keytab_t *kt, val_t *val); /* Given a key name as used in config overwrites, return a pointer to the corresponding @@ -564,8 +682,10 @@ static int parm_key_info(char *key, conf_var_t **parm, val_t **val); /* Have we seen a parse error yet? Parsing continues after an error, so this * flag is checked after the parse is complete. */ -static gboolean got_parserror; +static cfgerr_level_t cfgerr_level; +static GSList *cfgerr_errors = NULL; +static void conf_error_common(cfgerr_level_t level, const char * format, va_list argp); static void conf_parserror(const char *format, ...) __attribute__ ((format (printf, 1, 2))); @@ -594,6 +714,7 @@ keytab_t client_keytab[] = { { "CONNECT_TRIES", CONF_CONNECT_TRIES }, { "REP_TRIES", CONF_REP_TRIES }, { "REQ_TRIES", CONF_REQ_TRIES }, + { "CLIENT", CONF_CLIENT }, { "DEBUG_AMANDAD", CONF_DEBUG_AMANDAD }, { "DEBUG_AMIDXTAPED", CONF_DEBUG_AMIDXTAPED }, { "DEBUG_AMINDEXD", CONF_DEBUG_AMINDEXD }, @@ -610,13 +731,46 @@ keytab_t client_keytab[] = { { "DEBUG_SELFCHECK", CONF_DEBUG_SELFCHECK }, { "DEBUG_SENDSIZE", CONF_DEBUG_SENDSIZE }, { "DEBUG_SENDBACKUP", CONF_DEBUG_SENDBACKUP }, - { "RESERVED-UDP-PORT", CONF_RESERVED_UDP_PORT }, - { "RESERVED-TCP-PORT", CONF_RESERVED_TCP_PORT }, - { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT }, - { NULL, CONF_UNKNOWN }, + { "EXECUTE_ON", CONF_EXECUTE_ON }, + { "EXECUTE_WHERE", CONF_EXECUTE_WHERE }, + { "RESERVED_UDP_PORT", CONF_RESERVED_UDP_PORT }, + { "RESERVED_TCP_PORT", CONF_RESERVED_TCP_PORT }, + { "UNRESERVED_TCP_PORT", CONF_UNRESERVED_TCP_PORT }, + { "DEFINE", CONF_DEFINE }, + { "COMMENT", CONF_COMMENT }, + { "MAILER", CONF_MAILER }, + { "SCRIPT", CONF_PP_SCRIPT }, + { "SCRIPT_TOOL", CONF_PP_SCRIPT_TOOL }, + { "PLUGIN", CONF_PLUGIN }, + { "PRE_DLE_AMCHECK", CONF_PRE_DLE_AMCHECK }, + { "PRE_HOST_AMCHECK", CONF_PRE_HOST_AMCHECK }, + { "POST_DLE_AMCHECK", CONF_POST_DLE_AMCHECK }, + { "POST_HOST_AMCHECK", CONF_POST_HOST_AMCHECK }, + { "PRE_DLE_ESTIMATE", CONF_PRE_DLE_ESTIMATE }, + { "PRE_HOST_ESTIMATE", CONF_PRE_HOST_ESTIMATE }, + { "POST_DLE_ESTIMATE", CONF_POST_DLE_ESTIMATE }, + { "POST_HOST_ESTIMATE", CONF_POST_HOST_ESTIMATE }, + { "POST_DLE_BACKUP", CONF_POST_DLE_BACKUP }, + { "POST_HOST_BACKUP", CONF_POST_HOST_BACKUP }, + { "PRE_DLE_BACKUP", CONF_PRE_DLE_BACKUP }, + { "PRE_HOST_BACKUP", CONF_PRE_HOST_BACKUP }, + { "PRE_RECOVER", CONF_PRE_RECOVER }, + { "POST_RECOVER", CONF_POST_RECOVER }, + { "PRE_LEVEL_RECOVER", CONF_PRE_LEVEL_RECOVER }, + { "POST_LEVEL_RECOVER", CONF_POST_LEVEL_RECOVER }, + { "INTER_LEVEL_RECOVER", CONF_INTER_LEVEL_RECOVER }, + { "PRIORITY", CONF_PRIORITY }, + { "PROPERTY", CONF_PROPERTY }, + { "APPLICATION", CONF_APPLICATION }, + { "APPLICATION_TOOL", CONF_APPLICATION_TOOL }, + { "SERVER", CONF_SERVER }, + { "APPEND", CONF_APPEND }, + { NULL, CONF_IDENT }, + { NULL, CONF_UNKNOWN } }; keytab_t server_keytab[] = { + { "ALL", CONF_ALL }, { "AMANDAD_PATH", CONF_AMANDAD_PATH }, { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER }, { "AMRECOVER_CHECK_LABEL", CONF_AMRECOVER_CHECK_LABEL }, @@ -625,6 +779,8 @@ keytab_t server_keytab[] = { { "AUTH", CONF_AUTH }, { "AUTO", CONF_AUTO }, { "AUTOFLUSH", CONF_AUTOFLUSH }, + { "APPLICATION", CONF_APPLICATION }, + { "APPLICATION_TOOL", CONF_APPLICATION_TOOL }, { "BEST", CONF_BEST }, { "BLOCKSIZE", CONF_BLOCKSIZE }, { "BUMPDAYS", CONF_BUMPDAYS }, @@ -632,6 +788,7 @@ keytab_t server_keytab[] = { { "BUMPPERCENT", CONF_BUMPPERCENT }, { "BUMPSIZE", CONF_BUMPSIZE }, { "CALCSIZE", CONF_CALCSIZE }, + { "CHANGER", CONF_CHANGER }, { "CHANGERDEV", CONF_CHANGERDEV }, { "CHANGERFILE", CONF_CHANGERFILE }, { "CHUNKSIZE", CONF_CHUNKSIZE }, @@ -664,6 +821,7 @@ keytab_t server_keytab[] = { { "DEBUG_SENDSIZE" , CONF_DEBUG_SENDSIZE }, { "DEBUG_SENDBACKUP" , CONF_DEBUG_SENDBACKUP }, { "DEFINE", CONF_DEFINE }, + { "DEVICE", CONF_DEVICE }, { "DEVICE_PROPERTY", CONF_DEVICE_PROPERTY }, { "DIRECTORY", CONF_DIRECTORY }, { "DISKFILE", CONF_DISKFILE }, @@ -674,15 +832,18 @@ keytab_t server_keytab[] = { { "DUMPTYPE", CONF_DUMPTYPE }, { "DUMPUSER", CONF_DUMPUSER }, { "ENCRYPT", CONF_ENCRYPT }, + { "ERROR", CONF_ERROR }, { "ESTIMATE", CONF_ESTIMATE }, { "ETIMEOUT", CONF_ETIMEOUT }, { "EXCLUDE", CONF_EXCLUDE }, - { "EXCLUDE-FILE", CONF_EXCLUDE_FILE }, - { "EXCLUDE-LIST", CONF_EXCLUDE_LIST }, + { "EXCLUDE_FILE", CONF_EXCLUDE_FILE }, + { "EXCLUDE_LIST", CONF_EXCLUDE_LIST }, + { "EXECUTE_ON", CONF_EXECUTE_ON }, + { "EXECUTE_WHERE", CONF_EXECUTE_WHERE }, { "FALLBACK_SPLITSIZE", CONF_FALLBACK_SPLITSIZE }, { "FAST", CONF_FAST }, { "FILE", CONF_EFILE }, - { "FILE-PAD", CONF_FILE_PAD }, + { "FILE_PAD", CONF_FILE_PAD }, { "FILEMARK", CONF_FILEMARK }, { "FIRST", CONF_FIRST }, { "FIRSTFIT", CONF_FIRSTFIT }, @@ -706,11 +867,12 @@ keytab_t server_keytab[] = { { "LARGEST", CONF_LARGEST }, { "LARGESTFIT", CONF_LARGESTFIT }, { "LAST", CONF_LAST }, - { "LBL-TEMPL", CONF_LBL_TEMPL }, + { "LBL_TEMPL", CONF_LBL_TEMPL }, { "LENGTH", CONF_LENGTH }, { "LIST", CONF_LIST }, { "LOGDIR", CONF_LOGDIR }, { "LOW", CONF_LOW }, + { "MAILER", CONF_MAILER }, { "MAILTO", CONF_MAILTO }, { "READBLOCKSIZE", CONF_READBLOCKSIZE }, { "MAXDUMPS", CONF_MAXDUMPS }, @@ -724,45 +886,69 @@ keytab_t server_keytab[] = { { "NONE", CONF_NONE }, { "OPTIONAL", CONF_OPTIONAL }, { "ORG", CONF_ORG }, + { "PLUGIN", CONF_PLUGIN }, + { "PRE_DLE_AMCHECK", CONF_PRE_DLE_AMCHECK }, + { "PRE_HOST_AMCHECK", CONF_PRE_HOST_AMCHECK }, + { "POST_DLE_AMCHECK", CONF_POST_DLE_AMCHECK }, + { "POST_HOST_AMCHECK", CONF_POST_HOST_AMCHECK }, + { "PRE_DLE_ESTIMATE", CONF_PRE_DLE_ESTIMATE }, + { "PRE_HOST_ESTIMATE", CONF_PRE_HOST_ESTIMATE }, + { "POST_DLE_ESTIMATE", CONF_POST_DLE_ESTIMATE }, + { "POST_HOST_ESTIMATE", CONF_POST_HOST_ESTIMATE }, + { "POST_DLE_BACKUP", CONF_POST_DLE_BACKUP }, + { "POST_HOST_BACKUP", CONF_POST_HOST_BACKUP }, + { "PRE_DLE_BACKUP", CONF_PRE_DLE_BACKUP }, + { "PRE_HOST_BACKUP", CONF_PRE_HOST_BACKUP }, + { "PRE_RECOVER", CONF_PRE_RECOVER }, + { "POST_RECOVER", CONF_POST_RECOVER }, + { "PRE_LEVEL_RECOVER", CONF_PRE_LEVEL_RECOVER }, + { "POST_LEVEL_RECOVER", CONF_POST_LEVEL_RECOVER }, + { "INTER_LEVEL_RECOVER", CONF_INTER_LEVEL_RECOVER }, { "PRINTER", CONF_PRINTER }, { "PRIORITY", CONF_PRIORITY }, { "PROGRAM", CONF_PROGRAM }, + { "PROPERTY", CONF_PROPERTY }, { "RECORD", CONF_RECORD }, { "REP_TRIES", CONF_REP_TRIES }, { "REQ_TRIES", CONF_REQ_TRIES }, { "REQUIRED", CONF_REQUIRED }, { "RESERVE", CONF_RESERVE }, - { "RESERVED-UDP-PORT", CONF_RESERVED_UDP_PORT }, - { "RESERVED-TCP-PORT", CONF_RESERVED_TCP_PORT }, + { "RESERVED_UDP_PORT", CONF_RESERVED_UDP_PORT }, + { "RESERVED_TCP_PORT", CONF_RESERVED_TCP_PORT }, { "RUNSPERCYCLE", CONF_RUNSPERCYCLE }, { "RUNTAPES", CONF_RUNTAPES }, + { "SCRIPT", CONF_PP_SCRIPT }, + { "SCRIPT_TOOL", CONF_PP_SCRIPT_TOOL }, + { "SEND_AMREPORT_ON", CONF_SEND_AMREPORT_ON }, { "SERVER", CONF_SERVER }, { "SERVER_CUSTOM_COMPRESS", CONF_SRVCOMPPROG }, { "SERVER_DECRYPT_OPTION", CONF_SRV_DECRYPT_OPT }, { "SERVER_ENCRYPT", CONF_SRV_ENCRYPT }, { "SKIP", CONF_SKIP }, - { "SKIP-FULL", CONF_SKIP_FULL }, - { "SKIP-INCR", CONF_SKIP_INCR }, + { "SKIP_FULL", CONF_SKIP_FULL }, + { "SKIP_INCR", CONF_SKIP_INCR }, { "SMALLEST", CONF_SMALLEST }, { "SPEED", CONF_SPEED }, { "SPLIT_DISKBUFFER", CONF_SPLIT_DISKBUFFER }, { "SSH_KEYS", CONF_SSH_KEYS }, { "STANDARD", CONF_STANDARD }, { "STARTTIME", CONF_STARTTIME }, + { "STRANGE", CONF_STRANGE }, { "STRATEGY", CONF_STRATEGY }, { "TAPEBUFS", CONF_TAPEBUFS }, { "DEVICE_OUTPUT_BUFFER_SIZE", CONF_DEVICE_OUTPUT_BUFFER_SIZE }, { "TAPECYCLE", CONF_TAPECYCLE }, { "TAPEDEV", CONF_TAPEDEV }, + { "RAWTAPEDEV", CONF_RAWTAPEDEV }, { "TAPELIST", CONF_TAPELIST }, { "TAPERALGO", CONF_TAPERALGO }, - { "FLUSH-THRESHOLD-DUMPED", CONF_FLUSH_THRESHOLD_DUMPED }, - { "FLUSH-THRESHOLD-SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED }, + { "FLUSH_THRESHOLD_DUMPED", CONF_FLUSH_THRESHOLD_DUMPED }, + { "FLUSH_THRESHOLD_SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED }, { "TAPERFLUSH", CONF_TAPERFLUSH }, { "TAPETYPE", CONF_TAPETYPE }, { "TAPE_SPLITSIZE", CONF_TAPE_SPLITSIZE }, { "TPCHANGER", CONF_TPCHANGER }, - { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT }, + { "UNRESERVED_TCP_PORT", CONF_UNRESERVED_TCP_PORT }, { "USE", CONF_USE }, { "USETIMESTAMPS", CONF_USETIMESTAMPS }, { NULL, CONF_IDENT }, @@ -839,6 +1025,7 @@ conf_var_t client_var [] = { { CONF_CLIENT_USERNAME , CONFTYPE_STR , read_str , CNF_CLIENT_USERNAME , NULL }, { CONF_GNUTAR_LIST_DIR , CONFTYPE_STR , read_str , CNF_GNUTAR_LIST_DIR , NULL }, { CONF_AMANDATES , CONFTYPE_STR , read_str , CNF_AMANDATES , NULL }, + { CONF_MAILER , CONFTYPE_STR , read_str , CNF_MAILER , NULL }, { CONF_KRB5KEYTAB , CONFTYPE_STR , read_str , CNF_KRB5KEYTAB , NULL }, { CONF_KRB5PRINCIPAL , CONFTYPE_STR , read_str , CNF_KRB5PRINCIPAL , NULL }, { CONF_CONNECT_TRIES , CONFTYPE_INT , read_int , CNF_CONNECT_TRIES , validate_positive }, @@ -863,6 +1050,9 @@ conf_var_t client_var [] = { { CONF_RESERVED_UDP_PORT , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_UDP_PORT , validate_reserved_port_range }, { CONF_RESERVED_TCP_PORT , CONFTYPE_INTRANGE, read_intrange, CNF_RESERVED_TCP_PORT , validate_reserved_port_range }, { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range }, + { CONF_PROPERTY , CONFTYPE_PROPLIST, read_property, CNF_PROPERTY , NULL }, + { CONF_APPLICATION , CONFTYPE_STR , read_dapplication, DUMPTYPE_APPLICATION, NULL }, + { CONF_PP_SCRIPT , CONFTYPE_STR , read_dpp_script, DUMPTYPE_PP_SCRIPTLIST, NULL }, { CONF_UNKNOWN , CONFTYPE_INT , NULL , CNF_CNF , NULL } }; @@ -871,8 +1061,11 @@ conf_var_t server_var [] = { { CONF_MAILTO , CONFTYPE_STR , read_str , CNF_MAILTO , NULL }, { CONF_DUMPUSER , CONFTYPE_STR , read_str , CNF_DUMPUSER , NULL }, { CONF_PRINTER , CONFTYPE_STR , read_str , CNF_PRINTER , NULL }, + { CONF_MAILER , CONFTYPE_STR , read_str , CNF_MAILER , NULL }, { CONF_TAPEDEV , CONFTYPE_STR , read_str , CNF_TAPEDEV , NULL }, + { CONF_RAWTAPEDEV , CONFTYPE_STR , read_str , CNF_RAWTAPEDEV , NULL }, { CONF_DEVICE_PROPERTY , CONFTYPE_PROPLIST , read_property , CNF_DEVICE_PROPERTY , NULL }, + { CONF_PROPERTY , CONFTYPE_PROPLIST , read_property , CNF_PROPERTY , NULL }, { CONF_TPCHANGER , CONFTYPE_STR , read_str , CNF_TPCHANGER , NULL }, { CONF_CHANGERDEV , CONFTYPE_STR , read_str , CNF_CHANGERDEV , NULL }, { CONF_CHANGERFILE , CONFTYPE_STR , read_str , CNF_CHANGERFILE , NULL }, @@ -888,7 +1081,7 @@ conf_var_t server_var [] = { { CONF_RUNTAPES , CONFTYPE_INT , read_int , CNF_RUNTAPES , validate_nonnegative }, { CONF_TAPECYCLE , CONFTYPE_INT , read_int , CNF_TAPECYCLE , validate_positive }, { CONF_BUMPDAYS , CONFTYPE_INT , read_int , CNF_BUMPDAYS , validate_positive }, - { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_BUMPSIZE , validate_positive }, + { CONF_BUMPSIZE , CONFTYPE_INT64 , read_int64 , CNF_BUMPSIZE , validate_positive }, { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , CNF_BUMPPERCENT , validate_bumppercent }, { CONF_BUMPMULT , CONFTYPE_REAL , read_real , CNF_BUMPMULT , validate_bumpmult }, { CONF_NETUSAGE , CONFTYPE_INT , read_int , CNF_NETUSAGE , validate_positive }, @@ -902,13 +1095,14 @@ conf_var_t server_var [] = { { CONF_DEVICE_OUTPUT_BUFFER_SIZE, CONFTYPE_SIZE , read_size , CNF_DEVICE_OUTPUT_BUFFER_SIZE, validate_positive }, { CONF_COLUMNSPEC , CONFTYPE_STR , read_str , CNF_COLUMNSPEC , NULL }, { CONF_TAPERALGO , CONFTYPE_TAPERALGO, read_taperalgo , CNF_TAPERALGO , NULL }, + { CONF_SEND_AMREPORT_ON , CONFTYPE_SEND_AMREPORT_ON, read_send_amreport_on, CNF_SEND_AMREPORT_ON , NULL }, { CONF_FLUSH_THRESHOLD_DUMPED, CONFTYPE_INT , read_int , CNF_FLUSH_THRESHOLD_DUMPED, validate_nonnegative }, { CONF_FLUSH_THRESHOLD_SCHEDULED, CONFTYPE_INT , read_int , CNF_FLUSH_THRESHOLD_SCHEDULED, validate_nonnegative }, { CONF_TAPERFLUSH , CONFTYPE_INT , read_int , CNF_TAPERFLUSH , validate_nonnegative }, { CONF_DISPLAYUNIT , CONFTYPE_STR , read_str , CNF_DISPLAYUNIT , validate_displayunit }, { CONF_AUTOFLUSH , CONFTYPE_BOOLEAN , read_bool , CNF_AUTOFLUSH , NULL }, { CONF_RESERVE , CONFTYPE_INT , read_int , CNF_RESERVE , validate_reserve }, - { CONF_MAXDUMPSIZE , CONFTYPE_AM64 , read_am64 , CNF_MAXDUMPSIZE , NULL }, + { CONF_MAXDUMPSIZE , CONFTYPE_INT64 , read_int64 , CNF_MAXDUMPSIZE , NULL }, { CONF_KRB5KEYTAB , CONFTYPE_STR , read_str , CNF_KRB5KEYTAB , NULL }, { CONF_KRB5PRINCIPAL , CONFTYPE_STR , read_str , CNF_KRB5PRINCIPAL , NULL }, { CONF_LABEL_NEW_TAPES , CONFTYPE_STR , read_str , CNF_LABEL_NEW_TAPES , NULL }, @@ -946,8 +1140,8 @@ conf_var_t tapetype_var [] = { { CONF_LBL_TEMPL , CONFTYPE_STR , read_str , TAPETYPE_LBL_TEMPL , NULL }, { CONF_BLOCKSIZE , CONFTYPE_SIZE , read_size , TAPETYPE_BLOCKSIZE , validate_blocksize }, { CONF_READBLOCKSIZE , CONFTYPE_SIZE , read_size , TAPETYPE_READBLOCKSIZE, validate_blocksize }, - { CONF_LENGTH , CONFTYPE_AM64 , read_am64 , TAPETYPE_LENGTH , validate_nonnegative }, - { CONF_FILEMARK , CONFTYPE_AM64 , read_am64 , TAPETYPE_FILEMARK , NULL }, + { CONF_LENGTH , CONFTYPE_INT64 , read_int64 , TAPETYPE_LENGTH , validate_nonnegative }, + { CONF_FILEMARK , CONFTYPE_INT64 , read_int64 , TAPETYPE_FILEMARK , NULL }, { CONF_SPEED , CONFTYPE_INT , read_int , TAPETYPE_SPEED , validate_nonnegative }, { CONF_FILE_PAD , CONFTYPE_BOOLEAN , read_bool , TAPETYPE_FILE_PAD , NULL }, { CONF_UNKNOWN , CONFTYPE_INT , NULL , TAPETYPE_TAPETYPE , NULL } @@ -958,7 +1152,7 @@ conf_var_t dumptype_var [] = { { CONF_AUTH , CONFTYPE_STR , read_str , DUMPTYPE_SECURITY_DRIVER , NULL }, { CONF_BUMPDAYS , CONFTYPE_INT , read_int , DUMPTYPE_BUMPDAYS , NULL }, { CONF_BUMPMULT , CONFTYPE_REAL , read_real , DUMPTYPE_BUMPMULT , NULL }, - { CONF_BUMPSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_BUMPSIZE , NULL }, + { CONF_BUMPSIZE , CONFTYPE_INT64 , read_int64 , DUMPTYPE_BUMPSIZE , NULL }, { CONF_BUMPPERCENT , CONFTYPE_INT , read_int , DUMPTYPE_BUMPPERCENT , NULL }, { CONF_COMPRATE , CONFTYPE_REAL , read_rate , DUMPTYPE_COMPRATE , NULL }, { CONF_COMPRESS , CONFTYPE_INT , read_compress , DUMPTYPE_COMPRESS , NULL }, @@ -973,13 +1167,14 @@ conf_var_t dumptype_var [] = { { CONF_MAXDUMPS , CONFTYPE_INT , read_int , DUMPTYPE_MAXDUMPS , validate_positive }, { CONF_MAXPROMOTEDAY , CONFTYPE_INT , read_int , DUMPTYPE_MAXPROMOTEDAY , validate_nonnegative }, { CONF_PRIORITY , CONFTYPE_PRIORITY , read_priority , DUMPTYPE_PRIORITY , NULL }, - { CONF_PROGRAM , CONFTYPE_STR , read_str , DUMPTYPE_PROGRAM , NULL }, + { CONF_PROGRAM , CONFTYPE_STR , read_str , DUMPTYPE_PROGRAM , validate_program }, + { CONF_PROPERTY , CONFTYPE_PROPLIST , read_property , DUMPTYPE_PROPERTY , NULL }, { CONF_RECORD , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_RECORD , NULL }, { CONF_SKIP_FULL , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_SKIP_FULL , NULL }, { CONF_SKIP_INCR , CONFTYPE_BOOLEAN , read_bool , DUMPTYPE_SKIP_INCR , NULL }, { CONF_STARTTIME , CONFTYPE_TIME , read_time , DUMPTYPE_STARTTIME , NULL }, { CONF_STRATEGY , CONFTYPE_INT , read_strategy , DUMPTYPE_STRATEGY , NULL }, - { CONF_TAPE_SPLITSIZE , CONFTYPE_AM64 , read_am64 , DUMPTYPE_TAPE_SPLITSIZE , validate_nonnegative }, + { CONF_TAPE_SPLITSIZE , CONFTYPE_INT64 , read_int64 , DUMPTYPE_TAPE_SPLITSIZE , validate_nonnegative }, { CONF_SPLIT_DISKBUFFER , CONFTYPE_STR , read_str , DUMPTYPE_SPLIT_DISKBUFFER , NULL }, { CONF_ESTIMATE , CONFTYPE_INT , read_estimate , DUMPTYPE_ESTIMATE , NULL }, { CONF_SRV_ENCRYPT , CONFTYPE_STR , read_str , DUMPTYPE_SRV_ENCRYPT , NULL }, @@ -989,17 +1184,19 @@ conf_var_t dumptype_var [] = { { CONF_SSH_KEYS , CONFTYPE_STR , read_str , DUMPTYPE_SSH_KEYS , NULL }, { CONF_SRVCOMPPROG , CONFTYPE_STR , read_str , DUMPTYPE_SRVCOMPPROG , NULL }, { CONF_CLNTCOMPPROG , CONFTYPE_STR , read_str , DUMPTYPE_CLNTCOMPPROG , NULL }, - { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64 , read_am64 , DUMPTYPE_FALLBACK_SPLITSIZE, NULL }, + { CONF_FALLBACK_SPLITSIZE, CONFTYPE_INT64 , read_int64 , DUMPTYPE_FALLBACK_SPLITSIZE, NULL }, { CONF_SRV_DECRYPT_OPT , CONFTYPE_STR , read_str , DUMPTYPE_SRV_DECRYPT_OPT , NULL }, { CONF_CLNT_DECRYPT_OPT , CONFTYPE_STR , read_str , DUMPTYPE_CLNT_DECRYPT_OPT , NULL }, + { CONF_APPLICATION , CONFTYPE_STR , read_dapplication, DUMPTYPE_APPLICATION , NULL }, + { CONF_PP_SCRIPT , CONFTYPE_STR , read_dpp_script, DUMPTYPE_PP_SCRIPTLIST , NULL }, { CONF_UNKNOWN , CONFTYPE_INT , NULL , DUMPTYPE_DUMPTYPE , NULL } }; conf_var_t holding_var [] = { { CONF_DIRECTORY, CONFTYPE_STR , read_str , HOLDING_DISKDIR , NULL }, { CONF_COMMENT , CONFTYPE_STR , read_str , HOLDING_COMMENT , NULL }, - { CONF_USE , CONFTYPE_AM64 , read_am64 , HOLDING_DISKSIZE , validate_use }, - { CONF_CHUNKSIZE, CONFTYPE_AM64 , read_am64 , HOLDING_CHUNKSIZE, validate_chunksize }, + { CONF_USE , CONFTYPE_INT64 , read_int64 , HOLDING_DISKSIZE , validate_use }, + { CONF_CHUNKSIZE, CONFTYPE_INT64 , read_int64 , HOLDING_CHUNKSIZE, validate_chunksize }, { CONF_UNKNOWN , CONFTYPE_INT , NULL , HOLDING_HOLDING , NULL } }; @@ -1010,6 +1207,38 @@ conf_var_t interface_var [] = { }; +conf_var_t application_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , APPLICATION_COMMENT , NULL }, + { CONF_PLUGIN , CONFTYPE_STR , read_str , APPLICATION_PLUGIN , NULL }, + { CONF_PROPERTY , CONFTYPE_PROPLIST, read_property, APPLICATION_PROPERTY , NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , APPLICATION_APPLICATION, NULL } +}; + +conf_var_t pp_script_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , PP_SCRIPT_COMMENT , NULL }, + { CONF_PLUGIN , CONFTYPE_STR , read_str , PP_SCRIPT_PLUGIN , NULL }, + { CONF_PROPERTY , CONFTYPE_PROPLIST, read_property, PP_SCRIPT_PROPERTY , NULL }, + { CONF_EXECUTE_ON , CONFTYPE_EXECUTE_ON , read_execute_on , PP_SCRIPT_EXECUTE_ON , NULL }, + { CONF_EXECUTE_WHERE, CONFTYPE_EXECUTE_WHERE , read_execute_where , PP_SCRIPT_EXECUTE_WHERE, NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , PP_SCRIPT_PP_SCRIPT , NULL } +}; + +conf_var_t device_config_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , DEVICE_CONFIG_COMMENT , NULL }, + { CONF_DEVICE_PROPERTY , CONFTYPE_PROPLIST , read_property , DEVICE_CONFIG_DEVICE_PROPERTY, NULL }, + { CONF_TAPEDEV , CONFTYPE_STR , read_str , DEVICE_CONFIG_TAPEDEV , NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , DEVICE_CONFIG_DEVICE_CONFIG , NULL } +}; + +conf_var_t changer_config_var [] = { + { CONF_COMMENT , CONFTYPE_STR , read_str , CHANGER_CONFIG_COMMENT , NULL }, + { CONF_TAPEDEV , CONFTYPE_STR , read_str , CHANGER_CONFIG_TAPEDEV , NULL }, + { CONF_TPCHANGER , CONFTYPE_STR , read_str , CHANGER_CONFIG_TPCHANGER , NULL }, + { CONF_CHANGERDEV , CONFTYPE_STR , read_str , CHANGER_CONFIG_CHANGERDEV , NULL }, + { CONF_CHANGERFILE , CONFTYPE_STR , read_str , CHANGER_CONFIG_CHANGERFILE , NULL }, + { CONF_UNKNOWN , CONFTYPE_INT , NULL , CHANGER_CONFIG_CHANGER_CONFIG , NULL } +}; + /* * Lexical Analysis Implementation */ @@ -1038,10 +1267,21 @@ lookup_keyword( char * str) { keytab_t *kwp; + char *str1 = stralloc(str); + char *p = str1; + + /* Fold '-' to '_' in the token. Note that this modifies str1 + * in place. */ + while (*p) { + if (*p == '-') *p = '_'; + p++; + } for(kwp = keytable; kwp->keyword != NULL; kwp++) { - if (strcasecmp(kwp->keyword, str) == 0) break; + if (strcasecmp(kwp->keyword, str1) == 0) break; } + + amfree(str1); return kwp->token; } @@ -1050,7 +1290,7 @@ get_conftoken( tok_t exp) { int ch, d; - off_t am64; + gint64 int64; char *buf; char *tmps; int token_overflow; @@ -1067,7 +1307,7 @@ get_conftoken( ** up again in the current keyword table. */ switch(tok) { - case CONF_AM64: case CONF_SIZE: + case CONF_INT64: case CONF_SIZE: case CONF_INT: case CONF_REAL: case CONF_STRING: case CONF_LBRACE: case CONF_RBRACE: case CONF_COMMA: case CONF_NL: case CONF_END: case CONF_UNKNOWN: @@ -1085,7 +1325,9 @@ get_conftoken( else { ch = conftoken_getc(); - while(ch != EOF && ch != '\n' && isspace(ch)) + /* note that we're explicitly assuming this file is ASCII. Someday + * maybe we'll support UTF-8? */ + while(ch != EOF && ch != '\n' && g_ascii_isspace(ch)) ch = conftoken_getc(); if (ch == '#') { /* comment - eat everything but eol/eof */ while((ch = conftoken_getc()) != EOF && ch != '\n') { @@ -1129,36 +1371,36 @@ get_conftoken( sign = 1; negative_number: /* look for goto negative_number below sign is set there */ - am64 = 0; + int64 = 0; do { - am64 = am64 * 10 + (ch - '0'); + int64 = int64 * 10 + (ch - '0'); ch = conftoken_getc(); } while (isdigit(ch)); if (ch != '.') { if (exp == CONF_INT) { tok = CONF_INT; - tokenval.v.i = sign * (int)am64; + tokenval.v.i = sign * (int)int64; } else if (exp != CONF_REAL) { - tok = CONF_AM64; - tokenval.v.am64 = (off_t)sign * am64; + tok = CONF_INT64; + tokenval.v.int64 = (gint64)sign * int64; } else { /* automatically convert to real when expected */ - tokenval.v.r = (double)sign * (double)am64; + tokenval.v.r = (double)sign * (double)int64; tok = CONF_REAL; } } else { /* got a real number, not an int */ - tokenval.v.r = sign * (double) am64; - am64 = 0; + tokenval.v.r = sign * (double) int64; + int64 = 0; d = 1; ch = conftoken_getc(); while (isdigit(ch)) { - am64 = am64 * 10 + (ch - '0'); + int64 = int64 * 10 + (ch - '0'); d = d * 10; ch = conftoken_getc(); } - tokenval.v.r += sign * ((double)am64) / d; + tokenval.v.r += sign * ((double)int64) / d; tok = CONF_REAL; } @@ -1366,10 +1608,11 @@ conftoken_ungetc( * Parser Implementation */ -static gboolean +static void read_conffile( char *filename, - gboolean is_client) + gboolean is_client, + gboolean missing_ok) { /* Save global locations. */ FILE *save_file = current_file; @@ -1384,18 +1627,14 @@ read_conffile( keytable = server_keytab; parsetable = server_var; } - current_filename = config_dir_relative(filename); + filename = config_dir_relative(filename); + current_filename = get_seen_filename(filename); + amfree(filename); if ((current_file = fopen(current_filename, "r")) == NULL) { - /* client conf files are optional, and this fprintf ends up sending this message back - * to the server without proper auth encapsulation, leading to "invalid size: could not - * open .." This is fixed in TRUNK by completely rewriting this module's error-handling - * code. */ - if (!is_client) { - g_fprintf(stderr, _("could not open conf file \"%s\": %s\n"), current_filename, - strerror(errno)); - } - got_parserror = TRUE; + if (!missing_ok) + conf_parserror(_("could not open conf file \"%s\": %s"), + current_filename, strerror(errno)); goto finish; } @@ -1409,14 +1648,11 @@ read_conffile( afclose(current_file); finish: - amfree(current_filename); /* Restore servers */ current_line_num = save_line_num; current_file = save_file; current_filename = save_filename; - - return !got_parserror; } static gboolean @@ -1427,11 +1663,12 @@ read_confline( current_line_num += 1; get_conftoken(CONF_ANY); + handle_deprecated_keyword(); + switch(tok) { case CONF_INCLUDEFILE: get_conftoken(CONF_STRING); - if (!read_conffile(tokenval.v.s, is_client)) - return 0; + read_conffile(tokenval.v.s, is_client, FALSE); break; case CONF_HOLDING: @@ -1444,13 +1681,20 @@ read_confline( case CONF_DEFINE: if (is_client) { - handle_invalid_keyword(tokenval.v.s); + get_conftoken(CONF_ANY); + if(tok == CONF_APPLICATION_TOOL) get_application(); + else if(tok == CONF_PP_SCRIPT_TOOL) get_pp_script(); + else conf_parserror(_("APPLICATION-TOOL or SCRIPT-TOOL expected")); } else { get_conftoken(CONF_ANY); if(tok == CONF_DUMPTYPE) get_dumptype(); else if(tok == CONF_TAPETYPE) get_tapetype(); else if(tok == CONF_INTERFACE) get_interface(); - else conf_parserror(_("DUMPTYPE, INTERFACE or TAPETYPE expected")); + else if(tok == CONF_APPLICATION_TOOL) get_application(); + else if(tok == CONF_PP_SCRIPT_TOOL) get_pp_script(); + else if(tok == CONF_DEVICE) get_device_config(); + else if(tok == CONF_CHANGER) get_changer_config(); + else conf_parserror(_("DUMPTYPE, INTERFACE, TAPETYPE, APPLICATION-TOOL, SCRIPT-TOOL, DEVICE, or CHANGER expected")); } break; @@ -1482,42 +1726,50 @@ read_confline( } static void -handle_invalid_keyword( - const char * token) +handle_deprecated_keyword(void) { + tok_t *dep; /* Procedure for deprecated keywords: * 1) At time of deprecation, add to warning_deprecated below. - * Note the date of deprecation. - * 2) After two years, move the keyword to error_deprecated below. + * Note the date of deprecation. The keyword will still be + * parsed, and can still be used from other parts of Amanda, + * during this time. + * 2) After two years, move the keyword (as a string) to + * error_deprecated below. Remove the token (CONF_XXX) and + * config parameter (CNF_XXX) from the rest of the module. * Note the date of the move. - * 3) After two more years, drop the token entirely. */ + */ - static const char * warning_deprecated[] = { - "rawtapedev", /* 2007-01-23 */ - "tapebufs", /* 2007-10-15 */ - "netusage", /* historical since 1997-08-11, deprecated 2007-10-23 */ - NULL + static tok_t warning_deprecated[] = { + CONF_RAWTAPEDEV, /* 2007-01-23 */ + CONF_TAPEBUFS, /* 2007-10-15 */ + CONF_FILE_PAD, /* 2008-07-01 */ + 0 }; + + for (dep = warning_deprecated; *dep; dep++) { + if (tok == *dep) { + conf_parswarn(_("warning: Keyword %s is deprecated."), + tokenval.v.s); + } + } +} + +static void +handle_invalid_keyword( + const char * token) +{ static const char * error_deprecated[] = { NULL }; const char ** s; - for (s = warning_deprecated; *s != NULL; s ++) { - if (strcmp(*s, token) == 0) { - conf_parswarn(_("warning: Keyword %s is deprecated."), - token); - break; - } - } - if (*s == NULL) { - for (s = error_deprecated; *s != NULL; s ++) { - if (strcmp(*s, token) == 0) { - conf_parserror(_("error: Keyword %s is deprecated."), - token); - return; - } - } + for (s = error_deprecated; *s != NULL; s ++) { + if (strcmp(*s, token) == 0) { + conf_parserror(_("error: Keyword %s is deprecated."), + token); + return; + } } if (*s == NULL) { conf_parserror(_("configuration keyword expected")); @@ -1534,6 +1786,24 @@ handle_invalid_keyword( g_assert_not_reached(); } +static char * +get_seen_filename( + char *filename) +{ + GSList *iter; + char *istr; + + for (iter = seen_filenames; iter; iter = iter->next) { + istr = iter->data; + if (istr == filename || 0 == strcmp(istr, filename)) + return istr; + } + + istr = stralloc(filename); + seen_filenames = g_slist_prepend(seen_filenames, istr); + return istr; +} + static void read_block( conf_var_t *read_var, @@ -1604,7 +1874,8 @@ get_holdingdisk( get_conftoken(CONF_IDENT); hdcur.name = stralloc(tokenval.v.s); - hdcur.seen = current_line_num; + hdcur.seen.filename = current_filename; + hdcur.seen.linenum = current_line_num; read_block(holding_var, hdcur.value, _("holding disk parameter expected"), 1, NULL); @@ -1620,9 +1891,9 @@ init_holdingdisk_defaults( { conf_init_str(&hdcur.value[HOLDING_COMMENT] , ""); conf_init_str(&hdcur.value[HOLDING_DISKDIR] , ""); - conf_init_am64(&hdcur.value[HOLDING_DISKSIZE] , (off_t)0); + conf_init_int64(&hdcur.value[HOLDING_DISKSIZE] , (gint64)0); /* 1 Gb = 1M counted in 1Kb blocks */ - conf_init_am64(&hdcur.value[HOLDING_CHUNKSIZE], (off_t)1024*1024); + conf_init_int64(&hdcur.value[HOLDING_CHUNKSIZE], (gint64)1024*1024); } static void @@ -1659,7 +1930,7 @@ read_dumptype( if (fname) { saved_fname = current_filename; - current_filename = fname; + current_filename = get_seen_filename(fname); } if (linenum) @@ -1675,7 +1946,8 @@ read_dumptype( get_conftoken(CONF_IDENT); dpcur.name = stralloc(tokenval.v.s); } - dpcur.seen = current_line_num; + dpcur.seen.filename = current_filename; + dpcur.seen.linenum = current_line_num; read_block(dumptype_var, dpcur.value, _("dumptype parameter expected"), @@ -1730,7 +2002,7 @@ init_dumptype_defaults(void) conf_init_int (&dpcur.value[DUMPTYPE_MAXDUMPS] , conf_data[CNF_MAXDUMPS].v.i); conf_init_int (&dpcur.value[DUMPTYPE_MAXPROMOTEDAY] , 10000); conf_init_int (&dpcur.value[DUMPTYPE_BUMPPERCENT] , conf_data[CNF_BUMPPERCENT].v.i); - conf_init_am64 (&dpcur.value[DUMPTYPE_BUMPSIZE] , conf_data[CNF_BUMPSIZE].v.am64); + conf_init_int64 (&dpcur.value[DUMPTYPE_BUMPSIZE] , conf_data[CNF_BUMPSIZE].v.int64); conf_init_int (&dpcur.value[DUMPTYPE_BUMPDAYS] , conf_data[CNF_BUMPDAYS].v.i); conf_init_real (&dpcur.value[DUMPTYPE_BUMPMULT] , conf_data[CNF_BUMPMULT].v.r); conf_init_time (&dpcur.value[DUMPTYPE_STARTTIME] , (time_t)0); @@ -1741,8 +2013,8 @@ init_dumptype_defaults(void) conf_init_str (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT] , "-d"); conf_init_str (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT] , "-d"); conf_init_rate (&dpcur.value[DUMPTYPE_COMPRATE] , 0.50, 0.50); - conf_init_am64 (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE] , (off_t)0); - conf_init_am64 (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (off_t)10 * 1024); + conf_init_int64 (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE] , (gint64)0); + conf_init_int64 (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (gint64)10 * 1024); conf_init_str (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER] , NULL); conf_init_bool (&dpcur.value[DUMPTYPE_RECORD] , 1); conf_init_bool (&dpcur.value[DUMPTYPE_SKIP_INCR] , 0); @@ -1751,6 +2023,9 @@ init_dumptype_defaults(void) conf_init_bool (&dpcur.value[DUMPTYPE_KENCRYPT] , 0); conf_init_bool (&dpcur.value[DUMPTYPE_IGNORE] , 0); conf_init_bool (&dpcur.value[DUMPTYPE_INDEX] , 1); + conf_init_application(&dpcur.value[DUMPTYPE_APPLICATION]); + conf_init_pp_scriptlist(&dpcur.value[DUMPTYPE_PP_SCRIPTLIST]); + conf_init_proplist(&dpcur.value[DUMPTYPE_PROPERTY]); } static void @@ -1761,7 +2036,12 @@ save_dumptype(void) dp = lookup_dumptype(dpcur.name); if(dp != (dumptype_t *)0) { - conf_parserror(_("dumptype %s already defined on line %d"), dp->name, dp->seen); + if (dp->seen.linenum == -1) { + conf_parserror(_("dumptype %s is defined by default and cannot be redefined"), dp->name); + } else { + conf_parserror(_("dumptype %s already defined at %s:%d"), dp->name, + dp->seen.filename, dp->seen.linenum); + } return; } @@ -1794,7 +2074,7 @@ copy_dumptype(void) } for(i=0; i < DUMPTYPE_DUMPTYPE; i++) { - if(dt->value[i].seen) { + if(dt->value[i].seen.linenum) { free_val_t(&dpcur.value[i]); copy_val_t(&dpcur.value[i], &dt->value[i]); } @@ -1813,7 +2093,8 @@ get_tapetype(void) get_conftoken(CONF_IDENT); tpcur.name = stralloc(tokenval.v.s); - tpcur.seen = current_line_num; + tpcur.seen.filename = current_filename; + tpcur.seen.linenum = current_line_num; read_block(tapetype_var, tpcur.value, _("tapetype parameter expected"), 1, copy_tapetype); @@ -1835,9 +2116,9 @@ init_tapetype_defaults(void) conf_init_str(&tpcur.value[TAPETYPE_COMMENT] , ""); conf_init_str(&tpcur.value[TAPETYPE_LBL_TEMPL] , ""); conf_init_size (&tpcur.value[TAPETYPE_BLOCKSIZE] , DISK_BLOCK_KB); - conf_init_size (&tpcur.value[TAPETYPE_READBLOCKSIZE], MAX_TAPE_BLOCK_KB); - conf_init_am64 (&tpcur.value[TAPETYPE_LENGTH] , ((off_t)2000 * 1024)); - conf_init_am64 (&tpcur.value[TAPETYPE_FILEMARK] , (off_t)1000); + conf_init_size (&tpcur.value[TAPETYPE_READBLOCKSIZE], DISK_BLOCK_KB); + conf_init_int64 (&tpcur.value[TAPETYPE_LENGTH] , ((gint64)2000 * 1024)); + conf_init_int64 (&tpcur.value[TAPETYPE_FILEMARK] , (gint64)1000); conf_init_int (&tpcur.value[TAPETYPE_SPEED] , 200); conf_init_bool (&tpcur.value[TAPETYPE_FILE_PAD] , 1); } @@ -1851,7 +2132,8 @@ save_tapetype(void) if(tp != (tapetype_t *)0) { amfree(tpcur.name); - conf_parserror(_("tapetype %s already defined on line %d"), tp->name, tp->seen); + conf_parserror(_("tapetype %s already defined at %s:%d"), + tp->name, tp->seen.filename, tp->seen.linenum); return; } @@ -1883,7 +2165,7 @@ copy_tapetype(void) } for(i=0; i < TAPETYPE_TAPETYPE; i++) { - if(tp->value[i].seen) { + if(tp->value[i].seen.linenum) { free_val_t(&tpcur.value[i]); copy_val_t(&tpcur.value[i], &tp->value[i]); } @@ -1902,7 +2184,8 @@ get_interface(void) get_conftoken(CONF_IDENT); ifcur.name = stralloc(tokenval.v.s); - ifcur.seen = current_line_num; + ifcur.seen.filename = current_filename; + ifcur.seen.linenum = current_line_num; read_block(interface_var, ifcur.value, _("interface parameter expected"), 1, copy_interface); @@ -1930,8 +2213,8 @@ save_interface(void) ip = lookup_interface(ifcur.name); if(ip != (interface_t *)0) { - conf_parserror(_("interface %s already defined on line %d"), ip->name, - ip->seen); + conf_parserror(_("interface %s already defined at %s:%d"), + ip->name, ip->seen.filename, ip->seen.linenum); return; } @@ -1963,104 +2246,622 @@ copy_interface(void) } for(i=0; i < INTER_INTER; i++) { - if(ip->value[i].seen) { + if(ip->value[i].seen.linenum) { free_val_t(&ifcur.value[i]); copy_val_t(&ifcur.value[i], &ip->value[i]); } } } -/* Read functions */ -static void -read_int( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +application_t * +read_application( + char *name, + FILE *from, + char *fname, + int *linenum) { - ckseen(&val->seen); - val_t__int(val) = get_int(); + int save_overwrites; + FILE *saved_conf = NULL; + char *saved_fname = NULL; + + if (from) { + saved_conf = current_file; + current_file = from; + } + + if (fname) { + saved_fname = current_filename; + current_filename = get_seen_filename(fname); + } + + if (linenum) + current_line_num = *linenum; + + save_overwrites = allow_overwrites; + allow_overwrites = 1; + + init_application_defaults(); + if (name) { + apcur.name = name; + } else { + get_conftoken(CONF_IDENT); + apcur.name = stralloc(tokenval.v.s); + } + apcur.seen.filename = current_filename; + apcur.seen.linenum = current_line_num; + + read_block(application_var, apcur.value, + _("application-tool parameter expected"), + (name == NULL), *copy_application); + if(!name) + get_conftoken(CONF_NL); + + if (!application_get_plugin(&apcur) || + strlen(application_get_plugin(&apcur)) == 0) { + conf_parserror("plugin not set for application"); + } + + save_application(); + + allow_overwrites = save_overwrites; + + if (linenum) + *linenum = current_line_num; + + if (fname) + current_filename = saved_fname; + + if (from) + current_file = saved_conf; + + return lookup_application(apcur.name); } static void -read_am64( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +get_application( + void) { - ckseen(&val->seen); - val_t__am64(val) = get_am64_t(); + read_application(NULL, NULL, NULL, NULL); } static void -read_real( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +init_application_defaults( + void) { - ckseen(&val->seen); - get_conftoken(CONF_REAL); - val_t__real(val) = tokenval.v.r; + apcur.name = NULL; + conf_init_str(&apcur.value[APPLICATION_COMMENT] , ""); + conf_init_str(&apcur.value[APPLICATION_PLUGIN] , ""); + conf_init_proplist(&apcur.value[APPLICATION_PROPERTY]); } static void -read_str( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +save_application( + void) { - ckseen(&val->seen); - get_conftoken(CONF_STRING); - val->v.s = newstralloc(val->v.s, tokenval.v.s); + application_t *ap, *ap1; + + ap = lookup_application(apcur.name); + + if(ap != (application_t *)0) { + conf_parserror(_("application-tool %s already defined at %s:%d"), + ap->name, ap->seen.filename, ap->seen.linenum); + return; + } + + ap = alloc(sizeof(application_t)); + *ap = apcur; + ap->next = NULL; + /* add at end of list */ + if (!application_list) + application_list = ap; + else { + ap1 = application_list; + while (ap1->next != NULL) { + ap1 = ap1->next; + } + ap1->next = ap; + } } static void -read_ident( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +copy_application(void) { - ckseen(&val->seen); - get_conftoken(CONF_IDENT); - val->v.s = newstralloc(val->v.s, tokenval.v.s); + application_t *ap; + int i; + + ap = lookup_application(tokenval.v.s); + + if(ap == NULL) { + conf_parserror(_("application parameter expected")); + return; + } + + for(i=0; i < APPLICATION_APPLICATION; i++) { + if(ap->value[i].seen.linenum) { + free_val_t(&apcur.value[i]); + copy_val_t(&apcur.value[i], &ap->value[i]); + } + } } -static void -read_time( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +pp_script_t * +read_pp_script( + char *name, + FILE *from, + char *fname, + int *linenum) { - ckseen(&val->seen); - val_t__time(val) = get_time(); + int save_overwrites; + FILE *saved_conf = NULL; + char *saved_fname = NULL; + + if (from) { + saved_conf = current_file; + current_file = from; + } + + if (fname) { + saved_fname = current_filename; + current_filename = get_seen_filename(fname); + } + + if (linenum) + current_line_num = *linenum; + + save_overwrites = allow_overwrites; + allow_overwrites = 1; + + init_pp_script_defaults(); + if (name) { + pscur.name = name; + } else { + get_conftoken(CONF_IDENT); + pscur.name = stralloc(tokenval.v.s); + } + pscur.seen.filename = current_filename; + pscur.seen.linenum = current_line_num; + + read_block(pp_script_var, pscur.value, + _("script-tool parameter expected"), + (name == NULL), *copy_pp_script); + if(!name) + get_conftoken(CONF_NL); + + if (!pp_script_get_plugin(&pscur) || + strlen(pp_script_get_plugin(&pscur)) == 0) { + conf_parserror("plugin not set for script"); + } + + save_pp_script(); + + allow_overwrites = save_overwrites; + + if (linenum) + *linenum = current_line_num; + + if (fname) + current_filename = saved_fname; + + if (from) + current_file = saved_conf; + + return lookup_pp_script(pscur.name); } static void -read_size( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +get_pp_script( + void) { - ckseen(&val->seen); - val_t__size(val) = get_size(); + read_pp_script(NULL, NULL, NULL, NULL); } static void -read_bool( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +init_pp_script_defaults( + void) { - ckseen(&val->seen); - val_t__boolean(val) = get_bool(); + pscur.name = NULL; + conf_init_str(&pscur.value[PP_SCRIPT_COMMENT] , ""); + conf_init_str(&pscur.value[PP_SCRIPT_PLUGIN] , ""); + conf_init_proplist(&pscur.value[PP_SCRIPT_PROPERTY]); + conf_init_execute_on(&pscur.value[PP_SCRIPT_EXECUTE_ON], 0); + conf_init_execute_where(&pscur.value[PP_SCRIPT_EXECUTE_WHERE], ES_CLIENT); } static void -read_compress( - conf_var_t *np G_GNUC_UNUSED, - val_t *val) +save_pp_script( + void) { - int serv, clie, none, fast, best, custom; - int done; - comp_t comp; + pp_script_t *ps, *ps1; - ckseen(&val->seen); + ps = lookup_pp_script(pscur.name); - serv = clie = none = fast = best = custom = 0; + if(ps != (pp_script_t *)0) { + conf_parserror(_("script-tool %s already defined at %s:%d"), + ps->name, ps->seen.filename, ps->seen.linenum); + return; + } - done = 0; + ps = alloc(sizeof(pp_script_t)); + *ps = pscur; + ps->next = NULL; + /* add at end of list */ + if (!pp_script_list) + pp_script_list = ps; + else { + ps1 = pp_script_list; + while (ps1->next != NULL) { + ps1 = ps1->next; + } + ps1->next = ps; + } +} + +static void +copy_pp_script(void) +{ + pp_script_t *ps; + int i; + + ps = lookup_pp_script(tokenval.v.s); + + if(ps == NULL) { + conf_parserror(_("script parameter expected")); + return; + } + + for(i=0; i < PP_SCRIPT_PP_SCRIPT; i++) { + if(ps->value[i].seen.linenum) { + free_val_t(&pscur.value[i]); + copy_val_t(&pscur.value[i], &ps->value[i]); + } + } +} + +device_config_t * +read_device_config( + char *name, + FILE *from, + char *fname, + int *linenum) +{ + int save_overwrites; + FILE *saved_conf = NULL; + char *saved_fname = NULL; + + if (from) { + saved_conf = current_file; + current_file = from; + } + + if (fname) { + saved_fname = current_filename; + current_filename = get_seen_filename(fname); + } + + if (linenum) + current_line_num = *linenum; + + save_overwrites = allow_overwrites; + allow_overwrites = 1; + + init_device_config_defaults(); + if (name) { + dccur.name = name; + } else { + get_conftoken(CONF_IDENT); + dccur.name = stralloc(tokenval.v.s); + } + dccur.seen.filename = current_filename; + dccur.seen.linenum = current_line_num; + + read_block(device_config_var, dccur.value, + _("device parameter expected"), + (name == NULL), *copy_device_config); + if(!name) + get_conftoken(CONF_NL); + + save_device_config(); + + allow_overwrites = save_overwrites; + + if (linenum) + *linenum = current_line_num; + + if (fname) + current_filename = saved_fname; + + if (from) + current_file = saved_conf; + + return lookup_device_config(dccur.name); +} + +static void +get_device_config( + void) +{ + read_device_config(NULL, NULL, NULL, NULL); +} + +static void +init_device_config_defaults( + void) +{ + dccur.name = NULL; + conf_init_str(&dccur.value[DEVICE_CONFIG_COMMENT] , ""); + conf_init_str(&dccur.value[DEVICE_CONFIG_TAPEDEV] , ""); + conf_init_proplist(&dccur.value[DEVICE_CONFIG_DEVICE_PROPERTY]); +} + +static void +save_device_config( + void) +{ + device_config_t *dc, *dc1; + + dc = lookup_device_config(dccur.name); + + if(dc != (device_config_t *)0) { + conf_parserror(_("device %s already defined at %s:%d"), + dc->name, dc->seen.filename, dc->seen.linenum); + return; + } + + dc = alloc(sizeof(device_config_t)); + *dc = dccur; + dc->next = NULL; + /* add at end of list */ + if (!device_config_list) + device_config_list = dc; + else { + dc1 = device_config_list; + while (dc1->next != NULL) { + dc1 = dc1->next; + } + dc1->next = dc; + } +} + +static void +copy_device_config(void) +{ + device_config_t *dc; + int i; + + dc = lookup_device_config(tokenval.v.s); + + if(dc == NULL) { + conf_parserror(_("device parameter expected")); + return; + } + + for(i=0; i < DEVICE_CONFIG_DEVICE_CONFIG; i++) { + if(dc->value[i].seen.linenum) { + free_val_t(&dccur.value[i]); + copy_val_t(&dccur.value[i], &dc->value[i]); + } + } +} + +changer_config_t * +read_changer_config( + char *name, + FILE *from, + char *fname, + int *linenum) +{ + int save_overwrites; + FILE *saved_conf = NULL; + char *saved_fname = NULL; + + if (from) { + saved_conf = current_file; + current_file = from; + } + + if (fname) { + saved_fname = current_filename; + current_filename = fname; + } + + if (linenum) + current_line_num = *linenum; + + save_overwrites = allow_overwrites; + allow_overwrites = 1; + + init_changer_config_defaults(); + if (name) { + cccur.name = name; + } else { + get_conftoken(CONF_IDENT); + cccur.name = stralloc(tokenval.v.s); + } + cccur.seen = current_line_num; + + read_block(changer_config_var, cccur.value, + _("changer parameter expected"), + (name == NULL), *copy_changer_config); + if(!name) + get_conftoken(CONF_NL); + + save_changer_config(); + + allow_overwrites = save_overwrites; + + if (linenum) + *linenum = current_line_num; + + if (fname) + current_filename = saved_fname; + + if (from) + current_file = saved_conf; + + return lookup_changer_config(cccur.name); +} + +static void +get_changer_config( + void) +{ + read_changer_config(NULL, NULL, NULL, NULL); +} + +static void +init_changer_config_defaults( + void) +{ + cccur.name = NULL; + conf_init_str(&cccur.value[CHANGER_CONFIG_COMMENT] , ""); + conf_init_str(&cccur.value[CHANGER_CONFIG_TAPEDEV] , ""); + conf_init_str(&cccur.value[CHANGER_CONFIG_TPCHANGER] , ""); + conf_init_str(&cccur.value[CHANGER_CONFIG_CHANGERDEV] , ""); + conf_init_str(&cccur.value[CHANGER_CONFIG_CHANGERFILE] , ""); +} + +static void +save_changer_config( + void) +{ + changer_config_t *dc, *dc1; + + dc = lookup_changer_config(cccur.name); + + if(dc != (changer_config_t *)0) { + conf_parserror(_("changer %s already defined on line %d"), + dc->name, dc->seen); + return; + } + + dc = alloc(sizeof(changer_config_t)); + *dc = cccur; + dc->next = NULL; + /* add at end of list */ + if (!changer_config_list) + changer_config_list = dc; + else { + dc1 = changer_config_list; + while (dc1->next != NULL) { + dc1 = dc1->next; + } + dc1->next = dc; + } +} + +static void +copy_changer_config(void) +{ + changer_config_t *dc; + int i; + + dc = lookup_changer_config(tokenval.v.s); + + if(dc == NULL) { + conf_parserror(_("changer parameter expected")); + return; + } + + for(i=0; i < CHANGER_CONFIG_CHANGER_CONFIG; i++) { + if(dc->value[i].seen.linenum) { + free_val_t(&cccur.value[i]); + copy_val_t(&cccur.value[i], &dc->value[i]); + } + } +} + +/* Read functions */ + +static void +read_int( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__int(val) = get_int(); +} + +static void +read_int64( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__int64(val) = get_int64(); +} + +static void +read_real( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + get_conftoken(CONF_REAL); + val_t__real(val) = tokenval.v.r; +} + +static void +read_str( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + get_conftoken(CONF_STRING); + val->v.s = newstralloc(val->v.s, tokenval.v.s); +} + +static void +read_ident( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + get_conftoken(CONF_IDENT); + val->v.s = newstralloc(val->v.s, tokenval.v.s); +} + +static void +read_time( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__time(val) = get_time(); +} + +static void +read_size( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__size(val) = get_size(); +} + +static void +read_bool( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + val_t__boolean(val) = get_bool(); +} + +static void +read_compress( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + int serv, clie, none, fast, best, custom; + int done; + comp_t comp; + + ckseen(&val->seen); + + serv = clie = none = fast = best = custom = 0; + + done = 0; do { get_conftoken(CONF_ANY); switch(tok) { @@ -2258,6 +3059,24 @@ read_taperalgo( } } +static void +read_send_amreport_on( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_ALL: val_t__send_amreport(val) = SEND_AMREPORT_ALL; break; + case CONF_STRANGE: val_t__send_amreport(val) = SEND_AMREPORT_STRANGE; break; + case CONF_ERROR: val_t__send_amreport(val) = SEND_AMREPORT_ERROR; break; + case CONF_NEVER: val_t__send_amreport(val) = SEND_AMREPORT_NEVER; break; + default: + conf_parserror(_("ALL, STRANGE, ERROR or NEVER expected")); + } +} + static void read_priority( conf_var_t *np G_GNUC_UNUSED, @@ -2398,19 +3217,185 @@ read_intrange( static void read_property( conf_var_t *np G_GNUC_UNUSED, - val_t *val) + val_t *val) { - char *key, *value; - get_conftoken(CONF_STRING); + char *key; + property_t *property = malloc(sizeof(property_t)); + property_t *old_property; + property->append = 0; + property->priority = 0; + property->values = NULL; + + get_conftoken(CONF_ANY); + if (tok == CONF_PRIORITY) { + property->priority = 1; + get_conftoken(CONF_ANY); + } + if (tok == CONF_APPEND) { + property->append = 1; + get_conftoken(CONF_ANY); + } + if (tok != CONF_STRING) { + conf_parserror(_("key expected")); + return; + } key = strdup(tokenval.v.s); - get_conftoken(CONF_STRING); - value = strdup(tokenval.v.s); - g_hash_table_insert(val_t__proplist(val), key, value); + get_conftoken(CONF_ANY); + if (tok == CONF_NL || tok == CONF_END) { + g_hash_table_remove(val->v.proplist, key); + unget_conftoken(); + return; + } + if (tok != CONF_STRING) { + conf_parserror(_("value expected")); + return; + } + + if(val->seen.linenum == 0) { + val->seen.filename = current_filename; + val->seen.linenum = current_line_num; + } + + old_property = g_hash_table_lookup(val->v.proplist, key); + if (property->append) { + if (old_property) { + if (old_property->priority) + property->priority = 1; + property->values = old_property->values; + } + } else { + property->values = g_hash_table_lookup(val->v.proplist, key); + if (old_property) { + g_slist_free(old_property->values); + amfree(old_property); + } + property->values = NULL; + } + while(tok == CONF_STRING) { + property->values = g_slist_append(property->values, + strdup(tokenval.v.s)); + get_conftoken(CONF_ANY); + } + unget_conftoken(); + g_hash_table_insert(val->v.proplist, key, property); +} + + +static void +read_dapplication( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + + get_conftoken(CONF_ANY); + if (tok == CONF_LBRACE) { + val->v.application = read_application(vstralloc("custom(DUMPTYPE:", + dpcur.name, ")", ".", + anonymous_value(),NULL), + NULL, NULL, NULL); + + } else if (tok == CONF_STRING) { + val->v.application = lookup_application(tokenval.v.s); + if (val->v.application == NULL) { + conf_parserror(_("Unknown application named: %s"), tokenval.v.s); + return; + } + } else { + conf_parserror(_("application name expected: %d %d"), tok, CONF_STRING); + return; + } + ckseen(&val->seen); +} + +static void +read_dpp_script( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + pp_script_t *pp_script; + get_conftoken(CONF_ANY); + if (tok == CONF_LBRACE) { + pp_script = read_pp_script(vstralloc("custom(DUMPTYPE:", dpcur.name, + ")", ".", anonymous_value(),NULL), + NULL, NULL, NULL); + } else if (tok == CONF_STRING) { + pp_script = lookup_pp_script(tokenval.v.s); + if (pp_script == NULL) { + conf_parserror(_("Unknown pp_script named: %s"), tokenval.v.s); + return; + } + } else { + conf_parserror(_("pp_script name expected: %d %d"), tok, CONF_STRING); + return; + } + val->v.pp_scriptlist = g_slist_append(val->v.pp_scriptlist, pp_script); + ckseen(&val->seen); +} +static void +read_execute_on( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + + get_conftoken(CONF_ANY); + val->v.i = 0; + do { + switch(tok) { + case CONF_PRE_DLE_AMCHECK: val->v.i |= EXECUTE_ON_PRE_DLE_AMCHECK; break; + case CONF_PRE_HOST_AMCHECK: val->v.i |= EXECUTE_ON_PRE_HOST_AMCHECK; break; + case CONF_POST_DLE_AMCHECK: val->v.i |= EXECUTE_ON_POST_DLE_AMCHECK; break; + case CONF_POST_HOST_AMCHECK: val->v.i |= EXECUTE_ON_POST_HOST_AMCHECK; break; + case CONF_PRE_DLE_ESTIMATE: val->v.i |= EXECUTE_ON_PRE_DLE_ESTIMATE; break; + case CONF_PRE_HOST_ESTIMATE: val->v.i |= EXECUTE_ON_PRE_HOST_ESTIMATE; break; + case CONF_POST_DLE_ESTIMATE: val->v.i |= EXECUTE_ON_POST_DLE_ESTIMATE; break; + case CONF_POST_HOST_ESTIMATE: val->v.i |= EXECUTE_ON_POST_HOST_ESTIMATE; break; + case CONF_PRE_DLE_BACKUP: val->v.i |= EXECUTE_ON_PRE_DLE_BACKUP; break; + case CONF_PRE_HOST_BACKUP: val->v.i |= EXECUTE_ON_PRE_HOST_BACKUP; break; + case CONF_POST_DLE_BACKUP: val->v.i |= EXECUTE_ON_POST_DLE_BACKUP; break; + case CONF_POST_HOST_BACKUP: val->v.i |= EXECUTE_ON_POST_HOST_BACKUP; break; + case CONF_PRE_RECOVER: val->v.i |= EXECUTE_ON_PRE_RECOVER; break; + case CONF_POST_RECOVER: val->v.i |= EXECUTE_ON_POST_RECOVER; break; + case CONF_PRE_LEVEL_RECOVER: val->v.i |= EXECUTE_ON_PRE_LEVEL_RECOVER; break; + case CONF_POST_LEVEL_RECOVER: val->v.i |= EXECUTE_ON_POST_LEVEL_RECOVER; break; + case CONF_INTER_LEVEL_RECOVER: val->v.i |= EXECUTE_ON_INTER_LEVEL_RECOVER; break; + default: + conf_parserror(_("Execute_on expected")); + } + get_conftoken(CONF_ANY); + if (tok != CONF_COMMA) { + unget_conftoken(); + break; + } + get_conftoken(CONF_ANY); + } while (1); +} + +static void +read_execute_where( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + ckseen(&val->seen); + + get_conftoken(CONF_ANY); + switch(tok) { + case CONF_CLIENT: val->v.i = ES_CLIENT; break; + case CONF_SERVER: val->v.i = ES_SERVER; break; + default: + conf_parserror(_("CLIENT or SERVER expected")); + } } /* get_* functions */ +/* these functions use precompiler conditionals to skip useless size checks + * when casting from one type to another. SIZEOF_GINT64 is pretty simple to + * calculate; the others are calculated by configure. */ + +#define SIZEOF_GINT64 8 + static time_t get_time(void) { @@ -2420,7 +3405,7 @@ get_time(void) switch(tok) { case CONF_INT: #if SIZEOF_TIME_T < SIZEOF_INT - if ((off_t)tokenval.v.i >= (off_t)TIME_MAX) + if ((gint64)tokenval.v.i >= (gint64)TIME_MAX) conf_parserror(_("value too large")); #endif hhmm = (time_t)tokenval.v.i; @@ -2428,18 +3413,18 @@ get_time(void) case CONF_SIZE: #if SIZEOF_TIME_T < SIZEOF_SSIZE_T - if ((off_t)tokenval.v.size >= (off_t)TIME_MAX) + if ((gint64)tokenval.v.size >= (gint64)TIME_MAX) conf_parserror(_("value too large")); #endif hhmm = (time_t)tokenval.v.size; break; - case CONF_AM64: -#if SIZEOF_TIME_T < SIZEOF_LONG_LONG - if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX) + case CONF_INT64: +#if SIZEOF_TIME_T < SIZEOF_GINT64 + if ((gint64)tokenval.v.int64 >= (gint64)TIME_MAX) conf_parserror(_("value too large")); #endif - hhmm = (time_t)tokenval.v.am64; + hhmm = (time_t)tokenval.v.int64; break; case CONF_AMINFINITY: @@ -2471,22 +3456,22 @@ get_int(void) case CONF_SIZE: #if SIZEOF_INT < SIZEOF_SSIZE_T - if ((off_t)tokenval.v.size > (off_t)INT_MAX) + if ((gint64)tokenval.v.size > (gint64)INT_MAX) conf_parserror(_("value too large")); - if ((off_t)tokenval.v.size < (off_t)INT_MIN) + if ((gint64)tokenval.v.size < (gint64)INT_MIN) conf_parserror(_("value too small")); #endif val = (int)tokenval.v.size; break; - case CONF_AM64: -#if SIZEOF_INT < SIZEOF_LONG_LONG - if (tokenval.v.am64 > (off_t)INT_MAX) + case CONF_INT64: +#if SIZEOF_INT < SIZEOF_GINT64 + if (tokenval.v.int64 > (gint64)INT_MAX) conf_parserror(_("value too large")); - if (tokenval.v.am64 < (off_t)INT_MIN) + if (tokenval.v.int64 < (gint64)INT_MIN) conf_parserror(_("value too small")); #endif - val = (int)tokenval.v.am64; + val = (int)tokenval.v.int64; break; case CONF_AMINFINITY: @@ -2559,22 +3544,22 @@ get_size(void) case CONF_INT: #if SIZEOF_SIZE_T < SIZEOF_INT - if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX) + if ((gint64)tokenval.v.i > (gint64)SSIZE_MAX) conf_parserror(_("value too large")); - if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN) + if ((gint64)tokenval.v.i < (gint64)SSIZE_MIN) conf_parserror(_("value too small")); #endif val = (ssize_t)tokenval.v.i; break; - case CONF_AM64: -#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG - if (tokenval.v.am64 > (off_t)SSIZE_MAX) + case CONF_INT64: +#if SIZEOF_SIZE_T < SIZEOF_GINT64 + if (tokenval.v.int64 > (gint64)SSIZE_MAX) conf_parserror(_("value too large")); - if (tokenval.v.am64 < (off_t)SSIZE_MIN) + if (tokenval.v.int64 < (gint64)SSIZE_MIN) conf_parserror(_("value too small")); #endif - val = (ssize_t)tokenval.v.am64; + val = (ssize_t)tokenval.v.int64; break; case CONF_AMINFINITY: @@ -2629,10 +3614,10 @@ get_size(void) return val; } -static off_t -get_am64_t(void) +static gint64 +get_int64(void) { - off_t val; + gint64 val; keytab_t *save_kt; save_kt = keytable; @@ -2642,19 +3627,19 @@ get_am64_t(void) switch(tok) { case CONF_INT: - val = (off_t)tokenval.v.i; + val = (gint64)tokenval.v.i; break; case CONF_SIZE: - val = (off_t)tokenval.v.size; + val = (gint64)tokenval.v.size; break; - case CONF_AM64: - val = tokenval.v.am64; + case CONF_INT64: + val = tokenval.v.int64; break; case CONF_AMINFINITY: - val = AM64_MAX; + val = G_MAXINT64; break; default: @@ -2673,19 +3658,19 @@ get_am64_t(void) break; case CONF_MULT7: - if (val > AM64_MAX/7 || val < AM64_MIN/7) + if (val > G_MAXINT64/7 || val < ((gint64)G_MININT64)/7) conf_parserror(_("value too large")); val *= 7; break; case CONF_MULT1M: - if (val > AM64_MAX/1024 || val < AM64_MIN/1024) + if (val > G_MAXINT64/1024 || val < ((gint64)G_MININT64)/1024) conf_parserror(_("value too large")); val *= 1024; break; case CONF_MULT1G: - if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024)) + if (val > G_MAXINT64/(1024*1024) || val < ((gint64)G_MININT64)/(1024*1024)) conf_parserror(_("value too large")); val *= 1024*1024; break; @@ -2726,8 +3711,8 @@ get_bool(void) val = 0; break; - case CONF_AM64: - if (tokenval.v.am64 != (off_t)0) + case CONF_INT64: + if (tokenval.v.int64 != (gint64)0) val = 1; else val = 0; @@ -2758,12 +3743,14 @@ get_bool(void) void ckseen( - int *seen) + seen_t *seen) { - if (*seen && !allow_overwrites && current_line_num != -2) { - conf_parserror(_("duplicate parameter, prev def on line %d"), *seen); + if (seen->linenum && !allow_overwrites && current_line_num != -2) { + conf_parserror(_("duplicate parameter; previous definition %s:%d"), + seen->filename, seen->linenum); } - *seen = current_line_num; + seen->filename = current_filename; + seen->linenum = current_line_num; } /* Validation functions */ @@ -2778,8 +3765,8 @@ validate_nonnegative( if(val_t__int(val) < 0) conf_parserror(_("%s must be nonnegative"), get_token_name(np->token)); break; - case CONFTYPE_AM64: - if(val_t__am64(val) < 0) + case CONFTYPE_INT64: + if(val_t__int64(val) < 0) conf_parserror(_("%s must be nonnegative"), get_token_name(np->token)); break; case CONFTYPE_SIZE: @@ -2801,8 +3788,8 @@ validate_positive( if(val_t__int(val) < 1) conf_parserror(_("%s must be positive"), get_token_name(np->token)); break; - case CONFTYPE_AM64: - if(val_t__am64(val) < 1) + case CONFTYPE_INT64: + if(val_t__int64(val) < 1) conf_parserror(_("%s must be positive"), get_token_name(np->token)); break; case CONFTYPE_TIME: @@ -2899,7 +3886,7 @@ validate_use( struct conf_var_s *np G_GNUC_UNUSED, val_t *val) { - val_t__am64(val) = am_floor(val_t__am64(val), DISK_BLOCK_KB); + val_t__int64(val) = am_floor(val_t__int64(val), DISK_BLOCK_KB); } static void @@ -2908,14 +3895,14 @@ validate_chunksize( val_t *val) { /* NOTE: this function modifies the target value (rounding) */ - if(val_t__am64(val) == 0) { - val_t__am64(val) = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB)); + if(val_t__int64(val) == 0) { + val_t__int64(val) = ((G_MAXINT64 / 1024) - (2 * DISK_BLOCK_KB)); } - else if(val_t__am64(val) < 0) { - conf_parserror(_("Negative chunksize (%lld) is no longer supported"), (long long)val_t__am64(val)); + else if(val_t__int64(val) < 0) { + conf_parserror(_("Negative chunksize (%lld) is no longer supported"), (long long)val_t__int64(val)); } - val_t__am64(val) = am_floor(val_t__am64(val), (off_t)DISK_BLOCK_KB); - if (val_t__am64(val) < 2*DISK_BLOCK_KB) { + val_t__int64(val) = am_floor(val_t__int64(val), (gint64)DISK_BLOCK_KB); + if (val_t__int64(val) < 2*DISK_BLOCK_KB) { conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB); } } @@ -2981,7 +3968,7 @@ validate_unreserved_port_range( * Initialization Implementation */ -gboolean +cfgerr_level_t config_init( config_init_flags flags, char *arg_config_name) @@ -3029,9 +4016,12 @@ config_init( amfree(config_name); config_dir = newstralloc(config_dir, CONFIG_DIR); } else { - /* ok, then, we won't read anything (for e.g., amrestore) */ + /* ok, then, we won't read anything (for e.g., amrestore), but + * will set up for server-side config_overwrites */ amfree(config_name); amfree(config_dir); + keytable = server_keytab; + parsetable = server_var; } /* If we have a config_dir, we can try reading something */ @@ -3042,23 +4032,16 @@ config_init( config_filename = newvstralloc(config_filename, config_dir, "/amanda.conf", NULL); } - /* try to read the file, and handle parse errors */ - if (!read_conffile(config_filename, flags & CONFIG_INIT_CLIENT)) { - if (flags & CONFIG_INIT_FATAL) { - error(_("errors processing config file \"%s\""), config_filename); - /* NOTREACHED */ - } else { - g_warning(_("errors processing config file \"%s\" (non-fatal)"), config_filename); - return FALSE; - } - } + read_conffile(config_filename, + flags & CONFIG_INIT_CLIENT, + flags & CONFIG_INIT_CLIENT); } else { amfree(config_filename); } update_derived_values(flags & CONFIG_INIT_CLIENT); - return TRUE; + return cfgerr_level; } void @@ -3068,6 +4051,10 @@ config_uninit(void) dumptype_t *dp, *dpnext; tapetype_t *tp, *tpnext; interface_t *ip, *ipnext; + application_t *ap, *apnext; + pp_script_t *pp, *ppnext; + device_config_t *dc, *dcnext; + changer_config_t *cc, *ccnext; int i; if (!config_initialized) return; @@ -3112,6 +4099,47 @@ config_uninit(void) } interface_list = NULL; + for(ap=application_list; ap != NULL; ap = apnext) { + amfree(ap->name); + for(i=0; ivalue[i]); + } + apnext = ap->next; + amfree(ap); + } + application_list = NULL; + + for(pp=pp_script_list; pp != NULL; pp = ppnext) { + amfree(pp->name); + for(i=0; ivalue[i]); + } + ppnext = pp->next; + amfree(pp); + } + pp_script_list = NULL; + + for(dc=device_config_list; dc != NULL; dc = dcnext) { + amfree(dc->name); + for(i=0; ivalue[i]); + } + dcnext = dc->next; + amfree(dc); + } + device_config_list = NULL; + + for(cc=changer_config_list; cc != NULL; cc = ccnext) { + amfree(cc->name); + for(i=0; ivalue[i]); + } + ccnext = cc->next; + amfree(cc); + } + + changer_config_list = NULL; + for(i=0; iseen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_INT; val_t__int(val) = i; } static void -conf_init_am64( +conf_init_int64( val_t *val, - off_t l) + gint64 l) { - val->seen = 0; - val->type = CONFTYPE_AM64; - val_t__am64(val) = l; + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_INT64; + val_t__int64(val) = l; } static void @@ -3465,7 +4504,8 @@ conf_init_real( val_t *val, float r) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_REAL; val_t__real(val) = r; } @@ -3475,7 +4515,8 @@ conf_init_str( val_t *val, char *s) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_STR; if(s) val->v.s = stralloc(s); @@ -3488,7 +4529,8 @@ conf_init_ident( val_t *val, char *s) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_IDENT; if(s) val->v.s = stralloc(s); @@ -3501,7 +4543,8 @@ conf_init_time( val_t *val, time_t t) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_TIME; val_t__time(val) = t; } @@ -3511,7 +4554,8 @@ conf_init_size( val_t *val, ssize_t sz) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_SIZE; val_t__size(val) = sz; } @@ -3521,7 +4565,8 @@ conf_init_bool( val_t *val, int i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_BOOLEAN; val_t__boolean(val) = i; } @@ -3531,7 +4576,8 @@ conf_init_compress( val_t *val, comp_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_COMPRESS; val_t__compress(val) = (int)i; } @@ -3541,7 +4587,8 @@ conf_init_encrypt( val_t *val, encrypt_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_ENCRYPT; val_t__encrypt(val) = (int)i; } @@ -3551,7 +4598,8 @@ conf_init_holding( val_t *val, dump_holdingdisk_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_HOLDING; val_t__holding(val) = (int)i; } @@ -3561,7 +4609,8 @@ conf_init_estimate( val_t *val, estimate_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_ESTIMATE; val_t__estimate(val) = i; } @@ -3571,7 +4620,8 @@ conf_init_strategy( val_t *val, strategy_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_STRATEGY; val_t__strategy(val) = i; } @@ -3581,7 +4631,8 @@ conf_init_taperalgo( val_t *val, taperalgo_t i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_TAPERALGO; val_t__taperalgo(val) = i; } @@ -3591,7 +4642,8 @@ conf_init_priority( val_t *val, int i) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_PRIORITY; val_t__priority(val) = i; } @@ -3602,7 +4654,8 @@ conf_init_rate( float r1, float r2) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_RATE; val_t__rate(val)[0] = r1; val_t__rate(val)[1] = r2; @@ -3612,7 +4665,8 @@ static void conf_init_exinclude( val_t *val) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_EXINCLUDE; val_t__exinclude(val).optional = 0; val_t__exinclude(val).sl_list = NULL; @@ -3625,7 +4679,8 @@ conf_init_intrange( int i1, int i2) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_INTRANGE; val_t__intrange(val)[0] = i1; val_t__intrange(val)[1] = i2; @@ -3635,12 +4690,61 @@ static void conf_init_proplist( val_t *val) { - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; val->type = CONFTYPE_PROPLIST; val_t__proplist(val) = - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); +} + +static void +conf_init_execute_on( + val_t *val, + int i) +{ + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_EXECUTE_ON; + val->v.i = i; +} + +static void +conf_init_execute_where( + val_t *val, + int i) +{ + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_EXECUTE_WHERE; + val->v.i = i; +} + +static void +conf_init_send_amreport( + val_t *val, + send_amreport_t i) +{ + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_SEND_AMREPORT_ON; + val->v.i = i; +} + +static void conf_init_pp_scriptlist(val_t *val) { + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_PP_SCRIPTLIST; + val->v.proplist = NULL; +} + +static void conf_init_application(val_t *val) { + val->seen.linenum = 0; + val->seen.filename = NULL; + val->type = CONFTYPE_APPLICATION; + val->v.application = NULL; } + /* * Config access implementation */ @@ -3660,6 +4764,10 @@ getconf_list( dumptype_t *dp; interface_t *ip; holdingdisk_t *hp; + application_t *ap; + pp_script_t *pp; + device_config_t *dc; + changer_config_t *cc; GSList *rv = NULL; if (strcasecmp(listname,"tapetype") == 0) { @@ -3678,6 +4786,24 @@ getconf_list( for(ip = interface_list; ip != NULL; ip=ip->next) { rv = g_slist_append(rv, ip->name); } + } else if (strcasecmp(listname,"application_tool") == 0 + || strcasecmp(listname,"application-tool") == 0) { + for(ap = application_list; ap != NULL; ap=ap->next) { + rv = g_slist_append(rv, ap->name); + } + } else if (strcasecmp(listname,"script_tool") == 0 + || strcasecmp(listname,"script-tool") == 0) { + for(pp = pp_script_list; pp != NULL; pp=pp->next) { + rv = g_slist_append(rv, pp->name); + } + } else if (strcasecmp(listname,"device") == 0) { + for(dc = device_config_list; dc != NULL; dc=dc->next) { + rv = g_slist_append(rv, dc->name); + } + } else if (strcasecmp(listname,"changer") == 0) { + for(cc = changer_config_list; cc != NULL; cc=cc->next) { + rv = g_slist_append(rv, cc->name); + } } return rv; } @@ -3716,6 +4842,19 @@ tapetype_getconf( return &ttyp->value[key]; } +static void +validate_program( + conf_var_t *np G_GNUC_UNUSED, + val_t *val) +{ + if (strcmp(val->v.s, "DUMP") != 0 && + strcmp(val->v.s, "GNUTAR") != 0 && + strcmp(val->v.s, "STAR") != 0 && + strcmp(val->v.s, "APPLICATION") != 0) + conf_parserror("program must be \"DUMP\", \"GNUTAR\", \"STAR\" or \"APPLICATION\""); +} + + char * tapetype_name( tapetype_t *ttyp) @@ -3829,6 +4968,126 @@ holdingdisk_name( return hdisk->name; } +application_t * +lookup_application( + char *str) +{ + application_t *p; + + for(p = application_list; p != NULL; p = p->next) { + if(strcasecmp(p->name, str) == 0) return p; + } + return NULL; +} + +val_t * +application_getconf( + application_t *ap, + application_key key) +{ + assert(ap != NULL); + assert(key < APPLICATION_APPLICATION); + return &ap->value[key]; +} + +char * +application_name( + application_t *ap) +{ + assert(ap != NULL); + return ap->name; +} + +pp_script_t * +lookup_pp_script( + char *str) +{ + pp_script_t *pps; + + for(pps = pp_script_list; pps != NULL; pps = pps->next) { + if(strcasecmp(pps->name, str) == 0) return pps; + } + return NULL; +} + +val_t * +pp_script_getconf( + pp_script_t *pps, + pp_script_key key) +{ + assert(pps != NULL); + assert(key < PP_SCRIPT_PP_SCRIPT); + return &pps->value[key]; +} + +char * +pp_script_name( + pp_script_t *pps) +{ + assert(pps != NULL); + return pps->name; +} + +device_config_t * +lookup_device_config( + char *str) +{ + device_config_t *devconf; + + for(devconf = device_config_list; devconf != NULL; devconf = devconf->next) { + if(strcasecmp(devconf->name, str) == 0) return devconf; + } + return NULL; +} + +val_t * +device_config_getconf( + device_config_t *devconf, + device_config_key key) +{ + assert(devconf != NULL); + assert(key < DEVICE_CONFIG_DEVICE_CONFIG); + return &devconf->value[key]; +} + +char * +device_config_name( + device_config_t *devconf) +{ + assert(devconf != NULL); + return devconf->name; +} + +changer_config_t * +lookup_changer_config( + char *str) +{ + changer_config_t *devconf; + + for(devconf = changer_config_list; devconf != NULL; devconf = devconf->next) { + if(strcasecmp(devconf->name, str) == 0) return devconf; + } + return NULL; +} + +val_t * +changer_config_getconf( + changer_config_t *devconf, + changer_config_key key) +{ + assert(devconf != NULL); + assert(key < CHANGER_CONFIG_CHANGER_CONFIG); + return &devconf->value[key]; +} + +char * +changer_config_name( + changer_config_t *devconf) +{ + assert(devconf != NULL); + return devconf->name; +} + long int getconf_unit_divisor(void) { @@ -3845,6 +5104,9 @@ new_config_overwrites( { config_overwrites_t *co; + if (size_estimate <= 0) + size_estimate = 10; + co = alloc(sizeof(*co)); co->ovr = alloc(sizeof(*co->ovr) * size_estimate); co->n_allocated = size_estimate; @@ -3941,13 +5203,13 @@ extract_commandline_config_overwrites( return co; } -void +cfgerr_level_t apply_config_overwrites( config_overwrites_t *co) { int i; - if(!co) return; + if(!co) return cfgerr_level; assert(keytable != NULL); assert(parsetable != NULL); @@ -3958,7 +5220,8 @@ apply_config_overwrites( conf_var_t *key_parm; if (!parm_key_info(key, &key_parm, &key_val)) { - error(_("unknown parameter '%s'"), key); + conf_parserror(_("unknown parameter '%s'"), key); + continue; } /* now set up a fake line and use the relevant read_function to @@ -3974,7 +5237,6 @@ apply_config_overwrites( token_pushed = 0; current_line_num = -2; allow_overwrites = 1; - got_parserror = 0; key_parm->read_function(key_parm, key_val); if ((key_parm)->validate_function) @@ -3982,11 +5244,6 @@ apply_config_overwrites( amfree(current_line); current_char = NULL; - - if (got_parserror) { - error(_("parse error in configuration overwrites")); - /* NOTREACHED */ - } } /* merge these overwrites with previous overwrites, if necessary */ @@ -4003,6 +5260,8 @@ apply_config_overwrites( } update_derived_values(config_client); + + return cfgerr_level; } /* @@ -4020,15 +5279,15 @@ val_t_to_int( return val_t__int(val); } -off_t -val_t_to_am64( +gint64 +val_t_to_int64( val_t *val) { - if (val->type != CONFTYPE_AM64) { - error(_("val_t_to_am64: val.type is not CONFTYPE_AM64")); + if (val->type != CONFTYPE_INT64) { + error(_("val_t_to_int64: val.type is not CONFTYPE_INT64")); /*NOTREACHED*/ } - return val_t__am64(val); + return val_t__int64(val); } float @@ -4137,7 +5396,7 @@ val_t_to_estimate( val_t *val) { if (val->type != CONFTYPE_ESTIMATE) { - error(_("val_t_to_extimate: val.type is not CONFTYPE_ESTIMATE")); + error(_("val_t_to_estimate: val.type is not CONFTYPE_ESTIMATE")); /*NOTREACHED*/ } return val_t__estimate(val); @@ -4162,7 +5421,18 @@ val_t_to_taperalgo( error(_("val_t_to_taperalgo: val.type is not CONFTYPE_TAPERALGO")); /*NOTREACHED*/ } - return val_t__taperalgo(val); + return val_t__taperalgo(val); +} + +send_amreport_t +val_t_to_send_amreport( + val_t *val) +{ + if (val->type != CONFTYPE_SEND_AMREPORT_ON) { + error(_("val_t_to_send_amreport: val.type is not CONFTYPE_SEND_AMREPORT_ON")); + /*NOTREACHED*/ + } + return val_t__send_amreport(val); } int @@ -4226,7 +5496,7 @@ copy_val_t( val_t *valdst, val_t *valsrc) { - if(valsrc->seen) { + if(valsrc->seen.linenum) { valdst->type = valsrc->type; valdst->seen = valsrc->seen; switch(valsrc->type) { @@ -4236,6 +5506,9 @@ copy_val_t( case CONFTYPE_ENCRYPT: case CONFTYPE_HOLDING: case CONFTYPE_ESTIMATE: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: case CONFTYPE_STRATEGY: case CONFTYPE_TAPERALGO: case CONFTYPE_PRIORITY: @@ -4246,8 +5519,8 @@ copy_val_t( valdst->v.size = valsrc->v.size; break; - case CONFTYPE_AM64: - valdst->v.am64 = valsrc->v.am64; + case CONFTYPE_INT64: + valdst->v.int64 = valsrc->v.int64; break; case CONFTYPE_REAL: @@ -4280,12 +5553,66 @@ copy_val_t( break; case CONFTYPE_PROPLIST: - g_assert_not_reached(); - break; + if (valsrc->v.proplist) { + valdst->v.proplist = g_hash_table_new_full(g_str_hash, + g_str_equal, + NULL, NULL); + + g_hash_table_foreach(valsrc->v.proplist, ©_proplist, + valdst->v.proplist); + } else { + valdst->v.proplist = NULL; + } + break; + + case CONFTYPE_PP_SCRIPTLIST: + valdst->v.pp_scriptlist = NULL; + if (valsrc->v.pp_scriptlist) { + g_slist_foreach(valsrc->v.pp_scriptlist, ©_pp_scriptlist, + valdst->v.pp_scriptlist); + } + break; + + case CONFTYPE_APPLICATION: + valdst->v.application = valsrc->v.application; + break; } } } +static void +copy_proplist( + gpointer key_p, + gpointer value_p, + gpointer user_data_p) +{ + char *property_s = key_p; + property_t *property = value_p; + proplist_t proplist = user_data_p; + GSList *elem = NULL; + property_t *new_property = malloc(sizeof(property_t)); + new_property->append = property->append; + new_property->priority = property->priority; + new_property->values = NULL; + + for(elem = property->values;elem != NULL; elem=elem->next) { + new_property->values = g_slist_append(new_property->values, + stralloc(elem->data)); + } + g_hash_table_insert(proplist, property_s, new_property); +} + +static void +copy_pp_scriptlist( + gpointer data_p, + gpointer user_data_p) +{ + pp_script_t *pp_script = data_p; + pp_scriptlist_t pp_scriptlist = user_data_p; + + pp_scriptlist = g_slist_append(pp_scriptlist, pp_script); +} + static void free_val_t( val_t *val) @@ -4297,11 +5624,14 @@ free_val_t( case CONFTYPE_ENCRYPT: case CONFTYPE_HOLDING: case CONFTYPE_ESTIMATE: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_SEND_AMREPORT_ON: case CONFTYPE_STRATEGY: case CONFTYPE_SIZE: case CONFTYPE_TAPERALGO: case CONFTYPE_PRIORITY: - case CONFTYPE_AM64: + case CONFTYPE_INT64: case CONFTYPE_REAL: case CONFTYPE_RATE: case CONFTYPE_INTRANGE: @@ -4323,8 +5653,16 @@ free_val_t( case CONFTYPE_PROPLIST: g_hash_table_destroy(val_t__proplist(val)); break; + + case CONFTYPE_PP_SCRIPTLIST: + g_slist_free_full(val->v.pp_scriptlist); + break; + + case CONFTYPE_APPLICATION: + break; } - val->seen = 0; + val->seen.linenum = 0; + val->seen.filename = NULL; } /* @@ -4393,6 +5731,10 @@ dump_configuration(void) dumptype_t *dp; interface_t *ip; holdingdisk_t *hp; + application_t *ap; + pp_script_t *ps; + device_config_t *dc; + changer_config_t *cc; int i; conf_var_t *np; keytab_t *kt; @@ -4438,7 +5780,7 @@ dump_configuration(void) } for(tp = tapelist; tp != NULL; tp = tp->next) { - if(tp->seen == -1) + if(tp->seen.linenum == -1) prefix = "#"; else prefix = ""; @@ -4461,7 +5803,7 @@ dump_configuration(void) for(dp = dumplist; dp != NULL; dp = dp->next) { if (strncmp_const(dp->name, "custom(") != 0) { /* don't dump disklist-derived dumptypes */ - if(dp->seen == -1) + if(dp->seen.linenum == -1) prefix = "#"; else prefix = ""; @@ -4484,7 +5826,10 @@ dump_configuration(void) } for(ip = interface_list; ip != NULL; ip = ip->next) { - if(strcmp(ip->name,"default") == 0) + seen_t *netusage_seen = &val_t__seen(getconf(CNF_NETUSAGE)); + if (ip->seen.linenum == netusage_seen->linenum && + ip->seen.filename && netusage_seen->filename && + 0 == strcmp(ip->seen.filename, netusage_seen->filename)) prefix = "#"; else prefix = ""; @@ -4505,6 +5850,87 @@ dump_configuration(void) g_printf("%s}\n",prefix); } + for(ap = application_list; ap != NULL; ap = ap->next) { + if(strcmp(ap->name,"default") == 0) + prefix = "#"; + else + prefix = ""; + g_printf("\n%sDEFINE APPLICATION-TOOL %s {\n", prefix, ap->name); + for(i=0; i < APPLICATION_APPLICATION; i++) { + for(np=application_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("application-tool bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("application bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &ap->value[i]); + } + g_printf("%s}\n",prefix); + } + + for(ps = pp_script_list; ps != NULL; ps = ps->next) { + if(strcmp(ps->name,"default") == 0) + prefix = "#"; + else + prefix = ""; + g_printf("\n%sDEFINE SCRIPT-TOOL %s {\n", prefix, ps->name); + for(i=0; i < PP_SCRIPT_PP_SCRIPT; i++) { + for(np=pp_script_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("script-tool bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("script bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &ps->value[i]); + } + g_printf("%s}\n",prefix); + } + + for(dc = device_config_list; dc != NULL; dc = dc->next) { + prefix = ""; + g_printf("\n%sDEFINE DEVICE %s {\n", prefix, dc->name); + for(i=0; i < DEVICE_CONFIG_DEVICE_CONFIG; i++) { + for(np=device_config_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("device bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("device bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &dc->value[i]); + } + g_printf("%s}\n",prefix); + } + + for(cc = changer_config_list; cc != NULL; cc = cc->next) { + prefix = ""; + g_printf("\n%sDEFINE CHANGER %s {\n", prefix, cc->name); + for(i=0; i < CHANGER_CONFIG_CHANGER_CONFIG; i++) { + for(np=changer_config_var; np->token != CONF_UNKNOWN; np++) + if(np->parm == i) break; + if(np->token == CONF_UNKNOWN) + error(_("changer bad value")); + + for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) + if(kt->token == np->token) break; + if(kt->token == CONF_UNKNOWN) + error(_("changer bad token")); + + val_t_print_token(stdout, prefix, " %-19s ", kt, &cc->value[i]); + } + g_printf("%s}\n",prefix); + } } static void @@ -4563,8 +5989,8 @@ val_t_display_strs( buf[0] = vstrallocf("%zd", (ssize_t)val_t__size(val)); break; - case CONFTYPE_AM64: - buf[0] = vstrallocf("%lld", (long long)val_t__am64(val)); + case CONFTYPE_INT64: + buf[0] = vstrallocf("%lld", (long long)val_t__int64(val)); break; case CONFTYPE_REAL: @@ -4697,6 +6123,35 @@ val_t_display_strs( } break; + case CONFTYPE_EXECUTE_WHERE: + switch(val->v.i) { + case ES_CLIENT: + buf[0] = vstrallocf("CLIENT"); + break; + + case ES_SERVER: + buf[0] = vstrallocf("SERVER"); + break; + } + break; + + case CONFTYPE_SEND_AMREPORT_ON: + switch(val->v.i) { + case SEND_AMREPORT_ALL: + buf[0] = vstrallocf("ALL"); + break; + case SEND_AMREPORT_STRANGE: + buf[0] = vstrallocf("STRANGE"); + break; + case SEND_AMREPORT_ERROR: + buf[0] = vstrallocf("ERROR"); + break; + case SEND_AMREPORT_NEVER: + buf[0] = vstrallocf("NEVER"); + break; + } + break; + case CONFTYPE_ENCRYPT: switch(val_t__encrypt(val)) { case ENCRYPT_NONE: @@ -4758,27 +6213,197 @@ val_t_display_strs( buf = malloc((nb_property+1)*SIZEOF(char*)); buf[nb_property] = NULL; mybuf = buf; - g_hash_table_foreach(val_t__proplist(val), proplist_display_str_foreach_fn, &mybuf); + g_hash_table_foreach(val_t__proplist(val), + proplist_display_str_foreach_fn, + &mybuf); + break; + } + + case CONFTYPE_PP_SCRIPTLIST: { + int nb_pp_scriplist; + char **mybuf; + + nb_pp_scriplist = g_slist_length(val_t__pp_scriptlist(val)); + amfree(buf); + buf = malloc((nb_pp_scriplist+1)*SIZEOF(char*)); + buf[nb_pp_scriplist] = NULL; + mybuf = buf; + g_slist_foreach(val_t__pp_scriptlist(val), + pp_scriptlist_display_str_foreach_fn, + &mybuf); break; } + + case CONFTYPE_APPLICATION: { + if (val->v.application) { + buf[0] = vstrallocf("\"%s\"", val->v.application->name); + } else { + buf[0] = stralloc(""); + } + break; + } + + case CONFTYPE_EXECUTE_ON: + buf[0] = stralloc(""); + if (val->v.i != 0) { + char *sep = ""; + if (val->v.i & EXECUTE_ON_PRE_DLE_AMCHECK) { + buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-AMCHECK", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_HOST_AMCHECK) { + buf[0] = vstrextend(&buf[0], sep, "PRE-HOST-AMCHECK", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_DLE_AMCHECK) { + buf[0] = vstrextend(&buf[0], sep, "POST-DLE-AMCHECK", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_HOST_AMCHECK) { + buf[0] = vstrextend(&buf[0], sep, "POST-HOST-AMCHECK", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_DLE_ESTIMATE) { + buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-ESTIMATE", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_HOST_ESTIMATE) { + buf[0] = vstrextend(&buf[0], sep, "PRE-HOST-ESTIMATE", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_DLE_ESTIMATE) { + buf[0] = vstrextend(&buf[0], sep, "POST-DLE-ESTIMATE", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_HOST_ESTIMATE) { + buf[0] = vstrextend(&buf[0], sep, "POST-HOST-ESTIMATE", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_DLE_BACKUP) { + buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-BACKUP", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_HOST_BACKUP) { + buf[0] = vstrextend(&buf[0], sep, "PRE-HOST-BACKUP", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_DLE_BACKUP) { + buf[0] = vstrextend(&buf[0], sep, "POST-DLE-BACKUP", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_HOST_BACKUP) { + buf[0] = vstrextend(&buf[0], sep, "POST-HOST-BACKUP", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_RECOVER) { + buf[0] = vstrextend(&buf[0], sep, "PRE-RECOVER", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_RECOVER) { + buf[0] = vstrextend(&buf[0], sep, "POST-RECOVER", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_PRE_LEVEL_RECOVER) { + buf[0] = vstrextend(&buf[0], sep, "PRE-LEVEL-RECOVER", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_POST_LEVEL_RECOVER) { + buf[0] = vstrextend(&buf[0], sep, "POST-LEVEL-RECOVER", NULL); + sep = ", "; + } + if (val->v.i & EXECUTE_ON_INTER_LEVEL_RECOVER) { + buf[0] = vstrextend(&buf[0], sep, "INTER-LEVEL-RECOVER", NULL); + sep = ", "; + } + } + break; + } return buf; } +int +val_t_to_execute_on( + val_t *val) +{ + if (val->type != CONFTYPE_EXECUTE_ON) { + error(_("get_conftype_execute_on: val.type is not CONFTYPE_EXECUTE_ON")); + /*NOTREACHED*/ + } + return val_t__execute_on(val); +} + +int +val_t_to_execute_where( + val_t *val) +{ + if (val->type != CONFTYPE_EXECUTE_WHERE) { + error(_("get_conftype_execute_where: val.type is not CONFTYPE_EXECUTE_WHERE")); + /*NOTREACHED*/ + } + return val->v.i; +} + +pp_scriptlist_t +val_t_to_pp_scriptlist( + val_t *val) +{ + if (val->type != CONFTYPE_PP_SCRIPTLIST) { + error(_("get_conftype_proplist: val.type is not CONFTYPE_PP_SCRIPTLIST")); + /*NOTREACHED*/ + } + return val->v.pp_scriptlist; +} + + +application_t * +val_t_to_application( + val_t *val) +{ + if (val->type != CONFTYPE_APPLICATION) { + error(_("get_conftype_applicaiton: val.type is not CONFTYPE_APPLICATION")); + /*NOTREACHED*/ + } + return val->v.application; +} + + static void proplist_display_str_foreach_fn( gpointer key_p, gpointer value_p, gpointer user_data_p) { - char *property_s = key_p; - char *value_s = value_p; - char ***msg = (char ***)user_data_p; + char *property_s = key_p; + property_t *property = value_p; + GSList *value; + char ***msg = (char ***)user_data_p; + + /* What to do with property->append? it should be printed only on client */ + if (property->priority) { + **msg = vstralloc("priority \"", property_s, "\"", NULL); + } else { + **msg = vstralloc("\"", property_s, "\"", NULL); + } + for(value=property->values; value != NULL; value = value->next) { + **msg = vstrextend(*msg, " \"", value->data, "\"", NULL); + } + (*msg)++; +} + +static void +pp_scriptlist_display_str_foreach_fn( + gpointer data_p, + gpointer user_data_p) +{ + pp_script_t *pp_script = data_p; + char ***msg = (char ***)user_data_p; - **msg = vstralloc("\"", property_s, "\" \"", value_s, "\"", NULL); + **msg = vstralloc("\"", pp_script->name, "\"", NULL); (*msg)++; } + static char * exinclude_display_str( val_t *val, @@ -4858,6 +6483,10 @@ parm_key_info( dumptype_t *dp; interface_t *ip; holdingdisk_t *hp; + application_t *ap; + pp_script_t *pp; + device_config_t *dc; + changer_config_t *cc; int success = FALSE; /* WARNING: assumes globals keytable and parsetable are set correctly. */ @@ -4868,9 +6497,8 @@ parm_key_info( key = stralloc(key); /* uppercase the key */ - s = key; for (s = key; (ch = *s) != 0; s++) { - if(islower((int)ch)) + if (islower((int)ch)) *s = (char)toupper(ch); } @@ -4881,12 +6509,22 @@ parm_key_info( *subsec_name = '\0'; subsec_name++; + /* convert subsec_type '-' to '_' */ + for (s = subsec_type; (ch = *s) != 0; s++) { + if (*s == '-') *s = '_'; + } + subsec_key = strchr(subsec_name,':'); if(!subsec_key) goto out; /* failure */ *subsec_key = '\0'; subsec_key++; + /* convert subsec_key '-' to '_' */ + for (s = subsec_key; (ch = *s) != 0; s++) { + if (*s == '-') *s = '_'; + } + /* If the keyword doesn't exist, there's no need to look up the * subsection -- we know it's invalid */ for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) { @@ -4945,10 +6583,63 @@ parm_key_info( if (val) *val = &ip->value[np->parm]; if (parm) *parm = np; success = TRUE; - } + } else if (strcmp(subsec_type, "APPLICATION_TOOL") == 0) { + ap = lookup_application(subsec_name); + if (!ap) goto out; + for(np = application_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &ap->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "SCRIPT_TOOL") == 0) { + pp = lookup_pp_script(subsec_name); + if (!pp) goto out; + for(np = pp_script_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &pp->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "DEVICE") == 0) { + dc = lookup_device_config(subsec_name); + if (!dc) goto out; + for(np = device_config_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &dc->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } else if (strcmp(subsec_type, "CHANGER") == 0) { + cc = lookup_changer_config(subsec_name); + if (!cc) goto out; + for(np = changer_config_var; np->token != CONF_UNKNOWN; np++) { + if(np->token == kt->token) + break; + } + if (np->token == CONF_UNKNOWN) goto out; + + if (val) *val = &cc->value[np->parm]; + if (parm) *parm = np; + success = TRUE; + } /* No delimiters -- we're referencing a global config parameter */ } else { + /* convert key '-' to '_' */ + for (s = key; (ch = *s) != 0; s++) { + if (*s == '-') *s = '_'; + } + /* look up the keyword */ for(kt = keytable; kt->token != CONF_UNKNOWN; kt++) { if(kt->keyword && strcmp(kt->keyword, key) == 0) @@ -4975,20 +6666,21 @@ out: gint64 find_multiplier( - char * casestr) + char * str) { keytab_t * table_entry; - char * str = g_utf8_strup(casestr, -1); + + str = g_strdup(str); g_strstrip(str); if (*str == '\0') { g_free(str); return 1; } - + for (table_entry = numb_keytable; table_entry->keyword != NULL; table_entry ++) { - if (strcmp(casestr, table_entry->keyword) == 0) { + if (strcasecmp(str, table_entry->keyword) == 0) { g_free(str); switch (table_entry->token) { case CONF_MULT1K: @@ -5020,18 +6712,35 @@ find_multiplier( * Error Handling Implementaiton */ -static void print_parse_problem(const char * format, va_list argp) { - const char *xlated_fmt = gettext(format); +void config_add_error( + cfgerr_level_t level, + char * errmsg) +{ + cfgerr_level = max(cfgerr_level, level); + + g_debug("%s", errmsg); + cfgerr_errors = g_slist_append(cfgerr_errors, errmsg); +} + +static void conf_error_common( + cfgerr_level_t level, + const char * format, + va_list argp) +{ + char *msg = g_strdup_vprintf(format, argp); + char *errstr = NULL; if(current_line) - g_fprintf(stderr, _("argument \"%s\": "), current_line); + errstr = g_strdup_printf(_("argument \"%s\": %s"), + current_line, msg); else if (current_filename && current_line_num > 0) - g_fprintf(stderr, "\"%s\", line %d: ", current_filename, current_line_num); + errstr = g_strdup_printf(_("\"%s\", line %d: %s"), + current_filename, current_line_num, msg); else - g_fprintf(stderr, _("parse error: ")); - - g_vfprintf(stderr, xlated_fmt, argp); - fputc('\n', stderr); + errstr = g_strdup_printf(_("parse error: %s"), msg); + amfree(msg); + + config_add_error(level, errstr); } printf_arglist_function(void conf_parserror, const char *, format) @@ -5039,16 +6748,91 @@ printf_arglist_function(void conf_parserror, const char *, format) va_list argp; arglist_start(argp, format); - print_parse_problem(format, argp); + conf_error_common(CFGERR_ERRORS, format, argp); arglist_end(argp); - - got_parserror = TRUE; } printf_arglist_function(void conf_parswarn, const char *, format) { va_list argp; arglist_start(argp, format); - print_parse_problem(format, argp); + conf_error_common(CFGERR_WARNINGS, format, argp); arglist_end(argp); } + +cfgerr_level_t +config_errors(GSList **errstr) +{ + if (errstr) + *errstr = cfgerr_errors; + return cfgerr_level; +} + +void +config_clear_errors(void) +{ + g_slist_free_full(cfgerr_errors); + + cfgerr_errors = NULL; + cfgerr_level = CFGERR_OK; +} + +void +config_print_errors(void) +{ + GSList *iter; + + for (iter = cfgerr_errors; iter; iter = g_slist_next(iter)) { + g_fprintf(stderr, "%s\n", (char *)iter->data); + } +} + +/* Get the config name */ +char *get_config_name(void) +{ + return config_name; +} + +/* Get the config directory */ +char *get_config_dir(void) +{ + return config_dir; +} + +/* Get the config filename */ +char *get_config_filename(void) +{ + return config_filename; +} + +int +property_argv_size(proplist_t proplist) { + int nb; + + nb = 0; + g_hash_table_foreach(proplist, &count_proplist, &nb); + return nb*2; +} + +int +property_add_to_argv( + char **argvchild, + proplist_t proplist) +{ + char **argv = argvchild; + + g_hash_table_foreach(proplist, &proplist_add_to_argv, &argv); + return (argv - argvchild); +} + +char * +anonymous_value(void) +{ + static char number[NUM_STR_SIZE]; + static int value=1; + + g_snprintf(number, sizeof(number), "%d", value); + + value++; + return number; +} diff --git a/common-src/conffile.h b/common-src/conffile.h index 8873cec..a61edd9 100644 --- a/common-src/conffile.h +++ b/common-src/conffile.h @@ -38,12 +38,12 @@ /* Getting Configuration Values * ============================ * - * Amanda configurations consist of a number of "global" parameters, as well as named - * subsections of four types: dumptypes, interfaces, holdingdisks, and tapetypes. The - * global parameters are fetched with the getconf_CONFTYPE functions, keyed by a - * confparam_t constant (with prefix CNF_). The subsection parameters are fetched with - * SUBSEC_get_PARAM() macros, e.g., tapetype_get_blocksize(ttyp), where the argument - * comes from lookup_SUBSEC(), in this case lookup_tapetype(name). + * Amanda configurations consist of a number of "global" parameters, as well as + * named subsections of several types. The global parameters are fetched with + * the getconf_CONFTYPE functions, keyed by a confparam_t constant (with prefix + * CNF_). The subsection parameters are fetched with SUBSEC_get_PARAM() + * macros, e.g., tapetype_get_blocksize(ttyp), where the argument comes from + * lookup_SUBSEC(), in this case lookup_tapetype(name). * * Types * ===== @@ -64,6 +64,12 @@ * ====== * Note that, unless specified, all memory in this module is managed by the module * itself; return strings should not be freed by the caller. + * + * Error Handling + * ============== + * All errors and warnings generated by this module are available from get_config_errors(). + * It is up to the caller to route these messages to the user. The function + * config_print_errors() will print the errors to stderr, as a convenience. */ /* @@ -131,19 +137,55 @@ typedef enum { ALGO_ALGO /* sentinel */ } taperalgo_t; +/* execute_on types */ +#define EXECUTE_ON_PRE_DLE_AMCHECK 1<<0 +#define EXECUTE_ON_PRE_HOST_AMCHECK 1<<1 +#define EXECUTE_ON_POST_DLE_AMCHECK 1<<2 +#define EXECUTE_ON_POST_HOST_AMCHECK 1<<3 +#define EXECUTE_ON_PRE_DLE_ESTIMATE 1<<4 +#define EXECUTE_ON_PRE_HOST_ESTIMATE 1<<5 +#define EXECUTE_ON_POST_DLE_ESTIMATE 1<<6 +#define EXECUTE_ON_POST_HOST_ESTIMATE 1<<7 +#define EXECUTE_ON_PRE_DLE_BACKUP 1<<8 +#define EXECUTE_ON_PRE_HOST_BACKUP 1<<9 +#define EXECUTE_ON_POST_DLE_BACKUP 1<<10 +#define EXECUTE_ON_POST_HOST_BACKUP 1<<11 +#define EXECUTE_ON_PRE_RECOVER 1<<12 +#define EXECUTE_ON_POST_RECOVER 1<<13 +#define EXECUTE_ON_PRE_LEVEL_RECOVER 1<<14 +#define EXECUTE_ON_POST_LEVEL_RECOVER 1<<15 +#define EXECUTE_ON_INTER_LEVEL_RECOVER 1<<16 +typedef int execute_on_t; + +typedef int execute_where_t; + +typedef enum { + SEND_AMREPORT_ALL, + SEND_AMREPORT_STRANGE, + SEND_AMREPORT_ERROR, + SEND_AMREPORT_NEVER +} send_amreport_t; + typedef struct exinclude_s { sl_t *sl_list; sl_t *sl_file; int optional; } exinclude_t; +typedef struct { + int append; + int priority; + GSList* values; +} property_t; + typedef GHashTable* proplist_t; +typedef GSList* pp_scriptlist_t; /* Names for the type of value in a val_t. Mostly for internal use, but useful * for wrapping val_t's, too. */ typedef enum { CONFTYPE_INT, - CONFTYPE_AM64, + CONFTYPE_INT64, CONFTYPE_REAL, CONFTYPE_STR, CONFTYPE_IDENT, @@ -160,16 +202,29 @@ typedef enum { CONFTYPE_RATE, CONFTYPE_INTRANGE, CONFTYPE_EXINCLUDE, - CONFTYPE_PROPLIST + CONFTYPE_PROPLIST, + CONFTYPE_APPLICATION, + CONFTYPE_EXECUTE_ON, + CONFTYPE_EXECUTE_WHERE, + CONFTYPE_SEND_AMREPORT_ON, + CONFTYPE_PP_SCRIPTLIST } conftype_t; +/* A "seen" struct. Rather than allocate strings all over the place, this + * string is in the "parsed_filenames" GSList and will be freed when that + * GSList is freed. This struct should be opaque to other modules. */ +typedef struct seen_s { + char *filename; + int linenum; +} seen_t; + /* This should be considered an opaque type for any other modules. The complete * struct is included here to allow quick access via macros. Access it *only* through * those macros. */ typedef struct val_s { union { int i; - off_t am64; + gint64 int64; double r; char *s; ssize_t size; @@ -178,40 +233,47 @@ typedef struct val_s { exinclude_t exinclude; int intrange[2]; proplist_t proplist; + struct application_s *application; + pp_scriptlist_t pp_scriptlist; } v; - int seen; + seen_t seen; conftype_t type; } val_t; /* Functions to typecheck and extract a particular type of * value from a val_t. All call error() if the type is incorrect, * as this is a programming error. */ -int val_t_to_int (val_t *); -off_t val_t_to_am64 (val_t *); -float val_t_to_real (val_t *); -char *val_t_to_str (val_t *); /* (also converts CONFTYPE_IDENT) */ -char *val_t_to_ident (val_t *); /* (also converts CONFTYPE_STR) */ -time_t val_t_to_time (val_t *); -ssize_t val_t_to_size (val_t *); -int val_t_to_boolean (val_t *); -comp_t val_t_to_compress (val_t *); -encrypt_t val_t_to_encrypt (val_t *); -dump_holdingdisk_t val_t_to_holding (val_t *); -estimate_t val_t_to_estimate (val_t *); -strategy_t val_t_to_strategy (val_t *); -taperalgo_t val_t_to_taperalgo(val_t *); -int val_t_to_priority (val_t *); -float *val_t_to_rate (val_t *); /* array of two floats */ -exinclude_t val_t_to_exinclude(val_t *); -int *val_t_to_intrange (val_t *); /* array of two ints */ -proplist_t val_t_to_proplist (val_t *); +int val_t_to_int (val_t *); +gint64 val_t_to_int64 (val_t *); +float val_t_to_real (val_t *); +char *val_t_to_str (val_t *); /* (also converts CONFTYPE_IDENT) */ +char *val_t_to_ident (val_t *); /* (also converts CONFTYPE_STR) */ +time_t val_t_to_time (val_t *); +ssize_t val_t_to_size (val_t *); +int val_t_to_boolean (val_t *); +comp_t val_t_to_compress (val_t *); +encrypt_t val_t_to_encrypt (val_t *); +dump_holdingdisk_t val_t_to_holding (val_t *); +estimate_t val_t_to_estimate (val_t *); +strategy_t val_t_to_strategy (val_t *); +taperalgo_t val_t_to_taperalgo(val_t *); +int val_t_to_priority (val_t *); +float *val_t_to_rate (val_t *); /* array of two floats */ +exinclude_t val_t_to_exinclude(val_t *); +int *val_t_to_intrange (val_t *); /* array of two ints */ +proplist_t val_t_to_proplist (val_t *); +struct application_s *val_t_to_application(val_t *); +pp_scriptlist_t val_t_to_pp_scriptlist(val_t *); +execute_on_t val_t_to_execute_on(val_t *); +execute_where_t val_t_to_execute_where(val_t *); +send_amreport_t val_t_to_send_amreport(val_t *); /* Has the given val_t been seen in a configuration file or config overwrite? * * @param val: val_t* to examine * @returns: boolean */ -#define val_t_seen(val) ((val)->seen) +#define val_t_seen(val) ((val)->seen.linenum) /* What is the underlying type of this val_t? * @@ -227,26 +289,31 @@ proplist_t val_t_to_proplist (val_t *); * (in the macro name) to the corresponding union field. The macros work * as lvalues, too. */ -#define val_t__seen(val) ((val)->seen) -#define val_t__int(val) ((val)->v.i) -#define val_t__am64(val) ((val)->v.am64) -#define val_t__real(val) ((val)->v.r) -#define val_t__str(val) ((val)->v.s) -#define val_t__ident(val) ((val)->v.s) -#define val_t__time(val) ((val)->v.t) -#define val_t__size(val) ((val)->v.size) -#define val_t__boolean(val) ((val)->v.i) -#define val_t__compress(val) ((val)->v.i) -#define val_t__encrypt(val) ((val)->v.i) -#define val_t__holding(val) ((val)->v.i) -#define val_t__estimate(val) ((val)->v.i) -#define val_t__strategy(val) ((val)->v.i) -#define val_t__taperalgo(val) ((val)->v.i) -#define val_t__priority(val) ((val)->v.i) -#define val_t__rate(val) ((val)->v.rate) -#define val_t__exinclude(val) ((val)->v.exinclude) -#define val_t__intrange(val) ((val)->v.intrange) -#define val_t__proplist(val) ((val)->v.proplist) +#define val_t__seen(val) ((val)->seen) +#define val_t__int(val) ((val)->v.i) +#define val_t__int64(val) ((val)->v.int64) +#define val_t__real(val) ((val)->v.r) +#define val_t__str(val) ((val)->v.s) +#define val_t__ident(val) ((val)->v.s) +#define val_t__time(val) ((val)->v.t) +#define val_t__size(val) ((val)->v.size) +#define val_t__boolean(val) ((val)->v.i) +#define val_t__compress(val) ((val)->v.i) +#define val_t__encrypt(val) ((val)->v.i) +#define val_t__holding(val) ((val)->v.i) +#define val_t__estimate(val) ((val)->v.i) +#define val_t__strategy(val) ((val)->v.i) +#define val_t__taperalgo(val) ((val)->v.i) +#define val_t__send_amreport(val) ((val)->v.i) +#define val_t__priority(val) ((val)->v.i) +#define val_t__rate(val) ((val)->v.rate) +#define val_t__exinclude(val) ((val)->v.exinclude) +#define val_t__intrange(val) ((val)->v.intrange) +#define val_t__proplist(val) ((val)->v.proplist) +#define val_t__pp_scriptlist(val) ((val)->v.pp_scriptlist) +#define val_t__application(val) ((val)->v.application) +#define val_t__execute_on(val) ((val)->v.i) +#define val_t__execute_where(val) ((val)->v.i) /* * Parameters * @@ -272,7 +339,15 @@ typedef enum { CNF_MAILTO, CNF_DUMPUSER, CNF_TAPEDEV, + CNF_RAWTAPEDEV, CNF_DEVICE_PROPERTY, + CNF_PROPERTY, + CNF_APPLICATION, + CNF_APPLICATION_TOOL, + CNF_EXECUTE_ON, + CNF_PP_SCRIPT, + CNF_PP_SCRIPT_TOOL, + CNF_PLUGIN, CNF_CHANGERDEV, CNF_CHANGERFILE, CNF_LABELSTR, @@ -301,6 +376,7 @@ typedef enum { CNF_TAPEBUFS, CNF_DEVICE_OUTPUT_BUFFER_SIZE, CNF_PRINTER, + CNF_MAILER, CNF_AUTOFLUSH, CNF_RESERVE, CNF_MAXDUMPSIZE, @@ -309,6 +385,7 @@ typedef enum { CNF_AMRECOVER_CHECK_LABEL, CNF_AMRECOVER_CHANGER, CNF_TAPERALGO, + CNF_SEND_AMREPORT_ON, CNF_FLUSH_THRESHOLD_DUMPED, CNF_FLUSH_THRESHOLD_SCHEDULED, CNF_TAPERFLUSH, @@ -366,7 +443,7 @@ val_t *getconf(confparm_key key); * @returns: various */ #define getconf_int(key) (val_t_to_int(getconf((key)))) -#define getconf_am64(key) (val_t_to_am64(getconf((key)))) +#define getconf_int64(key) (val_t_to_int64(getconf((key)))) #define getconf_real(key) (val_t_to_real(getconf((key)))) #define getconf_str(key) (val_t_to_str(getconf((key)))) #define getconf_ident(key) (val_t_to_ident(getconf((key)))) @@ -384,6 +461,7 @@ val_t *getconf(confparm_key key); #define getconf_exinclude(key) (val_t_to_exinclude(getconf((key)))) #define getconf_intrange(key) (val_t_to_intrange(getconf((key)))) #define getconf_proplist(key) (val_t_to_proplist(getconf((key)))) +#define getconf_send_amreport(key) (val_t_to_send_amreport(getconf((key)))) /* Get a list of names for subsections of the given type * @@ -494,8 +572,8 @@ char *tapetype_name(tapetype_t *ttyp); #define tapetype_get_lbl_templ(ttyp) (val_t_to_str(tapetype_getconf((ttyp), TAPETYPE_LBL_TEMPL))) #define tapetype_get_blocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_BLOCKSIZE))) #define tapetype_get_readblocksize(ttyp) (val_t_to_size(tapetype_getconf((ttyp), TAPETYPE_READBLOCKSIZE))) -#define tapetype_get_length(ttyp) (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_LENGTH))) -#define tapetype_get_filemark(ttyp) (val_t_to_am64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK))) +#define tapetype_get_length(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_LENGTH))) +#define tapetype_get_filemark(ttyp) (val_t_to_int64(tapetype_getconf((ttyp), TAPETYPE_FILEMARK))) #define tapetype_get_speed(ttyp) (val_t_to_int(tapetype_getconf((ttyp), TAPETYPE_SPEED))) #define tapetype_get_file_pad(ttyp) (val_t_to_boolean(tapetype_getconf((ttyp), TAPETYPE_FILE_PAD))) @@ -542,6 +620,9 @@ typedef enum { DUMPTYPE_KENCRYPT, DUMPTYPE_IGNORE, DUMPTYPE_INDEX, + DUMPTYPE_APPLICATION, + DUMPTYPE_PP_SCRIPTLIST, + DUMPTYPE_PROPERTY, DUMPTYPE_DUMPTYPE /* sentinel */ } dumptype_key; @@ -604,7 +685,7 @@ char *dumptype_name(dumptype_t *dtyp); #define dumptype_get_maxdumps(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXDUMPS))) #define dumptype_get_maxpromoteday(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_MAXPROMOTEDAY))) #define dumptype_get_bumppercent(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPPERCENT))) -#define dumptype_get_bumpsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_BUMPSIZE))) +#define dumptype_get_bumpsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_BUMPSIZE))) #define dumptype_get_bumpdays(dtyp) (val_t_to_int(dumptype_getconf((dtyp), DUMPTYPE_BUMPDAYS))) #define dumptype_get_bumpmult(dtyp) (val_t_to_real(dumptype_getconf((dtyp), DUMPTYPE_BUMPMULT))) #define dumptype_get_starttime(dtyp) (val_t_to_time(dumptype_getconf((dtyp), DUMPTYPE_STARTTIME))) @@ -615,8 +696,8 @@ char *dumptype_name(dumptype_t *dtyp); #define dumptype_get_srv_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SRV_DECRYPT_OPT))) #define dumptype_get_clnt_decrypt_opt(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLNT_DECRYPT_OPT))) #define dumptype_get_comprate(dtyp) (val_t_to_rate(dumptype_getconf((dtyp), DUMPTYPE_COMPRATE))) -#define dumptype_get_tape_splitsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_TAPE_SPLITSIZE))) -#define dumptype_get_fallback_splitsize(dtyp) (val_t_to_am64(dumptype_getconf((dtyp), DUMPTYPE_FALLBACK_SPLITSIZE))) +#define dumptype_get_tape_splitsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_TAPE_SPLITSIZE))) +#define dumptype_get_fallback_splitsize(dtyp) (val_t_to_int64(dumptype_getconf((dtyp), DUMPTYPE_FALLBACK_SPLITSIZE))) #define dumptype_get_split_diskbuffer(dtyp) (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_SPLIT_DISKBUFFER))) #define dumptype_get_record(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_RECORD))) #define dumptype_get_skip_incr(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_SKIP_INCR))) @@ -625,6 +706,9 @@ char *dumptype_name(dumptype_t *dtyp); #define dumptype_get_kencrypt(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_KENCRYPT))) #define dumptype_get_ignore(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_IGNORE))) #define dumptype_get_index(dtyp) (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_INDEX))) +#define dumptype_get_application(dtyp) (val_t_to_application(dumptype_getconf((dtyp), DUMPTYPE_APPLICATION))) +#define dumptype_get_pp_scriptlist(dtyp) (val_t_to_pp_scriptlist(dumptype_getconf((dtyp), DUMPTYPE_PP_SCRIPTLIST))) +#define dumptype_get_property(dtyp) (val_t_to_proplist(dumptype_getconf((dtyp), DUMPTYPE_PROPERTY))) /* * Interface parameter access @@ -748,8 +832,290 @@ char *holdingdisk_name(holdingdisk_t *hdisk); */ #define holdingdisk_get_comment(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_COMMENT))) #define holdingdisk_get_diskdir(hdisk) (val_t_to_str(holdingdisk_getconf((hdisk), HOLDING_DISKDIR))) -#define holdingdisk_get_disksize(hdisk) (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_DISKSIZE))) -#define holdingdisk_get_chunksize(hdisk) (val_t_to_am64(holdingdisk_getconf((hdisk), HOLDING_CHUNKSIZE))) +#define holdingdisk_get_disksize(hdisk) (val_t_to_int64(holdingdisk_getconf((hdisk), HOLDING_DISKSIZE))) +#define holdingdisk_get_chunksize(hdisk) (val_t_to_int64(holdingdisk_getconf((hdisk), HOLDING_CHUNKSIZE))) + +/* A application-tool interface */ +typedef enum application_e { + APPLICATION_COMMENT, + APPLICATION_PLUGIN, + APPLICATION_PROPERTY, + APPLICATION_APPLICATION +} application_key; + +/* opaque object */ +typedef struct application_s application_t; + +/* Given the name of the application, return a application object. Returns NULL + * if no matching application exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired application + * @returns: object or NULL + */ + +application_t *lookup_application(char *identifier); + +/* Given a application and a key, return a pointer to the corresponding val_t. + * + * @param ttyp: the application to examine + * @param key: application (one of the APPLICATION_* constants) + * @returns: pointer to value + */ +val_t *application_getconf(application_t *app, application_key key); + +/* Get the name of this application. + * + * @param ttyp: the application to examine + * @returns: name of the application + */ +char *application_name(application_t *app); + +/* (convenience macro) has this parameter been seen in this application? This + * applies to the specific parameter *within* the application. + * + * @param key: application_key + * @returns: boolean + */ +#define application_seen(app, key) (val_t_seen(application_getconf((app), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param ttyp: the application to examine + * @returns: various + */ +#define application_get_comment(application) (val_t_to_str(application_getconf((application), APPLICATION_COMMENT)) +#define application_get_plugin(application) (val_t_to_str(application_getconf((application), APPLICATION_PLUGIN))) +#define application_get_property(application) (val_t_to_proplist(application_getconf((application), APPLICATION_PROPERTY))) + +application_t *read_application(char *name, FILE *from, char *fname, int *linenum); + +/* A pp-script-tool interface */ +typedef enum pp_script_e { + PP_SCRIPT_COMMENT, + PP_SCRIPT_PLUGIN, + PP_SCRIPT_PROPERTY, + PP_SCRIPT_EXECUTE_ON, + PP_SCRIPT_EXECUTE_WHERE, + PP_SCRIPT_PP_SCRIPT +} pp_script_key; + +/* opaque object */ +typedef struct pp_script_s pp_script_t; + +/* Given the name of the pp_script, return a pp_script object. Returns NULL + * if no matching pp_script exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired pp_script + * @returns: object or NULL + */ + +pp_script_t *lookup_pp_script(char *identifier); + +/* Given a pp_script and a key, return a pointer to the corresponding val_t. + * + * @param ttyp: the pp_script to examine + * @param key: pp_script (one of the PP_SCRIPT_* constants) + * @returns: pointer to value + */ +val_t *pp_script_getconf(pp_script_t *pps, pp_script_key key); + +/* Get the name of this pp_script. + * + * @param ttyp: the pp_script to examine + * @returns: name of the pp_script + */ +char *pp_script_name(pp_script_t *pps); + +/* (convenience macro) has this parameter been seen in this pp_script? This + * applies to the specific parameter *within* the pp_script. + * + * @param key: pp_script_key + * @returns: boolean + */ +#define pp_script_seen(pps, key) (val_t_seen(pp_script_getconf((pps), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param ttyp: the pp_script to examine + * @returns: various + */ + +#define pp_script_get_comment(pp_script) (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_COMMENT))) +#define pp_script_get_plugin(pp_script) (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_PLUGIN))) +#define pp_script_get_property(pp_script) (val_t_to_proplist(pp_script_getconf((pp_script), PP_SCRIPT_PROPERTY))) +#define pp_script_get_execute_on(pp_script) (val_t_to_execute_on(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_ON))) +#define pp_script_get_execute_where(pp_script) (val_t_to_execute_where(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_WHERE))) + +pp_script_t *read_pp_script(char *name, FILE *from, char *fname, int *linenum); +pp_script_t *lookup_pp_script(char *identifier); + +/* A device definition */ +typedef enum { + DEVICE_CONFIG_COMMENT, + DEVICE_CONFIG_TAPEDEV, + DEVICE_CONFIG_DEVICE_PROPERTY, + DEVICE_CONFIG_DEVICE_CONFIG +} device_config_key; + +/* opaque object */ +typedef struct device_config_s device_config_t; + +/* Given the name of the device, return a device_config_t object. Returns NULL + * if no matching device exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired device + * @returns: object or NULL + */ + +device_config_t *lookup_device_config(char *identifier); + +/* Given a device_config and a key, return a pointer to the corresponding val_t. + * + * @param ttyp: the device_config to examine + * @param key: device_config (one of the DEVICE_CONFIG_* constants) + * @returns: pointer to value + */ +val_t *device_config_getconf(device_config_t *devconf, device_config_key key); + +/* Get the name of this device_config. + * + * @param ttyp: the device_config to examine + * @returns: name of the device_config + */ +char *device_config_name(device_config_t *devconf); + +/* (convenience macro) has this parameter been seen in this device_config? This + * applies to the specific parameter *within* the device_config. + * + * @param key: device_config_key + * @returns: boolean + */ +#define device_config_seen(devconf, key) (val_t_seen(device_config_getconf((devconf), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param devconf: the device_config to examine + * @returns: various + */ + +#define device_config_get_comment(devconf) (val_t_to_str(device_config_getconf((devconf), DEVICE_CONFIG_COMMENT))) +#define device_config_get_tapedev(devconf) (val_t_to_str(device_config_getconf((devconf), DEVICE_CONFIG_TAPEDEV))) +#define device_config_get_property(devconf) (val_t_to_proplist(device_config_getconf((devconf), DEVICE_CONFIG_DEVICE_PROPERTY))) + +device_config_t *read_device_config(char *name, FILE *from, char *fname, int *linenum); +device_config_t *lookup_device_config(char *identifier); + +/* A changer definition */ +typedef enum { + CHANGER_CONFIG_COMMENT, + CHANGER_CONFIG_TAPEDEV, + CHANGER_CONFIG_TPCHANGER, + CHANGER_CONFIG_CHANGERDEV, + CHANGER_CONFIG_CHANGERFILE, + CHANGER_CONFIG_CHANGER_CONFIG +} changer_config_key; + +/* opaque object */ +typedef struct changer_config_s changer_config_t; + +/* Given the name of the changer, return a changer_config_t object. Returns NULL + * if no matching changer exists. Note that the match is case-insensitive. + * + * @param identifier: name of the desired changer + * @returns: object or NULL + */ + +changer_config_t *lookup_changer_config(char *identifier); + +/* Given a changer_config and a key, return a pointer to the corresponding val_t. + * + * @param ttyp: the changer_config to examine + * @param key: changer_config (one of the DEVICE_CONFIG_* constants) + * @returns: pointer to value + */ +val_t *changer_config_getconf(changer_config_t *devconf, changer_config_key key); + +/* Get the name of this changer_config. + * + * @param ttyp: the changer_config to examine + * @returns: name of the changer_config + */ +char *changer_config_name(changer_config_t *devconf); + +/* (convenience macro) has this parameter been seen in this changer_config? This + * applies to the specific parameter *within* the changer_config. + * + * @param key: changer_config_key + * @returns: boolean + */ +#define changer_config_seen(devconf, key) (val_t_seen(changer_config_getconf((devconf), (key)))) + +/* (convenience macros) + * fetch a particular parameter; caller must know the correct type. + * + * @param devconf: the changer_config to examine + * @returns: various + */ + +#define changer_config_get_comment(devconf) (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_COMMENT))) +#define changer_config_get_tapedev(devconf) (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_TAPEDEV))) +#define changer_config_get_tpchanger(devconf) (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_TPCHANGER))) +#define changer_config_get_changerdev(devconf) (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_CHANGERDEV))) +#define changer_config_get_changerfile(devconf) (val_t_to_str(changer_config_getconf((devconf), DEVICE_CONFIG_CHANGERFILE))) + +changer_config_t *read_changer_config(char *name, FILE *from, char *fname, int *linenum); +changer_config_t *lookup_changer_config(char *identifier); + +/* + * Error Handling + */ + +typedef enum { + /* No errors or warnings */ + CFGERR_OK = 0, + + /* warnings were encountered */ + CFGERR_WARNINGS = 1, + + /* errors (and maybe some warnings too, who knows) were encountered */ + CFGERR_ERRORS = 2, +} cfgerr_level_t; + +/* + * Errors + */ + +/* Get a GSList of all error and warning messages accumulated so far. + * + * @param (output) errlist: pointer to the list of error strings; allocated + * memory remains the responsibility of the config module. If errlist is + * NULL, the list is not returned. + * @returns: current error level + */ +cfgerr_level_t config_errors(GSList **errlist); + +/* Clear any error conditions. + */ +void config_clear_errors(void); + +/* Print the list of current error and warning messages, one per line, + * to stderr. This is a convenience function for command-line + * applications. + */ +void config_print_errors(void); + +/* Add an error message to the list of errors, and make sure tha the + * error level is at least LEVEL. This is used by the diskfile module + * to insert its errors into this module's error list. + * + * @param level: level for this error + * @param errmsg: error message; conffile takes responsibility for freeing + * this string. + */ +void config_add_error(cfgerr_level_t level, char *errmsg); /* * Command-line handling @@ -809,15 +1175,13 @@ extract_commandline_config_overwrites(int *argc, char ***argv); /* Apply configuration overwrites to the current configuration and take - * ownership of the config_overwrites object. - * - * If any parameters are not matched in the current symbol table, or - * correspond to named subsections which do not exist, this function calls - * error() and does not return. + * ownership of the config_overwrites object. It is the caller's + * responsibility to handle any errors. * * @param co: the config_overwrites object + * @returns: current error level */ -void apply_config_overwrites(config_overwrites_t *co); +cfgerr_level_t apply_config_overwrites(config_overwrites_t *co); /* * Initialization @@ -837,9 +1201,6 @@ typedef enum { /* New configuration should "overlay" existing configuration; this * is used by clients to load multiple amanda-client.conf files. */ CONFIG_INIT_OVERLAY = 1 << 3, - - /* If the file doesn't exist, halt with an error. */ - CONFIG_INIT_FATAL = 1 << 4, } config_init_flags; /* Initialize this application's configuration, with the specific actions @@ -855,15 +1216,14 @@ typedef enum { * - otherwise, for the client only, se config_dir to CONFIG_DIR and * config_name to NULL. * - depending on CONFIG_INIT_CLIENT, read amanda.conf or amanda-client.conf - * - in the event of an error, call error() if CONFIG_INIT_FATAL, otherwise - * record a message in the debug log and return false. * * @param flags: flags indicating desired behavior, as above * @param arg_config_name: config name to use (from e.g., argv[1]) - * @returns: true on success, false on failure, unless CONFIG_INIT_FATAL + * @returns: current error level */ -gboolean config_init(config_init_flags flags, - char *arg_config_name); +cfgerr_level_t config_init( + config_init_flags flags, + char *arg_config_name); /* Free all memory allocated for the configuration. This effectively * reverses the effects of config_init(). @@ -891,21 +1251,14 @@ void config_uninit(void); */ char **get_config_options(int first); -/* The name of the configuration under which this application is running. - * This variable is initialized by config_init, and should be treated as - * read-only. - */ -extern char *config_name; +/* Get the config name */ +char *get_config_name(void); -/* The directory containing the configuration for this application. This - * variable is initialized by config_init, and should be treated as read-only. - */ -extern char *config_dir; +/* Get the config directory */ +char *get_config_dir(void); -/* The most recently read top-level configuration file. This variable is - * initialized by config_init, and should be treated as read-only. - */ -extern char *config_filename; +/* Get the config filename */ +char *get_config_filename(void); /* * Utilities @@ -956,6 +1309,15 @@ char **val_t_display_strs(val_t *val, int str_needs_quotes); */ dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum); +/* Every call return a pointer to a string with an increasing number; this is + * used by this module as well as by diskfile.c to read the disklist. + * + * Nobody else should use this function. Seriously. + * + * @returns: a pointer to a static string. + */ +char *anonymous_value(void); + /* Extend a relative filename with the current config_dir; if filename is already * absolute, this is equivalent to stralloc. * @@ -983,4 +1345,18 @@ char *taperalgo2str(taperalgo_t taperalgo); */ gint64 find_multiplier(char * casestr); +/* Compute the size needed in an ARGV to pass all properties + * + * @param proplist: The property list + * @returns: The size required for an ARGV + */ +int property_argv_size(proplist_t proplist); + +/* Add all properties to an ARGV + * + * @param argvchild: Pointer to the ARGV. + * @param proplist: The property list + */ +int property_add_to_argv(char **argvchild, proplist_t proplist); + #endif /* ! CONFFILE_H */ diff --git a/common-src/debug.c b/common-src/debug.c index ed036e4..dff1383 100644 --- a/common-src/debug.c +++ b/common-src/debug.c @@ -64,7 +64,7 @@ static time_t open_time; static void (*logerror_fn)(char *) = NULL; /* storage for global variables */ -erroutput_type_t erroutput_type = ERR_INTERACTIVE; +erroutput_type_t erroutput_type = ERR_FROM_CONTEXT; int error_exit_status = 1; /* static function prototypes */ @@ -126,29 +126,60 @@ debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED, gpointer user_data G_GNUC_UNUSED) { char *maxlevel = NULL; + pcontext_t context = get_pcontext(); + + /* scriptutil context doesn't do any logging except for critical + * and error levels */ + if (context != CONTEXT_SCRIPTUTIL) { + /* convert the highest level to a string and dbprintf it */ + if (log_level & G_LOG_LEVEL_ERROR) + maxlevel = _("error (fatal): "); + else if (log_level & G_LOG_LEVEL_CRITICAL) + maxlevel = _("critical (fatal): "); + else if (log_level & G_LOG_LEVEL_WARNING) + maxlevel = _("warning: "); + else if (log_level & G_LOG_LEVEL_MESSAGE) + maxlevel = _("message: "); + else if (log_level & G_LOG_LEVEL_INFO) + maxlevel = _("info: "); + else + maxlevel = ""; /* no level displayed for debugging */ - /* convert the highest level to a string and dbprintf it */ - if (log_level & G_LOG_LEVEL_ERROR) - maxlevel = _("error (fatal): "); - else if (log_level & G_LOG_LEVEL_CRITICAL) - maxlevel = _("critical (fatal): "); - else if (log_level & G_LOG_LEVEL_WARNING) - maxlevel = _("warning: "); - else if (log_level & G_LOG_LEVEL_MESSAGE) - maxlevel = _("message: "); - else if (log_level & G_LOG_LEVEL_INFO) - maxlevel = _("info: "); - else - maxlevel = ""; /* no level displayed for debugging */ - - debug_printf("%s%s\n", maxlevel, message); + debug_printf("%s%s\n", maxlevel, message); + } /* error and critical levels have special handling */ if (log_level & (G_LOG_LEVEL_ERROR|G_LOG_LEVEL_CRITICAL)) { - if (erroutput_type & ERR_AMANDALOG && logerror_fn != NULL) + erroutput_type_t local_erroutput; + + /* Calculate a local version of erroutput_type, based on the + * context if the process has not set erroutput_type explicitly */ + if (!(erroutput_type & ERR_FROM_CONTEXT)) { + local_erroutput = erroutput_type; + } else { + switch (context) { + case CONTEXT_SCRIPTUTIL: + local_erroutput = ERR_INTERACTIVE; + break; + + case CONTEXT_DAEMON: + local_erroutput = ERR_INTERACTIVE + | ERR_AMANDALOG + | ERR_SYSLOG; + break; + + case CONTEXT_CMDLINE: + case CONTEXT_DEFAULT: + default: + local_erroutput = ERR_INTERACTIVE; + break; + } + } + + if (local_erroutput & ERR_AMANDALOG && logerror_fn != NULL) (*logerror_fn)((char *)message); /* discard 'const' */ - if (erroutput_type & ERR_SYSLOG) { + if (local_erroutput & ERR_SYSLOG) { #ifdef LOG_AUTH openlog(get_pname(), LOG_PID, LOG_AUTH); #else @@ -158,7 +189,7 @@ debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED, closelog(); } - if (erroutput_type & ERR_INTERACTIVE) { + if (local_erroutput & ERR_INTERACTIVE) { g_fprintf(stderr, "%s: %s\n", get_pname(), message); fflush(stderr); } @@ -379,9 +410,10 @@ debug_setup_2( /* * Make the first debug log file entry. */ - debug_printf(_("pid %ld ruid %ld euid %ld: %s at %s"), + debug_printf(_("pid %ld ruid %ld euid %ld version %s: %s at %s"), (long)getpid(), (long)getuid(), (long)geteuid(), + VERSION, annotation, ctime(&open_time)); } @@ -410,6 +442,19 @@ msg_timestamp(void) * ---- public functions */ +void +debug_init(void) +{ + debug_setup_logging(); + + /* the scriptutil context does not create a debug log, since such + * processes are invoked many times. + */ + if (get_pcontext() != CONTEXT_SCRIPTUTIL) { + debug_open(get_ptype()); + } +} + void set_logerror(void (*f)(char *)) { @@ -647,6 +692,7 @@ printf_arglist_function(void debug_printf, const char *, format) { va_list argp; int save_errno; + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; /* * It is common in the code to call dbprintf to write out @@ -662,6 +708,7 @@ printf_arglist_function(void debug_printf, const char *, format) db_file = stderr; } if(db_file != NULL) { + g_static_mutex_lock(&mutex); if (db_file != stderr) g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname()); else @@ -670,6 +717,7 @@ printf_arglist_function(void debug_printf, const char *, format) g_vfprintf(db_file, format, argp); arglist_end(argp); fflush(db_file); + g_static_mutex_unlock(&mutex); } errno = save_errno; } diff --git a/common-src/debug.h b/common-src/debug.h index b3d539e..13894be 100644 --- a/common-src/debug.h +++ b/common-src/debug.h @@ -53,8 +53,9 @@ * g_info -- helpful extra details, but not verbose * g_debug -- debug messages * - * g_error and g_critical will respect erroutput_type, potentially - * sending the error to the Amanda logfile for this run (see logfile.c). + * g_error and g_critical will respect erroutput_type, or if that has not + * been set explicitly, the current process context (get_pcontext). This can + * mean sending the error to the Amanda logfile for this run (see logfile.c). */ /* g_debug was introduced in glib 2.6, so define it here for systems where @@ -70,6 +71,15 @@ #define g_info(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__) #endif +/* Initialize the debugging interface. This is the "high-level" + * initialization function; older and lower-level applications can call + * dbopen() and friends directly. + * + * This function sets up debug logging and error-handling according to + * the current process name, type, and context, as defined in util. + */ +void debug_init(void); + /* * FATAL ERROR HANDLING */ @@ -80,7 +90,8 @@ #define errordump(...) do { g_error(__VA_ARGS__); abort(); } while (0) #define error(...) do { g_critical(__VA_ARGS__); exit(error_exit_status); } while (0) -/* Additional handling for error and critical messages. */ +/* Additional handling for error and critical messages. Leave this + * set to its default if you're using debug_init(). */ typedef enum { /* send message to stderr (for interactive programs) */ ERR_INTERACTIVE = 1 << 0, /* (default) */ @@ -90,7 +101,12 @@ typedef enum { /* add an L_FATAL entry in the Amanda logfile for the * current run */ - ERR_AMANDALOG = 1 << 2 + ERR_AMANDALOG = 1 << 2, + + /* the default situation -- do whatever's appropriate for + * the current context. If this is set, the other flags + * are ignored. */ + ERR_FROM_CONTEXT = 1 << 3, } erroutput_type_t; extern erroutput_type_t erroutput_type; @@ -103,7 +119,7 @@ extern int error_exit_status; * ERR_AMANDALOG is set. * * This function is required because libamanda, which contains - * debug.c, is not always linked with the logerror module + * debug.c, is not always linked with the logerror module * (which only appears in server applications). * * @param logerror_fn: function pointer diff --git a/common-src/dgram.c b/common-src/dgram.c index 7fbabb0..f0e80ec 100644 --- a/common-src/dgram.c +++ b/common-src/dgram.c @@ -64,6 +64,7 @@ dgram_bind( portrange = getconf_intrange(CNF_RESERVED_UDP_PORT); *portp = (in_port_t)0; + g_debug("dgram_bind: setting up a socket with family %d", family); if((s = socket(family, SOCK_DGRAM, 0)) == -1) { save_errno = errno; dbprintf(_("dgram_bind: socket() failed: %s\n"), @@ -158,6 +159,7 @@ dgram_send_addr( s = dgram->socket; socket_opened = 0; } else { + g_debug("dgram_send_addr: setting up a socket with family %d", SU_GET_FAMILY(addr)); if((s = socket(SU_GET_FAMILY(addr), SOCK_DGRAM, 0)) == -1) { save_errno = errno; dbprintf(_("dgram_send_addr: socket() failed: %s\n"), diff --git a/common-src/event-test.c b/common-src/event-test.c new file mode 100644 index 0000000..6a3bb15 --- /dev/null +++ b/common-src/event-test.c @@ -0,0 +1,650 @@ +/* + * Copyright (c) 2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 465 N Mathlida Ave, Suite 300 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * + * Author: Dustin J. Mitchell + */ + +#include "amanda.h" +#include "testutils.h" +#include "event.h" + +/* a random global variable to flag that some function has been called */ +static int global; + +/* file descriptor under EV_READFD or EV_WRITEFD */ +static int cb_fd; + +/* and some easy access to the event handles for callbacks */ +static event_handle_t *hdl[10]; + +/* + * Utils + */ + +/* A common event callback that just decrements 'global', and frees + * hdl[0] if global reaches zero. + */ +static void +test_decrement_cb(void *up G_GNUC_UNUSED) +{ + global--; + tu_dbg("Decrement global to %d\n", global); + if (global == 0) { + tu_dbg("Release event\n"); + event_release(hdl[0]); + } +} + +/* + * Tests + */ + +/**** + * Test that EV_TIME events fire, repeatedly. + */ +static int +test_ev_time(void) +{ + global = 2; + hdl[0] = event_register(1, EV_TIME, test_decrement_cb, NULL); + + /* Block waiting for the event to fire. The event itself eventually + * unregisters itself, causing the event_loop to finish */ + event_loop(0); + + return (global == 0); +} + +/**** + * Test that nonblocking waits don't block. + */ +static int +test_nonblock(void) +{ + global = 1; /* the callback should not be triggered, so this should stay 1 */ + hdl[0] = event_register(1, EV_TIME, test_decrement_cb, NULL); + + event_loop(1); /* non-blocking */ + + return (global != 0); +} + +/**** + * Test that EV_WAIT events fire when event_wakeup is called, without waiting for + * another iteration of the event loop. Security API depends on callbacks occuring + * immediately. + */ +static int +test_ev_wait(void) +{ + global = 2; + hdl[0] = event_register(4422, EV_WAIT, test_decrement_cb, NULL); + + if (global != 2) return 0; + event_wakeup(4422); + if (global != 1) return 0; + event_wakeup(4422); + if (global != 0) return 0; + event_wakeup(4422); /* the handler has been removed, but this is not an error */ + if (global != 0) return 0; + + /* queue should now be empty, so this won't block */ + event_loop(0); + + return 1; +} + +/**** + * Test that EV_WAIT events with the same ID added during an EV_WAIT callback are not + * called back immediately, but wait for a subsequent wakeup. Security API depends on + * this behavior. This is a pathological test :) + */ +static void +test_ev_wait_2_cb(void *up G_GNUC_UNUSED) +{ + global--; + tu_dbg("Decrement global to %d\n", global); + + if (global >= 0) { + tu_dbg("release EV_WAIT event\n"); + event_release(hdl[0]); + } + if (global > 0) { + tu_dbg("register new EV_WAIT event with same ID\n"); + hdl[0] = event_register(84, EV_WAIT, test_ev_wait_2_cb, NULL); + } +} + +static int +test_ev_wait_2(void) +{ + global = 2; + hdl[0] = event_register(84, EV_WAIT, test_ev_wait_2_cb, NULL); + + /* Each wakeup should only invoke the callback *once* */ + if (global != 2) return 0; + event_wakeup(84); + if (global != 1) return 0; + event_wakeup(84); + if (global != 0) return 0; + event_wakeup(84); /* the handler has been removed, but this is not an error */ + if (global != 0) return 0; + + return 1; +} + +/**** + * Test that event_wait correctly waits for a EV_TIME event to fire, even when + * other events are running. */ +static void +test_event_wait_cb(void *up G_GNUC_UNUSED) +{ + int *cb_fired = (int *)up; + (*cb_fired) = 1; + + /* immediately unregister ourselves */ + tu_dbg("test_event_wait_cb called\n"); + event_release(hdl[1]); +} + +static int +test_event_wait(void) +{ + int cb_fired = 0; + global = 3; + + /* this one serves as a "decoy", running in the background while we wait + * for test_event_wait_cb */ + hdl[0] = event_register(1, EV_TIME, test_decrement_cb, NULL); + + /* this is our own callback */ + hdl[1] = event_register(2, EV_TIME, test_event_wait_cb, (void *)&cb_fired); + + /* wait until our own callback fires */ + event_wait(hdl[1]); + + /* at this point, test_decrement_cb should have fired once or twice, but not + * three times */ + if (global == 0) { + tu_dbg("global is already zero!\n"); + return 0; + } + + /* and our own callback should have fired */ + if (!cb_fired) { + tu_dbg("test_event_wait_cb didn't fire\n"); + return 0; + } + + return 1; +} + +/**** + * Test that event_wait correctly waits for a EV_WAIT event to be released, not + * fired, even when other events are running. */ +static void +test_event_wait_2_cb(void *up) +{ + int *wakeups_remaining = (int *)up; + tu_dbg("test_event_wait_2_cb called\n"); + + if (--(*wakeups_remaining) == 0) { + /* unregister ourselves if we've awakened enough times */ + event_release(hdl[2]); + hdl[2] = NULL; + } +} + +static void +test_event_wait_2_wakeup_cb(void *up G_GNUC_UNUSED) +{ + tu_dbg("test_event_wait_2_wakeup_cb called\n"); + + /* wake up the EV_WAIT event */ + event_wakeup(9876); +} + +static int +test_event_wait_2(void) +{ + int wakeups_remaining = 2; + global = 3; + + /* this one serves as a "decoy", running in the background while we wait + * for test_event_wait_2_cb */ + hdl[0] = event_register(1, EV_TIME, test_decrement_cb, NULL); + + /* This one repeatedly calls event_wakeup for the EV_WAIT event */ + hdl[1] = event_register(1, EV_TIME, test_event_wait_2_wakeup_cb, NULL); + + /* this is our own callback */ + hdl[2] = event_register(9876, EV_WAIT, test_event_wait_2_cb, (void *)&wakeups_remaining); + + /* wait until the EV_WAIT is *released*, not just fired. */ + event_wait(hdl[2]); + + /* at this point, test_decrement_cb should have fired twice, but not + * three times */ + if (global == 0) { + tu_dbg("global is already zero!\n"); + return 0; + } + + /* and our own callback should have fired twice, not just once */ + if (wakeups_remaining != 0) { + tu_dbg("test_event_wait_2_cb didn't fire twice\n"); + return 0; + } + + return 1; +} + +/**** + * Test that EV_READFD is triggered correctly when there's data available + * for reading. The source of read events is a spawned child which writes + * lots of data to a pipe, in hopes of overflowing the pipe buffer. + */ +static void +test_ev_readfd_cb(void *up G_GNUC_UNUSED) +{ + char buf[1024]; + int len; + + /* read from the fd until we're out of bytes */ + tu_dbg("reader: callback executing\n"); + len = read(cb_fd, buf, sizeof(buf)); + if (len == 0) { + tu_dbg("reader: callback returning\n"); + } else if (len < 0) { + tu_dbg("reader: read() returned %d: %s\n", len, strerror(errno)); + /* do we need to handle e.g., EAGAIN here? */ + } else { + tu_dbg("reader: read %d bytes\n", len); + global -= len; + /* release this event if we've read all of the available bytes */ + if (global <= 0) { + close(cb_fd); + event_release(hdl[0]); + } + } +} + +static void +test_ev_readfd_writer(int fd, size_t count) +{ + char buf[256]; + size_t i; + + for (i = 0; i < sizeof(buf); i++) { + buf[i] = (char)i; + } + + while (count > 0) { + int len; + + len = write(fd, buf, min(sizeof(buf), count)); + tu_dbg("writer wrote %d bytes\n", len); + count -= len; + } + + close(fd); +} + +#define TEST_EV_READFD_SIZE (1024*1024) + +static int +test_ev_readfd(void) +{ + int writer_pid; + int p[2]; + + /* make a pipe */ + if (pipe(p) == -1) { + exit(1); + } + + /* fork off the writer */ + switch (writer_pid = fork()) { + case 0: /* child */ + close(p[0]); + test_ev_readfd_writer(p[1], TEST_EV_READFD_SIZE); + exit(0); + break; + + case -1: /* error */ + perror("fork"); + return 0; + + default: /* parent */ + break; + } + + /* set up a EV_READFD on the read end of the pipe */ + cb_fd = p[0]; + fcntl(cb_fd, F_SETFL, O_NONBLOCK); + close(p[1]); + global = TEST_EV_READFD_SIZE; + hdl[0] = event_register(p[0], EV_READFD, test_ev_readfd_cb, NULL); + + /* let it run */ + event_loop(0); + + tu_dbg("waiting for writer to die..\n"); + waitpid(writer_pid, NULL, 0); + + if (global != 0) { + tu_dbg("%d bytes remain unread..\n", global); + return 0; + } + + return 1; +} + +/**** + * Test the combination of an EV_TIME and an EV_READFD to peform a + * timeout-protected read that times out. + */ +static void +test_read_timeout_slow_writer(int fd) +{ + char buf[] = "OH NO!"; + + /* this should exceed the timeout, which is 1s */ + sleep(2); + + if (write(fd, buf, strlen(buf)+1) == -1) { + exit(1); + } + close(fd); +} + +static void +test_read_timeout_cb(void *up G_GNUC_UNUSED) +{ + tu_dbg("read timed out (this is supposed to happen)\n"); + global = 1234; /* sentinel value */ + + /* free up all of the events so that event_loop returns */ + event_release(hdl[0]); + event_release(hdl[1]); +} + +static int +test_read_timeout(void) +{ + int writer_pid; + int p[2]; + + /* make a pipe */ + if (pipe(p) == -1) { + exit(1); + } + + /* fork off the writer */ + switch (writer_pid = fork()) { + case 0: /* child */ + close(p[0]); + test_read_timeout_slow_writer(p[1]); + exit(0); + break; + + case -1: /* error */ + perror("fork"); + return 0; + + default: /* parent */ + break; + } + + /* set up a EV_READFD on the read end of the pipe */ + cb_fd = p[0]; + fcntl(cb_fd, F_SETFL, O_NONBLOCK); + close(p[1]); + hdl[0] = event_register(p[0], EV_READFD, test_ev_readfd_cb, NULL); + + /* and set up a timeout */ + global = 0; /* timeout_cb will set this to 1234 */ + hdl[1] = event_register(1, EV_TIME, test_read_timeout_cb, NULL); + + /* let it run */ + event_loop(0); + + /* see if we got the sentinel indicating the timeout fired */ + if (global != 1234) + return 0; + + return 1; +} + +/**** + * Test that EV_WRITEFD is triggered correctly when there's buffer space to + * support a write. + */ + +static void +test_ev_writefd_cb(void *up G_GNUC_UNUSED) +{ + char buf[1024]; + int len; + unsigned int i; + + /* initialize the buffer to something worthwhile */ + for (i = 0; i < sizeof(buf); i++) { + buf[i] = (char)i; + } + + /* write some bytes, but no more than global */ + tu_dbg("test_ev_writefd_cb called\n"); + while (1) { + len = write(cb_fd, buf, min((size_t)global, sizeof(buf))); + if (len < 0) { + tu_dbg("test_ev_writefd_cb: write() returned %d\n", len); + return; + } else if (len == 0) { + /* do we need to handle EAGAIN, etc. here? */ + tu_dbg("test_ev_writefd_cb done\n"); + return; + } + tu_dbg(" write() wrote %d bytes\n", len); + global -= len; + if (global <= 0) { + close(cb_fd); + event_release(hdl[0]); + return; + } + } +} + +static void +test_ev_writefd_consumer(int fd, size_t count) +{ + while (count > 0) { + char buf[1024]; + int len; + + tu_dbg("reader: calling read(%d)\n", (int)sizeof(buf)); + len = read(fd, buf, sizeof(buf)); + + /* exit on a read error or EOF */ + if (len < 1) return; + + tu_dbg("reader: read() returned %d bytes\n", len); + + count -= len; + } +} + +#define TEST_EV_WRITEFD_SIZE (1024*1024) + +static int +test_ev_writefd(void) +{ + int reader_pid; + int p[2]; + + /* make a pipe */ + if (pipe(p) == -1) { + exit(1); + } + + /* fork off the reader */ + switch (reader_pid = fork()) { + case 0: /* child */ + close(p[1]); + test_ev_writefd_consumer(p[0], TEST_EV_WRITEFD_SIZE); + exit(0); + break; + + case -1: /* error */ + perror("fork"); + return 0; + + default: /* parent */ + break; + } + + /* set up a EV_WRITEFD on the write end of the pipe */ + cb_fd = p[1]; + fcntl(cb_fd, F_SETFL, O_NONBLOCK); + global = TEST_EV_WRITEFD_SIZE; + close(p[0]); + hdl[0] = event_register(p[1], EV_WRITEFD, test_ev_writefd_cb, NULL); + + /* let it run */ + event_loop(0); + + tu_dbg("waiting for reader to die..\n"); + waitpid(reader_pid, NULL, 0); + + /* and see what we got */ + if (global != 0) { + tu_dbg("writes did not complete\n"); + return 0; + } + + return 1; +} + +/**** + * Test that a child_watch_source works correctly. + */ + +static gint test_child_watch_result = 0; +static GMainLoop *test_child_watch_main_loop = NULL; + +static void +test_child_watch_callback( + pid_t pid, + gint status, + gpointer data) +{ + static int count = 0; + gint expected_pid = GPOINTER_TO_INT(data); + + if (pid != expected_pid + || !WIFEXITED(status) + || WEXITSTATUS(status) != 13) + test_child_watch_result = FALSE; + else + test_child_watch_result = TRUE; + + count++; + if(count >= 2) + g_main_loop_quit(test_child_watch_main_loop); +} + +static int +test_child_watch_source(void) +{ + int pid, pid2; + GSource *src, *src2; + + /* fork off the child we want to watch die */ + switch (pid = fork()) { + case 0: /* child */ + exit(13); + break; + + case -1: /* error */ + perror("fork"); + return 0; + + default: /* parent */ + break; + } + + /* set up a child watch */ + src = new_child_watch_source(pid); + g_source_set_callback(src, (GSourceFunc)test_child_watch_callback, + GINT_TO_POINTER(pid), NULL); + g_source_attach(src, NULL); + g_source_unref(src); + + switch (pid2 = fork()) { + case 0: /* child */ + exit(13); + break; + + case -1: /* error */ + perror("fork"); + return 0; + + default: /* parent */ + break; + } + + sleep(1); + /* set up a child watch */ + src2 = new_child_watch_source(pid2); + g_source_set_callback(src2, (GSourceFunc)test_child_watch_callback, + GINT_TO_POINTER(pid2), NULL); + g_source_attach(src2, NULL); + g_source_unref(src2); + + /* let it run */ + test_child_watch_main_loop = g_main_loop_new(NULL, 1); + g_main_loop_run(test_child_watch_main_loop); + + return test_child_watch_result; +} + +/* + * Main driver + */ + +int +main(int argc, char **argv) +{ + static TestUtilsTest tests[] = { + TU_TEST(test_ev_time, 10), + TU_TEST(test_ev_wait, 10), + TU_TEST(test_ev_wait_2, 10), + TU_TEST(test_ev_readfd, 60), /* runs slowly on old kernels */ + TU_TEST(test_ev_writefd, 60), + TU_TEST(test_event_wait, 10), + TU_TEST(test_event_wait_2, 10), + TU_TEST(test_nonblock, 10), + TU_TEST(test_read_timeout, 10), + TU_TEST(test_child_watch_source, 5), + /* fdsource is used by ev_readfd/ev_writefd, and is sufficiently tested there */ + TU_END() + }; + + return testutils_run_tests(argc, argv, tests); +} diff --git a/common-src/event.c b/common-src/event.c index 11bad8b..474e871 100644 --- a/common-src/event.c +++ b/common-src/event.c @@ -29,13 +29,24 @@ * Event handler. Serializes different kinds of events to allow for * a uniform interface, central state storage, and centralized * interdependency logic. + * + * This is a compatibility wrapper over Glib's GMainLoop. New code should + * use Glib's interface directly. + * + * Each event_handle is associated with a unique GSource, identified by it + * event_source_id. */ #include "amanda.h" -#include "event.h" -#include "queue.h" #include "conffile.h" +#include "event.h" +#include "glib-util.h" + +/* TODO: use mem chunks to allocate event_handles */ +/* TODO: lock stuff for threading */ +/* Write a debugging message if the config variable debug_event + * is greater than or equal to i */ #define event_debug(i, ...) do { \ if ((i) <= debug_event) { \ dbprintf(__VA_ARGS__); \ @@ -49,56 +60,56 @@ struct event_handle { event_fn_t fn; /* function to call when this fires */ void *arg; /* argument to pass to previous function */ + event_type_t type; /* type of event */ event_id_t data; /* type data */ - time_t lastfired; /* timestamp of last fired (EV_TIME only) */ - LIST_ENTRY(event_handle) le; /* queue handle */ -}; -/* - * eventq is a queue of currently active events. - * cache is a queue of unused handles. We keep a few around to avoid - * malloc overhead when doing a lot of register/releases. - */ -static struct { - LIST_HEAD(, event_handle) listhead; - int qlength; -} eventq = { - LIST_HEAD_INITIALIZER(eventq.listhead), 0 -}, cache = { - LIST_HEAD_INITIALIZER(eventq.listhead), 0 + GSource *source; /* Glib event source, if one exists */ + guint source_id; /* ID of the glib event source */ + + gboolean has_fired; /* for use by event_wait() */ + gboolean is_dead; /* should this event be deleted? */ }; -#define eventq_first(q) LIST_FIRST(&q.listhead) -#define eventq_next(eh) LIST_NEXT(eh, le) -#define eventq_add(q, eh) LIST_INSERT_HEAD(&q.listhead, eh, le); -#define eventq_remove(eh) LIST_REMOVE(eh, le); -/* - * How many items we can have in the handle cache before we start - * freeing. - */ -#define CACHEDEPTH 10 +/* A list of all extant event_handle objects, used for searching for particular + * events and for deleting dead events */ +GSList *all_events; /* - * A table of currently set signal handlers. + * Utility functions */ -static struct sigtabent { - event_handle_t *handle; /* handle for this signal */ - int score; /* number of signals recvd since last checked */ - void (*oldhandler)(int);/* old handler (for unsetting) */ -} sigtable[NSIG]; - -static const char *event_type2str(event_type_t); -#define fire(eh) (*(eh)->fn)((eh)->arg) -static void signal_handler(int); -static event_handle_t *gethandle(void); -static void puthandle(event_handle_t *); -static int event_loop_wait (event_handle_t *, const int); + +static const char *event_type2str(event_type_t type); + +/* "Fire" an event handle, by calling its callback function */ +#define fire(eh) do { \ + event_debug(1, "firing %p: %s/%jd\n", eh, event_type2str((eh)->type), (eh)->data); \ + (*(eh)->fn)((eh)->arg); \ + (eh)->has_fired = TRUE; \ +} while(0) + +/* Adapt a Glib callback to an event_handle_t callback; assumes that the + * user_ptr for the Glib callback is a pointer to the event_handle_t. */ +static gboolean +event_handle_callback( + gpointer user_ptr) +{ + event_handle_t *hdl = (event_handle_t *)user_ptr; + + /* if the handle is dead, then don't fire the callback; this means that + * we're in the process of freeing the event */ + if (!hdl->is_dead) { + fire(hdl); + } + + /* don't ever let GMainLoop destroy GSources */ + return TRUE; +} /* - * Add a new event. See the comment in event.h for what the arguments - * mean. + * Public functions */ + event_handle_t * event_register( event_id_t data, @@ -107,42 +118,79 @@ event_register( void *arg) { event_handle_t *handle; + GIOCondition cond; + /* sanity-checking */ if ((type == EV_READFD) || (type == EV_WRITEFD)) { /* make sure we aren't given a high fd that will overflow a fd_set */ if (data >= (int)FD_SETSIZE) { - error(_("event_register: Invalid file descriptor %lu"), data); + error(_("event_register: Invalid file descriptor %jd"), data); /*NOTREACHED*/ } -#if !defined(__lint) /* Global checking knows that these are never called */ - } else if (type == EV_SIG) { - /* make sure signals are within range */ - if (data >= NSIG) { - error(_("event_register: Invalid signal %lu"), data); - /*NOTREACHED*/ - } - if (sigtable[data].handle != NULL) { - error(_("event_register: signal %lu already registered"), data); - /*NOTREACHED*/ + } else if (type == EV_TIME) { + if (data <= 0) { + error(_("event_register: interval for EV_TIME must be greater than 0; got %jd"), data); } - } else if (type >= EV_DEAD) { - error(_("event_register: Invalid event type %d"), type); - /*NOTREACHED*/ -#endif } - handle = gethandle(); + handle = g_new0(event_handle_t, 1); handle->fn = fn; handle->arg = arg; handle->type = type; handle->data = data; - handle->lastfired = -1; - eventq_add(eventq, handle); - eventq.qlength++; + handle->is_dead = FALSE; - event_debug(1, _("event: register: %p->data=%lu, type=%s\n"), + event_debug(1, _("event: register: %p->data=%jd, type=%s\n"), handle, handle->data, event_type2str(handle->type)); - return (handle); + + /* add to the list of events */ + all_events = g_slist_prepend(all_events, (gpointer)handle); + + /* and set up the GSource for this event */ + switch (type) { + case EV_READFD: + case EV_WRITEFD: + /* create a new source */ + if (type == EV_READFD) { + cond = G_IO_IN | G_IO_HUP | G_IO_ERR; + } else { + cond = G_IO_OUT | G_IO_ERR; + } + + handle->source = new_fdsource(data, cond); + + /* attach it to the default GMainLoop */ + g_source_attach(handle->source, NULL); + handle->source_id = g_source_get_id(handle->source); + + /* And set its callbacks */ + g_source_set_callback(handle->source, event_handle_callback, + (gpointer)handle, NULL); + + /* drop our reference to it, so when it's detached, it will be + * destroyed. */ + g_source_unref(handle->source); + break; + + case EV_TIME: + /* Glib provides a nice shortcut for timeouts. The *1000 converts + * seconds to milliseconds. */ + handle->source_id = g_timeout_add(data * 1000, event_handle_callback, + (gpointer)handle); + + /* But it doesn't give us the source directly.. */ + handle->source = g_main_context_find_source_by_id(NULL, handle->source_id); + break; + + case EV_WAIT: + /* nothing to do -- these are handled independently of GMainLoop */ + break; + + default: + error(_("Unknown event type %s"), event_type2str(type)); + } + + return handle; } /* @@ -154,37 +202,15 @@ void event_release( event_handle_t *handle) { - assert(handle != NULL); - event_debug(1, _("event: release (mark): %p data=%lu, type=%s\n"), + event_debug(1, _("event: release (mark): %p data=%jd, type=%s\n"), handle, handle->data, event_type2str(handle->type)); - assert(handle->type != EV_DEAD); - - /* - * For signal events, we need to specially remove then from the - * signal event table. - */ - if (handle->type == EV_SIG) { - struct sigtabent *se = &sigtable[handle->data]; - - assert(se->handle == handle); - signal((int)handle->data, se->oldhandler); - se->handle = NULL; - se->score = 0; - } - - /* - * Decrement the qlength now since this is no longer a real - * event. - */ - eventq.qlength--; + assert(!handle->is_dead); - /* - * Mark it as dead and leave it for the loop to remove. - */ - handle->type = EV_DEAD; + /* Mark it as dead and leave it for the event_loop to remove */ + handle->is_dead = TRUE; } /* @@ -194,401 +220,153 @@ int event_wakeup( event_id_t id) { - event_handle_t *eh; + GSList *iter; + GSList *tofire = NULL; int nwaken = 0; - event_debug(1, _("event: wakeup: enter (%lu)\n"), id); + event_debug(1, _("event: wakeup: enter (%jd)\n"), id); - for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) { + /* search for any and all matching events, and record them. This way + * we have determined the whole list of events we'll be firing *before* + * we fire any of them. */ + for (iter = all_events; iter != NULL; iter = g_slist_next(iter)) { + event_handle_t *eh = (event_handle_t *)iter->data; + if (eh->type == EV_WAIT && eh->data == id && !eh->is_dead) { + tofire = g_slist_append(tofire, (gpointer)eh); + } + } - if (eh->type == EV_WAIT && eh->data == id) { - event_debug(1, _("event: wakeup: %p id=%lu\n"), eh, id); + /* fire them */ + for (iter = tofire; iter != NULL; iter = g_slist_next(iter)) { + event_handle_t *eh = (event_handle_t *)iter->data; + if (eh->type == EV_WAIT && eh->data == id && !eh->is_dead) { + event_debug(1, _("A: event: wakeup triggering: %p id=%jd\n"), eh, id); fire(eh); nwaken++; } } + + /* and free the temporary list */ + g_slist_free(tofire); + return (nwaken); } /* - * The event loop. We need to be specially careful here with adds and - * deletes. Since adds and deletes will often happen while this is running, - * we need to make sure we don't end up referencing a dead event handle. + * The event loop. */ + +static void event_loop_wait (event_handle_t *, const int); + void event_loop( - const int dontblock) + int nonblock) { - event_loop_wait((event_handle_t *)NULL, dontblock); + event_loop_wait(NULL, nonblock); } - - -int +void event_wait( event_handle_t *eh) { - return event_loop_wait(eh, 0); + event_loop_wait(eh, 0); } -/* - * The event loop. We need to be specially careful here with adds and - * deletes. Since adds and deletes will often happen while this is running, - * we need to make sure we don't end up referencing a dead event handle. +/* Flush out any dead events in all_events. Be careful that this + * isn't called while someone is iterating over all_events. + * + * @param wait_eh: the event handle we're waiting on, which shouldn't + * be flushed. */ -static int -event_loop_wait( - event_handle_t *wait_eh, - const int dontblock) +static void +flush_dead_events(event_handle_t *wait_eh) { -#ifdef ASSERTIONS - static int entry = 0; -#endif - SELECT_ARG_TYPE readfds, writefds, errfds, werrfds; - struct timeval timeout, *tvptr; - int ntries, maxfd, rc; - long interval; - time_t curtime; - event_handle_t *eh, *nexteh; - struct sigtabent *se; - int event_wait_fired = 0; - int see_event; - - event_debug(1, _("event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n"), - dontblock, eventq.qlength, wait_eh); - - /* - * If we have no events, we have nothing to do - */ - if (eventq.qlength == 0) - return 0; - - /* - * We must not be entered twice - */ - assert(++entry == 1); - - ntries = 0; - - /* - * Save a copy of the current time once, to reduce syscall load - * slightly. - */ - curtime = time(NULL); - - do { - if (debug_event >= 1) { - event_debug(1, _("event: loop: dontblock=%d, qlength=%d eh=%p\n"), - dontblock, eventq.qlength, wait_eh); - for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) { - event_debug(1, _("%p): %s data=%lu fn=%p arg=%p\n"), - eh, event_type2str(eh->type), eh->data, eh->fn, - eh->arg); - } - } - /* - * Set ourselves up with no timeout initially. - */ - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - /* - * If we can block, initially set the tvptr to NULL. If - * we come across timeout events in the loop below, they - * will set it to an appropriate buffer. If we don't - * see any timeout events, then tvptr will remain NULL - * and the select will properly block indefinately. - * - * If we can't block, set it to point to the timeout buf above. - */ - if (dontblock) - tvptr = &timeout; - else - tvptr = NULL; - - /* - * Rebuild the select bitmasks each time. - */ - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&errfds); - maxfd = 0; - - see_event = (wait_eh == (event_handle_t *)NULL); - /* - * Run through each event handle and setup the events. - * We save our next pointer early in case we GC some dead - * events. - */ - for (eh = eventq_first(eventq); eh != NULL; eh = nexteh) { - nexteh = eventq_next(eh); - - switch (eh->type) { - - /* - * Read fds just get set into the select bitmask - */ - case EV_READFD: - FD_SET((int)eh->data, &readfds); - FD_SET((int)eh->data, &errfds); - maxfd = max(maxfd, (int)eh->data); - see_event |= (eh == wait_eh); - break; - - /* - * Likewise with write fds - */ - case EV_WRITEFD: - FD_SET((int)eh->data, &writefds); - FD_SET((int)eh->data, &errfds); - maxfd = max(maxfd, (int)eh->data); - see_event |= (eh == wait_eh); - break; - - /* - * Only set signals that aren't already set to avoid unnecessary - * syscall overhead. - */ - case EV_SIG: - se = &sigtable[eh->data]; - see_event |= (eh == wait_eh); - - if (se->handle == eh) - break; - - /* no previous handle */ - assert(se->handle == NULL); - se->handle = eh; - se->score = 0; - /*@ignore@*/ - se->oldhandler = signal((int)eh->data, signal_handler); - /*@end@*/ - break; - - /* - * Compute the timeout for this select - */ - case EV_TIME: - /* if we're not supposed to block, then leave it at 0 */ - if (dontblock) - break; - - if (eh->lastfired == -1) - eh->lastfired = curtime; - - interval = (long)(eh->data - (curtime - eh->lastfired)); - if (interval < 0) - interval = 0; - - if (tvptr != NULL) - timeout.tv_sec = min(timeout.tv_sec, interval); - else { - /* this is the first timeout */ - tvptr = &timeout; - timeout.tv_sec = interval; - } - see_event |= (eh == wait_eh); - break; - - /* - * Wait events are processed immediately by event_wakeup() - */ - case EV_WAIT: - see_event |= (eh == wait_eh); - break; - - /* - * Prune dead events - */ - case EV_DEAD: - eventq_remove(eh); - puthandle(eh); - break; - - default: - assert(0); - break; - } - } - - if(!see_event) { - assert(--entry == 0); - return 0; - } + GSList *iter, *next; - /* - * Let 'er rip - */ - event_debug(1, - _("event: select: dontblock=%d, maxfd=%d, timeout=%ld\n"), - dontblock, maxfd, - tvptr != NULL ? timeout.tv_sec : -1); - rc = select(maxfd + 1, &readfds, &writefds, &errfds, tvptr); - event_debug(1, _("event: select returns %d\n"), rc); - - /* - * Select errors can mean many things. Interrupted events should - * not be fatal, since they could be delivered signals which still - * need to have their events fired. - */ - if (rc < 0) { - if (errno != EINTR) { - if (++ntries > 5) { - error(_("select failed: %s"), strerror(errno)); - /*NOTREACHED*/ - } - continue; - } - /* proceed if errno == EINTR, we may have caught a signal */ + for (iter = all_events; iter != NULL; iter = next) { + event_handle_t *hdl = (event_handle_t *)iter->data; + next = g_slist_next(iter); - /* contents cannot be trusted */ - FD_ZERO(&readfds); - FD_ZERO(&writefds); - FD_ZERO(&errfds); - } + /* (handle the case when wait_eh is dead by simply not deleting + * it; the next run of event_loop will take care of it) */ + if (hdl->is_dead && hdl != wait_eh) { + all_events = g_slist_delete_link(all_events, iter); + if (hdl->source) g_source_destroy(hdl->source); - /* - * Grab the current time again for use in timed events. - */ - curtime = time(NULL); - - /* - * We need to copy the errfds into werrfds, so file descriptors - * that are being polled for both reading and writing have - * both of their poll events 'see' the error. - */ - memcpy(&werrfds, &errfds, SIZEOF(werrfds)); - - /* - * Now run through the events and fire the ones that are ready. - * Don't handle file descriptor events if the select failed. - */ - for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) { - - switch (eh->type) { - - /* - * Read fds: just fire the event if set in the bitmask - */ - case EV_READFD: - if (FD_ISSET((int)eh->data, &readfds) || - FD_ISSET((int)eh->data, &errfds)) { - FD_CLR((int)eh->data, &readfds); - FD_CLR((int)eh->data, &errfds); - fire(eh); - if(eh == wait_eh) event_wait_fired = 1; - } - break; - - /* - * Write fds: same as Read fds - */ - case EV_WRITEFD: - if (FD_ISSET((int)eh->data, &writefds) || - FD_ISSET((int)eh->data, &werrfds)) { - FD_CLR((int)eh->data, &writefds); - FD_CLR((int)eh->data, &werrfds); - fire(eh); - if(eh == wait_eh) event_wait_fired = 1; - } - break; - - /* - * Signal events: check the score for fires, and run the - * event if we got one. - */ - case EV_SIG: - se = &sigtable[eh->data]; - if (se->score > 0) { - assert(se->handle == eh); - se->score = 0; - fire(eh); - if(eh == wait_eh) event_wait_fired = 1; - } - break; - - /* - * Timed events: check the interval elapsed since last fired, - * and set it off if greater or equal to requested interval. - */ - case EV_TIME: - if (eh->lastfired == -1) - eh->lastfired = curtime; - if ((curtime - eh->lastfired) >= (time_t)eh->data) { - eh->lastfired = curtime; - fire(eh); - if(eh == wait_eh) event_wait_fired = 1; - } - break; - - /* - * Wait events are handled immediately by event_wakeup() - * Dead events are handled by the pre-select loop. - */ - case EV_WAIT: - case EV_DEAD: - break; - - default: - assert(0); - break; - } + amfree(hdl); } - } while (!dontblock && eventq.qlength > 0 && event_wait_fired == 0); - - assert(--entry == 0); - - return (event_wait_fired == 1); + } } -/* - * Generic signal handler. Used to count caught signals for the event - * loop. - */ -static void -signal_handler( - int signo) +/* Return TRUE if we have any events outstanding that can be dispatched + * by GMainLoop. Recall EV_WAIT events appear in all_events, but are + * not dispatched by GMainLoop. */ +static gboolean +any_mainloop_events(void) { + GSList *iter; + + for (iter = all_events; iter != NULL; iter = g_slist_next(iter)) { + event_handle_t *hdl = (event_handle_t *)iter->data; + if (hdl->type != EV_WAIT) + return TRUE; + } - assert((signo >= 0) && ((size_t)signo < (size_t)(sizeof(sigtable) / sizeof(sigtable[0])))); - sigtable[signo].score++; + return FALSE; } -/* - * Return a new handle. Take from the handle cache if not empty. Otherwise, - * alloc a new one. - */ -static event_handle_t * -gethandle(void) +static void +event_loop_wait( + event_handle_t *wait_eh, + int nonblock) { - event_handle_t *eh; + event_debug(1, _("event: loop: enter: nonblockg=%d, eh=%p\n"), nonblock, wait_eh); + + /* If we're waiting for a specific event, then reset its has_fired flag */ + if (wait_eh) { + wait_eh->has_fired = FALSE; + } - if ((eh = eventq_first(cache)) != NULL) { - assert(cache.qlength > 0); - eventq_remove(eh); - cache.qlength--; - return (eh); + /* Keep looping until there are no events, or until wait_eh has fired */ + while (1) { + /* clean up first, so we don't accidentally check a dead source */ + flush_dead_events(wait_eh); + + /* if there's nothing to wait for, then don't block, but run an + * iteration so that any other users of GMainLoop will get a chance + * to run. */ + if (!any_mainloop_events()) + break; + + /* Do an interation */ + g_main_context_iteration(NULL, !nonblock); + + /* If the event we've been waiting for has fired or been released, as + * appropriate, we're done. See the comments for event_wait in event.h + * for the skinny on this weird expression. */ + if (wait_eh && ((wait_eh->type == EV_WAIT && wait_eh->is_dead) + || (wait_eh->type != EV_WAIT && wait_eh->has_fired))) + break; + + /* Don't loop if we're not blocking */ + if (nonblock) + break; } - assert(cache.qlength == 0); - return (alloc(SIZEOF(*eh))); + + /* extra cleanup, to keep all_events short, and to delete wait_eh if it + * has been released. */ + flush_dead_events(NULL); + } -/* - * Free a handle. If there's space in the handle cache, put it there. - * Otherwise, free it. - */ -static void -puthandle( - event_handle_t *eh) +GMainLoop * +default_main_loop(void) { - - if (cache.qlength > CACHEDEPTH) { - amfree(eh); - return; - } - eventq_add(cache, eh); - cache.qlength++; + static GMainLoop *loop = NULL; + if (!loop) + loop = g_main_loop_new(NULL, TRUE); + return loop; } /* @@ -605,10 +383,8 @@ event_type2str( #define X(s) { s, stringize(s) } X(EV_READFD), X(EV_WRITEFD), - X(EV_SIG), X(EV_TIME), X(EV_WAIT), - X(EV_DEAD), #undef X }; size_t i; @@ -618,3 +394,192 @@ event_type2str( return (event_types[i].name); return (_("BOGUS EVENT TYPE")); } + +/* + * FDSource -- a source for a file descriptor + * + * We could use Glib's GIOChannel for this, but it adds some buffering + * and Unicode functionality that we really don't want. The custom GSource + * is simple enough anyway, and the Glib documentation describes it in prose. + */ + +typedef struct FDSource { + GSource source; /* must be the first element in the struct */ + GPollFD pollfd; /* Our file descriptor */ +} FDSource; + +static gboolean +fdsource_prepare( + GSource *source G_GNUC_UNUSED, + gint *timeout_) +{ + *timeout_ = -1; /* block forever, as far as we're concerned */ + return FALSE; +} + +static gboolean +fdsource_check( + GSource *source) +{ + FDSource *fds = (FDSource *)source; + + /* we need to be dispatched if any interesting events have been received by the FD */ + return fds->pollfd.events & fds->pollfd.revents; +} + +static gboolean +fdsource_dispatch( + GSource *source G_GNUC_UNUSED, + GSourceFunc callback, + gpointer user_data) +{ + if (callback) + return callback(user_data); + + /* Don't automatically detach the event source if there's no callback. */ + return TRUE; +} + +GSource * +new_fdsource(gint fd, GIOCondition events) +{ + static GSourceFuncs *fdsource_funcs = NULL; + GSource *src; + FDSource *fds; + + /* initialize these here to avoid a compiler warning */ + if (!fdsource_funcs) { + fdsource_funcs = g_new0(GSourceFuncs, 1); + fdsource_funcs->prepare = fdsource_prepare; + fdsource_funcs->check = fdsource_check; + fdsource_funcs->dispatch = fdsource_dispatch; + } + + src = g_source_new(fdsource_funcs, sizeof(FDSource)); + fds = (FDSource *)src; + + fds->pollfd.fd = fd; + fds->pollfd.events = events; + g_source_add_poll(src, &fds->pollfd); + + return src; +} + +/* + * ChildWatchSource -- a source for a file descriptor + * + * Newer versions of glib provide equivalent functionality; consider + * optionally using that, protected by a GLIB_CHECK_VERSION condition. + */ + +/* Versions before glib-2.4.0 didn't include a child watch source, and versions + * before 2.6.0 used unreliable signals. On these versions, we implement + * a "dumb" version of our own invention. This is dumb in the sense that it + * doesn't use SIGCHLD to detect a dead child, preferring to just poll at + * exponentially increasing interals. Writing a smarter implementation runs into + * some tricky race conditions and extra machinery. Since there are few, if any, + * users of a glib version this old, such machinery wouldn't get much testing. + */ +#if (GLIB_MAJOR_VERSION < 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 6)) +typedef struct ChildWatchSource { + GSource source; /* must be the first element in the struct */ + + pid_t pid; + + gint dead; + gint status; + + gint timeout; +} ChildWatchSource; + +/* this corresponds to rapid checks for about 10 seconds, after which the + * waitpid() check occurs every 2 seconds. */ +#define CWS_BASE_TIMEOUT 20 +#define CWS_MULT_TIMEOUT 1.1 +#define CWS_MAX_TIMEOUT 2000 + +static gboolean +child_watch_source_prepare( + GSource *source, + gint *timeout_) +{ + ChildWatchSource *cws = (ChildWatchSource *)source; + + *timeout_ = cws->timeout; + + cws->timeout *= CWS_MULT_TIMEOUT; + if (cws->timeout > CWS_MAX_TIMEOUT) cws->timeout = CWS_MAX_TIMEOUT; + + return FALSE; +} + +static gboolean +child_watch_source_check( + GSource *source) +{ + ChildWatchSource *cws = (ChildWatchSource *)source; + + /* is it dead? */ + if (!cws->dead && waitpid(cws->pid, &cws->status, WNOHANG) > 0) { + cws->dead = TRUE; + } + + return cws->dead; +} + +static gboolean +child_watch_source_dispatch( + GSource *source G_GNUC_UNUSED, + GSourceFunc callback, + gpointer user_data) +{ + ChildWatchSource *cws = (ChildWatchSource *)source; + + /* this shouldn't happen, but just in case */ + if (cws->dead) { + if (!callback) { + g_warning("child %jd died before callback was registered", (uintmax_t)cws->pid); + return FALSE; + } + + ((ChildWatchFunc)callback)(cws->pid, cws->status, user_data); + + /* Un-queue this source unconditionally -- the child can't die twice */ + return FALSE; + } + + return TRUE; +} + +GSource * +new_child_watch_source(pid_t pid) +{ + static GSourceFuncs *child_watch_source_funcs = NULL; + GSource *src; + ChildWatchSource *cws; + + /* initialize these here to avoid a compiler warning */ + if (!child_watch_source_funcs) { + child_watch_source_funcs = g_new0(GSourceFuncs, 1); + child_watch_source_funcs->prepare = child_watch_source_prepare; + child_watch_source_funcs->check = child_watch_source_check; + child_watch_source_funcs->dispatch = child_watch_source_dispatch; + } + + src = g_source_new(child_watch_source_funcs, sizeof(ChildWatchSource)); + cws = (ChildWatchSource *)src; + + cws->pid = pid; + cws->dead = FALSE; + cws->timeout = CWS_BASE_TIMEOUT; + + return src; +} +#else +/* In more recent versions of glib, we just use the built-in glib source */ +GSource * +new_child_watch_source(pid_t pid) +{ + return g_child_watch_source_new(pid); +} +#endif diff --git a/common-src/event.h b/common-src/event.h index 402d899..ed97ad9 100644 --- a/common-src/event.h +++ b/common-src/event.h @@ -43,13 +43,16 @@ struct event_handle; typedef struct event_handle event_handle_t; /* - * The 'id' of the event. The meaning of this is dependant on the type - * of event we are registering. This is hopefully wide enough that - * callers can cast pointers to it and keep the value untruncated and - * unique. - * FIXME: THIS IS NOT 64-BIT CLEAN! + * The 'id' of the event. The meaning of this depends on the type of + * event we are registering -- see event_register. The name 'id' is + * historical: it is quite possible to have many outstanding events with + * the same ID (same timeout or same file descriptor). + * + * Event id's are supplied by the caller, and in some cases are cast from + * pointers, so this value must be wide enough to hold a pointer without + * truncation. */ -typedef unsigned long event_id_t; +typedef intmax_t event_id_t; /* * The types of events we can register. @@ -57,10 +60,8 @@ typedef unsigned long event_id_t; typedef enum { EV_READFD, /* file descriptor is ready for reading */ EV_WRITEFD, /* file descriptor is ready for writing */ - EV_SIG, /* signal has fired */ EV_TIME, /* n seconds have elapsed */ EV_WAIT, /* event_wakeup() was called with this id */ - EV_DEAD /* internal use only */ } event_type_t; /* @@ -91,19 +92,56 @@ event_handle_t *event_register(event_id_t, event_type_t, event_fn_t, void *); void event_release(event_handle_t *); /* - * Wake up all EV_WAIT events waiting on a specific id + * Wake up all EV_WAIT events waiting on a specific id. This happens immediately, + * not in the next iteration of the event loop. If callbacks made during the wakeup + * register a new event with the same ID, that new event will *not* be awakened. */ int event_wakeup(event_id_t); /* - * Block until the event is terminated. + * Call event_loop, returning when one of the following conditions is + * true: + * evt is EV_WAIT, and it is released; or + * evt is EV_READFD, EV_WRITEFD, or EV_TIME, and it is fired. */ -int event_wait(event_handle_t *); +void event_wait(event_handle_t *evt); /* * Process events. If the argument is nonzero, then the loop does * not block. */ -void event_loop(const int); +void event_loop(int nonblock); + +/* + * Get the default GMainLoop object. Applications which use the Glib + * main loop directly should use this object for calls to e.g., + * g_main_loop_run(loop). + */ +GMainLoop *default_main_loop(void); + +/* + * Utility GSources + */ + +/* Create a GSource that will callback when the given file descriptor is in + * any of the given conditions. The callback is a simple GSourceFunc. + * + * @param fd: the file descriptr + * @param events: the conditions (GIOCondition flags) + * @return: GSource object + */ +GSource * new_fdsource(gint fd, GIOCondition events); + +/* Create a GSource that will callback when the given child dies. The callback + * should match ChildWatchFunc. Once the callback is made, it will not be called + * again by this source. + * + * Note: This is provided by glib in later versions, but not in version 2.2.0. + * This function and callback is modeled on g_child_watch_source_new. + * + * @param pid: the process ID @return: GSource object + */ +typedef void (*ChildWatchFunc)(pid_t pid, gint status, gpointer data); +GSource * new_child_watch_source(pid_t pid); #endif /* EVENT_H */ diff --git a/common-src/file.c b/common-src/file.c index 6f2a0ac..e8de92c 100644 --- a/common-src/file.c +++ b/common-src/file.c @@ -473,7 +473,7 @@ debug_agets( } if (ch == '\\') { - escape = 1; + escape = !escape; } else { if (ch == '"') { if (!escape) diff --git a/common-src/fileheader.c b/common-src/fileheader.c index ead4619..17cfca9 100644 --- a/common-src/fileheader.c +++ b/common-src/fileheader.c @@ -36,15 +36,17 @@ static const char * filetype2str(filetype_t); static filetype_t str2filetype(const char *); static void strange_header(dumpfile_t *, const char *, size_t, const char *, const char *); -static char * strquotedstr(void); static ssize_t hexdump(const char *buffer, size_t len); +static char *quote_heredoc(char *text, char *delimiter_prefix); +static char *parse_heredoc(char *line, char **saveptr); void fh_init( dumpfile_t *file) { memset(file, '\0', SIZEOF(*file)); - file->blocksize = DISK_BLOCK_BYTES; + file->type = F_EMPTY; + file->blocksize = 0; } static void @@ -69,6 +71,29 @@ strange_header( file->type = F_WEIRD; } +/* chop whitespace off of a string, in place */ +static void +chomp(char *str) +{ + char *s = str; + + if (!str) + return; + + /* trim leading space */ + while (g_ascii_isspace(*s)) { s++; } + if (s != str) + memmove(str, s, strlen(s)+1); + + /* trim trailing space */ + if (*str) { + for (s = str+strlen(str)-1; s >= str; s--) { + if (!g_ascii_isspace(*s)) + break; + *s = '\0'; + } + } +} void parse_file_header( @@ -80,6 +105,7 @@ parse_file_header( size_t lsize; char *uqname; int in_quotes; + char *saveptr = NULL; /* put the buffer into a writable chunk of memory and nul-term it */ buf = alloc(buflen + 1); @@ -87,6 +113,7 @@ parse_file_header( buf[buflen] = '\0'; fh_init(file); + /* extract the first unquoted line */ in_quotes = 0; for (line = buf, lsize = 0; lsize < buflen; line++) { if ((*line == '\n') && !in_quotes) @@ -106,7 +133,7 @@ parse_file_header( line1[lsize] = '\0'; *line = '\n'; - tok = strtok(line1, " "); + tok = strtok_r(line1, " ", &saveptr); if (tok == NULL) { g_fprintf(stderr, _("%s: Empty amanda header: buflen=%zu lsize=%zu\n"), get_pname(), buflen, @@ -123,7 +150,7 @@ parse_file_header( return; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -132,26 +159,26 @@ parse_file_header( switch (file->type) { case F_TAPESTART: - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if ((tok == NULL) || (strcmp(tok, "DATE") != 0)) { strange_header(file, buffer, buflen, "DATE", tok); goto out; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1); - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if ((tok == NULL) || (strcmp(tok, "TAPE") != 0)) { strange_header(file, buffer, buflen, "TAPE", tok); goto out; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -162,21 +189,21 @@ parse_file_header( case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->datestamp, tok, SIZEOF(file->datestamp) - 1); - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->name, tok, SIZEOF(file->name) - 1); - tok = strquotedstr(); + tok = strquotedstr(&saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -186,13 +213,13 @@ parse_file_header( amfree(uqname); if(file->type == F_SPLIT_DUMPFILE) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL || strcmp(tok, "part") != 0) { strange_header(file, buffer, buflen, "part", tok); goto out; } - tok = strtok(NULL, "/"); + tok = strtok_r(NULL, "/", &saveptr); if ((tok == NULL) || (sscanf(tok, "%d", &file->partnum) != 1)) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -201,32 +228,32 @@ parse_file_header( /* If totalparts == -1, then the original dump was done in streaming mode (no holding disk), thus we don't know how many parts there are. */ - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if((tok == NULL) || (sscanf(tok, "%d", &file->totalparts) != 1)) { strange_header(file, buffer, buflen, _(""), tok); goto out; } } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if ((tok == NULL) || (strcmp(tok, "lev") != 0)) { strange_header(file, buffer, buflen, "lev", tok); goto out; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if ((tok == NULL) || (sscanf(tok, "%d", &file->dumplevel) != 1)) { strange_header(file, buffer, buflen, _(""), tok); goto out; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if ((tok == NULL) || (strcmp(tok, "comp") != 0)) { strange_header(file, buffer, buflen, "comp", tok); goto out; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -238,7 +265,7 @@ parse_file_header( if (strcmp(file->comp_suffix, "C") == 0) strncpy(file->comp_suffix, ".Z", SIZEOF(file->comp_suffix) - 1); - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); /* "program" is optional */ if (tok == NULL || strcmp(tok, "program") != 0) { amfree(buf); @@ -246,7 +273,7 @@ parse_file_header( return; } - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -255,12 +282,12 @@ parse_file_header( if (file->program[0] == '\0') strncpy(file->program, "RESTORE", SIZEOF(file->program) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; /* reached the end of the buffer */ /* "encryption" is optional */ if (BSTRNCMP(tok, "crypt") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; @@ -268,65 +295,65 @@ parse_file_header( strncpy(file->encrypt_suffix, tok, SIZEOF(file->encrypt_suffix) - 1); file->encrypted = BSTRNCMP(file->encrypt_suffix, "N"); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "srvcompprog" is optional */ if (BSTRNCMP(tok, "server_custom_compress") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->srvcompprog, tok, SIZEOF(file->srvcompprog) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "clntcompprog" is optional */ if (BSTRNCMP(tok, "client_custom_compress") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->clntcompprog, tok, SIZEOF(file->clntcompprog) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "srv_encrypt" is optional */ if (BSTRNCMP(tok, "server_encrypt") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->srv_encrypt, tok, SIZEOF(file->srv_encrypt) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "clnt_encrypt" is optional */ if (BSTRNCMP(tok, "client_encrypt") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); goto out; } strncpy(file->clnt_encrypt, tok, SIZEOF(file->clnt_encrypt) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "srv_decrypt_opt" is optional */ if (BSTRNCMP(tok, "server_decrypt_option") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); @@ -334,13 +361,13 @@ parse_file_header( } strncpy(file->srv_decrypt_opt, tok, SIZEOF(file->srv_decrypt_opt) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } /* "clnt_decrypt_opt" is optional */ if (BSTRNCMP(tok, "client_decrypt_option") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if (tok == NULL) { strange_header(file, buffer, buflen, _(""), tok); @@ -348,18 +375,18 @@ parse_file_header( } strncpy(file->clnt_decrypt_opt, tok, SIZEOF(file->clnt_decrypt_opt) - 1); - if ((tok = strtok(NULL, " ")) == NULL) + if ((tok = strtok_r(NULL, " ", &saveptr)) == NULL) break; } break; case F_TAPEEND: - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); /* DATE is optional */ if (tok != NULL) { if (strcmp(tok, "DATE") == 0) { - tok = strtok(NULL, " "); + tok = strtok_r(NULL, " ", &saveptr); if(tok == NULL) file->datestamp[0] = '\0'; else @@ -378,9 +405,9 @@ parse_file_header( goto out; } - (void)strtok(buf, "\n"); /* this is the first line */ + (void)strtok_r(buf, "\n", &saveptr); /* this is the first line */ /* iterate through the rest of the lines */ - while ((line = strtok(NULL, "\n")) != NULL) { + while ((line = strtok_r(NULL, "\n", &saveptr)) != NULL) { #define SC "CONT_FILENAME=" if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) { line += SIZEOF(SC) - 1; @@ -397,21 +424,28 @@ parse_file_header( continue; } #undef SC -#define SC "DUMPER=" +#define SC "APPLICATION=" if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) { line += SIZEOF(SC) - 1; - strncpy(file->dumper, line, - SIZEOF(file->dumper) - 1); + strncpy(file->application, line, + SIZEOF(file->application) - 1); continue; } #undef SC +#define SC "DLE=" + if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) { + line += SIZEOF(SC) - 1; + file->dle_str = parse_heredoc(line, &saveptr); + } +#undef SC + #define SC _("To restore, position tape at start of file and run:") if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) continue; #undef SC -#define SC "\tdd if= bs=" +#define SC "\tdd if= " if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) { char *cmd1, *cmd2, *cmd3=NULL; @@ -431,6 +465,11 @@ parse_file_header( *cmd3++ = '\0'; } + /* clean up some extra spaces in various fields */ + chomp(cmd1); + chomp(cmd2); + chomp(cmd3); + /* three cmds: decrypt | uncompress | recover * two cmds: uncompress | recover * XXX note that if there are two cmds, the first one @@ -446,15 +485,15 @@ parse_file_header( SIZEOF(file->recover_cmd) - 1); } else { g_snprintf(file->uncompress_cmd, - SIZEOF(file->uncompress_cmd), "%s|", cmd1); + SIZEOF(file->uncompress_cmd), "%s |", cmd1); strncpy(file->recover_cmd, cmd2, SIZEOF(file->recover_cmd) - 1); } } else { /* cmd3 presents: decrypt | uncompress | recover */ g_snprintf(file->decrypt_cmd, - SIZEOF(file->decrypt_cmd), "%s|", cmd1); + SIZEOF(file->decrypt_cmd), "%s |", cmd1); g_snprintf(file->uncompress_cmd, - SIZEOF(file->uncompress_cmd), "%s|", cmd2); + SIZEOF(file->uncompress_cmd), "%s |", cmd2); strncpy(file->recover_cmd, cmd3, SIZEOF(file->recover_cmd) - 1); } @@ -485,7 +524,7 @@ dump_dumpfile_t( dbprintf(_(" name = '%s'\n"), file->name); dbprintf(_(" disk = '%s'\n"), file->disk); dbprintf(_(" program = '%s'\n"), file->program); - dbprintf(_(" dumper = '%s'\n"), file->dumper); + dbprintf(_(" application = '%s'\n"), file->application); dbprintf(_(" srvcompprog = '%s'\n"), file->srvcompprog); dbprintf(_(" clntcompprog = '%s'\n"), file->clntcompprog); dbprintf(_(" srv_encrypt = '%s'\n"), file->srv_encrypt); @@ -497,10 +536,15 @@ dump_dumpfile_t( dbprintf(_(" srv_decrypt_opt = '%s'\n"), file->srv_decrypt_opt); dbprintf(_(" clnt_decrypt_opt = '%s'\n"), file->clnt_decrypt_opt); dbprintf(_(" cont_filename = '%s'\n"), file->cont_filename); + if (file->dle_str) + dbprintf(_(" dle_str = %s\n"), file->dle_str); + else + dbprintf(_(" dle_str = (null)\n")); dbprintf(_(" is_partial = %d\n"), file->is_partial); dbprintf(_(" partnum = %d\n"), file->partnum); dbprintf(_(" totalparts = %d\n"), file->totalparts); - dbprintf(_(" blocksize = %zu\n"), file->blocksize); + if (file->blocksize) + dbprintf(_(" blocksize = %zu\n"), file->blocksize); } static void @@ -567,7 +611,7 @@ build_header(const dumpfile_t * file, size_t size) validate_name(file->name); validate_datestamp(file->datestamp); g_string_printf(rval, - "AMANDA: TAPESTART DATE %s TAPE %s\n014\n", + "AMANDA: TAPESTART DATE %s TAPE %s\n\014\n", file->datestamp, file->name); break; @@ -632,22 +676,34 @@ build_header(const dumpfile_t * file, size_t size) g_string_append_printf(rval, "CONT_FILENAME=%s\n", file->cont_filename); } - if (file->dumper[0] != '\0') { - g_string_append_printf(rval, "DUMPER=%s\n", file->dumper); + if (file->application[0] != '\0') { + g_string_append_printf(rval, "APPLICATION=%s\n", file->application); } if (file->is_partial != 0) { g_string_append_printf(rval, "PARTIAL=YES\n"); } + if (file->dle_str && strlen(file->dle_str) < size-2048) { + char *heredoc = quote_heredoc(file->dle_str, "ENDDLE"); + g_string_append_printf(rval, "DLE=%s\n", heredoc); + amfree(heredoc); + } g_string_append_printf(rval, _("To restore, position tape at start of file and run:\n")); + g_string_append_printf(rval, "\tdd if= "); + if (file->blocksize) + g_string_append_printf(rval, "bs=%zuk ", + file->blocksize / 1024); + g_string_append_printf(rval, "skip=1 | "); + if (*file->decrypt_cmd) + g_string_append_printf(rval, "%s ", file->decrypt_cmd); + if (*file->uncompress_cmd) + g_string_append_printf(rval, "%s ", file->uncompress_cmd); + if (*file->recover_cmd) + g_string_append_printf(rval, "%s ", file->recover_cmd); /* \014 == ^L == form feed */ - g_string_append_printf(rval, - "\tdd if= bs=%zuk skip=1 |%s %s %s\n\014\n", - file->blocksize / 1024, - file->decrypt_cmd, file->uncompress_cmd, - file->recover_cmd); + g_string_append_printf(rval, "\n\014\n"); break; case F_TAPEEND: @@ -827,37 +883,63 @@ gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b) { if (a == NULL || b == NULL) return FALSE; - return 0 == memcmp(a, b, sizeof(*a)); + if (a->type != b->type) return FALSE; + if (strcmp(a->datestamp, b->datestamp)) return FALSE; + if (a->dumplevel != b->dumplevel) return FALSE; + if (a->compressed != b->compressed) return FALSE; + if (a->encrypted != b->encrypted) return FALSE; + if (strcmp(a->comp_suffix, b->comp_suffix)) return FALSE; + if (strcmp(a->encrypt_suffix, b->encrypt_suffix)) return FALSE; + if (strcmp(a->name, b->name)) return FALSE; + if (strcmp(a->disk, b->disk)) return FALSE; + if (strcmp(a->program, b->program)) return FALSE; + if (strcmp(a->application, b->application)) return FALSE; + if (strcmp(a->srvcompprog, b->srvcompprog)) return FALSE; + if (strcmp(a->clntcompprog, b->clntcompprog)) return FALSE; + if (strcmp(a->srv_encrypt, b->srv_encrypt)) return FALSE; + if (strcmp(a->clnt_encrypt, b->clnt_encrypt)) return FALSE; + if (strcmp(a->recover_cmd, b->recover_cmd)) return FALSE; + if (strcmp(a->uncompress_cmd, b->uncompress_cmd)) return FALSE; + if (strcmp(a->encrypt_cmd, b->encrypt_cmd)) return FALSE; + if (strcmp(a->decrypt_cmd, b->decrypt_cmd)) return FALSE; + if (strcmp(a->srv_decrypt_opt, b->srv_decrypt_opt)) return FALSE; + if (strcmp(a->clnt_decrypt_opt, b->clnt_decrypt_opt)) return FALSE; + if (strcmp(a->cont_filename, b->cont_filename)) return FALSE; + if (a->dle_str != b->dle_str && a->dle_str && b->dle_str + && strcmp(a->dle_str, b->dle_str)) return FALSE; + if (a->is_partial != b->is_partial) return FALSE; + if (a->partnum != b->partnum) return FALSE; + if (a->totalparts != b->totalparts) return FALSE; + if (a->blocksize != b->blocksize) return FALSE; + + return TRUE; /* ok, they're the same */ } dumpfile_t * dumpfile_copy(dumpfile_t* source) { - gpointer rval = malloc(sizeof(dumpfile_t)); + dumpfile_t* rval = malloc(sizeof(dumpfile_t)); memcpy(rval, source, sizeof(dumpfile_t)); + if (rval->dle_str) rval->dle_str = stralloc(rval->dle_str); return rval; } -/* - * This function modify strtok context. - */ -static char * -strquotedstr(void) +void +dumpfile_copy_in_place( + dumpfile_t *dest, + dumpfile_t* source) { - char * tok = strtok(NULL, " "); - size_t len; - - len = strlen(tok); - if ((tok != NULL) && (tok[0] == '"') && - (len > 1 && (tok[len - 1] != '"') && (tok[len - 2] != '\\'))) { - char * t; - - do { - t = strtok(NULL, " "); - tok[len] = ' '; - len = strlen(tok); - } while ((t != NULL) && - (tok[len - 1] != '"') && (tok[len - 2] != '\\')); + memcpy(dest, source, sizeof(dumpfile_t)); + if (dest->dle_str) dest->dle_str = stralloc(dest->dle_str); +} + +void dumpfile_free_data(dumpfile_t* info) { + if (info) { + amfree(info->dle_str); } - return tok; +} + +void dumpfile_free(dumpfile_t* info) { + dumpfile_free_data(info); + amfree(info); } static ssize_t @@ -879,3 +961,66 @@ hexdump( return rc; } +static char *quote_heredoc( + char *text, + char *delimiter_prefix) +{ + char *delimiter = stralloc(delimiter_prefix); + int delimiter_n = 0; + int delimiter_len = strlen(delimiter); + char *quoted; + + /* keep picking delimiters until we find one that's not a line in TEXT */ + while (1) { + char *line = text; + char *c = text; + gboolean found_delimiter = FALSE; + + while (1) { + if (*c == '\n' || *c == '\0') { + int linelen = c - line; + if (linelen == delimiter_len && 0 == strncmp(line, delimiter, linelen)) { + found_delimiter = TRUE; + break; + } + line = c+1; + } + if (!*c) break; + c++; + } + + if (!found_delimiter) + break; + + delimiter = newvstrallocf(delimiter, "%s%d", delimiter_prefix, ++delimiter_n); + delimiter_len = strlen(delimiter); + } + + /* we have a delimiter .. now use it */ + quoted = vstrallocf("<<%s\n%s\n%s", delimiter, text, delimiter); + amfree(delimiter); + return quoted; +} + +static char *parse_heredoc( + char *line, + char **saveptr) +{ + char *result = NULL; + + if (strncmp(line, "<<", 2) == 0) { + char *keyword = line+2; + char *new_line; + + while((new_line = strtok_r(NULL, "\n", saveptr)) != NULL && + strcmp(new_line, keyword) != 0) { + result = vstrextend(&result, new_line, "\n", NULL); + } + /* remove latest '\n' */ + if (strlen(result) > 0) + result[strlen(result)-1] = '\0'; + } else { + result = stralloc(line); + } + return result; +} diff --git a/common-src/fileheader.h b/common-src/fileheader.h index f54fae5..e92eb8e 100644 --- a/common-src/fileheader.h +++ b/common-src/fileheader.h @@ -53,7 +53,7 @@ typedef struct file_s { string_t name; /* hostname or label */ string_t disk; string_t program; - string_t dumper; + string_t application; string_t srvcompprog; string_t clntcompprog; string_t srv_encrypt; @@ -65,6 +65,7 @@ typedef struct file_s { string_t srv_decrypt_opt; string_t clnt_decrypt_opt; string_t cont_filename; + char *dle_str; int is_partial; int partnum; int totalparts; /* -1 == UNKNOWN */ @@ -91,5 +92,12 @@ gboolean headers_are_equal(dumpfile_t * a, dumpfile_t * b); /* Returns an allocated duplicate header. */ dumpfile_t * dumpfile_copy(dumpfile_t* from); +void dumpfile_copy_in_place(dumpfile_t *dest, dumpfile_t* source); + +/* Frees associated storage */ +void dumpfile_free_data(dumpfile_t* info); + +/* Frees the header and associated storage */ +void dumpfile_free(dumpfile_t* info); #endif /* !FILEHEADER_H */ diff --git a/common-src/genversion.c b/common-src/genversion.c index 1b4f7f5..e4ae236 100644 --- a/common-src/genversion.c +++ b/common-src/genversion.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: genversion.c 698 2008-01-11 00:42:49Z martinea $ + * $Id: genversion.c 1168 2008-07-03 14:15:21Z djmitche $ * * dump the current Amanda version info */ @@ -362,20 +362,17 @@ main( prstr("HAVE_SYSVSHM"); #endif -#ifdef USE_POSIX_FCNTL - prstr("LOCKING=POSIX_FCNTL"); +#ifdef WANT_AMFLOCK_POSIX + prstr("AMFLOCK_POSIX"); #endif -#ifdef USE_FLOCK - prstr("LOCKING=FLOCK"); +#ifdef WANT_AMFLOCK_FLOCK + prstr("AMFLOCK_FLOCK"); #endif -#ifdef USE_LOCKF - prstr("LOCKING=LOCKF"); +#ifdef WANT_AMFLOCK_LOCKF + prstr("AMFLOCK_LOCKF"); #endif -#ifdef USE_LNLOCK - prstr("LOCKING=LNLOCK"); -#endif -#if !defined(USE_POSIX_FCNTL) && !defined(USE_FLOCK) && !defined(USE_LOCK) && !defined(USE_LNLOCK) - prstr("LOCKING=**NONE**"); +#ifdef WANT_AMFLOCK_LNLOCK + prstr("AMFLOCK_LNLOCK"); #endif #ifdef STATFS_BSD diff --git a/common-src/genversion.h b/common-src/genversion.h index 316c245..c140539 100644 --- a/common-src/genversion.h +++ b/common-src/genversion.h @@ -1,3 +1,3 @@ #define CC "gcc" -#define BUILT_DATE "Fri Aug 22 14:21:05 EDT 2008" +#define BUILT_DATE "Thu Jan 22 08:52:28 EST 2009" #define BUILT_MACH "x86_64-unknown-linux-gnu" diff --git a/common-src/glib-util.c b/common-src/glib-util.c index ec9728a..dd6b38e 100644 --- a/common-src/glib-util.c +++ b/common-src/glib-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* @@ -28,6 +28,51 @@ #include "glib-util.h" #include "conffile.h" /* For find_multiplier. */ +#ifdef HAVE_LIBCURL +#include +#endif + +void +glib_init(void) { + static gboolean did_glib_init = FALSE; + if (did_glib_init) return; + did_glib_init = TRUE; + + /* Initialize glib's type system */ + g_type_init(); + + /* set up libcurl (this must happen before threading + * is initialized) */ +#ifdef HAVE_LIBCURL +# ifdef G_THREADS_ENABLED + g_assert(!g_thread_supported()); +# endif + g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0); +#endif + + /* And set up glib's threads */ +#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) + if (g_thread_supported()) { + return; + } + g_thread_init(NULL); +#endif + + /* do a version check */ +#if GLIB_CHECK_VERSION(2,6,0) + { + const char *glib_err = glib_check_version(GLIB_MAJOR_VERSION, + GLIB_MINOR_VERSION, + GLIB_MICRO_VERSION); + if (glib_err) { + error(_("%s: Amanda was compiled with glib-%d.%d.%d"), glib_err, + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); + exit(1); /* glib_init may be called before error handling is set up */ + } + } +#endif +} + typedef enum { FLAG_STRING_NAME, FLAG_STRING_SHORT_NAME, @@ -402,6 +447,10 @@ char * g_english_strjoinv(char ** strv, const char * conjunction) { strv = g_strdupv(strv); length = g_strv_length(strv); + + if (length == 1) + return stralloc(strv[0]); + last = strv[length - 1]; strv[length - 1] = NULL; @@ -433,5 +482,43 @@ guint g_strv_length(gchar ** strv) { } return rval; } - #endif /* GLIB_CHECK_VERSION(2.6.0) */ + +#if !GLIB_CHECK_VERSION(2,4,0) +void +g_ptr_array_foreach (GPtrArray *array, + GFunc func, + gpointer user_data) +{ + guint i; + + g_return_if_fail (array); + + for (i = 0; i < array->len; i++) + (*func) (array->pdata[i], user_data); +} +#endif + +guint +g_str_case_hash( + gconstpointer key) +{ + /* modified version of glib's hash function, copyright + * GLib Team and others 1997-2000. */ + const char *p = key; + guint h = g_ascii_toupper(*p); + + if (h) + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + g_ascii_toupper(*p); + + return h; +} + +gboolean +g_str_case_equal( + gconstpointer v1, + gconstpointer v2) +{ + return (0 == g_ascii_strcasecmp((char *)v1, (char *)v2)); +} diff --git a/common-src/glib-util.h b/common-src/glib-util.h index 3151d2b..bc54c53 100644 --- a/common-src/glib-util.h +++ b/common-src/glib-util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* * Utilities that aren't quite included in glib @@ -29,6 +29,13 @@ #include #include +/* Call the requisite glib init functions, including calling + * g_init_types and setting up threading support. This function can + * be called multiple times with no harm, although it is not + * re-entrant. + */ +void glib_init(void); + /* like g_[s]list_foreach, but with a function taking only * one argument. */ @@ -107,5 +114,14 @@ char * g_english_strjoinv_and_free(char ** strv, const char * conjunction); guint g_strv_length(gchar ** strv); #endif +#if !GLIB_CHECK_VERSION(2,4,0) +void g_ptr_array_foreach (GPtrArray *array, + GFunc func, + gpointer user_data); #endif +/* functions for g_hash_table_new to hash and compare case-insensitive strings */ +guint g_str_case_hash(gconstpointer v); +gboolean g_str_case_equal(gconstpointer v1, gconstpointer v2); + +#endif diff --git a/common-src/krb4-security.c b/common-src/krb4-security.c index 77fa3bd..69bf2d3 100644 --- a/common-src/krb4-security.c +++ b/common-src/krb4-security.c @@ -60,6 +60,13 @@ #endif /* HAVE_ON_EXIT */ #endif /* ! HAVE_ATEXIT */ +/* + * This is the tcp stream buffer size + */ +#ifndef STREAM_BUFSIZE +#define STREAM_BUFSIZE (32768*2) +#endif + int krb_set_lifetime(int); int kuserok(AUTH_DAT *, char *); @@ -98,19 +105,12 @@ struct krb4_stream { in_port_t port; /* local port this is bound to */ int socket; /* fd for server-side accepts */ event_handle_t *ev_read; /* read event handle */ - char databuf[MAX_TAPE_BLOCK_BYTES]; /* read buffer */ + char databuf[STREAM_BUFSIZE]; /* read buffer */ int len; /* */ void (*fn)(void *, void *, ssize_t);/* read event fn */ void *arg; /* arg for previous */ }; -/* - * This is the tcp stream buffer size - */ -#ifndef STREAM_BUFSIZE -#define STREAM_BUFSIZE (MAX_TAPE_BLOCK_BYTES * 2) -#endif - /* * Interface functions */ diff --git a/common-src/krb5-security.c b/common-src/krb5-security.c index 6c6572b..dcf778e 100644 --- a/common-src/krb5-security.c +++ b/common-src/krb5-security.c @@ -116,15 +116,10 @@ */ #define GSS_TIMEOUT 30 -/* - * The largest buffer we can send/receive. - */ -#define AMANDA_MAX_TOK_SIZE (MAX_TAPE_BLOCK_BYTES * 4) - /* * This is the tcp stream buffer size */ -#define KRB5_STREAM_BUFSIZE (MAX_TAPE_BLOCK_BYTES * 2) +#define KRB5_STREAM_BUFSIZE (32768 * 2) /* * This is the max number of outgoing connections we can have at once. diff --git a/common-src/local-security.c b/common-src/local-security.c index 29a946d..7e2d1d8 100644 --- a/common-src/local-security.c +++ b/common-src/local-security.c @@ -178,6 +178,7 @@ local_connect( error: (*fn)(arg, &rh->sech, S_ERROR); + amfree(rh->hostname); } /* @@ -188,7 +189,7 @@ static int runlocal( struct tcp_conn * rc, const char * amandad_path, - const char * client_username) + const char * client_username G_GNUC_UNUSED) { int rpipe[2], wpipe[2]; char *xamandad_path = (char *)amandad_path; diff --git a/common-src/match.c b/common-src/match.c index f9ce31d..d8c83bc 100644 --- a/common-src/match.c +++ b/common-src/match.c @@ -99,6 +99,34 @@ match( return result == 0; } +int +match_no_newline( + const char * regex, + const char * str) +{ + regex_t regc; + int result; + char errmsg[STR_SIZE]; + + if((result = regcomp(®c, regex, + REG_EXTENDED|REG_NOSUB)) != 0) { + regerror(result, ®c, errmsg, SIZEOF(errmsg)); + error(_("regex \"%s\": %s"), regex, errmsg); + /*NOTREACHED*/ + } + + if((result = regexec(®c, str, 0, 0, 0)) != 0 + && result != REG_NOMATCH) { + regerror(result, ®c, errmsg, SIZEOF(errmsg)); + error(_("regex \"%s\": %s"), regex, errmsg); + /*NOTREACHED*/ + } + + regfree(®c); + + return result == 0; +} + char * validate_glob( const char * glob) @@ -530,6 +558,17 @@ match_disk( return match_word(glob, disk, '/'); } +static int +alldigits( + const char *str) +{ + while (*str) { + if (!isdigit((int)*(str++))) + return 0; + } + return 1; +} + int match_datestamp( const char * dateexp, @@ -543,45 +582,56 @@ match_datestamp( int match_exact; if(strlen(dateexp) >= 100 || strlen(dateexp) < 1) { - error(_("Illegal datestamp expression %s"),dateexp); - /*NOTREACHED*/ + goto illegal; } + /* strip and ignore an initial "^" */ if(dateexp[0] == '^') { - strncpy(mydateexp, dateexp+1, strlen(dateexp)-1); - mydateexp[strlen(dateexp)-1] = '\0'; + strncpy(mydateexp, dateexp+1, sizeof(mydateexp)-1); + mydateexp[sizeof(mydateexp)-1] = '\0'; } else { - strncpy(mydateexp, dateexp, strlen(dateexp)); - mydateexp[strlen(dateexp)] = '\0'; + strncpy(mydateexp, dateexp, sizeof(mydateexp)-1); + mydateexp[sizeof(mydateexp)-1] = '\0'; } - if(mydateexp[strlen(mydateexp)] == '$') { + if(mydateexp[strlen(mydateexp)-1] == '$') { match_exact = 1; - mydateexp[strlen(mydateexp)] = '\0'; + mydateexp[strlen(mydateexp)-1] = '\0'; /* strip the trailing $ */ } else match_exact = 0; + /* a single dash represents a date range */ if((dash = strchr(mydateexp,'-'))) { - if(match_exact == 1) { - error(_("Illegal datestamp expression %s"),dateexp); - /*NOTREACHED*/ + if(match_exact == 1 || strchr(dash+1, '-')) { + goto illegal; } - len = (size_t)(dash - mydateexp); - len_suffix = strlen(dash) - 1; - len_prefix = len - len_suffix; + + /* format: XXXYYYY-ZZZZ, indicating dates XXXYYYY to XXXZZZZ */ + + len = (size_t)(dash - mydateexp); /* length of XXXYYYY */ + len_suffix = strlen(dash) - 1; /* length of ZZZZ */ + if (len_suffix > len) goto illegal; + len_prefix = len - len_suffix; /* length of XXX */ dash++; + strncpy(firstdate, mydateexp, len); firstdate[len] = '\0'; strncpy(lastdate, mydateexp, len_prefix); strncpy(&(lastdate[len_prefix]), dash, len_suffix); lastdate[len] = '\0'; + if (!alldigits(firstdate) || !alldigits(lastdate)) + goto illegal; + if (strncmp(firstdate, lastdate, strlen(firstdate)) > 0) + goto illegal; return ((strncmp(datestamp, firstdate, strlen(firstdate)) >= 0) && (strncmp(datestamp, lastdate , strlen(lastdate)) <= 0)); } else { + if (!alldigits(mydateexp)) + goto illegal; if(match_exact == 1) { return (strcmp(datestamp, mydateexp) == 0); } @@ -589,6 +639,9 @@ match_datestamp( return (strncmp(datestamp, mydateexp, strlen(mydateexp)) == 0); } } +illegal: + error(_("Illegal datestamp expression %s"),dateexp); + /*NOTREACHED*/ } diff --git a/common-src/pipespawn.c b/common-src/pipespawn.c index 16fd67c..28f342b 100644 --- a/common-src/pipespawn.c +++ b/common-src/pipespawn.c @@ -6,7 +6,7 @@ char skip_argument[1]; -pid_t pipespawnv_passwd(char *prog, int pipedef, +pid_t pipespawnv_passwd(char *prog, int pipedef, int need_root, int *stdinfd, int *stdoutfd, int *stderrfd, char **my_argv); @@ -19,6 +19,7 @@ pid_t pipespawn( char * prog, int pipedef, + int need_root, int * stdinfd, int * stdoutfd, int * stderrfd, @@ -49,7 +50,8 @@ pipespawn( } arglist_end(ap); - pid = pipespawnv_passwd(prog, pipedef, stdinfd, stdoutfd, stderrfd, argv); + pid = pipespawnv_passwd(prog, pipedef, need_root, + stdinfd, stdoutfd, stderrfd, argv); amfree(argv); return pid; } @@ -58,12 +60,14 @@ pid_t pipespawnv( char * prog, int pipedef, + int need_root, int * stdinfd, int * stdoutfd, int * stderrfd, char ** my_argv) { - return pipespawnv_passwd(prog, pipedef, stdinfd, stdoutfd, stderrfd, + return pipespawnv_passwd(prog, pipedef, need_root, + stdinfd, stdoutfd, stderrfd, my_argv); } @@ -71,6 +75,7 @@ pid_t pipespawnv_passwd( char * prog, int pipedef, + int need_root, int * stdinfd, int * stdoutfd, int * stderrfd, @@ -96,6 +101,7 @@ pipespawnv_passwd( passwdvar = *my_argv++; passwdfd = (int *)*my_argv++; } + g_debug("pipespawnv: stdoutfd is %d", *stdoutfd); memset(inpipe, -1, SIZEOF(inpipe)); memset(outpipe, -1, SIZEOF(outpipe)); memset(errpipe, -1, SIZEOF(errpipe)); @@ -225,6 +231,8 @@ pipespawnv_passwd( safe_fd(-1, 0); } + if (need_root) + become_root(); execve(prog, my_argv, env); e = strerror(errno); error(_("error [exec %s: %s]"), prog, e); diff --git a/common-src/pipespawn.h b/common-src/pipespawn.h index 8b81f58..5813121 100644 --- a/common-src/pipespawn.h +++ b/common-src/pipespawn.h @@ -12,10 +12,10 @@ extern char skip_argument[1]; #define STDERR_PIPE (1 << 2) #define PASSWD_PIPE (1 << 3) -pid_t pipespawn(char *prog, int pipedef, +pid_t pipespawn(char *prog, int pipedef, int need_root, int *stdinfd, int *stdoutfd, int *stderrfd, ...); -pid_t pipespawnv(char *prog, int pipedef, +pid_t pipespawnv(char *prog, int pipedef, int need_root, int *stdinfd, int *stdoutfd, int *stderrfd, char **my_argv); diff --git a/common-src/protocol.c b/common-src/protocol.c index da58704..3cad500 100644 --- a/common-src/protocol.c +++ b/common-src/protocol.c @@ -159,7 +159,7 @@ protocol_sendreq( p->resettries = RESET_TRIES; p->reqtries = getconf_int(CNF_REQ_TRIES); p->conf_fn = conf_fn; - pkt_init(&p->req, P_REQ, req); + pkt_init(&p->req, P_REQ, "%s", req); /* * These are here for the caller diff --git a/common-src/queueing-test.c b/common-src/queueing-test.c new file mode 100644 index 0000000..7e78e81 --- /dev/null +++ b/common-src/queueing-test.c @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 465 N Mathlida Ave, Suite 300 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * + * Author: Dustin J. Mitchell + */ + +#include "amanda.h" +#include "testutils.h" +#include "glib-util.h" +#include "queueing.h" + +/**** + * Test a simple queue + */ + +struct test_queue_simple_data { + size_t bytes_to_produce; + + /* The counters here are used to produce a slowly changing + * bytesequence, which should not align with block or buffer + * boundaries. */ + size_t bytes_produced; + guint32 producer_counter; + + size_t bytes_consumed; + guint32 consumer_counter; +}; + +static producer_result_t +test_queue_simple_producer( + gpointer data, + queue_buffer_t *buffer, + size_t hint_size) +{ + struct test_queue_simple_data *d = (struct test_queue_simple_data *)data; + size_t to_write = hint_size; + size_t i; + + /* just for fun, write a little bit more sometimes */ + to_write += d->producer_counter % 50; + + /* but not too much */ + if (to_write > d->bytes_to_produce - d->bytes_produced) + to_write = d->bytes_to_produce - d->bytes_produced; + + /* make sure the buffer is big enough */ + if (buffer->data == NULL) { + buffer->data = g_malloc(to_write); + buffer->alloc_size = to_write; + } else if (buffer->alloc_size < to_write) { + buffer->data = g_realloc(buffer->data, to_write); + buffer->alloc_size = to_write; + } + /* g_debug("Producing %zd bytes in %p (@%p)", to_write, buffer, buffer->data); */ + + /* fill in the data with some random junk */ + for (i = 0; i < to_write; i++) { + buffer->data[i] = (char)(d->producer_counter / 7 + (d->producer_counter >> 10)); + d->producer_counter++; + } + + /* and call it a day */ + buffer->offset = 0; + buffer->data_size = to_write; + d->bytes_produced += to_write; + return d->bytes_produced >= d->bytes_to_produce? + PRODUCER_FINISHED + : PRODUCER_MORE; +} + +static ssize_t +test_queue_simple_consumer( + gpointer data, + queue_buffer_t *buffer) +{ + struct test_queue_simple_data *d = (struct test_queue_simple_data *)data; + size_t to_read = buffer->data_size; + size_t i; + + g_assert(buffer->data != NULL); + g_assert(buffer->data_size != 0); + + /* let's not read it all, to make sure that we get called back with the + * remainder */ + to_read = buffer->data_size; + if (to_read > 1000) to_read = 1000; + + /* verify the contents of the buffer */ + /* g_debug("Consuming %zd bytes starting at %d in %p (@%p)", to_read, buffer->offset, buffer, buffer->data); */ + for (i = 0; i < to_read; i++) { + char expected = d->consumer_counter / 7 + (d->consumer_counter >> 10); + if (buffer->data[buffer->offset + i] != expected) { + tu_dbg("expected %d, but got %d at byte position %zd\n", + (int)expected, buffer->data[i], i); + return -1; + } + d->consumer_counter++; + } + d->bytes_consumed += to_read; + + return to_read; +} + +static int +test_queue_simple(StreamingRequirement sr) +{ + queue_result_flags qr; + gboolean success = TRUE; + + struct test_queue_simple_data d = { + 10*1024*1024, /* bytes_to_produce */ + 0, /* bytes_produced */ + 0, /* producer_counter */ + 0, /* bytes_consumed */ + 0 /* consumer_counter */ + }; + + qr = do_consumer_producer_queue_full( + test_queue_simple_producer, (gpointer)&d, + test_queue_simple_consumer, (gpointer)&d, + 10230, /* almost 10k */ + 3*1024*1024, /* 3M */ + sr); + + if (qr != QUEUE_SUCCESS) { + tu_dbg("Expected result QUEUE_SUCCESS (%d); got %d\n", + QUEUE_SUCCESS, qr); + success = FALSE; + } + + if (d.bytes_produced != d.bytes_to_produce) { + tu_dbg("Expected to produce %zd bytes; produced %zd\n", + d.bytes_to_produce, d.bytes_produced); + success = FALSE; + } + + if (d.bytes_consumed != d.bytes_to_produce) { + tu_dbg("Expected to consume %zd bytes; consumed %zd\n", + d.bytes_to_produce, d.bytes_consumed); + success = FALSE; + } + + return success; +} + +static int +test_queue_simple_STREAMING_REQUIREMENT_NONE(void) +{ + return test_queue_simple(STREAMING_REQUIREMENT_NONE); +} + +static int +test_queue_simple_STREAMING_REQUIREMENT_DESIRED(void) +{ + return test_queue_simple(STREAMING_REQUIREMENT_DESIRED); +} + +static int +test_queue_simple_STREAMING_REQUIREMENT_REQUIRED(void) +{ + return test_queue_simple(STREAMING_REQUIREMENT_REQUIRED); +} + +/**** + * Test fd_reader and fd_writer + */ + +#define TEST_FD_CONSUMER_PRODUCER_BLOCKS (1024) + +static gpointer +data_producer_thread(gpointer d) +{ + int fd = GPOINTER_TO_INT(d); + char buf[1024]; + size_t i; + int block; + + /* fill in the buffer with some stuff */ + for (i = 0; i < (int)sizeof(buf); i++) { + buf[i] = (char)i; + } + + /* and write it out in blocks */ + for (block = 0; block < TEST_FD_CONSUMER_PRODUCER_BLOCKS; block++) { + size_t written = 0; + while (written < sizeof(buf)) { + int len = write(fd, buf + written, sizeof(buf) - written); + if (len < 0) { + perror("writing pipe to fd_read_producer"); + close(fd); + return GINT_TO_POINTER(0); + } + written += len; + } + } + + close(fd); + return GINT_TO_POINTER(1); +} + +static gpointer +data_consumer_thread(gpointer d) +{ + int fd = GPOINTER_TO_INT(d); + char buf[1024]; + size_t i; + int block; + + /* and read it in in blocks */ + for (block = 0; block < TEST_FD_CONSUMER_PRODUCER_BLOCKS; block++) { + size_t bytes_read = 0; + while (bytes_read < sizeof(buf)) { + int len = read(fd, buf + bytes_read, sizeof(buf) - bytes_read); + if (len < 0) { + perror("reading pipe from fd_write_consumer"); + return NULL; + } + bytes_read += len; + } + + /* verify the block */ + for (i = 0; i < (int)sizeof(buf); i++) { + if (buf[i] != (char)i) { + tu_dbg("result data does not match input; block %d byte %zd", block, i); + close(fd); + return GINT_TO_POINTER(0); + } + } + } + + close(fd); + return GINT_TO_POINTER(1); +} + +static int +test_fd_consumer_producer(void) +{ + gboolean success; + GThread *rth, *wth; + int input_pipe[2]; + int output_pipe[2]; + queue_fd_t queue_read = {0, NULL}; + queue_fd_t queue_write = {0, NULL}; + + /* create pipes and hook up threads to them */ + if (pipe(input_pipe) < 0) { + perror("pipe(input_pipe)"); + return FALSE; + } + if (pipe(output_pipe) < 0) { + perror("pipe(output_pipe)"); + return FALSE; + } + + wth = g_thread_create(data_producer_thread, GINT_TO_POINTER(input_pipe[1]), TRUE, NULL); + rth = g_thread_create(data_consumer_thread, GINT_TO_POINTER(output_pipe[0]), TRUE, NULL); + + /* run the queue */ + queue_read.fd = input_pipe[0]; + queue_write.fd = output_pipe[1]; + success = do_consumer_producer_queue( + fd_read_producer, &queue_read, + fd_write_consumer, &queue_write); + if (!success) + tu_dbg("do_consumer_producer_queue returned FALSE"); + + /* and examine the results */ + success = GPOINTER_TO_INT(g_thread_join(wth)) && success; + success = GPOINTER_TO_INT(g_thread_join(rth)) && success; + + /* close stuff up */ + close(input_pipe[0]); + close(input_pipe[1]); + close(output_pipe[0]); + close(output_pipe[1]); + + return success; +} + +/* + * Main driver + */ + +int +main(int argc, char **argv) +{ + static TestUtilsTest tests[] = { + TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_NONE, 15), + TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_DESIRED, 15), + TU_TEST(test_queue_simple_STREAMING_REQUIREMENT_REQUIRED, 15), + TU_TEST(test_fd_consumer_producer, 60), /* runs slowly on old kernels */ + TU_END() + }; + + glib_init(); + + return testutils_run_tests(argc, argv, tests); +} diff --git a/common-src/queueing.c b/common-src/queueing.c new file mode 100644 index 0000000..672d844 --- /dev/null +++ b/common-src/queueing.c @@ -0,0 +1,524 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "queueing.h" +#include "semaphore.h" +#include "amanda.h" + +/* Queueing framework here. */ +typedef struct { + size_t block_size; + StreamingRequirement streaming_mode; + + ProducerFunctor producer; + gpointer producer_user_data; + + ConsumerFunctor consumer; + gpointer consumer_user_data; + + GAsyncQueue *data_queue, *free_queue; + semaphore_t *free_memory; +} queue_data_t; + +static queue_buffer_t *invent_buffer(void) { + queue_buffer_t *rval; + rval = g_new(queue_buffer_t, 1); + + rval->data = NULL; + rval->alloc_size = 0; + rval->data_size = 0; + rval->offset = 0; + + return rval; +} + +void free_buffer(queue_buffer_t *buf) { + if (buf != NULL) + amfree(buf->data); + amfree(buf); +} + +static queue_buffer_t * merge_buffers(queue_buffer_t *buf1, + queue_buffer_t *buf2) { + if (buf1 == NULL) + return buf2; + else if (buf2 == NULL) + return buf1; + + if (buf2->offset >= buf1->data_size) { + /* We can fit buf1 at the beginning of buf2. */ + memcpy(buf2->data + buf2->offset - buf1->data_size, + buf1->data + buf1->offset, + buf1->data_size); + buf2->offset -= buf1->data_size; + buf2->data_size += buf1->data_size; + free_buffer(buf1); + return buf2; + } else if (buf1->alloc_size - buf1->offset - buf1->data_size + >= buf2->data_size) { + /* We can fit buf2 at the end of buf1. */ + memcpy(buf1->data + buf1->offset + buf1->data_size, + buf2->data + buf2->offset, buf2->data_size); + buf1->data_size += buf2->data_size; + free_buffer(buf2); + return buf1; + } else { + /* We can grow buf1 and put everything there. */ + if (buf1->offset != 0) { + /* But first we have to fix up buf1. */ + memmove(buf1->data, buf1->data + buf1->offset, buf1->data_size); + buf1->offset = 0; + } + buf1->alloc_size = buf1->data_size + buf2->data_size; + buf1->data = realloc(buf1->data, buf1->alloc_size); + memcpy(buf1->data + buf1->data_size, buf2->data + buf2->offset, + buf2->data_size); + buf1->data_size = buf1->alloc_size; + free_buffer(buf2); + return buf1; + } +} + +/* Invalidate the first "bytes" bytes of the buffer, by adjusting the + offset and data size. */ +static void consume_buffer(queue_buffer_t* buf, ssize_t bytes) { + g_assert(bytes >= 0 && bytes <= (ssize_t)buf->data_size); + buf->offset += bytes; + buf->data_size -= bytes; +} + +/* Looks at the buffer to see how much free space it has. If it has more than + * twice the data size of unused space at the end, or more than four times + * the data size of unused space at the beginning, then that space is + * reclaimed. */ +static void heatshrink_buffer(queue_buffer_t *buf) { + if (buf == NULL) + return; + + if (G_UNLIKELY(buf->offset > buf->data_size * 4)) { + /* Consolodate with memmove. We will reclaim the space in the next + * step. */ + memmove(buf->data, buf->data + buf->offset, buf->data_size); + buf->offset = 0; + } + + if (buf->alloc_size > buf->data_size*2 + buf->offset) { + buf->alloc_size = buf->data_size + buf->offset; + buf->data = realloc(buf->data, buf->alloc_size); + } +} + +static gpointer do_producer_thread(gpointer datap) { + queue_data_t* data = datap; + + for (;;) { + queue_buffer_t *buf; + gboolean result; + + semaphore_decrement(data->free_memory, 0); + buf = g_async_queue_try_pop(data->free_queue); + if (buf != NULL && buf->data == NULL) { + /* Consumer is finished, then so are we. */ + amfree(buf); + return GINT_TO_POINTER(TRUE); + } + + if (buf == NULL) { + buf = invent_buffer(); + } + buf->offset = 0; + buf->data_size = 0; + + result = data->producer(data->producer_user_data, buf, + data->block_size); + + // Producers can allocate way too much memory. + heatshrink_buffer(buf); + + if (buf->data_size > 0) { + semaphore_force_adjust(data->free_memory, -buf->alloc_size); + + g_async_queue_push(data->data_queue, buf); + buf = NULL; + } else { + g_assert(result != PRODUCER_MORE); + free_buffer(buf); + buf = NULL; + } + + + if (result == PRODUCER_MORE) { + continue; + } else { + /* We are finished (and the first to do so). */ + g_async_queue_push(data->data_queue, invent_buffer()); + semaphore_force_set(data->free_memory, INT_MIN); + + return GINT_TO_POINTER(result == PRODUCER_FINISHED); + } + } +} + +static gpointer do_consumer_thread(gpointer datap) { + queue_data_t* data = datap; + gboolean got_eof = FALSE; + queue_buffer_t *buf = NULL; + + if (data->streaming_mode != STREAMING_REQUIREMENT_NONE) { + semaphore_wait_empty(data->free_memory); + } + + for (;;) { + gboolean result; + + /* Pull in and merge buffers until we have at least data->block_size + * bytes, or there are no more buffers */ + while (!got_eof && (buf == NULL || buf->data_size < data->block_size)) { + queue_buffer_t *next_buf; + if (data->streaming_mode == STREAMING_REQUIREMENT_DESIRED) { + do { + next_buf = g_async_queue_try_pop(data->data_queue); + if (next_buf == NULL) { + semaphore_wait_empty(data->free_memory); + } + } while (next_buf == NULL); + } else { + next_buf = g_async_queue_pop(data->data_queue); + g_assert(next_buf != NULL); + } + + if (next_buf->data == NULL) { + /* A buffer with NULL data is an EOF from the producer */ + free_buffer(next_buf); + got_eof = TRUE; + break; + } + + semaphore_increment(data->free_memory, next_buf->alloc_size); + + buf = merge_buffers(buf, next_buf); + } + + /* If we're out of data, then we are done. */ + if (buf == NULL) + break; + + result = data->consumer(data->consumer_user_data, buf); + + if (result > 0) { + consume_buffer(buf, result); + if (buf->data_size == 0) { + g_async_queue_push(data->free_queue, buf); + buf = NULL; + } + continue; + } else { + free_buffer(buf); + return GINT_TO_POINTER(FALSE); + } + } + + /* We are so outta here. */ + return GINT_TO_POINTER(TRUE); +} + +/* Empties a buffer queue and frees all the buffers associated with it. + * + * If full_cleanup is TRUE, then we delete the queue itself. + * If full_cleanup is FALSE, then we leave the queue around, with a + * signal element in it. */ +static void cleanup_buffer_queue(GAsyncQueue *Q, gboolean full_cleanup) { + g_async_queue_lock(Q); + for (;;) { + queue_buffer_t *buftmp; + buftmp = g_async_queue_try_pop_unlocked(Q); + if (buftmp == NULL) + break; + + free_buffer(buftmp); + } + if (!full_cleanup) + g_async_queue_push_unlocked(Q, invent_buffer()); + + g_async_queue_unlock(Q); + + if (full_cleanup) + g_async_queue_unref(Q); +} + +/* This function sacrifices performance, but will still work just + fine, on systems where threads are not supported. */ +static queue_result_flags +do_unthreaded_consumer_producer_queue(size_t block_size, + ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data) { + queue_buffer_t *buf = NULL, *next_buf = NULL; + gboolean finished = FALSE; + queue_result_flags rval = 0; + + /* The basic theory of operation here is to read until we have + enough data to write, then write until we don't.. */ + while (!finished) { + producer_result_t result; + + while ((buf == NULL || buf->data_size < block_size) && !finished) { + if (next_buf == NULL) + next_buf = invent_buffer(); + + result = producer(producer_user_data, next_buf, block_size); + + if (result != PRODUCER_MORE) { + finished = TRUE; + if (result != PRODUCER_FINISHED) { + rval |= QUEUE_PRODUCER_ERROR; + } + } + + buf = merge_buffers(buf, next_buf); + next_buf = NULL; + } + + while (buf != NULL && buf->data_size > 0 && + (buf->data_size >= block_size || finished)) { + result = consumer(consumer_user_data, buf); + + if (result > 0) { + consume_buffer(buf, result); + if (buf->data_size == 0) { + next_buf = buf; + buf = NULL; + } + } else { + finished = TRUE; + rval |= QUEUE_CONSUMER_ERROR; + break; + } + } + } + + free_buffer(buf); + free_buffer(next_buf); + return rval; +} + +gboolean do_consumer_producer_queue(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data) { + return QUEUE_SUCCESS == + do_consumer_producer_queue_full(producer, producer_user_data, + consumer, consumer_user_data, + 0, DEFAULT_MAX_BUFFER_MEMORY, + STREAMING_REQUIREMENT_NONE); +} + +queue_result_flags +do_consumer_producer_queue_full(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data, + size_t block_size, + size_t max_memory, + StreamingRequirement streaming_mode) { + GThread * producer_thread; + GThread * consumer_thread; + queue_data_t queue_data; + gpointer producer_result; + gpointer consumer_result; + queue_result_flags rval; + + if (block_size <= 0) { + block_size = DISK_BLOCK_BYTES; + } + + g_return_val_if_fail(producer != NULL, FALSE); + g_return_val_if_fail(consumer != NULL, FALSE); + + if (!g_thread_supported()) { + return do_unthreaded_consumer_producer_queue(block_size, producer, + producer_user_data, + consumer, + consumer_user_data); + } + + queue_data.block_size = block_size; + queue_data.producer = producer; + queue_data.producer_user_data = producer_user_data; + queue_data.consumer = consumer; + queue_data.consumer_user_data = consumer_user_data; + queue_data.streaming_mode = streaming_mode; + + queue_data.data_queue = g_async_queue_new(); + queue_data.free_queue = g_async_queue_new(); + + max_memory = MAX(1,MIN(max_memory, INT_MAX / 2)); + queue_data.free_memory = semaphore_new_with_value(max_memory); + + producer_thread = g_thread_create(do_producer_thread, &queue_data, + TRUE, + NULL /* FIXME: Should handle + errors. */); + consumer_thread = g_thread_create(do_consumer_thread, &queue_data, + TRUE, + NULL /* FIXME: Should handle + errors. */); + + /* The order of cleanup here is very important, to avoid deadlock. */ + /* 1) Reap the consumer. */ + consumer_result = g_thread_join(consumer_thread); + /* 2) Stop the producer. */ + semaphore_force_set(queue_data.free_memory, -1); + /* 3) Cleanup the free queue; add a signal flag. */ + cleanup_buffer_queue(queue_data.free_queue, FALSE); + /* 4) Restart the producer (so it can exit). */ + semaphore_force_set(queue_data.free_memory, INT_MAX); + /* 5) Reap the producer. */ + producer_result = g_thread_join(producer_thread); + + cleanup_buffer_queue(queue_data.free_queue, TRUE); + cleanup_buffer_queue(queue_data.data_queue, TRUE); + + semaphore_free(queue_data.free_memory); + + rval = 0; + if (!GPOINTER_TO_INT(producer_result)) { + rval |= QUEUE_PRODUCER_ERROR; + } + if (!GPOINTER_TO_INT(consumer_result)) { + rval |= QUEUE_CONSUMER_ERROR; + } + return rval; +} + +/* Commonly-useful producers and consumers below. */ + +queue_fd_t * +queue_fd_new( + int fd, + char *errmsg) +{ + queue_fd_t *queue_fd; + + queue_fd = malloc(sizeof(queue_fd_t)); + queue_fd->fd = fd; + queue_fd->errmsg = errmsg; + + return queue_fd; +} + +int +queue_fd_fd( + queue_fd_t *queue_fd) +{ + return queue_fd->fd; +} + +char *queue_fd_errmsg( + queue_fd_t *queue_fd) +{ + return queue_fd->errmsg; +} + +producer_result_t fd_read_producer(gpointer f_queue_fd, queue_buffer_t *buffer, + size_t hint_size) { + int fd; + queue_fd_t *queue_fd = (queue_fd_t *)f_queue_fd; + fd = queue_fd->fd; + g_assert(fd >= 0); + g_assert(buffer->data_size == 0); + + buffer->offset = 0; + + if (buffer->data == NULL) { + /* Set up the buffer. */ + buffer->data = malloc(hint_size); + buffer->alloc_size = hint_size; + } + + for (;;) { + ssize_t result; + result = read(fd, buffer->data, buffer->alloc_size); + + if (result > 0) { + buffer->data_size = result; + return PRODUCER_MORE; + } else if (result == 0) { + /* End of file. */ + return PRODUCER_FINISHED; + } else if (0 +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif +#ifdef EINTR + || errno == EINTR +#endif + ) { + /* Try again. */ + continue; + } else { + /* Error occured. */ + queue_fd->errmsg = newvstrallocf(queue_fd->errmsg, + "Error reading fd %d: %s\n", fd, strerror(errno)); + return PRODUCER_ERROR; + } + } +} + +ssize_t fd_write_consumer(gpointer f_queue_fd, queue_buffer_t *buffer) { + int fd; + queue_fd_t *queue_fd = (queue_fd_t *)f_queue_fd; + fd = queue_fd->fd; + + g_assert(fd >= 0); + + g_return_val_if_fail(buffer->data_size > 0, 0); + + for (;;) { + ssize_t write_size; + write_size = write(fd, buffer->data + buffer->offset, + buffer->data_size); + + if (write_size > 0) { + return write_size; + } else if (0 +#ifdef EAGAIN + || errno == EAGAIN +#endif +#ifdef EWOULDBLOCK + || errno == EWOULDBLOCK +#endif +#ifdef EINTR + || errno == EINTR +#endif + ) { + /* Try again. */ + continue; + } else { + /* Error occured. */ + g_fprintf(stderr, "Error writing fd %d: %s\n", fd, strerror(errno)); + return -1; + } + } +} diff --git a/common-src/queueing.h b/common-src/queueing.h new file mode 100644 index 0000000..248c11b --- /dev/null +++ b/common-src/queueing.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#ifndef QUEUEING_H +#define QUEUEING_H + +/* This file contains the code for fast threaded reading and writing to/from + * media, for devices that don't require any special handling. Some + * devices (e.g., CD-ROM) may use a different method for bulk reads or + * writes. */ + +#include "amanda.h" +#include + +#define DEFAULT_MAX_BUFFER_MEMORY (1*1024*1024) + +typedef enum { + STREAMING_REQUIREMENT_NONE, + STREAMING_REQUIREMENT_DESIRED, + STREAMING_REQUIREMENT_REQUIRED +} StreamingRequirement; + +/* Valid data in this structure starts at data + offset, and has size + * data_size. Allocation starts at data and has size alloc_size. */ +typedef struct { + char *data; + size_t alloc_size; + size_t data_size; + size_t offset; +} queue_buffer_t; + +void free_buffer(queue_buffer_t*); + +typedef enum { + PRODUCER_MORE, /* Means the producer should be run again. */ + PRODUCER_FINISHED, /* Means that no error occured, but the + producer should not be run again. */ + PRODUCER_ERROR /* Means an error occured, and the producer + should not be run again. */ +} producer_result_t; + +typedef enum { + QUEUE_SUCCESS = 0, + QUEUE_PRODUCER_ERROR = 1 << 0, + QUEUE_CONSUMER_ERROR = 1 << 1, + QUEUE_INTERNAL_ERROR = 1 << 2 +} queue_result_flags; + +/* The producer takes the given buffer (which is not itself NULL, but may contain + * a NULL data segment), and fills it with data. The producer can allocate or + * reallocate the buffer's 'data' element as necessary; the queueing system will + * free it when necessary. The result of the production operation is specified in + * the return value, but if the buffer is left without data, then that is + * interpreted as PRODUCER_ERROR. For optimal performance, the producer should + * supply exactly hint_size bytes of data in each call, but this is not required. + * + * The consumer is given a buffer (which will not be NULL, nor contain a NULL data + * segment), and is expected to process some or all of the data in that buffer. If + * there is a problem consuming data (such that no further data can be consumed), + * the consumer may return -1. Otherwise, the consumer should return the number of + * bytes actually consumed. If an error occurs, it should return -1, regardless + * of the number of bytes consumed. The queueing framework will ensure that all + * blocks have at least hint_size bytes, except the last. For optimal + * performance, the consumer should consume the entire buffer at each call, but + * this is not required. + * + * Note that the handling of the queue_buffer_t is different between the two + * functions: The producer should update queue_buffer_t as necessary to corespond + * to read data, while the consumer should leave the queue_buffer_t unadjusted: + * The queueing framework will invalidate data in the buffer according to the + * return value of the consumer.*/ + +typedef producer_result_t (* ProducerFunctor)(gpointer user_data, + queue_buffer_t* buffer, + size_t hint_size); +typedef ssize_t (* ConsumerFunctor)(gpointer user_data, + queue_buffer_t* buffer); + + +/* These functions make the magic happen. The first one assumes + reasonable defaults, the second one provides more options. + % producer : A function that provides data to write. + % producer_user_data : A pointer to pass to that function. + % consumer : A function that writes data out. + % consumer_user_data : A pointer to pass to that function. + % block_size : Size of chunks to write out to consumer. If + nonpositive, data will be written in + variable-sized chunks. + % max_memory : Amount of memory to be used for buffering. + (default is DEFAULT_MAX_BUFFER_MEMORY). + % streaming_mode : Describes streaming mode. + STREAMING_REQUIREMENT_NONE: Data will be written as fast + as possible. No prebuffering + will be done. + STREAMING_REQUIREMENT_DESIRED: max_memory bytes of data will + be prebuffered, and if the + buffer ever empties, no data + will be written until it + fills again. + STREAMING_REQUIREMENT_REQUIRED: max_memory bytes of data will + be prebuffered, and + thereafter data will be + written as fast as possible. +*/ +gboolean +do_consumer_producer_queue(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data); +queue_result_flags +do_consumer_producer_queue_full(ProducerFunctor producer, + gpointer producer_user_data, + ConsumerFunctor consumer, + gpointer consumer_user_data, + size_t block_size, + size_t max_memory, + StreamingRequirement streaming_mode); + +/* Some commonly-useful producers and consumers.*/ + +/* These functions will call read() or write() respectively. The user + data should be a pointer to an queue_fd_t, with fd set to the device + descriptor and errmsg set to NULL. */ + +typedef struct { + int fd; + char *errmsg; +} queue_fd_t; + +queue_fd_t *queue_fd_new(int fd, char *errmsg); +int queue_fd_fd(queue_fd_t *queue_fd); +char *queue_fd_errmsg(queue_fd_t *queue_fd); + +producer_result_t fd_read_producer(gpointer queue_fd, queue_buffer_t *buffer, + size_t hint_size); +ssize_t fd_write_consumer(gpointer queue_fd, queue_buffer_t *buffer); + + + +#endif /* QUEUEING_H */ diff --git a/common-src/quoting-test.c b/common-src/quoting-test.c new file mode 100644 index 0000000..1654b05 --- /dev/null +++ b/common-src/quoting-test.c @@ -0,0 +1,492 @@ +/* + * Copyright (c) 2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 465 N Mathlida Ave, Suite 300 + * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * + * Author: Dustin J. Mitchell + */ + +#include "amanda.h" +#include "testutils.h" +#include "util.h" + +/* Utilities */ + +static char * +safestr(const char *str) { + static char hex[] = "0123456789abcdef"; + const char *p; + char *result = malloc(3 + strlen(str) * 3); + char *r = result; + + *(r++) = '|'; + for (p = str; *p; p++) { + if (isprint((int)*p)) { + *(r++) = *p; + } else { + *(r++) = '#'; + *(r++) = hex[((*p)&0xf0) >> 4]; + *(r++) = hex[(*p)&0xf]; + } + } + *(r++) = '|'; + *(r++) = '\0'; + + return result; +} + +char * quotable_strings[] = { + "", + "simple", + "sp a ces", + "\"foo bar\"", + "back\\slash", + "escaped\\ space", + "escaped\\\"quote", + "balanced \"internal\" quotes", + "\"already quoted\" string", + "string that's \"already quoted\"", + "internal\"quote", + "bs-end\\", + "backslash\\nletter", + "backslash\\tletter", + "\t", "\r", "\n", "\f", "\004", + "new\nline", + "newline-end\n", + "ta\tb", + "tab-end\t", + "\\\\\\\\", + "\"", + NULL +}; + +/**** + * Round-trip testing of quoting functions + */ + +static int +test_round_trip(void) +{ + char **strp; + gboolean success = TRUE; + + for (strp = quotable_strings; *strp; strp++) { + char *quoted, *unquoted; + + quoted = quote_string(*strp); + unquoted = unquote_string(quoted); + + /* if they're not the same, complain */ + if (0 != strcmp(*strp, unquoted)) { + char *safe_orig = safestr(*strp); + char *safe_quoted = safestr(quoted); + char *safe_unquoted = safestr(unquoted); + + printf(" bad round-trip: %s -quote_string-> %s -unquote_string-> %s\n", + safe_orig, safe_quoted, safe_unquoted); + + amfree(safe_orig); + amfree(safe_quoted); + amfree(safe_unquoted); + + success = FALSE; + } + + amfree(quoted); + amfree(unquoted); + } + + return success; +} + +/*** + * Test that the new split_quoted_strings acts identically to + * the old split(), albeit with a different set of arguments and + * return value. Note that we only test with a delimiter of " ", + * as split() is not used with any other delimiter. + */ + +static gboolean +compare_strv( + const char **exp, + char **got, + const char *source, + const char *original) +{ + const char **a = exp; + char **b = got; + while (*a && *b) { + if (0 != strcmp(*a, *b)) + break; + a++; b++; + } + + /* did we exit the loop early, or were they different lengths? */ + if (*a || *b) { + char *safe; + + safe = safestr(original); + g_printf(" %s: expected [", safe); + amfree(safe); + for (a = exp; *a; a++) { + safe = safestr(*a); + g_printf("%s%s", safe, *(a+1)? ", " : ""); + amfree(safe); + } + g_printf("] but got ["); + for (b = got; *b; b++) { + safe = safestr(*b); + g_printf("%s%s", safe, *(b+1)? ", " : ""); + amfree(safe); + } + g_printf("] using %s.\n", source); + + return FALSE; + } + + return TRUE; +} + +static int +test_split_quoted_strings(void) +{ + char **iter1, **iter2, **iter3; + gboolean success = TRUE; + char *middle_strings[] = { + "", + "foo", + "\"foo\"", + "sp aces", + NULL, + }; + + /* the idea here is to loop over all triples of strings, forming a + * string by quoting them with quote_string and inserting a space, then + * re-splitting with split_quoted_string. This should get us back to our + * starting point. */ + + for (iter1 = quotable_strings; *iter1; iter1++) { + for (iter2 = middle_strings; *iter2; iter2++) { + for (iter3 = quotable_strings; *iter3; iter3++) { + char *q1 = quote_string(*iter1); + char *q2 = quote_string(*iter2); + char *q3 = quote_string(*iter3); + const char *expected[4] = { *iter1, *iter2, *iter3, NULL }; + char *combined = vstralloc(q1, " ", q2, " ", q3, NULL); + char **tokens; + + tokens = split_quoted_strings(combined); + + success = compare_strv(expected, tokens, "split_quoted_strings", combined) + && success; + + amfree(q1); + amfree(q2); + amfree(q3); + amfree(combined); + g_strfreev(tokens); + } + } + } + + return success; +} + +/**** + * Test splitting some edge cases and invalid strings + */ + +struct trial { + const char *combined; + const char *expected[5]; +}; + +static int +test_split_quoted_strings_edge(void) +{ + gboolean success = TRUE; + struct trial trials[] = { + { "", { "", NULL, } }, + { " ", { "", "", NULL } }, + { " x", { "", "x", NULL } }, + { "x ", { "x", "", NULL } }, + { "x\\ y", { "x y", NULL } }, + { "\\", { "", NULL } }, /* inv */ + { "z\\", { "z", NULL } }, /* inv */ + { "z\"", { "z", NULL } }, /* inv */ + { "\" \" \"", { " ", "", NULL } }, /* inv */ + { NULL, { NULL, } }, + }; + struct trial *trial = trials; + + while (trial->combined) { + char **tokens = split_quoted_strings(trial->combined); + + success = compare_strv(trial->expected, tokens, + "split_quoted_strings", trial->combined) + && success; + + g_strfreev(tokens); + trial++; + } + + return success; +} + +/**** + * Test unquoting of some pathological strings + */ +static int +test_unquote_string(void) +{ + gboolean success = TRUE; + char *tests[] = { + "simple", "simple", + "\"quoted\"", "quoted", + "s p a c e", "s p a c e", + + /* special escape characters */ + "esc \\\" quote", "esc \" quote", + "esc \\t tab", "esc \t tab", + "esc \\\\ esc", "esc \\ esc", + "esc \\02 oct", "esc \02 oct", + "esc \\7 oct", "esc \7 oct", + "esc \\17 oct", "esc \17 oct", + "esc \\117 oct", "esc \117 oct", + "esc \\1117 oct", "esc \1117 oct", /* '7' is distinct char */ + + /* same, but pre-quoted */ + "\"esc \\\" quote\"", "esc \" quote", + "\"esc \\t tab\"", "esc \t tab", + "\"esc \\\\ esc\"", "esc \\ esc", + "\"esc \\02 oct\"", "esc \02 oct", + "\"esc \\7 oct\"", "esc \7 oct", + "\"esc \\17 oct\"", "esc \17 oct", + "\"esc \\117 oct\"", "esc \117 oct", + "\"esc \\1117 oct\"", "esc \1117 oct", /* '7' is distinct char */ + + /* strips balanced quotes, even inside the string */ + ">>\"x\"<<", ">>x<<", + ">>\"x\"-\"y\"<<", ">>x-y<<", + + /* pathological, but valid */ + "\\\\", "\\", + "\"\\\"\"", "\"", + "\"\\\\\"", "\\", + "--\\\"", "--\"", + "\\\"--", "\"--", + + /* invalid strings (handling here is arbitrary, but these tests + * will alert us if the handling changes) */ + "\\", "", /* trailing backslash is ignored */ + "xx\\", "xx", /* ditto */ + "\\\\\\\\\\\\\\", "\\\\\\", /* ditto */ + "\\777", "\377", /* 0777 & 0xff = 0xff */ + "\"--", "--", /* leading quote is dropped */ + "--\"", "--", /* trailing quote is dropped */ + + NULL, NULL, + }; + char **strp; + + for (strp = tests; *strp;) { + char *quoted = *(strp++); + char *expected = *(strp++); + char *unquoted = unquote_string(quoted); + + /* if they're not the same, complain */ + if (0 != strcmp(expected, unquoted)) { + char *safe_quoted = safestr(quoted); + char *safe_unquoted = safestr(unquoted); + char *safe_expected = safestr(expected); + + printf(" %s unquoted to %s; expected %s.\n", + safe_quoted, safe_unquoted, safe_expected); + + amfree(safe_quoted); + amfree(safe_unquoted); + amfree(safe_expected); + + success = FALSE; + } + + amfree(unquoted); + } + + return success; +} + +/**** + * Test the strquotedstr function + */ +static int +test_strquotedstr_skipping(void) +{ + char **iter1, **iter2; + gboolean success = TRUE; + + /* the idea here is to loop over all pairs of strings, forming a + * string by quoting them with quote_string and inserting a space, then + * re-splitting with strquotedstr. This should get us back to our + * starting point. Note that we have to begin with a non-quoted identifier, + * becuse strquotedstr requires that strtok_r has already been called. */ + + for (iter1 = quotable_strings; *iter1; iter1++) { + for (iter2 = quotable_strings; *iter2; iter2++) { + char *q1 = quote_string(*iter1); + char *q2 = quote_string(*iter2); + char *combined = vstralloc("START ", q1, " ", q2, NULL); + char *copy = g_strdup(combined); + char *saveptr = NULL; + char *tok; + int i; + + tok = strtok_r(copy, " ", &saveptr); + + for (i = 1; i <= 2; i++) { + char *expected = (i == 1)? q1:q2; + tok = strquotedstr(&saveptr); + if (!tok) { + g_fprintf(stderr, "while parsing '%s', call %d to strquotedstr returned NULL\n", + combined, i); + success = FALSE; + goto next; + } + if (0 != strcmp(tok, expected)) { + char *safe = safestr(tok); + + g_fprintf(stderr, "while parsing '%s', call %d to strquotedstr returned '%s' " + "but '%s' was expected.\n", + combined, i, safe, expected); + success = FALSE; + goto next; + } + } + + if (strquotedstr(&saveptr) != NULL) { + g_fprintf(stderr, "while parsing '%s', call 3 to strquotedstr did not return NULL\n", + combined); + success = FALSE; + goto next; + } +next: + amfree(q1); + amfree(q2); + amfree(copy); + amfree(combined); + } + } + + return success; +} + +static int +test_strquotedstr_edge_invalid(void) +{ + gboolean success = TRUE; + char *invalid[] = { + "X \"abc", /* unterminated */ + "X \"ab cd", /* unterminated second token */ + "X a\"b cd", /* unterminated second token with internal quote */ + "X b\\", /* trailing backslash */ + "X \"b\\", /* trailing backslash in quote */ + "X \"b\\\"", /* backslash'd ending quote */ + NULL + }; + char **iter; + + /* run strquotedstr on a bunch of invalid tokens. It should return NULL */ + + for (iter = invalid; *iter; iter++) { + char *copy = g_strdup(*iter); + char *tok; + char *saveptr = NULL; + + tok = strtok_r(copy, " ", &saveptr); + tok = strquotedstr(&saveptr); + if (tok != NULL) { + g_fprintf(stderr, "while parsing invalid '%s', strquotedstr did not return NULL\n", + *iter); + success = FALSE; + } + + amfree(copy); + } + + return success; +} + +static int +test_strquotedstr_edge_valid(void) +{ + gboolean success = TRUE; + char *valid[] = { + /* input */ /* expected (omitting "X") */ + "X abc\\ def", "abc\\ def", /* backslashed space */ + "X \"abc\\ def\"", "\"abc\\ def\"", /* quoted, backslashed space */ + "X a\" \"b", "a\" \"b", /* quoted spaces */ + NULL, NULL + }; + char **iter; + + /* run strquotedstr on a bunch of valid, but tricky, tokens. It should return NULL */ + + for (iter = valid; *iter; iter += 2) { + char *copy = g_strdup(*iter); + char *expected = *(iter+1); + char *tok; + char *saveptr = NULL; + + tok = strtok_r(copy, " ", &saveptr); + tok = strquotedstr(&saveptr); + if (tok == NULL) { + g_fprintf(stderr, "while parsing valid '%s', strquotedstr returned NULL\n", + *iter); + success = FALSE; + } else if (0 != strcmp(tok, expected)) { + g_fprintf(stderr, "while parsing valid '%s', strquotedstr returned '%s' while " + "'%s' was expected\n", + *iter, tok, expected); + success = FALSE; + } + + amfree(copy); + } + + return success; +} + +/* + * Main driver + */ + +int +main(int argc, char **argv) +{ + static TestUtilsTest tests[] = { + TU_TEST(test_round_trip, 5), + TU_TEST(test_unquote_string, 5), + TU_TEST(test_split_quoted_strings, 5), + TU_TEST(test_split_quoted_strings_edge, 5), + TU_TEST(test_strquotedstr_skipping, 5), + TU_TEST(test_strquotedstr_edge_invalid, 5), + TU_TEST(test_strquotedstr_edge_valid, 5), + TU_END() + }; + + return testutils_run_tests(argc, argv, tests); +} diff --git a/common-src/rsh-security.c b/common-src/rsh-security.c index 26914c6..4d14f3b 100644 --- a/common-src/rsh-security.c +++ b/common-src/rsh-security.c @@ -117,6 +117,7 @@ rsh_connect( void * arg, void * datap) { + int result; struct sec_handle *rh; char *amandad_path=NULL, *client_username=NULL; @@ -132,10 +133,12 @@ rsh_connect( rh->ev_timeout = NULL; rh->rc = NULL; + /* get the canonical hostname */ rh->hostname = NULL; - if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) { + if ((result = resolve_hostname(hostname, 0, NULL, &rh->hostname)) || rh->hostname == NULL) { security_seterror(&rh->sech, - _("%s: could not resolve hostname"), hostname); + _("rsh_security could not find canonical name for '%s': %s"), + hostname, gai_strerror(result)); (*fn)(arg, &rh->sech, S_ERROR); return; } diff --git a/common-src/security-util.c b/common-src/security-util.c index 77e5d0c..ee2f99c 100644 --- a/common-src/security-util.c +++ b/common-src/security-util.c @@ -229,7 +229,8 @@ stream_sendpkt( pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body); if (security_stream_write(&rh->rs->secstr, buf, len) < 0) { - security_seterror(&rh->sech, security_stream_geterror(&rh->rs->secstr)); + security_seterror(&rh->sech, "%s", security_stream_geterror(&rh->rs->secstr)); + amfree(buf); return (-1); } amfree(buf); @@ -330,7 +331,7 @@ tcpm_stream_write( if (tcpm_send_token(rs->rc, rs->rc->write, rs->handle, &rs->rc->errmsg, buf, size)) { - security_stream_seterror(&rs->secstr, rs->rc->errmsg); + security_stream_seterror(&rs->secstr, "%s", rs->rc->errmsg); return (-1); } return (0); @@ -354,7 +355,7 @@ tcpm_stream_read( * Only one read request can be active per stream. */ if (rs->ev_read == NULL) { - rs->ev_read = event_register((event_id_t)rs->rc, EV_WAIT, + rs->ev_read = event_register((event_id_t)rs->rc->event_id, EV_WAIT, stream_read_callback, rs); sec_tcp_conn_read(rs->rc); } @@ -380,7 +381,7 @@ tcpm_stream_read_sync( if (rs->ev_read != NULL) { return -1; } - rs->ev_read = event_register((event_id_t)rs->rc, EV_WAIT, + rs->ev_read = event_register((event_id_t)rs->rc->event_id, EV_WAIT, stream_read_sync_callback, rs); sec_tcp_conn_read(rs->rc); event_wait(rs->ev_read); @@ -466,7 +467,7 @@ tcpm_send_token( nb_iov = 3; } - rval = net_writev(fd, iov, nb_iov); + rval = full_writev(fd, iov, nb_iov); if (len != 0 && rc->driver->data_encrypt != NULL && buf != encbuf) { amfree(encbuf); } @@ -607,7 +608,7 @@ tcpm_close_connection( (void)hostname; - if (rh && rh->rc && rh->rc->toclose == 0) { + if (rh && rh->rc && rh->rc->read >= 0 && rh->rc->toclose == 0) { rh->rc->toclose = 1; sec_tcp_conn_put(rh->rc); } @@ -862,7 +863,7 @@ tcp_stream_write( assert(rs != NULL); - if (fullwrite(rs->fd, buf, size) < 0) { + if (full_write(rs->fd, buf, size) < size) { security_stream_seterror(&rs->secstr, _("write error on stream %d: %s"), rs->port, strerror(errno)); return (-1); @@ -886,7 +887,7 @@ bsd_prefix_packet( security_seterror(&rh->sech, _("can't get login name for my uid %ld"), (long)getuid()); - return(NULL); + return ""; } buf = alloc(16+strlen(pwd->pw_name)); strncpy(buf, "SECURITY USER ", (16 + strlen(pwd->pw_name))); @@ -1016,6 +1017,7 @@ bsd_recv_security_ok( if ((tok = strtok(NULL, "")) == NULL) { security_seterror(&rh->sech, _("SECURITY line: %s"), security_line); + amfree(service); amfree(security_line); return (-1); /* default errmsg */ } @@ -1063,7 +1065,7 @@ udpbsd_sendpkt( * Initialize this datagram, and add the header */ dgram_zero(&rh->udp->dgram); - dgram_cat(&rh->udp->dgram, pkthdr2str(rh, pkt)); + dgram_cat(&rh->udp->dgram, "%s", pkthdr2str(rh, pkt)); /* * Add the security info. This depends on which kind of packet we're @@ -1089,7 +1091,7 @@ udpbsd_sendpkt( /* * Add the body, and send it */ - dgram_cat(&rh->udp->dgram, pkt->body); + dgram_cat(&rh->udp->dgram, "%s", pkt->body); auth_debug(1, _("sec: udpbsd_sendpkt: %s (%d) pkt_t (len %zu) contains:\n\n\"%s\"\n\n"), @@ -1470,6 +1472,7 @@ sec_tcp_conn_get( rc->auth = 0; rc->conf_fn = NULL; rc->datap = NULL; + rc->event_id = newevent++; connq_append(rc); return (rc); } @@ -1505,10 +1508,13 @@ sec_tcp_conn_put( amfree(rc->errmsg); connq_remove(rc); amfree(rc->pkt); - if(!rc->donotclose) - amfree(rc); /* someone might still use it */ - /* eg. in sec_tcp_conn_read_callback if */ - /* event_wakeup call us. */ + if(!rc->donotclose) { + /* amfree(rc) */ + /* a memory leak occurs, but freeing it lead to memory + * corruption because it can still be used. + * We need to find a good place to free 'rc'. + */ + } } /* @@ -1583,7 +1589,7 @@ recvpkt_callback( (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR); return; case -1: - security_seterror(&rh->sech, security_stream_geterror(&rh->rs->secstr)); + security_seterror(&rh->sech, "%s", security_stream_geterror(&rh->rs->secstr)); (*rh->fn.recvpkt)(rh->arg, NULL, S_ERROR); return; default: @@ -1637,7 +1643,7 @@ stream_read_sync_callback( if (rs->rc->pktlen <= 0) { auth_debug(1, _("sec: stream_read_sync_callback: %s\n"), rs->rc->errmsg); - security_stream_seterror(&rs->secstr, rs->rc->errmsg); + security_stream_seterror(&rs->secstr, "%s", rs->rc->errmsg); if(rs->closed_by_me == 0 && rs->closed_by_network == 0) sec_tcp_conn_put(rs->rc); rs->closed_by_network = 1; @@ -1683,7 +1689,7 @@ stream_read_callback( if (rs->rc->pktlen <= 0) { auth_debug(1, _("sec: stream_read_callback: %s\n"), rs->rc->errmsg); - security_stream_seterror(&rs->secstr, rs->rc->errmsg); + security_stream_seterror(&rs->secstr, "%s", rs->rc->errmsg); if(rs->closed_by_me == 0 && rs->closed_by_network == 0) sec_tcp_conn_put(rs->rc); rs->closed_by_network = 1; @@ -1723,7 +1729,7 @@ sec_tcp_conn_read_callback( if (rval < 0 || rc->handle == H_EOF) { rc->pktlen = rval; rc->handle = H_EOF; - revent = event_wakeup((event_id_t)rc); + revent = event_wakeup((event_id_t)rc->event_id); auth_debug(1, _("sec: conn_read_callback: event_wakeup return %d\n"), revent); /* delete our 'accept' reference */ @@ -1741,7 +1747,7 @@ sec_tcp_conn_read_callback( if(rval == 0) { rc->pktlen = 0; - revent = event_wakeup((event_id_t)rc); + revent = event_wakeup((event_id_t)rc->event_id); auth_debug(1, _("sec: conn_read_callback: event_wakeup return %d\n"), revent); return; @@ -1749,8 +1755,8 @@ sec_tcp_conn_read_callback( /* If there are events waiting on this handle, we're done */ rc->donotclose = 1; - revent = event_wakeup((event_id_t)rc); - auth_debug(1, _("sec: conn_read_callback: event_wakeup return %zd\n"), rval); + revent = event_wakeup((event_id_t)rc->event_id); + auth_debug(1, _("sec: conn_read_callback: event_wakeup return %d\n"), revent); rc->donotclose = 0; if (rc->handle == H_TAKEN || rc->pktlen == 0) { if(rc->refcnt == 0) amfree(rc); @@ -1760,8 +1766,12 @@ sec_tcp_conn_read_callback( assert(rc->refcnt > 0); /* If there is no accept fn registered, then drop the packet */ - if (rc->accept_fn == NULL) + if (rc->accept_fn == NULL) { + g_warning( + _("sec: conn_read_callback: %zd bytes for handle %d went unclaimed!"), + rc->pktlen, rc->handle); return; + } rh = alloc(SIZEOF(*rh)); security_handleinit(&rh->sech, rc->driver); @@ -2237,7 +2247,7 @@ check_user_amandahosts( if (! found) { if (strcmp(service, "amindexd") == 0 || strcmp(service, "amidxtaped") == 0) { - result = vstrallocf(_("Please add the line \"%s %s amindexd amidxtaped\" to %s on the client"), host, remoteuser, ptmp); + result = vstrallocf(_("Please add the line \"%s %s amindexd amidxtaped\" to %s on the server"), host, remoteuser, ptmp); } else if (strcmp(service, "amdump") == 0 || strcmp(service, "noop") == 0 || strcmp(service, "selfcheck") == 0 || @@ -2365,57 +2375,6 @@ check_security( return *errstr == NULL; } -/* - * Writes out the entire iovec - */ -ssize_t -net_writev( - int fd, - struct iovec * iov, - int iovcnt) -{ - ssize_t delta, n, total; - - assert(iov != NULL); - - total = 0; - while (iovcnt > 0) { - /* - * Write the iovec - */ - n = writev(fd, iov, iovcnt); - if (n < 0) { - if (errno != EINTR) - return (-1); - auth_debug(1, _("net_writev got EINTR\n")); - } - else if (n == 0) { - errno = EIO; - return (-1); - } else { - total += n; - /* - * Iterate through each iov. Figure out what we still need - * to write out. - */ - for (; n > 0; iovcnt--, iov++) { - /* 'delta' is the bytes written from this iovec */ - delta = ((size_t)n < (size_t)iov->iov_len) ? n : (ssize_t)iov->iov_len; - /* subtract from the total num bytes written */ - n -= delta; - assert(n >= 0); - /* subtract from this iovec */ - iov->iov_len -= delta; - iov->iov_base = (char *)iov->iov_base + delta; - /* if this iovec isn't empty, run the writev again */ - if (iov->iov_len > 0) - break; - } - } - } - return (total); -} - /* * Like read(), but waits until the entire buffer has been filled. */ diff --git a/common-src/security-util.h b/common-src/security-util.h index 22accfc..93b234f 100644 --- a/common-src/security-util.h +++ b/common-src/security-util.h @@ -75,6 +75,7 @@ struct tcp_conn { char * errmsg; /* error passed up */ int refcnt; /* number of handles using */ int handle; /* last proto handle read */ + int event_id; /* event ID fired when token read */ void (*accept_fn)(security_handle_t *, pkt_t *); sockaddr_union peer; TAILQ_ENTRY(tcp_conn) tq; /* queue handle */ @@ -275,7 +276,6 @@ char * check_user_amandahosts(const char *host, const char *user, const char *service); -ssize_t net_writev(int, struct iovec *, int); ssize_t net_read(int, void *, size_t, int); ssize_t net_read_fillbuf(int, int, void *, size_t); void show_stat_info(char *a, char *b); diff --git a/common-src/semaphore-test.c b/common-src/semaphore-test.c new file mode 100644 index 0000000..d6ec04b --- /dev/null +++ b/common-src/semaphore-test.c @@ -0,0 +1,245 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "semaphore.h" +#include "testutils.h" +#include "amanda.h" +#include "util.h" + +/* + * test that decrement waits properly + */ + +struct test_decr_wait_data { + semaphore_t *sem; + gboolean increment_called; +}; + +static gpointer +test_decr_wait_thread(gpointer datap) +{ + struct test_decr_wait_data *data = datap; + + /* should block */ + semaphore_decrement(data->sem, 20); + + /* if increment hasn't been called yet, that's an error. */ + if (!data->increment_called) + return GINT_TO_POINTER(0); + + return GINT_TO_POINTER(1); +} + +static gboolean +test_decr_wait(void) +{ + GThread *th; + struct test_decr_wait_data data = { NULL, FALSE }; + int rv; + + data.sem = semaphore_new_with_value(10), + + th = g_thread_create(test_decr_wait_thread, (gpointer)&data, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and then increment the semaphore enough that the decrement can succeed */ + data.increment_called = TRUE; + semaphore_increment(data.sem, 10); + + /* join the thread and see how it fared. */ + rv = GPOINTER_TO_INT(g_thread_join(th)); + + semaphore_free(data.sem); + + return (rv == 1); +} + + +/* + * test that semaphore_wait_empty waits properly + */ + +static gpointer +test_wait_empty_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* should block */ + semaphore_decrement(sem, 20); + + /* value should be 10 now (decremented from 30) */ + if (sem->value != 10) + return GINT_TO_POINTER(1); + + /* sleep for a bit */ + g_usleep(G_USEC_PER_SEC / 4); + + /* decrement those last 10, which should trigger the zero */ + semaphore_decrement(sem, 10); + + return GINT_TO_POINTER(0); +} + +static gboolean +test_wait_empty(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + int rv; + + th = g_thread_create(test_wait_empty_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* add another 10, so decrement can hit zero next time it's called */ + semaphore_increment(sem, 10); + + /* and wait on the semaphore emptying */ + semaphore_wait_empty(sem); + + /* join the thread and see how it fared. */ + rv = GPOINTER_TO_INT(g_thread_join(th)); + + semaphore_free(sem); + + return (rv == 1); +} + +/* + * test that semaphore_force_adjust correctly wakes both + * semaphore_decrement and semaphore_wait_empty. + */ + +static gpointer +test_force_adjust_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* this should block */ + semaphore_decrement(sem, 20); + + /* and this should block, too - it's fun */ + semaphore_wait_empty(sem); + + return NULL; +} + +static gboolean +test_force_adjust(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + + th = g_thread_create(test_force_adjust_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* add another 20, so decrement can proceed, but leave the value at 10 */ + semaphore_force_adjust(sem, 20); + + /* sleep to give semaphore_wait_empty() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and empty out the semaphore */ + semaphore_force_adjust(sem, -10); + + g_thread_join(th); + + semaphore_free(sem); + + /* it we didn't hang yet, it's all good */ + return TRUE; +} + +/* + * test that semaphore_force_set correctly wakes both + * semaphore_decrement and semaphore_wait_empty. + */ + +static gpointer +test_force_set_thread(gpointer datap) +{ + semaphore_t *sem = datap; + + /* this should block */ + semaphore_decrement(sem, 20); + + /* and this should block, too - it's fun */ + semaphore_wait_empty(sem); + + return NULL; +} + +static gboolean +test_force_set(void) +{ + GThread *th; + semaphore_t *sem = semaphore_new_with_value(10); + + th = g_thread_create(test_force_set_thread, (gpointer)sem, TRUE, NULL); + + /* sleep to give semaphore_decrement() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* set it to 30, so decrement can proceed, but leave the value at 10 */ + semaphore_force_set(sem, 30); + + /* sleep to give semaphore_wait_empty() a chance to block (or not). */ + g_usleep(G_USEC_PER_SEC / 4); + + /* and empty out the semaphore */ + semaphore_force_set(sem, 0); + + g_thread_join(th); + + semaphore_free(sem); + + /* it we didn't hang yet, it's all good */ + return TRUE; +} + +/* + * Main loop + */ + +int +main(int argc, char **argv) +{ +#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) + static TestUtilsTest tests[] = { + TU_TEST(test_decr_wait, 10), + TU_TEST(test_wait_empty, 10), + TU_TEST(test_force_adjust, 10), + TU_TEST(test_force_set, 10), + TU_END() + }; + + glib_init(); + + return testutils_run_tests(argc, argv, tests); +#else + g_fprintf(stderr, "No thread support on this platform -- nothing to test\n"); + return 0; +#endif +} diff --git a/common-src/semaphore.c b/common-src/semaphore.c new file mode 100644 index 0000000..a38b677 --- /dev/null +++ b/common-src/semaphore.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +/* GLib does not provide semaphores, which are useful in queue.c. + So, we implement it here. */ + +#include "semaphore.h" +#include "amanda.h" + +semaphore_t* semaphore_new_with_value(int value) { + semaphore_t *rval; + + if (!g_thread_supported()) + return NULL; + + rval = malloc(sizeof(*rval)); + rval->value = value; + rval->mutex = g_mutex_new(); + rval->decrement_cond = g_cond_new(); + rval->zero_cond = g_cond_new(); + + if (rval->mutex == NULL || rval->decrement_cond == NULL || + rval->zero_cond == NULL) { + semaphore_free(rval); + return NULL; + } else { + return rval; + } +} + +void semaphore_free(semaphore_t* o) { + g_mutex_free(o->mutex); + g_cond_free(o->decrement_cond); + g_cond_free(o->zero_cond); + free(o); +} + +/* This function checks if the semaphore would is zero or negative. + * If so, the zero_cond is signalled. We assume that the mutex is + * locked. */ +static void check_empty(semaphore_t * o) { + if (o->value <= 0) { + g_cond_broadcast(o->zero_cond); + } +} + +void semaphore_increment(semaphore_t* o, unsigned int inc) { + g_return_if_fail(o != NULL); + g_return_if_fail(inc != 0); + + semaphore_force_adjust(o, inc); +} + +void semaphore_decrement(semaphore_t* o, unsigned int dec) { + int sdec; + g_return_if_fail(o != NULL); + sdec = (int) dec; + g_return_if_fail(sdec >= 0); + + g_mutex_lock(o->mutex); + while (o->value < sdec) { + g_cond_wait(o->decrement_cond, o->mutex); + } + o->value -= sdec; + check_empty(o); + g_mutex_unlock(o->mutex); +} + +void semaphore_force_adjust(semaphore_t* o, int inc) { + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + o->value += inc; + if (inc < 0) + check_empty(o); + else + g_cond_broadcast(o->decrement_cond); + g_mutex_unlock(o->mutex); + +} + +void semaphore_force_set(semaphore_t* o, int value) { + int oldvalue; + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + oldvalue = o->value; + o->value = value; + if (value < oldvalue) + check_empty(o); + else + g_cond_broadcast(o->decrement_cond); + g_mutex_unlock(o->mutex); + +} + +void semaphore_wait_empty(semaphore_t * o) { + g_return_if_fail(o != NULL); + + g_mutex_lock(o->mutex); + while (o->value > 0) { + g_cond_wait(o->zero_cond, o->mutex); + } + g_mutex_unlock(o->mutex); +} diff --git a/common-src/semaphore.h b/common-src/semaphore.h new file mode 100644 index 0000000..c3135d6 --- /dev/null +++ b/common-src/semaphore.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +/* GLib does not provide semaphores, which are useful in queue.c. + So, we implement it here. */ + +#include + +#ifndef SEMAPHORE_H + +typedef struct { + int value; + GMutex *mutex; + GCond * decrement_cond; + GCond * zero_cond; +} semaphore_t; + +/* Create a new semaphore object with the given value. + * + * @param value: new value + * @returns: newly allocated semaphore_t + */ +semaphore_t* semaphore_new_with_value(int value); + +/* Shortcut to make a new semaphore with value 1. + */ +#define semaphore_new() semaphore_new_with_value(1) + +/* Free a semaphore allocated by semaphore_with_new_value(). Be sure the + * semaphore is no longer in use by any threads. + * + * @param sem: the semaphore to free + */ +void semaphore_free(semaphore_t *sem); + +/* Increment the value of the semaphore by incr. This corresponds to + * Dijkstra's V(), or the typical semaphore's release(). + * + * This function will not block, but may wake other threads waiting + * on semaphore_decrement(). + * + * @param sem: the semaphore + * @param incr: added to the semaphore's value + */ +void semaphore_increment(semaphore_t *sem, unsigned int incr); + +/* Shortcut to increment the semaphore by 1. + */ +#define semaphore_up(semaphore) semaphore_increment(semaphore,1) + +/* Decrement the value of the semaphore by incr. If this operation + * would make the semaphore negative, block until the semaphore + * value is large enough, then perform the decerement operation. Threads + * waiting on semaphore_wait_empty() may be awakened if the value + * reaches 0. + * + * @param sem: the semaphore + * @param decr: subtracted from the semaphore's value + */ +void semaphore_decrement(semaphore_t *sem, unsigned int decr); + +/* Shortcut to decrement the semaphore by 1. + */ +#define semaphore_down(semaphore) semaphore_decrement(semaphore, 1) + +/* Increment or decrement (with a negative incr) the value without + * blocking. Threads waiting on semaphore_decrement() or + * semaphore_wait_empty() will be awakened if necessary. + * + * @param sem: the semaphore + * @param incr: added to the semaphore's value + */ +void semaphore_force_adjust(semaphore_t *sem, int incr); + +/* Set the semaphore to a given value without blocking. Threads + * waiting on semaphore_decrement() or semaphore_wait_empty() + * will be awakened if necessary. + * + * @param sem: the semaphore + * @param value: the new value + */ +void semaphore_force_set(semaphore_t *sem, int value); + +/* Block until the semaphore's value is zero. + * + * @param sem: the semaphore + */ +void semaphore_wait_empty(semaphore_t *sem); + +#endif /* SEMAPHORE_H */ diff --git a/common-src/simpleprng.c b/common-src/simpleprng.c new file mode 100644 index 0000000..684e5de --- /dev/null +++ b/common-src/simpleprng.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "simpleprng.h" + +/* A *very* basic linear congruential generator; values are as cited in + * http://en.wikipedia.org/wiki/Linear_congruential_generator for Numerical Recipes */ + +#define A 1664525 +#define C 1013904223 + +void +simpleprng_seed( + simpleprng_state_t *state, + guint32 seed) +{ + g_assert(seed != 0); + *state = seed; +} + +guint32 simpleprng_rand( + simpleprng_state_t *state) +{ + return (*state = (A * (*state)) + C); +} + +void simpleprng_fill_buffer( + simpleprng_state_t *state, + gpointer buf, + size_t len) +{ + guint8 *p = buf; + while (len--) { + *(p++) = simpleprng_rand_byte(state); + } +} + +gboolean simpleprng_verify_buffer( + simpleprng_state_t *state, + gpointer buf, + size_t len) +{ + guint8 *p = buf; + while (len--) { + guint8 expected = simpleprng_rand_byte(state); + guint8 got = *p; + if (expected != got) { + g_fprintf(stderr, + "random value mismatch in buffer %p, offset %zd: got 0x%02x, expected 0x%02x\n", + buf, (size_t)(p-(guint8*)buf), (int)got, (int)expected); + return FALSE; + } + p++; + } + + return TRUE; +} diff --git a/common-src/simpleprng.h b/common-src/simpleprng.h new file mode 100644 index 0000000..e5b6a7e --- /dev/null +++ b/common-src/simpleprng.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#ifndef SIMPLEPRNG_H +#define SIMPLEPRNG_H + +#include "amanda.h" + +/* A very simple, thread-safe PRNG. This is intended for use in reproducable + * generating bytestreams for testing purposes. It is *not* cryptographically + * secure! */ + +typedef guint32 simpleprng_state_t; + +/* Initialize and seed the PRNG + * + * @param state: pointer to PRNG state + * @param seed: initial value + */ +void simpleprng_seed( + simpleprng_state_t *state, + guint32 seed); + +/* Get a random guint32 + * + * @param state: pointer to PRNG state + * @returns: random integer + */ +guint32 simpleprng_rand( + simpleprng_state_t *state); + +/* Get a random byte + * + * @param state: pointer to PRNG state + * @returns: random integer + */ +/* use the high-order bytes, as they're "more random" */ +#define simpleprng_rand_byte(state) \ + ((guint8)(simpleprng_rand((state)) >> 24)) + +/* Fill the given buffer with a sequence of bytes + * + * @param state: pointer to PRNG state + * @param buf: buffer to fill + * @param len: number of bytes to write + */ +void simpleprng_fill_buffer( + simpleprng_state_t *state, + gpointer buf, + size_t len); + +/* Verify that a buffer matches the values from the PRNG. + * + * @param state: pointer to PRNG state + * @param buf: buffer to verify + * @param len: number of bytes to verify + * @returns: true if all bytes match + */ +gboolean simpleprng_verify_buffer( + simpleprng_state_t *state, + gpointer buf, + size_t len); + +#endif /* SIMPLEPRNG_H */ diff --git a/common-src/sockaddr-util.c b/common-src/sockaddr-util.c index ffc6ca2..84655ac 100644 --- a/common-src/sockaddr-util.c +++ b/common-src/sockaddr-util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -14,8 +14,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com * * Author: Dustin J. Mitchell */ diff --git a/common-src/sockaddr-util.h b/common-src/sockaddr-util.h index 977c4f9..56e460d 100644 --- a/common-src/sockaddr-util.h +++ b/common-src/sockaddr-util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -14,8 +14,8 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com * * Author: Dustin J. Mitchell */ diff --git a/common-src/ssh-security.c b/common-src/ssh-security.c index 45a55e4..229c4b4 100644 --- a/common-src/ssh-security.c +++ b/common-src/ssh-security.c @@ -106,6 +106,7 @@ ssh_connect( void * arg, void * datap) { + int result; struct sec_handle *rh; char *amandad_path=NULL, *client_username=NULL, *ssh_keys=NULL; @@ -121,10 +122,13 @@ ssh_connect( rh->ev_timeout = NULL; rh->rc = NULL; + /* get the canonical hostname */ rh->hostname = NULL; - if (resolve_hostname(hostname, 0, NULL, &rh->hostname) || rh->hostname == NULL) { + if ((result = resolve_hostname(hostname, 0, NULL, &rh->hostname)) != 0 + || rh->hostname == NULL) { security_seterror(&rh->sech, - _("%s: ssh could not resolve hostname"), hostname); + _("ssh_security could not find canonical name for '%s': %s"), + hostname, gai_strerror(result)); (*fn)(arg, &rh->sech, S_ERROR); return; } diff --git a/common-src/stream.c b/common-src/stream.c index d9504fc..22b9b0c 100644 --- a/common-src/stream.c +++ b/common-src/stream.c @@ -69,11 +69,13 @@ stream_server( } else { socket_family = family; } + g_debug("stream_server opening socket with family %d (requested family was %d)", socket_family, family); server_socket = socket(socket_family, SOCK_STREAM, 0); - + #ifdef WORKING_IPV6 /* if that address family actually isn't supported, just try AF_INET */ if (server_socket == -1 && errno == EAFNOSUPPORT) { + g_debug("stream_server retrying socket with AF_INET"); socket_family = AF_INET; server_socket = socket(AF_INET, SOCK_STREAM, 0); } @@ -202,10 +204,10 @@ stream_client_internal( int priv) { sockaddr_union svaddr, claddr; - int save_errno; + int save_errno = 0; char *f; - int client_socket; - int *portrange; + int client_socket = 0; + int *portrange = NULL; int result; struct addrinfo *res, *res_addr; @@ -347,7 +349,7 @@ stream_accept( _("stream_accept: timeout after %d seconds\n"), timeout), timeout); - errno = ENOENT; /* ??? */ + errno = ETIMEDOUT; return -1; } else if (!FD_ISSET(server_socket, &readset)) { int i; diff --git a/common-src/svn-info.h b/common-src/svn-info.h index 5357aaf..3e2b034 100644 --- a/common-src/svn-info.h +++ b/common-src/svn-info.h @@ -1,2 +1,2 @@ -#define BUILT_REV "1266" -#define BUILT_BRANCH "amanda-260" +#define BUILT_REV "1609" +#define BUILT_BRANCH "amanda-261" diff --git a/common-src/testutils.c b/common-src/testutils.c new file mode 100644 index 0000000..a614b7c --- /dev/null +++ b/common-src/testutils.c @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "testutils.h" + +int tu_debugging_enabled = FALSE; + +static void +alarm_hdlr(int sig G_GNUC_UNUSED) +{ + fprintf(stderr, "-- TEST TIMED OUT --\n"); + exit(1); +} + +/* Call testfn in a forked process, such that any failures will trigger a + * test failure, but allow the other tests to proceed. + */ +static int +callinfork(TestUtilsTest *test, int ignore_timeouts) +{ + pid_t pid; + int success; + amwait_t status; + + switch (pid = fork()) { + case 0: /* child */ + /* kill the test after a bit */ + signal(SIGALRM, alarm_hdlr); + if (!ignore_timeouts) alarm(test->timeout); + + success = test->fn(); + exit(success? 0:1); + + case -1: + perror("fork"); + exit(1); + + default: /* parent */ + waitpid(pid, &status, 0); + if (status == 0) { + fprintf(stderr, " PASS %s\n", test->name); + } else { + fprintf(stderr, " FAIL %s\n", test->name); + } + return status == 0; + } +} + +static void +usage( + TestUtilsTest *tests) +{ + printf("USAGE: [-d] [-h] [testname [testname [..]]]\n" + "\n" + "\t-h: this message\n" + "\t-d: print debugging messages\n" + "\t-t: ignore timeouts\n" + "\n" + "If no test names are specified, all tests are run. Available tests:\n" + "\n"); + while (tests->fn) { + printf("\t%s\n", tests->name); + tests++; + } +} + +static void +ignore_debug_messages( + const gchar *log_domain G_GNUC_UNUSED, + GLogLevelFlags log_level G_GNUC_UNUSED, + const gchar *message G_GNUC_UNUSED, + gpointer user_data G_GNUC_UNUSED) +{ +} + +int +testutils_run_tests( + int argc, + char **argv, + TestUtilsTest *tests) +{ + TestUtilsTest *t; + int run_all = 1; + int success; + int ignore_timeouts = 0; + + /* first_parse the command line */ + while (argc > 1) { + if (strcmp(argv[1], "-d") == 0) { + tu_debugging_enabled = TRUE; + } else if (strcmp(argv[1], "-t") == 0) { + ignore_timeouts = TRUE; + } else if (strcmp(argv[1], "-h") == 0) { + usage(tests); + return 1; + } else { + int found = 0; + + for (t = tests; t->fn; t++) { + if (strcmp(argv[1], t->name) == 0) { + found = 1; + t->selected = 1; + break; + } + } + + if (!found) { + fprintf(stderr, "Test '%s' not found\n", argv[1]); + return 1; + } + + run_all = 0; + } + + argc--; argv++; + } + + /* Make sure g_critical and g_error will exit */ + g_log_set_always_fatal(G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); + + /* and silently drop debug messages unless we're debugging */ + if (!tu_debugging_enabled) { + g_log_set_handler(NULL, G_LOG_LEVEL_DEBUG, ignore_debug_messages, NULL); + } + + /* Now actually run the tests */ + success = 1; + for (t = tests; t->fn; t++) { + if (run_all || t->selected) { + success = callinfork(t, ignore_timeouts) && success; + } + } + + return success? 0:1; +} diff --git a/common-src/testutils.h b/common-src/testutils.h new file mode 100644 index 0000000..26c138c --- /dev/null +++ b/common-src/testutils.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + * + * This program 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 program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#ifndef TESTUTILS_H +#define TESTUTILS_H + +/* + * A library of utilities for writing 'make check'-based tests. + * + * Use this module like this: + * int test_one(void) { + * ... + * tu_dbg("yep, worked: %p", someptr); + * ... + * return TRUE; + * } + * + * int main(int argc, char **argv) + * { + * TestUtilsTest tests[] = { + * TU_TEST(test_one, 5), + * TU_TEST(test_two, 6), + * ... + * TU_END() + * } + * + * return testutils_run_tests(argc, argv, tests); + * } + */ + +/* + * Defining tests + */ + +/* A test function, returning a boolean */ +typedef int (*TestFunction)(void); + +/* A struct for test functions */ +typedef struct TestUtilsTest { + TestFunction fn; + char *name; + int timeout; + int selected; +} TestUtilsTest; + +/* Macro to define a test array element */ +#define TU_TEST(fn, to) { fn, #fn, to, FALSE } +#define TU_END() { NULL, NULL, 0, FALSE } + +/* + * Debugging + */ + +/* Debugging macro taking printf arguments. This is only enabled if the '-d' flag + * is given on the commandline. You can use g_debug, too, if you'd prefer. */ +#define tu_dbg(...) if (tu_debugging_enabled) { g_fprintf(stderr, __VA_ARGS__); } + +/* Is debugging enabled for this test run? (set internally) */ +int tu_debugging_enabled; + +/* + * Main loop + */ + +int testutils_run_tests(int argc, char **argv, TestUtilsTest *tests); + +#endif /* TESTUTILS_H */ diff --git a/common-src/timestamp.c b/common-src/timestamp.c index dfeec75..0c2e6c1 100644 --- a/common-src/timestamp.c +++ b/common-src/timestamp.c @@ -60,6 +60,7 @@ char * get_timestamp_from_time(time_t when) { } char * get_proper_stamp_from_time(time_t when) { + /* note that this is reimplemented in perl in perl/Amanda/Util.swg */ if (getconf_boolean(CNF_USETIMESTAMPS)) { return get_timestamp_from_time(when); } else { diff --git a/common-src/token.c b/common-src/token.c deleted file mode 100644 index 6489da3..0000000 --- a/common-src/token.c +++ /dev/null @@ -1,482 +0,0 @@ -/* - * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1997-1998 University of Maryland at College Park - * All Rights Reserved. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of U.M. not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. U.M. makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Authors: the Amanda Development Team. Its members are listed in a - * file named AUTHORS, in the root directory of this distribution. - */ -/* - * $Id: token.c,v 1.32 2006/07/19 17:41:15 martinea Exp $ - * - * token bashing routines - */ - -/* -** The quoting method used here was selected because it has the -** property that quoting a string that doesn't contain funny -** characters results in an unchanged string and it was easy to code. -** There are probably other algorithms that are just as effective. -**/ - -#include "amanda.h" -#include "arglist.h" -#include "token.h" - -/* Split a string up into tokens. -** There is exactly one separator character between tokens. -** XXX Won't work too well if separator is '\'! -** -** Inspired by awk and a routine called splitter() that I snarfed from -** the net ages ago (original author long forgotten). -*/ -int -split( - char * str, /* String to split */ - char ** token, /* Array of token pointers */ - int toklen, /* Size of token[] */ - char * sep) /* Token separators - usually " " */ -{ - register char *pi, *po; - register int fld; - register size_t len; - static char *buf = (char *)0; /* XXX - static buffer */ - int in_quotes; - - assert(str && token && toklen > 0 && sep); - - token[0] = str; - - for (fld = 1; fld < toklen; fld++) token[fld] = (char *)0; - - fld = 0; - - if (*sep == '\0' || *str == '\0' || toklen == 1) return fld; - - /* Calculate the length of the unquoted string. */ - len = strlen(str);; - - /* Allocate some space */ - - buf = newalloc(buf, len+1); - - /* Copy it across and tokenise it */ - - in_quotes = 0; - po = buf; - token[++fld] = po; - for (pi = str; *pi && *pi != '\0'; pi++) { - if (*pi == '\n' && !in_quotes) - break; - - if (!in_quotes && strchr(sep, *pi)) { - /* - * separator - * Advance to next field. - */ - *po = '\0'; /* end of token */ - if (fld+1 >= toklen) return fld; /* too many tokens */ - token[++fld] = po + 1; - po++; - continue; - } - - if (*pi == '"') { - /* - * Start or end of quote - * Emit quote in either case - */ - in_quotes = !in_quotes; - } else if (in_quotes && *pi == '\\' && (*(pi + 1) == '"')) { - /* - * Quoted quote. - * emit '/' - default will pick up '"' - */ - *po++ = *pi++; - } - *po++ = *pi; /* Emit character */ - } - *po = '\0'; - - assert(po == buf + len); /* Just checking! */ - - return fld; -} - -/* -** Quote all the funny characters in one token. -** - squotef - formatted string with space separator -** - quotef - formatted string with specified separators -** - squote - fixed string with space separator -** - quote - fixed strings with specified separators -**/ -printf_arglist_function(char *squotef, char *, format) -{ - va_list argp; - char linebuf[16384]; - - /* Format the token */ - - arglist_start(argp, format); - g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp); - arglist_end(argp); - - return quote(" ", linebuf); -} - -printf_arglist_function1(char *quotef, char *, sep, char *, format) -{ - va_list argp; - char linebuf[16384]; - - /* Format the token */ - - arglist_start(argp, format); - g_vsnprintf(linebuf, SIZEOF(linebuf), format, argp); - arglist_end(argp); - - return quote(sep, linebuf); -} - -char *squote( - char * str) /* the string to quote */ -{ - return quote(" ", str); -} - -char * -quote( - char * sepchr, /* separators that also need quoting */ - char * str) /* the string to quote */ -{ - register char *pi, *po; - register size_t len; - char *buf; - int sep, need_quotes; - - /* Calculate the length of the quoted token. */ - - sep = 0; - len = 0; - for (pi = str; *pi; pi++) { - if (*pi < ' ' || *pi > '~') - len = len + 4; - else if (*pi == '\\' || *pi == '"') - len = len + 2; - else if (*sepchr && strchr(sepchr, *pi)) { - len = len + 1; - sep++; - } - else - len++; - } - - need_quotes = (sep != 0); - - if (need_quotes) len = len + 2; - - /* Allocate some space */ - - buf = alloc(len+1); /* trailing null */ - - /* Copy it across */ - - po = buf; - - if (need_quotes) *po++ = '"'; - - for (pi = str; *pi; pi++) { - if (*pi < ' ' || *pi > '~') { - *po++ = '\\'; - *po++ = (char)(((*pi >> 6) & 07) + '0'); - *po++ = (char)(((*pi >> 3) & 07) + '0'); - *po++ = (char)(((*pi ) & 07) + '0'); - } - else if (*pi == '\\' || *pi == '"') { - *po++ = '\\'; - *po++ = *pi; - } - else *po++ = *pi; - } - - if (need_quotes) *po++ = '"'; - - *po = '\0'; - - assert(po == (buf + len)); /* Just checking! */ - - return buf; -} - -/* Quote a string so that it can be used as a regular expression */ -char * -rxquote( - char * str) /* the string to quote */ -{ - char *pi, *po; - size_t len; - char *buf; - - /* Calculate the length of the quoted token. */ - - len = 0; - for (pi = str; *pi; pi++) { - switch (*pi) { - /* regular expression meta-characters: */ -#define META_CHARS \ - case '\\': \ - case '.': \ - case '?': \ - case '*': \ - case '+': \ - case '^': \ - case '$': \ - case '|': \ - case '(': \ - case ')': \ - case '[': \ - case ']': \ - case '{': \ - case '}' /* no colon */ - META_CHARS: - len++; - /* fall through */ - default: - len++; - break; - } - } - - /* Allocate some space */ - - buf = alloc(len+1); /* trailing null */ - - /* Copy it across */ - - po = buf; - - for (pi = str; *pi; pi++) { - switch (*pi) { - META_CHARS: -#undef META_CHARS - *po++ = '\\'; - /* fall through */ - default: - *po++ = *pi; - break; - } - } - - *po = '\0'; - - assert(po == (buf + len)); /* Just checking! */ - - return buf; -} - -#ifndef HAVE_SHQUOTE -/* Quote a string so that it can be safely passed to a shell */ -char * -shquote( - char * str) /* the string to quote */ -{ - char *pi, *po; - size_t len; - char *buf; - - /* Calculate the length of the quoted token. */ - - len = 0; - for (pi = str; *pi; pi++) { - switch (*pi) { - /* shell meta-characters: */ -#define META_CHARS \ - case '\\': \ - case ' ': \ - case '\t': \ - case '\n': \ - case '?': \ - case '*': \ - case '$': \ - case '~': \ - case '!': \ - case ';': \ - case '&': \ - case '<': \ - case '>': \ - case '\'': \ - case '\"': \ - case '`': \ - case '|': \ - case '(': \ - case ')': \ - case '[': \ - case ']': \ - case '{': \ - case '}' /* no colon */ - META_CHARS: - len++; - /* fall through */ - default: - len++; - break; - } - } - - /* Allocate some space */ - - buf = alloc(len+1); /* trailing null */ - - /* Copy it across */ - - po = buf; - - for (pi = str; *pi; pi++) { - switch (*pi) { - META_CHARS: -#undef META_CHARS - *po++ = '\\'; - /* fall through */ - default: - *po++ = *pi; - break; - } - } - - *po = '\0'; - - assert(po == (buf + len)); /* Just checking! */ - - return buf; -} -#endif - -/* Table lookup. -*/ -int -table_lookup( - table_t * table, - char * str) -{ - while(table->word != (char *)0) { - if (*table->word == *str && strcmp(table->word, str) == 0) { - return table->value; - } - table++; - } - - return table->value; -} - -/* Reverse table lookup. -*/ -char * -table_lookup_r( - /*@keep@*/ table_t * table, - int val) -{ - while(table->word != (char *)0) { - if (table->value == val) { - return table->word; - } - table++; - } - - return (char *)0; -} - -#ifdef TEST - -int -main( - int argc, - char ** argv) -{ - char *str = NULL; - char *t[20]; - int r; - char *sr; - int i; - - /* - * Configure program for internationalization: - * 1) Only set the message locale for now. - * 2) Set textdomain for all amanda related programs to "amanda" - * We don't want to be forced to support dozens of message catalogs - */ - setlocale(LC_MESSAGES, "C"); - textdomain("amanda"); - - safe_fd(-1, 0); - - setlocale(LC_ALL, "C"); - - /* shut up compiler */ - argc = argc; - argv = argv; - - set_pname("token test"); - - dbopen(NULL); - - /* Don't die when child closes pipe */ - signal(SIGPIPE, SIG_IGN); - - erroutput_type = ERR_INTERACTIVE; - - g_printf(_("Testing split() with \" \" token separator\n")); - while(1) { - g_printf(_("Input string: ")); - amfree(str); - if ((str = agets(stdin)) == NULL) { - g_printf("\n"); - break; - } - r = split(str, t, 20, " "); - g_printf(plural(_("%d token:\n"), _("%d token:\n"), r), r); - for (i=0; i <= r; i++) - g_printf("tok[%d] = \"%s\"\n", i, t[i]); - } - amfree(str); - g_printf("\n"); - - g_printf(_("Testing quote()\n")); - while(1) { - g_printf(_("Input string: ")); - amfree(str); - if ((str = agets(stdin)) == NULL) { - g_printf("\n"); - break; - } - sr = squote(str); - g_printf(_("Quoted = \"%s\"\n"), sr); - strncpy(str,sr,SIZEOF(str)-1); - str[SIZEOF(str)-1] = '\0'; - r = split(str, t, 20, " "); - if (r != 1) - g_printf("split()=%d!\n", r); - g_printf(_("Unquoted = \"%s\"\n"), t[1]); - amfree(sr); - } - amfree(str); - return 0; -} - -#endif diff --git a/common-src/token.h b/common-src/token.h deleted file mode 100644 index 4d80699..0000000 --- a/common-src/token.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 1997-1998 University of Maryland at College Park - * All Rights Reserved. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of U.M. not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. U.M. makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M. - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Authors: the Amanda Development Team. Its members are listed in a - * file named AUTHORS, in the root directory of this distribution. - */ -/* - * $Id: token.h,v 1.13 2006/05/25 01:47:12 johnfranks Exp $ - * - * interface to token module - */ -#ifndef TOKEN_H -#define TOKEN_H - -#include "amanda.h" - -typedef struct {char *word; int value;} table_t; - -extern int split(char *str, char **token, int toklen, char *sep); -extern char *squotef(char *format, ...) - G_GNUC_PRINTF(1,2); -extern char *squote(char *str); -extern char *quotef(char *sep, char *format, ...) - G_GNUC_PRINTF(2,3); -extern char *quote(char *sep, char *str); -extern char *rxquote(char *str); -#ifndef HAVE_SHQUOTE -extern char *shquote(char *str); -#endif -extern int table_lookup(table_t *table, char *str); -extern char *table_lookup_r(table_t *table, int val); - -#endif diff --git a/common-src/util.c b/common-src/util.c index c1ba9d5..24398f5 100644 --- a/common-src/util.c +++ b/common-src/util.c @@ -34,77 +34,12 @@ #include "clock.h" #include "sockaddr-util.h" #include "conffile.h" - -#ifdef HAVE_LIBCURL -#include -#endif +#include "base64.h" static int make_socket(sa_family_t family); static int connect_port(sockaddr_union *addrp, in_port_t port, char *proto, sockaddr_union *svaddr, int nonblock); -/* - * Keep calling read() until we've read buflen's worth of data, or EOF, - * or we get an error. - * - * Returns the number of bytes read, 0 on EOF, or negative on error. - */ -ssize_t -fullread( - int fd, - void * vbuf, - size_t buflen) -{ - ssize_t nread, tot = 0; - char *buf = vbuf; /* cast to char so we can ++ it */ - - while (buflen > 0) { - nread = read(fd, buf, buflen); - if (nread < 0) { - if ((errno == EINTR) || (errno == EAGAIN)) - continue; - return ((tot > 0) ? tot : -1); - } - - if (nread == 0) - break; - - tot += nread; - buf += nread; - buflen -= nread; - } - return (tot); -} - -/* - * Keep calling write() until we've written buflen's worth of data, - * or we get an error. - * - * Returns the number of bytes written, or negative on error. - */ -ssize_t -fullwrite( - int fd, - const void *vbuf, - size_t buflen) -{ - ssize_t nwritten, tot = 0; - const char *buf = vbuf; /* cast to char so we can ++ it */ - - while (buflen > 0) { - nwritten = write(fd, buf, buflen); - if (nwritten < 0) { - if ((errno == EINTR) || (errno == EAGAIN)) - continue; - return ((tot > 0) ? tot : -1); - } - tot += nwritten; - buf += nwritten; - buflen -= nwritten; - } - return (tot); -} - static int make_socket( sa_family_t family) @@ -116,6 +51,7 @@ make_socket( int r; #endif + g_debug("make_socket opening socket with family %d", family); s = socket(family, SOCK_STREAM, 0); if (s == -1) { save_errno = errno; @@ -376,6 +312,56 @@ bind_portrange( return -1; } +/* + * Writes out the entire iovec + */ +ssize_t +full_writev( + int fd, + struct iovec * iov, + int iovcnt) +{ + ssize_t delta, n, total; + + assert(iov != NULL); + + total = 0; + while (iovcnt > 0) { + /* + * Write the iovec + */ + n = writev(fd, iov, iovcnt); + if (n < 0) { + if (errno != EINTR) + return (-1); + } + else if (n == 0) { + errno = EIO; + return (-1); + } else { + total += n; + /* + * Iterate through each iov. Figure out what we still need + * to write out. + */ + for (; n > 0; iovcnt--, iov++) { + /* 'delta' is the bytes written from this iovec */ + delta = ((size_t)n < (size_t)iov->iov_len) ? n : (ssize_t)iov->iov_len; + /* subtract from the total num bytes written */ + n -= delta; + assert(n >= 0); + /* subtract from this iovec */ + iov->iov_len -= delta; + iov->iov_base = (char *)iov->iov_base + delta; + /* if this iovec isn't empty, run the writev again */ + if (iov->iov_len > 0) + break; + } + } + } + return (total); +} + int needs_quotes( @@ -487,6 +473,19 @@ unquote_string( in++; *(out++) = '\f'; continue; + } else if (*in >= '0' && *in <= '7') { + char c = 0; + int i = 0; + + while (i < 3 && *in >= '0' && *in <= '7') { + c = (c << 3) + *(in++) - '0'; + i++; + } + if (c) + *(out++) = c; + } else if (*in == '\0') { + /* trailing backslash -- ignore */ + break; } } *(out++) = *(in++); @@ -496,6 +495,85 @@ unquote_string( return (ret); } +gchar ** +split_quoted_strings( + const gchar *string) +{ + char *local = g_strdup(string); + char *start = local; + char *p = local; + char **result; + GPtrArray *strs = g_ptr_array_new(); + int iq = 0; + + while (*p) { + if (!iq && *p == ' ') { + *p = '\0'; + g_ptr_array_add(strs, unquote_string(start)); + start = p+1; + } else if (*p == '\\') { + /* next character is taken literally; if it's a multicharacter + * escape (e.g., \171), that doesn't bother us here */ + p++; + if (!*p) break; + } else if (*p == '\"') { + iq = ! iq; + } + + p++; + } + if (start != string) + g_ptr_array_add(strs, unquote_string(start)); + + /* now convert strs into a strv, by stealing its references to the underlying + * strings */ + result = g_new0(char *, strs->len + 1); + memmove(result, strs->pdata, sizeof(char *) * strs->len); + + g_ptr_array_free(strs, FALSE); /* FALSE => don't free strings */ + g_free(local); + + return result; +} + +char * +strquotedstr(char **saveptr) +{ + char * tok = strtok_r(NULL, " ", saveptr); + size_t len; + int in_quote; + int in_backslash; + char *p, *t; + + if (!tok) + return tok; + len = strlen(tok); + in_quote = 0; + in_backslash = 0; + p = tok; + while (in_quote || in_backslash || *p != '\0') { + if (*p == '\0') { + /* append a new token */ + t = strtok_r(NULL, " ", saveptr); + if (!t) + return NULL; + tok[len] = ' '; + len = strlen(tok); + } + if (!in_backslash) { + if (*p == '"') + in_quote = !in_quote; + else if (*p == '\\') { + in_backslash = 1; + } + } else { + in_backslash = 0; + } + p++; + } + return tok; +} + char * sanitize_string( const char *str) @@ -535,7 +613,7 @@ int copy_file( { int infd, outfd; int save_errno; - ssize_t nb; + size_t nb; char buf[32768]; char *quoted; @@ -559,7 +637,7 @@ int copy_file( } while((nb=read(infd, &buf, SIZEOF(buf))) > 0) { - if(fullwrite(outfd,&buf,(size_t)nb) < nb) { + if(full_write(outfd,&buf,nb) < nb) { save_errno = errno; quoted = quote_string(dst); *errmsg = vstrallocf(_("Error writing to '%s': %s"), @@ -571,7 +649,7 @@ int copy_file( } } - if (nb < 0) { + if (errno != 0) { save_errno = errno; quoted = quote_string(src); *errmsg = vstrallocf(_("Error reading from '%s': %s"), @@ -712,28 +790,6 @@ int compare_possibly_null_strings(const char * a, const char * b) { } } -gboolean amanda_thread_init(void) { - gboolean success = FALSE; -#ifdef HAVE_LIBCURL - static gboolean did_curl_init = FALSE; - if (!did_curl_init) { -# ifdef G_THREADS_ENABLED - g_assert(!g_thread_supported()); -# endif - g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0); - did_curl_init = TRUE; - } -#endif -#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) - if (g_thread_supported()) { - return TRUE; - } - g_thread_init(NULL); - success = TRUE; -#endif - return success; -} - int resolve_hostname(const char *hostname, int socktype, @@ -756,7 +812,14 @@ resolve_hostname(const char *hostname, #endif memset(&hints, 0, sizeof(hints)); +#ifdef WORKING_IPV6 + /* get any kind of addresss */ hints.ai_family = AF_UNSPEC; +#else + /* even if getaddrinfo supports IPv6, don't let it return + * such an address */ + hints.ai_family = AF_INET; +#endif hints.ai_flags = flags; hints.ai_socktype = socktype; result = getaddrinfo(hostname, NULL, &hints, &myres); @@ -844,6 +907,11 @@ check_running_as(running_as_flags who) #endif switch (who & RUNNING_AS_USER_MASK) { + case RUNNING_AS_ANY: + uid_target = uid_me; + uname_target = uname_me; + return; + case RUNNING_AS_ROOT: uid_target = 0; uname_target = "root"; @@ -923,28 +991,123 @@ int become_root(void) { #ifndef SINGLE_USERID + // if euid !=0, it set only euid + if (setuid(0) == -1) return 0; + // will set ruid because euid == 0. if (setuid(0) == -1) return 0; #endif return 1; } + +char * +base64_decode_alloc_string( + char *in) +{ + char *out; + size_t in_len = strlen(in); + size_t out_len = 3 * (in_len / 4) + 3; + + out = malloc(out_len); + if (!base64_decode(in, in_len, out, &out_len)) { + amfree(out); + return NULL; + } + out[out_len] = '\0'; + + return out; +} + + +/* A GHFunc (callback for g_hash_table_foreach) */ +void count_proplist( + gpointer key_p G_GNUC_UNUSED, + gpointer value_p, + gpointer user_data_p) +{ + property_t *value_s = value_p; + int *nb = user_data_p; + GSList *value; + + for(value=value_s->values; value != NULL; value = value->next) { + (*nb)++; + } +} + +/* A GHFunc (callback for g_hash_table_foreach) */ +void proplist_add_to_argv( + gpointer key_p, + gpointer value_p, + gpointer user_data_p) +{ + char *property_s = key_p; + property_t *value_s = value_p; + char ***argv = user_data_p; + GSList *value; + char *q, *w, *qprop, *qvalue; + + q = quote_string(property_s); + /* convert to lower case */ + for (w=q; *w != '\0'; w++) { + *w = tolower(*w); + if (*w == '_') + *w = '-'; + } + qprop = stralloc2("--", q); + amfree(q); + for(value=value_s->values; value != NULL; value = value->next) { + qvalue = quote_string((char *)value->data); + **argv = stralloc(qprop); + (*argv)++; + **argv = qvalue; + (*argv)++; + } + amfree(qprop); +} + + /* * Process parameters */ -/* current process name */ -#define MAX_PNAME 128 -static char pname[MAX_PNAME] = "unknown"; +static char *pname = NULL; +static char *ptype = NULL; +static pcontext_t pcontext = CONTEXT_DEFAULT; void set_pname(char *p) { - g_strlcpy(pname, p, sizeof(pname)); + pname = newstralloc(pname, p); } char * get_pname(void) { + if (!pname) pname = stralloc("unknown"); return pname; } +void +set_ptype(char *p) +{ + ptype = newstralloc(ptype, p); +} + +char * +get_ptype(void) +{ + if (!ptype) ptype = stralloc("unknown"); + return ptype; +} + +void +set_pcontext(pcontext_t pc) +{ + pcontext = pc; +} + +pcontext_t +get_pcontext(void) +{ + return pcontext; +} diff --git a/common-src/util.h b/common-src/util.h index 3a9efe7..59d29a0 100644 --- a/common-src/util.h +++ b/common-src/util.h @@ -45,14 +45,13 @@ /* internal types and variables */ -ssize_t fullread(int, void *, size_t); -ssize_t fullwrite(int, const void *, size_t); - int connect_portrange(sockaddr_union *, in_port_t, in_port_t, char *, sockaddr_union *, int); int bind_portrange(int, sockaddr_union *, in_port_t, in_port_t, char *); +ssize_t full_writev(int, struct iovec *, int); + char * construct_datestamp(time_t *t); char * construct_timestamp(time_t *t); @@ -60,6 +59,25 @@ char * construct_timestamp(time_t *t); /*@only@*//*@null@*/char *unquote_string(const char *str); int needs_quotes(const char * str); +/* Split a string into space-delimited words, obeying quoting as created by + * quote_string. To keep compatibility with the old split(), this has the + * characteristic that multiple consecutive spaces are not collapsed into + * a single space: "x y" parses as [ "x", "", "y", NULL ]. The strings are + * unquoted before they are returned, unlike split(). An empty string is + * split into [ "", NULL ]. + * + * Returns a NULL-terminated array of strings, which should be freed with + * g_strfreev. + */ +gchar ** split_quoted_strings(const gchar *string); + +/* Like strtok_r, but consider a quoted string to be a single token. Caller + * must begin parsing with strtok_r first, then pass the saveptr to this function. + * + * Returns NULL on unparseable strings (e.g., unterminated quotes, bad escapes) + */ +char * strquotedstr(char **saveptr); + char * sanitize_string(const char *str); int copy_file(char *dst, char *src, char **errmsg); @@ -103,11 +121,6 @@ void free_new_argv(int new_argc, char **new_argv); * strings, instead of segfaulting. */ int compare_possibly_null_strings(const char * a, const char * b); -/* Does g_thread_init(), along with anything else that should be done - * before/after thread setup. It's OK to call this function more than once. - * Returns TRUE if threads are supported. */ -gboolean amanda_thread_init(void); - /* Given a hostname, call getaddrinfo to resolve it. Optionally get the * entire set of results (if res is not NULL) and the canonical name of * the host (if canonname is not NULL). The canonical name might @@ -155,6 +168,9 @@ char *_str_exit_status(char *subject, amwait_t status); * @param who: one of the RUNNING_AS_* constants, below. */ typedef enum { + /* doesn't matter */ + RUNNING_AS_ANY, + /* userid is 0 */ RUNNING_AS_ROOT, @@ -199,6 +215,24 @@ int become_root(void); * Process parameters */ +/* The 'context' of a process gives a general description of how it is + * used. This affects log output, among other things. + */ +typedef enum { + /* default context (logging to stderr, etc. -- not pretty) */ + CONTEXT_DEFAULT = 0, + + /* user-interfacing command-line utility like amadmin */ + CONTEXT_CMDLINE, + + /* daemon like amandad or sendbackup */ + CONTEXT_DAEMON, + + /* a utility used from shell scripts, and thus probably invoked + * quite often */ + CONTEXT_SCRIPTUTIL, +} pcontext_t; + /* Set the name of the process. The parameter is copied, and remains * the responsibility of the caller on return. This value is used in log * messages and other output throughout Amanda. @@ -214,6 +248,33 @@ void set_pname(char *pname); */ char *get_pname(void); +/* Set the type of the process. The parameter is copied, and remains + * the responsibility of the caller on return. This value dictates the + * directory in which debug logs are stored. + * + * @param pname: the new process type + */ +void set_ptype(char *ptype); + +/* Get the current process name; the result is in a static buffer, and + * should *not* be free()d by the caller. + * + * @returns: process name + */ +char *get_ptype(void); + +/* Set the process's context + * + * @param context: the new context + */ +void set_pcontext(pcontext_t context); + +/* Get the process's context + * + * @returns: the context + */ +pcontext_t get_pcontext(void); + /* * Readline support * @@ -242,4 +303,28 @@ void add_history(const char *line); #endif +char *base64_decode_alloc_string(char *); + +/* A GHFunc (callback for g_hash_table_foreach), + * Count the number of properties. + * + * @param key_p: (char *) property name. + * @param value_p: (GSList *) property values list. + * @param user_data_p: (int *) count are added to that value. + */ +void count_proplist(gpointer key_p, + gpointer value_p, + gpointer user_data_p); + +/* A GHFunc (callback for g_hash_table_foreach), + * Store a property and it's value in an ARGV. + * + * @param key_p: (char *) property name. + * @param value_p: (GSList *) property values list. + * @param user_data_p: (char ***) pointer to ARGV. + */ +void proplist_add_to_argv(gpointer key_p, + gpointer value_p, + gpointer user_data_p); + #endif /* UTIL_H */ diff --git a/common-src/versuff.c b/common-src/versuff.c index 3504b30..03e6183 100644 --- a/common-src/versuff.c +++ b/common-src/versuff.c @@ -33,14 +33,14 @@ const int VERSION_MAJOR = 2; const int VERSION_MINOR = 6; -const int VERSION_PATCH = 0; -const char *const VERSION_COMMENT = "p2"; +const int VERSION_PATCH = 1; +const char *const VERSION_COMMENT = ""; const char * versionsuffix(void) { #ifdef USE_VERSION_SUFFIXES - return "-2.6.0p2"; + return "-2.6.1"; #else return ""; #endif @@ -49,5 +49,5 @@ versionsuffix(void) const char * version(void) { - return "2.6.0p2"; + return "2.6.1"; } diff --git a/config/Makefile.in b/config/Makefile.in index 7f0a293..e7aabc0 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -42,6 +42,7 @@ subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -75,6 +76,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -97,7 +99,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -125,7 +129,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -136,7 +139,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -155,6 +157,7 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -169,8 +172,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -182,16 +187,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -205,6 +222,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -212,7 +230,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -225,6 +243,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -235,9 +254,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -247,6 +269,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -271,8 +294,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -281,11 +306,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -299,6 +328,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -307,9 +337,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -317,7 +348,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -326,8 +359,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -335,7 +370,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -344,10 +378,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -363,6 +399,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -379,6 +417,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -387,7 +427,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -423,26 +462,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -450,7 +500,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -460,6 +514,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -469,7 +524,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -478,6 +540,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -506,6 +569,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -524,6 +588,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -553,6 +619,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ @@ -565,11 +632,12 @@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \ amanda/ipv6.m4 amanda/krb4-security.m4 amanda/krb5-security.m4 \ amanda/lfs.m4 amanda/libs.m4 amanda/net.m4 amanda/progs.m4 \ - amanda/readdir.m4 amanda/readline.m4 amanda/rsh-security.m4 \ - amanda/s3-device.m4 amanda/shmem.m4 amanda/socklen_t_equiv.m4 \ - amanda/ssh-security.m4 amanda/summary.m4 amanda/swig.m4 \ - amanda/syshacks.m4 amanda/tape.m4 amanda/types.m4 \ - amanda/userid.m4 amanda/version.m4 gettext-macros/codeset.m4 \ + amanda/ps.m4 amanda/readdir.m4 amanda/readline.m4 \ + amanda/rsh-security.m4 amanda/s3-device.m4 amanda/shmem.m4 \ + amanda/socklen_t_equiv.m4 amanda/ssh-security.m4 \ + amanda/summary.m4 amanda/swig.m4 amanda/syshacks.m4 \ + amanda/tape.m4 amanda/types.m4 amanda/userid.m4 \ + amanda/version.m4 gettext-macros/codeset.m4 \ gettext-macros/gettext.m4 gettext-macros/glibc21.m4 \ gettext-macros/glibc2.m4 gettext-macros/iconv.m4 \ gettext-macros/intdiv0.m4 gettext-macros/intmax.m4 \ @@ -587,7 +655,7 @@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ gnulib/absolute-header.m4 gnulib/alloca.m4 \ gnulib/arpa_inet_h.m4 gnulib/base64.m4 gnulib/eoverflow.m4 \ gnulib/extensions.m4 gnulib/float_h.m4 gnulib/fsusage.m4 \ - gnulib/getaddrinfo.m4 gnulib/gettimeofday.m4 \ + gnulib/getaddrinfo.m4 gnulib/getopt.m4 gnulib/gettimeofday.m4 \ gnulib/gnulib-cache.m4 gnulib/gnulib-common.m4 \ gnulib/gnulib-comp.m4 gnulib/gnulib-tool.m4 \ gnulib/include_next.m4 gnulib/inet_ntop.m4 gnulib/intmax_t.m4 \ @@ -600,10 +668,11 @@ EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \ gnulib/stdbool.m4 gnulib/stdint_h.m4 gnulib/stdint.m4 \ gnulib/stdio_h.m4 gnulib/stdlib_h.m4 gnulib/strdup.m4 \ gnulib/string_h.m4 gnulib/sys_socket_h.m4 gnulib/sys_stat_h.m4 \ - gnulib/sys_time_h.m4 gnulib/tempname.m4 gnulib/ulonglong.m4 \ - gnulib/unistd_h.m4 gnulib/vasnprintf.m4 gnulib/visibility.m4 \ - gnulib/wchar.m4 gnulib/wchar_t.m4 gnulib/wint_t.m4 \ - gnulib/xsize.m4 macro-archive/ac_define_dir.m4 \ + gnulib/sys_time_h.m4 gnulib/tempname.m4 gnulib/unistd_h.m4 \ + gnulib/vasnprintf.m4 gnulib/visibility.m4 gnulib/wchar.m4 \ + gnulib/wchar_t.m4 gnulib/wint_t.m4 gnulib/xsize.m4 \ + macro-archive/ac_define_dir.m4 \ + macro-archive/ac_perl_module_version.m4 \ macro-archive/ac_prog_perl_version.m4 \ macro-archive/ac_prog_swig.m4 \ macro-archive/ax_compare_version.m4 \ diff --git a/config/amanda/bsd-security.m4 b/config/amanda/bsd-security.m4 index a376707..30ce62a 100644 --- a/config/amanda/bsd-security.m4 +++ b/config/amanda/bsd-security.m4 @@ -11,9 +11,10 @@ # Note that the defaults for *both* of these options are "yes", unlike # the remainder of the security implementations. # -# Defines BSD_SECURITY, and sets AM_CONDITIONAL WANT_BSD_SECURITY, -# if the user has selected this mechanism. Also defines USE_AMANDAHOSTS -# unless the user has specified --without-amandahosts. +# Defines and substitues BSD_SECURITY, and sets AM_CONDITIONAL +# WANT_BSD_SECURITY, if the user has selected this mechanism. +# Also defines and substitutes USE_AMANDAHOSTS unless the user has +# specified --without-amandahosts. # AC_DEFUN([AMANDA_BSD_SECURITY], [ @@ -24,7 +25,7 @@ AC_DEFUN([AMANDA_BSD_SECURITY], [ case "$withval" in n | no) BSD_SECURITY=no ;; - y | ye | yes) ;; + y | ye | yes) BSD_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --without-bsd-security.]) ;; esac @@ -37,8 +38,8 @@ AC_DEFUN([AMANDA_BSD_SECURITY], [use ".rhosts" instead of ".amandahosts"]), [ case "$withval" in - n | no ) USE_AMANDAHOSTS="no" ;; - y | ye | yes) : ;; + n | no ) USE_AMANDAHOSTS=no ;; + y | ye | yes) USE_AMANDAHOSTS=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --without-amandahosts option.]) ;; esac @@ -55,4 +56,6 @@ AC_DEFUN([AMANDA_BSD_SECURITY], fi AM_CONDITIONAL(WANT_BSD_SECURITY, test x"$BSD_SECURITY" = x"yes") + AC_SUBST(BSD_SECURITY) + AC_SUBST(USE_AMANDAHOSTS) ]) diff --git a/config/amanda/bsdtcp-security.m4 b/config/amanda/bsdtcp-security.m4 index 044415b..10192e1 100644 --- a/config/amanda/bsdtcp-security.m4 +++ b/config/amanda/bsdtcp-security.m4 @@ -7,18 +7,18 @@ # Handle configuration for BSDTCP security, implementing the # --with-bsdtcp-security option. # -# Defines BSDTCP_SECURITY, and sets AM_CONDITIONAL WANT_BSDTCP_SECURITY, -# if the user has selected this mechanism. +# Defines and substitutes BSDTCP_SECURITY, and sets AM_CONDITIONAL +# WANT_BSDTCP_SECURITY, if the user has selected this mechanism. # AC_DEFUN([AMANDA_BSDTCP_SECURITY], [ - BSDTCP_SECURITY="no" + BSDTCP_SECURITY="yes" AC_ARG_WITH(bsdtcp-security, AS_HELP_STRING([--with-bsdtcp-security], [include BSDTCP authentication]), [ case "$withval" in - n | no) : ;; + n | no) BSDTCP_SECURITY=no ;; y | ye | yes) BSDTCP_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-bsdtcp-security.]) ;; @@ -30,5 +30,7 @@ AC_DEFUN([AMANDA_BSDTCP_SECURITY], AC_DEFINE(BSDTCP_SECURITY,1, [Define if BSDTCP transport should be enabled.]) fi + AM_CONDITIONAL(WANT_BSDTCP_SECURITY, test x"$BSDTCP_SECURITY" = x"yes") + AC_SUBST(BSDTCP_SECURITY) ]) diff --git a/config/amanda/bsdudp-security.m4 b/config/amanda/bsdudp-security.m4 index 1422bb7..32fe09e 100644 --- a/config/amanda/bsdudp-security.m4 +++ b/config/amanda/bsdudp-security.m4 @@ -7,8 +7,8 @@ # Handle configuration for BSDUDP security, implementing the # --with-bsdudp-security option. # -# Defines BSDUDP_SECURITY, and sets AM_CONDITIONAL WANT_BSDUDP_SECURITY, -# if the user has selected this mechanism. +# Defines and substitutes BSDUDP_SECURITY, and sets AM_CONDITIONAL +# WANT_BSDUDP_SECURITY, if the user has selected this mechanism. # AC_DEFUN([AMANDA_BSDUDP_SECURITY], [ @@ -30,5 +30,7 @@ AC_DEFUN([AMANDA_BSDUDP_SECURITY], AC_DEFINE(BSDUDP_SECURITY,1, [Define if BSDUDP transport should be enabled.]) fi + AM_CONDITIONAL(WANT_BSDUDP_SECURITY, test x"$BSDUDP_SECURITY" = x"yes") + AC_SUBST(BSDUDP_SECURITY) ]) diff --git a/config/amanda/changer.m4 b/config/amanda/changer.m4 index 23c3ae3..3d26325 100644 --- a/config/amanda/changer.m4 +++ b/config/amanda/changer.m4 @@ -33,8 +33,8 @@ AC_DEFUN([AMANDA_SETUP_CHANGER], [ sys/scsi.h \ sys/scsiio.h \ sys/scsi/impl/uscsi.h \ - sys/scsi/scsi/ioctl.h \ - ) + sys/scsi/scsi/ioctl.h, \ + [], [], [AC_INCLUDES_DEFAULT]) # # chio support diff --git a/config/amanda/compress.m4 b/config/amanda/compress.m4 index 1fb47ec..4df5a49 100644 --- a/config/amanda/compress.m4 +++ b/config/amanda/compress.m4 @@ -4,7 +4,7 @@ # # OVERVIEW # -# Find a suitable compression program and define the following: +# Find a suitable compression program and substitute and define the following: # # - COMPRESS_PATH # - COMPRESS_SUFFIX @@ -20,9 +20,11 @@ AC_DEFUN([AMANDA_CHECK_COMPRESSION], AC_REQUIRE([AMANDA_PROG_COMPRESS]) AC_REQUIRE([AMANDA_PROG_GZIP]) + HAVE_GZIP= if test "$GZIP"; then AC_DEFINE(HAVE_GZIP,1, [Define if Amanda is using the gzip program. ]) + HAVE_GZIP=1 COMPRESS_PATH="$GZIP" COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast" @@ -66,6 +68,14 @@ AC_DEFUN([AMANDA_CHECK_COMPRESSION], AC_DEFINE_UNQUOTED(UNCOMPRESS_OPT,"$UNCOMPRESS_OPT", [Define as any optional arguments to get UNCOMPRESS_PATH to uncompress. ]) + AC_SUBST(COMPRESS_PATH) + AC_SUBST(COMPRESS_SUFFIX) + AC_SUBST(COMPRESS_FAST_OPT) + AC_SUBST(COMPRESS_BEST_OPT) + AC_SUBST(UNCOMPRESS_PATH) + AC_SUBST(UNCOMPRESS_OPT) + AC_SUBST(HAVE_GZIP) + # Empty GZIP so that make dist works. GZIP= ]) diff --git a/config/amanda/debugging.m4 b/config/amanda/debugging.m4 index 4a499dc..a9acbd6 100644 --- a/config/amanda/debugging.m4 +++ b/config/amanda/debugging.m4 @@ -4,10 +4,12 @@ # # OVERVIEW # -# Handles the --with-assertions flag. Defines ASSERTIONS if the flag is given. +# Handles the --with-assertions flag. Defines and substitutes ASSERTIONS +# if the flag is given. # AC_DEFUN([AMANDA_WITH_ASSERTIONS], [ + ASSERTIONS= AC_ARG_WITH(assertions, AS_HELP_STRING([--with-assertions], [compile assertions into code]), @@ -15,6 +17,7 @@ AC_DEFUN([AMANDA_WITH_ASSERTIONS], case "$withval" in n | no) : ;; y | ye | yes) + ASSERTIONS=1 AC_DEFINE(ASSERTIONS,1, [Define if you want assertion checking. ]) ;; @@ -23,6 +26,7 @@ AC_DEFUN([AMANDA_WITH_ASSERTIONS], esac ] ) + AC_SUBST(ASSERTIONS) ]) # SYNOPSIS diff --git a/config/amanda/defaults.m4 b/config/amanda/defaults.m4 index a28931b..af870c4 100644 --- a/config/amanda/defaults.m4 +++ b/config/amanda/defaults.m4 @@ -16,6 +16,10 @@ # AC_DEFUN([AMANDA_SETUP_DEFAULTS], [ + #allow configure CONFIG_CLOBBER_MY_CONFIG= to be used by make. + CONFIG_CLOBBER_MY_CONFIG=$CLOBBER_MY_CONFIG + AC_SUBST(CONFIG_CLOBBER_MY_CONFIG) + AC_ARG_WITH(index-server, AS_HELP_STRING([--with-index-server=HOST], [default amanda index server (default: `uname -n`)]), diff --git a/config/amanda/dirs.m4 b/config/amanda/dirs.m4 index ee9c58c..f0fea5b 100644 --- a/config/amanda/dirs.m4 +++ b/config/amanda/dirs.m4 @@ -1,16 +1,16 @@ # SYNOPSIS # -# AMANDA_WITH_DUMPERDIR +# AMANDA_WITH_APPLICATIONDIR # # OVERVIEW # -# Define and substitute DUMPER_DIR with the result. +# Define and substitute APPLICATION_DIR with the result. # -AC_DEFUN([AMANDA_WITH_DUMPERDIR], +AC_DEFUN([AMANDA_WITH_APPLICATIONDIR], [ AC_ARG_WITH(dumperdir, AS_HELP_STRING([--with-dumperdir=DIR], - [where we install the dumpers (default: exec_prefix/dumper)]), + [where we install the dumpers (deprecated)]), [ AMANDA_MSG_WARN([--with-dumperdir is no longer used.]) ] @@ -24,7 +24,7 @@ AC_DEFUN([AMANDA_WITH_DUMPERDIR], # OVERVIEW # # Allow user to specify the dumperdir, defaulting to ${exec_prefix}/dumper. -# Define and substitute DUMPER_DIR with the result. +# Define and substitute APPLICATION_DIR with the result. # AC_DEFUN([AMANDA_WITH_CONFIGDIR], [ @@ -156,11 +156,12 @@ AC_DEFUN([AMANDA_WITH_TMPDIR], # - mandir # # Also defines the following directories and expands any variable references: +# - amdatadir = --with-amdatadir or ${datadir}/amanda # - amlibdir = --with-amlibdir or ${libdir}/amanda # - amlibexecdir = --with-amlibexecdir or ${libexecdir}/amanda # - amincludedir = ${includedir}/amanda # - amperldir = --with-amperldir or `perl -V:installsitearch` -# - DUMPER_DIR = ${amlibexecdir}/application +# - APPLICATION_DIR = ${amlibexecdir}/application # AC_DEFUN([AMANDA_EXPAND_DIRS], [ @@ -241,10 +242,21 @@ AC_DEFUN([AMANDA_EXPAND_DIRS], AC_DEFINE_DIR([amperldir], [AMPERLLIB], [Directory in which perl modules should be installed]) - DUMPER_DIR='${amlibexecdir}/application' - AC_DEFINE_DIR([DUMPER_DIR],[DUMPER_DIR], + APPLICATION_DIR='${amlibexecdir}/application' + AC_DEFINE_DIR([APPLICATION_DIR],[APPLICATION_DIR], [Directory in which dumper interfaces should be installed and searched. ]) - # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR' + + AC_ARG_WITH(amdatadir, + AS_HELP_STRING([--with-amdatadir[[[[[=PATH]]]]]], + [Where amanda's templates and examples are installed; default: $datadir/amanda]), + [ + AMDATADIR=$withval + ], [ + AMDATADIR=$datadir/amanda + ] + ) + AC_DEFINE_DIR([amdatadir], [AMDATADIR], + [Directory in which amanda's templates and examples are installed. ]) ]) # SYNOPSIS @@ -258,9 +270,10 @@ AC_DEFUN([AMANDA_EXPAND_DIRS], AC_DEFUN([AMANDA_SHOW_DIRS_SUMMARY], [ echo "Directories:" - echo " Perl modules (amperldir): $amperldir" - echo " Dumper: $DUMPER_DIR" + echo " Application: $APPLICATION_DIR" echo " Configuration: $CONFIG_DIR" echo " GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR" + echo " Perl modules (amperldir): $amperldir" + echo " Template and example data files (amdatadir): $amdatadir" echo " Temporary: $AMANDA_TMPDIR" ]) diff --git a/config/amanda/dumpers.m4 b/config/amanda/dumpers.m4 index 9c455c6..76b20d9 100644 --- a/config/amanda/dumpers.m4 +++ b/config/amanda/dumpers.m4 @@ -214,7 +214,8 @@ AC_DEFUN([AMANDA_PROG_XFSDUMP_XFSRESTORE], # the binaries we search for depends on the target system. If working # binaries are found, DUMP and RESTORE are defined to their full paths. # -# DUMP_RETURNS is defined if the system's 'dump' returns 1 on success. +# DUMP_RETURNS_1 is defined and substituted if the system's 'dump' +# returns 1 on success. # # HAVE_DUMP_ESTIMATE is defined to the dump flag which enables estimates. # @@ -233,23 +234,25 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE], # a variable is set up here to specify the order of dump programs to # search for on the system. DUMP_PROGRAMS="ufsdump dump backup" - dump_returns_1= + DUMP_RETURNS_1= + AIX_BACKUP= case "$target" in *-dg-*) DUMP_PROGRAMS="dump "$DUMP_PROGRAMS - dump_returns_1=yes + DUMP_RETURNS_1=1 ;; *-ibm-aix*) DUMP_PROGRAMS="backup "$DUMP_PROGRAMS + AIX_BACKUP=1 AC_DEFINE(AIX_BACKUP,1, [Is DUMP the AIX program 'backup'?]) ;; *-ultrix*) - dump_returns_1=yes + DUMP_RETURNS_1=1 ;; esac - if test -n "$dump_returns_1"; then + if test -n "$DUMP_RETURNS_1"; then AC_DEFINE(DUMP_RETURNS_1,1, [Define this if this system's dump exits with 1 as a success code. ]) fi @@ -362,6 +365,9 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE], fi ]) fi + + AC_SUBST(AIX_BACKUP) + AC_SUBST(DUMP_RETURNS_1) ]) # SYNOPSIS @@ -371,7 +377,7 @@ AC_DEFUN([AMANDA_PROG_DUMP_RESTORE], # DESCRIPTION # # Decide if the 'rundump' setuid-root wrapper should be used to invoke -# dump. If so, USE_RUNDUMP is #defined. +# dump. If so, USE_RUNDUMP is defined and substituted. # AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [ USE_RUNDUMP=no @@ -392,7 +398,12 @@ AC_DEFUN([AMANDA_CHECK_USE_RUNDUMP], [ ]) if test x"$USE_RUNDUMP" = x"yes"; then + USE_RUNDUMP=1 AC_DEFINE(USE_RUNDUMP,1, [Define to invoke rundump (setuid-root) instead of DUMP program directly. ]) + else + USE_RUNDUMP= fi + + AC_SUBST(USE_RUNDUMP) ]) diff --git a/config/amanda/file-list b/config/amanda/file-list index 7e929ac..b5133a7 100644 --- a/config/amanda/file-list +++ b/config/amanda/file-list @@ -25,6 +25,7 @@ EXTRA_DIST += amanda/lfs.m4 EXTRA_DIST += amanda/libs.m4 EXTRA_DIST += amanda/net.m4 EXTRA_DIST += amanda/progs.m4 +EXTRA_DIST += amanda/ps.m4 EXTRA_DIST += amanda/readdir.m4 EXTRA_DIST += amanda/readline.m4 EXTRA_DIST += amanda/rsh-security.m4 diff --git a/config/amanda/flags.m4 b/config/amanda/flags.m4 index ba20da9..1f67530 100644 --- a/config/amanda/flags.m4 +++ b/config/amanda/flags.m4 @@ -92,16 +92,17 @@ AC_DEFUN([AMANDA_INIT_FLAGS], done ]) + # Disable strict-aliasing optimizations + AMANDA_DISABLE_GCC_FEATURE(strict-aliasing) + # Warn for just about everything - AMANDA_TEST_GCC_WARNING_FLAG(-Wall, [ - AMANDA_ADD_WARNING_CFLAG(-Wall) - ]) + AMANDA_ENABLE_GCC_WARNING(all) # And add any extra warnings too - AMANDA_TEST_GCC_WARNING_FLAG(-Wextra, [ + AMANDA_TEST_GCC_FLAG(-Wextra, [ AMANDA_ADD_WARNING_CFLAG(-Wextra) ], [ - AMANDA_TEST_GCC_WARNING_FLAG(-W, [ + AMANDA_TEST_GCC_FLAG(-W, [ AMANDA_ADD_WARNING_CFLAG(-W) ]) ]) @@ -197,6 +198,25 @@ AC_DEFUN([AMANDA_ADD_LIBS], [LIBS="$1 $LIBS"] ) +# SYNOPSIS +# +# AMANDA_DISABLE_GCC_FEATURE(feature) +# +# OVERVIEW +# +# Disable feature 'feature' by adding flag -Wno-'feature' to +# AMANDA_FEATURE_CFLAGS. +# +AC_DEFUN([AMANDA_DISABLE_GCC_FEATURE], +[ + # test for -W'feature', then add the 'no-' version. + AMANDA_TEST_GCC_FLAG(-f$1, + [ + AMANDA_ADD_CFLAGS(-fno-$1) + AMANDA_ADD_CPPFLAGS(-fno-$1) + ]) +]) + # SYNOPSIS # # AMANDA_ADD_WARNING_CFLAG(flag) @@ -220,7 +240,7 @@ AC_DEFUN([AMANDA_ADD_WARNING_CFLAG], # AC_DEFUN([AMANDA_ENABLE_GCC_WARNING], [ - AMANDA_TEST_GCC_WARNING_FLAG(-W$1, + AMANDA_TEST_GCC_FLAG(-W$1, [ AMANDA_ADD_WARNING_CFLAG(-W$1) ]) @@ -238,7 +258,7 @@ AC_DEFUN([AMANDA_ENABLE_GCC_WARNING], AC_DEFUN([AMANDA_DISABLE_GCC_WARNING], [ # test for -W'warning', then add the 'no-' version. - AMANDA_TEST_GCC_WARNING_FLAG(-W$1, + AMANDA_TEST_GCC_FLAG(-W$1, [ AMANDA_ADD_WARNING_CFLAG(-Wno-$1) ]) @@ -246,7 +266,7 @@ AC_DEFUN([AMANDA_DISABLE_GCC_WARNING], # SYNOPSIS # -# AMANDA_TEST_GCC_WARNING_FLAG(flag, action-if-found, action-if-not-found) +# AMANDA_TEST_GCC_FLAG(flag, action-if-found, action-if-not-found) # # OVERVIEW # @@ -255,14 +275,16 @@ AC_DEFUN([AMANDA_DISABLE_GCC_WARNING], # # Intended for internal use in this file. # -AC_DEFUN([AMANDA_TEST_GCC_WARNING_FLAG], +AC_DEFUN([AMANDA_TEST_GCC_FLAG], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_EGREP]) AC_MSG_CHECKING(for gcc flag $1) if test "x$GCC" = "xyes"; then changequote(,)dnl - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]$1[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]$1[^[:alnum:]-]' 2>&1 > /dev/null changequote([,])dnl if test $? -eq 0; then found_warning=yes diff --git a/config/amanda/flock.m4 b/config/amanda/flock.m4 index 9850a5b..fa7615b 100644 --- a/config/amanda/flock.m4 +++ b/config/amanda/flock.m4 @@ -4,15 +4,15 @@ # # OVERVIEW # -# Set up file locking support. Four types of locking are available: -# USE_POSIX_FCNTL - use fcntl(). The full job. -# USE_FLOCK - use flock(). Does just as well. -# USE_LOCKF - use lockf(). Only handles advisory, exclusive, +# Set up file locking support. Four locking mechanisms are available: +# POSIX_FCNTL - use fcntl(). The full job. +# FLOCK - use flock(). Does just as well. +# LOCKF - use lockf(). Only handles advisory, exclusive, # blocking file locks as used by Amanda. -# USE_LNLOCK - Home brew exclusive, blocking file lock. -# - No locking available. User beware! -# One of given symbols are defined if the method is discovered to -# be available; the methods are searched in the above order. +# LNLOCK - Home brew exclusive, blocking file lock. +# +# For the chosen method, WANT_AMFLOCK_mech is defined and set up as an +# AM_CONDITIONAL. Also, LOCKING, which contains the mechanism, is substituted. # AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], [ @@ -28,7 +28,7 @@ AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], # Note: these all use AC_TRY_LINK to make sure that we can compile # and link each variant. They do not try to test the variants -- # that is left to runtime. - WORKING_FILE_LOCK="no" + LOCKING="no" # check POSIX locking AC_CACHE_CHECK( @@ -62,7 +62,7 @@ AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], if test "x$amanda_cv_posix_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_POSIX,1,[Define to use POSIX (fcntl()) for file locking]) WANT_AMFLOCK_POSIX="yes" - WORKING_FILE_LOCK="yes" + LOCKING="POSIX_FCNTL" fi AM_CONDITIONAL(WANT_AMFLOCK_POSIX, test x"$WANT_AMFLOCK_POSIX" = x"yes") @@ -86,7 +86,7 @@ AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], if test "x$amanda_cv_flock_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_FLOCK,1,[Define to use flock(2) for file locking]) WANT_AMFLOCK_FLOCK="yes" - WORKING_FILE_LOCK="yes" + LOCKING="FLOCK" fi AM_CONDITIONAL(WANT_AMFLOCK_FLOCK, test x"$WANT_AMFLOCK_FLOCK" = x"yes") @@ -110,7 +110,7 @@ AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], if test "x$amanda_cv_lockf_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_LOCKF,1,[Define to use lockf(3) for file locking.]) WANT_AMFLOCK_LOCKF="yes" - WORKING_FILE_LOCK="yes" + LOCKING="LOCKF" fi AM_CONDITIONAL(WANT_AMFLOCK_LOCKF, test x"$WANT_AMFLOCK_LOCKF" = x"yes") @@ -134,12 +134,14 @@ AC_DEFUN([AMANDA_SETUP_FILE_LOCKING], if test "x$amanda_cv_lnlock_filelocking" = xyes; then AC_DEFINE(WANT_AMFLOCK_LNLOCK,1,[Define to use link(2) to emulate file locking.]) WANT_AMFLOCK_LNLOCK="yes" - WORKING_FILE_LOCK="yes" + LOCKING="LNLOCK" fi AM_CONDITIONAL(WANT_AMFLOCK_LNLOCK, test x"$WANT_AMFLOCK_LNLOCK" = x"yes") - if test x"$WORKING_FILE_LOCK" = "no"; then + if test x"$LOCKING" = "no"; then # this shouldn't happen, and is *bad* if it does AC_MSG_ERROR([*** No working file locking capability found!]) fi + + AC_SUBST(LOCKING) ]) diff --git a/config/amanda/ipv6.m4 b/config/amanda/ipv6.m4 index c3c1776..4330ad5 100644 --- a/config/amanda/ipv6.m4 +++ b/config/amanda/ipv6.m4 @@ -112,31 +112,6 @@ main() fi ]) -# -# Checks to see if there's a sockaddr_storage structure -# -# usage: -# -# AC_SOCKADDR_STORAGE -# -# results: -# -# HAVE_SOCKADDR_STORAGE (defined) -# -AC_DEFUN([AC_SOCKADDR_STORAGE], - [AC_MSG_CHECKING(if sockaddr_storage struct exists) - AC_CACHE_VAL(ac_cv_has_sockaddr_storage, - AC_TRY_COMPILE([ -# include -# include ], - [u_int i = sizeof (struct sockaddr_storage)], - ac_cv_has_sockaddr_storage=yes, - ac_cv_has_sockaddr_storage=no)) - AC_MSG_RESULT($ac_cv_has_sockaddr_storage) - if test $ac_cv_has_sockaddr_storage = yes ; then - AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) - fi]) - # SYNOPSIS # # AMANDA_SHOW_IPV6_SUMMARY diff --git a/config/amanda/krb4-security.m4 b/config/amanda/krb4-security.m4 index 68f5416..446be93 100644 --- a/config/amanda/krb4-security.m4 +++ b/config/amanda/krb4-security.m4 @@ -7,9 +7,9 @@ # Handle configuration for KRB4 security, implementing the --with-krb4-security # option. If libraries are found, they are added to the relevant compiler flags. # -# Defines KRB4_SECURITY, and sets AM_CONDITIONAL WANT_KRB4_SECURITY, +# Defines and substitutes KRB4_SECURITY, and sets AM_CONDITIONAL WANT_KRB4_SECURITY, # if the user has selected this mechanism. Also, the following parameters -# are taken from options and defined: +# are taken from options, defined, and substituted: # # - SERVER_HOST_PRINCIPAL # - SERVER_HOST_INSTANCE @@ -231,4 +231,14 @@ AC_DEFUN([AMANDA_KRB4_SECURITY], fi fi AM_CONDITIONAL(WANT_KRB4_SECURITY, test x"$KRB4_SECURITY" = x"yes") + + AC_SUBST(KRB4_SECURITY) + + AC_SUBST(SERVER_HOST_PRINCIPAL) + AC_SUBST(SERVER_HOST_INSTANCE) + AC_SUBST(SERVER_HOST_KEY_FILE) + AC_SUBST(CLIENT_HOST_PRINCIPAL) + AC_SUBST(CLIENT_HOST_INSTANCE) + AC_SUBST(CLIENT_HOST_KEY_FILE) + AC_SUBST(TICKET_LIFETIME) ]) diff --git a/config/amanda/krb5-security.m4 b/config/amanda/krb5-security.m4 index 1cf0d7a..0aea8f5 100644 --- a/config/amanda/krb5-security.m4 +++ b/config/amanda/krb5-security.m4 @@ -7,17 +7,9 @@ # Handle configuration for KRB5 security, implementing the --with-krb5-security # option. If libraries are found, they are added to the relevant compiler flags. # -# Defines KRB5_SECURITY, and sets AM_CONDITIONAL WANT_KRB5_SECURITY, -# if the user has selected this mechanism. Also, the following parameters -# are taken from options and defined: -# -# - SERVER_HOST_PRINCIPAL -# - SERVER_HOST_INSTANCE -# - SERVER_HOST_KEY_FILE -# - CLIENT_HOST_PRINCIPAL -# - CLIENT_HOST_INSTANCE -# - CLIENT_HOST_KEY_FILE -# - TICKET_LIFETIME +# Defines and substitutes KRB5_SECURITY, and sets AM_CONDITIONAL +# WANT_KRB5_SECURITY, if the user has selected this mechanism. Also, the +# following parameters are taken from options, defined, and substituted: # AC_DEFUN([AMANDA_KRB5_SECURITY], [ @@ -102,4 +94,5 @@ AC_DEFUN([AMANDA_KRB5_SECURITY], fi AM_CONDITIONAL(WANT_KRB5_SECURITY, test x"$KRB5_SECURITY" = x"yes") + AC_SUBST(KRB5_SECURITY) ]) diff --git a/config/amanda/libs.m4 b/config/amanda/libs.m4 index 4bf2bc2..1c3ae6c 100644 --- a/config/amanda/libs.m4 +++ b/config/amanda/libs.m4 @@ -120,8 +120,8 @@ AC_DEFUN([AMANDA_CHECK_GLIB], [ AM_PATH_GLIB_2_0(2.2.0,,[ AC_MSG_ERROR(glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help) ], gmodule gobject gthread) - AMANDA_ADD_CFLAGS($GLIB_CFLAGS) - AMANDA_ADD_CPPFLAGS($GLIB_CPPFLAGS) + # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain. + AMANDA_ADD_CPPFLAGS($GLIB_CFLAGS) AMANDA_ADD_LIBS($GLIB_LIBS) ]) diff --git a/config/amanda/net.m4 b/config/amanda/net.m4 index f2c1805..917903b 100644 --- a/config/amanda/net.m4 +++ b/config/amanda/net.m4 @@ -59,8 +59,8 @@ AC_DEFUN([AMANDA_WITH_REUSEPORTS], [ # OVERVIEW # # Implement --with-low-tcpportrange, --with-tcpportrange, and --with-udpportrange. -# Results are DEFINED in LOW_TCPPORTRANGE, TCPPORTRANGE, and UDPPORTRANGE, -# respectively. +# Results are DEFINED and substituted in LOW_TCPPORTRANGE, TCPPORTRANGE, and +# UDPPORTRANGE, respectively. # AC_DEFUN([AMANDA_WITH_PORTRANGES], [ AC_ARG_WITH(low-tcpportrange, @@ -139,6 +139,9 @@ AC_DEFUN([AMANDA_WITH_PORTRANGES], [ [A comma-separated list of two integers, determining the minimum and * maximum reserved UDP port numbers sockets should be bound to. ]) fi + AC_SUBST(UDPPORTRANGE) + AC_SUBST(TCPPORTRANGE) + AC_SUBST(LOW_TCPPORTRANGE) ]) # SYNOPSIS diff --git a/config/amanda/progs.m4 b/config/amanda/progs.m4 index 79babba..c816b75 100644 --- a/config/amanda/progs.m4 +++ b/config/amanda/progs.m4 @@ -111,10 +111,11 @@ AC_DEFUN([AMANDA_PROG_LINT], AC_PATH_PROG(AMLINT,splint,,$SYSLOCPATH) if test ! -z "$AMLINT"; then AMLINT="splint" + AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' else AMLINT='echo "Error: LINT is not installed" ; false' + AMLINTFLAGS='' fi - AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' fi AC_SUBST(AMLINTFLAGS) ]) @@ -283,10 +284,13 @@ AC_DEFUN([AMANDA_PROG_MAILER], AC_PATH_PROGS(MAILER,Mail mailx mail,NONE) if test x"$MAILER" = x"NONE"; then AMANDA_MSG_WARN([WARNING: Amanda cannot send mail reports without a mailer.]) + DEFAULT_MAILER="" else - AC_DEFINE_UNQUOTED(MAILER,"$MAILER", - [A program that understands -s "subject" user < message_file]) + DEFAULT_MAILER="$MAILER" fi + AC_DEFINE_UNQUOTED(DEFAULT_MAILER,"$DEFAULT_MAILER", + [A program that understands -s "subject" user < message_file]) + AC_SUBST(DEFAULT_MAILER) ]) # SYNOPSIS diff --git a/config/amanda/ps.m4 b/config/amanda/ps.m4 new file mode 100644 index 0000000..83b88b5 --- /dev/null +++ b/config/amanda/ps.m4 @@ -0,0 +1,62 @@ +# +# Find ps argument for Amanda::Process +# +AC_DEFUN([AMANDA_PS_ARGUMENT], +[ + AC_PATH_PROG(PS, ps) + AC_MSG_CHECKING([ps argument to use]) + PS_ARGUMENT= + + # ps is *very* non-portable, and across many systems, the same option + # (e.g., -e) can mean different things. So this macro tries to + # special-case most known systems, and makes an effort to detect unknown + # systems + case "$target" in + *-*-solaris*) + PS_ARGUMENT="-eo pid,ppid,comm" + ;; + + *-*-linux-*) + PS_ARGUMENT="-eo pid,ppid,command" + ;; + + *-*-*bsd*) + PS_ARGUMENT="-axo pid,ppid,command" + ;; + + *-apple-darwin*) + PS_ARGUMENT="-aAco pid,ppid,command" + ;; + + *-pc-cygwin) + # Cygwin is special-cased in Amanda::Process + PS_ARGUMENT=CYGWIN + ;; + + *-*-hpux*) + # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode + PS="UNIX95=1 $PS" + PS_ARGUMENT="-eo pid,ppid,comm" + ;; + + *) + for try in \ + "-axo pid,ppid,command" \ + "-aAco pid,ppid,command" \ + "-eo pid,ppid,comm" + do + ps $try >/dev/null 2>/dev/null + if test $? -eq 0; then + PS_ARGUMENT="$try" + break + fi + done + if test -z "$PS_ARGUMENT"; then + AC_MSG_ERROR([Can't find ps argument to use.]) + fi + ;; + esac + + AC_MSG_RESULT($PS_ARGUMENT) + AC_SUBST(PS_ARGUMENT) +]) diff --git a/config/amanda/rsh-security.m4 b/config/amanda/rsh-security.m4 index 891d50f..747b654 100644 --- a/config/amanda/rsh-security.m4 +++ b/config/amanda/rsh-security.m4 @@ -28,5 +28,6 @@ AC_DEFUN([AMANDA_RSH_SECURITY], [Define if RSH transport should be enabled. ]) fi AM_CONDITIONAL(WANT_RSH_SECURITY, test x"$RSH_SECURITY" = x"yes") + AC_SUBST(RSH_SECURITY) ]) diff --git a/config/amanda/s3-device.m4 b/config/amanda/s3-device.m4 index 1aa37cb..2c15e4c 100644 --- a/config/amanda/s3-device.m4 +++ b/config/amanda/s3-device.m4 @@ -7,9 +7,6 @@ # Perform the necessary checks for the S3 Device. If the S3 device should be built, # WANT_S3_DEVICE is DEFINEd and set up as an AM_CONDITIONAL. # -# The subsidiary DevPay support, if enabled, defines and AM_CONDITIONALizes -# WANT_DEVPAY. -# AC_DEFUN([AMANDA_S3_DEVICE], [ AC_REQUIRE([AMANDA_CHECK_LIBCURL]) AC_REQUIRE([AMANDA_CHECK_HMAC]) @@ -43,23 +40,4 @@ AC_DEFUN([AMANDA_S3_DEVICE], [ if test x"$WANT_S3_DEVICE" = x"yes"; then AC_DEFINE(WANT_S3_DEVICE, [], [Compile Amazon S3 driver]) fi - - - AC_ARG_ENABLE([devpay], - AS_HELP_STRING([--enable-devpay], - [Use devpay authentication for Amazon S3 driver]), - [WANT_DEVPAY=$enableval], [WANT_DEVPAY=no]) - - AC_MSG_CHECKING([whether to include the Amazon S3 device's DevPay support]) - if test x"$WANT_DEVPAY" = x"yes"; then - if test x"$WANT_S3_DEVICE" != x"yes"; then - AC_MSG_RESULT(no) - AC_MSG_ERROR([DevPay support requires the S3 device (--enable-s3-device)]) - fi - - AC_DEFINE([WANT_DEVPAY], [], [Compile Amazon DevPay support]) - fi - AC_MSG_RESULT($WANT_DEVPAY) - - AM_CONDITIONAL([WANT_DEVPAY], [test "$WANT_DEVPAY" = "yes"]) ]) diff --git a/config/amanda/ssh-security.m4 b/config/amanda/ssh-security.m4 index 9fd8d97..e5e4c34 100644 --- a/config/amanda/ssh-security.m4 +++ b/config/amanda/ssh-security.m4 @@ -5,17 +5,18 @@ # OVERVIEW # # Handle configuration for SSH security, implementing the --with-ssh-security -# option and checking for the relevant programs and options. +# option and checking for the relevant programs and options. Defines and substitutes +# SSH_SECURITY, searches for and defines SSH, and defines SSH_OPTIONS. # AC_DEFUN([AMANDA_SSH_SECURITY], [ - SSH_SECURITY=no + SSH_SECURITY=yes AC_ARG_WITH(ssh-security, AS_HELP_STRING([--with-ssh-security], [include SSH authentication]), [ case "$withval" in - n | no) : ;; + n | no) SSH_SECURITY=no ;; y | ye | yes) SSH_SECURITY=yes ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.]) ;; @@ -68,4 +69,7 @@ AC_DEFUN([AMANDA_SSH_SECURITY], [Arguments to ssh]) fi AM_CONDITIONAL(WANT_SSH_SECURITY, test x"$SSH_SECURITY" = x"yes") + + AC_SUBST(SSH_SECURITY) + # (note -- don't just substitute SSH_OPTIONS -- shell quoting will break) ]) diff --git a/config/amanda/swig.m4 b/config/amanda/swig.m4 index dadfc89..483306d 100644 --- a/config/amanda/swig.m4 +++ b/config/amanda/swig.m4 @@ -17,6 +17,11 @@ AC_DEFUN([AMANDA_SETUP_SWIG], # If we want cygwin to copy ddl to modules directory. WANT_CYGWIN_COPY_PERL_DLL="false" + # test for ExtUtils::Embed + AC_PERL_MODULE_VERSION([ExtUtils::Embed 0.0], [], [ + AC_MSG_ERROR([*** Amanda requires the perl package ExtUtils::Embed to build its perl modules]) + ]) + # get the include path for building perl extensions PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc` AC_SUBST(PERL_INC) diff --git a/config/amanda/tape.m4 b/config/amanda/tape.m4 index d08f27a..f5b04d9 100644 --- a/config/amanda/tape.m4 +++ b/config/amanda/tape.m4 @@ -4,20 +4,12 @@ # # OVERVIEW # -# Implement the --with-maxtapeblocksize option, and DEFINE and SUBST the -# result in MAX_TAPE_BLOCk_KB and MAXTAPEBLOCKSIZE, respectively. +# Implement the deprecated --with-maxtapeblocksize option. # AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [ - AC_ARG_WITH(maxtapeblocksize, - AS_HELP_STRING([--with-maxtapeblocksize=kb], - [Maximum size of a tape block (default: 32)]), - [ MAXTAPEBLOCKSIZE="$withval" ], - [ MAXTAPEBLOCKSIZE=32 ] + AC_ARG_WITH(maxtapeblocksize, [(deprecated)], + [ AMANDA_MSG_WARN([--with-maxtapeblocksize is no longer needed]) ] ) - - AC_DEFINE_UNQUOTED(MAX_TAPE_BLOCK_KB,($MAXTAPEBLOCKSIZE), - [Maximum size of a tape block in KBytes.]) - AC_SUBST(MAXTAPEBLOCKSIZE) ]) # SYNOPSIS @@ -35,9 +27,6 @@ AC_DEFUN([AMANDA_WITH_MAXTAPEBLOCKSIZE], [ # If 'struct mtget' fields mt_flags, mt_fileno, mt_blkno, mt_dsreg, and # mt_erreg, the corresponding HAVE_MT_* is DEFINEd. # -# Not that most of the checks in this section correspond to the older -# tapeio (in tape-src/), rather than the new tape device. -# AC_DEFUN([AMANDA_TAPE_DEVICE], [ AC_CHECK_HEADERS( \ linux/zftape.h \ diff --git a/config/amanda/types.m4 b/config/amanda/types.m4 index ff9e852..a3ddea2 100644 --- a/config/amanda/types.m4 +++ b/config/amanda/types.m4 @@ -14,6 +14,9 @@ AC_DEFUN([AMANDA_CHECK_TYPE], [ AC_CHECK_TYPE($1, [], [ AC_DEFINE($1, $2, [Type for $1, if it is not defined by the system]) ], ifelse($3, [], [], [ +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef STDC_HEADERS #include #include diff --git a/config/amanda/userid.m4 b/config/amanda/userid.m4 index 8ef15c8..c659395 100644 --- a/config/amanda/userid.m4 +++ b/config/amanda/userid.m4 @@ -28,8 +28,8 @@ AC_DEFUN([AMANDA_DISABLE_INSTALLPERMS], # OVERVIEW # # Handle the --without-force-id option, which disables userid checks for -# all Amanda applications. Defines CHECK_USERID *unless* this option is -# given. +# all Amanda applications. Defines and substitutes CHECK_USERID *unless* +# this option is given. # AC_DEFUN([AMANDA_WITH_FORCE_UID], [ @@ -41,14 +41,17 @@ AC_DEFUN([AMANDA_WITH_FORCE_UID], ) case "$CHECK_USERID" in y | ye | yes) + CHECK_USERID=1 AC_DEFINE(CHECK_USERID, 1, [Define to force to another user on client machines. ]) ;; n | no) : + CHECK_USERID= ;; *) AC_MSG_ERROR([*** You must not supply an argument to --with-force-uid option.]) esac + AC_SUBST(CHECK_USERID) ]) # SYNOPSIS diff --git a/config/automake/installperms.am b/config/automake/installperms.am index 245345b..586eb01 100644 --- a/config/automake/installperms.am +++ b/config/automake/installperms.am @@ -25,7 +25,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -35,13 +35,41 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs=s|^.*/|| +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. if WANT_INSTALLPERMS +do_file=pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ + if test -n "$$chown"; then \ + echo chown "$$chown" "$$pa"; \ + chown "$$chown" "$$pa" || exit 1; \ + fi; \ + if test -n "$$chmod"; then \ + echo chmod "$$chmod" "$$pa"; \ + chmod "$$chmod" "$$pa" || exit 1; \ + fi +else +installperms_sh="$(top_builddir)/installperms.sh" +do_file=pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ + echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" +DISTCLEANFILES += $(installperms_sh) +endif + installperms-exec: @installperms="$(INSTALLPERMS_exec)"; \ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ @@ -52,21 +80,12 @@ installperms-exec: echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ - *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ - if test -n "$$chown"; then \ - echo chown "$$chown" "$$pa"; \ - chown "$$chown" "$$pa" || exit 1; \ - fi; \ - if test -n "$$chmod"; then \ - echo chmod "$$chmod" "$$pa"; \ - chmod "$$chmod" "$$pa" || exit 1; \ - fi; \ + *) $(do_file) ;; \ esac; \ done installperms-data: @installperms="$(INSTALLPERMS_data)"; \ - test -n "$$installperms" && echo "Setting installation permissions on data"; \ dest=; chown=; chmod=; \ for cmd in $$installperms; do \ case "$$cmd" in \ @@ -74,18 +93,17 @@ installperms-data: echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ dest=*|chown=*|chmod=*) \ echo " ($$cmd)"; eval $$cmd;; \ - *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ - if test -n "$$chown"; then \ - echo chown "$$chown" "$$pa"; \ - chown "$$chown" "$$pa" || exit 1; \ - fi; \ - if test -n "$$chmod"; then \ - echo chmod "$$chmod" "$$pa"; \ - chmod "$$chmod" "$$pa" || exit 1; \ - fi; \ + *) $(do_file) ;; \ esac; \ done install-exec-hook: installperms-exec install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +if WANT_INSTALLPERMS +installperms-init: +else +installperms-init: + rm -f "$(installperms_sh)" endif diff --git a/config/automake/scripts.am b/config/automake/scripts.am index 129df49..cb6d705 100644 --- a/config/automake/scripts.am +++ b/config/automake/scripts.am @@ -1,5 +1,5 @@ # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -26,7 +26,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -36,12 +40,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -62,6 +69,11 @@ %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -89,17 +101,31 @@ CLEANFILES += config.log # and we'll need to clean up our generated files for distclean -DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) +DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) $(SCRIPTS_INCLUDE) # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl # syntax-check shell scripts on 'make check' CHECK_SHELL = $(SCRIPTS_SHELL) diff --git a/config/automake/vars.am b/config/automake/vars.am index 88aa8a8..a6310e9 100644 --- a/config/automake/vars.am +++ b/config/automake/vars.am @@ -1,5 +1,5 @@ # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. diff --git a/config/config.h.in b/config/config.h.in index 5c2d004..172cfbd 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -1,5 +1,8 @@ /* config/config.h.in. Generated from configure.in by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Is DUMP the AIX program 'backup'? */ #undef AIX_BACKUP @@ -15,6 +18,9 @@ /* The directory in which Amanda should create temporary files. */ #undef AMANDA_TMPDIR +/* Directory in which dumper interfaces should be installed and searched. */ +#undef APPLICATION_DIR + /* Define if you want assertion checking. */ #undef ASSERTIONS @@ -95,6 +101,9 @@ /* This is the default Amanda configuration. */ #undef DEFAULT_CONFIG +/* A program that understands -s "subject" user < message_file */ +#undef DEFAULT_MAILER + /* This is the default Amanda index server. */ #undef DEFAULT_SERVER @@ -110,9 +119,6 @@ /* Define the location of the ufsdump, backup, or dump program. */ #undef DUMP -/* Directory in which dumper interfaces should be installed and searched. */ -#undef DUMPER_DIR - /* Define if dumper should buffer the sockets for faster throughput. */ #undef DUMPER_SOCKET_BUFFERING @@ -155,6 +161,9 @@ */ #undef HAVE_ALLOCA_H +/* Define to 1 if you have the "amanda.h" header file. */ +#undef HAVE_AMANDA_H + /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H @@ -245,6 +254,10 @@ don't. */ #undef HAVE_DECL_GETADDRINFO +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#undef HAVE_DECL_GETENV + /* Define to 1 if you have the declaration of `getnameinfo', and to 0 if you don't. */ #undef HAVE_DECL_GETNAMEINFO @@ -358,9 +371,6 @@ /* Define if fwrite is declared. */ #undef HAVE_FWRITE_DECL -/* Define to 1 if you have the `getaddrinfo' function. */ -#undef HAVE_GETADDRINFO - /* Define to 1 if you have the `getgrgid_r' function. */ #undef HAVE_GETGRGID_R @@ -379,6 +389,12 @@ /* Define if getopt is declared. */ #undef HAVE_GETOPT_DECL +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY + /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE @@ -533,9 +549,6 @@ /* Define if listen is declared. */ #undef HAVE_LISTEN_DECL -/* Define if you have the 'long long' type. */ -#undef HAVE_LONG_LONG - /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT @@ -671,9 +684,6 @@ /* Define if the POSIX multithreading library has read/write locks. */ #undef HAVE_PTHREAD_RWLOCK -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV @@ -707,6 +717,9 @@ /* Define if recvfrom is declared. */ #undef HAVE_RECVFROM_DECL +/* Define to 1 if you have the header file. */ +#undef HAVE_REGEX_H + /* Define to 1 if you have the `remove' function. */ #undef HAVE_REMOVE @@ -818,9 +831,6 @@ /* Define if shmget is declared. */ #undef HAVE_SHMGET_DECL -/* Define to 1 if you have the `shquote' function. */ -#undef HAVE_SHQUOTE - /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION @@ -845,7 +855,7 @@ /* Define if snprintf is declared. */ #undef HAVE_SNPRINTF_DECL -/* if struct sockaddr_storage exists */ +/* struct sockaddr_storage exists */ #undef HAVE_SOCKADDR_STORAGE /* Define to 1 if you have the `socket' function. */ @@ -1097,6 +1107,9 @@ /* Define if time is declared. */ #undef HAVE_TIME_DECL +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + /* Define to 1 if you have the `tolower' function. */ #undef HAVE_TOLOWER @@ -1121,6 +1134,9 @@ /* Define to 1 if the system has the type `unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT +/* Define to 1 if you have the "util.h" header file. */ +#undef HAVE_UTIL_H + /* Define to 1 if you have the `vasnprintf' function. */ #undef HAVE_VASNPRINTF @@ -1260,12 +1276,6 @@ /* LPRCMD switch for specifying a printer name. */ #undef LPRFLAG -/* A program that understands -s "subject" user < message_file */ -#undef MAILER - -/* Maximum size of a tape block in KBytes. */ -#undef MAX_TAPE_BLOCK_KB - /* The switch to be used when invoking mt to specify the * tape device. */ #undef MT_FILE_FLAG @@ -1470,6 +1480,9 @@ /* Define for backups being done on a multiple networks and FQDNs are used. */ #undef USE_FQDN +/* Define to 1 if files will be processed with gettextize */ +#undef USE_GETTEXT + /* Define if the POSIX multithreading library can be used. */ #undef USE_POSIX_THREADS @@ -1539,9 +1552,6 @@ /* Define to use POSIX (fcntl()) for file locking */ #undef WANT_AMFLOCK_POSIX -/* Compile Amazon DevPay support */ -#undef WANT_DEVPAY - /* Compile Amazon S3 driver */ #undef WANT_S3_DEVICE @@ -1568,9 +1578,17 @@ 'wint_t'. */ #undef WINT_T_SUFFIX -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Target system has functional IPv6 support */ #undef WORKING_IPV6 @@ -1588,11 +1606,6 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES @@ -1628,6 +1641,13 @@ #endif +/* Define to rpl_ if the getopt replacement functions and variables should be + used. */ +#undef __GETOPT_PREFIX + +/* Directory in which amanda's templates and examples are installed. */ +#undef amdatadir + /* Directory in which Amanda header files should be installed */ #undef amincludedir @@ -1685,9 +1705,22 @@ /* Define to `int' if does not define. */ #undef pid_t -/* Define to equivalent of C99 restrict keyword, or to nothing if this is not - supported. Do not define if restrict is supported directly. */ +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ #undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict, even + though the corresponding Sun C compiler does, which causes + "#define restrict _Restrict" in the previous line. Perhaps some future + version of Sun C++ will work with _Restrict; if so, it'll probably + define __RESTRICT, just as Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +#endif /* Type for sa_family_t, if it is not defined by the system */ #undef sa_family_t diff --git a/config/config.rpath b/config/config.rpath index c547c68..35f959b 100644 --- a/config/config.rpath +++ b/config/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2007 Free Software Foundation, Inc. +# Copyright 1996-2008 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # @@ -158,7 +158,7 @@ if test "$with_gnu_ld" = yes; then # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no @@ -254,7 +254,7 @@ else hardcode_direct=unsupported fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -264,7 +264,7 @@ else # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -505,7 +505,7 @@ case "$host_os" in aix3*) library_names_spec='$libname.a' ;; - aix4* | aix5*) + aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) diff --git a/config/gnulib/alloca.m4 b/config/gnulib/alloca.m4 index eb62e0e..95f54a6 100644 --- a/config/gnulib/alloca.m4 +++ b/config/gnulib/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 7 -dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc. +# alloca.m4 serial 8 +dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -39,10 +39,6 @@ AC_DEFUN([gl_FUNC_ALLOCA], ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) - - AC_DEFINE(HAVE_ALLOCA_H, 1, - [Define HAVE_ALLOCA_H for backward compatibility with older code - that includes only if HAVE_ALLOCA_H is defined.]) ]) # Prerequisites of lib/alloca.c. diff --git a/config/gnulib/file-list b/config/gnulib/file-list index f2c14fc..0029f2e 100644 --- a/config/gnulib/file-list +++ b/config/gnulib/file-list @@ -8,6 +8,7 @@ EXTRA_DIST += gnulib/extensions.m4 EXTRA_DIST += gnulib/float_h.m4 EXTRA_DIST += gnulib/fsusage.m4 EXTRA_DIST += gnulib/getaddrinfo.m4 +EXTRA_DIST += gnulib/getopt.m4 EXTRA_DIST += gnulib/gettimeofday.m4 EXTRA_DIST += gnulib/gnulib-cache.m4 EXTRA_DIST += gnulib/gnulib-common.m4 @@ -45,7 +46,6 @@ EXTRA_DIST += gnulib/sys_socket_h.m4 EXTRA_DIST += gnulib/sys_stat_h.m4 EXTRA_DIST += gnulib/sys_time_h.m4 EXTRA_DIST += gnulib/tempname.m4 -EXTRA_DIST += gnulib/ulonglong.m4 EXTRA_DIST += gnulib/unistd_h.m4 EXTRA_DIST += gnulib/vasnprintf.m4 EXTRA_DIST += gnulib/visibility.m4 diff --git a/config/gnulib/float_h.m4 b/config/gnulib/float_h.m4 index 1b1ad10..d36e3a4 100644 --- a/config/gnulib/float_h.m4 +++ b/config/gnulib/float_h.m4 @@ -1,4 +1,4 @@ -# float_h.m4 serial 2 +# float_h.m4 serial 3 dnl Copyright (C) 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,7 +10,7 @@ AC_DEFUN([gl_FLOAT_H], AC_REQUIRE([AC_CANONICAL_HOST]) FLOAT_H= case "$host_os" in - beos*) + beos* | openbsd*) FLOAT_H=float.h gl_CHECK_NEXT_HEADERS([float.h]) ;; diff --git a/config/gnulib/getaddrinfo.m4 b/config/gnulib/getaddrinfo.m4 index 7be1e49..5d36c19 100644 --- a/config/gnulib/getaddrinfo.m4 +++ b/config/gnulib/getaddrinfo.m4 @@ -1,4 +1,4 @@ -# getaddrinfo.m4 serial 13 +# getaddrinfo.m4 serial 15 dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,23 @@ AC_DEFUN([gl_GETADDRINFO], AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo]) + AC_CHECK_HEADERS_ONCE(netdb.h) + AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) - AC_CHECK_FUNCS(getaddrinfo,, [ + AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [ + AC_TRY_LINK([ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#include +], [getaddrinfo("", "", NULL, NULL);], + [gl_cv_func_getaddrinfo=yes], + [gl_cv_func_getaddrinfo=no])]) + if test $gl_cv_func_getaddrinfo = no; then AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32, gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no @@ -20,19 +35,19 @@ AC_DEFUN([gl_GETADDRINFO], #ifdef HAVE_WS2TCPIP_H #include #endif -], [getaddrinfo(0, 0, 0, 0);], gl_cv_w32_getaddrinfo=yes) +#include +], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes) LIBS="$am_save_LIBS"]) if test "$gl_cv_w32_getaddrinfo" = "yes"; then LIBS="$LIBS -lws2_32" else AC_LIBOBJ(getaddrinfo) fi - ]) + fi # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an # inline function declared in ws2tcpip.h, so we need to get that # header included somehow. - AC_CHECK_HEADERS_ONCE(netdb.h) AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)], gl_cv_func_gai_strerror, [ AC_TRY_LINK([ @@ -46,7 +61,8 @@ AC_DEFUN([gl_GETADDRINFO], #ifdef HAVE_WS2TCPIP_H #include #endif -], [gai_strerror (0);], +#include +], [gai_strerror (NULL);], [gl_cv_func_gai_strerror=yes], [gl_cv_func_gai_strerror=no])]) if test $gl_cv_func_gai_strerror = no; then @@ -71,7 +87,8 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ #ifdef HAVE_WINSOCK2_H #include #endif -], [gethostbyname(0);], gl_cv_w32_gethostbyname=yes) +#include +], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes) LIBS="$am_save_LIBS"]) if test "$gl_cv_w32_gethostbyname" = "yes"; then LIBS="$LIBS -lws2_32" diff --git a/config/gnulib/getopt.m4 b/config/gnulib/getopt.m4 new file mode 100644 index 0000000..c0a73b2 --- /dev/null +++ b/config/gnulib/getopt.m4 @@ -0,0 +1,83 @@ +# getopt.m4 serial 13 +dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# The getopt module assume you want GNU getopt, with getopt_long etc, +# rather than vanilla POSIX getopt. This means your code should +# always include for the getopt prototypes. + +AC_DEFUN([gl_GETOPT_SUBSTITUTE], +[ + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_GETOPT_SUBSTITUTE_HEADER + gl_PREREQ_GETOPT +]) + +AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], +[ + GETOPT_H=getopt.h + AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], + [Define to rpl_ if the getopt replacement functions and variables + should be used.]) + AC_SUBST([GETOPT_H]) +]) + +AC_DEFUN([gl_GETOPT_CHECK_HEADERS], +[ + if test -z "$GETOPT_H"; then + AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) + fi + + if test -z "$GETOPT_H"; then + AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) + fi + + dnl BSD getopt_long uses an incompatible method to reset option processing, + dnl and (as of 2004-10-15) mishandles optional option-arguments. + if test -z "$GETOPT_H"; then + AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) + fi + + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + if test -z "$GETOPT_H"; then + AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([#include ], + [[ + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + ]])], + [gl_cv_func_gnu_getopt=yes], + [gl_cv_func_gnu_getopt=no], + [dnl cross compiling - pessimistically guess based on decls + dnl Solaris 10 getopt doesn't handle `+' as a leading character in an + dnl option string (as of 2005-05-05). + AC_CHECK_DECL([getopt_clip], + [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], + [#include ])])]) + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi +]) + +AC_DEFUN([gl_GETOPT_IFELSE], +[ + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) + AS_IF([test -n "$GETOPT_H"], [$1], [$2]) +]) + +AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) + +# Prerequisites of lib/getopt*. +AC_DEFUN([gl_PREREQ_GETOPT], +[ + AC_CHECK_DECLS_ONCE([getenv]) +]) diff --git a/config/gnulib/gnulib-cache.m4 b/config/gnulib/gnulib-cache.m4 index f1b01f7..b1a4c82 100644 --- a/config/gnulib/gnulib-cache.m4 +++ b/config/gnulib/gnulib-cache.m4 @@ -15,11 +15,11 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage full-read full-write getaddrinfo getopt lock mkdtemp physmem visibility # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) -gl_MODULES([base64 fsusage getaddrinfo lock mkdtemp physmem visibility]) +gl_MODULES([base64 fsusage full-read full-write getaddrinfo getopt lock mkdtemp physmem visibility]) gl_AVOID([]) gl_SOURCE_BASE([gnulib]) gl_M4_BASE([config/gnulib]) diff --git a/config/gnulib/gnulib-common.m4 b/config/gnulib/gnulib-common.m4 index 5398010..9336d72 100644 --- a/config/gnulib/gnulib-common.m4 +++ b/config/gnulib/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 2 +# gnulib-common.m4 serial 3 dnl Copyright (C) 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -20,3 +20,46 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake MKDIR_P='$(mkdir_p)' AC_SUBST([MKDIR_P])])]) + +# AC_C_RESTRICT +# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61, +# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++ +# works. +# This definition can be removed once autoconf >= 2.62 can be assumed. +AC_DEFUN([AC_C_RESTRICT], +[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, + [ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + }]], + [[int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t)]])], + [ac_cv_c_restrict=$ac_kw]) + test "$ac_cv_c_restrict" != no && break + done + ]) + AH_VERBATIM([restrict], +[/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict, even + though the corresponding Sun C compiler does, which causes + "#define restrict _Restrict" in the previous line. Perhaps some future + version of Sun C++ will work with _Restrict; if so, it'll probably + define __RESTRICT, just as Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +#endif]) + case $ac_cv_c_restrict in + restrict) ;; + no) AC_DEFINE([restrict], []) ;; + *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; + esac +]) diff --git a/config/gnulib/gnulib-comp.m4 b/config/gnulib/gnulib-comp.m4 index 3c36360..d0858c3 100644 --- a/config/gnulib/gnulib-comp.m4 +++ b/config/gnulib/gnulib-comp.m4 @@ -34,11 +34,11 @@ AC_DEFUN([gl_EARLY], # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ + AM_CONDITIONAL([GL_COND_LIBTOOL], [true]) + gl_cond_libtool=true m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ])) m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS])) m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) - AM_CONDITIONAL([GL_COND_LIBTOOL], [true]) - gl_cond_libtool=true gl_source_base='gnulib' gl_FUNC_ALLOCA gl_HEADER_ARPA_INET @@ -47,6 +47,7 @@ AC_DEFUN([gl_INIT], gl_FLOAT_H gl_FSUSAGE gl_GETADDRINFO + gl_GETOPT AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_FUNC_GETTIMEOFDAY @@ -102,34 +103,112 @@ AC_DEFUN([gl_INIT], AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) ]) + gltests_libdeps= + gltests_ltlibdeps= + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ])) + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS])) + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) + gl_source_base='tests' + m4_popdef([AC_LIBSOURCES]) + m4_popdef([AC_REPLACE_FUNCS]) + m4_popdef([AC_LIBOBJ]) + AC_CONFIG_COMMANDS_PRE([ + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) + ]) ]) # Like AC_LIBOBJ, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. -AC_DEFUN([gl_LIBOBJ], - [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"]) +AC_DEFUN([gl_LIBOBJ], [ + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext" +]) + +# m4_foreach_w is provided by autoconf-2.59c and later. +# This definition is to accommodate developers using versions +# of autoconf older than that. +m4_ifndef([m4_foreach_w], + [m4_define([m4_foreach_w], + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) # Like AC_REPLACE_FUNCS, except that the module name goes # into gl_LIBOBJS instead of into LIBOBJS. -AC_DEFUN([gl_REPLACE_FUNCS], - [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])]) +AC_DEFUN([gl_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)]) +]) + +# Like AC_LIBSOURCES, except the directory where the source file is +# expected is derived from the gnulib-tool parametrization, +# and alloca is special cased (for the alloca-opt module). +# We could also entirely rely on EXTRA_lib..._SOURCES. +AC_DEFUN([gl_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_syscmd([test -r gnulib/]_gl_NAME[ || test ! -d gnulib])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([missing gnulib/]_gl_NAME)]) + ]) + ]) +]) + +# Like AC_LIBOBJ, except that the module name goes +# into gltests_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gltests_LIBOBJ], [ + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext" +]) + +# m4_foreach_w is provided by autoconf-2.59c and later. +# This definition is to accommodate developers using versions +# of autoconf older than that. +m4_ifndef([m4_foreach_w], + [m4_define([m4_foreach_w], + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])]) -# Like AC_LIBSOURCES, except that it does nothing. -# We rely on EXTRA_lib..._SOURCES instead. -AC_DEFUN([gl_LIBSOURCES], - []) +# Like AC_REPLACE_FUNCS, except that the module name goes +# into gltests_LIBOBJS instead of into LIBOBJS. +AC_DEFUN([gltests_REPLACE_FUNCS], [ + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)]) +]) + +# Like AC_LIBSOURCES, except the directory where the source file is +# expected is derived from the gnulib-tool parametrization, +# and alloca is special cased (for the alloca-opt module). +# We could also entirely rely on EXTRA_lib..._SOURCES. +AC_DEFUN([gltests_LIBSOURCES], [ + m4_foreach([_gl_NAME], [$1], [ + m4_if(_gl_NAME, [alloca.c], [], [ + m4_syscmd([test -r tests/]_gl_NAME[ || test ! -d tests])dnl + m4_if(m4_sysval, [0], [], + [AC_FATAL([missing tests/]_gl_NAME)]) + ]) + ]) +]) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath build-aux/link-warning.h - lib/alloca_.h + lib/alloca.in.h lib/asnprintf.c lib/base64.c lib/base64.h lib/float+.h - lib/float_.h + lib/float.in.h lib/fsusage.c lib/fsusage.h lib/full-read.c @@ -139,6 +218,10 @@ AC_DEFUN([gl_FILE_LIST], [ lib/gai_strerror.c lib/getaddrinfo.c lib/getaddrinfo.h + lib/getopt.c + lib/getopt.in.h + lib/getopt1.c + lib/getopt_int.h lib/gettext.h lib/gettimeofday.c lib/inet_ntop.c @@ -147,7 +230,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/lock.h lib/malloc.c lib/mkdtemp.c - lib/netinet_in_.h + lib/netinet_in.in.h lib/physmem.c lib/physmem.h lib/printf-args.c @@ -160,21 +243,21 @@ AC_DEFUN([gl_FILE_LIST], [ lib/safe-write.h lib/size_max.h lib/snprintf.c - lib/stdbool_.h - lib/stdint_.h - lib/stdio_.h - lib/stdlib_.h + lib/stdbool.in.h + lib/stdint.in.h + lib/stdio.in.h + lib/stdlib.in.h lib/strdup.c - lib/string_.h - lib/sys_socket_.h - lib/sys_stat_.h - lib/sys_time_.h + lib/string.in.h + lib/sys_socket.in.h + lib/sys_stat.in.h + lib/sys_time.in.h lib/tempname.c lib/tempname.h - lib/unistd_.h + lib/unistd.in.h lib/vasnprintf.c lib/vasnprintf.h - lib/wchar_.h + lib/wchar.in.h lib/xsize.h m4/absolute-header.m4 m4/alloca.m4 @@ -185,6 +268,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/float_h.m4 m4/fsusage.m4 m4/getaddrinfo.m4 + m4/getopt.m4 m4/gettimeofday.m4 m4/gnulib-common.m4 m4/include_next.m4 @@ -219,7 +303,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/sys_stat_h.m4 m4/sys_time_h.m4 m4/tempname.m4 - m4/ulonglong.m4 m4/unistd_h.m4 m4/vasnprintf.m4 m4/visibility.m4 diff --git a/config/gnulib/intmax_t.m4 b/config/gnulib/intmax_t.m4 index 17c7b0a..50ae35d 100644 --- a/config/gnulib/intmax_t.m4 +++ b/config/gnulib/intmax_t.m4 @@ -1,5 +1,5 @@ -# intmax_t.m4 serial 5 -dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc. +# intmax_t.m4 serial 6 +dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -18,8 +18,8 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then - AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) - test $ac_cv_type_long_long = yes \ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, @@ -51,8 +51,8 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) else - AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) - test $ac_cv_type_long_long = yes \ + AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) + test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, diff --git a/config/gnulib/lib-link.m4 b/config/gnulib/lib-link.m4 index f157d98..e3d26fc 100644 --- a/config/gnulib/lib-link.m4 +++ b/config/gnulib/lib-link.m4 @@ -1,4 +1,4 @@ -# lib-link.m4 serial 13 (gettext-0.16.2) +# lib-link.m4 serial 13 (gettext-0.17) dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/config/gnulib/lock.m4 b/config/gnulib/lock.m4 index 4cc585e..9111933 100644 --- a/config/gnulib/lock.m4 +++ b/config/gnulib/lock.m4 @@ -1,4 +1,4 @@ -# lock.m4 serial 7 (gettext-0.16.2) +# lock.m4 serial 7 (gettext-0.17) dnl Copyright (C) 2005-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/config/gnulib/longlong.m4 b/config/gnulib/longlong.m4 index 1f9e862..15bf9da 100644 --- a/config/gnulib/longlong.m4 +++ b/config/gnulib/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 10 -dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. +# longlong.m4 serial 13 +dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG_INT if 'long long int' works. -# This fixes a bug in Autoconf 2.60, but can be removed once we -# assume 2.61 everywhere. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. # Note: If the type 'long long int' exists but is only 32 bits large # (as on some very old compilers), HAVE_LONG_LONG_INT will not be @@ -18,20 +18,11 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - typedef int a[((-9223372036854775807LL < 0 - && 0 < 9223372036854775807ll) - ? 1 : -1)]; - int i = 63;]], - [[long long int llmax = 9223372036854775807ll; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll));]])], + [_AC_TYPE_LONG_LONG_SNIPPET], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. dnl If cross compiling, assume the bug isn't important, since dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( + AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[@%:@include @%:@ifndef LLONG_MAX @@ -60,13 +51,56 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], fi ]) -# This macro is obsolescent and should go away soon. -AC_DEFUN([gl_AC_TYPE_LONG_LONG], +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ - AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) - ac_cv_type_long_long=$ac_cv_type_long_long_int - if test $ac_cv_type_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG, 1, - [Define if you have the 'long long' type.]) + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [ac_cv_type_unsigned_long_long_int=yes], + [ac_cv_type_unsigned_long_long_int=no])]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) + +# Expands to a C program that can be used to test for simultaneous support +# of 'long long' and 'unsigned long long'. We don't want to say that +# 'long long' is available if 'unsigned long long' is not, or vice versa, +# because too many programs rely on the symmetry between signed and unsigned +# integer types (excluding 'bool'). +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], +[ + AC_LANG_PROGRAM( + [[/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) diff --git a/config/gnulib/socklen.m4 b/config/gnulib/socklen.m4 index d39a314..b755757 100644 --- a/config/gnulib/socklen.m4 +++ b/config/gnulib/socklen.m4 @@ -1,4 +1,4 @@ -# socklen.m4 serial 5 +# socklen.m4 serial 6 dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,7 +12,7 @@ dnl types for the argument to getsockopt, getpeername, etc. So we dnl have to test to find something that will work. dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find -dnl it there first. That file is included by gnulib's sys_socket_.h, which +dnl it there first. That file is included by gnulib's sys_socket.in.h, which dnl all users of this module should include. Cygwin must not include dnl ws2tcpip.h. AC_DEFUN([gl_TYPE_SOCKLEN_T], diff --git a/config/gnulib/stdint.m4 b/config/gnulib/stdint.m4 index 03bb093..bb6c34f 100644 --- a/config/gnulib/stdint.m4 +++ b/config/gnulib/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 28 +# stdint.m4 serial 29 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -370,7 +370,7 @@ AC_DEFUN([gl_STDINT_INCLUDES], dnl gl_STDINT_TYPE_PROPERTIES dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t -dnl of interest to stdint_.h. +dnl of interest to stdint.in.h. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], [ gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], diff --git a/config/gnulib/stdio_h.m4 b/config/gnulib/stdio_h.m4 index b9a6998..a40d418 100644 --- a/config/gnulib/stdio_h.m4 +++ b/config/gnulib/stdio_h.m4 @@ -1,4 +1,4 @@ -# stdio_h.m4 serial 7 +# stdio_h.m4 serial 9 dnl Copyright (C) 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -28,6 +28,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) @@ -48,6 +50,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO]) REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO]) REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK]) @@ -69,13 +73,12 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET], [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [#if defined __SL64 && defined __SCLE /* cygwin */ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making - fseeko/ftello needlessly fail. This bug was fixed at the same time - that cygwin started exporting asnprintf (cygwin 1.7.0), so we use - that as a link-time test for cross-compiles rather than building - a runtime test. */ - size_t s; - if (asnprintf (NULL, &s, "")) - return 0; + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and + it is easier to do a version check than building a runtime test. */ +# include +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25) + choke me +# endif #endif])], [gl_cv_var_stdin_large_offset=yes], [gl_cv_var_stdin_large_offset=no])]) diff --git a/config/gnulib/stdlib_h.m4 b/config/gnulib/stdlib_h.m4 index ea9286e..fe4ce12 100644 --- a/config/gnulib/stdlib_h.m4 +++ b/config/gnulib/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 3 +# stdlib_h.m4 serial 5 dnl Copyright (C) 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,11 +25,18 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) + GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) + GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) + GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX]) HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP]) HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX]) + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV]) + HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV]) ]) diff --git a/config/gnulib/string_h.m4 b/config/gnulib/string_h.m4 index ec51e9a..766d7e9 100644 --- a/config/gnulib/string_h.m4 +++ b/config/gnulib/string_h.m4 @@ -1,10 +1,12 @@ # Configure a GNU-like replacement for . -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 4 + # Written by Paul Eggert. AC_DEFUN([gl_HEADER_STRING_H], @@ -41,6 +43,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) @@ -57,14 +60,14 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) - HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) - HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) @@ -74,4 +77,11 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) + HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR]) + HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) + REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) + REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) + REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) + REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR]) + REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR]) ]) diff --git a/config/gnulib/ulonglong.m4 b/config/gnulib/ulonglong.m4 deleted file mode 100644 index 9fae98e..0000000 --- a/config/gnulib/ulonglong.m4 +++ /dev/null @@ -1,48 +0,0 @@ -# ulonglong.m4 serial 6 -dnl Copyright (C) 1999-2006 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Paul Eggert. - -# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. -# This fixes a bug in Autoconf 2.60, but can be removed once we -# assume 2.61 everywhere. - -# Note: If the type 'unsigned long long int' exists but is only 32 bits -# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT -# will not be defined. In this case you can treat 'unsigned long long int' -# like 'unsigned long int'. - -AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], -[ - AC_CACHE_CHECK([for unsigned long long int], - [ac_cv_type_unsigned_long_long_int], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[unsigned long long int ull = 18446744073709551615ULL; - typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63;]], - [[unsigned long long int ullmax = 18446744073709551615ull; - return (ull << 63 | ull >> 63 | ull << i | ull >> i - | ullmax / ull | ullmax % ull);]])], - [ac_cv_type_unsigned_long_long_int=yes], - [ac_cv_type_unsigned_long_long_int=no])]) - if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, - [Define to 1 if the system has the type `unsigned long long int'.]) - fi -]) - -# This macro is obsolescent and should go away soon. -AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], -[ - AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT]) - ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int - if test $ac_cv_type_unsigned_long_long = yes; then - AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, - [Define if you have the 'unsigned long long' type.]) - fi -]) diff --git a/config/gnulib/unistd_h.m4 b/config/gnulib/unistd_h.m4 index b12f84e..e8ccab1 100644 --- a/config/gnulib/unistd_h.m4 +++ b/config/gnulib/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 9 -dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. +# unistd_h.m4 serial 11 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -34,10 +34,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) @@ -45,12 +47,17 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) ]) diff --git a/config/gnulib/vasnprintf.m4 b/config/gnulib/vasnprintf.m4 index ef2de78..c4d3f4f 100644 --- a/config/gnulib/vasnprintf.m4 +++ b/config/gnulib/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 20 -dnl Copyright (C) 2002-2004, 2006-2007 Free Software Foundation, Inc. +# vasnprintf.m4 serial 24 +dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -45,7 +45,10 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE], AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) - AC_CHECK_TYPES(ptrdiff_t) + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) ]) @@ -163,6 +166,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], esac ]) +# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], +[ + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + [Define if the vasnprintf implementation needs special code for the + '-' flag.]) + ;; + esac +]) + # Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], [ @@ -178,6 +196,49 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], esac ]) +# Extra prerequisites of lib/vasnprintf.c for supporting large precisions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], +[ + AC_REQUIRE([gl_PRINTF_PRECISION]) + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + [Define if the vasnprintf implementation needs special code for + supporting large precisions without arbitrary bounds.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory +# conditions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], +[ + AC_REQUIRE([gl_PRINTF_ENOMEM]) + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + [Define if the vasnprintf implementation needs special code for + surviving out-of-memory conditions.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + # Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], [ @@ -188,7 +249,10 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], gl_PREREQ_VASNPRINTF_DIRECTIVE_A gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_FLAG_GROUPING + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO + gl_PREREQ_VASNPRINTF_PRECISION + gl_PREREQ_VASNPRINTF_ENOMEM ]) # Prerequisites of lib/asnprintf.c. diff --git a/config/gnulib/wint_t.m4 b/config/gnulib/wint_t.m4 index 2cac1a7..af5ed93 100644 --- a/config/gnulib/wint_t.m4 +++ b/config/gnulib/wint_t.m4 @@ -1,4 +1,4 @@ -# wint_t.m4 serial 2 (gettext-0.16.2) +# wint_t.m4 serial 2 (gettext-0.17) dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/config/macro-archive/ac_perl_module_version.m4 b/config/macro-archive/ac_perl_module_version.m4 new file mode 100644 index 0000000..b2987dc --- /dev/null +++ b/config/macro-archive/ac_perl_module_version.m4 @@ -0,0 +1,85 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ac_perl_module_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AC_PERL_MODULE_VERSION([MODULE VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# Checks to see if the list of 'Module Version' are avaiable in the +# system. If all the modules in the list are avaiable ACTION-IF-TRUE is +# executed. Case one module is not avaiable ACTION-IF-FALSE is executed +# and the macro execution is aborted. NOTE: Perl is needed. +# +# Example: +# +# AC_PERL_MODULE_VERSION(CGI::Test 0.104 CGI::Ajax 0.694, , +# AC_MSG_ERROR(Need some Perl modules)) +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Marco Gomes +# Copyright (c) 2008 Ruben Fonseca +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AC_PERL_MODULE_VERSION],[dnl +ac_perl_list_modules="$1" +# Make sure we have perl +if test -z "$PERL"; then +AC_CHECK_PROG(PERL,perl,perl) +fi + +# Check the number of arguments +args_num=`echo $ac_perl_list_modules | wc -w` +let "ckeck_args = $args_num % 2" +if test "$check_args" = "1" ; then + AC_MSG_ERROR(syntax error) +else + eval +fi + +if test "x$PERL" != x; then + ac_failed=0 + while test ${#ac_perl_list_modules} -gt 2 ; do + module_name=`echo $ac_perl_list_modules | cut -d " " -f 1` + module_version=`echo $ac_perl_list_modules | cut -d " " -f 2` + ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-` + AC_MSG_CHECKING(for perl module $module_name version $module_version) + + $PERL "-M$module_name" -e exit > /dev/null 2>&1 + if test $? -ne 0; then + AC_MSG_RESULT(no); + ac_failed=1 + ac_perl_list_modules="" + else + version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1` + $PERL -e 'exit(shift cmp shift)' "$version" "$module_version" + if test $? -eq 0 -o $? -eq 1 ; then + AC_MSG_RESULT(ok); + else + AC_MSG_RESULT(no) + ac_failed=1 + ac_perl_list_modules="" + fi + fi; + done + + if test "$ac_failed" = 0; then + : + $2 + else + : + $3 + fi +else + AC_MSG_ERROR(could not find perl) +fi])dnl diff --git a/config/macro-archive/docbook-dtd.m4 b/config/macro-archive/docbook-dtd.m4 index 935b169..f29c94e 100644 --- a/config/macro-archive/docbook-dtd.m4 +++ b/config/macro-archive/docbook-dtd.m4 @@ -32,7 +32,7 @@ # # COPYRIGHT # -# Copyright (c) 2007 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -53,8 +53,8 @@ # may extend this special exception to the GPL to apply to your # modified version as well. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_DTD], [ diff --git a/config/macro-archive/docbook-xslt-min.m4 b/config/macro-archive/docbook-xslt-min.m4 index e92c848..86e1337 100644 --- a/config/macro-archive/docbook-xslt-min.m4 +++ b/config/macro-archive/docbook-xslt-min.m4 @@ -27,7 +27,7 @@ # # COPYRIGHT # -# Copyright (c) 2007 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -48,8 +48,8 @@ # may extend this special exception to the GPL to apply to your # modified version as well. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_XSLT_MIN], [ diff --git a/config/macro-archive/docbook-xslt.m4 b/config/macro-archive/docbook-xslt.m4 index ab4b6ce..d163f98 100644 --- a/config/macro-archive/docbook-xslt.m4 +++ b/config/macro-archive/docbook-xslt.m4 @@ -32,7 +32,7 @@ # # COPYRIGHT # -# Copyright (c) 2007 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -53,8 +53,8 @@ # may extend this special exception to the GPL to apply to your # modified version as well. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_CHECK_DOCBOOK_XSLT], [ diff --git a/config/macro-archive/file-list b/config/macro-archive/file-list index 7773a1d..f1e2010 100644 --- a/config/macro-archive/file-list +++ b/config/macro-archive/file-list @@ -1,5 +1,6 @@ ## this file is automatically generated by autogen EXTRA_DIST += macro-archive/ac_define_dir.m4 +EXTRA_DIST += macro-archive/ac_perl_module_version.m4 EXTRA_DIST += macro-archive/ac_prog_perl_version.m4 EXTRA_DIST += macro-archive/ac_prog_swig.m4 EXTRA_DIST += macro-archive/ax_compare_version.m4 diff --git a/config/macro-archive/xsltproc.m4 b/config/macro-archive/xsltproc.m4 index b782967..799635c 100644 --- a/config/macro-archive/xsltproc.m4 +++ b/config/macro-archive/xsltproc.m4 @@ -27,7 +27,7 @@ # # COPYRIGHT # -# Copyright (c) 2007 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -48,8 +48,8 @@ # may extend this special exception to the GPL to apply to your # modified version as well. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com AC_DEFUN([AC_PROG_XSLTPROC], [ diff --git a/configure b/configure index 49ddd55..4194c65 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61. +# Generated by GNU Autoconf 2.63. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -15,7 +15,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -37,17 +37,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -63,8 +91,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -87,7 +113,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -100,17 +126,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -132,7 +151,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -158,7 +177,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -240,7 +259,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -261,7 +280,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -341,10 +360,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -413,9 +432,10 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -451,7 +471,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -479,7 +499,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -492,19 +511,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -529,10 +551,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -769,499 +791,658 @@ ac_includes_default="\ gl_header_list= gl_func_list= -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -PACKAGE -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -SNAPSHOT_STAMP -VERSION_MAJOR -VERSION_MINOR -VERSION_PATCH -VERSION_COMMENT -VERSION_SUFFIX -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -RANLIB -CPP -GREP -EGREP -GL_COND_LIBTOOL_TRUE -GL_COND_LIBTOOL_FALSE -ALLOCA -ALLOCA_H -ARPA_INET_H -INCLUDE_NEXT -NEXT_FLOAT_H -FLOAT_H -NEXT_SYS_SOCKET_H -HAVE_SYS_SOCKET_H -HAVE_WINSOCK2_H -HAVE_WS2TCPIP_H -SYS_SOCKET_H -LIBINTL -LTLIBINTL -NEXT_SYS_TIME_H -HAVE_SYS_TIME_H -HAVE_STRUCT_TIMEVAL -REPLACE_GETTIMEOFDAY -SYS_TIME_H -LIBPTH -LTLIBPTH -LIBTHREAD -LTLIBTHREAD -LIBMULTITHREAD -LTLIBMULTITHREAD -HAVE_MALLOC_POSIX -GNULIB_MALLOC_POSIX -GNULIB_REALLOC_POSIX -GNULIB_CALLOC_POSIX -GNULIB_GETSUBOPT -GNULIB_MKDTEMP -GNULIB_MKSTEMP -HAVE_CALLOC_POSIX -HAVE_GETSUBOPT -HAVE_MKDTEMP -HAVE_REALLOC_POSIX -REPLACE_MKSTEMP -NEXT_NETINET_IN_H -HAVE_NETINET_IN_H -NETINET_IN_H -GNULIB_FPRINTF_POSIX -GNULIB_PRINTF_POSIX -GNULIB_SNPRINTF -GNULIB_SPRINTF_POSIX -GNULIB_VFPRINTF_POSIX -GNULIB_VPRINTF_POSIX -GNULIB_VSNPRINTF -GNULIB_VSPRINTF_POSIX -GNULIB_VASPRINTF -GNULIB_FSEEK -GNULIB_FSEEKO -GNULIB_FTELL -GNULIB_FTELLO -GNULIB_FFLUSH -GNULIB_GETDELIM -GNULIB_GETLINE -REPLACE_FPRINTF -REPLACE_VFPRINTF -REPLACE_PRINTF -REPLACE_VPRINTF -REPLACE_SNPRINTF -HAVE_DECL_SNPRINTF -REPLACE_VSNPRINTF -HAVE_DECL_VSNPRINTF -REPLACE_SPRINTF -REPLACE_VSPRINTF -HAVE_VASPRINTF -REPLACE_VASPRINTF -HAVE_FSEEKO -REPLACE_FSEEKO -REPLACE_FSEEK -HAVE_FTELLO -REPLACE_FTELLO -REPLACE_FTELL -REPLACE_FFLUSH -HAVE_DECL_GETDELIM -HAVE_DECL_GETLINE -REPLACE_GETLINE -STDBOOL_H -HAVE__BOOL -HAVE_LONG_LONG_INT -HAVE_UNSIGNED_LONG_LONG_INT -HAVE_INTTYPES_H -HAVE_SYS_TYPES_H -NEXT_STDINT_H -HAVE_STDINT_H -HAVE_SYS_INTTYPES_H -HAVE_SYS_BITYPES_H -BITSIZEOF_PTRDIFF_T -BITSIZEOF_SIG_ATOMIC_T -BITSIZEOF_SIZE_T -BITSIZEOF_WCHAR_T -BITSIZEOF_WINT_T -HAVE_SIGNED_SIG_ATOMIC_T -HAVE_SIGNED_WCHAR_T -HAVE_SIGNED_WINT_T -PTRDIFF_T_SUFFIX -SIG_ATOMIC_T_SUFFIX -SIZE_T_SUFFIX -WCHAR_T_SUFFIX -WINT_T_SUFFIX -STDINT_H -NEXT_STDIO_H -NEXT_STDLIB_H -GNULIB_MEMMEM -GNULIB_MEMPCPY -GNULIB_MEMRCHR -GNULIB_STPCPY -GNULIB_STPNCPY -GNULIB_STRCHRNUL -GNULIB_STRDUP -GNULIB_STRNDUP -GNULIB_STRNLEN -GNULIB_STRPBRK -GNULIB_STRSEP -GNULIB_STRCASESTR -GNULIB_STRTOK_R -GNULIB_MBSLEN -GNULIB_MBSNLEN -GNULIB_MBSCHR -GNULIB_MBSRCHR -GNULIB_MBSSTR -GNULIB_MBSCASECMP -GNULIB_MBSNCASECMP -GNULIB_MBSPCASECMP -GNULIB_MBSCASESTR -GNULIB_MBSCSPN -GNULIB_MBSPBRK -GNULIB_MBSSPN -GNULIB_MBSSEP -GNULIB_MBSTOK_R -HAVE_DECL_MEMMEM -HAVE_MEMPCPY -HAVE_DECL_MEMRCHR -HAVE_STPCPY -HAVE_STPNCPY -HAVE_STRCASECMP -HAVE_DECL_STRNCASECMP -HAVE_STRCHRNUL -HAVE_DECL_STRDUP -HAVE_STRNDUP -HAVE_DECL_STRNDUP -HAVE_DECL_STRNLEN -HAVE_STRPBRK -HAVE_STRSEP -HAVE_STRCASESTR -HAVE_DECL_STRTOK_R -NEXT_STRING_H -HAVE_LSTAT -HAVE_DECL_MKDIR -HAVE_IO_H -NEXT_SYS_STAT_H -SYS_STAT_H -GNULIB_CHOWN -GNULIB_DUP2 -GNULIB_FCHDIR -GNULIB_FTRUNCATE -GNULIB_GETCWD -GNULIB_GETLOGIN_R -GNULIB_LCHOWN -GNULIB_LSEEK -GNULIB_READLINK -GNULIB_SLEEP -HAVE_DUP2 -HAVE_FTRUNCATE -HAVE_READLINK -HAVE_SLEEP -HAVE_DECL_GETLOGIN_R -REPLACE_CHOWN -REPLACE_FCHDIR -REPLACE_GETCWD -REPLACE_LCHOWN -REPLACE_LSEEK -NEXT_UNISTD_H -HAVE_UNISTD_H -EOVERFLOW -CFLAG_VISIBILITY -HAVE_VISIBILITY -GNULIB_WCWIDTH -HAVE_DECL_WCWIDTH -REPLACE_WCWIDTH -WCHAR_H -HAVE_WCHAR_H -NEXT_WCHAR_H -AMANDA_WARNING_CFLAGS -CLIENT_LOGIN -SETUID_GROUP -CONFIG_DIR -USE_VERSION_SUFFIXES -GNUTAR_LISTED_INCREMENTAL_DIR -AMANDA_TMPDIR -BINARY_OWNER -MAXTAPEBLOCKSIZE -AMANDA_DBGDIR -AMANDA_DEBUG_DAYS -SERVICE_SUFFIX -WANT_SETUID_CLIENT_TRUE -WANT_SETUID_CLIENT_FALSE -WANT_INSTALLPERMS_TRUE -WANT_INSTALLPERMS_FALSE -WANT_CLIENT_TRUE -WANT_CLIENT_FALSE -WANT_RESTORE_TRUE -WANT_RESTORE_FALSE -WANT_SERVER_TRUE -WANT_SERVER_FALSE -WANT_RECOVER_TRUE -WANT_RECOVER_FALSE -WANT_TAPE_TRUE -WANT_TAPE_FALSE -GNUPLOT -PCAT -COMPRESS -GZIP -AMPLOT_COMPRESS -AMPLOT_CAT_GZIP -AMPLOT_CAT_COMPRESS -AMPLOT_CAT_PACK -WANT_AMPLOT_TRUE -WANT_AMPLOT_FALSE -XSLTPROC_FLAGS -XSLTPROC -ENABLE_MANPAGE_BUILD_TRUE -ENABLE_MANPAGE_BUILD_FALSE -XSLREL -DOC_BUILD_DATE -DEFAULT_SERVER -DEFAULT_CONFIG -DEFAULT_TAPE_SERVER -DEFAULT_TAPE_DEVICE -EXAMPLE_TAPEDEV -DEFAULT_CHANGER_DEVICE -DEFAULT_AMANDATES_FILE -GETCONF -CHIO -CHS -MTX -MCUTIL -WANT_CHG_SCSI_TRUE -WANT_CHG_SCSI_FALSE -WANT_SCSI_LINUX_TRUE -WANT_SCSI_LINUX_FALSE -WANT_SCSI_HPUX_NEW_TRUE -WANT_SCSI_HPUX_NEW_FALSE -WANT_SCSI_IRIX_TRUE -WANT_SCSI_IRIX_FALSE -WANT_SCSI_SOLARIS_TRUE -WANT_SCSI_SOLARIS_FALSE -WANT_SCSI_AIX_TRUE -WANT_SCSI_AIX_FALSE -WANT_SCSI_CAM_TRUE -WANT_SCSI_CAM_FALSE -WANT_SCSI_BSD_TRUE -WANT_SCSI_BSD_FALSE -WANT_CHG_SCSI_CHIO_TRUE -WANT_CHG_SCSI_CHIO_FALSE -WANT_SCSI_HPUX_TRUE -WANT_SCSI_HPUX_FALSE -WANT_SCSI_CHIO_TRUE -WANT_SCSI_CHIO_FALSE -WANT_AMFLOCK_POSIX_TRUE -WANT_AMFLOCK_POSIX_FALSE -WANT_AMFLOCK_FLOCK_TRUE -WANT_AMFLOCK_FLOCK_FALSE -WANT_AMFLOCK_LOCKF_TRUE -WANT_AMFLOCK_LOCKF_FALSE -WANT_AMFLOCK_LNLOCK_TRUE -WANT_AMFLOCK_LNLOCK_FALSE -SWIG -SWIG_LIB -PERL -PERL_INC -WANT_CYGWIN_COPY_PERL_DLL_TRUE -WANT_CYGWIN_COPY_PERL_DLL_FALSE -PERLEXTLIBS -CAT -CLIENT_SCRIPTS_OPT -amlibdir -amlibexecdir -amincludedir -amperldir -DUMPER_DIR -MSGFMT -GETTEXT -USE_NLS -GMSGFMT -MSGFMT_015 -GMSGFMT_015 -XGETTEXT -XGETTEXT_015 -MSGMERGE -INTL_MACOSX_LIBS -LIBICONV -LTLIBICONV -INTLLIBS -POSUB -CURL_CONFIG -_libcurl_config -LIBCURL_CPPFLAGS -LIBCURL -WANT_S3_DEVICE_TRUE -WANT_S3_DEVICE_FALSE -WANT_DEVPAY_TRUE -WANT_DEVPAY_FALSE -WANT_TAPE_XENIX_TRUE -WANT_TAPE_XENIX_FALSE -WANT_TAPE_AIX_TRUE -WANT_TAPE_AIX_FALSE -WANT_TAPE_UWARE_TRUE -WANT_TAPE_UWARE_FALSE -WANT_TAPE_POSIX_TRUE -WANT_TAPE_POSIX_FALSE -WANT_TAPE_DEVICE_TRUE -WANT_TAPE_DEVICE_FALSE -WANT_BSD_SECURITY_TRUE -WANT_BSD_SECURITY_FALSE -WANT_BSDTCP_SECURITY_TRUE -WANT_BSDTCP_SECURITY_FALSE -WANT_BSDUDP_SECURITY_TRUE -WANT_BSDUDP_SECURITY_FALSE -WANT_RSH_SECURITY_TRUE -WANT_RSH_SECURITY_FALSE -SSH -WANT_SSH_SECURITY_TRUE -WANT_SSH_SECURITY_FALSE -WANT_KRB4_SECURITY_TRUE -WANT_KRB4_SECURITY_FALSE -WANT_KRB5_SECURITY_TRUE -WANT_KRB5_SECURITY_FALSE -XFSDUMP -XFSRESTORE -VXDUMP -VXRESTORE -VDUMP -VRESTORE -DUMP -RESTORE -GNUTAR -SAMBA_CLIENT -WANT_SAMBA_TRUE -WANT_SAMBA_FALSE -AMLINT -AMLINTFLAGS -LEX -LEX_OUTPUT_ROOT -LEXLIB -AR -YACC -YFLAGS -DD -BASH -SORT -MAILER -MT -MT_FILE_FLAG -PRINT -GCC_COMPILER_TRUE -GCC_COMPILER_FALSE -LN_S -ECHO -CXX -CXXFLAGS -ac_ct_CXX -CXXDEPMODE -am__fastdepCXX_TRUE -am__fastdepCXX_FALSE -CXXCPP -F77 -FFLAGS -ac_ct_F77 -LIBTOOL -LIBTOOL_DEPS -AMANDA_STATIC_LDFLAGS -PKG_CONFIG -GLIB_CFLAGS -GLIB_LIBS -GLIB_GENMARSHAL -GOBJECT_QUERY -GLIB_MKENUMS -READLINE_LIBS -LIBOBJS -LTLIBOBJS -gl_LIBOBJS +ac_subst_vars='SVN +gltests_LTLIBOBJS +gltests_LIBOBJS gl_LTLIBOBJS -SVN' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP +gl_LIBOBJS +LTLIBOBJS +LIBOBJS +READLINE_LIBS +GLIB_MKENUMS +GOBJECT_QUERY +GLIB_GENMARSHAL +GLIB_LIBS +GLIB_CFLAGS +PKG_CONFIG +AMANDA_STATIC_LDFLAGS +LIBTOOL_DEPS +LIBTOOL +ac_ct_F77 +FFLAGS +F77 +CXXCPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +ECHO +LN_S +GCC_COMPILER_FALSE +GCC_COMPILER_TRUE +PS_ARGUMENT +PS +PRINT +MT_FILE_FLAG +MT +DEFAULT_MAILER +MAILER +SORT +BASH +DD +YFLAGS +YACC +AR +LEXLIB +LEX_OUTPUT_ROOT +LEX +AMLINTFLAGS +AMLINT +USE_RUNDUMP +WANT_SAMBA_FALSE +WANT_SAMBA_TRUE +SAMBA_CLIENT +GNUTAR +DUMP_RETURNS_1 +AIX_BACKUP +RESTORE +DUMP +VRESTORE +VDUMP +VXRESTORE +VXDUMP +XFSRESTORE +XFSDUMP +KRB5_SECURITY +WANT_KRB5_SECURITY_FALSE +WANT_KRB5_SECURITY_TRUE +TICKET_LIFETIME +CLIENT_HOST_KEY_FILE +CLIENT_HOST_INSTANCE +CLIENT_HOST_PRINCIPAL +SERVER_HOST_KEY_FILE +SERVER_HOST_INSTANCE +SERVER_HOST_PRINCIPAL +KRB4_SECURITY +WANT_KRB4_SECURITY_FALSE +WANT_KRB4_SECURITY_TRUE +SSH_SECURITY +WANT_SSH_SECURITY_FALSE +WANT_SSH_SECURITY_TRUE +SSH +RSH_SECURITY +WANT_RSH_SECURITY_FALSE +WANT_RSH_SECURITY_TRUE +BSDUDP_SECURITY +WANT_BSDUDP_SECURITY_FALSE +WANT_BSDUDP_SECURITY_TRUE +BSDTCP_SECURITY +WANT_BSDTCP_SECURITY_FALSE +WANT_BSDTCP_SECURITY_TRUE +USE_AMANDAHOSTS +BSD_SECURITY +WANT_BSD_SECURITY_FALSE +WANT_BSD_SECURITY_TRUE +WANT_TAPE_DEVICE_FALSE +WANT_TAPE_DEVICE_TRUE +WANT_TAPE_POSIX_FALSE +WANT_TAPE_POSIX_TRUE +WANT_TAPE_UWARE_FALSE +WANT_TAPE_UWARE_TRUE +WANT_TAPE_AIX_FALSE +WANT_TAPE_AIX_TRUE +WANT_TAPE_XENIX_FALSE +WANT_TAPE_XENIX_TRUE +WANT_S3_DEVICE_FALSE +WANT_S3_DEVICE_TRUE +LIBCURL +LIBCURL_CPPFLAGS +_libcurl_config +CURL_CONFIG +POSUB +INTLLIBS +LTLIBICONV +LIBICONV +INTL_MACOSX_LIBS +MSGMERGE +XGETTEXT_015 +XGETTEXT +GMSGFMT_015 +MSGFMT_015 +GMSGFMT +USE_NLS +GETTEXT +MSGFMT +amdatadir +APPLICATION_DIR +amperldir +amincludedir +amlibexecdir +amlibdir +CLIENT_SCRIPTS_OPT +HAVE_GZIP +UNCOMPRESS_OPT +UNCOMPRESS_PATH +COMPRESS_BEST_OPT +COMPRESS_FAST_OPT +COMPRESS_SUFFIX +COMPRESS_PATH +CAT +PERLEXTLIBS +WANT_CYGWIN_COPY_PERL_DLL_FALSE +WANT_CYGWIN_COPY_PERL_DLL_TRUE +PERL_INC +PERL +SWIG_LIB +SWIG +LOCKING +WANT_AMFLOCK_LNLOCK_FALSE +WANT_AMFLOCK_LNLOCK_TRUE +WANT_AMFLOCK_LOCKF_FALSE +WANT_AMFLOCK_LOCKF_TRUE +WANT_AMFLOCK_FLOCK_FALSE +WANT_AMFLOCK_FLOCK_TRUE +WANT_AMFLOCK_POSIX_FALSE +WANT_AMFLOCK_POSIX_TRUE +WANT_SCSI_CHIO_FALSE +WANT_SCSI_CHIO_TRUE +WANT_SCSI_HPUX_FALSE +WANT_SCSI_HPUX_TRUE +WANT_CHG_SCSI_CHIO_FALSE +WANT_CHG_SCSI_CHIO_TRUE +WANT_SCSI_BSD_FALSE +WANT_SCSI_BSD_TRUE +WANT_SCSI_CAM_FALSE +WANT_SCSI_CAM_TRUE +WANT_SCSI_AIX_FALSE +WANT_SCSI_AIX_TRUE +WANT_SCSI_SOLARIS_FALSE +WANT_SCSI_SOLARIS_TRUE +WANT_SCSI_IRIX_FALSE +WANT_SCSI_IRIX_TRUE +WANT_SCSI_HPUX_NEW_FALSE +WANT_SCSI_HPUX_NEW_TRUE +WANT_SCSI_LINUX_FALSE +WANT_SCSI_LINUX_TRUE +WANT_CHG_SCSI_FALSE +WANT_CHG_SCSI_TRUE +MCUTIL +MTX +CHS +CHIO +GETCONF +DEFAULT_AMANDATES_FILE +DEFAULT_CHANGER_DEVICE +EXAMPLE_TAPEDEV +DEFAULT_TAPE_DEVICE +DEFAULT_TAPE_SERVER +DEFAULT_CONFIG +DEFAULT_SERVER +CONFIG_CLOBBER_MY_CONFIG +DOC_BUILD_DATE +XSLREL +ENABLE_MANPAGE_BUILD_FALSE +ENABLE_MANPAGE_BUILD_TRUE +XSLTPROC +XSLTPROC_FLAGS +WANT_AMPLOT_FALSE +WANT_AMPLOT_TRUE +AMPLOT_CAT_PACK +AMPLOT_CAT_COMPRESS +AMPLOT_CAT_GZIP +AMPLOT_COMPRESS +GZIP +COMPRESS +PCAT +GNUPLOT +WANT_TAPE_FALSE +WANT_TAPE_TRUE +WANT_RECOVER_FALSE +WANT_RECOVER_TRUE +WANT_SERVER_FALSE +WANT_SERVER_TRUE +WANT_RESTORE_FALSE +WANT_RESTORE_TRUE +WANT_CLIENT_FALSE +WANT_CLIENT_TRUE +WANT_INSTALLPERMS_FALSE +WANT_INSTALLPERMS_TRUE +WANT_SETUID_CLIENT_FALSE +WANT_SETUID_CLIENT_TRUE +SERVICE_SUFFIX +AMANDA_DEBUG_DAYS +AMANDA_DBGDIR +ASSERTIONS +LOW_TCPPORTRANGE +TCPPORTRANGE +UDPPORTRANGE +BINARY_OWNER +CHECK_USERID +AMANDA_TMPDIR +GNUTAR_LISTED_INCREMENTAL_DIR +USE_VERSION_SUFFIXES +CONFIG_DIR +SETUID_GROUP +CLIENT_LOGIN +AMANDA_WARNING_CFLAGS +NEXT_WCHAR_H +HAVE_WCHAR_H +WCHAR_H +REPLACE_WCWIDTH +HAVE_DECL_WCWIDTH +GNULIB_WCWIDTH +HAVE_VISIBILITY +CFLAG_VISIBILITY +EOVERFLOW +HAVE_UNISTD_H +NEXT_UNISTD_H +REPLACE_LSEEK +REPLACE_LCHOWN +REPLACE_GETPAGESIZE +REPLACE_GETCWD +REPLACE_FCHDIR +REPLACE_CHOWN +HAVE_SYS_PARAM_H +HAVE_OS_H +HAVE_DECL_GETLOGIN_R +HAVE_DECL_ENVIRON +HAVE_SLEEP +HAVE_READLINK +HAVE_GETPAGESIZE +HAVE_FTRUNCATE +HAVE_DUP2 +GNULIB_SLEEP +GNULIB_READLINK +GNULIB_LSEEK +GNULIB_LCHOWN +GNULIB_GETPAGESIZE +GNULIB_GETLOGIN_R +GNULIB_GETCWD +GNULIB_FTRUNCATE +GNULIB_FCHDIR +GNULIB_ENVIRON +GNULIB_DUP2 +GNULIB_CHOWN +SYS_STAT_H +NEXT_SYS_STAT_H +HAVE_IO_H +HAVE_DECL_MKDIR +HAVE_LSTAT +NEXT_STRING_H +REPLACE_STRSTR +REPLACE_STRCASESTR +REPLACE_MEMMEM +REPLACE_STRSIGNAL +REPLACE_STRERROR +HAVE_DECL_STRSIGNAL +HAVE_DECL_STRERROR +HAVE_DECL_STRTOK_R +HAVE_STRCASESTR +HAVE_STRSEP +HAVE_STRPBRK +HAVE_DECL_STRNLEN +HAVE_DECL_STRNDUP +HAVE_STRNDUP +HAVE_DECL_STRDUP +HAVE_STRCHRNUL +HAVE_STPNCPY +HAVE_STPCPY +HAVE_DECL_MEMRCHR +HAVE_MEMPCPY +HAVE_DECL_MEMMEM +GNULIB_STRSIGNAL +GNULIB_STRERROR +GNULIB_MBSTOK_R +GNULIB_MBSSEP +GNULIB_MBSSPN +GNULIB_MBSPBRK +GNULIB_MBSCSPN +GNULIB_MBSCASESTR +GNULIB_MBSPCASECMP +GNULIB_MBSNCASECMP +GNULIB_MBSCASECMP +GNULIB_MBSSTR +GNULIB_MBSRCHR +GNULIB_MBSCHR +GNULIB_MBSNLEN +GNULIB_MBSLEN +GNULIB_STRTOK_R +GNULIB_STRCASESTR +GNULIB_STRSTR +GNULIB_STRSEP +GNULIB_STRPBRK +GNULIB_STRNLEN +GNULIB_STRNDUP +GNULIB_STRDUP +GNULIB_STRCHRNUL +GNULIB_STPNCPY +GNULIB_STPCPY +GNULIB_MEMRCHR +GNULIB_MEMPCPY +GNULIB_MEMMEM +NEXT_STDLIB_H +NEXT_STDIO_H +STDINT_H +WINT_T_SUFFIX +WCHAR_T_SUFFIX +SIZE_T_SUFFIX +SIG_ATOMIC_T_SUFFIX +PTRDIFF_T_SUFFIX +HAVE_SIGNED_WINT_T +HAVE_SIGNED_WCHAR_T +HAVE_SIGNED_SIG_ATOMIC_T +BITSIZEOF_WINT_T +BITSIZEOF_WCHAR_T +BITSIZEOF_SIZE_T +BITSIZEOF_SIG_ATOMIC_T +BITSIZEOF_PTRDIFF_T +HAVE_SYS_BITYPES_H +HAVE_SYS_INTTYPES_H +HAVE_STDINT_H +NEXT_STDINT_H +HAVE_SYS_TYPES_H +HAVE_INTTYPES_H +HAVE_UNSIGNED_LONG_LONG_INT +HAVE_LONG_LONG_INT +HAVE__BOOL +STDBOOL_H +REPLACE_GETLINE +HAVE_DECL_GETLINE +HAVE_DECL_GETDELIM +REPLACE_FFLUSH +REPLACE_FTELL +REPLACE_FTELLO +HAVE_FTELLO +REPLACE_FSEEK +REPLACE_FSEEKO +HAVE_FSEEKO +REPLACE_FREOPEN +REPLACE_FOPEN +REPLACE_VASPRINTF +HAVE_VASPRINTF +REPLACE_VSPRINTF +REPLACE_SPRINTF +HAVE_DECL_VSNPRINTF +REPLACE_VSNPRINTF +HAVE_DECL_SNPRINTF +REPLACE_SNPRINTF +REPLACE_VPRINTF +REPLACE_PRINTF +REPLACE_VFPRINTF +REPLACE_FPRINTF +GNULIB_GETLINE +GNULIB_GETDELIM +GNULIB_FFLUSH +GNULIB_FTELLO +GNULIB_FTELL +GNULIB_FSEEKO +GNULIB_FSEEK +GNULIB_FREOPEN +GNULIB_FOPEN +GNULIB_VASPRINTF +GNULIB_VSPRINTF_POSIX +GNULIB_VSNPRINTF +GNULIB_VPRINTF_POSIX +GNULIB_VFPRINTF_POSIX +GNULIB_SPRINTF_POSIX +GNULIB_SNPRINTF +GNULIB_PRINTF_POSIX +GNULIB_FPRINTF_POSIX +NETINET_IN_H +HAVE_NETINET_IN_H +NEXT_NETINET_IN_H +VOID_UNSETENV +REPLACE_PUTENV +REPLACE_MKSTEMP +HAVE_UNSETENV +HAVE_SETENV +HAVE_REALLOC_POSIX +HAVE_MKDTEMP +HAVE_GETSUBOPT +HAVE_CALLOC_POSIX +GNULIB_UNSETENV +GNULIB_SETENV +GNULIB_PUTENV +GNULIB_MKSTEMP +GNULIB_MKDTEMP +GNULIB_GETSUBOPT +GNULIB_CALLOC_POSIX +GNULIB_REALLOC_POSIX +GNULIB_MALLOC_POSIX +HAVE_MALLOC_POSIX +LTLIBMULTITHREAD +LIBMULTITHREAD +LTLIBTHREAD +LIBTHREAD +LTLIBPTH +LIBPTH +SYS_TIME_H +REPLACE_GETTIMEOFDAY +HAVE_STRUCT_TIMEVAL +HAVE_SYS_TIME_H +NEXT_SYS_TIME_H +LTLIBINTL +LIBINTL +GETOPT_H +SYS_SOCKET_H +HAVE_WS2TCPIP_H +HAVE_WINSOCK2_H +HAVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +FLOAT_H +NEXT_FLOAT_H +INCLUDE_NEXT +ARPA_INET_H +ALLOCA_H +ALLOCA +GL_COND_LIBTOOL_FALSE +GL_COND_LIBTOOL_TRUE +EGREP +GREP +CPP +RANLIB +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +VERSION_SUFFIX +VERSION_COMMENT +VERSION_PATCH +VERSION_MINOR +VERSION_MAJOR +SNAPSHOT_STAMP +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +PACKAGE +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_threads +with_gnu_ld +enable_rpath +with_libpth_prefix +enable_largefile +with_cflags +with_includes +with_libraries +with_user +with_group +with_dumperdir +with_configdir +with_indexdir +with_dbdir +with_logdir +with_suffixes +with_gnutar_listdir +with_gnutar_listed_incremental +with_tmpdir +with_force_uid +with_owner +with_fqdn +with_reuseports +with_low_tcpportrange +with_tcpportrange +with_udpportrange +with_buffered_dump +with_maxtapeblocksize +with_assertions +with_debugging +with_debug_days +with_testing +with_single_userid +enable_installperms +with_server +with_client +with_restore +with_amrecover +with_client_only +with_server_only +with_gnuplot +enable_manpage_build +with_xsltproc +with_xsltproc_flags +with_index_server +with_config +with_tape_server +with_tape_device +with_changer_device +with_amandates +with_perlextlibs +with_ipv6 +with_mmap +with_amlibdir +with_amlibexecdir +with_amperldir +with_amdatadir +enable_nls +with_libiconv_prefix +with_libintl_prefix +with_libcurl +enable_s3_device +with_bsd_security +with_amandahosts +with_bsdtcp_security +with_bsdudp_security +with_rsh_security +with_ssh_security +with_ssh_options +with_krb4_security +with_server_principal +with_server_instance +with_server_keyfile +with_client_principal +with_client_instance +with_client_keyfile +with_ticket_lifetime +with_krb5_security +with_dump_honor_nodump +with_gnutar +with_smbclient +with_samba_user +with_rundump +enable_shared +enable_static +enable_fast_install +enable_libtool_lock +with_pic +with_tags +enable_static_binary +enable_glibtest +with_readline +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP GNUPLOT SWIG PERL @@ -1280,6 +1461,8 @@ PKG_CONFIG' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -1378,13 +1561,21 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -1397,13 +1588,21 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1594,22 +1793,38 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1629,7 +1844,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1638,16 +1853,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1656,22 +1871,38 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1686,7 +1917,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1702,10 +1933,10 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1713,12 +1944,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1745,12 +1976,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1799,9 +2030,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1811,25 +2042,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1851,6 +2082,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build @@ -1866,7 +2098,6 @@ Optional Features: manpages are usually sufficient) --disable-nls do not use Native Language Support --disable-s3-device disable the S3 device - --enable-devpay Use devpay authentication for Amazon S3 driver --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1890,8 +2121,7 @@ Optional Packages: --with-user=USER force execution to USER on client systems (REQUIRED) --with-group=GROUP group allowed to execute setuid-root programs (REQUIRED) - --with-dumperdir=DIR where we install the dumpers (default: - exec_prefix/dumper) + --with-dumperdir=DIR where we install the dumpers (deprecated) --with-configdir=DIR runtime config files in DIR [sysconfdir/amanda] --with-indexdir deprecated: use indexdir in amanda.conf --with-dbdir deprecated: use infofile in amanda.conf @@ -1921,8 +2151,7 @@ Optional Packages: bind reserved UDP server sockets to ports within this range (default: unlimited) --with-buffered-dump buffer the dumping sockets on the server for speed - --with-maxtapeblocksize=kb - Maximum size of a tape block (default: 32) +(deprecated) --with-assertions compile assertions into code --with-debugging=DIR put debug logs in DIR (default same as --with-tmpdir) @@ -1940,7 +2169,7 @@ Optional Packages: --with-client-only deprecated: use --without-server --with-server-only deprecated: use --without-client --with-gnuplot=PATH use gnuplot executable at PATH in amplot - --with-xsltproc[=PATH] + --with-xsltproc[[[=PATH]]] Use the xsltproc binary in in PATH. --with-xsltproc-flags=FLAGS Flags to pass to xsltproc (default --nonet) @@ -1959,17 +2188,20 @@ Optional Packages: --with-ipv6 enable IPv6 support (default if IPv6 is found) --without-ipv6 disable IPv6 --with-mmap force use of mmap instead of shared memory support - --with-amlibdir[=PATH] + --with-amlibdir[[[=PATH]]] Where library are installed, default: $libdir/amanda --without-amlibdir Library are installed in $libdir - --with-amlibexecdir[=PATH] + --with-amlibexecdir[[[=PATH]]] Where amanda own programs are installed, default: $libexecdir/amanda --without-amlibexecdir Amanda own programs are installed in $libexecdir - --with-amperldir[=PATH] + --with-amperldir[[[=PATH]]] Where amanda's perl modules are installed; default: installsitelib --without-amperldir Install amanda's perl modules in $amlibdir/perl + --with-amdatadir[[[=PATH]]] + Where amanda's templates and examples are installed; + default: $datadir/amanda --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib @@ -2051,15 +2283,17 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -2095,7 +2329,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -2105,10 +2339,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -2119,7 +2353,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2155,7 +2389,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -2190,7 +2424,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -2242,11 +2476,12 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -2276,9 +2511,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -2293,9 +2528,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -2311,8 +2546,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2354,21 +2589,24 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -2378,16 +2616,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -2420,29 +2658,38 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2452,10 +2699,12 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -2500,8 +2749,8 @@ for ac_dir in config "$srcdir"/config; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} { (exit 1); exit 1; }; } fi @@ -2516,34 +2765,34 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -2560,27 +2809,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -2597,27 +2846,27 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -2659,11 +2908,12 @@ am__api_version='1.10' # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2692,17 +2942,29 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2715,8 +2977,8 @@ fi INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2726,8 +2988,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -2750,9 +3012,9 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi @@ -2763,26 +3025,23 @@ then # Ok. : else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! +$as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -2793,15 +3052,15 @@ if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -2836,8 +3095,8 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in @@ -2849,10 +3108,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2865,7 +3124,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2876,22 +3135,23 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2908,12 +3168,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2932,8 +3192,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi @@ -2950,7 +3210,7 @@ fi # Define the identity of the package. PACKAGE=amanda - VERSION="2.6.0p2" + VERSION="2.6.1" cat >>confdefs.h <<_ACEOF @@ -2988,10 +3248,10 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -3004,7 +3264,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3015,11 +3275,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3028,10 +3288,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -3044,7 +3304,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3055,11 +3315,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -3067,12 +3327,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -3156,10 +3412,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3172,7 +3428,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3183,11 +3439,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3196,10 +3452,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -3212,7 +3468,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3223,11 +3479,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3235,12 +3491,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3253,10 +3505,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3269,7 +3521,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3280,11 +3532,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3293,10 +3545,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3314,7 +3566,7 @@ do continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3337,11 +3589,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3352,10 +3604,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3368,7 +3620,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3379,11 +3631,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3396,10 +3648,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -3412,7 +3664,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3423,11 +3675,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3439,12 +3691,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3454,44 +3702,50 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -3510,27 +3764,22 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -3541,10 +3790,11 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -3555,7 +3805,7 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -3582,25 +3832,27 @@ else ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -3609,49 +3861,53 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -3660,31 +3916,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3707,40 +3965,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3766,20 +4027,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3789,15 +4051,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3824,20 +4090,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3862,20 +4129,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3901,20 +4169,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3929,8 +4198,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3946,10 +4215,10 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -4020,20 +4289,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4049,15 +4319,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -4078,8 +4348,8 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none @@ -4106,8 +4376,8 @@ if test "$am__include" = "#"; then fi -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6; } +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. @@ -4131,10 +4401,10 @@ fi depcc="$CC" am_compiler_list= -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up @@ -4222,8 +4492,8 @@ else fi fi -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4240,10 +4510,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4256,7 +4526,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4267,11 +4537,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4280,10 +4550,10 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4296,7 +4566,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4307,11 +4577,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4319,12 +4589,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4334,26 +4600,20 @@ else fi -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -4385,20 +4645,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4422,13 +4683,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4436,7 +4698,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4461,8 +4723,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -4490,20 +4752,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4527,13 +4790,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4541,7 +4805,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4557,11 +4821,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -4571,42 +4837,37 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -4621,74 +4882,60 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -4703,40 +4950,31 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4763,20 +5001,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -4868,37 +5107,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4920,11 +5162,11 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4942,20 +5184,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -4963,12 +5206,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4978,17 +5224,17 @@ done if test "${ac_cv_header_minix_config_h+set}" = set; then - { echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5004,32 +5250,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5043,66 +5290,67 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } fi -if test $ac_cv_header_minix_config_h = yes; then +if test "x$ac_cv_header_minix_config_h" = x""yes; then MINIX=yes else MINIX= @@ -5129,10 +5377,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5157,20 +5405,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_safe_to_define___extensions__=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_safe_to_define___extensions__=no @@ -5178,8 +5427,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 @@ -5251,10 +5500,10 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5278,31 +5527,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_working_alloca_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -5311,10 +5564,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5358,31 +5611,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_alloca_works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -5396,6 +5653,10 @@ else # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. + + + + ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF @@ -5403,10 +5664,10 @@ cat >>confdefs.h <<\_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5430,15 +5691,15 @@ fi rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5491,33 +5752,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -5529,10 +5797,10 @@ fi done fi -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 @@ -5570,36 +5838,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -5615,20 +5886,21 @@ fi for ac_header in $gl_header_list do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5644,32 +5916,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5683,69 +5956,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5757,10 +6034,10 @@ done -{ echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do @@ -5783,20 +6060,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -5807,8 +6085,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -5826,15 +6104,14 @@ _ACEOF ;; esac -{ echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 -echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } if test "${ac_cv_c_restrict+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_restrict=no - # Try the official restrict keyword, then gcc's __restrict, and - # the less common variants. - for ac_kw in restrict __restrict __restrict__ _Restrict; do + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5842,16 +6119,16 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; + int foo (int_ptr $ac_kw ip) { + return ip[0]; } int main () { int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) + int * $ac_kw t = s; + t[0] = 0; + return foo(t) ; return 0; } @@ -5862,20 +6139,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_restrict=$ac_kw else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -5886,13 +6164,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 -echo "${ECHO_T}$ac_cv_c_restrict" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in restrict) ;; - no) -cat >>confdefs.h <<\_ACEOF -#define restrict + no) cat >>confdefs.h <<\_ACEOF +#define restrict /**/ _ACEOF ;; *) cat >>confdefs.h <<_ACEOF @@ -5903,10 +6182,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 -echo $ECHO_N "checking whether the preprocessor supports include_next... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether the preprocessor supports include_next" >&5 +$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } if test "${gl_cv_have_include_next+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else rm -rf conftestd1 conftestd2 mkdir conftestd1 conftestd2 @@ -5936,20 +6215,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_have_include_next=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_have_include_next=no @@ -5960,8 +6240,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -rf conftestd1 conftestd2 fi -{ echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 -echo "${ECHO_T}$gl_cv_have_include_next" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_have_include_next" >&5 +$as_echo "$gl_cv_have_include_next" >&6; } if test $gl_cv_have_include_next = yes; then @@ -6007,10 +6287,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking whether is self-contained" >&5 -echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6034,20 +6314,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_sys_socket_h_selfcontained=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_sys_socket_h_selfcontained=no @@ -6056,8 +6337,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 -echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' else @@ -6077,10 +6358,10 @@ echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_sys_socket_h='<'sys/socket.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_sys_socket_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_sys_socket_h = yes; then @@ -6105,8 +6386,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 -echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 +$as_echo "$gl_cv_next_sys_socket_h" >&6; } fi NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h @@ -6122,20 +6403,21 @@ echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } for ac_header in winsock2.h ws2tcpip.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6151,32 +6433,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6190,69 +6473,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6298,10 +6585,10 @@ done - { echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 -echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 +$as_echo_n "checking for IPv4 sockets... " >&6; } if test "${gl_cv_socket_ipv4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6334,20 +6621,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_socket_ipv4=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_socket_ipv4=no @@ -6356,8 +6644,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 -echo "${ECHO_T}$gl_cv_socket_ipv4" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 +$as_echo "$gl_cv_socket_ipv4" >&6; } if test $gl_cv_socket_ipv4 = yes; then cat >>confdefs.h <<\_ACEOF @@ -6366,10 +6654,10 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 -echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 +$as_echo_n "checking for IPv6 sockets... " >&6; } if test "${gl_cv_socket_ipv6+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6402,20 +6690,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_socket_ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_socket_ipv6=no @@ -6424,8 +6713,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 -echo "${ECHO_T}$gl_cv_socket_ipv6" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 +$as_echo "$gl_cv_socket_ipv6" >&6; } if test $gl_cv_socket_ipv6 = yes; then cat >>confdefs.h <<\_ACEOF @@ -6435,6 +6724,529 @@ _ACEOF fi + if test -z "$GETOPT_H"; then + +for ac_header in getopt.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi + +done + + fi + + if test -z "$GETOPT_H"; then + +for ac_func in getopt_long_only +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + GETOPT_H=getopt.h +fi +done + + fi + + if test -z "$GETOPT_H"; then + { $as_echo "$as_me:$LINENO: checking whether optreset is declared" >&5 +$as_echo_n "checking whether optreset is declared... " >&6; } +if test "${ac_cv_have_decl_optreset+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef optreset + (void) optreset; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_optreset=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_optreset=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 +$as_echo "$ac_cv_have_decl_optreset" >&6; } +if test "x$ac_cv_have_decl_optreset" = x""yes; then + GETOPT_H=getopt.h +fi + + fi + + if test -z "$GETOPT_H"; then + { $as_echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 +$as_echo_n "checking for working GNU getopt function... " >&6; } +if test "${gl_cv_func_gnu_getopt+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + { $as_echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 +$as_echo_n "checking whether getopt_clip is declared... " >&6; } +if test "${ac_cv_have_decl_getopt_clip+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef getopt_clip + (void) getopt_clip; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_getopt_clip=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getopt_clip=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 +$as_echo "$ac_cv_have_decl_getopt_clip" >&6; } +if test "x$ac_cv_have_decl_getopt_clip" = x""yes; then + gl_cv_func_gnu_getopt=no +else + gl_cv_func_gnu_getopt=yes +fi + +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ + + char *myargv[3]; + myargv[0] = "conftest"; + myargv[1] = "-+"; + myargv[2] = 0; + return getopt (2, myargv, "+a") != '?'; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gl_cv_func_gnu_getopt=yes +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +gl_cv_func_gnu_getopt=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 +$as_echo "$gl_cv_func_gnu_getopt" >&6; } + if test "$gl_cv_func_gnu_getopt" = "no"; then + GETOPT_H=getopt.h + fi + fi + + + { $as_echo "$as_me:$LINENO: checking whether getenv is declared" >&5 +$as_echo_n "checking whether getenv is declared... " >&6; } +if test "${ac_cv_have_decl_getenv+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getenv + (void) getenv; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_getenv=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getenv=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 +$as_echo "$ac_cv_have_decl_getenv" >&6; } +if test "x$ac_cv_have_decl_getenv" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETENV 0 +_ACEOF + + +fi + + + + @@ -6456,10 +7268,10 @@ _ACEOF if test $gl_cv_have_include_next = yes; then gl_cv_next_sys_time_h='<'sys/time.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_sys_time_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_sys_time_h = yes; then @@ -6484,8 +7296,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5 -echo "${ECHO_T}$gl_cv_next_sys_time_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_time_h" >&5 +$as_echo "$gl_cv_next_sys_time_h" >&6; } fi NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h @@ -6499,10 +7311,10 @@ echo "${ECHO_T}$gl_cv_next_sys_time_h" >&6; } fi - { echo "$as_me:$LINENO: checking for struct timeval" >&5 -echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for struct timeval" >&5 +$as_echo_n "checking for struct timeval... " >&6; } if test "${gl_cv_sys_struct_timeval+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6529,20 +7341,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_sys_struct_timeval=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_sys_struct_timeval=no @@ -6550,8 +7363,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 -echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_sys_struct_timeval" >&5 +$as_echo "$gl_cv_sys_struct_timeval" >&6; } if test $gl_cv_sys_struct_timeval = yes; then HAVE_STRUCT_TIMEVAL=1 else @@ -6578,11 +7391,11 @@ echo "${ECHO_T}$gl_cv_sys_struct_timeval" >&6; } for ac_func in $gl_func_list do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6635,35 +7448,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -6714,8 +7534,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -6744,14 +7564,14 @@ echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } ;; esac elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${acl_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" @@ -6778,19 +7598,19 @@ fi LD="$acl_cv_path_LD" if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } + { $as_echo "$as_me:$LINENO: result: $LD" >&5 +$as_echo "$LD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &1 &5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } +{ $as_echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld - { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } if test "${acl_cv_rpath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ @@ -6820,8 +7640,8 @@ else acl_cv_rpath=done fi -{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6; } +{ $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" @@ -6864,8 +7684,8 @@ fi LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then - { echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 -echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5 +$as_echo_n "checking whether imported symbols can be declared weak... " >&6; } gl_have_weak=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6889,45 +7709,49 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_have_weak=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - { echo "$as_me:$LINENO: result: $gl_have_weak" >&5 -echo "${ECHO_T}$gl_have_weak" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_have_weak" >&5 +$as_echo "$gl_have_weak" >&6; } if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . It's added above, in gl_LOCK_EARLY_BODY. if test "${ac_cv_header_pthread_h+set}" = set; then - { echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 +$as_echo_n "checking for pthread.h... " >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +$as_echo "$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5 +$as_echo_n "checking pthread.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6943,32 +7767,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5 +$as_echo_n "checking pthread.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6982,66 +7807,67 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 +$as_echo_n "checking for pthread.h... " >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +$as_echo "$ac_cv_header_pthread_h" >&6; } fi -if test $ac_cv_header_pthread_h = yes; then +if test "x$ac_cv_header_pthread_h" = x""yes; then gl_have_pthread_h=yes else gl_have_pthread_h=no @@ -7078,26 +7904,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_have_pthread=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # Test for libpthread by looking for pthread_kill. (Not pthread_self, @@ -7105,10 +7935,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. - { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -7140,33 +7970,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread_pthread_kill=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } -if test $ac_cv_lib_pthread_pthread_kill = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a @@ -7185,10 +8019,10 @@ fi else # Some library is needed. Try libpthread and libc_r. - { echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 -echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -7220,33 +8054,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread_pthread_kill=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_kill=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6; } -if test $ac_cv_lib_pthread_pthread_kill = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = x""yes; then gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread @@ -7254,10 +8092,10 @@ fi if test -z "$gl_have_pthread"; then # For FreeBSD 4. - { echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 -echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5 +$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -7289,33 +8127,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_kill=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_kill=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6; } -if test $ac_cv_lib_c_r_pthread_kill = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } +if test "x$ac_cv_lib_c_r_pthread_kill" = x""yes; then gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r @@ -7343,12 +8185,13 @@ _ACEOF fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. - { echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 -echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 +$as_echo_n "checking for pthread_rwlock_t... " >&6; } if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pthread_rwlock_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7356,14 +8199,46 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -typedef pthread_rwlock_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pthread_rwlock_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +if (sizeof ((pthread_rwlock_t))) + return 0; ; return 0; } @@ -7374,30 +8249,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pthread_rwlock_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pthread_rwlock_t=no + ac_cv_type_pthread_rwlock_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 -echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6; } -if test $ac_cv_type_pthread_rwlock_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5 +$as_echo "$ac_cv_type_pthread_rwlock_t" >&6; } +if test "x$ac_cv_type_pthread_rwlock_t" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_RWLOCK 1 @@ -7432,13 +8316,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7449,7 +8334,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7486,26 +8371,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_have_solaristhread=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" @@ -7539,10 +8428,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking how to link with libpth" >&5 -echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking how to link with libpth" >&5 +$as_echo_n "checking how to link with libpth... " >&6; } if test "${ac_cv_libpth_libs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else @@ -7929,8 +8818,8 @@ fi ac_cv_libpth_cppflags="$INCPTH" fi -{ echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 -echo "${ECHO_T}$ac_cv_libpth_libs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5 +$as_echo "$ac_cv_libpth_libs" >&6; } LIBPTH="$ac_cv_libpth_libs" LTLIBPTH="$ac_cv_libpth_ltlibs" INCPTH="$ac_cv_libpth_cppflags" @@ -7987,26 +8876,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_have_pth=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gl_save_LIBS" @@ -8053,20 +8946,20 @@ _ACEOF fi fi fi - { echo "$as_me:$LINENO: checking for multithread API to use" >&5 -echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $gl_threads_api" >&5 -echo "${ECHO_T}$gl_threads_api" >&6; } + { $as_echo "$as_me:$LINENO: checking for multithread API to use" >&5 +$as_echo_n "checking for multithread API to use... " >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_threads_api" >&5 +$as_echo "$gl_threads_api" >&6; } - { echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5 -echo $ECHO_N "checking whether malloc, realloc, calloc are POSIX compliant... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } if test "${gl_cv_func_malloc_posix+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -8093,20 +8986,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_func_malloc_posix=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_malloc_posix=no @@ -8115,8 +9009,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5 -echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_malloc_posix" >&5 +$as_echo "$gl_cv_func_malloc_posix" >&6; } GNULIB_MALLOC_POSIX=0; @@ -8125,17 +9019,24 @@ echo "${ECHO_T}$gl_cv_func_malloc_posix" >&6; } GNULIB_GETSUBOPT=0; GNULIB_MKDTEMP=0; GNULIB_MKSTEMP=0; + GNULIB_PUTENV=0; + GNULIB_SETENV=0; + GNULIB_UNSETENV=0; HAVE_CALLOC_POSIX=1; HAVE_GETSUBOPT=1; HAVE_MALLOC_POSIX=1; HAVE_MKDTEMP=1; HAVE_REALLOC_POSIX=1; + HAVE_SETENV=1; + HAVE_UNSETENV=1; REPLACE_MKSTEMP=0; + REPLACE_PUTENV=0; + VOID_UNSETENV=0; -{ echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5 -echo $ECHO_N "checking for external symbol _system_configuration... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5 +$as_echo_n "checking for external symbol _system_configuration... " >&6; } if test "${gl_cv_var__system_configuration+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8160,31 +9061,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_cv_var__system_configuration=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_var__system_configuration=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_var__system_configuration" >&5 -echo "${ECHO_T}$gl_cv_var__system_configuration" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_var__system_configuration" >&5 +$as_echo "$gl_cv_var__system_configuration" >&6; } if test $gl_cv_var__system_configuration = yes; then @@ -8196,10 +9101,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${gt_cv_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8223,20 +9128,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_ssize_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_ssize_t=no @@ -8244,8 +9150,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 -echo "${ECHO_T}$gt_cv_ssize_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +$as_echo "$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then cat >>confdefs.h <<\_ACEOF @@ -8264,6 +9170,8 @@ _ACEOF GNULIB_VSNPRINTF=0; GNULIB_VSPRINTF_POSIX=0; GNULIB_VASPRINTF=0; + GNULIB_FOPEN=0; + GNULIB_FREOPEN=0; GNULIB_FSEEK=0; GNULIB_FSEEKO=0; GNULIB_FTELL=0; @@ -8283,6 +9191,8 @@ _ACEOF REPLACE_VSPRINTF=0; HAVE_VASPRINTF=1; REPLACE_VASPRINTF=0; + REPLACE_FOPEN=0; + REPLACE_FREOPEN=0; HAVE_FSEEKO=1; REPLACE_FSEEKO=0; REPLACE_FSEEK=0; @@ -8295,10 +9205,10 @@ _ACEOF REPLACE_GETLINE=0; - { echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +$as_echo_n "checking whether snprintf is declared... " >&6; } if test "${ac_cv_have_decl_snprintf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8324,20 +9234,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_snprintf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_snprintf=no @@ -8345,9 +9256,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; } -if test $ac_cv_have_decl_snprintf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +$as_echo "$ac_cv_have_decl_snprintf" >&6; } +if test "x$ac_cv_have_decl_snprintf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SNPRINTF 1 @@ -8364,10 +9275,10 @@ fi -{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8457,20 +9368,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no @@ -8478,28 +9390,60 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } - { echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 +$as_echo_n "checking for _Bool... " >&6; } if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type__Bool=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef _Bool ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (_Bool)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((_Bool))) + return 0; ; return 0; } @@ -8510,30 +9454,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Bool=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } -if test $ac_cv_type__Bool = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +$as_echo "$ac_cv_type__Bool" >&6; } +if test "x$ac_cv_type__Bool" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 @@ -8550,32 +9503,46 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for long long int" >&5 -echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } if test "${ac_cv_type_long_long_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -long long int ll = 9223372036854775807ll; - long long int nll = -9223372036854775807LL; - typedef int a[((-9223372036854775807LL < 0 - && 0 < 9223372036854775807ll) - ? 1 : -1)]; - int i = 63; +/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main () { -long long int llmax = 9223372036854775807ll; - return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll)); +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } + _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" @@ -8583,19 +9550,22 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - if test "$cross_compiling" = yes; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + if test "$cross_compiling" = yes; then ac_cv_type_long_long_int=yes else cat >conftest.$ac_ext <<_ACEOF @@ -8634,45 +9604,49 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long_int=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_long_long_int=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long_int=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } if test $ac_cv_type_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF @@ -8682,30 +9656,46 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 -echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for unsigned long long int" >&5 +$as_echo_n "checking for unsigned long long int... " >&6; } if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -unsigned long long int ull = 18446744073709551615ULL; - typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; - int i = 63; +/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main () { -unsigned long long int ullmax = 18446744073709551615ull; - return (ull << 63 | ull >> 63 | ull << i | ull >> i - | ullmax / ull | ullmax % ull); +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } + _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" @@ -8713,31 +9703,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_type_unsigned_long_long_int=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long_int=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; } if test $ac_cv_type_unsigned_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF @@ -8782,6 +9776,7 @@ _ACEOF GNULIB_STRNLEN=0; GNULIB_STRPBRK=0; GNULIB_STRSEP=0; + GNULIB_STRSTR=0; GNULIB_STRCASESTR=0; GNULIB_STRTOK_R=0; GNULIB_MBSLEN=0; @@ -8798,13 +9793,13 @@ _ACEOF GNULIB_MBSSPN=0; GNULIB_MBSSEP=0; GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRSIGNAL=0; HAVE_DECL_MEMMEM=1; HAVE_MEMPCPY=1; HAVE_DECL_MEMRCHR=1; HAVE_STPCPY=1; HAVE_STPNCPY=1; - HAVE_STRCASECMP=1; - HAVE_DECL_STRNCASECMP=1; HAVE_STRCHRNUL=1; HAVE_DECL_STRDUP=1; HAVE_STRNDUP=1; @@ -8814,12 +9809,19 @@ _ACEOF HAVE_STRSEP=1; HAVE_STRCASESTR=1; HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR=1; + HAVE_DECL_STRSIGNAL=1; + REPLACE_STRERROR=0; + REPLACE_STRSIGNAL=0; + REPLACE_MEMMEM=0; + REPLACE_STRCASESTR=0; + REPLACE_STRSTR=0; - { echo "$as_me:$LINENO: checking whether strdup is declared" >&5 -echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether strdup is declared" >&5 +$as_echo_n "checking whether strdup is declared... " >&6; } if test "${ac_cv_have_decl_strdup+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8845,20 +9847,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_strdup=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strdup=no @@ -8866,9 +9869,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6; } -if test $ac_cv_have_decl_strdup = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 +$as_echo "$ac_cv_have_decl_strdup" >&6; } +if test "x$ac_cv_have_decl_strdup" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRDUP 1 @@ -8908,10 +9911,10 @@ fi if test $gl_cv_have_include_next = yes; then gl_cv_next_string_h='<'string.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_string_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_string_h = yes; then @@ -8936,8 +9939,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5 -echo "${ECHO_T}$gl_cv_next_string_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_string_h" >&5 +$as_echo "$gl_cv_next_string_h" >&6; } fi NEXT_STRING_H=$gl_cv_next_string_h @@ -8950,10 +9953,10 @@ echo "${ECHO_T}$gl_cv_next_string_h" >&6; } -{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } if test "${ac_cv_header_stat_broken+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8987,20 +9990,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stat_broken=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stat_broken=yes @@ -9008,8 +10012,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +$as_echo "$ac_cv_header_stat_broken" >&6; } if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF @@ -9031,10 +10035,10 @@ fi if test "$enable_largefile" != no; then - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then @@ -9071,20 +10075,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9098,20 +10103,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9124,16 +10130,16 @@ rm -f core conftest.err conftest.$ac_objext rm -f conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF @@ -9165,20 +10171,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9215,20 +10222,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9239,8 +10247,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) @@ -9249,12 +10257,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF @@ -9286,20 +10294,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9336,20 +10345,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -9360,8 +10370,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) @@ -9370,29 +10380,36 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* fi fi GNULIB_CHOWN=0; GNULIB_DUP2=0; + GNULIB_ENVIRON=0; GNULIB_FCHDIR=0; GNULIB_FTRUNCATE=0; GNULIB_GETCWD=0; GNULIB_GETLOGIN_R=0; + GNULIB_GETPAGESIZE=0; GNULIB_LCHOWN=0; GNULIB_LSEEK=0; GNULIB_READLINK=0; GNULIB_SLEEP=0; HAVE_DUP2=1; HAVE_FTRUNCATE=1; + HAVE_GETPAGESIZE=1; HAVE_READLINK=1; HAVE_SLEEP=1; + HAVE_DECL_ENVIRON=1; HAVE_DECL_GETLOGIN_R=1; + HAVE_OS_H=0; + HAVE_SYS_PARAM_H=0; REPLACE_CHOWN=0; REPLACE_FCHDIR=0; REPLACE_GETCWD=0; + REPLACE_GETPAGESIZE=0; REPLACE_LCHOWN=0; REPLACE_LSEEK=0; @@ -9404,10 +10421,10 @@ fi - { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 -echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 +$as_echo_n "checking for EOVERFLOW... " >&6; } if test "${ac_cv_decl_EOVERFLOW+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -9484,13 +10501,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9526,20 +10544,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9553,7 +10572,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9585,13 +10604,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9627,20 +10647,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9654,7 +10675,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9696,20 +10717,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9751,15 +10773,17 @@ main () long int i = longval (); if (i != (EOVERFLOW)) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (EOVERFLOW)) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9772,27 +10796,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_EOVERFLOW=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val @@ -9802,8 +10829,8 @@ rm -f conftest.val fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 -echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 +$as_echo "$ac_cv_decl_EOVERFLOW" >&6; } if test "$ac_cv_decl_EOVERFLOW" != yes; then cat >>confdefs.h <<_ACEOF @@ -9821,10 +10848,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9848,20 +10875,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wchar_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no @@ -9869,8 +10897,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 -echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -9880,10 +10908,10 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for wint_t" >&5 -echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } if test "${gt_cv_c_wint_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9907,20 +10935,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_wint_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no @@ -9928,8 +10957,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 -echo "${ECHO_T}$gt_cv_c_wint_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -9938,26 +10967,24 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (size_t)) + return 0; ; return 0; } @@ -9968,57 +10995,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - - { echo "$as_me:$LINENO: checking for inttypes.h" >&5 -echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } -if test "${gl_cv_header_inttypes_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +$ac_includes_default int main () { -uintmax_t i = (uintmax_t) -1; +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -10029,42 +11029,53 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - gl_cv_header_inttypes_h=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_header_inttypes_h=no + ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 -echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } - if test $gl_cv_header_inttypes_h = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then + : +else cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +#define size_t unsigned int _ACEOF - fi +fi - { echo "$as_me:$LINENO: checking for stdint.h" >&5 -echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } -if test "${gl_cv_header_stdint_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if test "${gl_cv_header_inttypes_h+set}" = set; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10073,7 +11084,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include +#include int main () { @@ -10088,42 +11099,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - gl_cv_header_stdint_h=yes + gl_cv_header_inttypes_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - gl_cv_header_stdint_h=no + gl_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 -echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } - if test $gl_cv_header_stdint_h = yes; then +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 +$as_echo "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H_WITH_UINTMAX 1 +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi - { echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if test "${gl_cv_header_stdint_h+set}" = set; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10131,51 +11143,50 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -long long ll = 1LL; int i = 63; +#include +#include int main () { -long long llmax = (long long) -1; - return ll << i | ll >> i | llmax / ll | llmax % ll; +uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_type_long_long=yes + } && test -s conftest.$ac_objext; then + gl_cv_header_stdint_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long_long=no + gl_cv_header_stdint_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - if test $ac_cv_type_long_long = yes; then +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 +$as_echo "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi @@ -10183,10 +11194,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } if test "${gt_cv_c_intmax_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10218,20 +11229,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_c_intmax_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no @@ -10239,8 +11251,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 -echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 +$as_echo "$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF @@ -10249,7 +11261,7 @@ _ACEOF else - test $ac_cv_type_long_long = yes \ + test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' @@ -10267,9 +11279,6 @@ _ACEOF - - - if true; then GL_COND_LIBTOOL_TRUE= GL_COND_LIBTOOL_FALSE='#' @@ -10279,6 +11288,9 @@ else fi gl_cond_libtool=true + + + gl_source_base='gnulib' @@ -10291,10 +11303,10 @@ fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then - { echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 -echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5 +$as_echo_n "checking for alloca as a compiler built-in... " >&6; } if test "${gl_cv_rpl_alloca+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -10319,8 +11331,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 -echo "${ECHO_T}$gl_cv_rpl_alloca" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5 +$as_echo "$gl_cv_rpl_alloca" >&6; } if test $gl_cv_rpl_alloca = yes; then cat >>confdefs.h <<\_ACEOF @@ -10337,12 +11349,6 @@ _ACEOF -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF - - - : @@ -10357,11 +11363,11 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -10396,8 +11402,8 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } @@ -10410,7 +11416,7 @@ echo "${ECHO_T}$MKDIR_P" >&6; } FLOAT_H= case "$host_os" in - beos*) + beos* | openbsd*) FLOAT_H=float.h @@ -10426,10 +11432,10 @@ echo "${ECHO_T}$MKDIR_P" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_float_h='<'float.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_float_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_float_h = yes; then @@ -10454,8 +11460,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5 -echo "${ECHO_T}$gl_cv_next_float_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_float_h" >&5 +$as_echo "$gl_cv_next_float_h" >&6; } fi NEXT_FLOAT_H=$gl_cv_next_float_h @@ -10486,11 +11492,11 @@ echo "${ECHO_T}$gl_cv_next_float_h" >&6; } for ac_header in sys/mount.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10511,20 +11517,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -10532,12 +11539,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -10546,8 +11556,8 @@ done -{ echo "$as_me:$LINENO: checking how to get file system space usage" >&5 -echo "$as_me: checking how to get file system space usage" >&6;} +{ $as_echo "$as_me:$LINENO: checking how to get file system space usage" >&5 +$as_echo "$as_me: checking how to get file system space usage" >&6;} ac_fsusage_space=no # Perform only the link test since it seems there are no variants of the @@ -10558,10 +11568,10 @@ ac_fsusage_space=no # is what it gets when this test fails. if test $ac_fsusage_space = no; then # SVR4 - { echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5 -echo $ECHO_N "checking for statvfs function (SVR4)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for statvfs function (SVR4)" >&5 +$as_echo_n "checking for statvfs function (SVR4)... " >&6; } if test "${fu_cv_sys_stat_statvfs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -10597,31 +11607,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then fu_cv_sys_stat_statvfs=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fu_cv_sys_stat_statvfs=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_statvfs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5 +$as_echo "$fu_cv_sys_stat_statvfs" >&6; } if test $fu_cv_sys_stat_statvfs = yes; then ac_fsusage_space=yes @@ -10634,10 +11648,10 @@ fi if test $ac_fsusage_space = no; then # DEC Alpha running OSF/1 - { echo "$as_me:$LINENO: checking for 3-argument statfs function (DEC OSF/1)" >&5 -echo $ECHO_N "checking for 3-argument statfs function (DEC OSF/1)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for 3-argument statfs function (DEC OSF/1)" >&5 +$as_echo_n "checking for 3-argument statfs function (DEC OSF/1)... " >&6; } if test "${fu_cv_sys_stat_statfs3_osf1+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then fu_cv_sys_stat_statfs3_osf1=no @@ -10666,37 +11680,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fu_cv_sys_stat_statfs3_osf1=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fu_cv_sys_stat_statfs3_osf1=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs3_osf1" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_statfs3_osf1" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs3_osf1" >&5 +$as_echo "$fu_cv_sys_stat_statfs3_osf1" >&6; } if test $fu_cv_sys_stat_statfs3_osf1 = yes; then ac_fsusage_space=yes @@ -10709,10 +11726,10 @@ fi if test $ac_fsusage_space = no; then # AIX - { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 -echo $ECHO_N "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +$as_echo_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)... " >&6; } if test "${fu_cv_sys_stat_statfs2_bsize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then fu_cv_sys_stat_statfs2_bsize=no @@ -10747,37 +11764,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fu_cv_sys_stat_statfs2_bsize=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fu_cv_sys_stat_statfs2_bsize=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_bsize" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_statfs2_bsize" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_bsize" >&5 +$as_echo "$fu_cv_sys_stat_statfs2_bsize" >&6; } if test $fu_cv_sys_stat_statfs2_bsize = yes; then ac_fsusage_space=yes @@ -10790,10 +11810,10 @@ fi if test $ac_fsusage_space = no; then # SVR3 - { echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 -echo $ECHO_N "checking for four-argument statfs (AIX-3.2.5, SVR3)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +$as_echo_n "checking for four-argument statfs (AIX-3.2.5, SVR3)... " >&6; } if test "${fu_cv_sys_stat_statfs4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then fu_cv_sys_stat_statfs4=no @@ -10819,37 +11839,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fu_cv_sys_stat_statfs4=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fu_cv_sys_stat_statfs4=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs4" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_statfs4" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs4" >&5 +$as_echo "$fu_cv_sys_stat_statfs4" >&6; } if test $fu_cv_sys_stat_statfs4 = yes; then ac_fsusage_space=yes @@ -10862,10 +11885,10 @@ fi if test $ac_fsusage_space = no; then # 4.4BSD and NetBSD - { echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 -echo $ECHO_N "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +$as_echo_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)... " >&6; } if test "${fu_cv_sys_stat_statfs2_fsize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then fu_cv_sys_stat_statfs2_fsize=no @@ -10897,37 +11920,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fu_cv_sys_stat_statfs2_fsize=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fu_cv_sys_stat_statfs2_fsize=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_fsize" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_statfs2_fsize" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statfs2_fsize" >&5 +$as_echo "$fu_cv_sys_stat_statfs2_fsize" >&6; } if test $fu_cv_sys_stat_statfs2_fsize = yes; then ac_fsusage_space=yes @@ -10940,10 +11966,10 @@ fi if test $ac_fsusage_space = no; then # Ultrix - { echo "$as_me:$LINENO: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 -echo $ECHO_N "checking for two-argument statfs with struct fs_data (Ultrix)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +$as_echo_n "checking for two-argument statfs with struct fs_data (Ultrix)... " >&6; } if test "${fu_cv_sys_stat_fs_data+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then fu_cv_sys_stat_fs_data=no @@ -10979,37 +12005,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fu_cv_sys_stat_fs_data=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fu_cv_sys_stat_fs_data=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_stat_fs_data" >&5 -echo "${ECHO_T}$fu_cv_sys_stat_fs_data" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_stat_fs_data" >&5 +$as_echo "$fu_cv_sys_stat_fs_data" >&6; } if test $fu_cv_sys_stat_fs_data = yes; then ac_fsusage_space=yes @@ -11036,13 +12065,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -11054,7 +12084,7 @@ _ACEOF ac_fsusage_space=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -11072,7 +12102,15 @@ fi if test $gl_cv_fs_space = yes; then - gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fsusage.$ac_objext" + @@ -11080,20 +12118,21 @@ fi for ac_header in dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11109,32 +12148,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11148,69 +12188,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -11218,10 +12262,10 @@ fi done - { echo "$as_me:$LINENO: checking for statfs that truncates block counts" >&5 -echo $ECHO_N "checking for statfs that truncates block counts... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for statfs that truncates block counts" >&5 +$as_echo_n "checking for statfs that truncates block counts... " >&6; } if test "${fu_cv_sys_truncating_statfs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11250,20 +12294,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then fu_cv_sys_truncating_statfs=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fu_cv_sys_truncating_statfs=no @@ -11279,20 +12324,28 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - { echo "$as_me:$LINENO: result: $fu_cv_sys_truncating_statfs" >&5 -echo "${ECHO_T}$fu_cv_sys_truncating_statfs" >&6; } + { $as_echo "$as_me:$LINENO: result: $fu_cv_sys_truncating_statfs" >&5 +$as_echo "$fu_cv_sys_truncating_statfs" >&6; } fi - { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 -echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} + { $as_echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5 +$as_echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;} + + + : + + - { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 -echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; } + + + + { $as_echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 +$as_echo_n "checking for library containing getaddrinfo... " >&6; } if test "${ac_cv_search_getaddrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -11330,26 +12383,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_getaddrinfo=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getaddrinfo+set}" = set; then @@ -11364,64 +12421,40 @@ fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 +$as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - -for ac_func in getaddrinfo -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } +if test "${gl_cv_func_getaddrinfo+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" +#include +#ifdef HAVE_SYS_SOCKET_H +#include #endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me +#ifdef HAVE_NETDB_H +#include #endif +#include int main () { -return $ac_func (); +getaddrinfo("", "", NULL, NULL); ; return 0; } @@ -11432,43 +12465,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + gl_cv_func_getaddrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + gl_cv_func_getaddrinfo=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - - { echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 -echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_getaddrinfo" >&5 +$as_echo "$gl_cv_func_getaddrinfo" >&6; } + if test $gl_cv_func_getaddrinfo = no; then + { $as_echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5 +$as_echo_n "checking for getaddrinfo in ws2tcpip.h and -lws2_32... " >&6; } if test "${gl_cv_w32_getaddrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gl_cv_w32_getaddrinfo=no @@ -11484,11 +12514,12 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef HAVE_WS2TCPIP_H #include #endif +#include int main () { -getaddrinfo(0, 0, 0, 0); +getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } @@ -11499,56 +12530,58 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_cv_w32_getaddrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi -{ echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 -echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5 +$as_echo "$gl_cv_w32_getaddrinfo" >&6; } if test "$gl_cv_w32_getaddrinfo" = "yes"; then LIBS="$LIBS -lws2_32" else - gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" - fi -fi -done - # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an - # inline function declared in ws2tcpip.h, so we need to get that - # header included somehow. - : + gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext" + fi + fi - { echo "$as_me:$LINENO: checking for gai_strerror (possibly via ws2tcpip.h)" >&5 -echo $ECHO_N "checking for gai_strerror (possibly via ws2tcpip.h)... $ECHO_C" >&6; } + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an + # inline function declared in ws2tcpip.h, so we need to get that + # header included somehow. + { $as_echo "$as_me:$LINENO: checking for gai_strerror (possibly via ws2tcpip.h)" >&5 +$as_echo_n "checking for gai_strerror (possibly via ws2tcpip.h)... " >&6; } if test "${gl_cv_func_gai_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -11568,11 +12601,12 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef HAVE_WS2TCPIP_H #include #endif +#include int main () { -gai_strerror (0); +gai_strerror (NULL); ; return 0; } @@ -11583,40 +12617,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_cv_func_gai_strerror=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_gai_strerror=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_gai_strerror" >&5 -echo "${ECHO_T}$gl_cv_func_gai_strerror" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gai_strerror" >&5 +$as_echo "$gl_cv_func_gai_strerror" >&6; } if test $gl_cv_func_gai_strerror = no; then - gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gai_strerror.$ac_objext" + fi - { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 -echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } if test "${ac_cv_search_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -11654,26 +12700,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_gethostbyname=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_gethostbyname+set}" = set; then @@ -11688,18 +12738,18 @@ fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 -echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 +$as_echo_n "checking for library containing getservbyname... " >&6; } if test "${ac_cv_search_getservbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -11737,26 +12787,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_getservbyname=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getservbyname+set}" = set; then @@ -11771,8 +12825,8 @@ fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 -echo "${ECHO_T}$ac_cv_search_getservbyname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 +$as_echo "$ac_cv_search_getservbyname" >&6; } ac_res=$ac_cv_search_getservbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -11782,11 +12836,11 @@ fi for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11839,43 +12893,50 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 -echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5 +$as_echo_n "checking for gethostbyname in winsock2.h and -lws2_32... " >&6; } if test "${gl_cv_w32_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gl_cv_w32_gethostbyname=no @@ -11891,11 +12952,12 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef HAVE_WINSOCK2_H #include #endif +#include int main () { -gethostbyname(0); +gethostbyname(NULL); ; return 0; } @@ -11906,32 +12968,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gl_cv_w32_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi -{ echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 -echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5 +$as_echo "$gl_cv_w32_gethostbyname" >&6; } if test "$gl_cv_w32_gethostbyname" = "yes"; then LIBS="$LIBS -lws2_32" fi @@ -11954,10 +13020,10 @@ done - { echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 -echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 +$as_echo_n "checking whether getaddrinfo is declared... " >&6; } if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11998,20 +13064,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_getaddrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getaddrinfo=no @@ -12019,9 +13086,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6; } -if test $ac_cv_have_decl_getaddrinfo = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 +$as_echo "$ac_cv_have_decl_getaddrinfo" >&6; } +if test "x$ac_cv_have_decl_getaddrinfo" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETADDRINFO 1 @@ -12035,10 +13102,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 -echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 +$as_echo_n "checking whether freeaddrinfo is declared... " >&6; } if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12079,20 +13146,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_freeaddrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_freeaddrinfo=no @@ -12100,9 +13168,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6; } -if test $ac_cv_have_decl_freeaddrinfo = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 +$as_echo "$ac_cv_have_decl_freeaddrinfo" >&6; } +if test "x$ac_cv_have_decl_freeaddrinfo" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREEADDRINFO 1 @@ -12116,10 +13184,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 -echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 +$as_echo_n "checking whether gai_strerror is declared... " >&6; } if test "${ac_cv_have_decl_gai_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12160,20 +13228,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_gai_strerror=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_gai_strerror=no @@ -12181,9 +13250,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 -echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6; } -if test $ac_cv_have_decl_gai_strerror = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 +$as_echo "$ac_cv_have_decl_gai_strerror" >&6; } +if test "x$ac_cv_have_decl_gai_strerror" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GAI_STRERROR 1 @@ -12197,10 +13266,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5 -echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5 +$as_echo_n "checking whether getnameinfo is declared... " >&6; } if test "${ac_cv_have_decl_getnameinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12241,20 +13310,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_getnameinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getnameinfo=no @@ -12262,9 +13332,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5 -echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6; } -if test $ac_cv_have_decl_getnameinfo = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5 +$as_echo "$ac_cv_have_decl_getnameinfo" >&6; } +if test "x$ac_cv_have_decl_getnameinfo" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETNAMEINFO 1 @@ -12280,12 +13350,13 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for struct addrinfo" >&5 -echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for struct addrinfo" >&5 +$as_echo_n "checking for struct addrinfo... " >&6; } if test "${ac_cv_type_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_struct_addrinfo=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12304,14 +13375,57 @@ cat >>conftest.$ac_ext <<_ACEOF #endif -typedef struct addrinfo ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (struct addrinfo)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif + + +int +main () +{ +if (sizeof ((struct addrinfo))) + return 0; ; return 0; } @@ -12322,30 +13436,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_struct_addrinfo=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_struct_addrinfo=no + ac_cv_type_struct_addrinfo=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6; } -if test $ac_cv_type_struct_addrinfo = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 +$as_echo "$ac_cv_type_struct_addrinfo" >&6; } +if test "x$ac_cv_type_struct_addrinfo" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_ADDRINFO 1 @@ -12358,6 +13481,33 @@ fi + if test -n "$GETOPT_H"; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + + GETOPT_H=getopt.h + +cat >>confdefs.h <<\_ACEOF +#define __GETOPT_PREFIX rpl_ +_ACEOF + @@ -12369,10 +13519,27 @@ fi - { echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 -echo $ECHO_N "checking for gettimeofday with POSIX signature... $ECHO_C" >&6; } + +fi + + + + + + + + + : + + + + + + + { $as_echo "$as_me:$LINENO: checking for gettimeofday with POSIX signature" >&5 +$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; } if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12401,20 +13568,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_func_gettimeofday_posix_signature=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_gettimeofday_posix_signature=no @@ -12422,16 +13590,16 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 -echo "${ECHO_T}$gl_cv_func_gettimeofday_posix_signature" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_posix_signature" >&5 +$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; } - { echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 -echo $ECHO_N "checking whether gettimeofday clobbers localtime buffer... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gettimeofday clobbers localtime buffer" >&5 +$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; } if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then gl_cv_func_gettimeofday_clobber=yes @@ -12470,320 +13638,72 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_gettimeofday_clobber=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_gettimeofday_clobber=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 -echo "${ECHO_T}$gl_cv_func_gettimeofday_clobber" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_func_gettimeofday_clobber" >&5 +$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; } if test $gl_cv_func_gettimeofday_clobber = yes; then REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h - gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" - - -for ac_header in sys/timeb.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_func in _ftime -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -cat >>confdefs.h <<\_ACEOF -#define gmtime rpl_gmtime -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define localtime rpl_localtime -_ACEOF - - - -cat >>confdefs.h <<\_ACEOF -#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 -_ACEOF - - fi - + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" - if test $gl_cv_func_gettimeofday_posix_signature != yes; then - REPLACE_GETTIMEOFDAY=1 - SYS_TIME_H=sys/time.h - if test $gl_cv_func_gettimeofday_clobber != yes; then - gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" for ac_header in sys/timeb.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12799,32 +13719,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -12838,69 +13759,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -12910,11 +13835,11 @@ done for ac_func in _ftime do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12967,35 +13892,323 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +cat >>confdefs.h <<\_ACEOF +#define gmtime rpl_gmtime +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define localtime rpl_localtime +_ACEOF + + + +cat >>confdefs.h <<\_ACEOF +#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1 +_ACEOF + + fi + + + if test $gl_cv_func_gettimeofday_posix_signature != yes; then + REPLACE_GETTIMEOFDAY=1 + SYS_TIME_H=sys/time.h + if test $gl_cv_func_gettimeofday_clobber != yes; then + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext" + + + +for ac_header in sys/timeb.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in _ftime +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -13007,13 +14220,20 @@ done + + + + + + + for ac_func in inet_ntop do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13066,44 +14286,54 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + : @@ -13113,10 +14343,10 @@ done - { echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 -echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5 +$as_echo_n "checking whether inet_ntop is declared... " >&6; } if test "${ac_cv_have_decl_inet_ntop+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13143,20 +14373,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_inet_ntop=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_inet_ntop=no @@ -13164,9 +14395,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5 -echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6; } -if test $ac_cv_have_decl_inet_ntop = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5 +$as_echo "$ac_cv_have_decl_inet_ntop" >&6; } +if test "x$ac_cv_have_decl_inet_ntop" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_INET_NTOP 1 @@ -13203,7 +14434,15 @@ cat >>confdefs.h <<\_ACEOF _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext" + HAVE_MALLOC_POSIX=0 fi @@ -13215,13 +14454,20 @@ _ACEOF + + + + + + + for ac_func in mkdtemp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13274,42 +14520,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + if test $ac_cv_func_mkdtemp = no; then HAVE_MKDTEMP=0 : @@ -13321,10 +14577,10 @@ done GNULIB_MKDTEMP=1 - { echo "$as_me:$LINENO: checking whether is self-contained" >&5 -echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } if test "${gl_cv_header_netinet_in_h_selfcontained+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -13348,20 +14604,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_netinet_in_h_selfcontained=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_netinet_in_h_selfcontained=no @@ -13370,8 +14627,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 -echo "${ECHO_T}$gl_cv_header_netinet_in_h_selfcontained" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_netinet_in_h_selfcontained" >&5 +$as_echo "$gl_cv_header_netinet_in_h_selfcontained" >&6; } if test $gl_cv_header_netinet_in_h_selfcontained = yes; then NETINET_IN_H='' else @@ -13379,20 +14636,21 @@ echo "${ECHO_T}$gl_cv_header_netinet_in_h_selfcontained" >&6; } for ac_header in netinet/in.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13408,32 +14666,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13447,69 +14706,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -13530,10 +14793,10 @@ done if test $gl_cv_have_include_next = yes; then gl_cv_next_netinet_in_h='<'netinet/in.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_netinet_in_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_netinet_in_h = yes; then @@ -13558,8 +14821,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_netinet_in_h" >&5 -echo "${ECHO_T}$gl_cv_next_netinet_in_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_netinet_in_h" >&5 +$as_echo "$gl_cv_next_netinet_in_h" >&6; } fi NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_h @@ -13574,11 +14837,11 @@ echo "${ECHO_T}$gl_cv_next_netinet_in_h" >&6; } fi - { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -13613,12 +14876,20 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + + + + + + + gl_LIBOBJS="$gl_LIBOBJS physmem.$ac_objext" + # Prerequisites of lib/physmem.c. @@ -13632,11 +14903,11 @@ for ac_header in sys/pstat.h sys/sysmp.h sys/sysinfo.h \ machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \ sys/systemcfg.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13654,20 +14925,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -13675,12 +14947,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -13696,11 +14971,11 @@ done for ac_func in pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13753,35 +15028,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -13790,6 +15072,13 @@ done + + + + + + + gl_LIBOBJS="$gl_LIBOBJS safe-read.$ac_objext" @@ -13797,6 +15086,14 @@ done + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS safe-write.$ac_objext" @@ -13807,22 +15104,24 @@ done + for ac_header in stdint.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13838,32 +15137,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13877,77 +15177,81 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done - { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 -echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } result= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13998,13 +15302,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -14035,20 +15340,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -14062,7 +15368,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -14089,13 +15395,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -14126,20 +15433,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -14153,7 +15461,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -14190,20 +15498,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -14240,15 +15549,17 @@ main () long int i = longval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) * CHAR_BIT - 1)) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -14261,29 +15572,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then size_t_bits_minus_1=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) size_t_bits_minus_1= fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val @@ -14313,13 +15627,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -14349,20 +15664,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -14376,7 +15692,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -14402,13 +15718,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -14438,20 +15755,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -14465,7 +15783,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -14501,20 +15819,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -14550,15 +15869,17 @@ main () long int i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -14571,29 +15892,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) fits_in_uint= fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val @@ -14624,20 +15948,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then fits_in_uint=0 else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -14654,8 +15979,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext result='((size_t)~(size_t)0)' fi fi - { echo "$as_me:$LINENO: result: $result" >&5 -echo "${ECHO_T}$result" >&6; } + { $as_echo "$as_me:$LINENO: result: $result" >&5 +$as_echo "$result" >&6; } if test "$result" != yes; then cat >>confdefs.h <<_ACEOF @@ -14669,11 +15994,11 @@ _ACEOF for ac_func in snprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14726,35 +16051,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -14763,7 +16095,15 @@ done if test $ac_cv_func_snprintf = no; then + + + + + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + if test $ac_cv_func_snprintf = yes; then REPLACE_SNPRINTF=1 fi @@ -14785,12 +16125,13 @@ done GNULIB_SNPRINTF=1 - { echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14803,14 +16144,51 @@ cat >>conftest.$ac_ext <<_ACEOF # include #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #if HAVE_SYS_SOCKET_H + # include + #elif HAVE_WS2TCPIP_H + # include + #endif + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -14821,36 +16199,45 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else - { echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 -echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 +$as_echo_n "checking for socklen_t equivalent... " >&6; } if test "${gl_cv_socklen_t_equiv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername @@ -14882,20 +16269,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_socklen_t_equiv="$t" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -14910,12 +16298,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "$gl_cv_socklen_t_equiv" = ""; then - { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 -echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} + { { $as_echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 +$as_echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} { (exit 1); exit 1; }; } fi - { echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 -echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 +$as_echo "$gl_cv_socklen_t_equiv" >&6; } cat >>confdefs.h <<_ACEOF #define socklen_t $gl_cv_socklen_t_equiv @@ -14924,10 +16312,10 @@ _ACEOF fi - { echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${gt_cv_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14951,20 +16339,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gt_cv_ssize_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_ssize_t=no @@ -14972,8 +16361,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 -echo "${ECHO_T}$gt_cv_ssize_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 +$as_echo "$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then cat >>confdefs.h <<\_ACEOF @@ -15046,10 +16435,10 @@ _ACEOF if test $gl_cv_have_include_next = yes; then gl_cv_next_stdint_h='<'stdint.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_stdint_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdint_h = yes; then @@ -15074,8 +16463,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5 -echo "${ECHO_T}$gl_cv_next_stdint_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdint_h" >&5 +$as_echo "$gl_cv_next_stdint_h" >&6; } fi NEXT_STDINT_H=$gl_cv_next_stdint_h @@ -15089,10 +16478,10 @@ echo "${ECHO_T}$gl_cv_next_stdint_h" >&6; } if test $ac_cv_header_stdint_h = yes; then - { echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 -echo $ECHO_N "checking whether stdint.h conforms to C99... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether stdint.h conforms to C99" >&5 +$as_echo_n "checking whether stdint.h conforms to C99... " >&6; } if test "${gl_cv_header_working_stdint_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gl_cv_header_working_stdint_h=no cat >conftest.$ac_ext <<_ACEOF @@ -15268,20 +16657,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_working_stdint_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -15289,8 +16679,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 -echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_working_stdint_h" >&5 +$as_echo "$gl_cv_header_working_stdint_h" >&6; } fi if test "$gl_cv_header_working_stdint_h" = yes; then STDINT_H= @@ -15299,20 +16689,21 @@ echo "${ECHO_T}$gl_cv_header_working_stdint_h" >&6; } for ac_header in sys/inttypes.h sys/bitypes.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15328,32 +16719,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15367,69 +16759,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -15466,10 +16862,10 @@ done for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 -echo $ECHO_N "checking for bit size of $gltype... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for bit size of $gltype" >&5 +$as_echo_n "checking for bit size of $gltype... " >&6; } if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -15507,13 +16903,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15554,20 +16951,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -15581,7 +16979,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -15618,13 +17016,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15665,20 +17064,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -15692,7 +17092,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -15739,20 +17139,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -15799,15 +17200,17 @@ main () long int i = longval (); if (i != (sizeof ($gltype) * CHAR_BIT)) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != (sizeof ($gltype) * CHAR_BIT)) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -15820,38 +17223,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then result=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=unknown fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val eval gl_cv_bitsizeof_${gltype}=\$result fi -ac_res=`eval echo '${'gl_cv_bitsizeof_${gltype}'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'gl_cv_bitsizeof_${gltype}'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval result=\$gl_cv_bitsizeof_${gltype} if test $result = unknown; then result=0 @@ -15871,10 +17278,10 @@ _ACEOF for gltype in sig_atomic_t wchar_t wint_t ; do - { echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 -echo $ECHO_N "checking whether $gltype is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $gltype is signed" >&5 +$as_echo_n "checking whether $gltype is signed... " >&6; } if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15908,20 +17315,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then result=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 result=no @@ -15931,9 +17339,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext eval gl_cv_type_${gltype}_signed=\$result fi -ac_res=`eval echo '${'gl_cv_type_${gltype}_signed'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_signed'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then @@ -15958,10 +17367,10 @@ _ACEOF for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do - { echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 -echo $ECHO_N "checking for $gltype integer literal suffix... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $gltype integer literal suffix" >&5 +$as_echo_n "checking for $gltype integer literal suffix... " >&6; } if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval gl_cv_type_${gltype}_suffix=no eval result=\$gl_cv_type_${gltype}_signed @@ -16014,20 +17423,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval gl_cv_type_${gltype}_suffix=\$glsuf else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16038,9 +17448,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$result" != no && break done fi -ac_res=`eval echo '${'gl_cv_type_${gltype}_suffix'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'gl_cv_type_${gltype}_suffix'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= @@ -16073,10 +17484,10 @@ _ACEOF if test $gl_cv_have_include_next = yes; then gl_cv_next_stdio_h='<'stdio.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_stdio_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdio_h = yes; then @@ -16101,8 +17512,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5 -echo "${ECHO_T}$gl_cv_next_stdio_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdio_h" >&5 +$as_echo "$gl_cv_next_stdio_h" >&6; } fi NEXT_STDIO_H=$gl_cv_next_stdio_h @@ -16125,10 +17536,10 @@ echo "${ECHO_T}$gl_cv_next_stdio_h" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_stdlib_h='<'stdlib.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_stdlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_stdlib_h = yes; then @@ -16153,8 +17564,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5 -echo "${ECHO_T}$gl_cv_next_stdlib_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_stdlib_h" >&5 +$as_echo "$gl_cv_next_stdlib_h" >&6; } fi NEXT_STDLIB_H=$gl_cv_next_stdlib_h @@ -16164,13 +17575,20 @@ echo "${ECHO_T}$gl_cv_next_stdlib_h" >&6; } + + + + + + + for ac_func in strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16223,43 +17641,53 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext" + fi done + : @@ -16279,10 +17707,10 @@ done - { echo "$as_me:$LINENO: checking whether is self-contained" >&5 -echo $ECHO_N "checking whether is self-contained... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether is self-contained" >&5 +$as_echo_n "checking whether is self-contained... " >&6; } if test "${gl_cv_header_sys_socket_h_selfcontained+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16306,20 +17734,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_sys_socket_h_selfcontained=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_sys_socket_h_selfcontained=no @@ -16328,8 +17757,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 -echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_sys_socket_h_selfcontained" >&5 +$as_echo "$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_header_sys_socket_h_selfcontained = yes; then SYS_SOCKET_H='' else @@ -16349,10 +17778,10 @@ echo "${ECHO_T}$gl_cv_header_sys_socket_h_selfcontained" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_sys_socket_h='<'sys/socket.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_sys_socket_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_sys_socket_h = yes; then @@ -16377,8 +17806,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 -echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_socket_h" >&5 +$as_echo "$gl_cv_next_sys_socket_h" >&6; } fi NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_h @@ -16394,20 +17823,21 @@ echo "${ECHO_T}$gl_cv_next_sys_socket_h" >&6; } for ac_header in winsock2.h ws2tcpip.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16423,32 +17853,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16462,69 +17893,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -16548,11 +17983,11 @@ done fi - { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -16587,8 +18022,8 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } @@ -16605,10 +18040,10 @@ echo "${ECHO_T}$MKDIR_P" >&6; } fi - { echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 -echo $ECHO_N "checking whether mkdir is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether mkdir is declared" >&5 +$as_echo_n "checking whether mkdir is declared... " >&6; } if test "${ac_cv_have_decl_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16635,20 +18070,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_mkdir=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_mkdir=no @@ -16656,9 +18092,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 -echo "${ECHO_T}$ac_cv_have_decl_mkdir" >&6; } -if test $ac_cv_have_decl_mkdir = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_mkdir" >&5 +$as_echo "$ac_cv_have_decl_mkdir" >&6; } +if test "x$ac_cv_have_decl_mkdir" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MKDIR 1 @@ -16673,20 +18109,21 @@ _ACEOF for ac_header in io.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16702,32 +18139,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16741,69 +18179,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -16843,10 +18285,10 @@ fi if test $gl_cv_have_include_next = yes; then gl_cv_next_sys_stat_h='<'sys/stat.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_sys_stat_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_sys_stat_h = yes; then @@ -16871,8 +18313,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5 -echo "${ECHO_T}$gl_cv_next_sys_stat_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_sys_stat_h" >&5 +$as_echo "$gl_cv_next_sys_stat_h" >&6; } fi NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h @@ -16881,11 +18323,11 @@ echo "${ECHO_T}$gl_cv_next_sys_stat_h" >&6; } SYS_STAT_H='sys/stat.h' - { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -16920,17 +18362,17 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } - { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -16965,14 +18407,22 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + + + + + + + gl_LIBOBJS="$gl_LIBOBJS tempname.$ac_objext" + : @@ -16993,10 +18443,10 @@ echo "${ECHO_T}$MKDIR_P" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_unistd_h='<'unistd.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_unistd_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_unistd_h = yes; then @@ -17021,8 +18471,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5 -echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_unistd_h" >&5 +$as_echo "$gl_cv_next_unistd_h" >&6; } fi NEXT_UNISTD_H=$gl_cv_next_unistd_h @@ -17061,10 +18511,42 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6; } + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + if test $ac_cv_func_vasnprintf = yes; then cat >>confdefs.h <<\_ACEOF @@ -17082,26 +18564,58 @@ _ACEOF - { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 -echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 +$as_echo_n "checking for ptrdiff_t... " >&6; } if test "${ac_cv_type_ptrdiff_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ptrdiff_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ptrdiff_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (ptrdiff_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((ptrdiff_t))) + return 0; ; return 0; } @@ -17112,33 +18626,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ptrdiff_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_ptrdiff_t=no + ac_cv_type_ptrdiff_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 -echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; } -if test $ac_cv_type_ptrdiff_t = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_PTRDIFF_T 1 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 +$as_echo "$ac_cv_type_ptrdiff_t" >&6; } +if test "x$ac_cv_type_ptrdiff_t" = x""yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define ptrdiff_t long _ACEOF @@ -17155,11 +18680,11 @@ fi for ac_func in snprintf wcslen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17212,44 +18737,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done - { echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 -echo $ECHO_N "checking whether _snprintf is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether _snprintf is declared" >&5 +$as_echo_n "checking whether _snprintf is declared... " >&6; } if test "${ac_cv_have_decl__snprintf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17276,20 +18808,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl__snprintf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl__snprintf=no @@ -17297,9 +18830,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl__snprintf" >&6; } -if test $ac_cv_have_decl__snprintf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl__snprintf" >&5 +$as_echo "$ac_cv_have_decl__snprintf" >&6; } +if test "x$ac_cv_have_decl__snprintf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL__SNPRINTF 1 @@ -17326,10 +18859,10 @@ fi CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then - { echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 -echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for simple visibility declarations" >&5 +$as_echo_n "checking for simple visibility declarations... " >&6; } if test "${gl_cv_cc_visibility+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gl_save_CFLAGS="$CFLAGS" @@ -17358,20 +18891,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_cc_visibility=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_cc_visibility=no @@ -17381,8 +18915,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$gl_save_CFLAGS" fi - { echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 -echo "${ECHO_T}$gl_cv_cc_visibility" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5 +$as_echo "$gl_cv_cc_visibility" >&6; } if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 @@ -17398,10 +18932,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking whether is standalone" >&5 -echo $ECHO_N "checking whether is standalone... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether is standalone" >&5 +$as_echo_n "checking whether is standalone... " >&6; } if test "${gl_cv_header_wchar_h_standalone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF #include @@ -17413,20 +18947,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_header_wchar_h_standalone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_wchar_h_standalone=no @@ -17434,8 +18969,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 -echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_header_wchar_h_standalone" >&5 +$as_echo "$gl_cv_header_wchar_h_standalone" >&6; } if test $gl_cv_header_wchar_h_standalone != yes; then WCHAR_H=wchar.h fi @@ -17467,10 +19002,10 @@ echo "${ECHO_T}$gl_cv_header_wchar_h_standalone" >&6; } if test $gl_cv_have_include_next = yes; then gl_cv_next_wchar_h='<'wchar.h'>' else - { echo "$as_me:$LINENO: checking absolute name of " >&5 -echo $ECHO_N "checking absolute name of ... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } if test "${gl_cv_next_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $ac_cv_header_wchar_h = yes; then @@ -17495,8 +19030,8 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5 -echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gl_cv_next_wchar_h" >&5 +$as_echo "$gl_cv_next_wchar_h" >&6; } fi NEXT_WCHAR_H=$gl_cv_next_wchar_h @@ -17509,20 +19044,21 @@ echo "${ECHO_T}$gl_cv_next_wchar_h" >&6; } for ac_header in stdint.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17538,32 +19074,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17577,69 +19114,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -17651,6 +19192,16 @@ done + gltests_libdeps= + gltests_ltlibdeps= + + + + gl_source_base='tests' + + + + @@ -17663,8 +19214,8 @@ if test "${with_cflags+set}" = set; then withval=$with_cflags; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-cflags option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-cflags option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -17680,8 +19231,8 @@ if test "${with_includes+set}" = set; then withval=$with_includes; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -17691,8 +19242,8 @@ echo "$as_me: error: *** You must supply an argument to the --with-includes opti CPPFLAGS="$CPPFLAGS -I$dir" else - { echo "$as_me:$LINENO: WARNING: Include directory $dir does not exist." >&5 -echo "$as_me: WARNING: Include directory $dir does not exist." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Include directory $dir does not exist." >&5 +$as_echo "$as_me: WARNING: Include directory $dir does not exist." >&2;} cat <>config.warnings @@ -17712,8 +19263,8 @@ if test "${with_libraries+set}" = set; then withval=$with_libraries; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -17728,8 +19279,8 @@ echo "$as_me: error: *** You must supply an argument to the --with-libraries opt LDFLAGS="$LDFLAGS -L$dir" else - { echo "$as_me:$LINENO: WARNING: Library directory $dir does not exist." >&5 -echo "$as_me: WARNING: Library directory $dir does not exist." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Library directory $dir does not exist." >&5 +$as_echo "$as_me: WARNING: Library directory $dir does not exist." >&2;} cat <>config.warnings @@ -17743,27 +19294,69 @@ AAW_EOF fi + # Disable strict-aliasing optimizations + + # test for -W'feature', then add the 'no-' version. + + + + { $as_echo "$as_me:$LINENO: checking for gcc flag -fstrict-aliasing" >&5 +$as_echo_n "checking for gcc flag -fstrict-aliasing... " >&6; } + if test "x$GCC" = "xyes"; then + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-fstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + found_warning=no + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + else + found_warning=no + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + CFLAGS="$CFLAGS -fno-strict-aliasing" + + CPPFLAGS="$CPPFLAGS -fno-strict-aliasing" + + + else + : + fi + + + # Warn for just about everything - { echo "$as_me:$LINENO: checking for gcc flag -Wall" >&5 -echo $ECHO_N "checking for gcc flag -Wall... $ECHO_C" >&6; } + + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wall" >&5 +$as_echo_n "checking for gcc flag -Wall... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wall[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wall[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -17775,27 +19368,30 @@ echo "${ECHO_T}no (not using gcc)" >&6; } fi + # And add any extra warnings too - { echo "$as_me:$LINENO: checking for gcc flag -Wextra" >&5 -echo $ECHO_N "checking for gcc flag -Wextra... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wextra" >&5 +$as_echo_n "checking for gcc flag -Wextra... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wextra[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wextra[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -17806,23 +19402,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -W" >&5 -echo $ECHO_N "checking for gcc flag -W... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -W" >&5 +$as_echo_n "checking for gcc flag -W... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '^[:alnum:]-W^[:alnum:]-' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '^[:alnum:]-W^[:alnum:]-' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -17853,8 +19451,8 @@ if test "${with_user+set}" = set; then withval=$with_user; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;} { (exit 1); exit 1; }; } ;; *) @@ -17865,8 +19463,8 @@ echo "$as_me: error: *** You must supply an argument to the --with-user option." else - { echo "$as_me:$LINENO: WARNING: no user specified (--with-user) -- using 'amanda'" >&5 -echo "$as_me: WARNING: no user specified (--with-user) -- using 'amanda'" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: no user specified (--with-user) -- using 'amanda'" >&5 +$as_echo "$as_me: WARNING: no user specified (--with-user) -- using 'amanda'" >&2;} cat <>config.warnings @@ -17894,8 +19492,8 @@ if test "${with_group+set}" = set; then withval=$with_group; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;} { (exit 1); exit 1; }; } ;; *) SETUID_GROUP="$withval" @@ -17905,8 +19503,8 @@ echo "$as_me: error: *** You must supply an argument to the --with-group option. else - { echo "$as_me:$LINENO: WARNING: no group specified (--with-group) -- using 'backup'" >&5 -echo "$as_me: WARNING: no group specified (--with-group) -- using 'backup'" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: no group specified (--with-group) -- using 'backup'" >&5 +$as_echo "$as_me: WARNING: no group specified (--with-group) -- using 'backup'" >&2;} cat <>config.warnings @@ -17927,8 +19525,8 @@ fi if test "${with_dumperdir+set}" = set; then withval=$with_dumperdir; - { echo "$as_me:$LINENO: WARNING: --with-dumperdir is no longer used." >&5 -echo "$as_me: WARNING: --with-dumperdir is no longer used." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: --with-dumperdir is no longer used." >&5 +$as_echo "$as_me: WARNING: --with-dumperdir is no longer used." >&2;} cat <>config.warnings @@ -17948,8 +19546,8 @@ if test "${with_configdir+set}" = set; then withval=$with_configdir; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;} { (exit 1); exit 1; }; } ;; *) CONFIG_DIR="$withval" @@ -17985,8 +19583,8 @@ _ACEOF # Check whether --with-indexdir was given. if test "${with_indexdir+set}" = set; then - withval=$with_indexdir; { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&2;} + withval=$with_indexdir; { { $as_echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&5 +$as_echo "$as_me: error: *** --with-indexdir is deprecated; use indexdir in amanda.conf instead." >&2;} { (exit 1); exit 1; }; } fi @@ -17996,8 +19594,8 @@ fi # Check whether --with-dbdir was given. if test "${with_dbdir+set}" = set; then - withval=$with_dbdir; { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&2;} + withval=$with_dbdir; { { $as_echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&5 +$as_echo "$as_me: error: *** --with-dbdir is deprecated; use infofile in amanda.conf instead." >&2;} { (exit 1); exit 1; }; } fi @@ -18007,8 +19605,8 @@ fi # Check whether --with-logdir was given. if test "${with_logdir+set}" = set; then - withval=$with_logdir; { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&5 -echo "$as_me: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&2;} + withval=$with_logdir; { { $as_echo "$as_me:$LINENO: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&5 +$as_echo "$as_me: error: *** --with-logdir is deprecated; use logfile in amanda.conf instead." >&2;} { (exit 1); exit 1; }; } fi @@ -18062,8 +19660,8 @@ EOF_SED ;; n | no) USE_VERSION_SUFFIXES=no ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18113,8 +19711,8 @@ _ACEOF # Check whether --with-gnutar-listed-incremental was given. if test "${with_gnutar_listed_incremental+set}" = set; then withval=$with_gnutar_listed_incremental; - { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&5 -echo "$as_me: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&2;} + { { $as_echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&5 +$as_echo "$as_me: error: *** The gnutar-listed-incremental option is deprecated; use --with-gnutar-listdir instead" >&2;} { (exit 1); exit 1; }; } @@ -18137,8 +19735,8 @@ fi case "$tmpdir" in - n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5 -echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;} + n | no) { { $as_echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5 +$as_echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;} { (exit 1); exit 1; }; };; y | ye | yes) AMANDA_TMPDIR="/tmp/amanda";; *) AMANDA_TMPDIR="$tmpdir";; @@ -18174,6 +19772,7 @@ fi case "$CHECK_USERID" in y | ye | yes) + CHECK_USERID=1 cat >>confdefs.h <<\_ACEOF #define CHECK_USERID 1 @@ -18181,23 +19780,25 @@ _ACEOF ;; n | no) : + CHECK_USERID= ;; *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;} { (exit 1); exit 1; }; } esac + # Check whether --with-owner was given. if test "${with_owner+set}" = set; then withval=$with_owner; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;} { (exit 1); exit 1; }; } ;; *) BINARY_OWNER="$withval" @@ -18237,8 +19838,8 @@ cat >>confdefs.h <<\_ACEOF _ACEOF ;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-fqdn option." >&5 -echo "$as_me: error: You must not supply an argument to --with-fqdn option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-fqdn option." >&5 +$as_echo "$as_me: error: You must not supply an argument to --with-fqdn option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18250,8 +19851,8 @@ if test "${with_reuseports+set}" = set; then withval=$with_reuseports; case "$withval" in y | ye | yes) USE_REUSEADDR=no;; n | no) USE_REUSEADDR=yes;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --without-reuseports" >&5 -echo "$as_me: error: You must not supply an argument to --without-reuseports" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --without-reuseports" >&5 +$as_echo "$as_me: error: You must not supply an argument to --without-reuseports" >&2;} { (exit 1); exit 1; }; };; esac @@ -18279,21 +19880,21 @@ fi if test x"$LOW_TCPPORTRANGE" != x"unlimited"; then if test x`echo "$LOW_TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&2;} + { { $as_echo "$as_me:$LINENO: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&5 +$as_echo "$as_me: error: --with-low-tcpportrange requires two comma-separated positive numbers" >&2;} { (exit 1); exit 1; }; } fi min_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/,.*//'` max_low_tcp_port=`echo "$LOW_TCPPORTRANGE" | sed 's/.*,//'` if test $min_low_tcp_port -gt $max_low_tcp_port; then - { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5 -echo "$as_me: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;} + { { $as_echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&5 +$as_echo "$as_me: error: the second TCP port number must be greater than the first in --with-low-tcpportrange" >&2;} { (exit 1); exit 1; }; } fi if test $min_low_tcp_port -lt 512; then - { echo "$as_me:$LINENO: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5 -echo "$as_me: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&5 +$as_echo "$as_me: WARNING: the low TCP port range should be 512 or greater in --with-low-tcpportrange" >&2;} cat <>config.warnings @@ -18304,8 +19905,8 @@ AAW_EOF fi if test $max_low_tcp_port -ge 1024; then - { echo "$as_me:$LINENO: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5 -echo "$as_me: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&5 +$as_echo "$as_me: WARNING: the low TCP port range should be less than 1024 in --with-low-tcpportrange" >&2;} cat <>config.warnings @@ -18332,21 +19933,21 @@ fi if test x"$TCPPORTRANGE" != x"unlimited"; then if test x`echo "$TCPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: --with-tcpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: --with-tcpportrange requires two comma-separated positive numbers" >&2;} + { { $as_echo "$as_me:$LINENO: error: --with-tcpportrange requires two comma-separated positive numbers" >&5 +$as_echo "$as_me: error: --with-tcpportrange requires two comma-separated positive numbers" >&2;} { (exit 1); exit 1; }; } fi min_tcp_port=`echo "$TCPPORTRANGE" | sed 's/,.*//'` max_tcp_port=`echo "$TCPPORTRANGE" | sed 's/.*,//'` if test $min_tcp_port -gt $max_tcp_port; then - { { echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&5 -echo "$as_me: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&2;} + { { $as_echo "$as_me:$LINENO: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&5 +$as_echo "$as_me: error: the second TCP port number must be greater than the first in --with-tcpportrange" >&2;} { (exit 1); exit 1; }; } fi if test $min_tcp_port -lt 1024; then - { echo "$as_me:$LINENO: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&5 -echo "$as_me: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&5 +$as_echo "$as_me: WARNING: the TCP port range should be 1024 or greater in --with-tcpportrange" >&2;} cat <>config.warnings @@ -18357,8 +19958,8 @@ AAW_EOF fi if test $max_tcp_port -ge 65536; then - { echo "$as_me:$LINENO: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&5 -echo "$as_me: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&5 +$as_echo "$as_me: WARNING: the TCP port range should be less than 65536 in --with-tcpportrange" >&2;} cat <>config.warnings @@ -18384,21 +19985,21 @@ fi if test x"$UDPPORTRANGE" != x"unlimited"; then if test x`echo "$UDPPORTRANGE" | sed 's/[0-9][0-9]*,[0-9][0-9]*//'` != x""; then - { { echo "$as_me:$LINENO: error: --with-udpportrange requires two comma-separated positive numbers" >&5 -echo "$as_me: error: --with-udpportrange requires two comma-separated positive numbers" >&2;} + { { $as_echo "$as_me:$LINENO: error: --with-udpportrange requires two comma-separated positive numbers" >&5 +$as_echo "$as_me: error: --with-udpportrange requires two comma-separated positive numbers" >&2;} { (exit 1); exit 1; }; } fi min_udp_port=`echo "$UDPPORTRANGE" | sed 's/,.*//'` max_udp_port=`echo "$UDPPORTRANGE" | sed 's/.*,//'` if test $min_udp_port -gt $max_udp_port; then - { { echo "$as_me:$LINENO: error: the second UDP port number must be greater than the first in --with-udpportrange" >&5 -echo "$as_me: error: the second UDP port number must be greater than the first in --with-udpportrange" >&2;} + { { $as_echo "$as_me:$LINENO: error: the second UDP port number must be greater than the first in --with-udpportrange" >&5 +$as_echo "$as_me: error: the second UDP port number must be greater than the first in --with-udpportrange" >&2;} { (exit 1); exit 1; }; } fi if test $max_udp_port -ge 1024; then - { echo "$as_me:$LINENO: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&5 -echo "$as_me: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&5 +$as_echo "$as_me: WARNING: the UDP port range should be less than 1025 in --with-udpportrange" >&2;} cat <>config.warnings @@ -18409,8 +20010,8 @@ AAW_EOF fi if test $min_udp_port -le 0; then - { echo "$as_me:$LINENO: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&5 -echo "$as_me: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&5 +$as_echo "$as_me: WARNING: the UDP port range should be greater than 0 in --with-udpportrange" >&2;} cat <>config.warnings @@ -18428,6 +20029,9 @@ _ACEOF + + + # Check whether --with-buffered-dump was given. if test "${with_buffered_dump+set}" = set; then withval=$with_buffered_dump; DUMPER_SOCKET_BUFFERING=$withval @@ -18444,8 +20048,8 @@ cat >>confdefs.h <<\_ACEOF _ACEOF ;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-buffered-dump." >&5 -echo "$as_me: error: You must not supply an argument to --with-buffered-dump." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-buffered-dump." >&5 +$as_echo "$as_me: error: You must not supply an argument to --with-buffered-dump." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18453,21 +20057,22 @@ echo "$as_me: error: You must not supply an argument to --with-buffered-dump." > # Check whether --with-maxtapeblocksize was given. if test "${with_maxtapeblocksize+set}" = set; then - withval=$with_maxtapeblocksize; MAXTAPEBLOCKSIZE="$withval" -else - MAXTAPEBLOCKSIZE=32 + withval=$with_maxtapeblocksize; + { $as_echo "$as_me:$LINENO: WARNING: --with-maxtapeblocksize is no longer needed" >&5 +$as_echo "$as_me: WARNING: --with-maxtapeblocksize is no longer needed" >&2;} -fi + cat <>config.warnings +--with-maxtapeblocksize is no longer needed +AAW_EOF -cat >>confdefs.h <<_ACEOF -#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE) -_ACEOF +fi + ASSERTIONS= # Check whether --with-assertions was given. if test "${with_assertions+set}" = set; then @@ -18475,14 +20080,15 @@ if test "${with_assertions+set}" = set; then case "$withval" in n | no) : ;; y | ye | yes) + ASSERTIONS=1 cat >>confdefs.h <<\_ACEOF #define ASSERTIONS 1 _ACEOF ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18494,6 +20100,7 @@ fi + # Check whether --with-debugging was given. if test "${with_debugging+set}" = set; then withval=$with_debugging; debugging="$withval" @@ -18504,8 +20111,8 @@ fi case "$debugging" in - n | no) { { echo "$as_me:$LINENO: error: Amanda no longer supports building with debugging disabled" >&5 -echo "$as_me: error: Amanda no longer supports building with debugging disabled" >&2;} + n | no) { { $as_echo "$as_me:$LINENO: error: Amanda no longer supports building with debugging disabled" >&5 +$as_echo "$as_me: error: Amanda no longer supports building with debugging disabled" >&2;} { (exit 1); exit 1; }; };; y | ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";; *) AMANDA_DBGDIR="$debugging";; @@ -18551,8 +20158,8 @@ fi AMANDA_DEBUG_DAYS=4 ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9]) AMANDA_DEBUG_DAYS="$debug_days" ;; - *) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5 -echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5 +$as_echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18678,8 +20285,8 @@ if test "${with_server+set}" = set; then case "$withval" in y | ye | yes) WANT_SERVER=true;; n | no) WANT_SERVER=false;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-server option." >&5 -echo "$as_me: error: You must not supply an argument to the --without-server option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to the --without-server option." >&5 +$as_echo "$as_me: error: You must not supply an argument to the --without-server option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18695,8 +20302,8 @@ if test "${with_client+set}" = set; then case "$withval" in y | ye | yes) WANT_CLIENT=true;; n | no) WANT_CLIENT=false;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to the --without-client option." >&5 -echo "$as_me: error: You must not supply an argument to the --without-client option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to the --without-client option." >&5 +$as_echo "$as_me: error: You must not supply an argument to the --without-client option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18713,8 +20320,8 @@ if test "${with_restore+set}" = set; then case "$withval" in y | ye | yes) WANT_RESTORE=true;; n | no) WANT_RESTORE=false;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-restore option." >&5 -echo "$as_me: error: You must not supply an argument to --with-restore option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-restore option." >&5 +$as_echo "$as_me: error: You must not supply an argument to --with-restore option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18731,8 +20338,8 @@ if test "${with_amrecover+set}" = set; then case "$withval" in y | ye | yes) WANT_RECOVER=false;; n | no) WANT_RECOVER=false;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-amrecover option." >&5 -echo "$as_me: error: You must not supply an argument to --with-amrecover option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-amrecover option." >&5 +$as_echo "$as_me: error: You must not supply an argument to --with-amrecover option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18743,8 +20350,8 @@ fi # Check whether --with-client-only was given. if test "${with_client_only+set}" = set; then - withval=$with_client_only; { { echo "$as_me:$LINENO: error: --with-client-only is deprecated, use --without-server instead." >&5 -echo "$as_me: error: --with-client-only is deprecated, use --without-server instead." >&2;} + withval=$with_client_only; { { $as_echo "$as_me:$LINENO: error: --with-client-only is deprecated, use --without-server instead." >&5 +$as_echo "$as_me: error: --with-client-only is deprecated, use --without-server instead." >&2;} { (exit 1); exit 1; }; } fi @@ -18754,8 +20361,8 @@ fi # Check whether --with-server-only was given. if test "${with_server_only+set}" = set; then - withval=$with_server_only; { { echo "$as_me:$LINENO: error: --with-server-only is deprecated, use --without-client instead." >&5 -echo "$as_me: error: --with-server-only is deprecated, use --without-client instead." >&2;} + withval=$with_server_only; { { $as_echo "$as_me:$LINENO: error: --with-server-only is deprecated, use --without-client instead." >&5 +$as_echo "$as_me: error: --with-server-only is deprecated, use --without-client instead." >&2;} { (exit 1); exit 1; }; } fi @@ -18769,13 +20376,13 @@ fi # detect invalid combinations of components if ! ${WANT_SERVER-true} && ${WANT_RESTORE-true}; then - { { echo "$as_me:$LINENO: error: --without-server requires --without-restore" >&5 -echo "$as_me: error: --without-server requires --without-restore" >&2;} + { { $as_echo "$as_me:$LINENO: error: --without-server requires --without-restore" >&5 +$as_echo "$as_me: error: --without-server requires --without-restore" >&2;} { (exit 1); exit 1; }; } fi if ! ${WANT_CLIENT-true} && ${WANT_RECOVER-true}; then - { { echo "$as_me:$LINENO: error: --without-client requires --without-amrecover" >&5 -echo "$as_me: error: --without-client requires --without-amrecover" >&2;} + { { $as_echo "$as_me:$LINENO: error: --without-client requires --without-amrecover" >&5 +$as_echo "$as_me: error: --without-client requires --without-amrecover" >&2;} { (exit 1); exit 1; }; } fi @@ -18852,10 +20459,10 @@ fi else # Extract the first word of "gnuplot", so it can be a program name with args. set dummy gnuplot; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GNUPLOT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GNUPLOT in [\\/]* | ?:[\\/]*) @@ -18870,7 +20477,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -18882,11 +20489,11 @@ esac fi GNUPLOT=$ac_cv_path_GNUPLOT if test -n "$GNUPLOT"; then - { echo "$as_me:$LINENO: result: $GNUPLOT" >&5 -echo "${ECHO_T}$GNUPLOT" >&6; } + { $as_echo "$as_me:$LINENO: result: $GNUPLOT" >&5 +$as_echo "$GNUPLOT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -18899,10 +20506,10 @@ fi # Extract the first word of "pcat", so it can be a program name with args. set dummy pcat; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PCAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PCAT in [\\/]* | ?:[\\/]*) @@ -18917,7 +20524,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -18929,11 +20536,11 @@ esac fi PCAT=$ac_cv_path_PCAT if test -n "$PCAT"; then - { echo "$as_me:$LINENO: result: $PCAT" >&5 -echo "${ECHO_T}$PCAT" >&6; } + { $as_echo "$as_me:$LINENO: result: $PCAT" >&5 +$as_echo "$PCAT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -18942,10 +20549,10 @@ fi # Extract the first word of "compress", so it can be a program name with args. set dummy compress; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_COMPRESS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $COMPRESS in [\\/]* | ?:[\\/]*) @@ -18960,7 +20567,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -18972,11 +20579,11 @@ esac fi COMPRESS=$ac_cv_path_COMPRESS if test -n "$COMPRESS"; then - { echo "$as_me:$LINENO: result: $COMPRESS" >&5 -echo "${ECHO_T}$COMPRESS" >&6; } + { $as_echo "$as_me:$LINENO: result: $COMPRESS" >&5 +$as_echo "$COMPRESS" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -18985,10 +20592,10 @@ fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GZIP in [\\/]* | ?:[\\/]*) @@ -19003,7 +20610,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19015,11 +20622,11 @@ esac fi GZIP=$ac_cv_path_GZIP if test -n "$GZIP"; then - { echo "$as_me:$LINENO: result: $GZIP" >&5 -echo "${ECHO_T}$GZIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $GZIP" >&5 +$as_echo "$GZIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19060,8 +20667,8 @@ fi else WANT_AMPLOT=false - { echo "$as_me:$LINENO: WARNING: Not building 'amplot', because gnuplot was not found" >&5 -echo "$as_me: WARNING: Not building 'amplot', because gnuplot was not found" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Not building 'amplot', because gnuplot was not found" >&5 +$as_echo "$as_me: WARNING: Not building 'amplot', because gnuplot was not found" >&2;} cat <>config.warnings @@ -19128,10 +20735,10 @@ if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) @@ -19146,7 +20753,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19158,11 +20765,11 @@ esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then - { echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6; } + { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19175,8 +20782,8 @@ else XSLTPROC="$ac_with_xsltproc"; else - { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&5 -echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&5 +$as_echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't executable; searching for an alternative." >&2;} cat <>config.warnings @@ -19188,10 +20795,10 @@ AAW_EOF do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) @@ -19206,7 +20813,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19218,11 +20825,11 @@ esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then - { echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6; } + { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19242,10 +20849,10 @@ fi - { echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5 -echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5 +$as_echo_n "checking for Docbook XSLT version 1.72.0... " >&6; } if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_docbook_xslt_1_72_0=no @@ -19259,8 +20866,8 @@ else fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5 -echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5 +$as_echo "$ac_cv_docbook_xslt_1_72_0" >&6; } HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0" HAVE_DOCBOOK_XSLT="$HAVE_DOCBOOK_XSLT_1_72_0" @@ -19272,10 +20879,10 @@ echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6; } - { echo "$as_me:$LINENO: checking for current Docbook XSLT version" >&5 -echo $ECHO_N "checking for current Docbook XSLT version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for current Docbook XSLT version" >&5 +$as_echo_n "checking for current Docbook XSLT version... " >&6; } if test "${ac_cv_docbook_xslt_current_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_docbook_xslt_current_version=no @@ -19309,16 +20916,16 @@ EOF fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_current_version" >&5 -echo "${ECHO_T}$ac_cv_docbook_xslt_current_version" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_current_version" >&5 +$as_echo "$ac_cv_docbook_xslt_current_version" >&6; } DOCBOOK_XSLT_CURRENT_VERSION="$ac_cv_docbook_xslt_current_version" - { echo "$as_me:$LINENO: checking whether Docbook XSLT version is 1.72.0 or newer" >&5 -echo $ECHO_N "checking whether Docbook XSLT version is 1.72.0 or newer... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether Docbook XSLT version is 1.72.0 or newer" >&5 +$as_echo_n "checking whether Docbook XSLT version is 1.72.0 or newer... " >&6; } if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else # Used to indicate true or false condition @@ -19358,11 +20965,11 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version if test x"$DOCBOOK_XSLT_CURRENT_VERSION" = x"no"; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else - { echo "$as_me:$LINENO: result: yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&5 -echo "${ECHO_T}yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&6; } + { $as_echo "$as_me:$LINENO: result: yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&5 +$as_echo "yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&6; } fi fi @@ -19375,10 +20982,10 @@ echo "${ECHO_T}yes ($DOCBOOK_XSLT_CURRENT_VERSION)" >&6; } - { echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5 -echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5 +$as_echo_n "checking for Docbook DTD version 4.1.2... " >&6; } if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_docbook_dtd_4_1_2=no @@ -19411,8 +21018,8 @@ EOF fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5 -echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5 +$as_echo "$ac_cv_docbook_dtd_4_1_2" >&6; } HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2" HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_1_2" @@ -19430,10 +21037,10 @@ echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6; } - { echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5 -echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5 +$as_echo_n "checking for Docbook DTD version 4.2... " >&6; } if test "${ac_cv_docbook_dtd_4_2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_docbook_dtd_4_2=no @@ -19466,8 +21073,8 @@ EOF fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5 -echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5 +$as_echo "$ac_cv_docbook_dtd_4_2" >&6; } HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2" HAVE_DOCBOOK_DTD="$HAVE_DOCBOOK_DTD_4_2" @@ -19478,8 +21085,8 @@ echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6; } if test -z "$XSLTPROC"; then - { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5 -echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5 +$as_echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;} { (exit 1); exit 1; }; } fi @@ -19488,8 +21095,8 @@ echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;} XSLREL=current if test "x$DOCBOOK_XSLT_CURRENT_VERSION" = "xno"; then if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then - { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&5 -echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&2;} + { { $as_echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&5 +$as_echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 or higher required." >&2;} { (exit 1); exit 1; }; } else XSLREL=1.72.0 @@ -19499,8 +21106,8 @@ echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 or higher req # disable validation if the correct DTDs are not available if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then - { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5 -echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5 +$as_echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;} cat <>config.warnings @@ -19524,14 +21131,18 @@ fi + #allow configure CONFIG_CLOBBER_MY_CONFIG= to be used by make. + CONFIG_CLOBBER_MY_CONFIG=$CLOBBER_MY_CONFIG + + # Check whether --with-index-server was given. if test "${with_index_server+set}" = set; then withval=$with_index_server; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;} { (exit 1); exit 1; }; } ;; *) DEFAULT_SERVER="$withval" @@ -19556,8 +21167,8 @@ if test "${with_config+set}" = set; then withval=$with_config; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;} { (exit 1); exit 1; }; } ;; *) DEFAULT_CONFIG="$withval" @@ -19582,8 +21193,8 @@ if test "${with_tape_server+set}" = set; then withval=$with_tape_server; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;} { (exit 1); exit 1; }; } ;; *) DEFAULT_TAPE_SERVER="$withval" @@ -19608,8 +21219,8 @@ if test "${with_tape_device+set}" = set; then withval=$with_tape_device; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;} { (exit 1); exit 1; }; } ;; *) DEFAULT_TAPE_DEVICE="$withval" @@ -19640,8 +21251,8 @@ if test "${with_changer_device+set}" = set; then withval=$with_changer_device; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;} { (exit 1); exit 1; }; } ;; *) DEFAULT_CHANGER_DEVICE="$withval" @@ -19671,8 +21282,8 @@ _ACEOF if test "${with_amandates+set}" = set; then withval=$with_amandates; case "$withval" in - n | no) { { echo "$as_me:$LINENO: error: *** --without-amandates is not allowed." >&5 -echo "$as_me: error: *** --without-amandates is not allowed." >&2;} + n | no) { { $as_echo "$as_me:$LINENO: error: *** --without-amandates is not allowed." >&5 +$as_echo "$as_me: error: *** --without-amandates is not allowed." >&2;} { (exit 1); exit 1; }; };; y | ye | yes) amandates='$localstatedir/amanda/amandates' ;; *) amandates="$withval";; @@ -19706,10 +21317,10 @@ _ACEOF # Extract the first word of "getconf", so it can be a program name with args. set dummy getconf; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GETCONF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GETCONF in [\\/]* | ?:[\\/]*) @@ -19724,7 +21335,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GETCONF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19736,11 +21347,11 @@ esac fi GETCONF=$ac_cv_path_GETCONF if test -n "$GETCONF"; then - { echo "$as_me:$LINENO: result: $GETCONF" >&5 -echo "${ECHO_T}$GETCONF" >&6; } + { $as_echo "$as_me:$LINENO: result: $GETCONF" >&5 +$as_echo "$GETCONF" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19760,10 +21371,10 @@ fi # Checks for compilers, typedefs, structures, and compiler characteristics. # Check for large file compilation environment. NEED_RESETOFS=yes - { echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5 -echo $ECHO_N "checking for large file compilation CFLAGS... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for large file compilation CFLAGS" >&5 +$as_echo_n "checking for large file compilation CFLAGS... " >&6; } if test "${amanda_cv_LFS_CFLAGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else amanda_cv_LFS_CFLAGS= @@ -19776,15 +21387,15 @@ else fi -{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_CFLAGS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_LFS_CFLAGS" >&5 +$as_echo "$amanda_cv_LFS_CFLAGS" >&6; } CFLAGS="$CFLAGS $amanda_cv_LFS_CFLAGS" - { echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5 -echo $ECHO_N "checking for large file compilation LDFLAGS... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for large file compilation LDFLAGS" >&5 +$as_echo_n "checking for large file compilation LDFLAGS... " >&6; } if test "${amanda_cv_LFS_LDFLAGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else amanda_cv_LFS_LDFLAGS= @@ -19797,15 +21408,15 @@ else fi -{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_LDFLAGS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_LFS_LDFLAGS" >&5 +$as_echo "$amanda_cv_LFS_LDFLAGS" >&6; } LDFLAGS="$LDFLAGS $amanda_cv_LFS_LDFLAGS" - { echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5 -echo $ECHO_N "checking for large file compilation LIBS... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for large file compilation LIBS" >&5 +$as_echo_n "checking for large file compilation LIBS... " >&6; } if test "${amanda_cv_LFS_LIBS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else amanda_cv_LFS_LIBS= @@ -19818,8 +21429,8 @@ else fi -{ echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5 -echo "${ECHO_T}$amanda_cv_LFS_LIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_LFS_LIBS" >&5 +$as_echo "$amanda_cv_LFS_LIBS" >&6; } LIBS="$amanda_cv_LFS_LIBS $LIBS" @@ -19835,10 +21446,10 @@ _ACEOF # Extract the first word of "chio", so it can be a program name with args. set dummy chio; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CHIO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CHIO in [\\/]* | ?:[\\/]*) @@ -19853,7 +21464,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHIO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19866,11 +21477,11 @@ esac fi CHIO=$ac_cv_path_CHIO if test -n "$CHIO"; then - { echo "$as_me:$LINENO: result: $CHIO" >&5 -echo "${ECHO_T}$CHIO" >&6; } + { $as_echo "$as_me:$LINENO: result: $CHIO" >&5 +$as_echo "$CHIO" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19879,10 +21490,10 @@ fi # Extract the first word of "chs", so it can be a program name with args. set dummy chs; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CHS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CHS in [\\/]* | ?:[\\/]*) @@ -19897,7 +21508,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CHS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19910,11 +21521,11 @@ esac fi CHS=$ac_cv_path_CHS if test -n "$CHS"; then - { echo "$as_me:$LINENO: result: $CHS" >&5 -echo "${ECHO_T}$CHS" >&6; } + { $as_echo "$as_me:$LINENO: result: $CHS" >&5 +$as_echo "$CHS" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19923,10 +21534,10 @@ fi # Extract the first word of "mtx", so it can be a program name with args. set dummy mtx; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MTX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MTX in [\\/]* | ?:[\\/]*) @@ -19941,7 +21552,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19954,11 +21565,11 @@ esac fi MTX=$ac_cv_path_MTX if test -n "$MTX"; then - { echo "$as_me:$LINENO: result: $MTX" >&5 -echo "${ECHO_T}$MTX" >&6; } + { $as_echo "$as_me:$LINENO: result: $MTX" >&5 +$as_echo "$MTX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -19967,10 +21578,10 @@ fi # Extract the first word of "mcutil", so it can be a program name with args. set dummy mcutil; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MCUTIL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MCUTIL in [\\/]* | ?:[\\/]*) @@ -19985,7 +21596,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MCUTIL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -19998,11 +21609,11 @@ esac fi MCUTIL=$ac_cv_path_MCUTIL if test -n "$MCUTIL"; then - { echo "$as_me:$LINENO: result: $MCUTIL" >&5 -echo "${ECHO_T}$MCUTIL" >&6; } + { $as_echo "$as_me:$LINENO: result: $MCUTIL" >&5 +$as_echo "$MCUTIL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20041,30 +21652,22 @@ for ac_header in \ sys/scsi.h \ sys/scsiio.h \ sys/scsi/impl/uscsi.h \ - sys/scsi/scsi/ioctl.h \ - + sys/scsi/scsi/ioctl.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } + $as_echo_n "(cached) " >&6 else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + #include <$ac_header> _ACEOF rm -f conftest.$ac_objext @@ -20073,109 +21676,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF + \ fi @@ -20186,10 +21719,10 @@ done # chio support # if test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5 -echo $ECHO_N "checking for HP/UX-like scsi changer support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for HP/UX-like scsi changer support" >&5 +$as_echo_n "checking for HP/UX-like scsi changer support... " >&6; } if test "${amanda_cv_hpux_scsi_chio+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20219,20 +21752,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_hpux_scsi_chio=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_hpux_scsi_chio=no @@ -20240,8 +21774,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5 -echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi_chio" >&5 +$as_echo "$amanda_cv_hpux_scsi_chio" >&6; } if test x"$amanda_cv_hpux_scsi_chio" = x"yes"; then WANT_SCSI_HPUX=yes WANT_CHG_SCSI=yes @@ -20253,10 +21787,10 @@ echo "${ECHO_T}$amanda_cv_hpux_scsi_chio" >&6; } # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_scsi_scsi_ioctl_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5 -echo $ECHO_N "checking for Linux like scsi support (ioctl)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Linux like scsi support (ioctl)" >&5 +$as_echo_n "checking for Linux like scsi support (ioctl)... " >&6; } if test "${amanda_cv_linux_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20286,20 +21820,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_linux_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_linux_scsi=no @@ -20307,8 +21842,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5 -echo "${ECHO_T}$amanda_cv_linux_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_linux_scsi" >&5 +$as_echo "$amanda_cv_linux_scsi" >&6; } fi # @@ -20316,10 +21851,10 @@ echo "${ECHO_T}$amanda_cv_linux_scsi" >&6; } # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_scsi_sg_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5 -echo $ECHO_N "checking for Linux like scsi support (sg)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Linux like scsi support (sg)" >&5 +$as_echo_n "checking for Linux like scsi support (sg)... " >&6; } if test "${amanda_cv_linux_sg_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20351,20 +21886,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_linux_sg_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_linux_sg_scsi=no @@ -20372,8 +21908,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5 -echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_linux_sg_scsi" >&5 +$as_echo "$amanda_cv_linux_sg_scsi" >&6; } fi if test x"$amanda_cv_linux_scsi" = x"yes" || @@ -20387,10 +21923,10 @@ echo "${ECHO_T}$amanda_cv_linux_sg_scsi" >&6; } # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_sys_scsi_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5 -echo $ECHO_N "checking for HP-UX like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for HP-UX like scsi support" >&5 +$as_echo_n "checking for HP-UX like scsi support... " >&6; } if test "${amanda_cv_hpux_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20422,20 +21958,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_hpux_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_hpux_scsi=no @@ -20443,8 +21980,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5 -echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_hpux_scsi" >&5 +$as_echo "$amanda_cv_hpux_scsi" >&6; } if test x"$amanda_cv_hpux_scsi" = x"yes";then WANT_SCSI_HPUX_NEW=yes WANT_CHG_SCSI=yes @@ -20457,10 +21994,10 @@ echo "${ECHO_T}$amanda_cv_hpux_scsi" >&6; } # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_sys_dsreq_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for Irix like scsi support" >&5 -echo $ECHO_N "checking for Irix like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Irix like scsi support" >&5 +$as_echo_n "checking for Irix like scsi support... " >&6; } if test "${amanda_cv_irix_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20491,20 +22028,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_irix_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_irix_scsi=no @@ -20512,8 +22050,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5 -echo "${ECHO_T}$amanda_cv_irix_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_irix_scsi" >&5 +$as_echo "$amanda_cv_irix_scsi" >&6; } if test x"$amanda_cv_irix_scsi" = x"yes";then WANT_SCSI_IRIX=yes WANT_CHG_SCSI=yes @@ -20525,10 +22063,10 @@ echo "${ECHO_T}$amanda_cv_irix_scsi" >&6; } # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_sys_scsi_impl_uscsi_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5 -echo $ECHO_N "checking for Solaris-like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Solaris-like scsi support" >&5 +$as_echo_n "checking for Solaris-like scsi support... " >&6; } if test "${amanda_cv_solaris_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20559,20 +22097,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_solaris_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_solaris_scsi=no @@ -20580,8 +22119,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5 -echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_solaris_scsi" >&5 +$as_echo "$amanda_cv_solaris_scsi" >&6; } if test x"$amanda_cv_solaris_scsi" = x"yes";then WANT_SCSI_SOLARIS=yes WANT_CHG_SCSI=yes @@ -20594,10 +22133,10 @@ echo "${ECHO_T}$amanda_cv_solaris_scsi" >&6; } if test x"$ac_cv_header_sys_tape_h" = x"yes" && test x"$ac_cv_header_sys_scarray_h" = x"yes" && test x"$ac_cv_header_sys_gscdds_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for AIX like scsi support" >&5 -echo $ECHO_N "checking for AIX like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for AIX like scsi support" >&5 +$as_echo_n "checking for AIX like scsi support... " >&6; } if test "${amanda_cv_aix_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20628,20 +22167,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_aix_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_aix_scsi=no @@ -20649,8 +22189,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5 -echo "${ECHO_T}$amanda_cv_aix_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_aix_scsi" >&5 +$as_echo "$amanda_cv_aix_scsi" >&6; } if test x"$amanda_cv_aix_scsi" = x"yes";then WANT_SCSI_AIX=yes WANT_CHG_SCSI=yes @@ -20660,10 +22200,10 @@ echo "${ECHO_T}$amanda_cv_aix_scsi" >&6; } # BSD CAM SCSI # if test x"$ac_cv_header_cam_cam_h" = x"yes";then - { echo "$as_me:$LINENO: checking for CAM like scsi support" >&5 -echo $ECHO_N "checking for CAM like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for CAM like scsi support" >&5 +$as_echo_n "checking for CAM like scsi support... " >&6; } if test "${amanda_cv_cam_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20698,20 +22238,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_cam_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_cam_scsi=no @@ -20719,16 +22260,16 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5 -echo "${ECHO_T}$amanda_cv_cam_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_cam_scsi" >&5 +$as_echo "$amanda_cv_cam_scsi" >&6; } if test x"$amanda_cv_cam_scsi" = x"yes";then WANT_SCSI_CAM=yes WANT_CHG_SCSI=yes -{ echo "$as_me:$LINENO: checking for main in -lcam" >&5 -echo $ECHO_N "checking for main in -lcam... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lcam" >&5 +$as_echo_n "checking for main in -lcam... " >&6; } if test "${ac_cv_lib_cam_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcam $LIBS" @@ -20754,33 +22295,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cam_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cam_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5 -echo "${ECHO_T}$ac_cv_lib_cam_main" >&6; } -if test $ac_cv_lib_cam_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cam_main" >&5 +$as_echo "$ac_cv_lib_cam_main" >&6; } +if test "x$ac_cv_lib_cam_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCAM 1 _ACEOF @@ -20798,10 +22343,10 @@ fi # if test x"$ac_cv_header_sys_mtio_h" = x"yes" && test x"$ac_cv_header_sys_scsiio_h" = x"yes"; then - { echo "$as_me:$LINENO: checking for BSD like scsi support" >&5 -echo $ECHO_N "checking for BSD like scsi support... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for BSD like scsi support" >&5 +$as_echo_n "checking for BSD like scsi support... " >&6; } if test "${amanda_cv_bsd_scsi+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20832,20 +22377,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_bsd_scsi=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_bsd_scsi=no @@ -20853,8 +22399,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5 -echo "${ECHO_T}$amanda_cv_bsd_scsi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_bsd_scsi" >&5 +$as_echo "$amanda_cv_bsd_scsi" >&6; } if test x"$amanda_cv_bsd_scsi" = x"yes";then WANT_SCSI_BSD=yes WANT_CHG_SCSI=yes @@ -20984,20 +22530,21 @@ for ac_header in fstab.h \ sys/vfstab.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21013,32 +22560,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21052,69 +22600,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -21125,11 +22677,11 @@ done for ac_func in endmntent do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21182,35 +22734,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -21219,11 +22778,11 @@ done for ac_func in setmntent do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21276,35 +22835,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -21324,20 +22890,21 @@ for ac_header in fcntl.h \ unistd.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21353,32 +22920,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21392,69 +22960,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -21466,13 +23038,13 @@ done # Note: these all use AC_TRY_LINK to make sure that we can compile # and link each variant. They do not try to test the variants -- # that is left to runtime. - WORKING_FILE_LOCK="no" + LOCKING="no" # check POSIX locking - { echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5 -echo $ECHO_N "checking whether POSIX locking (with fcntl(2)) is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether POSIX locking (with fcntl(2)) is available" >&5 +$as_echo_n "checking whether POSIX locking (with fcntl(2)) is available... " >&6; } if test "${amanda_cv_posix_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21514,23 +23086,26 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then amanda_cv_posix_filelocking="yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21538,12 +23113,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_posix_filelocking" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_posix_filelocking" >&5 +$as_echo "$amanda_cv_posix_filelocking" >&6; } if test "x$amanda_cv_posix_filelocking" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -21551,7 +23127,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF WANT_AMFLOCK_POSIX="yes" - WORKING_FILE_LOCK="yes" + LOCKING="POSIX_FCNTL" fi if test x"$WANT_AMFLOCK_POSIX" = x"yes"; then WANT_AMFLOCK_POSIX_TRUE= @@ -21563,10 +23139,10 @@ fi # check flock-based (BSD) locking - { echo "$as_me:$LINENO: checking whether flock locking is available" >&5 -echo $ECHO_N "checking whether flock locking is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether flock locking is available" >&5 +$as_echo_n "checking whether flock locking is available... " >&6; } if test "${amanda_cv_flock_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21596,23 +23172,26 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then amanda_cv_flock_filelocking="yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21620,12 +23199,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_flock_filelocking" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_flock_filelocking" >&5 +$as_echo "$amanda_cv_flock_filelocking" >&6; } if test "x$amanda_cv_flock_filelocking" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -21633,7 +23213,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF WANT_AMFLOCK_FLOCK="yes" - WORKING_FILE_LOCK="yes" + LOCKING="FLOCK" fi if test x"$WANT_AMFLOCK_FLOCK" = x"yes"; then WANT_AMFLOCK_FLOCK_TRUE= @@ -21645,10 +23225,10 @@ fi # check lockf-based (SVR2, SVR3, SVR4) locking - { echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5 -echo $ECHO_N "checking whether lockf(3) locking is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether lockf(3) locking is available" >&5 +$as_echo_n "checking whether lockf(3) locking is available... " >&6; } if test "${amanda_cv_lockf_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21678,23 +23258,26 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then amanda_cv_lockf_filelocking="yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21702,12 +23285,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_lockf_filelocking" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lockf_filelocking" >&5 +$as_echo "$amanda_cv_lockf_filelocking" >&6; } if test "x$amanda_cv_lockf_filelocking" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -21715,7 +23299,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF WANT_AMFLOCK_LOCKF="yes" - WORKING_FILE_LOCK="yes" + LOCKING="LOCKF" fi if test x"$WANT_AMFLOCK_LOCKF" = x"yes"; then WANT_AMFLOCK_LOCKF_TRUE= @@ -21727,10 +23311,10 @@ fi # check our homebrew hardlink-based locking (requires hardlinks) - { echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5 -echo $ECHO_N "checking whether link(2) is available for locking... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether link(2) is available for locking" >&5 +$as_echo_n "checking whether link(2) is available for locking... " >&6; } if test "${amanda_cv_lnlock_filelocking+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21760,23 +23344,26 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then amanda_cv_lnlock_filelocking="yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21784,12 +23371,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5 -echo "${ECHO_T}$amanda_cv_lnlock_filelocking" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_lnlock_filelocking" >&5 +$as_echo "$amanda_cv_lnlock_filelocking" >&6; } if test "x$amanda_cv_lnlock_filelocking" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -21797,7 +23385,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF WANT_AMFLOCK_LNLOCK="yes" - WORKING_FILE_LOCK="yes" + LOCKING="LNLOCK" fi if test x"$WANT_AMFLOCK_LNLOCK" = x"yes"; then WANT_AMFLOCK_LNLOCK_TRUE= @@ -21808,23 +23396,25 @@ else fi - if test x"$WORKING_FILE_LOCK" = "no"; then + if test x"$LOCKING" = "no"; then # this shouldn't happen, and is *bad* if it does - { { echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5 -echo "$as_me: error: *** No working file locking capability found!" >&2;} + { { $as_echo "$as_me:$LINENO: error: *** No working file locking capability found!" >&5 +$as_echo "$as_me: error: *** No working file locking capability found!" >&2;} { (exit 1); exit 1; }; } fi + + for ac_prog in swig do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SWIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) @@ -21839,7 +23429,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -21851,11 +23441,11 @@ esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then - { echo "$as_me:$LINENO: result: $SWIG" >&5 -echo "${ECHO_T}$SWIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $SWIG" >&5 +$as_echo "$SWIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21866,10 +23456,10 @@ done # Extract the first word of "swig", so it can be a program name with args. set dummy swig; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SWIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) @@ -21884,7 +23474,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -21896,22 +23486,22 @@ esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then - { echo "$as_me:$LINENO: result: $SWIG" >&5 -echo "${ECHO_T}$SWIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $SWIG" >&5 +$as_echo "$SWIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -z "$SWIG" ; then SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' elif test -n "1.3.28" ; then - { echo "$as_me:$LINENO: checking for SWIG version" >&5 -echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5 +$as_echo_n "checking for SWIG version... " >&6; } swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'` - { echo "$as_me:$LINENO: result: $swig_version" >&5 -echo "${ECHO_T}$swig_version" >&6; } + { $as_echo "$as_me:$LINENO: result: $swig_version" >&5 +$as_echo "$swig_version" >&6; } if test -n "$swig_version" ; then # Calculate the required version number components required=1.3.28 @@ -21965,10 +23555,10 @@ echo "${ECHO_T}$swig_version" >&6; } do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) @@ -21983,7 +23573,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -21995,11 +23585,11 @@ esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then - { echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6; } + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -22011,10 +23601,10 @@ done if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. @@ -22027,7 +23617,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PERL="perl" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -22038,11 +23628,11 @@ fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then - { echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6; } + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -22052,27 +23642,27 @@ fi ac_perl_version="5.6.0" if test "x$PERL" != "x"; then - { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 -echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 +$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&6; } # NB: It would be nice to log the error if there is one, but we cannot rely # on autoconf internals $PERL -e "use $ac_perl_version;" > /dev/null 2>&1 if test $? -ne 0; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; - { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 -echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} + { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 +$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} { (exit 1); exit 1; }; } else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; }; + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; }; fi else - { echo "$as_me:$LINENO: WARNING: could not find perl" >&5 -echo "$as_me: WARNING: could not find perl" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} fi @@ -22083,13 +23673,114 @@ fi # If we want cygwin to copy ddl to modules directory. WANT_CYGWIN_COPY_PERL_DLL="false" + # test for ExtUtils::Embed + ac_perl_list_modules="ExtUtils::Embed 0.0" +# Make sure we have perl +if test -z "$PERL"; then +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PERL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PERL="perl" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi + +# Check the number of arguments +args_num=`echo $ac_perl_list_modules | wc -w` +let "ckeck_args = $args_num % 2" +if test "$check_args" = "1" ; then + { { $as_echo "$as_me:$LINENO: error: syntax error" >&5 +$as_echo "$as_me: error: syntax error" >&2;} + { (exit 1); exit 1; }; } +else + eval +fi + +if test "x$PERL" != x; then + ac_failed=0 + while test ${#ac_perl_list_modules} -gt 2 ; do + module_name=`echo $ac_perl_list_modules | cut -d " " -f 1` + module_version=`echo $ac_perl_list_modules | cut -d " " -f 2` + ac_perl_list_modules=`echo $ac_perl_list_modules | cut -d " " -f 3-` + { $as_echo "$as_me:$LINENO: checking for perl module $module_name version $module_version" >&5 +$as_echo_n "checking for perl module $module_name version $module_version... " >&6; } + + $PERL "-M$module_name" -e exit > /dev/null 2>&1 + if test $? -ne 0; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; + ac_failed=1 + ac_perl_list_modules="" + else + version=`$PERL "-M$module_name" -e 'print $'"$module_name::VERSION" 2>&1` + $PERL -e 'exit(shift cmp shift)' "$version" "$module_version" + if test $? -eq 0 -o $? -eq 1 ; then + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; }; + else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ac_failed=1 + ac_perl_list_modules="" + fi + fi; + done + + if test "$ac_failed" = 0; then + : + + else + : + + { { $as_echo "$as_me:$LINENO: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&5 +$as_echo "$as_me: error: *** Amanda requires the perl package ExtUtils::Embed to build its perl modules" >&2;} + { (exit 1); exit 1; }; } + + fi +else + { { $as_echo "$as_me:$LINENO: error: could not find perl" >&5 +$as_echo "$as_me: error: could not find perl" >&2;} + { (exit 1); exit 1; }; } +fi + # get the include path for building perl extensions PERL_INC=`$PERL -MExtUtils::Embed -e perl_inc` if test x"$enable_shared" = x"no"; then - { { echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5 -echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;} + { { $as_echo "$as_me:$LINENO: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&5 +$as_echo "$as_me: error: *** Amanda cannot be compiled without shared-library support (do not use --disable-shared)" >&2;} { (exit 1); exit 1; }; } fi @@ -22143,8 +23834,8 @@ fi if test "${with_perlextlibs+set}" = set; then withval=$with_perlextlibs; case "$withval" in - y|ye|yes) { { echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5 -echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;} + y|ye|yes) { { $as_echo "$as_me:$LINENO: error: *** You must specify a value for --with-perlextlibs" >&5 +$as_echo "$as_me: error: *** You must specify a value for --with-perlextlibs" >&2;} { (exit 1); exit 1; }; };; n|no) PERLEXTLIBS='';; *) PERLEXTLIBS="$withval" ;; @@ -22158,10 +23849,10 @@ fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CAT in [\\/]* | ?:[\\/]*) @@ -22176,7 +23867,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -22189,11 +23880,11 @@ esac fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then - { echo "$as_me:$LINENO: result: $CAT" >&5 -echo "${ECHO_T}$CAT" >&6; } + { $as_echo "$as_me:$LINENO: result: $CAT" >&5 +$as_echo "$CAT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -22203,12 +23894,14 @@ fi + HAVE_GZIP= if test "$GZIP"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GZIP 1 _ACEOF + HAVE_GZIP=1 COMPRESS_PATH="$GZIP" COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast" @@ -22230,8 +23923,8 @@ _ACEOF # XXX is the above true? --dustin - { echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress. Using cat." >&5 -echo "$as_me: WARNING: Cannot find either gzip or compress. Using cat." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Cannot find either gzip or compress. Using cat." >&5 +$as_echo "$as_me: WARNING: Cannot find either gzip or compress. Using cat." >&2;} cat <>config.warnings @@ -22279,14 +23972,22 @@ cat >>confdefs.h <<_ACEOF _ACEOF + + + + + + + + # Empty GZIP so that make dist works. GZIP= - { echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 -echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 +$as_echo_n "checking if sockaddr_storage struct exists... " >&6; } if test "${ac_cv_has_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22312,20 +24013,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_has_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_sockaddr_storage=no @@ -22334,8 +24036,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 +$as_echo "$ac_cv_has_sockaddr_storage" >&6; } if test $ac_cv_has_sockaddr_storage = yes ; then @@ -22357,8 +24059,8 @@ if test "${with_ipv6+set}" = set; then y | ye | yes) amanda_with_ipv6=yes;; n | no) amanda_with_ipv6=no;; *) - { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -22373,10 +24075,10 @@ fi if test x"$amanda_with_ipv6" = x"yes" || test x"$amanda_with_ipv6" = x"maybe" ; then - { echo "$as_me:$LINENO: checking for working IPv6" >&5 -echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for working IPv6" >&5 +$as_echo_n "checking for working IPv6... " >&6; } if test "${amanda_cv_working_ipv6+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$target" in @@ -22420,29 +24122,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then amanda_cv_working_ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) amanda_cv_working_ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -22450,8 +24155,8 @@ fi esac fi -{ echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5 -echo "${ECHO_T}$amanda_cv_working_ipv6" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_working_ipv6" >&5 +$as_echo "$amanda_cv_working_ipv6" >&6; } if test "$amanda_cv_working_ipv6" = yes; then WORKING_IPV6=yes @@ -22463,8 +24168,8 @@ _ACEOF else # error out only if the user specifically requested support if test x"$amanda_with_ipv6" = x"yes"; then - { { echo "$as_me:$LINENO: error: IPv6 support was requested, but it is not working." >&5 -echo "$as_me: error: IPv6 support was requested, but it is not working." >&2;} + { { $as_echo "$as_me:$LINENO: error: IPv6 support was requested, but it is not working." >&5 +$as_echo "$as_me: error: IPv6 support was requested, but it is not working." >&2;} { (exit 1); exit 1; }; } fi fi @@ -22478,8 +24183,8 @@ if test "${with_mmap+set}" = set; then withval=$with_mmap; case "$FORCE_MMAP" in y | ye | yes | n | no) : ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;} { (exit 1); exit 1; }; } ;; esac FORCE_MMAP=$withval @@ -22498,20 +24203,21 @@ for ac_header in \ sys/mman.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22527,32 +24233,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22566,69 +24273,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -22640,20 +24351,21 @@ done for ac_header in stdlib.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22669,32 +24381,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22708,69 +24421,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -22780,11 +24497,11 @@ done for ac_func in getpagesize do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22837,44 +24554,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no @@ -23018,36 +24742,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF @@ -23061,11 +24788,11 @@ rm -f conftest.mmap for ac_func in shmget do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23118,35 +24845,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -23158,20 +24892,21 @@ for ac_header in sys/types.h \ sys/shm.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23187,32 +24922,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23226,69 +24962,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -23296,10 +25036,10 @@ fi done - { echo "$as_me:$LINENO: checking for shmdt() argument type" >&5 -echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shmdt() argument type" >&5 +$as_echo_n "checking for shmdt() argument type... " >&6; } if test "${amanda_cv_shmdt_arg_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$ac_cv_func_shmget" = yes; then @@ -23340,8 +25080,8 @@ EOF fi -{ echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5 -echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5 +$as_echo "$amanda_cv_shmdt_arg_type" >&6; } cat >>confdefs.h <<_ACEOF #define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type @@ -23368,11 +25108,11 @@ ice_have_shmat=no for ac_func in shmat do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23425,45 +25165,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_shmat=yes fi done if test "${ice_have_shmat}" = yes; then -{ echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +$as_echo_n "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; } if test "${ice_cv_have_shmat_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_shmat_decl=no @@ -23512,8 +25259,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5 +$as_echo "$ice_cv_have_shmat_decl" >&6; } if test "$ice_cv_have_shmat_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -23528,11 +25275,11 @@ ice_have_shmctl=no for ac_func in shmctl do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23585,45 +25332,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_shmctl=yes fi done if test "${ice_have_shmctl}" = yes; then -{ echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +$as_echo_n "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; } if test "${ice_cv_have_shmctl_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_shmctl_decl=no @@ -23672,8 +25426,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5 +$as_echo "$ice_cv_have_shmctl_decl" >&6; } if test "$ice_cv_have_shmctl_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -23688,11 +25442,11 @@ ice_have_shmdt=no for ac_func in shmdt do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23745,45 +25499,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_shmdt=yes fi done if test "${ice_have_shmdt}" = yes; then -{ echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +$as_echo_n "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; } if test "${ice_cv_have_shmdt_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_shmdt_decl=no @@ -23832,8 +25593,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5 +$as_echo "$ice_cv_have_shmdt_decl" >&6; } if test "$ice_cv_have_shmdt_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -23848,11 +25609,11 @@ ice_have_shmget=no for ac_func in shmget do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23905,45 +25666,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_shmget=yes fi done if test "${ice_have_shmget}" = yes; then -{ echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 -echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5 +$as_echo_n "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... " >&6; } if test "${ice_cv_have_shmget_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_shmget_decl=no @@ -23992,8 +25760,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5 -echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5 +$as_echo "$ice_cv_have_shmget_decl" >&6; } if test "$ice_cv_have_shmget_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -24009,8 +25777,8 @@ fi n | no) if test "x$ac_cv_func_shmget" != xyes; then - { echo "$as_me:$LINENO: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&5 -echo "$as_me: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&5 +$as_echo "$as_me: WARNING: Neither shmget() nor mmap() found. This system will not support the Amanda server." >&2;} cat <>config.warnings @@ -24023,8 +25791,8 @@ AAW_EOF ;; y | ye | yes) - { echo "$as_me:$LINENO: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&5 -echo "$as_me: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&5 +$as_echo "$as_me: WARNING: --with-mmap used on a system with no mmap() support. This system will not support the Amanda server." >&2;} cat <>config.warnings @@ -24045,11 +25813,11 @@ AAW_EOF ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24075,20 +25843,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -24096,12 +25865,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -24110,10 +25882,10 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -24151,26 +25923,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -24185,8 +25961,8 @@ fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -24194,10 +25970,10 @@ if test "$ac_res" != no; then fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -24235,26 +26011,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -24269,8 +26049,8 @@ fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -24281,10 +26061,10 @@ fi # include the dirent headers as described in the autoconf documentation. - { echo "$as_me:$LINENO: checking whether readdir is declared" >&5 -echo $ECHO_N "checking whether readdir is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether readdir is declared" >&5 +$as_echo_n "checking whether readdir is declared... " >&6; } if test "${ac_cv_have_decl_readdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24328,20 +26108,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_readdir=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_readdir=no @@ -24349,9 +26130,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir" >&5 -echo "${ECHO_T}$ac_cv_have_decl_readdir" >&6; } -if test $ac_cv_have_decl_readdir = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir" >&5 +$as_echo "$ac_cv_have_decl_readdir" >&6; } +if test "x$ac_cv_have_decl_readdir" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_READDIR 1 @@ -24365,10 +26146,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether readdir_r is declared" >&5 -echo $ECHO_N "checking whether readdir_r is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether readdir_r is declared" >&5 +$as_echo_n "checking whether readdir_r is declared... " >&6; } if test "${ac_cv_have_decl_readdir_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24412,20 +26193,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_readdir_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_readdir_r=no @@ -24433,9 +26215,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir_r" >&5 -echo "${ECHO_T}$ac_cv_have_decl_readdir_r" >&6; } -if test $ac_cv_have_decl_readdir_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir_r" >&5 +$as_echo "$ac_cv_have_decl_readdir_r" >&6; } +if test "x$ac_cv_have_decl_readdir_r" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_READDIR_R 1 @@ -24449,10 +26231,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether readdir64 is declared" >&5 -echo $ECHO_N "checking whether readdir64 is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether readdir64 is declared" >&5 +$as_echo_n "checking whether readdir64 is declared... " >&6; } if test "${ac_cv_have_decl_readdir64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24496,20 +26278,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_readdir64=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_readdir64=no @@ -24517,9 +26300,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64" >&5 -echo "${ECHO_T}$ac_cv_have_decl_readdir64" >&6; } -if test $ac_cv_have_decl_readdir64 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64" >&5 +$as_echo "$ac_cv_have_decl_readdir64" >&6; } +if test "x$ac_cv_have_decl_readdir64" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_READDIR64 1 @@ -24533,10 +26316,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether readdir64_r is declared" >&5 -echo $ECHO_N "checking whether readdir64_r is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether readdir64_r is declared" >&5 +$as_echo_n "checking whether readdir64_r is declared... " >&6; } if test "${ac_cv_have_decl_readdir64_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24580,20 +26363,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_readdir64_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_readdir64_r=no @@ -24601,9 +26385,9 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64_r" >&5 -echo "${ECHO_T}$ac_cv_have_decl_readdir64_r" >&6; } -if test $ac_cv_have_decl_readdir64_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_readdir64_r" >&5 +$as_echo "$ac_cv_have_decl_readdir64_r" >&6; } +if test "x$ac_cv_have_decl_readdir64_r" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_READDIR64_R 1 @@ -24622,8 +26406,8 @@ fi # disk device prefixes - { echo "$as_me:$LINENO: checking disk device prefixes" >&5 -echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking disk device prefixes" >&5 +$as_echo_n "checking disk device prefixes... " >&6; } # Use df to find the mount point for the root filesystem. Use # the positional parameters to find the particular line from df @@ -24662,8 +26446,8 @@ echo $ECHO_N "checking disk device prefixes... $ECHO_C" >&6; } case $mount in /dev/vg*) - { echo "$as_me:$LINENO: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&5 -echo "$as_me: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&5 +$as_echo "$as_me: WARNING: Run amhpfixdevs on HP-UX systems using /dev/vg??." >&2;} cat <>config.warnings @@ -24680,8 +26464,8 @@ AAW_EOF CLIENT_SCRIPTS_OPT=amsinixfixdevs if ! test -d /dev/dsk; then - { echo "$as_me:$LINENO: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&5 -echo "$as_me: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&5 +$as_echo "$as_me: WARNING: Run amsinixfixdevs on Sinix systems using VxFS." >&2;} cat <>config.warnings @@ -24701,8 +26485,8 @@ AAW_EOF esac if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then - { echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5 -echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6; } + { $as_echo "$as_me:$LINENO: result: (predefined) $DEV_PREFIX - $RDEV_PREFIX" >&5 +$as_echo "(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6; } else if test -d /dev/dsk; then DEV_PREFIX=/dev/dsk/ @@ -24733,8 +26517,8 @@ echo "${ECHO_T}(predefined) $DEV_PREFIX - $RDEV_PREFIX" >&6; } DEV_PREFIX=/ RDEV_PREFIX=/ fi - { echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5 -echo "${ECHO_T}$DEV_PREFIX - $RDEV_PREFIX" >&6; } + { $as_echo "$as_me:$LINENO: result: $DEV_PREFIX - $RDEV_PREFIX" >&5 +$as_echo "$DEV_PREFIX - $RDEV_PREFIX" >&6; } fi @@ -24799,8 +26583,8 @@ _ACEOF *-sgi-irix3*) # The old cc won't work! if test "x$GCC" != "xyes"; then - { { echo "$as_me:$LINENO: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&5 -echo "$as_me: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&2;} + { { $as_echo "$as_me:$LINENO: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&5 +$as_echo "$as_me: error: The old SGI IRIX compiler ($CC) will not compile Amanda; use CC=gcc" >&2;} { (exit 1); exit 1; }; } fi ;; @@ -25064,25 +26848,55 @@ _ACEOF test "$exec_prefix_NONE" && exec_prefix=NONE - DUMPER_DIR='${amlibexecdir}/application' + APPLICATION_DIR='${amlibexecdir}/application' + + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$APPLICATION_DIR\"" + eval ac_define_dir="\"$ac_define_dir\"" + APPLICATION_DIR="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define APPLICATION_DIR "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + +# Check whether --with-amdatadir was given. +if test "${with_amdatadir+set}" = set; then + withval=$with_amdatadir; + AMDATADIR=$withval + +else + + AMDATADIR=$datadir/amanda + + +fi + prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix - eval ac_define_dir="\"$DUMPER_DIR\"" + eval ac_define_dir="\"$AMDATADIR\"" eval ac_define_dir="\"$ac_define_dir\"" - DUMPER_DIR="$ac_define_dir" + amdatadir="$ac_define_dir" cat >>confdefs.h <<_ACEOF -#define DUMPER_DIR "$ac_define_dir" +#define amdatadir "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE - # TODO: rename to APPLICATION_DIR, add to Amanda::Paths and 'amgtconf build.APPLICATION_DIR' # @@ -25091,10 +26905,10 @@ _ACEOF # FreeBSD needs to link libxpg4 -{ echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 -echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 +$as_echo_n "checking for setlocale in -lxpg4... " >&6; } if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $LIBS" @@ -25126,33 +26940,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_xpg4_setlocale=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_xpg4_setlocale=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 -echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6; } -if test $ac_cv_lib_xpg4_setlocale = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 +$as_echo "$ac_cv_lib_xpg4_setlocale" >&6; } +if test "x$ac_cv_lib_xpg4_setlocale" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXPG4 1 _ACEOF @@ -25171,10 +26989,10 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) @@ -25189,7 +27007,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25201,20 +27019,20 @@ esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then - { echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6; } + { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "gettext", so it can be a program name with args. set dummy gettext; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GETTEXT in [\\/]* | ?:[\\/]*) @@ -25229,7 +27047,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25241,19 +27059,19 @@ esac fi GETTEXT=$ac_cv_path_GETTEXT if test -n "$GETTEXT"; then - { echo "$as_me:$LINENO: result: $GETTEXT" >&5 -echo "${ECHO_T}$GETTEXT" >&6; } + { $as_echo "$as_me:$LINENO: result: $GETTEXT" >&5 +$as_echo "$GETTEXT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +$as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval @@ -25261,8 +27079,8 @@ else USE_NLS=yes fi - { echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6; } + { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } @@ -25299,10 +27117,10 @@ rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) @@ -25331,19 +27149,19 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then - { echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6; } + { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5 +$as_echo "$MSGFMT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) @@ -25358,7 +27176,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -25371,11 +27189,11 @@ esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then - { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6; } + { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +$as_echo "$GMSGFMT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -25422,10 +27240,10 @@ rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) @@ -25454,11 +27272,11 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then - { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6; } + { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +$as_echo "$XGETTEXT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f messages.po @@ -25500,10 +27318,10 @@ rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) @@ -25531,11 +27349,11 @@ esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then - { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6; } + { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5 +$as_echo "$MSGMERGE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -25945,10 +27763,10 @@ fi - { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 -echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" @@ -25973,32 +27791,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gt_cv_func_CFPreferencesCopyAppValue=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi -{ echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 -echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF @@ -26006,10 +27828,10 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi - { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 -echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 +$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" @@ -26034,32 +27856,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gt_cv_func_CFLocaleCopyCurrent=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi -{ echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF @@ -26089,10 +27915,10 @@ _ACEOF - { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 -echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 +$as_echo_n "checking for GNU gettext in libc... " >&6; } if test "${gt_cv_func_gnugettext1_libc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26118,31 +27944,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gt_cv_func_gnugettext1_libc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 +$as_echo "$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then @@ -26175,10 +28005,10 @@ echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } done - { echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } if test "${am_cv_func_iconv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" @@ -26207,26 +28037,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then am_cv_func_iconv=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then @@ -26256,35 +28090,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi -{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6; } +{ $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF @@ -26293,10 +28131,10 @@ _ACEOF fi if test "$am_cv_lib_iconv" = yes; then - { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6; } + { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= @@ -26685,10 +28523,10 @@ fi done fi - { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 -echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 +$as_echo_n "checking for GNU gettext in libintl... " >&6; } if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" @@ -26722,26 +28560,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then gt_cv_func_gnugettext1_libintl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then @@ -26774,37 +28616,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi -{ echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 -echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 +$as_echo "$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ @@ -26840,13 +28686,13 @@ _ACEOF fi fi - { echo "$as_me:$LINENO: checking whether to use NLS" >&5 -echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6; } + { $as_echo "$as_me:$LINENO: checking whether to use NLS" >&5 +$as_echo_n "checking whether to use NLS... " >&6; } + { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5 +$as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then - { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 -echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 +$as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" @@ -26856,18 +28702,18 @@ echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } else gt_source="included intl directory" fi - { echo "$as_me:$LINENO: result: $gt_source" >&5 -echo "${ECHO_T}$gt_source" >&6; } + { $as_echo "$as_me:$LINENO: result: $gt_source" >&5 +$as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then - { echo "$as_me:$LINENO: checking how to link with libintl" >&5 -echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $LIBINTL" >&5 -echo "${ECHO_T}$LIBINTL" >&6; } + { $as_echo "$as_me:$LINENO: checking how to link with libintl" >&5 +$as_echo_n "checking how to link with libintl... " >&6; } + { $as_echo "$as_me:$LINENO: result: $LIBINTL" >&5 +$as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= @@ -26929,10 +28775,10 @@ _ACEOF # translate them to -R flags, as required by the runtime linker. # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CURL_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CURL_CONFIG in [\\/]* | ?:[\\/]*) @@ -26948,7 +28794,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CURL_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -26960,11 +28806,11 @@ esac fi CURL_CONFIG=$ac_cv_path_CURL_CONFIG if test -n "$CURL_CONFIG"; then - { echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5 -echo "${ECHO_T}$CURL_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $CURL_CONFIG" >&5 +$as_echo "$CURL_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -27031,10 +28877,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -27047,7 +28893,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -27058,11 +28904,11 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -27079,10 +28925,10 @@ done _libcurl_ldflags="-L$withval/lib" # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path__libcurl_config+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $_libcurl_config in [\\/]* | ?:[\\/]*) @@ -27097,7 +28943,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -27110,21 +28956,21 @@ esac fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then - { echo "$as_me:$LINENO: result: $_libcurl_config" >&5 -echo "${ECHO_T}$_libcurl_config" >&6; } + { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5 +$as_echo "$_libcurl_config" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path__libcurl_config+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $_libcurl_config in [\\/]* | ?:[\\/]*) @@ -27139,7 +28985,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -27151,35 +28997,35 @@ esac fi _libcurl_config=$ac_cv_path__libcurl_config if test -n "$_libcurl_config"; then - { echo "$as_me:$LINENO: result: $_libcurl_config" >&5 -echo "${ECHO_T}$_libcurl_config" >&6; } + { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5 +$as_echo "$_libcurl_config" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi if test x$_libcurl_config != "x" ; then - { echo "$as_me:$LINENO: checking for the version of libcurl" >&5 -echo $ECHO_N "checking for the version of libcurl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for the version of libcurl" >&5 +$as_echo_n "checking for the version of libcurl... " >&6; } if test "${libcurl_cv_lib_curl_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'` fi -{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5 -echo "${ECHO_T}$libcurl_cv_lib_curl_version" >&6; } +{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5 +$as_echo "$libcurl_cv_lib_curl_version" >&6; } _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse` _libcurl_wanted=`echo 7.10.0 | $_libcurl_version_parse` if test $_libcurl_wanted -gt 0 ; then - { echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5 -echo $ECHO_N "checking for libcurl >= version 7.10.0... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5 +$as_echo_n "checking for libcurl >= version 7.10.0... " >&6; } if test "${libcurl_cv_lib_version_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test $_libcurl_version -ge $_libcurl_wanted ; then @@ -27189,8 +29035,8 @@ else fi fi -{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5 -echo "${ECHO_T}$libcurl_cv_lib_version_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5 +$as_echo "$libcurl_cv_lib_version_ok" >&6; } fi if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then @@ -27230,10 +29076,10 @@ echo "${ECHO_T}$libcurl_cv_lib_version_ok" >&6; } # link line (or failing that, "-lcurl") is enough. LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"} - { echo "$as_me:$LINENO: checking whether libcurl is usable" >&5 -echo $ECHO_N "checking whether libcurl is usable... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether libcurl is usable" >&5 +$as_echo_n "checking whether libcurl is usable... " >&6; } if test "${libcurl_cv_lib_curl_usable+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else _libcurl_save_cppflags=$CPPFLAGS @@ -27273,26 +29119,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then libcurl_cv_lib_curl_usable=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 libcurl_cv_lib_curl_usable=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -27302,8 +29152,8 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ unset _libcurl_save_libs fi -{ echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5 -echo "${ECHO_T}$libcurl_cv_lib_curl_usable" >&6; } +{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5 +$as_echo "$libcurl_cv_lib_curl_usable" >&6; } if test $libcurl_cv_lib_curl_usable = yes ; then @@ -27315,10 +29165,10 @@ echo "${ECHO_T}$libcurl_cv_lib_curl_usable" >&6; } _libcurl_save_libs=$LIBS LIBS="$LIBS $LIBCURL" - { echo "$as_me:$LINENO: checking for curl_free" >&5 -echo $ECHO_N "checking for curl_free... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for curl_free" >&5 +$as_echo_n "checking for curl_free... " >&6; } if test "${ac_cv_func_curl_free+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -27371,32 +29221,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_curl_free=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_curl_free=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5 -echo "${ECHO_T}$ac_cv_func_curl_free" >&6; } -if test $ac_cv_func_curl_free = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5 +$as_echo "$ac_cv_func_curl_free" >&6; } +if test "x$ac_cv_func_curl_free" = x""yes; then : else @@ -27422,10 +29276,10 @@ _ACEOF for _libcurl_feature in $_libcurl_features ; do cat >>confdefs.h <<_ACEOF -#define `echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 +#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1 _ACEOF - eval `echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes + eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes done if test "x$_libcurl_protocols" = "x" ; then @@ -27447,10 +29301,10 @@ _ACEOF for _libcurl_protocol in $_libcurl_protocols ; do cat >>confdefs.h <<_ACEOF -#define `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 +#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1 _ACEOF - eval `echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes + eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes done else unset LIBCURL @@ -27487,18 +29341,22 @@ _ACEOF - { echo "$as_me:$LINENO: checking for curl_off_t" >&5 -echo $ECHO_N "checking for curl_off_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for curl_off_t" >&5 +$as_echo_n "checking for curl_off_t... " >&6; } if test "${ac_cv_type_curl_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_curl_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef STDC_HEADERS #include #include @@ -27507,14 +29365,56 @@ cat >>conftest.$ac_ext <<_ACEOF -typedef curl_off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (curl_off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef STDC_HEADERS +#include +#include +#endif +#include + + + +int +main () +{ +if (sizeof ((curl_off_t))) + return 0; ; return 0; } @@ -27525,30 +29425,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_curl_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_curl_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_curl_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_curl_off_t" >&6; } -if test $ac_cv_type_curl_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5 +$as_echo "$ac_cv_type_curl_off_t" >&6; } +if test "x$ac_cv_type_curl_off_t" = x""yes; then : else @@ -27566,10 +29475,10 @@ fi HAVE_HMAC=yes -{ echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5 -echo $ECHO_N "checking for HMAC_CTX_init in -lcrypto... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5 +$as_echo_n "checking for HMAC_CTX_init in -lcrypto... " >&6; } if test "${ac_cv_lib_crypto_HMAC_CTX_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" @@ -27601,33 +29510,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_crypto_HMAC_CTX_init=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypto_HMAC_CTX_init=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5 -echo "${ECHO_T}$ac_cv_lib_crypto_HMAC_CTX_init" >&6; } -if test $ac_cv_lib_crypto_HMAC_CTX_init = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5 +$as_echo "$ac_cv_lib_crypto_HMAC_CTX_init" >&6; } +if test "x$ac_cv_lib_crypto_HMAC_CTX_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF @@ -27645,20 +29558,21 @@ fi for ac_header in openssl/hmac.h crypto/hmac.h hmac.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27674,32 +29588,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27713,69 +29628,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF found_hmac_h=yes; break fi @@ -27798,8 +29717,8 @@ else fi - { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5 -echo $ECHO_N "checking whether to include the Amazon S3 device... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5 +$as_echo_n "checking whether to include the Amazon S3 device... " >&6; } # if the user didn't specify 'no', then check for support if test x"$WANT_S3_DEVICE" != x"no"; then if test x"$HAVE_CURL" = x"yes" -a x"$HAVE_HMAC" = x"yes"; then @@ -27808,18 +29727,18 @@ echo $ECHO_N "checking whether to include the Amazon S3 device... $ECHO_C" >&6; # no support -- if the user explicitly enabled the device, # then this is an error if test x"$WANT_S3_DEVICE" = x"yes"; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5 -echo "$as_me: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&2;} + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5 +$as_echo "$as_me: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&2;} { (exit 1); exit 1; }; } else WANT_S3_DEVICE=no fi fi fi - { echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5 -echo "${ECHO_T}$WANT_S3_DEVICE" >&6; } + { $as_echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5 +$as_echo "$WANT_S3_DEVICE" >&6; } if test x"$WANT_S3_DEVICE" = x"yes"; then WANT_S3_DEVICE_TRUE= @@ -27834,50 +29753,12 @@ fi if test x"$WANT_S3_DEVICE" = x"yes"; then cat >>confdefs.h <<\_ACEOF -#define WANT_S3_DEVICE +#define WANT_S3_DEVICE /**/ _ACEOF fi - # Check whether --enable-devpay was given. -if test "${enable_devpay+set}" = set; then - enableval=$enable_devpay; WANT_DEVPAY=$enableval -else - WANT_DEVPAY=no -fi - - - { echo "$as_me:$LINENO: checking whether to include the Amazon S3 device's DevPay support" >&5 -echo $ECHO_N "checking whether to include the Amazon S3 device's DevPay support... $ECHO_C" >&6; } - if test x"$WANT_DEVPAY" = x"yes"; then - if test x"$WANT_S3_DEVICE" != x"yes"; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: DevPay support requires the S3 device (--enable-s3-device)" >&5 -echo "$as_me: error: DevPay support requires the S3 device (--enable-s3-device)" >&2;} - { (exit 1); exit 1; }; } - fi - - -cat >>confdefs.h <<\_ACEOF -#define WANT_DEVPAY -_ACEOF - - fi - { echo "$as_me:$LINENO: result: $WANT_DEVPAY" >&5 -echo "${ECHO_T}$WANT_DEVPAY" >&6; } - - if test "$WANT_DEVPAY" = "yes"; then - WANT_DEVPAY_TRUE= - WANT_DEVPAY_FALSE='#' -else - WANT_DEVPAY_TRUE='#' - WANT_DEVPAY_FALSE= -fi - - - @@ -27887,20 +29768,21 @@ for ac_header in \ sys/mtio.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27916,32 +29798,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -27955,69 +29838,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -28026,10 +29913,10 @@ done # check for MTIOCTOP, an indicator of POSIX tape support - { echo "$as_me:$LINENO: checking for MTIOCTOP" >&5 -echo $ECHO_N "checking for MTIOCTOP... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for MTIOCTOP" >&5 +$as_echo_n "checking for MTIOCTOP... " >&6; } if test "${amanda_cv_HAVE_MTIOCTOP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -28063,20 +29950,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then amanda_cv_HAVE_MTIOCTOP=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 amanda_cv_HAVE_MTIOCTOP=no @@ -28087,8 +29975,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP fi -{ echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5 -echo "${ECHO_T}$amanda_cv_HAVE_MTIOCTOP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5 +$as_echo "$amanda_cv_HAVE_MTIOCTOP" >&6; } # decide which tape device to compile (arranged in such a way that # only one actually gets compiled) @@ -28180,8 +30068,8 @@ _ACEOF # # Check for various "mt status" related structure elements. # - { echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5 -echo $ECHO_N "checking for mt_flags mtget structure element... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5 +$as_echo_n "checking for mt_flags mtget structure element... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -28212,20 +30100,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MT_FLAGS 1 @@ -28233,19 +30122,19 @@ _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5 -echo $ECHO_N "checking for mt_fileno mtget structure element... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5 +$as_echo_n "checking for mt_fileno mtget structure element... " >&6; } mt_fileno_result="found" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -28277,20 +30166,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MT_FILENO 1 @@ -28298,19 +30188,19 @@ _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5 -echo $ECHO_N "checking for mt_blkno mtget structure element... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5 +$as_echo_n "checking for mt_blkno mtget structure element... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -28341,20 +30231,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MT_BLKNO 1 @@ -28362,19 +30253,19 @@ _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5 -echo $ECHO_N "checking for mt_dsreg mtget structure element... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5 +$as_echo_n "checking for mt_dsreg mtget structure element... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -28405,20 +30296,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MT_DSREG 1 @@ -28426,19 +30318,19 @@ _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5 -echo $ECHO_N "checking for mt_erreg mtget structure element... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5 +$as_echo_n "checking for mt_erreg mtget structure element... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -28469,20 +30361,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_MT_ERREG 1 @@ -28490,12 +30383,12 @@ _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -28513,9 +30406,9 @@ if test "${with_bsd_security+set}" = set; then withval=$with_bsd_security; case "$withval" in n | no) BSD_SECURITY=no ;; - y | ye | yes) ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;} + y | ye | yes) BSD_SECURITY=yes ;; + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28529,10 +30422,10 @@ fi if test "${with_amandahosts+set}" = set; then withval=$with_amandahosts; case "$withval" in - n | no ) USE_AMANDAHOSTS="no" ;; - y | ye | yes) : ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5 -echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;} + n | no ) USE_AMANDAHOSTS=no ;; + y | ye | yes) USE_AMANDAHOSTS=yes ;; + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28566,16 +30459,18 @@ fi - BSDTCP_SECURITY="no" + + + BSDTCP_SECURITY="yes" # Check whether --with-bsdtcp-security was given. if test "${with_bsdtcp_security+set}" = set; then withval=$with_bsdtcp_security; case "$withval" in - n | no) : ;; + n | no) BSDTCP_SECURITY=no ;; y | ye | yes) BSDTCP_SECURITY=yes ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28590,6 +30485,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi + if test x"$BSDTCP_SECURITY" = x"yes"; then WANT_BSDTCP_SECURITY_TRUE= WANT_BSDTCP_SECURITY_FALSE='#' @@ -28600,6 +30496,7 @@ fi + BSDUDP_SECURITY="no" # Check whether --with-bsdudp-security was given. @@ -28608,8 +30505,8 @@ if test "${with_bsdudp_security+set}" = set; then case "$withval" in n | no) : ;; y | ye | yes) BSDUDP_SECURITY=yes ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28624,6 +30521,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi + if test x"$BSDUDP_SECURITY" = x"yes"; then WANT_BSDUDP_SECURITY_TRUE= WANT_BSDUDP_SECURITY_FALSE='#' @@ -28634,6 +30532,7 @@ fi + RSH_SECURITY=no # Check whether --with-rsh-security was given. @@ -28642,8 +30541,8 @@ if test "${with_rsh_security+set}" = set; then case "$withval" in n | no) : ;; y | ye | yes) RSH_SECURITY=yes ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28668,16 +30567,17 @@ fi - SSH_SECURITY=no + + SSH_SECURITY=yes # Check whether --with-ssh-security was given. if test "${with_ssh_security+set}" = set; then withval=$with_ssh_security; case "$withval" in - n | no) : ;; + n | no) SSH_SECURITY=no ;; y | ye | yes) SSH_SECURITY=yes ;; - *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5 -echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5 +$as_echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -28691,10 +30591,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SSH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SSH in [\\/]* | ?:[\\/]*) @@ -28709,7 +30609,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -28721,11 +30621,11 @@ esac fi SSH=$ac_cv_path_SSH if test -n "$SSH"; then - { echo "$as_me:$LINENO: result: $SSH" >&5 -echo "${ECHO_T}$SSH" >&6; } + { $as_echo "$as_me:$LINENO: result: $SSH" >&5 +$as_echo "$SSH" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -28746,14 +30646,14 @@ fi case "$SSH_OPTIONS" in y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5 -echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5 +$as_echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;} { (exit 1); exit 1; }; };; *) : ;; esac - { echo "$as_me:$LINENO: checking SSH options" >&5 -echo $ECHO_N "checking SSH options... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking SSH options" >&5 +$as_echo_n "checking SSH options... " >&6; } # if we didn't get SSH options from the user, figure them out for ourselves if test -z "$SSH_OPTIONS"; then case `$SSH -V 2>&1` in @@ -28769,8 +30669,8 @@ echo $ECHO_N "checking SSH options... $ECHO_C" >&6; } quoted="\"`echo "$i" | sed -e 's/\"/\\\"/'`\"" SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }$quoted"; done - { echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5 -echo "${ECHO_T}$SSH_OPTIONS" >&6; } + { $as_echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5 +$as_echo "$SSH_OPTIONS" >&6; } # finally, make the various outputs for all of this @@ -28799,6 +30699,9 @@ fi + # (note -- don't just substitute SSH_OPTIONS -- shell quoting will break) + + # Specify --with-krb4-security if Kerberos software is in somewhere # other than the listed KRB4_SPOTS. We only compile kerberos support in # if the right files are there. @@ -28823,16 +30726,16 @@ fi # check the remaining, subsidiary options - { echo "$as_me:$LINENO: checking host principal" >&5 -echo $ECHO_N "checking host principal... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking host principal" >&5 +$as_echo_n "checking host principal... " >&6; } # Check whether --with-server-principal was given. if test "${with_server_principal+set}" = set; then withval=$with_server_principal; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;} { (exit 1); exit 1; }; } ;; *) SERVER_HOST_PRINCIPAL="$withval" ;; @@ -28843,19 +30746,19 @@ else fi - { echo "$as_me:$LINENO: result: $SERVER_HOST_PRINCIPAL" >&5 -echo "${ECHO_T}$SERVER_HOST_PRINCIPAL" >&6; } + { $as_echo "$as_me:$LINENO: result: $SERVER_HOST_PRINCIPAL" >&5 +$as_echo "$SERVER_HOST_PRINCIPAL" >&6; } - { echo "$as_me:$LINENO: checking server host instance" >&5 -echo $ECHO_N "checking server host instance... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking server host instance" >&5 +$as_echo_n "checking server host instance... " >&6; } # Check whether --with-server-instance was given. if test "${with_server_instance+set}" = set; then withval=$with_server_instance; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;} { (exit 1); exit 1; }; } ;; *) SERVER_HOST_INSTANCE="$withval" ;; @@ -28866,19 +30769,19 @@ else fi - { echo "$as_me:$LINENO: result: $SERVER_HOST_INSTANCE" >&5 -echo "${ECHO_T}$SERVER_HOST_INSTANCE" >&6; } + { $as_echo "$as_me:$LINENO: result: $SERVER_HOST_INSTANCE" >&5 +$as_echo "$SERVER_HOST_INSTANCE" >&6; } - { echo "$as_me:$LINENO: checking server host key file" >&5 -echo $ECHO_N "checking server host key file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking server host key file" >&5 +$as_echo_n "checking server host key file... " >&6; } # Check whether --with-server-keyfile was given. if test "${with_server_keyfile+set}" = set; then withval=$with_server_keyfile; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;} { (exit 1); exit 1; }; } ;; *) SERVER_HOST_KEY_FILE="$withval" ;; @@ -28889,19 +30792,19 @@ else fi - { echo "$as_me:$LINENO: result: $SERVER_HOST_KEY_FILE" >&5 -echo "${ECHO_T}$SERVER_HOST_KEY_FILE" >&6; } + { $as_echo "$as_me:$LINENO: result: $SERVER_HOST_KEY_FILE" >&5 +$as_echo "$SERVER_HOST_KEY_FILE" >&6; } - { echo "$as_me:$LINENO: checking client host principle" >&5 -echo $ECHO_N "checking client host principle... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking client host principle" >&5 +$as_echo_n "checking client host principle... " >&6; } # Check whether --with-client-principal was given. if test "${with_client_principal+set}" = set; then withval=$with_client_principal; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;} { (exit 1); exit 1; }; } ;; *) CLIENT_HOST_PRINCIPAL="$withval" ;; @@ -28912,19 +30815,19 @@ else fi - { echo "$as_me:$LINENO: result: $CLIENT_HOST_PRINCIPAL" >&5 -echo "${ECHO_T}$CLIENT_HOST_PRINCIPAL" >&6; } + { $as_echo "$as_me:$LINENO: result: $CLIENT_HOST_PRINCIPAL" >&5 +$as_echo "$CLIENT_HOST_PRINCIPAL" >&6; } - { echo "$as_me:$LINENO: checking client host instance" >&5 -echo $ECHO_N "checking client host instance... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking client host instance" >&5 +$as_echo_n "checking client host instance... " >&6; } # Check whether --with-client-instance was given. if test "${with_client_instance+set}" = set; then withval=$with_client_instance; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;} { (exit 1); exit 1; }; } ;; *) CLIENT_HOST_INSTANCE="$withval" ;; @@ -28935,19 +30838,19 @@ else fi - { echo "$as_me:$LINENO: result: $CLIENT_HOST_INSTANCE" >&5 -echo "${ECHO_T}$CLIENT_HOST_INSTANCE" >&6; } + { $as_echo "$as_me:$LINENO: result: $CLIENT_HOST_INSTANCE" >&5 +$as_echo "$CLIENT_HOST_INSTANCE" >&6; } - { echo "$as_me:$LINENO: checking client host key file" >&5 -echo $ECHO_N "checking client host key file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking client host key file" >&5 +$as_echo_n "checking client host key file... " >&6; } # Check whether --with-client-keyfile was given. if test "${with_client_keyfile+set}" = set; then withval=$with_client_keyfile; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;} { (exit 1); exit 1; }; } ;; *) CLIENT_HOST_KEY_FILE="$withval" ;; @@ -28963,19 +30866,19 @@ fi # add quotes CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\"" fi - { echo "$as_me:$LINENO: result: $CLIENT_HOST_KEY_FILE" >&5 -echo "${ECHO_T}$CLIENT_HOST_KEY_FILE" >&6; } + { $as_echo "$as_me:$LINENO: result: $CLIENT_HOST_KEY_FILE" >&5 +$as_echo "$CLIENT_HOST_KEY_FILE" >&6; } - { echo "$as_me:$LINENO: checking ticket lifetime" >&5 -echo $ECHO_N "checking ticket lifetime... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ticket lifetime" >&5 +$as_echo_n "checking ticket lifetime... " >&6; } # Check whether --with-ticket-lifetime was given. if test "${with_ticket_lifetime+set}" = set; then withval=$with_ticket_lifetime; case "$withval" in "" | y | ye | yes | n | no) - { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5 -echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;} + { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5 +$as_echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;} { (exit 1); exit 1; }; } ;; *) TICKET_LIFETIME="$withval" ;; @@ -28986,21 +30889,21 @@ else fi - { echo "$as_me:$LINENO: result: $TICKET_LIFETIME" >&5 -echo "${ECHO_T}$TICKET_LIFETIME" >&6; } + { $as_echo "$as_me:$LINENO: result: $TICKET_LIFETIME" >&5 +$as_echo "$TICKET_LIFETIME" >&6; } if test "x${KRB4_SECURITY}" = "xyes"; then - { echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5 -echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5 +$as_echo_n "checking for Kerberos and Amanda kerberos4 bits... " >&6; } found="no" for dir in $KRB4_SPOTS; do if test \( -f ${dir}/lib/libkrb.a -o -f ${dir}/lib/libkrb.so \) -a \( -f ${dir}/lib/libdes.a -o -f ${dir}/lib/libdes.so \) ; then # # This is the original Kerberos 4. # - { echo "$as_me:$LINENO: result: found in $dir" >&5 -echo "${ECHO_T}found in $dir" >&6; } + { $as_echo "$as_me:$LINENO: result: found in $dir" >&5 +$as_echo "found in $dir" >&6; } found="yes" # @@ -29028,8 +30931,8 @@ echo "${ECHO_T}found in $dir" >&6; } # # This is Kerberos 5 with Kerberos 4 back-support. # - { echo "$as_me:$LINENO: result: found in $dir" >&5 -echo "${ECHO_T}found in $dir" >&6; } + { $as_echo "$as_me:$LINENO: result: found in $dir" >&5 +$as_echo "found in $dir" >&6; } found="yes" CPPFLAGS="$CPPFLAGS -I$dir/include -I$dir/include/kerberosIV" @@ -29048,11 +30951,11 @@ echo "${ECHO_T}found in $dir" >&6; } done if test "x$found" = "xno" ; then - { echo "$as_me:$LINENO: result: no libraries found" >&5 -echo "${ECHO_T}no libraries found" >&6; } + { $as_echo "$as_me:$LINENO: result: no libraries found" >&5 +$as_echo "no libraries found" >&6; } - { echo "$as_me:$LINENO: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&5 -echo "$as_me: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&5 +$as_echo "$as_me: WARNING: No Kerberos IV libraries were found on your system; disabling krb4-security" >&2;} cat <>config.warnings @@ -29114,6 +31017,16 @@ fi + + + + + + + + + + # Specify --with-krb5-security if Kerberos software is in somewhere # other than the listed KRB5_SPOTS. We only compile kerberos support in # if the right files are there. @@ -29141,8 +31054,8 @@ fi # if found, force the static versions of these libs (.a) by linking directly # with the .a files. I don't know how to get -R dependancies checked # in autoconf at this time. -kashmir - { echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5 -echo $ECHO_N "checking for Kerberos V libraries... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5 +$as_echo_n "checking for Kerberos V libraries... " >&6; } KRB5_DIR_FOUND="" for dir in $KRB5_SPOTS; do for lib in lib lib64; do @@ -29176,8 +31089,8 @@ echo $ECHO_N "checking for Kerberos V libraries... $ECHO_C" >&6; } done if test "$KRB5_DIR_FOUND"; then - { echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5 -echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6; } + { $as_echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5 +$as_echo "found in $KRB5_DIR_FOUND" >&6; } # # some OS's, such as NetBSD, stick krb5 includes out of the way... # should probably just use autoconf to look for various include @@ -29192,10 +31105,10 @@ echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6; } fi -{ echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5 -echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5 +$as_echo_n "checking for main in -lkrb5support... " >&6; } if test "${ac_cv_lib_krb5support_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkrb5support $LIBS" @@ -29221,33 +31134,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_krb5support_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_krb5support_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5 -echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6; } -if test $ac_cv_lib_krb5support_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5 +$as_echo "$ac_cv_lib_krb5support_main" >&6; } +if test "x$ac_cv_lib_krb5support_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBKRB5SUPPORT 1 _ACEOF @@ -29265,10 +31182,10 @@ cat >>confdefs.h <<\_ACEOF _ACEOF else - { echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5 -echo "${ECHO_T}no krb5 system libraries found" >&6; } - { { echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5 -echo "$as_me: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&2;} + { $as_echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5 +$as_echo "no krb5 system libraries found" >&6; } + { { $as_echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5 +$as_echo "$as_me: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&2;} { (exit 1); exit 1; }; } KRB5_SECURITY="no" fi @@ -29284,6 +31201,7 @@ fi + # # Dumpers # @@ -29294,10 +31212,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XFSDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $XFSDUMP in [\\/]* | ?:[\\/]*) @@ -29312,7 +31230,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XFSDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29324,11 +31242,11 @@ esac fi XFSDUMP=$ac_cv_path_XFSDUMP if test -n "$XFSDUMP"; then - { echo "$as_me:$LINENO: result: $XFSDUMP" >&5 -echo "${ECHO_T}$XFSDUMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $XFSDUMP" >&5 +$as_echo "$XFSDUMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29339,10 +31257,10 @@ done do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XFSRESTORE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $XFSRESTORE in [\\/]* | ?:[\\/]*) @@ -29357,7 +31275,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XFSRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29369,11 +31287,11 @@ esac fi XFSRESTORE=$ac_cv_path_XFSRESTORE if test -n "$XFSRESTORE"; then - { echo "$as_me:$LINENO: result: $XFSRESTORE" >&5 -echo "${ECHO_T}$XFSRESTORE" >&6; } + { $as_echo "$as_me:$LINENO: result: $XFSRESTORE" >&5 +$as_echo "$XFSRESTORE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29392,8 +31310,8 @@ cat >>confdefs.h <<_ACEOF _ACEOF - { echo "$as_me:$LINENO: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&5 -echo "$as_me: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&5 +$as_echo "$as_me: WARNING: xfsdump causes the setuid-root rundump program to be enabled. To disable it, just #undef XFSDUMP in config/config.h" >&2;} cat <>config.warnings @@ -29408,10 +31326,10 @@ AAW_EOF # Extract the first word of "vxdump", so it can be a program name with args. set dummy vxdump; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_VXDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $VXDUMP in [\\/]* | ?:[\\/]*) @@ -29427,7 +31345,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_VXDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29439,20 +31357,20 @@ esac fi VXDUMP=$ac_cv_path_VXDUMP if test -n "$VXDUMP"; then - { echo "$as_me:$LINENO: result: $VXDUMP" >&5 -echo "${ECHO_T}$VXDUMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $VXDUMP" >&5 +$as_echo "$VXDUMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "vxrestore", so it can be a program name with args. set dummy vxrestore; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_VXRESTORE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $VXRESTORE in [\\/]* | ?:[\\/]*) @@ -29468,7 +31386,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_VXRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29480,11 +31398,11 @@ esac fi VXRESTORE=$ac_cv_path_VXRESTORE if test -n "$VXRESTORE"; then - { echo "$as_me:$LINENO: result: $VXRESTORE" >&5 -echo "${ECHO_T}$VXRESTORE" >&6; } + { $as_echo "$as_me:$LINENO: result: $VXRESTORE" >&5 +$as_echo "$VXRESTORE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29506,10 +31424,10 @@ _ACEOF # Extract the first word of "vdump", so it can be a program name with args. set dummy vdump; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_VDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $VDUMP in [\\/]* | ?:[\\/]*) @@ -29524,7 +31442,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_VDUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29536,20 +31454,20 @@ esac fi VDUMP=$ac_cv_path_VDUMP if test -n "$VDUMP"; then - { echo "$as_me:$LINENO: result: $VDUMP" >&5 -echo "${ECHO_T}$VDUMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $VDUMP" >&5 +$as_echo "$VDUMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "vrestore", so it can be a program name with args. set dummy vrestore; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_VRESTORE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $VRESTORE in [\\/]* | ?:[\\/]*) @@ -29564,7 +31482,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_VRESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29576,11 +31494,11 @@ esac fi VRESTORE=$ac_cv_path_VRESTORE if test -n "$VRESTORE"; then - { echo "$as_me:$LINENO: result: $VRESTORE" >&5 -echo "${ECHO_T}$VRESTORE" >&6; } + { $as_echo "$as_me:$LINENO: result: $VRESTORE" >&5 +$as_echo "$VRESTORE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29601,10 +31519,10 @@ _ACEOF # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) @@ -29619,7 +31537,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29632,11 +31550,11 @@ esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { echo "$as_me:$LINENO: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6; } + { $as_echo "$as_me:$LINENO: result: $GREP" >&5 +$as_echo "$GREP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29657,14 +31575,16 @@ _ACEOF # a variable is set up here to specify the order of dump programs to # search for on the system. DUMP_PROGRAMS="ufsdump dump backup" - dump_returns_1= + DUMP_RETURNS_1= + AIX_BACKUP= case "$target" in *-dg-*) DUMP_PROGRAMS="dump "$DUMP_PROGRAMS - dump_returns_1=yes + DUMP_RETURNS_1=1 ;; *-ibm-aix*) DUMP_PROGRAMS="backup "$DUMP_PROGRAMS + AIX_BACKUP=1 cat >>confdefs.h <<\_ACEOF #define AIX_BACKUP 1 @@ -29672,11 +31592,11 @@ _ACEOF ;; *-ultrix*) - dump_returns_1=yes + DUMP_RETURNS_1=1 ;; esac - if test -n "$dump_returns_1"; then + if test -n "$DUMP_RETURNS_1"; then cat >>confdefs.h <<\_ACEOF #define DUMP_RETURNS_1 1 @@ -29688,10 +31608,10 @@ _ACEOF do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $DUMP in [\\/]* | ?:[\\/]*) @@ -29706,7 +31626,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DUMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29718,11 +31638,11 @@ esac fi DUMP=$ac_cv_path_DUMP if test -n "$DUMP"; then - { echo "$as_me:$LINENO: result: $DUMP" >&5 -echo "${ECHO_T}$DUMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $DUMP" >&5 +$as_echo "$DUMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29733,10 +31653,10 @@ done do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RESTORE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $RESTORE in [\\/]* | ?:[\\/]*) @@ -29751,7 +31671,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RESTORE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -29763,11 +31683,11 @@ esac fi RESTORE=$ac_cv_path_RESTORE if test -n "$RESTORE"; then - { echo "$as_me:$LINENO: result: $RESTORE" >&5 -echo "${ECHO_T}$RESTORE" >&6; } + { $as_echo "$as_me:$LINENO: result: $RESTORE" >&5 +$as_echo "$RESTORE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -29801,10 +31721,10 @@ _ACEOF # check for an estimate flag if test -x $DUMP; then - { echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5 -echo $ECHO_N "checking whether $DUMP supports -E or -S for estimates... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5 +$as_echo_n "checking whether $DUMP supports -E or -S for estimates... " >&6; } if test "${amanda_cv_dump_estimate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$DUMP" in @@ -29816,7 +31736,7 @@ else { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } cat conftest.d-E >&5 { ac_try='$DUMP 9Sf /dev/null /dev/null/invalid/fs 2>&1 @@ -29826,7 +31746,7 @@ else { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } cat conftest.d-S >&5 { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 @@ -29836,21 +31756,21 @@ else { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } cat conftest.d >&5 if { ac_try='cmp conftest.d-E conftest.d 1>&2' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then amanda_cv_dump_estimate=E elif { ac_try='cmp conftest.d-S conftest.d 1>&2' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then amanda_cv_dump_estimate=S else @@ -29863,12 +31783,12 @@ else esac fi -{ echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5 -echo "${ECHO_T}$amanda_cv_dump_estimate" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5 +$as_echo "$amanda_cv_dump_estimate" >&6; } else - { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5 -echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5 +$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;} cat <>config.warnings @@ -29891,10 +31811,10 @@ _ACEOF if test "${with_dump_honor_nodump+set}" = set; then withval=$with_dump_honor_nodump; if test -x $DUMP; then - { echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5 -echo $ECHO_N "checking whether $DUMP supports -h (honor nodump flag)... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5 +$as_echo_n "checking whether $DUMP supports -h (honor nodump flag)... " >&6; } if test "${amanda_cv_honor_nodump+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case "$DUMP" in @@ -29906,7 +31826,7 @@ else { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } cat conftest.d-h >&5 { ac_try='$DUMP 9f /dev/null /dev/null/invalid/fs 2>&1 @@ -29916,14 +31836,14 @@ else { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } cat conftest.d >&5 if { ac_try='diff conftest.d-h conftest.d 1>&2' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then amanda_cv_honor_nodump=yes else @@ -29936,12 +31856,12 @@ else esac fi -{ echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5 -echo "${ECHO_T}$amanda_cv_honor_nodump" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5 +$as_echo "$amanda_cv_honor_nodump" >&6; } else - { echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5 -echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5 +$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;} cat <>config.warnings @@ -29966,6 +31886,9 @@ fi + + + # call with # Check whether --with-gnutar was given. @@ -29976,8 +31899,8 @@ if test "${with_gnutar+set}" = set; then /*) GNUTAR="$withval";; y|ye|yes) :;; n|no) GNUTAR=no ;; - *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5 +$as_echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;} { (exit 1); exit 1; }; };; esac # done @@ -29994,10 +31917,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GNUTAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GNUTAR in [\\/]* | ?:[\\/]*) @@ -30012,7 +31935,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30024,11 +31947,11 @@ esac fi GNUTAR=$ac_cv_path_GNUTAR if test -n "$GNUTAR"; then - { echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6; } + { $as_echo "$as_me:$LINENO: result: $GNUTAR" >&5 +$as_echo "$GNUTAR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30044,8 +31967,8 @@ done *) # warning.. - { echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5 -echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5 +$as_echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;} cat <>config.warnings @@ -30084,8 +32007,8 @@ if test "${with_smbclient+set}" = set; then /*) SAMBA_CLIENT="$withval";; y|ye|yes) :;; n|no) SAMBA_CLIENT=no ;; - *) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5 -echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5 +$as_echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;} { (exit 1); exit 1; }; };; esac @@ -30096,8 +32019,8 @@ fi # Check whether --with-samba-user was given. if test "${with_samba_user+set}" = set; then - withval=$with_samba_user; { { echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5 -echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;} + withval=$with_samba_user; { { $as_echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5 +$as_echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;} { (exit 1); exit 1; }; } fi @@ -30106,10 +32029,10 @@ fi if test "x$SAMBA_CLIENT" != "xno"; then # Extract the first word of "smbclient", so it can be a program name with args. set dummy smbclient; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SAMBA_CLIENT in [\\/]* | ?:[\\/]*) @@ -30124,7 +32047,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SAMBA_CLIENT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30136,11 +32059,11 @@ esac fi SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT if test -n "$SAMBA_CLIENT"; then - { echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5 -echo "${ECHO_T}$SAMBA_CLIENT" >&6; } + { $as_echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5 +$as_echo "$SAMBA_CLIENT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30155,8 +32078,8 @@ fi ;; *) - { echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5 -echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5 +$as_echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;} cat <>config.warnings @@ -30207,8 +32130,8 @@ if test "${with_rundump+set}" = set; then case "$withval" in n | no) USE_RUNDUMP=no ;; y | ye | yes) USE_RUNDUMP=yes ;; - *) { { echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5 -echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;} + *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5 +$as_echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;} { (exit 1); exit 1; }; };; esac @@ -30216,14 +32139,19 @@ fi if test x"$USE_RUNDUMP" = x"yes"; then + USE_RUNDUMP=1 cat >>confdefs.h <<\_ACEOF #define USE_RUNDUMP 1 _ACEOF + else + USE_RUNDUMP= fi + + # # Look for other programs Amanda will use # @@ -30231,10 +32159,10 @@ _ACEOF # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) @@ -30249,7 +32177,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30262,11 +32190,11 @@ esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { echo "$as_me:$LINENO: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6; } + { $as_echo "$as_me:$LINENO: result: $GREP" >&5 +$as_echo "$GREP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30276,45 +32204,40 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -30329,33 +32252,24 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" @@ -30365,10 +32279,10 @@ echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } # Extract the first word of "lint", so it can be a program name with args. set dummy lint; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AMLINT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $AMLINT in [\\/]* | ?:[\\/]*) @@ -30384,7 +32298,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30396,11 +32310,11 @@ esac fi AMLINT=$ac_cv_path_AMLINT if test -n "$AMLINT"; then - { echo "$as_me:$LINENO: result: $AMLINT" >&5 -echo "${ECHO_T}$AMLINT" >&6; } + { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5 +$as_echo "$AMLINT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30464,10 +32378,10 @@ fi else # Extract the first word of "splint", so it can be a program name with args. set dummy splint; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AMLINT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $AMLINT in [\\/]* | ?:[\\/]*) @@ -30482,7 +32396,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30494,20 +32408,21 @@ esac fi AMLINT=$ac_cv_path_AMLINT if test -n "$AMLINT"; then - { echo "$as_me:$LINENO: result: $AMLINT" >&5 -echo "${ECHO_T}$AMLINT" >&6; } + { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5 +$as_echo "$AMLINT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test ! -z "$AMLINT"; then AMLINT="splint" + AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' else AMLINT='echo "Error: LINT is not installed" ; false' + AMLINTFLAGS='' fi - AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode' fi @@ -30515,10 +32430,10 @@ for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. @@ -30531,7 +32446,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30542,11 +32457,11 @@ fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - { echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6; } + { $as_echo "$as_me:$LINENO: result: $LEX" >&5 +$as_echo "$LEX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30579,15 +32494,16 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking lex output file root" >&5 +$as_echo_n "checking lex output file root... " >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then @@ -30595,20 +32511,20 @@ if test -f lex.yy.c; then elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else - { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +$as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +$as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then - { echo "$as_me:$LINENO: checking lex library" >&5 -echo $ECHO_N "checking lex library... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking lex library" >&5 +$as_echo_n "checking lex library... " >&6; } if test "${ac_cv_lib_lex+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS @@ -30624,26 +32540,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lex=$ac_lib else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break @@ -30651,16 +32571,16 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ LIBS=$ac_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 -echo "${ECHO_T}$ac_cv_lib_lex" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 +$as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi -{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +$as_echo_n "checking whether yytext is a pointer... " >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since @@ -30678,33 +32598,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_prog_lex_yytext_pointer=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF @@ -30722,10 +32646,10 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $AR in [\\/]* | ?:[\\/]*) @@ -30740,7 +32664,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30752,11 +32676,11 @@ esac fi AR=$ac_cv_path_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30765,10 +32689,10 @@ fi # Extract the first word of "gettext", so it can be a program name with args. set dummy gettext; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GETTEXT in [\\/]* | ?:[\\/]*) @@ -30783,7 +32707,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30795,11 +32719,11 @@ esac fi GETTEXT=$ac_cv_path_GETTEXT if test -n "$GETTEXT"; then - { echo "$as_me:$LINENO: result: $GETTEXT" >&5 -echo "${ECHO_T}$GETTEXT" >&6; } + { $as_echo "$as_me:$LINENO: result: $GETTEXT" >&5 +$as_echo "$GETTEXT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30808,10 +32732,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -30824,7 +32748,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30835,11 +32759,11 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30850,10 +32774,10 @@ for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -30866,7 +32790,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30877,11 +32801,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } + { $as_echo "$as_me:$LINENO: result: $YACC" >&5 +$as_echo "$YACC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30889,11 +32813,11 @@ fi done test -n "$YACC" || YACC="yacc" -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -30928,17 +32852,17 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } # Extract the first word of "dd", so it can be a program name with args. set dummy dd; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $DD in [\\/]* | ?:[\\/]*) @@ -30953,7 +32877,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -30965,11 +32889,11 @@ esac fi DD=$ac_cv_path_DD if test -n "$DD"; then - { echo "$as_me:$LINENO: result: $DD" >&5 -echo "${ECHO_T}$DD" >&6; } + { $as_echo "$as_me:$LINENO: result: $DD" >&5 +$as_echo "$DD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -30978,10 +32902,10 @@ fi # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_BASH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $BASH in [\\/]* | ?:[\\/]*) @@ -30996,7 +32920,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31008,11 +32932,11 @@ esac fi BASH=$ac_cv_path_BASH if test -n "$BASH"; then - { echo "$as_me:$LINENO: result: $BASH" >&5 -echo "${ECHO_T}$BASH" >&6; } + { $as_echo "$as_me:$LINENO: result: $BASH" >&5 +$as_echo "$BASH" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31023,10 +32947,10 @@ fi # Extract the first word of "sort", so it can be a program name with args. set dummy sort; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SORT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SORT in [\\/]* | ?:[\\/]*) @@ -31041,7 +32965,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31054,19 +32978,19 @@ esac fi SORT=$ac_cv_path_SORT if test -n "$SORT"; then - { echo "$as_me:$LINENO: result: $SORT" >&5 -echo "${ECHO_T}$SORT" >&6; } + { $as_echo "$as_me:$LINENO: result: $SORT" >&5 +$as_echo "$SORT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # sort is only needed in the server build if test x"$SORT" = x"NONE" && $WANT_SERVER; then - { { echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5 -echo "$as_me: error: Set SORT to the path of the sort program." >&2;} + { { $as_echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5 +$as_echo "$as_me: error: Set SORT to the path of the sort program." >&2;} { (exit 1); exit 1; }; } fi @@ -31082,10 +33006,10 @@ _ACEOF do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MAILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MAILER in [\\/]* | ?:[\\/]*) @@ -31100,7 +33024,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MAILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31112,11 +33036,11 @@ esac fi MAILER=$ac_cv_path_MAILER if test -n "$MAILER"; then - { echo "$as_me:$LINENO: result: $MAILER" >&5 -echo "${ECHO_T}$MAILER" >&6; } + { $as_echo "$as_me:$LINENO: result: $MAILER" >&5 +$as_echo "$MAILER" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31126,8 +33050,8 @@ test -n "$MAILER" || MAILER="NONE" if test x"$MAILER" = x"NONE"; then - { echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5 -echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5 +$as_echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;} cat <>config.warnings @@ -31135,22 +33059,25 @@ WARNING: Amanda cannot send mail reports without a mailer. AAW_EOF + DEFAULT_MAILER="" else + DEFAULT_MAILER="$MAILER" + fi cat >>confdefs.h <<_ACEOF -#define MAILER "$MAILER" +#define DEFAULT_MAILER "$DEFAULT_MAILER" _ACEOF - fi + # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MT in [\\/]* | ?:[\\/]*) @@ -31165,7 +33092,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31178,11 +33105,11 @@ esac fi MT=$ac_cv_path_MT if test -n "$MT"; then - { echo "$as_me:$LINENO: result: $MT" >&5 -echo "${ECHO_T}$MT" >&6; } + { $as_echo "$as_me:$LINENO: result: $MT" >&5 +$as_echo "$MT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31206,10 +33133,10 @@ _ACEOF do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PRINT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PRINT in [\\/]* | ?:[\\/]*) @@ -31224,7 +33151,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PRINT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31236,11 +33163,11 @@ esac fi PRINT=$ac_cv_path_PRINT if test -n "$PRINT"; then - { echo "$as_me:$LINENO: result: $PRINT" >&5 -echo "${ECHO_T}$PRINT" >&6; } + { $as_echo "$as_me:$LINENO: result: $PRINT" >&5 +$as_echo "$PRINT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31254,10 +33181,10 @@ cat >>confdefs.h <<_ACEOF _ACEOF - { echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5 -echo $ECHO_N "checking which flag to use to select a printer... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5 +$as_echo_n "checking which flag to use to select a printer... " >&6; } if test "${amanda_cv_printer_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else amanda_cv_printer_flag=$PRINTER_FLAG @@ -31267,8 +33194,8 @@ else esac fi -{ echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5 -echo "${ECHO_T}$amanda_cv_printer_flag" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5 +$as_echo "$amanda_cv_printer_flag" >&6; } if test ! -z "$amanda_cv_printer_flag"; then cat >>confdefs.h <<_ACEOF @@ -31277,8 +33204,8 @@ _ACEOF else - { echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5 -echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5 +$as_echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;} cat <>config.warnings @@ -31293,10 +33220,10 @@ AAW_EOF # Extract the first word of "pcat", so it can be a program name with args. set dummy pcat; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PCAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PCAT in [\\/]* | ?:[\\/]*) @@ -31311,7 +33238,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31323,11 +33250,11 @@ esac fi PCAT=$ac_cv_path_PCAT if test -n "$PCAT"; then - { echo "$as_me:$LINENO: result: $PCAT" >&5 -echo "${ECHO_T}$PCAT" >&6; } + { $as_echo "$as_me:$LINENO: result: $PCAT" >&5 +$as_echo "$PCAT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31338,10 +33265,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) @@ -31356,7 +33283,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31368,11 +33295,11 @@ esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then - { echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6; } + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31384,10 +33311,10 @@ done if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. @@ -31400,7 +33327,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PERL="perl" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31411,11 +33338,11 @@ fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then - { echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6; } + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31425,27 +33352,27 @@ fi ac_perl_version="5.6.0" if test "x$PERL" != "x"; then - { echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 -echo $ECHO_N "checking for perl version greater than or equal to $ac_perl_version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5 +$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&6; } # NB: It would be nice to log the error if there is one, but we cannot rely # on autoconf internals $PERL -e "use $ac_perl_version;" > /dev/null 2>&1 if test $? -ne 0; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; - { { echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 -echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} + { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5 +$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;} { (exit 1); exit 1; }; } else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; }; + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; }; fi else - { echo "$as_me:$LINENO: WARNING: could not find perl" >&5 -echo "$as_me: WARNING: could not find perl" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5 +$as_echo "$as_me: WARNING: could not find perl" >&2;} fi @@ -31455,10 +33382,10 @@ fi do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SWIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) @@ -31473,7 +33400,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31485,11 +33412,11 @@ esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then - { echo "$as_me:$LINENO: result: $SWIG" >&5 -echo "${ECHO_T}$SWIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $SWIG" >&5 +$as_echo "$SWIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -31500,10 +33427,10 @@ done # Extract the first word of "swig", so it can be a program name with args. set dummy swig; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SWIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SWIG in [\\/]* | ?:[\\/]*) @@ -31518,7 +33445,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -31530,22 +33457,22 @@ esac fi SWIG=$ac_cv_path_SWIG if test -n "$SWIG"; then - { echo "$as_me:$LINENO: result: $SWIG" >&5 -echo "${ECHO_T}$SWIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $SWIG" >&5 +$as_echo "$SWIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -z "$SWIG" ; then SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' elif test -n "1.3.28" ; then - { echo "$as_me:$LINENO: checking for SWIG version" >&5 -echo $ECHO_N "checking for SWIG version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5 +$as_echo_n "checking for SWIG version... " >&6; } swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'` - { echo "$as_me:$LINENO: result: $swig_version" >&5 -echo "${ECHO_T}$swig_version" >&6; } + { $as_echo "$as_me:$LINENO: result: $swig_version" >&5 +$as_echo "$swig_version" >&6; } if test -n "$swig_version" ; then # Calculate the required version number components required=1.3.28 @@ -31594,6 +33521,107 @@ echo "${ECHO_T}$swig_version" >&6; } + # Extract the first word of "ps", so it can be a program name with args. +set dummy ps; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + case $PS in + [\\/]* | ?:[\\/]*) + ac_cv_path_PS="$PS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PS=$ac_cv_path_PS +if test -n "$PS"; then + { $as_echo "$as_me:$LINENO: result: $PS" >&5 +$as_echo "$PS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:$LINENO: checking ps argument to use" >&5 +$as_echo_n "checking ps argument to use... " >&6; } + PS_ARGUMENT= + + # ps is *very* non-portable, and across many systems, the same option + # (e.g., -e) can mean different things. So this macro tries to + # special-case most known systems, and makes an effort to detect unknown + # systems + case "$target" in + *-*-solaris*) + PS_ARGUMENT="-eo pid,ppid,comm" + ;; + + *-*-linux-*) + PS_ARGUMENT="-eo pid,ppid,command" + ;; + + *-*-*bsd*) + PS_ARGUMENT="-axo pid,ppid,command" + ;; + + *-apple-darwin*) + PS_ARGUMENT="-aAco pid,ppid,command" + ;; + + *-pc-cygwin) + # Cygwin is special-cased in Amanda::Process + PS_ARGUMENT=CYGWIN + ;; + + *-*-hpux*) + # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode + PS="UNIX95=1 $PS" + PS_ARGUMENT="-eo pid,ppid,comm" + ;; + + *) + for try in \ + "-axo pid,ppid,command" \ + "-aAco pid,ppid,command" \ + "-eo pid,ppid,comm" + do + ps $try >/dev/null 2>/dev/null + if test $? -eq 0; then + PS_ARGUMENT="$try" + break + fi + done + if test -z "$PS_ARGUMENT"; then + { { $as_echo "$as_me:$LINENO: error: Can't find ps argument to use." >&5 +$as_echo "$as_me: error: Can't find ps argument to use." >&2;} + { (exit 1); exit 1; }; } + fi + ;; + esac + + { $as_echo "$as_me:$LINENO: result: $PS_ARGUMENT" >&5 +$as_echo "$PS_ARGUMENT" >&6; } + + + # # Compiler / system characteristics @@ -31603,10 +33631,10 @@ echo "${ECHO_T}$swig_version" >&6; } # compiler # if test $ac_cv_c_compiler_gnu = yes; then - { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +$as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF @@ -31645,17 +33673,17 @@ rm -f conftest* fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +$as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -31727,20 +33755,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -31748,38 +33777,88 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -31791,33 +33870,34 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; @@ -31829,20 +33909,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -31850,29 +33931,31 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include + int main () { - _ascii (); _ebcdic (); +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + ; return 0; } @@ -31883,30 +33966,139 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -31925,14 +34117,14 @@ int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -31944,55 +34136,62 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # GCC_COMPILER is needed in the gnulib Makefile to silence errors @@ -32012,23 +34211,25 @@ fi - { echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5 -echo $ECHO_N "checking for gcc flag -Wparentheses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5 +$as_echo_n "checking for gcc flag -Wparentheses... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32044,23 +34245,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5 -echo $ECHO_N "checking for gcc flag -Wdeclaration-after-statement... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5 +$as_echo_n "checking for gcc flag -Wdeclaration-after-statement... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32076,23 +34279,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5 -echo $ECHO_N "checking for gcc flag -Wmissing-prototypes... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5 +$as_echo_n "checking for gcc flag -Wmissing-prototypes... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32108,23 +34313,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5 -echo $ECHO_N "checking for gcc flag -Wstrict-prototypes... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5 +$as_echo_n "checking for gcc flag -Wstrict-prototypes... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32140,23 +34347,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5 -echo $ECHO_N "checking for gcc flag -Wmissing-declarations... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5 +$as_echo_n "checking for gcc flag -Wmissing-declarations... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32172,23 +34381,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5 -echo $ECHO_N "checking for gcc flag -Wformat... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5 +$as_echo_n "checking for gcc flag -Wformat... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32204,23 +34415,59 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5 -echo $ECHO_N "checking for gcc flag -Wsign-compare... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat-security" >&5 +$as_echo_n "checking for gcc flag -Wformat-security... " >&6; } + if test "x$GCC" = "xyes"; then + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wformat-security[^[:alnum:]-]' 2>&1 > /dev/null + if test $? -eq 0; then + found_warning=yes + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + else + found_warning=no + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + fi + else + found_warning=no + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } + fi + + if test x"$found_warning" = x"yes"; then + AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat-security" + + + else + : + fi + + + + + + + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5 +$as_echo_n "checking for gcc flag -Wsign-compare... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32236,23 +34483,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5 -echo $ECHO_N "checking for gcc flag -Wfloat-equal... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5 +$as_echo_n "checking for gcc flag -Wfloat-equal... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32268,23 +34517,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5 -echo $ECHO_N "checking for gcc flag -Wold-style-definition... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5 +$as_echo_n "checking for gcc flag -Wold-style-definition... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32301,23 +34552,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wstrict-aliasing" >&5 -echo $ECHO_N "checking for gcc flag -Wstrict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-aliasing" >&5 +$as_echo_n "checking for gcc flag -Wstrict-aliasing... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32334,23 +34587,25 @@ echo "${ECHO_T}no (not using gcc)" >&6; } - { echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5 -echo $ECHO_N "checking for gcc flag -Wunknown-pragmas... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5 +$as_echo_n "checking for gcc flag -Wunknown-pragmas... " >&6; } if test "x$GCC" = "xyes"; then - $CC -v --help 2>&1 | $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null + (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 || + $CC -v --help 2>&1) | + $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null if test $? -eq 0; then found_warning=yes - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else found_warning=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else found_warning=no - { echo "$as_me:$LINENO: result: no (not using gcc)" >&5 -echo "${ECHO_T}no (not using gcc)" >&6; } + { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5 +$as_echo "no (not using gcc)" >&6; } fi if test x"$found_warning" = x"yes"; then @@ -32439,10 +34694,10 @@ else fi -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. @@ -32493,8 +34748,8 @@ done fi SED=$lt_cv_path_SED -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SED" >&5 +$as_echo "$SED" >&6; } # Check whether --with-gnu-ld was given. @@ -32507,8 +34762,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -32537,14 +34792,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } ;; esac elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR @@ -32574,19 +34829,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } + { $as_echo "$as_me:$LINENO: result: $LD" >&5 +$as_echo "$LD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -32628,10 +34883,10 @@ case $host_os in ;; esac -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +$as_echo_n "checking for BSD-compatible nm... " >&6; } if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. @@ -32670,25 +34925,25 @@ else test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +$as_echo_n "checking how to recognise dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -32857,8 +35112,8 @@ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) esac fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -32886,7 +35141,7 @@ ia64-*-hpux*) if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) @@ -32901,11 +35156,11 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 32904 "configure"' > conftest.$ac_ext + echo '#line 35159 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -32942,7 +35197,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) @@ -32986,10 +35241,10 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -33018,26 +35273,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then lt_cv_cc_needs_belf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c @@ -33047,8 +35306,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -33063,20 +35322,21 @@ need_locks="$enable_libtool_lock" for ac_header in dlfcn.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -33092,32 +35352,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -33131,69 +35392,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -33214,10 +35479,10 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -33230,7 +35495,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -33241,11 +35506,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -33258,10 +35523,10 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -33274,7 +35539,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -33285,11 +35550,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -33301,12 +35566,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -33316,43 +35577,47 @@ fi fi fi # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -33378,20 +35643,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -33401,15 +35667,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes @@ -33436,20 +35706,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" @@ -33474,20 +35745,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag @@ -33513,20 +35785,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -33541,8 +35814,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -33566,10 +35839,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up @@ -33657,8 +35930,8 @@ else fi fi -{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if @@ -33682,11 +35955,11 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" @@ -33718,20 +35991,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -33755,13 +36029,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err @@ -33769,7 +36044,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -33794,8 +36069,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -33823,20 +36098,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -33860,13 +36136,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err @@ -33874,7 +36151,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -33890,11 +36167,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=cpp @@ -33915,10 +36194,10 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. @@ -33931,7 +36210,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -33942,11 +36221,11 @@ fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $F77" >&5 +$as_echo "$F77" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -33959,10 +36238,10 @@ if test -z "$F77"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. @@ -33975,7 +36254,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -33986,11 +36265,11 @@ fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +$as_echo "$ac_ct_F77" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -34002,12 +36281,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 @@ -34016,37 +36291,41 @@ fi # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out @@ -34054,10 +36333,10 @@ rm -f a.out # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main @@ -34073,20 +36352,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -34096,16 +36376,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +$as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +$as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF @@ -34119,20 +36399,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no @@ -34141,8 +36422,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +$as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then @@ -34159,7 +36440,11 @@ else fi fi -G77=`test $ac_compiler_gnu = yes && echo yes` +if test $ac_compiler_gnu = yes; then + G77=yes +else + G77= +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -34171,10 +36456,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" @@ -34263,21 +36548,21 @@ else fi if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } + { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. @@ -34373,14 +36658,14 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -34435,7 +36720,7 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi @@ -34470,17 +36755,17 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } + { $as_echo "$as_me:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } fi -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null @@ -34492,8 +36777,8 @@ else fi rmdir .libs 2>/dev/null fi -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -34544,10 +36829,10 @@ with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -34560,7 +36845,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34571,11 +36856,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -34584,10 +36869,10 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -34600,7 +36885,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34611,11 +36896,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -34623,12 +36908,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -34640,10 +36921,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -34656,7 +36937,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34667,11 +36948,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -34680,10 +36961,10 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -34696,7 +36977,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34707,11 +36988,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -34719,12 +37000,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -34736,10 +37013,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -34752,7 +37029,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34763,11 +37040,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -34776,10 +37053,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -34792,7 +37069,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -34803,11 +37080,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -34815,12 +37092,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -34882,10 +37155,10 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -34935,19 +37208,19 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -34997,11 +37270,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else @@ -35091,8 +37364,8 @@ if test "$GCC" = no; then fi if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +$as_echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} cat <>config.warnings @@ -35103,8 +37376,8 @@ AAW_EOF if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +$as_echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} cat <>config.warnings @@ -35120,10 +37393,10 @@ fi # # Check to make sure the static flag actually works. # -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +$as_echo_n "checking if $compiler static flag $lt_prog_compiler_static works... " >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" @@ -35148,8 +37421,8 @@ else LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +$as_echo "$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : @@ -35170,10 +37443,10 @@ if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext @@ -35188,11 +37461,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35191: $lt_compile\"" >&5) + (eval echo "\"\$as_me:37464: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:35195: \$? = $ac_status" >&5 + echo "$as_me:37468: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -35205,8 +37478,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -35220,8 +37493,8 @@ lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -35424,18 +37697,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext @@ -35450,11 +37723,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35453: $lt_compile\"" >&5) + (eval echo "\"\$as_me:37726: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:35457: \$? = $ac_status" >&5 + echo "$as_me:37730: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -35467,8 +37740,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +$as_echo "$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -35491,10 +37764,10 @@ case $host_os in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null @@ -35512,11 +37785,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35515: $lt_compile\"" >&5) + (eval echo "\"\$as_me:37788: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:35519: \$? = $ac_status" >&5 + echo "$as_me:37792: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -35538,27 +37811,27 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} cat <>config.warnings @@ -35572,8 +37845,8 @@ else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -35945,18 +38218,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -35964,12 +38240,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -36004,18 +38281,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -36023,12 +38303,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -36474,8 +38755,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -36500,15 +38781,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -36525,7 +38806,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no @@ -36537,16 +38818,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -37099,12 +39380,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ @@ -37128,8 +39409,8 @@ else # directories. hardcode_action=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported @@ -37142,29 +39423,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -37196,10 +39477,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -37231,33 +39512,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -37270,10 +39555,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -37326,38 +39611,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -37389,39 +39678,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -37474,38 +39767,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -37537,39 +39834,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -37601,39 +39902,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -37665,33 +39970,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -37730,10 +40039,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -37741,7 +40050,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -37823,15 +40132,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -37839,7 +40148,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -37921,8 +40230,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -37944,13 +40253,13 @@ fi # Report which librarie types wil actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } +{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -37970,15 +40279,15 @@ aix4* | aix5*) fi ;; esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh @@ -38069,8 +40378,8 @@ if test -f "$ltmain"; then cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} + { $as_echo "$as_me:$LINENO: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL @@ -38476,8 +40785,8 @@ fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} cat <>config.warnings @@ -38491,8 +40800,8 @@ AAW_EOF eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} cat <>config.warnings @@ -38502,8 +40811,8 @@ AAW_EOF else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} cat <>config.warnings @@ -38524,16 +40833,16 @@ AAW_EOF # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +$as_echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +$as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi @@ -38671,8 +40980,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -38701,14 +41010,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } ;; esac elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR @@ -38738,19 +41047,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } + { $as_echo "$as_me:$LINENO: result: $LD" >&5 +$as_echo "$LD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -38813,8 +41122,8 @@ else fi # PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -38929,18 +41238,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -38948,12 +41260,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -38989,18 +41302,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -39008,12 +41324,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -39702,8 +42019,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ld_shlibs_CXX=no ;; esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" @@ -39727,7 +42044,7 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. @@ -39837,8 +42154,8 @@ lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -40112,18 +42429,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext @@ -40138,11 +42455,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:40141: $lt_compile\"" >&5) + (eval echo "\"\$as_me:42458: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:40145: \$? = $ac_status" >&5 + echo "$as_me:42462: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -40155,8 +42472,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in @@ -40179,10 +42496,10 @@ case $host_os in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null @@ -40200,11 +42517,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:40203: $lt_compile\"" >&5) + (eval echo "\"\$as_me:42520: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:40207: \$? = $ac_status" >&5 + echo "$as_me:42524: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -40226,27 +42543,27 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} cat <>config.warnings @@ -40260,8 +42577,8 @@ else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in @@ -40285,8 +42602,8 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar ;; esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -40311,15 +42628,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -40336,7 +42653,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no @@ -40348,16 +42665,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +$as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -40910,12 +43227,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ @@ -40939,8 +43256,8 @@ else # directories. hardcode_action_CXX=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported @@ -40953,29 +43270,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -41007,10 +43324,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -41042,33 +43359,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -41081,10 +43402,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -41137,38 +43458,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -41200,39 +43525,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -41285,38 +43614,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -41348,39 +43681,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -41412,39 +43749,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -41476,33 +43817,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -41541,10 +43886,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -41552,7 +43897,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -41634,15 +43979,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -41650,7 +43995,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -41732,8 +44077,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -42261,13 +44606,13 @@ done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } +{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -42286,15 +44631,15 @@ aix4* | aix5*) fi ;; esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no @@ -42305,8 +44650,8 @@ lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' @@ -42509,18 +44854,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +$as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext @@ -42535,11 +44880,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:42538: $lt_compile\"" >&5) + (eval echo "\"\$as_me:44883: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:42542: \$? = $ac_status" >&5 + echo "$as_me:44887: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -42552,8 +44897,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +$as_echo "$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in @@ -42576,10 +44921,10 @@ case $host_os in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null @@ -42597,11 +44942,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:42600: $lt_compile\"" >&5) + (eval echo "\"\$as_me:44945: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:42604: \$? = $ac_status" >&5 + echo "$as_me:44949: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -42623,27 +44968,27 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} cat <>config.warnings @@ -42657,8 +45002,8 @@ else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= @@ -43020,18 +45365,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -43039,12 +45387,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -43069,18 +45418,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -43088,12 +45440,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -43539,8 +45892,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +$as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -43565,15 +45918,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -43590,7 +45943,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no @@ -43602,16 +45955,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +$as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -44164,12 +46517,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ @@ -44193,8 +46546,8 @@ else # directories. hardcode_action_F77=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +$as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported @@ -44207,29 +46560,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -44726,10 +47079,10 @@ if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext @@ -44744,11 +47097,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:44747: $lt_compile\"" >&5) + (eval echo "\"\$as_me:47100: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:44751: \$? = $ac_status" >&5 + echo "$as_me:47104: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -44761,8 +47114,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" @@ -44776,8 +47129,8 @@ lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' @@ -44980,18 +47333,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +$as_echo "$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext @@ -45006,11 +47359,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:45009: $lt_compile\"" >&5) + (eval echo "\"\$as_me:47362: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:45013: \$? = $ac_status" >&5 + echo "$as_me:47366: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -45023,8 +47376,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +$as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in @@ -45047,10 +47400,10 @@ case $host_os in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null @@ -45068,11 +47421,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:45071: $lt_compile\"" >&5) + (eval echo "\"\$as_me:47424: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:45075: \$? = $ac_status" >&5 + echo "$as_me:47428: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -45094,27 +47447,27 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} cat <>config.warnings @@ -45128,8 +47481,8 @@ else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_GCJ= @@ -45501,18 +47854,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -45520,12 +47876,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -45560,18 +47917,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -45579,12 +47939,13 @@ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File S if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -46030,8 +48391,8 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +$as_echo "$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -46056,15 +48417,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -46081,7 +48442,7 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no @@ -46093,16 +48454,16 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >& cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +$as_echo "$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -46655,12 +49016,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ @@ -46684,8 +49045,8 @@ else # directories. hardcode_action_GCJ=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +$as_echo "$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported @@ -46698,29 +49059,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -46752,10 +49113,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -46787,33 +49148,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -46826,10 +49191,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -46882,38 +49247,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -46945,39 +49314,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -47030,38 +49403,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -47093,39 +49470,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -47157,39 +49538,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -47221,33 +49606,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -47286,10 +49675,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -47297,7 +49686,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -47379,15 +49768,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -47395,7 +49784,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -47477,8 +49866,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -48389,8 +50778,8 @@ CC="$lt_save_CC" ;; *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +$as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -48409,8 +50798,8 @@ echo "$as_me: error: Unsupported tag name: $tagname" >&2;} chmod +x "$ofile" else rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +$as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi @@ -48453,8 +50842,8 @@ if test "${enable_static_binary+set}" = set; then "" | y | ye | yes) AMANDA_STATIC_LDFLAGS=-static if test x"$enable_static" = x"no"; then - { { echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5 -echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;} + { { $as_echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5 +$as_echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;} { (exit 1); exit 1; }; } fi ;; @@ -48471,10 +50860,263 @@ fi # # headers # -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_search_opendir=$ac_res +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_search_opendir=$ac_res +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -48501,20 +51143,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -48606,37 +51249,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -48645,10 +51291,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -48675,20 +51321,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -48696,8 +51343,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -48729,6 +51376,7 @@ fi + for ac_header in arpa/inet.h \ @@ -48739,9 +51387,9 @@ for ac_header in arpa/inet.h \ math.h \ netdb.h \ netinet/in.h \ + regex.h \ stdarg.h \ stdlib.h \ - string.h \ strings.h \ sys/file.h \ sys/ioctl.h \ @@ -48755,23 +51403,25 @@ for ac_header in arpa/inet.h \ sys/types.h \ sys/uio.h \ syslog.h \ + time.h \ unistd.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -48787,32 +51437,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -48826,69 +51477,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -48896,130 +51551,33 @@ fi done -# -# Types -# -{ echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 -echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6; } - if test "${ac_cv_has_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<\_ACEOF +#define HAVE_AMANDA_H 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -# include -# include -int -main () -{ -u_int i = sizeof (struct sockaddr_storage) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_has_sockaddr_storage=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_has_sockaddr_storage=no -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_UTIL_H 1 +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - { echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6; } - if test $ac_cv_has_sockaddr_storage = yes ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_SOCKADDR_STORAGE 1 -_ACEOF - - fi -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef int ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} +#define USE_GETTEXT 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +# +# Types +# # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -49030,11 +51588,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -49047,13 +51604,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -49067,11 +51625,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -49084,20 +51641,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -49111,7 +51669,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -49121,11 +51679,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -49138,13 +51695,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -49158,11 +51716,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -49175,20 +51732,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -49202,7 +51760,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -49222,11 +51780,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -49239,20 +51796,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -49263,11 +51821,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -49280,9 +51840,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -49292,20 +51851,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -49318,43 +51879,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -49363,473 +51929,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -49840,11 +51947,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -49857,13 +51963,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -49877,11 +51984,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -49894,20 +52000,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -49921,7 +52028,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -49931,11 +52038,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -49948,13 +52054,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -49968,11 +52075,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -49985,20 +52091,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -50012,7 +52119,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -50032,11 +52139,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -50049,20 +52155,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -50071,15 +52178,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_sizeof_long_long=$ac_lo;; -'') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +?*) ac_cv_sizeof_long=$ac_lo;; +'') if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else - ac_cv_sizeof_long_long=0 + ac_cv_sizeof_long=0 fi ;; esac else @@ -50090,9 +52199,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -50102,20 +52210,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -50128,71 +52238,272 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_long_long=`cat conftest.val` + ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else - ac_cv_sizeof_long_long=0 + ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -{ echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } -if test "${ac_cv_type_intmax_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if test "${ac_cv_sizeof_long_long+set}" = set; then + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef intmax_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; +test_array [0] = 0 + + ; return 0; -if (sizeof (ac__type_new_)) +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=$ac_mid; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_lo=$ac_mid; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -50203,38 +52514,147 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_intmax_t=yes + ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_intmax_t=no + ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long_long=0 + fi ;; +esac +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (long long))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (long long)))) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (long long)))) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long_long=`cat conftest.val` +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute sizeof (long long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long_long=0 + fi +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of intmax_t" >&5 -echo $ECHO_N "checking size of intmax_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of intmax_t" >&5 +$as_echo_n "checking size of intmax_t... " >&6; } if test "${ac_cv_sizeof_intmax_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -50245,11 +52665,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= 0)]; test_array [0] = 0 ; @@ -50262,13 +52681,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -50282,11 +52702,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -50299,20 +52718,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -50326,7 +52746,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -50336,11 +52756,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) < 0)]; test_array [0] = 0 ; @@ -50353,13 +52772,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -50373,11 +52793,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -50390,20 +52809,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -50417,7 +52837,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -50437,11 +52857,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -50454,20 +52873,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -50478,11 +52898,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_intmax_t=$ac_lo;; '') if test "$ac_cv_type_intmax_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (intmax_t) +$as_echo "$as_me: error: cannot compute sizeof (intmax_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_intmax_t=0 fi ;; @@ -50495,9 +52917,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef intmax_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (intmax_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (intmax_t)); } #include #include int @@ -50507,20 +52928,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (intmax_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (intmax_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (intmax_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -50533,43 +52956,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_intmax_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_intmax_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (intmax_t) +$as_echo "$as_me: error: cannot compute sizeof (intmax_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_intmax_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_intmax_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5 +$as_echo "$ac_cv_sizeof_intmax_t" >&6; } @@ -50578,68 +53006,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } -if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef off_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_off_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -50650,11 +53024,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= 0)]; test_array [0] = 0 ; @@ -50667,13 +53040,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -50687,11 +53061,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -50704,20 +53077,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -50731,7 +53105,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -50741,11 +53115,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) < 0)]; test_array [0] = 0 ; @@ -50758,13 +53131,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -50778,11 +53152,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -50795,20 +53168,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -50822,7 +53196,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -50842,11 +53216,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -50859,20 +53232,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -50883,11 +53257,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_off_t=$ac_lo;; '') if test "$ac_cv_type_off_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t) +$as_echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_off_t=0 fi ;; @@ -50900,9 +53276,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef off_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (off_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (off_t)); } #include #include int @@ -50912,20 +53287,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (off_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (off_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (off_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -50938,43 +53315,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_off_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t) +$as_echo "$as_me: error: cannot compute sizeof (off_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_off_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } @@ -50983,68 +53365,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -51055,11 +53383,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -51072,13 +53399,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51092,11 +53420,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -51109,20 +53436,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -51136,7 +53464,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -51146,11 +53474,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -51163,13 +53490,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51183,11 +53511,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -51200,20 +53527,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -51227,7 +53555,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -51247,11 +53575,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -51264,20 +53591,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -51288,11 +53616,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -51305,9 +53635,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -51317,20 +53646,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -51343,43 +53674,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -51388,68 +53724,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } -if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef ssize_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of ssize_t" >&5 -echo $ECHO_N "checking size of ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of ssize_t" >&5 +$as_echo_n "checking size of ssize_t... " >&6; } if test "${ac_cv_sizeof_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -51460,11 +53742,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= 0)]; test_array [0] = 0 ; @@ -51477,13 +53758,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51497,11 +53779,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -51514,20 +53795,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -51541,7 +53823,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -51551,11 +53833,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) < 0)]; test_array [0] = 0 ; @@ -51568,13 +53849,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51588,11 +53870,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -51605,20 +53886,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -51632,7 +53914,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -51652,11 +53934,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -51669,20 +53950,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -51693,11 +53975,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_ssize_t=$ac_lo;; '') if test "$ac_cv_type_ssize_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (ssize_t) +$as_echo "$as_me: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_ssize_t=0 fi ;; @@ -51710,9 +53994,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef ssize_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (ssize_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (ssize_t)); } #include #include int @@ -51722,20 +54005,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (ssize_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (ssize_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (ssize_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -51748,43 +54033,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_ssize_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_ssize_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (ssize_t) +$as_echo "$as_me: error: cannot compute sizeof (ssize_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_ssize_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_ssize_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5 +$as_echo "$ac_cv_sizeof_ssize_t" >&6; } @@ -51793,68 +54083,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for time_t" >&5 -echo $ECHO_N "checking for time_t... $ECHO_C" >&6; } -if test "${ac_cv_type_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef time_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_time_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_time_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_time_t" >&5 -echo "${ECHO_T}$ac_cv_type_time_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -51865,11 +54101,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= 0)]; test_array [0] = 0 ; @@ -51882,13 +54117,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51902,11 +54138,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -51919,20 +54154,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -51946,7 +54182,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -51956,11 +54192,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) < 0)]; test_array [0] = 0 ; @@ -51973,13 +54208,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -51993,11 +54229,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -52010,20 +54245,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -52037,7 +54273,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -52057,11 +54293,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -52074,20 +54309,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -52098,11 +54334,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_time_t=$ac_lo;; '') if test "$ac_cv_type_time_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (time_t) +$as_echo "$as_me: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_time_t=0 fi ;; @@ -52115,9 +54353,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef time_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (time_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (time_t)); } #include #include int @@ -52127,20 +54364,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (time_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (time_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (time_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -52153,43 +54392,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_time_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (time_t) +$as_echo "$as_me: error: cannot compute sizeof (time_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_time_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } @@ -52198,26 +54442,58 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -52228,30 +54504,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + ac_cv_type_off_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -52261,26 +54546,58 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -52291,30 +54608,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -52324,26 +54650,58 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (size_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -52354,30 +54712,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -52387,10 +54754,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52410,8 +54777,8 @@ fi rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -52425,10 +54792,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52453,20 +54820,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -52474,18 +54842,18 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -52501,7 +54869,7 @@ main () { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -52512,20 +54880,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -52533,8 +54902,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -52545,10 +54914,10 @@ fi ## lifted from config/gnulib/socklen.m4 - { echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 -echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 +$as_echo_n "checking for socklen_t equivalent... " >&6; } if test "${gl_cv_socklen_t_equiv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Systems have either "struct sockaddr *" or # "void *" as the second argument to getpeername @@ -52580,20 +54949,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then gl_cv_socklen_t_equiv="$t" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -52612,8 +54982,8 @@ fi if test "$gl_cv_socklen_t_equiv" = ""; then gl_cv_socklen_t_equiv=socklen_t fi - { echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 -echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6; } + { $as_echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5 +$as_echo "$gl_cv_socklen_t_equiv" >&6; } cat >>confdefs.h <<_ACEOF @@ -52623,18 +54993,22 @@ _ACEOF - { echo "$as_me:$LINENO: checking for sa_family_t" >&5 -echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5 +$as_echo_n "checking for sa_family_t... " >&6; } if test "${ac_cv_type_sa_family_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_sa_family_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef STDC_HEADERS #include #include @@ -52643,14 +55017,56 @@ cat >>conftest.$ac_ext <<_ACEOF -typedef sa_family_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (sa_family_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef STDC_HEADERS +#include +#include +#endif +#include + + + +int +main () +{ +if (sizeof ((sa_family_t))) + return 0; ; return 0; } @@ -52661,30 +55077,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_sa_family_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_sa_family_t=no + ac_cv_type_sa_family_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 -echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6; } -if test $ac_cv_type_sa_family_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 +$as_echo "$ac_cv_type_sa_family_t" >&6; } +if test "x$ac_cv_type_sa_family_t" = x""yes; then : else @@ -52699,18 +55124,22 @@ fi - { echo "$as_me:$LINENO: checking for in_port_t" >&5 -echo $ECHO_N "checking for in_port_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for in_port_t" >&5 +$as_echo_n "checking for in_port_t... " >&6; } if test "${ac_cv_type_in_port_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_in_port_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#ifdef HAVE_SYS_TYPES_H +#include +#endif #ifdef STDC_HEADERS #include #include @@ -52719,14 +55148,56 @@ cat >>conftest.$ac_ext <<_ACEOF -typedef in_port_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (in_port_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef STDC_HEADERS +#include +#include +#endif +#include + + + +int +main () +{ +if (sizeof ((in_port_t))) + return 0; ; return 0; } @@ -52737,30 +55208,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_in_port_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_in_port_t=no + ac_cv_type_in_port_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5 -echo "${ECHO_T}$ac_cv_type_in_port_t" >&6; } -if test $ac_cv_type_in_port_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5 +$as_echo "$ac_cv_type_in_port_t" >&6; } +if test "x$ac_cv_type_in_port_t" = x""yes; then : else @@ -52779,20 +55259,21 @@ fi for ac_header in sys/wait.h wait.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -52808,32 +55289,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -52847,79 +55329,83 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done - { echo "$as_me:$LINENO: checking whether wait uses union wait" >&5 -echo $ECHO_N "checking whether wait uses union wait... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wait uses union wait" >&5 +$as_echo_n "checking whether wait uses union wait... " >&6; } if test "${cf_cv_arg_union_wait+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -52960,20 +55446,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cf_cv_arg_union_wait=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cf_cv_arg_union_wait=no @@ -52981,8 +55468,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5 -echo "${ECHO_T}$cf_cv_arg_union_wait" >&6; } +{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5 +$as_echo "$cf_cv_arg_union_wait" >&6; } if test $cf_cv_arg_union_wait = yes; then cat >>confdefs.h <<\_ACEOF @@ -52997,20 +55484,21 @@ _ACEOF for ac_header in sys/wait.h wait.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -53026,32 +55514,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -53065,79 +55554,83 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done - { echo "$as_me:$LINENO: checking whether wait uses int" >&5 -echo $ECHO_N "checking whether wait uses int... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wait uses int" >&5 +$as_echo_n "checking whether wait uses int... " >&6; } if test "${cf_cv_arg_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -53178,20 +55671,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cf_cv_arg_int=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cf_cv_arg_int=no @@ -53199,8 +55693,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5 -echo "${ECHO_T}$cf_cv_arg_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5 +$as_echo "$cf_cv_arg_int" >&6; } if test $cf_cv_arg_int = yes; then cat >>confdefs.h <<\_ACEOF @@ -53215,10 +55709,10 @@ fi # # cur_colr is on some HP's -{ echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5 -echo $ECHO_N "checking for main in -lcur_colr... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5 +$as_echo_n "checking for main in -lcur_colr... " >&6; } if test "${ac_cv_lib_cur_colr_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcur_colr $LIBS" @@ -53244,33 +55738,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cur_colr_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cur_colr_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5 -echo "${ECHO_T}$ac_cv_lib_cur_colr_main" >&6; } -if test $ac_cv_lib_cur_colr_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5 +$as_echo "$ac_cv_lib_cur_colr_main" >&6; } +if test "x$ac_cv_lib_cur_colr_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCUR_COLR 1 _ACEOF @@ -53280,10 +55778,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for main in -lintl" >&5 -echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lintl" >&5 +$as_echo_n "checking for main in -lintl... " >&6; } if test "${ac_cv_lib_intl_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -53309,33 +55807,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_main" >&6; } -if test $ac_cv_lib_intl_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5 +$as_echo "$ac_cv_lib_intl_main" >&6; } +if test "x$ac_cv_lib_intl_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF @@ -53349,10 +55851,10 @@ fi case "$target" in *sgi-irix*) -{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5 -echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5 +$as_echo_n "checking for main in -lsocket... " >&6; } if test "${ac_cv_lib_socket_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" @@ -53378,33 +55880,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } -if test $ac_cv_lib_socket_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 +$as_echo "$ac_cv_lib_socket_main" >&6; } +if test "x$ac_cv_lib_socket_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -53416,10 +55922,10 @@ fi ;; *) -{ echo "$as_me:$LINENO: checking for main in -lresolv" >&5 -echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lresolv" >&5 +$as_echo_n "checking for main in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -53445,33 +55951,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6; } -if test $ac_cv_lib_resolv_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5 +$as_echo "$ac_cv_lib_resolv_main" >&6; } +if test "x$ac_cv_lib_resolv_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -53481,10 +55991,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for main in -lnsl" >&5 -echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lnsl" >&5 +$as_echo_n "checking for main in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -53510,33 +56020,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6; } -if test $ac_cv_lib_nsl_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5 +$as_echo "$ac_cv_lib_nsl_main" >&6; } +if test "x$ac_cv_lib_nsl_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF @@ -53546,10 +56060,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for main in -lsocket" >&5 -echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5 +$as_echo_n "checking for main in -lsocket... " >&6; } if test "${ac_cv_lib_socket_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" @@ -53575,33 +56089,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_main" >&6; } -if test $ac_cv_lib_socket_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5 +$as_echo "$ac_cv_lib_socket_main" >&6; } +if test "x$ac_cv_lib_socket_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -53611,10 +56129,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for main in -lsun" >&5 -echo $ECHO_N "checking for main in -lsun... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for main in -lsun" >&5 +$as_echo_n "checking for main in -lsun... " >&6; } if test "${ac_cv_lib_sun_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsun $LIBS" @@ -53640,33 +56158,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_sun_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sun_main=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5 -echo "${ECHO_T}$ac_cv_lib_sun_main" >&6; } -if test $ac_cv_lib_sun_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5 +$as_echo "$ac_cv_lib_sun_main" >&6; } +if test "x$ac_cv_lib_sun_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSUN 1 _ACEOF @@ -53683,10 +56205,10 @@ fi # system-specific search paths. # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -53702,7 +56224,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -53714,11 +56236,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -53760,6 +56282,9 @@ fi gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; + gio*) + pkg_config_args="$pkg_config_args $module-2.0" + ;; esac done @@ -53769,10 +56294,10 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -53787,7 +56312,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -53799,11 +56324,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -53812,10 +56337,10 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -53830,7 +56355,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -53842,11 +56367,11 @@ esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -53854,12 +56379,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -53870,15 +56391,15 @@ fi fi if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.16 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + _pkg_min_version=0.7 + { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } PKG_CONFIG="" fi @@ -53892,8 +56413,8 @@ fi fi min_glib_version=2.2.0 - { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 -echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs @@ -54016,29 +56537,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_glib=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -54048,12 +56572,12 @@ fi fi fi if test "x$no_glib" = x ; then - { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 -echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } + { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } : else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" @@ -54090,18 +56614,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" @@ -54112,13 +56639,14 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" @@ -54131,8 +56659,8 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ GOBJECT_QUERY="" GLIB_MKENUMS="" - { { echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5 -echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&2;} + { { $as_echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5 +$as_echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&2;} { (exit 1); exit 1; }; } fi @@ -54143,9 +56671,8 @@ echo "$as_me: error: glib not found or too old; See http://wiki.zmanda.com/index rm -f conf.glibtest - CFLAGS="$CFLAGS $GLIB_CFLAGS" - - CPPFLAGS="$CPPFLAGS $GLIB_CPPFLAGS" + # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain. + CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" @@ -54157,8 +56684,8 @@ if test "${with_readline+set}" = set; then withval=$with_readline; case "$withval" in y | ye | yes | n | no) : ;; - *) { { echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5 -echo "$as_me: error: *** --with-readline does not take a value" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5 +$as_echo "$as_me: error: *** --with-readline does not take a value" >&2;} { (exit 1); exit 1; }; } esac want_readline="$withval" @@ -54174,10 +56701,10 @@ fi if test x"$want_readline" != x"no"; then # we need a tgetent() somewhere.. proceed="false" - { echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 -echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } if test "${ac_cv_lib_termcap_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltermcap $LIBS" @@ -54209,43 +56736,47 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_termcap_tgetent=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_termcap_tgetent=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6; } -if test $ac_cv_lib_termcap_tgetent = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = x""yes; then READLINE_LIBS="-ltermcap" proceed="true" else - { echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 -echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 +$as_echo_n "checking for tgetent in -lcurses... " >&6; } if test "${ac_cv_lib_curses_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" @@ -54277,43 +56808,47 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_curses_tgetent=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_tgetent=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6; } -if test $ac_cv_lib_curses_tgetent = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 +$as_echo "$ac_cv_lib_curses_tgetent" >&6; } +if test "x$ac_cv_lib_curses_tgetent" = x""yes; then READLINE_LIBS="-lcurses" proceed="true" else - { echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 -echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 +$as_echo_n "checking for tgetent in -lncurses... " >&6; } if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" @@ -54345,33 +56880,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ncurses_tgetent=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_tgetent=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6; } -if test $ac_cv_lib_ncurses_tgetent = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 +$as_echo "$ac_cv_lib_ncurses_tgetent" >&6; } +if test "x$ac_cv_lib_ncurses_tgetent" = x""yes; then READLINE_LIBS="-lncurses" proceed="true" @@ -54393,20 +56932,21 @@ fi for ac_header in history.h readline.h readline/history.h readline/readline.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -54422,32 +56962,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -54461,69 +57002,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF # found at least one of the headers, so we can proceed. @@ -54537,10 +57082,10 @@ done if $proceed; then proceed="false" - { echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 -echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 +$as_echo_n "checking for readline in -lreadline... " >&6; } if test "${ac_cv_lib_readline_readline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -54572,33 +57117,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6; } -if test $ac_cv_lib_readline_readline = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 +$as_echo "$ac_cv_lib_readline_readline" >&6; } +if test "x$ac_cv_lib_readline_readline" = x""yes; then READLINE_LIBS="-lreadline $READLINE_LIBS" proceed="true" @@ -54617,8 +57166,8 @@ _ACEOF else # no readline. if the user *really* wanted it, bail out. if test x"$want_readline" = x"yes"; then - { { echo "$as_me:$LINENO: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&5 -echo "$as_me: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&2;} + { { $as_echo "$as_me:$LINENO: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&5 +$as_echo "$as_me: error: *** No readline implementation found. Try using --with-libraries and --with-includes" >&2;} { (exit 1); exit 1; }; } fi READLINE_LIBS="" @@ -54627,10 +57176,10 @@ echo "$as_me: error: *** No readline implementation found. Try using --with-lib -{ echo "$as_me:$LINENO: checking for modf in -lm" >&5 -echo $ECHO_N "checking for modf in -lm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for modf in -lm" >&5 +$as_echo_n "checking for modf in -lm... " >&6; } if test "${ac_cv_lib_m_modf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" @@ -54662,33 +57211,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_m_modf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_modf=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5 -echo "${ECHO_T}$ac_cv_lib_m_modf" >&6; } -if test $ac_cv_lib_m_modf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5 +$as_echo "$ac_cv_lib_m_modf" >&6; } +if test "x$ac_cv_lib_m_modf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -54699,17 +57252,17 @@ fi if test "${ac_cv_header_execinfo_h+set}" = set; then - { echo "$as_me:$LINENO: checking for execinfo.h" >&5 -echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5 +$as_echo_n "checking for execinfo.h... " >&6; } if test "${ac_cv_header_execinfo_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5 -echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5 +$as_echo "$ac_cv_header_execinfo_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking execinfo.h usability" >&5 -echo $ECHO_N "checking execinfo.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking execinfo.h usability" >&5 +$as_echo_n "checking execinfo.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -54725,32 +57278,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking execinfo.h presence" >&5 -echo $ECHO_N "checking execinfo.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking execinfo.h presence" >&5 +$as_echo_n "checking execinfo.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -54764,71 +57318,72 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: execinfo.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: execinfo.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: execinfo.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: execinfo.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for execinfo.h" >&5 -echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5 +$as_echo_n "checking for execinfo.h... " >&6; } if test "${ac_cv_header_execinfo_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_execinfo_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5 -echo "${ECHO_T}$ac_cv_header_execinfo_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5 +$as_echo "$ac_cv_header_execinfo_h" >&6; } fi -if test $ac_cv_header_execinfo_h = yes; then +if test "x$ac_cv_header_execinfo_h" = x""yes; then - { echo "$as_me:$LINENO: checking for backtrace_symbols_fd" >&5 -echo $ECHO_N "checking for backtrace_symbols_fd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for backtrace_symbols_fd" >&5 +$as_echo_n "checking for backtrace_symbols_fd... " >&6; } if test "${ac_cv_func_backtrace_symbols_fd+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54881,32 +57436,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_backtrace_symbols_fd=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_backtrace_symbols_fd=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_backtrace_symbols_fd" >&5 -echo "${ECHO_T}$ac_cv_func_backtrace_symbols_fd" >&6; } -if test $ac_cv_func_backtrace_symbols_fd = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_backtrace_symbols_fd" >&5 +$as_echo "$ac_cv_func_backtrace_symbols_fd" >&6; } +if test "x$ac_cv_func_backtrace_symbols_fd" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -54936,11 +57495,11 @@ ice_have_accept=no for ac_func in accept do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -54993,45 +57552,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_accept=yes fi done if test "${ice_have_accept}" = yes; then -{ echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for accept declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for accept declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_accept_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_accept_decl=no @@ -55080,8 +57646,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5 -echo "${ECHO_T}$ice_cv_have_accept_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5 +$as_echo "$ice_cv_have_accept_decl" >&6; } if test "$ice_cv_have_accept_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -55093,10 +57659,10 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55120,31 +57686,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_working_alloca_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -55153,10 +57723,10 @@ _ACEOF fi -{ echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55200,31 +57770,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_alloca_works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -55245,10 +57819,10 @@ cat >>confdefs.h <<\_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if test "${ac_cv_os_cray+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55272,15 +57846,15 @@ fi rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55333,33 +57907,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -55371,10 +57952,10 @@ fi done fi -{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 @@ -55412,36 +57993,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -55453,11 +58037,11 @@ fi for ac_func in atexit do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55510,35 +58094,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -55549,11 +58140,11 @@ ice_have_atof=no for ac_func in atof do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55606,45 +58197,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_atof=yes fi done if test "${ice_have_atof}" = yes; then -{ echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atof declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5 +$as_echo_n "checking for atof declaration in stdlib.h... " >&6; } if test "${ice_cv_have_atof_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_atof_decl=no @@ -55693,8 +58291,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atof_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5 +$as_echo "$ice_cv_have_atof_decl" >&6; } if test "$ice_cv_have_atof_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -55709,11 +58307,11 @@ ice_have_atol=no for ac_func in atol do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55766,45 +58364,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_atol=yes fi done if test "${ice_have_atol}" = yes; then -{ echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atol declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5 +$as_echo_n "checking for atol declaration in stdlib.h... " >&6; } if test "${ice_cv_have_atol_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_atol_decl=no @@ -55853,8 +58458,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atol_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5 +$as_echo "$ice_cv_have_atol_decl" >&6; } if test "$ice_cv_have_atol_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -55869,11 +58474,11 @@ ice_have_atoll=no for ac_func in atoll do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -55926,45 +58531,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_atoll=yes fi done if test "${ice_have_atoll}" = yes; then -{ echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5 -echo $ECHO_N "checking for atoll declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5 +$as_echo_n "checking for atoll declaration in stdlib.h... " >&6; } if test "${ice_cv_have_atoll_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_atoll_decl=no @@ -56013,8 +58625,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5 -echo "${ECHO_T}$ice_cv_have_atoll_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5 +$as_echo "$ice_cv_have_atoll_decl" >&6; } if test "$ice_cv_have_atoll_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56029,11 +58641,11 @@ ice_have_strtol=no for ac_func in strtol do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56086,45 +58698,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strtol=yes fi done if test "${ice_have_strtol}" = yes; then -{ echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5 -echo $ECHO_N "checking for strtol declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5 +$as_echo_n "checking for strtol declaration in stdlib.h... " >&6; } if test "${ice_cv_have_strtol_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strtol_decl=no @@ -56173,8 +58792,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strtol_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5 +$as_echo "$ice_cv_have_strtol_decl" >&6; } if test "$ice_cv_have_strtol_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56189,11 +58808,11 @@ ice_have_strtoll=no for ac_func in strtoll do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56246,45 +58865,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strtoll=yes fi done if test "${ice_have_strtoll}" = yes; then -{ echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5 -echo $ECHO_N "checking for strtoll declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5 +$as_echo_n "checking for strtoll declaration in stdlib.h... " >&6; } if test "${ice_cv_have_strtoll_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strtoll_decl=no @@ -56333,8 +58959,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strtoll_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5 +$as_echo "$ice_cv_have_strtoll_decl" >&6; } if test "$ice_cv_have_strtoll_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56347,11 +58973,11 @@ fi for ac_func in basename do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56404,35 +59030,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -56443,11 +59076,11 @@ ice_have_bind=no for ac_func in bind do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56500,45 +59133,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_bind=yes fi done if test "${ice_have_bind}" = yes; then -{ echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for bind declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_bind_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_bind_decl=no @@ -56587,8 +59227,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bind_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5 +$as_echo "$ice_cv_have_bind_decl" >&6; } if test "$ice_cv_have_bind_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56603,11 +59243,11 @@ ice_have_bcopy=no for ac_func in bcopy do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56660,45 +59300,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_bcopy=yes fi done if test "${ice_have_bcopy}" = yes; then -{ echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5 -echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5 +$as_echo_n "checking for bcopy declaration in string.h strings.h stdlib.h... " >&6; } if test "${ice_cv_have_bcopy_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_bcopy_decl=no @@ -56747,8 +59394,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5 +$as_echo "$ice_cv_have_bcopy_decl" >&6; } if test "$ice_cv_have_bcopy_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56763,11 +59410,11 @@ ice_have_bzero=no for ac_func in bzero do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -56820,45 +59467,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_bzero=yes fi done if test "${ice_have_bzero}" = yes; then -{ echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5 -echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5 +$as_echo_n "checking for bzero declaration in string.h strings.h stdlib.h... " >&6; } if test "${ice_cv_have_bzero_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_bzero_decl=no @@ -56907,8 +59561,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5 -echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5 +$as_echo "$ice_cv_have_bzero_decl" >&6; } if test "$ice_cv_have_bzero_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -56918,10 +59572,10 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +$as_echo_n "checking whether closedir returns void... " >&6; } if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_closedir_void=yes @@ -56952,36 +59606,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_closedir_void=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_closedir_void=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +$as_echo "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then cat >>confdefs.h <<\_ACEOF @@ -56995,11 +59652,11 @@ ice_have_closelog=no for ac_func in closelog do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57052,45 +59709,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_closelog=yes fi done if test "${ice_have_closelog}" = yes; then -{ echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5 -echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5 +$as_echo_n "checking for closelog declaration in syslog.h... " >&6; } if test "${ice_cv_have_closelog_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_closelog_decl=no @@ -57139,8 +59803,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5 +$as_echo "$ice_cv_have_closelog_decl" >&6; } if test "$ice_cv_have_closelog_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57155,11 +59819,11 @@ ice_have_connect=no for ac_func in connect do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57212,45 +59876,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_connect=yes fi done if test "${ice_have_connect}" = yes; then -{ echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for connect declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_connect_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_connect_decl=no @@ -57299,8 +59970,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5 -echo "${ECHO_T}$ice_cv_have_connect_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5 +$as_echo "$ice_cv_have_connect_decl" >&6; } if test "$ice_cv_have_connect_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57315,11 +59986,11 @@ ice_have_fclose=no for ac_func in fclose do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57372,45 +60043,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fclose=yes fi done if test "${ice_have_fclose}" = yes; then -{ echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5 -echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5 +$as_echo_n "checking for fclose declaration in stdio.h... " >&6; } if test "${ice_cv_have_fclose_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fclose_decl=no @@ -57459,8 +60137,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5 +$as_echo "$ice_cv_have_fclose_decl" >&6; } if test "$ice_cv_have_fclose_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57475,11 +60153,11 @@ ice_have_fflush=no for ac_func in fflush do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57532,45 +60210,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fflush=yes fi done if test "${ice_have_fflush}" = yes; then -{ echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5 -echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5 +$as_echo_n "checking for fflush declaration in stdio.h... " >&6; } if test "${ice_cv_have_fflush_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fflush_decl=no @@ -57619,8 +60304,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5 +$as_echo "$ice_cv_have_fflush_decl" >&6; } if test "$ice_cv_have_fflush_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57635,11 +60320,11 @@ ice_have_fprintf=no for ac_func in fprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57692,45 +60377,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fprintf=yes fi done if test "${ice_have_fprintf}" = yes; then -{ echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5 +$as_echo_n "checking for fprintf declaration in stdio.h... " >&6; } if test "${ice_cv_have_fprintf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fprintf_decl=no @@ -57779,8 +60471,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5 +$as_echo "$ice_cv_have_fprintf_decl" >&6; } if test "$ice_cv_have_fprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57795,11 +60487,11 @@ ice_have_fputc=no for ac_func in fputc do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -57852,45 +60544,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fputc=yes fi done if test "${ice_have_fputc}" = yes; then -{ echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5 -echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5 +$as_echo_n "checking for fputc declaration in stdio.h... " >&6; } if test "${ice_cv_have_fputc_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fputc_decl=no @@ -57939,8 +60638,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5 +$as_echo "$ice_cv_have_fputc_decl" >&6; } if test "$ice_cv_have_fputc_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -57955,11 +60654,11 @@ ice_have_fputs=no for ac_func in fputs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58012,45 +60711,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fputs=yes fi done if test "${ice_have_fputs}" = yes; then -{ echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5 -echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5 +$as_echo_n "checking for fputs declaration in stdio.h... " >&6; } if test "${ice_cv_have_fputs_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fputs_decl=no @@ -58099,8 +60805,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5 +$as_echo "$ice_cv_have_fputs_decl" >&6; } if test "$ice_cv_have_fputs_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -58115,11 +60821,11 @@ ice_have_fread=no for ac_func in fread do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58172,45 +60878,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fread=yes fi done if test "${ice_have_fread}" = yes; then -{ echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5 +$as_echo_n "checking for fread declaration in stdio.h stdlib.h... " >&6; } if test "${ice_cv_have_fread_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fread_decl=no @@ -58259,8 +60972,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fread_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5 +$as_echo "$ice_cv_have_fread_decl" >&6; } if test "$ice_cv_have_fread_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -58275,11 +60988,11 @@ ice_have_fseek=no for ac_func in fseek do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58332,45 +61045,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fseek=yes fi done if test "${ice_have_fseek}" = yes; then -{ echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5 -echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5 +$as_echo_n "checking for fseek declaration in stdio.h... " >&6; } if test "${ice_cv_have_fseek_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fseek_decl=no @@ -58419,8 +61139,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5 +$as_echo "$ice_cv_have_fseek_decl" >&6; } if test "$ice_cv_have_fseek_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -58435,11 +61155,11 @@ ice_have_fwrite=no for ac_func in fwrite do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58492,45 +61212,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_fwrite=yes fi done if test "${ice_have_fwrite}" = yes; then -{ echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5 +$as_echo_n "checking for fwrite declaration in stdio.h stdlib.h... " >&6; } if test "${ice_cv_have_fwrite_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_fwrite_decl=no @@ -58579,8 +61306,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5 -echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5 +$as_echo "$ice_cv_have_fwrite_decl" >&6; } if test "$ice_cv_have_fwrite_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -58593,11 +61320,11 @@ fi for ac_func in getgrgid_r do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58650,35 +61377,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -58687,11 +61421,11 @@ done for ac_func in getpwuid_r do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58744,35 +61478,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -58783,11 +61524,11 @@ ice_have_gethostname=no for ac_func in gethostname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -58840,45 +61581,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_gethostname=yes fi done if test "${ice_have_gethostname}" = yes; then -{ echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5 -echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5 +$as_echo_n "checking for gethostname declaration in unistd.h... " >&6; } if test "${ice_cv_have_gethostname_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_gethostname_decl=no @@ -58927,8 +61675,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5 -echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5 +$as_echo "$ice_cv_have_gethostname_decl" >&6; } if test "$ice_cv_have_gethostname_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -58943,11 +61691,11 @@ ice_have_getopt=no for ac_func in getopt do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59000,45 +61748,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_getopt=yes fi done if test "${ice_have_getopt}" = yes; then -{ echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5 +$as_echo_n "checking for getopt declaration in stdlib.h unistd.h libc.h... " >&6; } if test "${ice_cv_have_getopt_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_getopt_decl=no @@ -59087,8 +61842,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5 +$as_echo "$ice_cv_have_getopt_decl" >&6; } if test "$ice_cv_have_getopt_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -59103,11 +61858,11 @@ ice_have_getpeername=no for ac_func in getpeername do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59160,45 +61915,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_getpeername=yes fi done if test "${ice_have_getpeername}" = yes; then -{ echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for getpeername declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_getpeername_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_getpeername_decl=no @@ -59247,8 +62009,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5 +$as_echo "$ice_cv_have_getpeername_decl" >&6; } if test "$ice_cv_have_getpeername_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -59258,10 +62020,10 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: checking for getpgrp" >&5 -echo $ECHO_N "checking for getpgrp... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpgrp" >&5 +$as_echo_n "checking for getpgrp... " >&6; } if test "${ac_cv_func_getpgrp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59314,36 +62076,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_getpgrp=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getpgrp=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5 -echo "${ECHO_T}$ac_cv_func_getpgrp" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5 +$as_echo "$ac_cv_func_getpgrp" >&6; } -{ echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 -echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 +$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; } if test "${ac_cv_func_getpgrp_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Use it with a single arg. cat >conftest.$ac_ext <<_ACEOF @@ -59367,20 +62133,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_func_getpgrp_void=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getpgrp_void=yes @@ -59389,8 +62156,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 -echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 +$as_echo "$ac_cv_func_getpgrp_void" >&6; } if test $ac_cv_func_getpgrp_void = yes; then cat >>confdefs.h <<\_ACEOF @@ -59404,11 +62171,11 @@ ice_have_getsockname=no for ac_func in getsockname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59461,45 +62228,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_getsockname=yes fi done if test "${ice_have_getsockname}" = yes; then -{ echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for getsockname declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_getsockname_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_getsockname_decl=no @@ -59548,8 +62322,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5 +$as_echo "$ice_cv_have_getsockname_decl" >&6; } if test "$ice_cv_have_getsockname_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -59564,11 +62338,11 @@ ice_have_getsockopt=no for ac_func in getsockopt do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59621,45 +62395,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_getsockopt=yes fi done if test "${ice_have_getsockopt}" = yes; then -{ echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for getsockopt declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_getsockopt_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_getsockopt_decl=no @@ -59708,8 +62489,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5 +$as_echo "$ice_cv_have_getsockopt_decl" >&6; } if test "$ice_cv_have_getsockopt_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -59724,11 +62505,11 @@ ice_have_initgroups=no for ac_func in initgroups do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59781,45 +62562,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_initgroups=yes fi done if test "${ice_have_initgroups}" = yes; then -{ echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5 +$as_echo_n "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... " >&6; } if test "${ice_cv_have_initgroups_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_initgroups_decl=no @@ -59868,8 +62656,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5 -echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5 +$as_echo "$ice_cv_have_initgroups_decl" >&6; } if test "$ice_cv_have_initgroups_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -59884,11 +62672,11 @@ ice_have_ioctl=no for ac_func in ioctl do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -59941,45 +62729,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_ioctl=yes fi done if test "${ice_have_ioctl}" = yes; then -{ echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5 +$as_echo_n "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... " >&6; } if test "${ice_cv_have_ioctl_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_ioctl_decl=no @@ -60028,8 +62823,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5 +$as_echo "$ice_cv_have_ioctl_decl" >&6; } if test "$ice_cv_have_ioctl_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60044,11 +62839,11 @@ ice_have_isnormal=no for ac_func in isnormal do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60101,45 +62896,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_isnormal=yes fi done if test "${ice_have_isnormal}" = yes; then -{ echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5 -echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5 +$as_echo_n "checking for isnormal declaration in math.h... " >&6; } if test "${ice_cv_have_isnormal_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_isnormal_decl=no @@ -60188,8 +62990,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5 -echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5 +$as_echo "$ice_cv_have_isnormal_decl" >&6; } if test "$ice_cv_have_isnormal_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60204,11 +63006,11 @@ ice_have_listen=no for ac_func in listen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60261,45 +63063,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_listen=yes fi done if test "${ice_have_listen}" = yes; then -{ echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for listen declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_listen_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_listen_decl=no @@ -60348,8 +63157,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5 -echo "${ECHO_T}$ice_cv_have_listen_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5 +$as_echo "$ice_cv_have_listen_decl" >&6; } if test "$ice_cv_have_listen_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60364,11 +63173,11 @@ ice_have_lstat=no for ac_func in lstat do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60421,45 +63230,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_lstat=yes fi done if test "${ice_have_lstat}" = yes; then -{ echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5 -echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5 +$as_echo_n "checking for lstat declaration in sys/types.h sys/stat.h... " >&6; } if test "${ice_cv_have_lstat_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_lstat_decl=no @@ -60508,8 +63324,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5 -echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5 +$as_echo "$ice_cv_have_lstat_decl" >&6; } if test "$ice_cv_have_lstat_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60524,11 +63340,11 @@ ice_have_malloc=no for ac_func in malloc do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60581,45 +63397,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_malloc=yes fi done if test "${ice_have_malloc}" = yes; then -{ echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5 -echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5 +$as_echo_n "checking for malloc declaration in stdlib.h... " >&6; } if test "${ice_cv_have_malloc_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_malloc_decl=no @@ -60668,8 +63491,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5 +$as_echo "$ice_cv_have_malloc_decl" >&6; } if test "$ice_cv_have_malloc_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60684,11 +63507,11 @@ ice_have_memmove=no for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60741,45 +63564,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_memmove=yes fi done if test "${ice_have_memmove}" = yes; then -{ echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5 +$as_echo_n "checking for memmove declaration in string.h strings.h... " >&6; } if test "${ice_cv_have_memmove_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_memmove_decl=no @@ -60828,8 +63658,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5 -echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5 +$as_echo "$ice_cv_have_memmove_decl" >&6; } if test "$ice_cv_have_memmove_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -60844,11 +63674,11 @@ ice_have_memset=no for ac_func in memset do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -60901,45 +63731,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_memset=yes fi done if test "${ice_have_memset}" = yes; then -{ echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5 +$as_echo_n "checking for memset declaration in string.h strings.h... " >&6; } if test "${ice_cv_have_memset_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_memset_decl=no @@ -60988,8 +63825,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5 -echo "${ECHO_T}$ice_cv_have_memset_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5 +$as_echo "$ice_cv_have_memset_decl" >&6; } if test "$ice_cv_have_memset_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61004,11 +63841,11 @@ ice_have_mkstemp=no for ac_func in mkstemp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61061,45 +63898,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_mkstemp=yes fi done if test "${ice_have_mkstemp}" = yes; then -{ echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5 -echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5 +$as_echo_n "checking for mkstemp declaration in stdlib.h... " >&6; } if test "${ice_cv_have_mkstemp_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_mkstemp_decl=no @@ -61148,8 +63992,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5 +$as_echo "$ice_cv_have_mkstemp_decl" >&6; } if test "$ice_cv_have_mkstemp_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61164,11 +64008,11 @@ ice_have_mktemp=no for ac_func in mktemp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61221,45 +64065,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_mktemp=yes fi done if test "${ice_have_mktemp}" = yes; then -{ echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5 -echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5 +$as_echo_n "checking for mktemp declaration in stdlib.h... " >&6; } if test "${ice_cv_have_mktemp_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_mktemp_decl=no @@ -61308,8 +64159,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5 +$as_echo "$ice_cv_have_mktemp_decl" >&6; } if test "$ice_cv_have_mktemp_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61324,11 +64175,11 @@ ice_have_mktime=no for ac_func in mktime do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61381,45 +64232,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_mktime=yes fi done if test "${ice_have_mktime}" = yes; then -{ echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5 +$as_echo_n "checking for mktime declaration in time.h sys/time.h... " >&6; } if test "${ice_cv_have_mktime_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_mktime_decl=no @@ -61468,8 +64326,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5 -echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5 +$as_echo "$ice_cv_have_mktime_decl" >&6; } if test "$ice_cv_have_mktime_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61482,11 +64340,11 @@ fi for ac_func in on_exit do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61539,35 +64397,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -61578,11 +64443,11 @@ ice_have_openlog=no for ac_func in openlog do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61635,45 +64500,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_openlog=yes fi done if test "${ice_have_openlog}" = yes; then -{ echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5 -echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5 +$as_echo_n "checking for openlog declaration in syslog.h... " >&6; } if test "${ice_cv_have_openlog_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_openlog_decl=no @@ -61722,8 +64594,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5 +$as_echo "$ice_cv_have_openlog_decl" >&6; } if test "$ice_cv_have_openlog_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61738,11 +64610,11 @@ ice_have_pclose=no for ac_func in pclose do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61795,45 +64667,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_pclose=yes fi done if test "${ice_have_pclose}" = yes; then -{ echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5 -echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5 +$as_echo_n "checking for pclose declaration in stdio.h... " >&6; } if test "${ice_cv_have_pclose_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_pclose_decl=no @@ -61882,8 +64761,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5 -echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5 +$as_echo "$ice_cv_have_pclose_decl" >&6; } if test "$ice_cv_have_pclose_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -61898,11 +64777,11 @@ ice_have_perror=no for ac_func in perror do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -61955,45 +64834,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_perror=yes fi done if test "${ice_have_perror}" = yes; then -{ echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5 -echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5 +$as_echo_n "checking for perror declaration in stdio.h... " >&6; } if test "${ice_cv_have_perror_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_perror_decl=no @@ -62042,8 +64928,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5 -echo "${ECHO_T}$ice_cv_have_perror_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5 +$as_echo "$ice_cv_have_perror_decl" >&6; } if test "$ice_cv_have_perror_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62058,11 +64944,11 @@ ice_have_printf=no for ac_func in printf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62115,45 +65001,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_printf=yes fi done if test "${ice_have_printf}" = yes; then -{ echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5 -echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5 +$as_echo_n "checking for printf declaration in stdio.h... " >&6; } if test "${ice_cv_have_printf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_printf_decl=no @@ -62202,8 +65095,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_printf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5 +$as_echo "$ice_cv_have_printf_decl" >&6; } if test "$ice_cv_have_printf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62216,11 +65109,11 @@ fi for ac_func in putenv do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62273,35 +65166,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -62312,11 +65212,11 @@ ice_have_puts=no for ac_func in puts do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62369,45 +65269,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_puts=yes fi done if test "${ice_have_puts}" = yes; then -{ echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5 -echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5 +$as_echo_n "checking for puts declaration in stdio.h... " >&6; } if test "${ice_cv_have_puts_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_puts_decl=no @@ -62456,8 +65363,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5 -echo "${ECHO_T}$ice_cv_have_puts_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5 +$as_echo "$ice_cv_have_puts_decl" >&6; } if test "$ice_cv_have_puts_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62472,11 +65379,11 @@ ice_have_realloc=no for ac_func in realloc do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62529,45 +65436,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_realloc=yes fi done if test "${ice_have_realloc}" = yes; then -{ echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5 -echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5 +$as_echo_n "checking for realloc declaration in stdlib.h... " >&6; } if test "${ice_cv_have_realloc_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_realloc_decl=no @@ -62616,8 +65530,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5 +$as_echo "$ice_cv_have_realloc_decl" >&6; } if test "$ice_cv_have_realloc_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62632,11 +65546,11 @@ ice_have_recvfrom=no for ac_func in recvfrom do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62689,45 +65603,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_recvfrom=yes fi done if test "${ice_have_recvfrom}" = yes; then -{ echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for recvfrom declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_recvfrom_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_recvfrom_decl=no @@ -62776,8 +65697,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5 -echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5 +$as_echo "$ice_cv_have_recvfrom_decl" >&6; } if test "$ice_cv_have_recvfrom_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62792,11 +65713,11 @@ ice_have_remove=no for ac_func in remove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -62849,45 +65770,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_remove=yes fi done if test "${ice_have_remove}" = yes; then -{ echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5 -echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5 +$as_echo_n "checking for remove declaration in stdio.h... " >&6; } if test "${ice_cv_have_remove_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_remove_decl=no @@ -62936,8 +65864,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5 -echo "${ECHO_T}$ice_cv_have_remove_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5 +$as_echo "$ice_cv_have_remove_decl" >&6; } if test "$ice_cv_have_remove_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -62952,11 +65880,11 @@ ice_have_rename=no for ac_func in rename do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -63009,45 +65937,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_rename=yes fi done if test "${ice_have_rename}" = yes; then -{ echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5 -echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5 +$as_echo_n "checking for rename declaration in stdio.h... " >&6; } if test "${ice_cv_have_rename_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_rename_decl=no @@ -63096,8 +66031,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5 -echo "${ECHO_T}$ice_cv_have_rename_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5 +$as_echo "$ice_cv_have_rename_decl" >&6; } if test "$ice_cv_have_rename_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -63112,11 +66047,11 @@ ice_have_rewind=no for ac_func in rewind do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -63169,45 +66104,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_rewind=yes fi done if test "${ice_have_rewind}" = yes; then -{ echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5 -echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5 +$as_echo_n "checking for rewind declaration in stdio.h... " >&6; } if test "${ice_cv_have_rewind_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_rewind_decl=no @@ -63256,8 +66198,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5 -echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5 +$as_echo "$ice_cv_have_rewind_decl" >&6; } if test "$ice_cv_have_rewind_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -63272,11 +66214,11 @@ ice_have_ruserok=no for ac_func in ruserok do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -63329,45 +66271,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_ruserok=yes fi done if test "${ice_have_ruserok}" = yes; then -{ echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5 -echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5 +$as_echo_n "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... " >&6; } if test "${ice_cv_have_ruserok_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_ruserok_decl=no @@ -63416,8 +66365,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5 +$as_echo "$ice_cv_have_ruserok_decl" >&6; } if test "$ice_cv_have_ruserok_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -63432,11 +66381,11 @@ ice_have_select=no for ac_func in select do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -63489,45 +66438,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_select=yes fi done if test "${ice_have_select}" = yes; then -{ echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5 -echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5 +$as_echo_n "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... " >&6; } if test "${ice_cv_have_select_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_select_decl=no @@ -63576,8 +66532,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5 -echo "${ECHO_T}$ice_cv_have_select_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5 +$as_echo "$ice_cv_have_select_decl" >&6; } if test "$ice_cv_have_select_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -63601,20 +66557,21 @@ for ac_header in sys/time.h \ unistd.h \ do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -63630,32 +66587,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -63669,69 +66627,73 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -63739,10 +66701,10 @@ fi done - { echo "$as_me:$LINENO: checking for select() argument type" >&5 -echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for select() argument type" >&5 +$as_echo_n "checking for select() argument type... " >&6; } if test "${amanda_cv_select_arg_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else rm -f conftest.c @@ -63814,8 +66776,8 @@ EOF fi -{ echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5 -echo "${ECHO_T}$amanda_cv_select_arg_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5 +$as_echo "$amanda_cv_select_arg_type" >&6; } cat >>confdefs.h <<_ACEOF #define SELECT_ARG_TYPE $amanda_cv_select_arg_type @@ -63828,11 +66790,11 @@ ice_have_sendto=no for ac_func in sendto do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -63885,45 +66847,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_sendto=yes fi done if test "${ice_have_sendto}" = yes; then -{ echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for sendto declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_sendto_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_sendto_decl=no @@ -63972,8 +66941,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5 -echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5 +$as_echo "$ice_cv_have_sendto_decl" >&6; } if test "$ice_cv_have_sendto_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -63988,11 +66957,11 @@ ice_have_setegid=no for ac_func in setegid do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64045,45 +67014,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_setegid=yes fi done if test "${ice_have_setegid}" = yes; then -{ echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5 +$as_echo_n "checking for setegid declaration in unistd.h... " >&6; } if test "${ice_cv_have_setegid_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_setegid_decl=no @@ -64132,8 +67108,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5 +$as_echo "$ice_cv_have_setegid_decl" >&6; } if test "$ice_cv_have_setegid_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -64148,11 +67124,11 @@ ice_have_seteuid=no for ac_func in seteuid do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64205,45 +67181,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_seteuid=yes fi done if test "${ice_have_seteuid}" = yes; then -{ echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5 -echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5 +$as_echo_n "checking for seteuid declaration in unistd.h... " >&6; } if test "${ice_cv_have_seteuid_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_seteuid_decl=no @@ -64292,8 +67275,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5 +$as_echo "$ice_cv_have_seteuid_decl" >&6; } if test "$ice_cv_have_seteuid_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -64308,11 +67291,11 @@ ice_have_setresgid=no for ac_func in setresgid do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64365,45 +67348,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_setresgid=yes fi done if test "${ice_have_setresgid}" = yes; then -{ echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5 +$as_echo_n "checking for setresgid declaration in unistd.h... " >&6; } if test "${ice_cv_have_setresgid_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_setresgid_decl=no @@ -64452,8 +67442,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5 +$as_echo "$ice_cv_have_setresgid_decl" >&6; } if test "$ice_cv_have_setresgid_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -64468,169 +67458,11 @@ ice_have_setresuid=no for ac_func in setresuid do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - ice_have_setresuid=yes -fi -done - -if test "${ice_have_setresuid}" = yes; then -{ echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5 -echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6; } -if test "${ice_cv_have_setresuid_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -ice_cv_have_setresuid_decl=no -ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' -ice_re_word='(^|[^a-zA-Z0-9_])' -for header in unistd.h; do -# Check for ordinary declaration -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresuid[ ]*\(" >/dev/null 2>&1; then - ice_cv_have_setresuid_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_setresuid_decl" = yes; then - break -fi -# Check for "fixed" declaration like "getpid _PARAMS((int))" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$header> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "${ice_re_word}setresuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then - ice_cv_have_setresuid_decl=yes -fi -rm -f conftest* - -if test "$ice_cv_have_setresuid_decl" = yes; then - break -fi -done - -fi - -{ echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6; } -if test "$ice_cv_have_setresuid_decl" = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SETRESUID_DECL 1 -_ACEOF - -fi -fi - - -for ac_func in shquote -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64683,50 +67515,121 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + ice_have_setresuid=yes +fi +done + +if test "${ice_have_setresuid}" = yes; then +{ $as_echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5 +$as_echo_n "checking for setresuid declaration in unistd.h... " >&6; } +if test "${ice_cv_have_setresuid_decl+set}" = set; then + $as_echo_n "(cached) " >&6 +else + +ice_cv_have_setresuid_decl=no +ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*' +ice_re_word='(^|[^a-zA-Z0-9_])' +for header in unistd.h; do +# Check for ordinary declaration +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}setresuid[ ]*\(" >/dev/null 2>&1; then + ice_cv_have_setresuid_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_setresuid_decl" = yes; then + break +fi +# Check for "fixed" declaration like "getpid _PARAMS((int))" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$header> +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "${ice_re_word}setresuid[ ]*$ice_re_params\(\(" >/dev/null 2>&1; then + ice_cv_have_setresuid_decl=yes +fi +rm -f conftest* + +if test "$ice_cv_have_setresuid_decl" = yes; then + break fi done +fi + +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5 +$as_echo "$ice_cv_have_setresuid_decl" >&6; } +if test "$ice_cv_have_setresuid_decl" = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SETRESUID_DECL 1 +_ACEOF + +fi +fi + ice_have_snprintf=no for ac_func in snprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64779,45 +67682,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_snprintf=yes fi done if test "${ice_have_snprintf}" = yes; then -{ echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5 +$as_echo_n "checking for snprintf declaration in stdio.h... " >&6; } if test "${ice_cv_have_snprintf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_snprintf_decl=no @@ -64866,8 +67776,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5 +$as_echo "$ice_cv_have_snprintf_decl" >&6; } if test "$ice_cv_have_snprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -64882,11 +67792,11 @@ ice_have_vsnprintf=no for ac_func in vsnprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -64939,45 +67849,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_vsnprintf=yes fi done if test "${ice_have_vsnprintf}" = yes; then -{ echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5 -echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5 +$as_echo_n "checking for vsnprintf declaration in stdio.h... " >&6; } if test "${ice_cv_have_vsnprintf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_vsnprintf_decl=no @@ -65026,8 +67943,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5 +$as_echo "$ice_cv_have_vsnprintf_decl" >&6; } if test "$ice_cv_have_vsnprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -65038,10 +67955,10 @@ fi fi - { echo "$as_me:$LINENO: checking for setpgid" >&5 -echo $ECHO_N "checking for setpgid... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for setpgid" >&5 +$as_echo_n "checking for setpgid... " >&6; } if test "${ac_cv_func_setpgid+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65094,32 +68011,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_setpgid=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setpgid=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5 -echo "${ECHO_T}$ac_cv_func_setpgid" >&6; } -if test $ac_cv_func_setpgid = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5 +$as_echo "$ac_cv_func_setpgid" >&6; } +if test "x$ac_cv_func_setpgid" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -65131,11 +68052,11 @@ ice_have_setpgid=no for ac_func in setpgid do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65188,45 +68109,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_setpgid=yes fi done if test "${ice_have_setpgid}" = yes; then -{ echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5 -echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5 +$as_echo_n "checking for setpgid declaration in sys/types.h unistd.h... " >&6; } if test "${ice_cv_have_setpgid_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_setpgid_decl=no @@ -65275,8 +68203,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5 +$as_echo "$ice_cv_have_setpgid_decl" >&6; } if test "$ice_cv_have_setpgid_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -65290,10 +68218,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for setpgrp" >&5 -echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setpgrp" >&5 +$as_echo_n "checking for setpgrp... " >&6; } if test "${ac_cv_func_setpgrp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65346,40 +68274,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_setpgrp=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setpgrp=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5 -echo "${ECHO_T}$ac_cv_func_setpgrp" >&6; } -if test $ac_cv_func_setpgrp = yes; then - { echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5 -echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5 +$as_echo "$ac_cv_func_setpgrp" >&6; } +if test "x$ac_cv_func_setpgrp" = x""yes; then + { $as_echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } if test "${ac_cv_func_setpgrp_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5 -echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5 +$as_echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -65406,36 +68338,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setpgrp_void=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_setpgrp_void=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 -echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } if test $ac_cv_func_setpgrp_void = yes; then cat >>confdefs.h <<\_ACEOF @@ -65451,11 +68386,11 @@ ice_have_setpgrp=no for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65508,45 +68443,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_setpgrp=yes fi done if test "${ice_have_setpgrp}" = yes; then -{ echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5 -echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5 +$as_echo_n "checking for setpgrp declaration in sys/types.h unistd.h libc.h... " >&6; } if test "${ice_cv_have_setpgrp_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_setpgrp_decl=no @@ -65595,8 +68537,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5 +$as_echo "$ice_cv_have_setpgrp_decl" >&6; } if test "$ice_cv_have_setpgrp_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -65611,11 +68553,11 @@ ice_have_setsockopt=no for ac_func in setsockopt do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65668,45 +68610,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_setsockopt=yes fi done if test "${ice_have_setsockopt}" = yes; then -{ echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for setsockopt declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_setsockopt_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_setsockopt_decl=no @@ -65755,8 +68704,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5 -echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5 +$as_echo "$ice_cv_have_setsockopt_decl" >&6; } if test "$ice_cv_have_setsockopt_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -65771,11 +68720,11 @@ fi for ac_func in sigaction sigemptyset sigvec do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65828,35 +68777,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -65867,11 +68823,11 @@ ice_have_socket=no for ac_func in socket do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -65924,45 +68880,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_socket=yes fi done if test "${ice_have_socket}" = yes; then -{ echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for socket declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_socket_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_socket_decl=no @@ -66011,8 +68974,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5 -echo "${ECHO_T}$ice_cv_have_socket_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5 +$as_echo "$ice_cv_have_socket_decl" >&6; } if test "$ice_cv_have_socket_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66027,11 +68990,11 @@ ice_have_socketpair=no for ac_func in socketpair do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66084,45 +69047,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_socketpair=yes fi done if test "${ice_have_socketpair}" = yes; then -{ echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5 -echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5 +$as_echo_n "checking for socketpair declaration in sys/types.h sys/socket.h... " >&6; } if test "${ice_cv_have_socketpair_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_socketpair_decl=no @@ -66171,8 +69141,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5 -echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5 +$as_echo "$ice_cv_have_socketpair_decl" >&6; } if test "$ice_cv_have_socketpair_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66187,11 +69157,11 @@ ice_have_sscanf=no for ac_func in sscanf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66244,45 +69214,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_sscanf=yes fi done if test "${ice_have_sscanf}" = yes; then -{ echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5 -echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5 +$as_echo_n "checking for sscanf declaration in stdio.h... " >&6; } if test "${ice_cv_have_sscanf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_sscanf_decl=no @@ -66331,8 +69308,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5 +$as_echo "$ice_cv_have_sscanf_decl" >&6; } if test "$ice_cv_have_sscanf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66347,11 +69324,11 @@ ice_have_strerror=no for ac_func in strerror do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66404,45 +69381,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strerror=yes fi done if test "${ice_have_strerror}" = yes; then -{ echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5 +$as_echo_n "checking for strerror declaration in string.h strings.h... " >&6; } if test "${ice_cv_have_strerror_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strerror_decl=no @@ -66491,8 +69475,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5 +$as_echo "$ice_cv_have_strerror_decl" >&6; } if test "$ice_cv_have_strerror_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66505,11 +69489,11 @@ fi for ac_func in strftime do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66562,43 +69546,50 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. -{ echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 -echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } if test "${ac_cv_lib_intl_strftime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -66630,33 +69621,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_strftime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; } -if test $ac_cv_lib_intl_strftime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF @@ -66672,11 +69667,11 @@ ice_have_strftime=no for ac_func in strftime do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66729,45 +69724,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strftime=yes fi done if test "${ice_have_strftime}" = yes; then -{ echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5 +$as_echo_n "checking for strftime declaration in time.h sys/time.h... " >&6; } if test "${ice_cv_have_strftime_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strftime_decl=no @@ -66816,8 +69818,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5 +$as_echo "$ice_cv_have_strftime_decl" >&6; } if test "$ice_cv_have_strftime_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66832,11 +69834,11 @@ ice_have_strncasecmp=no for ac_func in strncasecmp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -66889,45 +69891,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strncasecmp=yes fi done if test "${ice_have_strncasecmp}" = yes; then -{ echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5 +$as_echo_n "checking for strncasecmp declaration in string.h strings.h... " >&6; } if test "${ice_cv_have_strncasecmp_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strncasecmp_decl=no @@ -66976,8 +69985,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5 +$as_echo "$ice_cv_have_strncasecmp_decl" >&6; } if test "$ice_cv_have_strncasecmp_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -66992,11 +70001,11 @@ ice_have_syslog=no for ac_func in syslog do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67049,45 +70058,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_syslog=yes fi done if test "${ice_have_syslog}" = yes; then -{ echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5 -echo $ECHO_N "checking for syslog declaration in syslog.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5 +$as_echo_n "checking for syslog declaration in syslog.h... " >&6; } if test "${ice_cv_have_syslog_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_syslog_decl=no @@ -67136,8 +70152,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5 -echo "${ECHO_T}$ice_cv_have_syslog_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5 +$as_echo "$ice_cv_have_syslog_decl" >&6; } if test "$ice_cv_have_syslog_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67152,11 +70168,11 @@ ice_have_system=no for ac_func in system do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67209,45 +70225,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_system=yes fi done if test "${ice_have_system}" = yes; then -{ echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5 -echo $ECHO_N "checking for system declaration in stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5 +$as_echo_n "checking for system declaration in stdlib.h... " >&6; } if test "${ice_cv_have_system_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_system_decl=no @@ -67296,8 +70319,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5 -echo "${ECHO_T}$ice_cv_have_system_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5 +$as_echo "$ice_cv_have_system_decl" >&6; } if test "$ice_cv_have_system_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67312,11 +70335,11 @@ ice_have_time=no for ac_func in time do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67369,45 +70392,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_time=yes fi done if test "${ice_have_time}" = yes; then -{ echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5 -echo $ECHO_N "checking for time declaration in time.h sys/time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5 +$as_echo_n "checking for time declaration in time.h sys/time.h... " >&6; } if test "${ice_cv_have_time_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_time_decl=no @@ -67456,8 +70486,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5 -echo "${ECHO_T}$ice_cv_have_time_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5 +$as_echo "$ice_cv_have_time_decl" >&6; } if test "$ice_cv_have_time_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67472,11 +70502,11 @@ ice_have_tolower=no for ac_func in tolower do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67529,45 +70559,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_tolower=yes fi done if test "${ice_have_tolower}" = yes; then -{ echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5 -echo $ECHO_N "checking for tolower declaration in ctype.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5 +$as_echo_n "checking for tolower declaration in ctype.h... " >&6; } if test "${ice_cv_have_tolower_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_tolower_decl=no @@ -67616,8 +70653,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5 -echo "${ECHO_T}$ice_cv_have_tolower_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5 +$as_echo "$ice_cv_have_tolower_decl" >&6; } if test "$ice_cv_have_tolower_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67632,11 +70669,11 @@ ice_have_toupper=no for ac_func in toupper do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67689,45 +70726,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_toupper=yes fi done if test "${ice_have_toupper}" = yes; then -{ echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5 -echo $ECHO_N "checking for toupper declaration in ctype.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5 +$as_echo_n "checking for toupper declaration in ctype.h... " >&6; } if test "${ice_cv_have_toupper_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_toupper_decl=no @@ -67776,8 +70820,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5 -echo "${ECHO_T}$ice_cv_have_toupper_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5 +$as_echo "$ice_cv_have_toupper_decl" >&6; } if test "$ice_cv_have_toupper_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67792,11 +70836,11 @@ ice_have_ungetc=no for ac_func in ungetc do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -67849,45 +70893,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_ungetc=yes fi done if test "${ice_have_ungetc}" = yes; then -{ echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5 -echo $ECHO_N "checking for ungetc declaration in stdio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5 +$as_echo_n "checking for ungetc declaration in stdio.h... " >&6; } if test "${ice_cv_have_ungetc_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_ungetc_decl=no @@ -67936,8 +70987,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5 -echo "${ECHO_T}$ice_cv_have_ungetc_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5 +$as_echo "$ice_cv_have_ungetc_decl" >&6; } if test "$ice_cv_have_ungetc_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -67952,11 +71003,11 @@ ice_have_vfprintf=no for ac_func in vfprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -68009,45 +71060,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_vfprintf=yes fi done if test "${ice_have_vfprintf}" = yes; then -{ echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for vfprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5 +$as_echo_n "checking for vfprintf declaration in stdio.h stdlib.h... " >&6; } if test "${ice_cv_have_vfprintf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_vfprintf_decl=no @@ -68096,8 +71154,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vfprintf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5 +$as_echo "$ice_cv_have_vfprintf_decl" >&6; } if test "$ice_cv_have_vfprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -68112,11 +71170,11 @@ ice_have_vprintf=no for ac_func in vprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -68169,45 +71227,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_vprintf=yes fi done if test "${ice_have_vprintf}" = yes; then -{ echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5 -echo $ECHO_N "checking for vprintf declaration in stdio.h stdlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5 +$as_echo_n "checking for vprintf declaration in stdio.h stdlib.h... " >&6; } if test "${ice_cv_have_vprintf_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_vprintf_decl=no @@ -68256,8 +71321,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5 -echo "${ECHO_T}$ice_cv_have_vprintf_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5 +$as_echo "$ice_cv_have_vprintf_decl" >&6; } if test "$ice_cv_have_vprintf_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -68267,10 +71332,10 @@ _ACEOF fi fi -{ echo "$as_me:$LINENO: checking for wait4" >&5 -echo $ECHO_N "checking for wait4... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wait4" >&5 +$as_echo_n "checking for wait4... " >&6; } if test "${ac_cv_func_wait4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -68323,42 +71388,46 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_wait4=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_wait4=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5 -echo "${ECHO_T}$ac_cv_func_wait4" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5 +$as_echo "$ac_cv_func_wait4" >&6; } ice_have_writev=no for ac_func in writev do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -68411,45 +71480,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_writev=yes fi done if test "${ice_have_writev}" = yes; then -{ echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5 -echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5 +$as_echo_n "checking for writev declaration in unistd.h sys/uio.h... " >&6; } if test "${ice_cv_have_writev_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_writev_decl=no @@ -68498,8 +71574,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5 -echo "${ECHO_T}$ice_cv_have_writev_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5 +$as_echo "$ice_cv_have_writev_decl" >&6; } if test "$ice_cv_have_writev_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -68514,11 +71590,11 @@ ice_have_strcasecmp=no for ac_func in strcasecmp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -68571,45 +71647,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF ice_have_strcasecmp=yes fi done if test "${ice_have_strcasecmp}" = yes; then -{ echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5 -echo $ECHO_N "checking for strcasecmp declaration in string.h strings.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5 +$as_echo_n "checking for strcasecmp declaration in string.h strings.h... " >&6; } if test "${ice_cv_have_strcasecmp_decl+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ice_cv_have_strcasecmp_decl=no @@ -68658,8 +71741,8 @@ done fi -{ echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5 -echo "${ECHO_T}$ice_cv_have_strcasecmp_decl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5 +$as_echo "$ice_cv_have_strcasecmp_decl" >&6; } if test "$ice_cv_have_strcasecmp_decl" = yes; then cat >>confdefs.h <<_ACEOF @@ -68671,7 +71754,7 @@ fi -ac_config_files="$ac_config_files Makefile amandad-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile common-src/versuff.c config/Makefile device-src/Makefile device-src/tests/Makefile dumper-src/Makefile example/Makefile example/amanda-client.conf example/amanda.conf example/chg-mcutil.conf example/template.d/amanda-S3.conf example/template.d/advanced.conf example/template.d/amanda-harddisk.conf example/template.d/amanda-single-tape.conf example/template.d/amanda-tape-changer.conf gnulib/Makefile installcheck/Makefile man/Makefile oldrecover-src/Makefile packaging/Makefile perl/Makefile po/Makefile recover-src/Makefile restore-src/Makefile server-src/Makefile tape-src/Makefile" +ac_config_files="$ac_config_files Makefile amandad-src/Makefile amar-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile common-src/Makefile common-src/versuff.c config/Makefile device-src/Makefile application-src/Makefile example/Makefile example/amanda-client.conf example/amanda.conf example/xinetd.amandaclient example/xinetd.amandaserver example/inetd.conf.amandaclient example/inetd.conf.amandaserver example/chg-mcutil.conf example/template.d/advanced.conf example/template.d/amanda-S3.conf example/template.d/amanda-harddisk.conf example/template.d/amanda-single-tape.conf example/template.d/amanda-tape-changer.conf gnulib/Makefile installcheck/Makefile man/Makefile oldrecover-src/Makefile packaging/Makefile perl/Makefile po/Makefile recover-src/Makefile restore-src/Makefile server-src/Makefile xfer-src/Makefile" cat >confcache <<\_ACEOF @@ -68701,11 +71784,12 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -68738,12 +71822,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -68759,7 +71843,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -68771,23 +71855,23 @@ LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. +$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined. +$as_echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi @@ -68807,307 +71891,318 @@ fi gl_LTLIBOBJS=$gl_ltlibobjs + + gltests_libobjs= + gltests_ltlibobjs= + if test -n "$gltests_LIBOBJS"; then + # Remove the extension. + sed_drop_objext='s/\.o$//;s/\.obj$//' + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do + gltests_libobjs="$gltests_libobjs $i.$ac_objext" + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + done + fi + gltests_LIBOBJS=$gltests_libobjs + + gltests_LTLIBOBJS=$gltests_ltlibobjs + + if test -z "${WANT_SETUID_CLIENT_TRUE}" && test -z "${WANT_SETUID_CLIENT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SETUID_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SETUID_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_INSTALLPERMS_TRUE}" && test -z "${WANT_INSTALLPERMS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_INSTALLPERMS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_INSTALLPERMS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_INSTALLPERMS\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_INSTALLPERMS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_CLIENT_TRUE}" && test -z "${WANT_CLIENT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_RESTORE_TRUE}" && test -z "${WANT_RESTORE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_RESTORE\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_RESTORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_RESTORE\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_RESTORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SERVER_TRUE}" && test -z "${WANT_SERVER_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SERVER\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SERVER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SERVER\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SERVER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_RECOVER_TRUE}" && test -z "${WANT_RECOVER_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_RECOVER\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_RECOVER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_RECOVER\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_RECOVER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_TRUE}" && test -z "${WANT_TAPE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_AMPLOT_TRUE}" && test -z "${WANT_AMPLOT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_AMPLOT\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMPLOT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_AMPLOT\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_AMPLOT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. +$as_echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_CHG_SCSI_TRUE}" && test -z "${WANT_CHG_SCSI_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CHG_SCSI\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_CHG_SCSI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_LINUX_TRUE}" && test -z "${WANT_SCSI_LINUX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_LINUX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_LINUX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_HPUX_NEW_TRUE}" && test -z "${WANT_SCSI_HPUX_NEW_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_HPUX_NEW\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_IRIX_TRUE}" && test -z "${WANT_SCSI_IRIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_IRIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_IRIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_IRIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_IRIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_SOLARIS_TRUE}" && test -z "${WANT_SCSI_SOLARIS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_AIX_TRUE}" && test -z "${WANT_SCSI_AIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_AIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_AIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_CAM_TRUE}" && test -z "${WANT_SCSI_CAM_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CAM\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_CAM\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_CAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_BSD_TRUE}" && test -z "${WANT_SCSI_BSD_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_BSD\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_BSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_BSD\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_BSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_CHG_SCSI_CHIO_TRUE}" && test -z "${WANT_CHG_SCSI_CHIO_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_CHG_SCSI_CHIO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_HPUX_TRUE}" && test -z "${WANT_SCSI_HPUX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_HPUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_HPUX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_HPUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SCSI_CHIO_TRUE}" && test -z "${WANT_SCSI_CHIO_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CHIO\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SCSI_CHIO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SCSI_CHIO\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SCSI_CHIO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_AMFLOCK_POSIX_TRUE}" && test -z "${WANT_AMFLOCK_POSIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_AMFLOCK_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_AMFLOCK_FLOCK_TRUE}" && test -z "${WANT_AMFLOCK_FLOCK_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_AMFLOCK_FLOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_AMFLOCK_LOCKF_TRUE}" && test -z "${WANT_AMFLOCK_LOCKF_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_AMFLOCK_LOCKF\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_AMFLOCK_LNLOCK_TRUE}" && test -z "${WANT_AMFLOCK_LNLOCK_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_AMFLOCK_LNLOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_CYGWIN_COPY_PERL_DLL_TRUE}" && test -z "${WANT_CYGWIN_COPY_PERL_DLL_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_CYGWIN_COPY_PERL_DLL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${WANT_DEVPAY_TRUE}" && test -z "${WANT_DEVPAY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_DEVPAY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_DEVPAY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_S3_DEVICE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_XENIX_TRUE}" && test -z "${WANT_TAPE_XENIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_XENIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_XENIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE_XENIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE_XENIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_AIX_TRUE}" && test -z "${WANT_TAPE_AIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_AIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE_AIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE_AIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_UWARE_TRUE}" && test -z "${WANT_TAPE_UWARE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_UWARE\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_UWARE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE_UWARE\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE_UWARE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_POSIX_TRUE}" && test -z "${WANT_TAPE_POSIX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_POSIX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE_POSIX\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE_POSIX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_TAPE_DEVICE_TRUE}" && test -z "${WANT_TAPE_DEVICE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_TAPE_DEVICE\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_TAPE_DEVICE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_BSD_SECURITY_TRUE}" && test -z "${WANT_BSD_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_BSD_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_BSD_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_BSD_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_BSD_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_BSDTCP_SECURITY_TRUE}" && test -z "${WANT_BSDTCP_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_BSDTCP_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_BSDUDP_SECURITY_TRUE}" && test -z "${WANT_BSDUDP_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_BSDUDP_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_RSH_SECURITY_TRUE}" && test -z "${WANT_RSH_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_RSH_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_RSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_RSH_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_RSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SSH_SECURITY_TRUE}" && test -z "${WANT_SSH_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SSH_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SSH_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SSH_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_KRB4_SECURITY_TRUE}" && test -z "${WANT_KRB4_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB4_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_KRB4_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_KRB4_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_KRB4_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_KRB5_SECURITY_TRUE}" && test -z "${WANT_KRB5_SECURITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_KRB5_SECURITY\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_KRB5_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_KRB5_SECURITY\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_KRB5_SECURITY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WANT_SAMBA_TRUE}" && test -z "${WANT_SAMBA_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_SAMBA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined. +$as_echo "$as_me: error: conditional \"WANT_SAMBA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi + if test -z "${GCC_COMPILER_TRUE}" && test -z "${GCC_COMPILER_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"GCC_COMPILER\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"GCC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined. +$as_echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -69120,7 +72215,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -69130,7 +72225,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -69152,17 +72247,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -69178,8 +72301,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -69202,7 +72323,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -69215,17 +72336,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -69247,7 +72361,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -69298,7 +72412,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -69326,7 +72440,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -69339,19 +72452,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -69376,10 +72492,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -69402,7 +72518,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -69415,7 +72531,16 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -69423,22 +72548,23 @@ config_commands="$ac_config_commands" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -69452,13 +72578,13 @@ $config_commands Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -69466,11 +72592,12 @@ ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -69492,30 +72619,36 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -69534,27 +72667,29 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # @@ -69569,7 +72704,7 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -69580,6 +72715,7 @@ do "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "amandad-src/Makefile") CONFIG_FILES="$CONFIG_FILES amandad-src/Makefile" ;; + "amar-src/Makefile") CONFIG_FILES="$CONFIG_FILES amar-src/Makefile" ;; "amplot/Makefile") CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;; "changer-src/Makefile") CONFIG_FILES="$CONFIG_FILES changer-src/Makefile" ;; "client-src/Makefile") CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;; @@ -69587,14 +72723,17 @@ do "common-src/versuff.c") CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "device-src/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/Makefile" ;; - "device-src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES device-src/tests/Makefile" ;; - "dumper-src/Makefile") CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;; + "application-src/Makefile") CONFIG_FILES="$CONFIG_FILES application-src/Makefile" ;; "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; "example/amanda-client.conf") CONFIG_FILES="$CONFIG_FILES example/amanda-client.conf" ;; "example/amanda.conf") CONFIG_FILES="$CONFIG_FILES example/amanda.conf" ;; + "example/xinetd.amandaclient") CONFIG_FILES="$CONFIG_FILES example/xinetd.amandaclient" ;; + "example/xinetd.amandaserver") CONFIG_FILES="$CONFIG_FILES example/xinetd.amandaserver" ;; + "example/inetd.conf.amandaclient") CONFIG_FILES="$CONFIG_FILES example/inetd.conf.amandaclient" ;; + "example/inetd.conf.amandaserver") CONFIG_FILES="$CONFIG_FILES example/inetd.conf.amandaserver" ;; "example/chg-mcutil.conf") CONFIG_FILES="$CONFIG_FILES example/chg-mcutil.conf" ;; - "example/template.d/amanda-S3.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-S3.conf" ;; "example/template.d/advanced.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/advanced.conf" ;; + "example/template.d/amanda-S3.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-S3.conf" ;; "example/template.d/amanda-harddisk.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-harddisk.conf" ;; "example/template.d/amanda-single-tape.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-single-tape.conf" ;; "example/template.d/amanda-tape-changer.conf") CONFIG_FILES="$CONFIG_FILES example/template.d/amanda-tape-changer.conf" ;; @@ -69608,10 +72747,10 @@ do "recover-src/Makefile") CONFIG_FILES="$CONFIG_FILES recover-src/Makefile" ;; "restore-src/Makefile") CONFIG_FILES="$CONFIG_FILES restore-src/Makefile" ;; "server-src/Makefile") CONFIG_FILES="$CONFIG_FILES server-src/Makefile" ;; - "tape-src/Makefile") CONFIG_FILES="$CONFIG_FILES tape-src/Makefile" ;; + "xfer-src/Makefile") CONFIG_FILES="$CONFIG_FILES xfer-src/Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -69652,711 +72791,144 @@ $debug || (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -PACKAGE!$PACKAGE$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -SNAPSHOT_STAMP!$SNAPSHOT_STAMP$ac_delim -VERSION_MAJOR!$VERSION_MAJOR$ac_delim -VERSION_MINOR!$VERSION_MINOR$ac_delim -VERSION_PATCH!$VERSION_PATCH$ac_delim -VERSION_COMMENT!$VERSION_COMMENT$ac_delim -VERSION_SUFFIX!$VERSION_SUFFIX$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -RANLIB!$RANLIB$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr fi -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -GL_COND_LIBTOOL_TRUE!$GL_COND_LIBTOOL_TRUE$ac_delim -GL_COND_LIBTOOL_FALSE!$GL_COND_LIBTOOL_FALSE$ac_delim -ALLOCA!$ALLOCA$ac_delim -ALLOCA_H!$ALLOCA_H$ac_delim -ARPA_INET_H!$ARPA_INET_H$ac_delim -INCLUDE_NEXT!$INCLUDE_NEXT$ac_delim -NEXT_FLOAT_H!$NEXT_FLOAT_H$ac_delim -FLOAT_H!$FLOAT_H$ac_delim -NEXT_SYS_SOCKET_H!$NEXT_SYS_SOCKET_H$ac_delim -HAVE_SYS_SOCKET_H!$HAVE_SYS_SOCKET_H$ac_delim -HAVE_WINSOCK2_H!$HAVE_WINSOCK2_H$ac_delim -HAVE_WS2TCPIP_H!$HAVE_WS2TCPIP_H$ac_delim -SYS_SOCKET_H!$SYS_SOCKET_H$ac_delim -LIBINTL!$LIBINTL$ac_delim -LTLIBINTL!$LTLIBINTL$ac_delim -NEXT_SYS_TIME_H!$NEXT_SYS_TIME_H$ac_delim -HAVE_SYS_TIME_H!$HAVE_SYS_TIME_H$ac_delim -HAVE_STRUCT_TIMEVAL!$HAVE_STRUCT_TIMEVAL$ac_delim -REPLACE_GETTIMEOFDAY!$REPLACE_GETTIMEOFDAY$ac_delim -SYS_TIME_H!$SYS_TIME_H$ac_delim -LIBPTH!$LIBPTH$ac_delim -LTLIBPTH!$LTLIBPTH$ac_delim -LIBTHREAD!$LIBTHREAD$ac_delim -LTLIBTHREAD!$LTLIBTHREAD$ac_delim -LIBMULTITHREAD!$LIBMULTITHREAD$ac_delim -LTLIBMULTITHREAD!$LTLIBMULTITHREAD$ac_delim -HAVE_MALLOC_POSIX!$HAVE_MALLOC_POSIX$ac_delim -GNULIB_MALLOC_POSIX!$GNULIB_MALLOC_POSIX$ac_delim -GNULIB_REALLOC_POSIX!$GNULIB_REALLOC_POSIX$ac_delim -GNULIB_CALLOC_POSIX!$GNULIB_CALLOC_POSIX$ac_delim -GNULIB_GETSUBOPT!$GNULIB_GETSUBOPT$ac_delim -GNULIB_MKDTEMP!$GNULIB_MKDTEMP$ac_delim -GNULIB_MKSTEMP!$GNULIB_MKSTEMP$ac_delim -HAVE_CALLOC_POSIX!$HAVE_CALLOC_POSIX$ac_delim -HAVE_GETSUBOPT!$HAVE_GETSUBOPT$ac_delim -HAVE_MKDTEMP!$HAVE_MKDTEMP$ac_delim -HAVE_REALLOC_POSIX!$HAVE_REALLOC_POSIX$ac_delim -REPLACE_MKSTEMP!$REPLACE_MKSTEMP$ac_delim -NEXT_NETINET_IN_H!$NEXT_NETINET_IN_H$ac_delim -HAVE_NETINET_IN_H!$HAVE_NETINET_IN_H$ac_delim -NETINET_IN_H!$NETINET_IN_H$ac_delim -GNULIB_FPRINTF_POSIX!$GNULIB_FPRINTF_POSIX$ac_delim -GNULIB_PRINTF_POSIX!$GNULIB_PRINTF_POSIX$ac_delim -GNULIB_SNPRINTF!$GNULIB_SNPRINTF$ac_delim -GNULIB_SPRINTF_POSIX!$GNULIB_SPRINTF_POSIX$ac_delim -GNULIB_VFPRINTF_POSIX!$GNULIB_VFPRINTF_POSIX$ac_delim -GNULIB_VPRINTF_POSIX!$GNULIB_VPRINTF_POSIX$ac_delim -GNULIB_VSNPRINTF!$GNULIB_VSNPRINTF$ac_delim -GNULIB_VSPRINTF_POSIX!$GNULIB_VSPRINTF_POSIX$ac_delim -GNULIB_VASPRINTF!$GNULIB_VASPRINTF$ac_delim -GNULIB_FSEEK!$GNULIB_FSEEK$ac_delim -GNULIB_FSEEKO!$GNULIB_FSEEKO$ac_delim -GNULIB_FTELL!$GNULIB_FTELL$ac_delim -GNULIB_FTELLO!$GNULIB_FTELLO$ac_delim -GNULIB_FFLUSH!$GNULIB_FFLUSH$ac_delim -GNULIB_GETDELIM!$GNULIB_GETDELIM$ac_delim -GNULIB_GETLINE!$GNULIB_GETLINE$ac_delim -REPLACE_FPRINTF!$REPLACE_FPRINTF$ac_delim -REPLACE_VFPRINTF!$REPLACE_VFPRINTF$ac_delim -REPLACE_PRINTF!$REPLACE_PRINTF$ac_delim -REPLACE_VPRINTF!$REPLACE_VPRINTF$ac_delim -REPLACE_SNPRINTF!$REPLACE_SNPRINTF$ac_delim -HAVE_DECL_SNPRINTF!$HAVE_DECL_SNPRINTF$ac_delim -REPLACE_VSNPRINTF!$REPLACE_VSNPRINTF$ac_delim -HAVE_DECL_VSNPRINTF!$HAVE_DECL_VSNPRINTF$ac_delim -REPLACE_SPRINTF!$REPLACE_SPRINTF$ac_delim -REPLACE_VSPRINTF!$REPLACE_VSPRINTF$ac_delim -HAVE_VASPRINTF!$HAVE_VASPRINTF$ac_delim -REPLACE_VASPRINTF!$REPLACE_VASPRINTF$ac_delim -HAVE_FSEEKO!$HAVE_FSEEKO$ac_delim -REPLACE_FSEEKO!$REPLACE_FSEEKO$ac_delim -REPLACE_FSEEK!$REPLACE_FSEEK$ac_delim -HAVE_FTELLO!$HAVE_FTELLO$ac_delim -REPLACE_FTELLO!$REPLACE_FTELLO$ac_delim -REPLACE_FTELL!$REPLACE_FTELL$ac_delim -REPLACE_FFLUSH!$REPLACE_FFLUSH$ac_delim -HAVE_DECL_GETDELIM!$HAVE_DECL_GETDELIM$ac_delim -HAVE_DECL_GETLINE!$HAVE_DECL_GETLINE$ac_delim -REPLACE_GETLINE!$REPLACE_GETLINE$ac_delim -STDBOOL_H!$STDBOOL_H$ac_delim -HAVE__BOOL!$HAVE__BOOL$ac_delim -HAVE_LONG_LONG_INT!$HAVE_LONG_LONG_INT$ac_delim -HAVE_UNSIGNED_LONG_LONG_INT!$HAVE_UNSIGNED_LONG_LONG_INT$ac_delim -HAVE_INTTYPES_H!$HAVE_INTTYPES_H$ac_delim -HAVE_SYS_TYPES_H!$HAVE_SYS_TYPES_H$ac_delim -NEXT_STDINT_H!$NEXT_STDINT_H$ac_delim -HAVE_STDINT_H!$HAVE_STDINT_H$ac_delim -HAVE_SYS_INTTYPES_H!$HAVE_SYS_INTTYPES_H$ac_delim -HAVE_SYS_BITYPES_H!$HAVE_SYS_BITYPES_H$ac_delim -BITSIZEOF_PTRDIFF_T!$BITSIZEOF_PTRDIFF_T$ac_delim -BITSIZEOF_SIG_ATOMIC_T!$BITSIZEOF_SIG_ATOMIC_T$ac_delim -BITSIZEOF_SIZE_T!$BITSIZEOF_SIZE_T$ac_delim -BITSIZEOF_WCHAR_T!$BITSIZEOF_WCHAR_T$ac_delim -BITSIZEOF_WINT_T!$BITSIZEOF_WINT_T$ac_delim -HAVE_SIGNED_SIG_ATOMIC_T!$HAVE_SIGNED_SIG_ATOMIC_T$ac_delim -HAVE_SIGNED_WCHAR_T!$HAVE_SIGNED_WCHAR_T$ac_delim -HAVE_SIGNED_WINT_T!$HAVE_SIGNED_WINT_T$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -PTRDIFF_T_SUFFIX!$PTRDIFF_T_SUFFIX$ac_delim -SIG_ATOMIC_T_SUFFIX!$SIG_ATOMIC_T_SUFFIX$ac_delim -SIZE_T_SUFFIX!$SIZE_T_SUFFIX$ac_delim -WCHAR_T_SUFFIX!$WCHAR_T_SUFFIX$ac_delim -WINT_T_SUFFIX!$WINT_T_SUFFIX$ac_delim -STDINT_H!$STDINT_H$ac_delim -NEXT_STDIO_H!$NEXT_STDIO_H$ac_delim -NEXT_STDLIB_H!$NEXT_STDLIB_H$ac_delim -GNULIB_MEMMEM!$GNULIB_MEMMEM$ac_delim -GNULIB_MEMPCPY!$GNULIB_MEMPCPY$ac_delim -GNULIB_MEMRCHR!$GNULIB_MEMRCHR$ac_delim -GNULIB_STPCPY!$GNULIB_STPCPY$ac_delim -GNULIB_STPNCPY!$GNULIB_STPNCPY$ac_delim -GNULIB_STRCHRNUL!$GNULIB_STRCHRNUL$ac_delim -GNULIB_STRDUP!$GNULIB_STRDUP$ac_delim -GNULIB_STRNDUP!$GNULIB_STRNDUP$ac_delim -GNULIB_STRNLEN!$GNULIB_STRNLEN$ac_delim -GNULIB_STRPBRK!$GNULIB_STRPBRK$ac_delim -GNULIB_STRSEP!$GNULIB_STRSEP$ac_delim -GNULIB_STRCASESTR!$GNULIB_STRCASESTR$ac_delim -GNULIB_STRTOK_R!$GNULIB_STRTOK_R$ac_delim -GNULIB_MBSLEN!$GNULIB_MBSLEN$ac_delim -GNULIB_MBSNLEN!$GNULIB_MBSNLEN$ac_delim -GNULIB_MBSCHR!$GNULIB_MBSCHR$ac_delim -GNULIB_MBSRCHR!$GNULIB_MBSRCHR$ac_delim -GNULIB_MBSSTR!$GNULIB_MBSSTR$ac_delim -GNULIB_MBSCASECMP!$GNULIB_MBSCASECMP$ac_delim -GNULIB_MBSNCASECMP!$GNULIB_MBSNCASECMP$ac_delim -GNULIB_MBSPCASECMP!$GNULIB_MBSPCASECMP$ac_delim -GNULIB_MBSCASESTR!$GNULIB_MBSCASESTR$ac_delim -GNULIB_MBSCSPN!$GNULIB_MBSCSPN$ac_delim -GNULIB_MBSPBRK!$GNULIB_MBSPBRK$ac_delim -GNULIB_MBSSPN!$GNULIB_MBSSPN$ac_delim -GNULIB_MBSSEP!$GNULIB_MBSSEP$ac_delim -GNULIB_MBSTOK_R!$GNULIB_MBSTOK_R$ac_delim -HAVE_DECL_MEMMEM!$HAVE_DECL_MEMMEM$ac_delim -HAVE_MEMPCPY!$HAVE_MEMPCPY$ac_delim -HAVE_DECL_MEMRCHR!$HAVE_DECL_MEMRCHR$ac_delim -HAVE_STPCPY!$HAVE_STPCPY$ac_delim -HAVE_STPNCPY!$HAVE_STPNCPY$ac_delim -HAVE_STRCASECMP!$HAVE_STRCASECMP$ac_delim -HAVE_DECL_STRNCASECMP!$HAVE_DECL_STRNCASECMP$ac_delim -HAVE_STRCHRNUL!$HAVE_STRCHRNUL$ac_delim -HAVE_DECL_STRDUP!$HAVE_DECL_STRDUP$ac_delim -HAVE_STRNDUP!$HAVE_STRNDUP$ac_delim -HAVE_DECL_STRNDUP!$HAVE_DECL_STRNDUP$ac_delim -HAVE_DECL_STRNLEN!$HAVE_DECL_STRNLEN$ac_delim -HAVE_STRPBRK!$HAVE_STRPBRK$ac_delim -HAVE_STRSEP!$HAVE_STRSEP$ac_delim -HAVE_STRCASESTR!$HAVE_STRCASESTR$ac_delim -HAVE_DECL_STRTOK_R!$HAVE_DECL_STRTOK_R$ac_delim -NEXT_STRING_H!$NEXT_STRING_H$ac_delim -HAVE_LSTAT!$HAVE_LSTAT$ac_delim -HAVE_DECL_MKDIR!$HAVE_DECL_MKDIR$ac_delim -HAVE_IO_H!$HAVE_IO_H$ac_delim -NEXT_SYS_STAT_H!$NEXT_SYS_STAT_H$ac_delim -SYS_STAT_H!$SYS_STAT_H$ac_delim -GNULIB_CHOWN!$GNULIB_CHOWN$ac_delim -GNULIB_DUP2!$GNULIB_DUP2$ac_delim -GNULIB_FCHDIR!$GNULIB_FCHDIR$ac_delim -GNULIB_FTRUNCATE!$GNULIB_FTRUNCATE$ac_delim -GNULIB_GETCWD!$GNULIB_GETCWD$ac_delim -GNULIB_GETLOGIN_R!$GNULIB_GETLOGIN_R$ac_delim -GNULIB_LCHOWN!$GNULIB_LCHOWN$ac_delim -GNULIB_LSEEK!$GNULIB_LSEEK$ac_delim -GNULIB_READLINK!$GNULIB_READLINK$ac_delim -GNULIB_SLEEP!$GNULIB_SLEEP$ac_delim -HAVE_DUP2!$HAVE_DUP2$ac_delim -HAVE_FTRUNCATE!$HAVE_FTRUNCATE$ac_delim -HAVE_READLINK!$HAVE_READLINK$ac_delim -HAVE_SLEEP!$HAVE_SLEEP$ac_delim -HAVE_DECL_GETLOGIN_R!$HAVE_DECL_GETLOGIN_R$ac_delim -REPLACE_CHOWN!$REPLACE_CHOWN$ac_delim -REPLACE_FCHDIR!$REPLACE_FCHDIR$ac_delim -REPLACE_GETCWD!$REPLACE_GETCWD$ac_delim -REPLACE_LCHOWN!$REPLACE_LCHOWN$ac_delim -REPLACE_LSEEK!$REPLACE_LSEEK$ac_delim -NEXT_UNISTD_H!$NEXT_UNISTD_H$ac_delim -HAVE_UNISTD_H!$HAVE_UNISTD_H$ac_delim -EOVERFLOW!$EOVERFLOW$ac_delim -CFLAG_VISIBILITY!$CFLAG_VISIBILITY$ac_delim -HAVE_VISIBILITY!$HAVE_VISIBILITY$ac_delim -GNULIB_WCWIDTH!$GNULIB_WCWIDTH$ac_delim -HAVE_DECL_WCWIDTH!$HAVE_DECL_WCWIDTH$ac_delim -REPLACE_WCWIDTH!$REPLACE_WCWIDTH$ac_delim -WCHAR_H!$WCHAR_H$ac_delim -HAVE_WCHAR_H!$HAVE_WCHAR_H$ac_delim -NEXT_WCHAR_H!$NEXT_WCHAR_H$ac_delim -AMANDA_WARNING_CFLAGS!$AMANDA_WARNING_CFLAGS$ac_delim -CLIENT_LOGIN!$CLIENT_LOGIN$ac_delim -SETUID_GROUP!$SETUID_GROUP$ac_delim -CONFIG_DIR!$CONFIG_DIR$ac_delim -USE_VERSION_SUFFIXES!$USE_VERSION_SUFFIXES$ac_delim -GNUTAR_LISTED_INCREMENTAL_DIR!$GNUTAR_LISTED_INCREMENTAL_DIR$ac_delim -AMANDA_TMPDIR!$AMANDA_TMPDIR$ac_delim -BINARY_OWNER!$BINARY_OWNER$ac_delim -MAXTAPEBLOCKSIZE!$MAXTAPEBLOCKSIZE$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -AMANDA_DBGDIR!$AMANDA_DBGDIR$ac_delim -AMANDA_DEBUG_DAYS!$AMANDA_DEBUG_DAYS$ac_delim -SERVICE_SUFFIX!$SERVICE_SUFFIX$ac_delim -WANT_SETUID_CLIENT_TRUE!$WANT_SETUID_CLIENT_TRUE$ac_delim -WANT_SETUID_CLIENT_FALSE!$WANT_SETUID_CLIENT_FALSE$ac_delim -WANT_INSTALLPERMS_TRUE!$WANT_INSTALLPERMS_TRUE$ac_delim -WANT_INSTALLPERMS_FALSE!$WANT_INSTALLPERMS_FALSE$ac_delim -WANT_CLIENT_TRUE!$WANT_CLIENT_TRUE$ac_delim -WANT_CLIENT_FALSE!$WANT_CLIENT_FALSE$ac_delim -WANT_RESTORE_TRUE!$WANT_RESTORE_TRUE$ac_delim -WANT_RESTORE_FALSE!$WANT_RESTORE_FALSE$ac_delim -WANT_SERVER_TRUE!$WANT_SERVER_TRUE$ac_delim -WANT_SERVER_FALSE!$WANT_SERVER_FALSE$ac_delim -WANT_RECOVER_TRUE!$WANT_RECOVER_TRUE$ac_delim -WANT_RECOVER_FALSE!$WANT_RECOVER_FALSE$ac_delim -WANT_TAPE_TRUE!$WANT_TAPE_TRUE$ac_delim -WANT_TAPE_FALSE!$WANT_TAPE_FALSE$ac_delim -GNUPLOT!$GNUPLOT$ac_delim -PCAT!$PCAT$ac_delim -COMPRESS!$COMPRESS$ac_delim -GZIP!$GZIP$ac_delim -AMPLOT_COMPRESS!$AMPLOT_COMPRESS$ac_delim -AMPLOT_CAT_GZIP!$AMPLOT_CAT_GZIP$ac_delim -AMPLOT_CAT_COMPRESS!$AMPLOT_CAT_COMPRESS$ac_delim -AMPLOT_CAT_PACK!$AMPLOT_CAT_PACK$ac_delim -WANT_AMPLOT_TRUE!$WANT_AMPLOT_TRUE$ac_delim -WANT_AMPLOT_FALSE!$WANT_AMPLOT_FALSE$ac_delim -XSLTPROC_FLAGS!$XSLTPROC_FLAGS$ac_delim -XSLTPROC!$XSLTPROC$ac_delim -ENABLE_MANPAGE_BUILD_TRUE!$ENABLE_MANPAGE_BUILD_TRUE$ac_delim -ENABLE_MANPAGE_BUILD_FALSE!$ENABLE_MANPAGE_BUILD_FALSE$ac_delim -XSLREL!$XSLREL$ac_delim -DOC_BUILD_DATE!$DOC_BUILD_DATE$ac_delim -DEFAULT_SERVER!$DEFAULT_SERVER$ac_delim -DEFAULT_CONFIG!$DEFAULT_CONFIG$ac_delim -DEFAULT_TAPE_SERVER!$DEFAULT_TAPE_SERVER$ac_delim -DEFAULT_TAPE_DEVICE!$DEFAULT_TAPE_DEVICE$ac_delim -EXAMPLE_TAPEDEV!$EXAMPLE_TAPEDEV$ac_delim -DEFAULT_CHANGER_DEVICE!$DEFAULT_CHANGER_DEVICE$ac_delim -DEFAULT_AMANDATES_FILE!$DEFAULT_AMANDATES_FILE$ac_delim -GETCONF!$GETCONF$ac_delim -CHIO!$CHIO$ac_delim -CHS!$CHS$ac_delim -MTX!$MTX$ac_delim -MCUTIL!$MCUTIL$ac_delim -WANT_CHG_SCSI_TRUE!$WANT_CHG_SCSI_TRUE$ac_delim -WANT_CHG_SCSI_FALSE!$WANT_CHG_SCSI_FALSE$ac_delim -WANT_SCSI_LINUX_TRUE!$WANT_SCSI_LINUX_TRUE$ac_delim -WANT_SCSI_LINUX_FALSE!$WANT_SCSI_LINUX_FALSE$ac_delim -WANT_SCSI_HPUX_NEW_TRUE!$WANT_SCSI_HPUX_NEW_TRUE$ac_delim -WANT_SCSI_HPUX_NEW_FALSE!$WANT_SCSI_HPUX_NEW_FALSE$ac_delim -WANT_SCSI_IRIX_TRUE!$WANT_SCSI_IRIX_TRUE$ac_delim -WANT_SCSI_IRIX_FALSE!$WANT_SCSI_IRIX_FALSE$ac_delim -WANT_SCSI_SOLARIS_TRUE!$WANT_SCSI_SOLARIS_TRUE$ac_delim -WANT_SCSI_SOLARIS_FALSE!$WANT_SCSI_SOLARIS_FALSE$ac_delim -WANT_SCSI_AIX_TRUE!$WANT_SCSI_AIX_TRUE$ac_delim -WANT_SCSI_AIX_FALSE!$WANT_SCSI_AIX_FALSE$ac_delim -WANT_SCSI_CAM_TRUE!$WANT_SCSI_CAM_TRUE$ac_delim -WANT_SCSI_CAM_FALSE!$WANT_SCSI_CAM_FALSE$ac_delim -WANT_SCSI_BSD_TRUE!$WANT_SCSI_BSD_TRUE$ac_delim -WANT_SCSI_BSD_FALSE!$WANT_SCSI_BSD_FALSE$ac_delim -WANT_CHG_SCSI_CHIO_TRUE!$WANT_CHG_SCSI_CHIO_TRUE$ac_delim -WANT_CHG_SCSI_CHIO_FALSE!$WANT_CHG_SCSI_CHIO_FALSE$ac_delim -WANT_SCSI_HPUX_TRUE!$WANT_SCSI_HPUX_TRUE$ac_delim -WANT_SCSI_HPUX_FALSE!$WANT_SCSI_HPUX_FALSE$ac_delim -WANT_SCSI_CHIO_TRUE!$WANT_SCSI_CHIO_TRUE$ac_delim -WANT_SCSI_CHIO_FALSE!$WANT_SCSI_CHIO_FALSE$ac_delim -WANT_AMFLOCK_POSIX_TRUE!$WANT_AMFLOCK_POSIX_TRUE$ac_delim -WANT_AMFLOCK_POSIX_FALSE!$WANT_AMFLOCK_POSIX_FALSE$ac_delim -WANT_AMFLOCK_FLOCK_TRUE!$WANT_AMFLOCK_FLOCK_TRUE$ac_delim -WANT_AMFLOCK_FLOCK_FALSE!$WANT_AMFLOCK_FLOCK_FALSE$ac_delim -WANT_AMFLOCK_LOCKF_TRUE!$WANT_AMFLOCK_LOCKF_TRUE$ac_delim -WANT_AMFLOCK_LOCKF_FALSE!$WANT_AMFLOCK_LOCKF_FALSE$ac_delim -WANT_AMFLOCK_LNLOCK_TRUE!$WANT_AMFLOCK_LNLOCK_TRUE$ac_delim -WANT_AMFLOCK_LNLOCK_FALSE!$WANT_AMFLOCK_LNLOCK_FALSE$ac_delim -SWIG!$SWIG$ac_delim -SWIG_LIB!$SWIG_LIB$ac_delim -PERL!$PERL$ac_delim -PERL_INC!$PERL_INC$ac_delim -WANT_CYGWIN_COPY_PERL_DLL_TRUE!$WANT_CYGWIN_COPY_PERL_DLL_TRUE$ac_delim -WANT_CYGWIN_COPY_PERL_DLL_FALSE!$WANT_CYGWIN_COPY_PERL_DLL_FALSE$ac_delim -PERLEXTLIBS!$PERLEXTLIBS$ac_delim -CAT!$CAT$ac_delim -CLIENT_SCRIPTS_OPT!$CLIENT_SCRIPTS_OPT$ac_delim -amlibdir!$amlibdir$ac_delim -amlibexecdir!$amlibexecdir$ac_delim -amincludedir!$amincludedir$ac_delim -amperldir!$amperldir$ac_delim -DUMPER_DIR!$DUMPER_DIR$ac_delim -MSGFMT!$MSGFMT$ac_delim -GETTEXT!$GETTEXT$ac_delim -USE_NLS!$USE_NLS$ac_delim -GMSGFMT!$GMSGFMT$ac_delim -MSGFMT_015!$MSGFMT_015$ac_delim -GMSGFMT_015!$GMSGFMT_015$ac_delim -XGETTEXT!$XGETTEXT$ac_delim -XGETTEXT_015!$XGETTEXT_015$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-4.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -MSGMERGE!$MSGMERGE$ac_delim -INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim -LIBICONV!$LIBICONV$ac_delim -LTLIBICONV!$LTLIBICONV$ac_delim -INTLLIBS!$INTLLIBS$ac_delim -POSUB!$POSUB$ac_delim -CURL_CONFIG!$CURL_CONFIG$ac_delim -_libcurl_config!$_libcurl_config$ac_delim -LIBCURL_CPPFLAGS!$LIBCURL_CPPFLAGS$ac_delim -LIBCURL!$LIBCURL$ac_delim -WANT_S3_DEVICE_TRUE!$WANT_S3_DEVICE_TRUE$ac_delim -WANT_S3_DEVICE_FALSE!$WANT_S3_DEVICE_FALSE$ac_delim -WANT_DEVPAY_TRUE!$WANT_DEVPAY_TRUE$ac_delim -WANT_DEVPAY_FALSE!$WANT_DEVPAY_FALSE$ac_delim -WANT_TAPE_XENIX_TRUE!$WANT_TAPE_XENIX_TRUE$ac_delim -WANT_TAPE_XENIX_FALSE!$WANT_TAPE_XENIX_FALSE$ac_delim -WANT_TAPE_AIX_TRUE!$WANT_TAPE_AIX_TRUE$ac_delim -WANT_TAPE_AIX_FALSE!$WANT_TAPE_AIX_FALSE$ac_delim -WANT_TAPE_UWARE_TRUE!$WANT_TAPE_UWARE_TRUE$ac_delim -WANT_TAPE_UWARE_FALSE!$WANT_TAPE_UWARE_FALSE$ac_delim -WANT_TAPE_POSIX_TRUE!$WANT_TAPE_POSIX_TRUE$ac_delim -WANT_TAPE_POSIX_FALSE!$WANT_TAPE_POSIX_FALSE$ac_delim -WANT_TAPE_DEVICE_TRUE!$WANT_TAPE_DEVICE_TRUE$ac_delim -WANT_TAPE_DEVICE_FALSE!$WANT_TAPE_DEVICE_FALSE$ac_delim -WANT_BSD_SECURITY_TRUE!$WANT_BSD_SECURITY_TRUE$ac_delim -WANT_BSD_SECURITY_FALSE!$WANT_BSD_SECURITY_FALSE$ac_delim -WANT_BSDTCP_SECURITY_TRUE!$WANT_BSDTCP_SECURITY_TRUE$ac_delim -WANT_BSDTCP_SECURITY_FALSE!$WANT_BSDTCP_SECURITY_FALSE$ac_delim -WANT_BSDUDP_SECURITY_TRUE!$WANT_BSDUDP_SECURITY_TRUE$ac_delim -WANT_BSDUDP_SECURITY_FALSE!$WANT_BSDUDP_SECURITY_FALSE$ac_delim -WANT_RSH_SECURITY_TRUE!$WANT_RSH_SECURITY_TRUE$ac_delim -WANT_RSH_SECURITY_FALSE!$WANT_RSH_SECURITY_FALSE$ac_delim -SSH!$SSH$ac_delim -WANT_SSH_SECURITY_TRUE!$WANT_SSH_SECURITY_TRUE$ac_delim -WANT_SSH_SECURITY_FALSE!$WANT_SSH_SECURITY_FALSE$ac_delim -WANT_KRB4_SECURITY_TRUE!$WANT_KRB4_SECURITY_TRUE$ac_delim -WANT_KRB4_SECURITY_FALSE!$WANT_KRB4_SECURITY_FALSE$ac_delim -WANT_KRB5_SECURITY_TRUE!$WANT_KRB5_SECURITY_TRUE$ac_delim -WANT_KRB5_SECURITY_FALSE!$WANT_KRB5_SECURITY_FALSE$ac_delim -XFSDUMP!$XFSDUMP$ac_delim -XFSRESTORE!$XFSRESTORE$ac_delim -VXDUMP!$VXDUMP$ac_delim -VXRESTORE!$VXRESTORE$ac_delim -VDUMP!$VDUMP$ac_delim -VRESTORE!$VRESTORE$ac_delim -DUMP!$DUMP$ac_delim -RESTORE!$RESTORE$ac_delim -GNUTAR!$GNUTAR$ac_delim -SAMBA_CLIENT!$SAMBA_CLIENT$ac_delim -WANT_SAMBA_TRUE!$WANT_SAMBA_TRUE$ac_delim -WANT_SAMBA_FALSE!$WANT_SAMBA_FALSE$ac_delim -AMLINT!$AMLINT$ac_delim -AMLINTFLAGS!$AMLINTFLAGS$ac_delim -LEX!$LEX$ac_delim -LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim -LEXLIB!$LEXLIB$ac_delim -AR!$AR$ac_delim -YACC!$YACC$ac_delim -YFLAGS!$YFLAGS$ac_delim -DD!$DD$ac_delim -BASH!$BASH$ac_delim -SORT!$SORT$ac_delim -MAILER!$MAILER$ac_delim -MT!$MT$ac_delim -MT_FILE_FLAG!$MT_FILE_FLAG$ac_delim -PRINT!$PRINT$ac_delim -GCC_COMPILER_TRUE!$GCC_COMPILER_TRUE$ac_delim -GCC_COMPILER_FALSE!$GCC_COMPILER_FALSE$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -LIBTOOL_DEPS!$LIBTOOL_DEPS$ac_delim -AMANDA_STATIC_LDFLAGS!$AMANDA_STATIC_LDFLAGS$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim -GLIB_LIBS!$GLIB_LIBS$ac_delim -GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim -GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim -GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim -READLINE_LIBS!$READLINE_LIBS$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -gl_LIBOBJS!$gl_LIBOBJS$ac_delim -gl_LTLIBOBJS!$gl_LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi + print line +} -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-5.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACAWK _ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -70372,19 +72944,133 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -70413,26 +73099,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -70442,7 +73140,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70468,7 +73166,7 @@ echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -70477,7 +73175,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70498,17 +73196,17 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -70553,12 +73251,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -70567,13 +73266,14 @@ case `sed -n '/datarootdir/ { /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -70587,15 +73287,16 @@ _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -70606,135 +73307,75 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" | sed -f "$tmp/subs-5.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70754,8 +73395,8 @@ echo X$ac_file | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -70771,13 +73412,13 @@ echo "$as_me: executing $ac_file commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || -echo X"$mf" | +$as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70821,7 +73462,7 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$file" | +$as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70847,7 +73488,7 @@ echo X"$file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -70856,7 +73497,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -70877,8 +73518,8 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" @@ -71008,6 +73649,11 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -71029,6 +73675,10 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi @@ -71036,10 +73686,10 @@ fi # Extract the first word of "svn", so it can be a program name with args. set dummy svn; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SVN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SVN in [\\/]* | ?:[\\/]*) @@ -71054,7 +73704,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -71066,16 +73716,16 @@ esac fi SVN=$ac_cv_path_SVN if test -n "$SVN"; then - { echo "$as_me:$LINENO: result: $SVN" >&5 -echo "${ECHO_T}$SVN" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVN" >&5 +$as_echo "$SVN" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - { echo "$as_me:$LINENO: checking Subversion revision information" >&5 -echo $ECHO_N "checking Subversion revision information... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking Subversion revision information" >&5 +$as_echo_n "checking Subversion revision information... " >&6; } if test -d $srcdir/.svn && test -n "$SVN" && (cd $srcdir > /dev/null ; $SVN info . ) > conftemp.svn; then rev=`$GREP Revision: conftemp.svn|cut -d: -f 2|cut -c2-` url=`$GREP URL: conftemp.svn|cut -d: -f 2-|cut -c2-` @@ -71083,18 +73733,18 @@ echo $ECHO_N "checking Subversion revision information... $ECHO_C" >&6; } echo '#define BUILT_BRANCH "'`basename "$url"`'"' ) > common-src/svn-info.h - { echo "$as_me:$LINENO: result: updated" >&5 -echo "${ECHO_T}updated" >&6; } + { $as_echo "$as_me:$LINENO: result: updated" >&5 +$as_echo "updated" >&6; } else # Makefiles will be upset if the file doesn't exist, so double-check if test -f common-src/svn-info.h; then : # all good - { echo "$as_me:$LINENO: result: not changed" >&5 -echo "${ECHO_T}not changed" >&6; } + { $as_echo "$as_me:$LINENO: result: not changed" >&5 +$as_echo "not changed" >&6; } else echo '/* no information available */' > common-src/svn-info.h - { echo "$as_me:$LINENO: result: not available" >&5 -echo "${ECHO_T}not available" >&6; } + { $as_echo "$as_me:$LINENO: result: not available" >&5 +$as_echo "not available" >&6; } fi fi @@ -71141,10 +73791,11 @@ echo "${ECHO_T}not available" >&6; } echo "Directories:" - echo " Perl modules (amperldir): $amperldir" - echo " Dumper: $DUMPER_DIR" + echo " Application: $APPLICATION_DIR" echo " Configuration: $CONFIG_DIR" echo " GNU Tar lists: $GNUTAR_LISTED_INCREMENTAL_DIR" + echo " Perl modules (amperldir): $amperldir" + echo " Template and example data files (amdatadir): $amdatadir" echo " Temporary: $AMANDA_TMPDIR" if test -f config.warnings; then diff --git a/configure.in b/configure.in index b5eee29..338abfe 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_CANONICAL_TARGET([]) PACKAGE=amanda AC_SUBST(PACKAGE) -AM_INIT_AUTOMAKE(amanda, "2.6.0p2") +AM_INIT_AUTOMAKE(amanda, "2.6.1") AC_CONFIG_HEADERS([config/config.h]) dnl Minimum Autoconf version required. @@ -41,7 +41,7 @@ dnl ------------------------------------------------------------------------- AMANDA_WITH_USER AMANDA_WITH_GROUP -AMANDA_WITH_DUMPERDIR +AMANDA_WITH_APPLICATIONDIR AMANDA_WITH_CONFIGDIR AMANDA_WITH_INDEXDIR AMANDA_WITH_DBDIR @@ -142,6 +142,7 @@ AMANDA_PROG_PRINT AMANDA_PROG_PCAT AMANDA_PROG_PERL AMANDA_PROG_SWIG +AMANDA_PS_ARGUMENT dnl ------------------------------------------------------------------------- @@ -168,6 +169,7 @@ AMANDA_ENABLE_GCC_WARNING([missing-prototypes]) AMANDA_ENABLE_GCC_WARNING([strict-prototypes]) AMANDA_ENABLE_GCC_WARNING([missing-declarations]) AMANDA_ENABLE_GCC_WARNING([format]) +AMANDA_ENABLE_GCC_WARNING([format-security]) AMANDA_ENABLE_GCC_WARNING([sign-compare]) AMANDA_ENABLE_GCC_WARNING([float-equal]) AMANDA_ENABLE_GCC_WARNING([old-style-definition]) @@ -185,6 +187,7 @@ AMANDA_STATIC_FLAGS # # headers # +AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS( @@ -196,9 +199,9 @@ AC_CHECK_HEADERS( math.h \ netdb.h \ netinet/in.h \ + regex.h \ stdarg.h \ stdlib.h \ - string.h \ strings.h \ sys/file.h \ sys/ioctl.h \ @@ -212,13 +215,17 @@ AC_CHECK_HEADERS( sys/types.h \ sys/uio.h \ syslog.h \ + time.h \ unistd.h \ ) +AC_DEFINE([HAVE_AMANDA_H], 1, [Define to 1 if you have the "amanda.h" header file.]) +AC_DEFINE([HAVE_UTIL_H], 1, [Define to 1 if you have the "util.h" header file.]) + +AC_DEFINE([USE_GETTEXT], 1, [Define to 1 if files will be processed with gettextize]) # # Types # -AC_SOCKADDR_STORAGE AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) @@ -323,7 +330,6 @@ ICE_CHECK_DECL(setegid,unistd.h) ICE_CHECK_DECL(seteuid,unistd.h) ICE_CHECK_DECL(setresgid,unistd.h) ICE_CHECK_DECL(setresuid,unistd.h) -AC_CHECK_FUNCS(shquote) ICE_CHECK_DECL(snprintf,stdio.h) ICE_CHECK_DECL(vsnprintf,stdio.h) AMANDA_FUNC_SETPGID @@ -359,6 +365,7 @@ dnl AC_CONFIG_FILES([ Makefile amandad-src/Makefile + amar-src/Makefile amplot/Makefile changer-src/Makefile client-src/Makefile @@ -366,14 +373,17 @@ AC_CONFIG_FILES([ common-src/versuff.c config/Makefile device-src/Makefile - device-src/tests/Makefile - dumper-src/Makefile + application-src/Makefile example/Makefile example/amanda-client.conf example/amanda.conf + example/xinetd.amandaclient + example/xinetd.amandaserver + example/inetd.conf.amandaclient + example/inetd.conf.amandaserver example/chg-mcutil.conf - example/template.d/amanda-S3.conf example/template.d/advanced.conf + example/template.d/amanda-S3.conf example/template.d/amanda-harddisk.conf example/template.d/amanda-single-tape.conf example/template.d/amanda-tape-changer.conf @@ -387,7 +397,7 @@ AC_CONFIG_FILES([ recover-src/Makefile restore-src/Makefile server-src/Makefile - tape-src/Makefile + xfer-src/Makefile ]) AC_OUTPUT diff --git a/device-src/Makefile.am b/device-src/Makefile.am index 75177d7..41c5b23 100644 --- a/device-src/Makefile.am +++ b/device-src/Makefile.am @@ -1,7 +1,7 @@ # Makefile for Amanda tape library. -SUBDIRS = . tests - +include $(top_srcdir)/config/automake/vars.am +include $(top_srcdir)/config/automake/scripts.am include $(top_srcdir)/config/automake/precompile.am INCLUDES = -I$(top_builddir)/common-src \ @@ -13,11 +13,15 @@ AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) sbin_PROGRAMS = +CHECK_PERL = amtapetype +SCRIPTS_PERL = $(CHECK_PERL) +sbin_SCRIPTS = $(SCRIPTS_PERL) + ## libamdevice.la amlib_LTLIBRARIES = libamdevice.la libamdevice_la_LDFLAGS = -release $(VERSION) -libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \ +libamdevice_la_SOURCES = property.c device.c device-queueing.c \ null-device.c rait-device.c vfs-device.c libamdevice_la_LIBADD = ../common-src/libamanda.la @@ -44,21 +48,35 @@ endif endif if WANT_S3_DEVICE -libamdevice_la_SOURCES += s3-device.c s3.c +libamdevice_la_SOURCES += s3-device.c s3.c s3-util.c endif +## automake-style tests + +TESTS = vfs-test +noinst_PROGRAMS = $(TESTS) + +vfs_test_SOURCES = vfs-test.c +vfs_test_LDADD = \ + ../common-src/libtestutils.la \ + libamdevice.la + ## activate-devpay -if WANT_DEVPAY +if WANT_S3_DEVICE sbin_PROGRAMS += activate-devpay activate_devpay_SOURCES = activate-devpay.c endif ## headers -noinst_HEADERS = null-device.h semaphore.h \ - tape-ops.h property.h rait-device.h s3.h \ - s3-device.h tape-device.h vfs-device.h \ - device.h queueing.h +noinst_HEADERS = \ + device-queueing.h \ + device.h \ + property.h \ + s3.h \ + s3-util.h \ + tape-device.h \ + tape-ops.h aminclude_HEADERS = diff --git a/device-src/Makefile.in b/device-src/Makefile.in index 70898dd..7b310fc 100644 --- a/device-src/Makefile.in +++ b/device-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +17,96 @@ # Makefile for Amanda tape library. # vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# SYNOPSIS: +# +# Automake magic to handle the various tasks of building scripts. Scripts can +# be built down to extensionless executables (e.g., foo.pl -> foo), or to +# files with the usual extension (foo-lib.sh.in -> foo.sh). +# +# Files which support it are syntax-checked when the user invokes 'make check'. +# +# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. +# +# USAGE: +# +# include $(top_srcdir)/config/automake/vars.am +# include $(top_srcdir)/config/automake/scripts.am +# ... +# SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm +# SCRIPTS_SHELL = shell1 shell2 sh-lib.sh +# SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl +# +# with the corresponding files in the repository: +# +# fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in +# shell1.sh shell2.sh sh-lib.sh.in +# talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl +# +# by default, all shell and perl scripts are syntax checked. If this is +# a problem (for example, perl scripts depending on Amanda extension +# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish +# to be checked (which can be empty). +# +# To add extra flags to the perl checks (e.g., to add new -I flags), set +# CHECK_PERL_FLAGS. + +# Implementation note: +# +# This file uses config.status to substitute @foo@ in those scripts while +# converting them. It also adds the executable bits (a+x) to extensionless +# files. The substitution works even though the files are not listed in +# configure.in + +# vim:ft=automake + @@ -41,8 +131,10 @@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(aminclude_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/config/automake/precompile.am -sbin_PROGRAMS = $(am__EXEEXT_1) + $(top_srcdir)/config/automake/precompile.am \ + $(top_srcdir)/config/automake/scripts.am \ + $(top_srcdir)/config/automake/vars.am +sbin_PROGRAMS = $(am__EXEEXT_2) # tape-device has *lots* of conditionals; the first is whether to support # the device at all, and the remainder select a particular kind of OS-specific @@ -52,12 +144,15 @@ sbin_PROGRAMS = $(am__EXEEXT_1) @WANT_TAPE_AIX_TRUE@@WANT_TAPE_DEVICE_TRUE@am__append_3 = tape-aix.c @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@am__append_4 = tape-uware.c @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__append_5 = tape-posix.c -@WANT_S3_DEVICE_TRUE@am__append_6 = s3-device.c s3.c -@WANT_DEVPAY_TRUE@am__append_7 = activate-devpay +@WANT_S3_DEVICE_TRUE@am__append_6 = s3-device.c s3.c s3-util.c +TESTS = vfs-test$(EXEEXT) +noinst_PROGRAMS = $(am__EXEEXT_1) +@WANT_S3_DEVICE_TRUE@am__append_7 = activate-devpay subdir = device-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -91,6 +186,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -113,7 +209,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -141,7 +239,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -152,7 +249,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -174,14 +270,14 @@ am__vpath_adj = case $$p in \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" \ - "$(DESTDIR)$(amincludedir)" + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)" amlibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(amlib_LTLIBRARIES) libamdevice_la_DEPENDENCIES = ../common-src/libamanda.la -am__libamdevice_la_SOURCES_DIST = property.c device.c queueing.c \ - semaphore.c null-device.c rait-device.c vfs-device.c \ +am__libamdevice_la_SOURCES_DIST = property.c device.c \ + device-queueing.c null-device.c rait-device.c vfs-device.c \ tape-device.c tape-xenix.c tape-aix.c tape-uware.c \ - tape-posix.c s3-device.c s3.c + tape-posix.c s3-device.c s3.c s3-util.c @WANT_TAPE_DEVICE_TRUE@am__objects_1 = tape-device.lo @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@am__objects_2 = \ @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_XENIX_TRUE@ tape-xenix.lo @@ -191,24 +287,30 @@ am__libamdevice_la_SOURCES_DIST = property.c device.c queueing.c \ @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_UWARE_TRUE@ tape-uware.lo @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@am__objects_5 = \ @WANT_TAPE_DEVICE_TRUE@@WANT_TAPE_POSIX_TRUE@ tape-posix.lo -@WANT_S3_DEVICE_TRUE@am__objects_6 = s3-device.lo s3.lo -am_libamdevice_la_OBJECTS = property.lo device.lo queueing.lo \ - semaphore.lo null-device.lo rait-device.lo vfs-device.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) \ - $(am__objects_4) $(am__objects_5) $(am__objects_6) +@WANT_S3_DEVICE_TRUE@am__objects_6 = s3-device.lo s3.lo s3-util.lo +am_libamdevice_la_OBJECTS = property.lo device.lo device-queueing.lo \ + null-device.lo rait-device.lo vfs-device.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) $(am__objects_4) \ + $(am__objects_5) $(am__objects_6) libamdevice_la_OBJECTS = $(am_libamdevice_la_OBJECTS) libamdevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libamdevice_la_LDFLAGS) $(LDFLAGS) -o $@ -@WANT_DEVPAY_TRUE@am__EXEEXT_1 = activate-devpay$(EXEEXT) +am__EXEEXT_1 = vfs-test$(EXEEXT) +@WANT_S3_DEVICE_TRUE@am__EXEEXT_2 = activate-devpay$(EXEEXT) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(sbin_PROGRAMS) +PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS) am__activate_devpay_SOURCES_DIST = activate-devpay.c -@WANT_DEVPAY_TRUE@am_activate_devpay_OBJECTS = \ -@WANT_DEVPAY_TRUE@ activate-devpay.$(OBJEXT) +@WANT_S3_DEVICE_TRUE@am_activate_devpay_OBJECTS = \ +@WANT_S3_DEVICE_TRUE@ activate-devpay.$(OBJEXT) activate_devpay_OBJECTS = $(am_activate_devpay_OBJECTS) activate_devpay_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +am_vfs_test_OBJECTS = vfs-test.$(OBJEXT) +vfs_test_OBJECTS = $(am_vfs_test_OBJECTS) +vfs_test_DEPENDENCIES = ../common-src/libtestutils.la libamdevice.la +sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(sbin_SCRIPTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -220,25 +322,17 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES) +SOURCES = $(libamdevice_la_SOURCES) $(activate_devpay_SOURCES) \ + $(vfs_test_SOURCES) DIST_SOURCES = $(am__libamdevice_la_SOURCES_DIST) \ - $(am__activate_devpay_SOURCES_DIST) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive + $(am__activate_devpay_SOURCES_DIST) $(vfs_test_SOURCES) amincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(aminclude_HEADERS) $(noinst_HEADERS) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -253,8 +347,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -266,16 +362,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -289,6 +397,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -296,7 +405,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -309,6 +418,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -319,9 +429,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -331,6 +444,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -355,8 +469,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -365,11 +481,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -383,6 +503,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -391,9 +512,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -401,7 +523,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -410,8 +534,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -419,7 +545,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -428,10 +553,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -447,6 +574,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -463,6 +592,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -471,7 +602,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -507,26 +637,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -534,7 +675,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -544,6 +689,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -553,7 +699,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -562,6 +715,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -590,6 +744,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -608,6 +763,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -637,34 +794,62 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = . tests +SUFFIXES = +EXTRA_DIST = +BUILT_SOURCES = +MOSTLYCLEANFILES = + +# config.status leaves config.log files around +CLEANFILES = config.log + +# and we'll need to clean up our generated files for distclean +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) +MAINTAINERCLEANFILES = + +# syntax-check shell scripts on 'make check' +CHECK_SHELL = $(SCRIPTS_SHELL) INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/gnulib AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) +CHECK_PERL = amtapetype +SCRIPTS_PERL = $(CHECK_PERL) +sbin_SCRIPTS = $(SCRIPTS_PERL) amlib_LTLIBRARIES = libamdevice.la libamdevice_la_LDFLAGS = -release $(VERSION) -libamdevice_la_SOURCES = property.c device.c queueing.c semaphore.c \ +libamdevice_la_SOURCES = property.c device.c device-queueing.c \ null-device.c rait-device.c vfs-device.c $(am__append_1) \ $(am__append_2) $(am__append_3) $(am__append_4) \ $(am__append_5) $(am__append_6) libamdevice_la_LIBADD = ../common-src/libamanda.la -@WANT_DEVPAY_TRUE@activate_devpay_SOURCES = activate-devpay.c -noinst_HEADERS = null-device.h semaphore.h \ - tape-ops.h property.h rait-device.h s3.h \ - s3-device.h tape-device.h vfs-device.h \ - device.h queueing.h +vfs_test_SOURCES = vfs-test.c +vfs_test_LDADD = \ + ../common-src/libtestutils.la \ + libamdevice.la + +@WANT_S3_DEVICE_TRUE@activate_devpay_SOURCES = activate-devpay.c +noinst_HEADERS = \ + device-queueing.h \ + device.h \ + property.h \ + s3.h \ + s3-util.h \ + tape-device.h \ + tape-ops.h aminclude_HEADERS = -all: all-recursive +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -699,8 +884,8 @@ install-amlibLTLIBRARIES: $(amlib_LTLIBRARIES) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(amlibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(amlibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(amlibdir)/$$f"; \ else :; fi; \ done @@ -708,8 +893,8 @@ uninstall-amlibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(amlib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(amlibdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(amlibdir)/$$p"; \ done clean-amlibLTLIBRARIES: @@ -722,6 +907,13 @@ clean-amlibLTLIBRARIES: done libamdevice.la: $(libamdevice_la_OBJECTS) $(libamdevice_la_DEPENDENCIES) $(libamdevice_la_LINK) -rpath $(amlibdir) $(libamdevice_la_OBJECTS) $(libamdevice_la_LIBADD) $(LIBS) + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @@ -731,8 +923,8 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS) || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done @@ -753,6 +945,28 @@ clean-sbinPROGRAMS: activate-devpay$(EXEEXT): $(activate_devpay_OBJECTS) $(activate_devpay_DEPENDENCIES) @rm -f activate-devpay$(EXEEXT) $(LINK) $(activate_devpay_OBJECTS) $(activate_devpay_LDADD) $(LIBS) +vfs-test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) + @rm -f vfs-test$(EXEEXT) + $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS) +install-sbinSCRIPTS: $(sbin_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ + else :; fi; \ + done + +uninstall-sbinSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(sbin_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ + done mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -761,20 +975,21 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/activate-devpay.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device-queueing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queueing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rait-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-aix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-posix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-uware.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape-xenix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs-test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -820,125 +1035,41 @@ uninstall-amincludeHEADERS: rm -f "$(DESTDIR)$(amincludedir)/$$f"; \ done -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -951,6 +1082,79 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -977,136 +1181,221 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - distdir) \ - || exit 1; \ - fi; \ - done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"; do \ + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \ - clean-sbinPROGRAMS mostlyclean-am + clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am -info: info-recursive +info: info-am info-am: install-data-am: install-amincludeHEADERS install-amlibLTLIBRARIES -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am -install-exec-am: install-sbinPROGRAMS +install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS -install-html: install-html-recursive +install-html: install-html-am -install-info: install-info-recursive +install-info: install-info-am install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am -install-ps: install-ps-recursive +install-ps: install-ps-am -installcheck-am: +installcheck-am: installcheck-local -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: uninstall-am: uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \ - uninstall-sbinPROGRAMS + uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-amlibLTLIBRARIES \ - clean-generic clean-libtool clean-sbinPROGRAMS ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-local \ + clean clean-amlibLTLIBRARIES clean-generic clean-libtool \ + clean-noinstPROGRAMS clean-sbinPROGRAMS ctags dist-hook \ + distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am \ install-amincludeHEADERS install-amlibLTLIBRARIES install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-sbinPROGRAMS install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-amincludeHEADERS uninstall-amlibLTLIBRARIES \ - uninstall-sbinPROGRAMS + install-ps install-ps-am install-sbinPROGRAMS \ + install-sbinSCRIPTS install-strip installcheck installcheck-am \ + installcheck-local installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-amincludeHEADERS \ + uninstall-amlibLTLIBRARIES uninstall-sbinPROGRAMS \ + uninstall-sbinSCRIPTS + + +# Perl +%: %.pl $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi +%.pl: %.pl.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +%.pm: %.pm.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Shell +%: %.sh $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.sh: %.sh.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# Awk +%: %.awk $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + chmod a+x $@ + +%.awk: %.awk.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + +# syntax-check perl scripts on 'make check' +check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ + done; \ + fi +installcheck-local: installcheck-perl +check-shell: $(CHECK_SHELL) + @CHECK_SHELL="$(CHECK_SHELL)"; \ + if test -n "$$CHECK_SHELL"; then \ + if test -n "$(BASH)"; then \ + for shobj in $$CHECK_SHELL; do \ + if $(BASH) -n $$shobj; then \ + echo "$$shobj syntax OK"; \ + else \ + echo "$$shobj syntax error"; \ + exit 1; \ + fi; \ + done; \ + else \ + echo "No 'bash' available -- cannot syntax-check shell scripts"; \ + fi; \ + fi +check-local: check-shell + +# make sure that the sources for all shell and perl scripts get included +# in the distribution +dist-scripts: + SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ + for script in $$SCRIPTS_PERL; do \ + test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL; do \ + test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ + done; \ + for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ + test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ + done; \ + true +dist-hook: dist-scripts # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange diff --git a/device-src/activate-devpay.c b/device-src/activate-devpay.c index 196834d..9563071 100644 --- a/device-src/activate-devpay.c +++ b/device-src/activate-devpay.c @@ -13,10 +13,6 @@ #include "base64.h" #include "s3.h" -#ifndef WANT_DEVPAY -# error activate_devpay only works if devpay is enabled. -#endif - #define MAX_RESPONSE_SIZE (1024*1024) typedef struct { @@ -147,7 +143,7 @@ static void parser_got_text(GMarkupParseContext * context, /* Do nothing; wait for the message. */ } } else if (g_strrstr(current_tag, "Message")) { - g_set_error(error, G_MARKUP_ERROR, -1, "%.*s", text_len, text); + g_set_error(error, G_MARKUP_ERROR, -1, "%.*s", (int)text_len, text); } } diff --git a/device-src/amtapetype.pl b/device-src/amtapetype.pl new file mode 100644 index 0000000..299bd77 --- /dev/null +++ b/device-src/amtapetype.pl @@ -0,0 +1,399 @@ +#! @PERL@ +# Copyright (c) 2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# This is a tool to examine a device and generate a reasonable tapetype +# entry accordingly. + +use lib '@amperldir@'; +use strict; + +use File::Basename; +use Getopt::Long; +use Math::BigInt; +use Amanda::BigIntCompat; + +use Amanda::Device qw( :constants ); +use Amanda::Debug qw( :logging ); +use Amanda::Util qw( :constants ); +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::MainLoop; +use Amanda::Xfer; +use Amanda::Constants; +use Amanda::Types; + +# command-line options +my $opt_only_compression = 0; +my $opt_blocksize; +my $opt_tapetype_name = 'unknown-tapetype'; +my $opt_force = 0; +my $opt_label = "amtapetype-".(int rand 2**31); +my $opt_device_name; + +# global "hint" from the compression heuristic as to how fast this +# drive is. +my $device_speed_estimate; + +# open up a device, optionally check its label, and start it in ACCESS_WRITE. +sub open_device { + my $device = Amanda::Device->new($opt_device_name); + if ($device->status() != $DEVICE_STATUS_SUCCESS) { + die("Could not open device $opt_device_name: ".$device->error()."\n"); + } + + if (defined $opt_blocksize) { + $device->property_set('BLOCK_SIZE', $opt_blocksize) + or die "Error setting blocksize: " . $device->error_or_status(); + } + + if (!$opt_force) { + my $read_label_status = $device->read_label(); + if ($read_label_status & $DEVICE_STATUS_VOLUME_UNLABELED) { + if ($device->volume_label) { + die "Volume in device $opt_device_name has Amanda label '" . + {$device->volume_label} . "'. Giving up."; + } + } elsif ($read_label_status != $DEVICE_STATUS_SUCCESS) { + die "Error reading label: " . $device->error_or_status(); + } + } + + return $device; +} + +sub start_device { + my ($device) = @_; + + if (!$device->start($ACCESS_WRITE, $opt_label, undef)) { + die("Error writing label '$opt_label': ". $device->error_or_status()); + } + + return $device; +} + +# Write a single file to the device, and record the results in STATS. +# write_one_file( +# STATS => $stats_hashref, (see below) +# DEVICE => $dev, (device to write to) +# PATTERN => RANDOM or FIXED, (data pattern to write) +# BYTES => nn, (number of bytes; optional) +# MAX_TIME => secs); (cancel write after this time; optional) +# +# Returns 0 on success (including EOM), "TIMEOUT" on timeout, or an error message +# on failure. +# +# STATS is a multi-level hashref; write_one_file adds to any values +# already in the data structure. +# $stats->{$pattern}->{TIME} - number of seconds spent writing +# $stats->{$pattern}->{FILES} - number of files written +# $stats->{$pattern}->{BYTES} - number of bytes written (approximate) +# +sub write_one_file(%) { + my %options = @_; + my $stats = $options{'STATS'} || { }; + my $device = $options{'DEVICE'}; + my $bytes = $options{'MAX_BYTES'} || 0; + my $pattern = $options{'PATTERN'} || 'FIXED'; + my $max_time = $options{'MAX_TIME'} || 0; + + # start the device + my $hdr = Amanda::Types::dumpfile_t->new(); + $hdr->{type} = $Amanda::Types::F_DUMPFILE; + $hdr->{name} = "amtapetype"; + $hdr->{disk} = "/test"; + $hdr->{datestamp} = "X"; + $device->start_file($hdr) + or return $device->error_or_status(); + + # set up the transfer + my ($source, $dest, $xfer); + if ($pattern eq 'FIXED') { + # a simple 256-byte pattern to dodge run length encoding. + my $non_random_pattern = pack("C*", 0..255); + $source = Amanda::Xfer::Source::Pattern->new($bytes, $non_random_pattern); + } elsif ($pattern eq 'RANDOM') { + $source = Amanda::Xfer::Source::Random->new($bytes, 1 + int rand 100); + } else { + die "Unknown PATTERN $pattern"; + } + $dest = Amanda::Xfer::Dest::Device->new($device, 0); + $xfer = Amanda::Xfer->new([$source, $dest]); + + # set up the relevant callbacks + my ($timeout_src, $xfer_src, $spinner_src); + my $got_error = 0; + my $got_timeout = 0; + + $xfer_src = $xfer->get_source(); + $xfer_src->set_callback(sub { + my ($src, $xmsg, $xfer) = @_; + if ($xmsg->{type} == $Amanda::Xfer::XMSG_ERROR) { + $got_error = $xmsg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + Amanda::MainLoop::quit(); + } + }); + + if ($max_time) { + $timeout_src = Amanda::MainLoop::timeout_source($max_time * 1000); + $timeout_src->set_callback(sub { + my ($src) = @_; + $got_timeout = 1; + $xfer->cancel(); # will result in an XFER_DONE + }); + } + + $spinner_src = Amanda::MainLoop::timeout_source(1000); + $spinner_src->set_callback(sub { + my ($src) = @_; + my ($file, $block) = ($device->file(), $device->block()); + print STDERR "File $file, block $block \r"; + }); + + my $start_time = time(); + + $xfer->start(); + Amanda::MainLoop::run(); + $xfer_src->remove(); + $spinner_src->remove(); + $timeout_src->remove() if ($timeout_src); + print STDERR " " x 60, "\r"; + + my $duration = time() - $start_time; + + # OK, we finished, update statistics (even if we saw an error) + my $blocks_written = $device->block(); + my $block_size = $device->property_get("block_size"); + $stats->{$pattern}->{BYTES} += $blocks_written * $block_size; + $stats->{$pattern}->{FILES} += 1; + $stats->{$pattern}->{TIME} += $duration; + + if ($device->status() != $Amanda::Device::DEVICE_STATUS_SUCCESS) { + return $device->error_or_status(); + } + + if ($got_error) { + return $got_error; + } + + if ($got_timeout) { + return "TIMEOUT"; + } + + return 0; +} + +sub check_compression { + my ($device) = @_; + + # Check compression status here by property query. If the device can answer + # the question, there's no reason to investigate further. + my $compression_enabled = $device->property_get("compression"); + + if (defined $compression_enabled) { + return $compression_enabled; + } + + # Need to use heuristic to find out if compression is enabled. Also, we + # rewind between passes so that the second pass doesn't get some kind of + # buffering advantage. + + print STDERR "Applying heuristic check for compression.\n"; + + # We base our determination on whether it's faster to write random data or + # patterned data. That starts by writing random data for a short length of + # time, then measuring the elapsed time and total data written. Due to + # potential delay in cancelling a transfer, the elapsed time will be a bit + # longer than the intended time. We then write the same amount of + # patterned data, and again measure the elapsed time. We can then + # calculate the speeds of the two operations. If the compressible speed + # was faster by more than min_ratio, then we assume compression is enabled. + + my $compression_check_time = 60; + my $compression_check_min_ratio = 1.2; + + my $stats = { }; + + start_device($device); + + my $err = write_one_file( + DEVICE => $device, + STATS => $stats, + MAX_TIME => $compression_check_time, + PATTERN => 'RANDOM'); + + if ($err != 'TIMEOUT') { + die $err; + } + + # restart the device to rewind it + start_device($device); + + $err = write_one_file( + DEVICE => $device, + STATS => $stats, + MAX_BYTES => $stats->{'RANDOM'}->{'BYTES'}, + PATTERN => 'FIXED'); + if ($err) { + die $err; + } + + # speed calculations are a little tricky: BigInt * float comes out to NaN, so we + # cast the BigInts to float first + my $random_speed = ($stats->{RANDOM}->{BYTES} . "") / $stats->{RANDOM}->{TIME}; + my $fixed_speed = ($stats->{FIXED}->{BYTES} . "") / $stats->{FIXED}->{TIME}; + + print STDERR "Wrote random (uncompressible) data at $random_speed bytes/sec\n"; + print STDERR "Wrote fixed (compressible) data at $fixed_speed bytes/sec\n"; + + # sock this away for make_tapetype's use + $device_speed_estimate = $random_speed; + + $compression_enabled = + ($fixed_speed / $random_speed > $compression_check_min_ratio); + return $compression_enabled; +} + +sub make_tapetype { + my ($device, $compression_enabled) = @_; + my $blocksize = $device->property_get("BLOCK_SIZE"); + + # First, write one very long file to get the total tape length + print STDERR "Writing one file to fill the volume.\n"; + my $stats = {}; + start_device($device); + my $err = write_one_file( + DEVICE => $device, + STATS => $stats, + PATTERN => 'RANDOM'); + + if ($stats->{RANDOM}->{BYTES} < 1024 * 1024 * 100) { + die "Wrote less than 100MB to the device: $err\n"; + } + my $volume_size_estimate = $stats->{RANDOM}->{BYTES}; + my $speed_estimate = (($stats->{RANDOM}->{BYTES}."") / 1024) + / $stats->{RANDOM}->{TIME}; + $speed_estimate = int $speed_estimate; + print STDERR "Wrote $volume_size_estimate bytes at $speed_estimate kb/sec\n"; + + # now we want to write about 100 filemarks; round down to the blocksize + # to avoid counting padding as part of the filemark + my $file_size = $volume_size_estimate / 100; + $file_size -= $file_size % $blocksize; + + print STDERR "Writing smaller files ($file_size bytes) to determine filemark.\n"; + $stats = {}; + start_device($device); + while (!write_one_file( + DEVICE => $device, + STATS => $stats, + MAX_BYTES => $file_size, + PATTERN => 'RANDOM')) { } + + my $filemark_estimate = ($volume_size_estimate - $stats->{RANDOM}->{BYTES}) + / ($stats->{RANDOM}->{FILES} - 1); + if ($filemark_estimate < 0) { + $filemark_estimate = 0; + } + + my $comment = "Created by amtapetype; compression " + . ($compression_enabled? "enabled" : "disabled"); + + print < \&usage, + 'c' => \$opt_only_compression, + 'b=s' => sub { + my ($num, $suff) = ($_[1] =~ /^([0-9]+)\s*(.*)$/); + die "Invalid blocksize '$_[1]'" unless (defined $num); + my $mult = (defined $suff)? + Amanda::Config::find_multiplier($suff) : 1; + die "Invalid suffix '$suff'" unless ($mult); + $opt_blocksize = $num * $mult; + }, + 't=s' => \$opt_tapetype_name, + 'f' => \$opt_force, + 'l' => \$opt_label, + 'o=s' => sub { add_config_overwrite_opt($config_overwrites, $_[1]); }, +) or usage(); +usage() if (@ARGV != 1); + +$opt_device_name= shift @ARGV; + +apply_config_overwrites($config_overwrites); +my ($cfgerr_level, @cfgerr_errors) = config_errors(); +if ($cfgerr_level >= $CFGERR_WARNINGS) { + config_print_errors(); + if ($cfgerr_level >= $CFGERR_ERRORS) { + die("errors processing configuration options"); + } +} + +Amanda::Util::finish_setup($RUNNING_AS_ANY); + +my $device = open_device(); + +my $compression_enabled = check_compression($device); +print STDERR "Compression: ", + $compression_enabled? "enabled" : "disabled", + "\n"; + +if ($compression_enabled and !$opt_force) { + print STDERR "Turn off compression or run amtapetype with the -f option\n"; + exit(1); +} + +if (!$opt_only_compression) { + make_tapetype($device, $compression_enabled); +} diff --git a/device-src/device-queueing.c b/device-src/device-queueing.c new file mode 100644 index 0000000..7582c1b --- /dev/null +++ b/device-src/device-queueing.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "amanda.h" +#include "device-queueing.h" +#include "device.h" + +producer_result_t device_read_producer(gpointer devicep, + queue_buffer_t *buffer, + size_t hint_size G_GNUC_UNUSED) { + Device* device; + + device = (Device*) devicep; + g_assert(IS_DEVICE(device)); + + buffer->offset = 0; + for (;;) { + int result, read_size; + read_size = buffer->alloc_size; + result = device_read_block(device, buffer->data, &read_size); + if (result > 0) { + buffer->data_size = read_size; + return PRODUCER_MORE; + } else if (result == 0) { + /* unfortunately, the best "memory" we have of needing a larger + * block size is the next time this buffer comes around, and even + * this is incomplete as buffers may be resized periodically. So + * we'll end up calling read_block with small buffers more often + * than strictly necessary. */ + buffer->data = realloc(buffer->data, read_size); + buffer->alloc_size = read_size; + } else if (device->is_eof) { + return PRODUCER_FINISHED; + } else { + buffer->data_size = 0; + return PRODUCER_ERROR; + } + } +} + +ssize_t device_write_consumer(gpointer devicep, queue_buffer_t *buffer) { + Device* device; + size_t write_size; + gsize block_size; + + device = DEVICE(devicep); + + block_size = device->block_size; + write_size = MIN(buffer->data_size, block_size); + + /* we assume that the queueing module is providing us with + * appropriately-sized blocks until the last block. */ + if (device_write_block(device, write_size, + buffer->data + buffer->offset)) { + /* Success! */ + return write_size; + } else { + /* Nope, really an error. */ + return -1; + } +} + diff --git a/device-src/device-queueing.h b/device-src/device-queueing.h new file mode 100644 index 0000000..75d54db --- /dev/null +++ b/device-src/device-queueing.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#ifndef DEVICE_QUEUEING_H +#define DEVICE_QUEUEING_H + +/* some utilities for using queueing with device */ + +#include "queueing.h" + +/* These functions will call device_read_block and device_write_block + * respectively. The user data should be a Device*. + * + * device_write_consumer assumes that the block_size passed to + * do_consumer_producer_queue_full is at least device->block_size(); + * do_consumer_thread() will not pass a buffer of less than block_size + * to the consumer unless it has received EOF from the producer thread. + * + * Similarly, device_read_producer works similarly, but will expand its + * buffers if the device encounters larger blocks - this is Amanda's + * ability to read volumes written with larger block sizes. + */ +producer_result_t device_read_producer(gpointer device, + queue_buffer_t *buffer, + size_t hint_size); +ssize_t device_write_consumer(gpointer device, queue_buffer_t *buffer); + +#endif /* DEVICE_QUEUEING_H */ diff --git a/device-src/device.c b/device-src/device.c index 001db2a..ddb357c 100644 --- a/device-src/device.c +++ b/device-src/device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* The Device API abstracts device workings, interaction, properties, and @@ -29,25 +29,34 @@ #include "device.h" #include "queueing.h" +#include "device-queueing.h" #include "property.h" -#include "null-device.h" #include "timestamp.h" -#include "vfs-device.h" #include "util.h" -#ifdef WANT_TAPE_DEVICE -#include "tape-device.h" -#endif -#include "rait-device.h" + +/* + * Prototypes for subclass registration functions + */ + +void null_device_register (void); +void rait_device_register (void); #ifdef WANT_S3_DEVICE - #include "s3-device.h" +void s3_device_register (void); +#endif +#ifdef WANT_TAPE_DEVICE +void tape_device_register (void); #endif +void vfs_device_register (void); + +/* + * Registration infrastructure + */ static GHashTable* driverList = NULL; void device_api_init(void) { - g_type_init(); - amanda_thread_init(); + glib_init(); device_property_init(); driverList = g_hash_table_new(g_str_hash, g_str_equal); @@ -63,9 +72,13 @@ void device_api_init(void) { #endif } -void register_device(DeviceFactory factory, - const char ** device_prefix_list) { +void +register_device( + DeviceFactory factory, + const char ** device_prefix_list) +{ char ** tmp; + g_assert(driverList != NULL); g_assert(factory != NULL); g_return_if_fail(device_prefix_list != NULL); @@ -78,44 +91,44 @@ void register_device(DeviceFactory factory, } } -static DeviceFactory lookup_device_factory(const char *device_name) { +static DeviceFactory lookup_device_factory(const char *device_type) { gpointer key, value; g_assert(driverList != NULL); - if (g_hash_table_lookup_extended(driverList, device_name, &key, &value)) { + if (g_hash_table_lookup_extended(driverList, device_type, &key, &value)) { return (DeviceFactory)value; } else { return NULL; } } -static const GFlagsValue read_label_status_flags_values[] = { - { READ_LABEL_STATUS_SUCCESS, - "READ_LABEL_STATUS_SUCCESS", +static const GFlagsValue device_status_flags_values[] = { + { DEVICE_STATUS_SUCCESS, + "DEVICE_STATUS_SUCCESS", "Success" }, - { READ_LABEL_STATUS_DEVICE_MISSING, - "READ_LABEL_STATUS_DEVICE_MISSING", - "Device not found" }, - { READ_LABEL_STATUS_DEVICE_ERROR, - "READ_LABEL_STATUS_DEVICE_ERROR", + { DEVICE_STATUS_DEVICE_ERROR, + "DEVICE_STATUS_DEVICE_ERROR", "Device error" }, - { READ_LABEL_STATUS_VOLUME_MISSING, - "READ_LABEL_STATUS_VOLUME_MISSING", + { DEVICE_STATUS_DEVICE_BUSY, + "DEVICE_STATUS_DEVICE_BUSY", + "Device busy" }, + { DEVICE_STATUS_VOLUME_MISSING, + "DEVICE_STATUS_VOLUME_MISSING", "Volume not found" }, - { READ_LABEL_STATUS_VOLUME_UNLABELED, - "READ_LABEL_STATUS_VOLUME_UNLABELED", + { DEVICE_STATUS_VOLUME_UNLABELED, + "DEVICE_STATUS_VOLUME_UNLABELED", "Volume not labeled" }, - { READ_LABEL_STATUS_VOLUME_ERROR, - "READ_LABEL_STATUS_VOLUME_ERROR", + { DEVICE_STATUS_VOLUME_ERROR, + "DEVICE_STATUS_VOLUME_ERROR", "Volume error" }, { 0, NULL, NULL } }; -GType read_label_status_flags_get_type(void) { +GType device_status_flags_get_type(void) { static GType type = 0; if (G_UNLIKELY(type == 0)) { - type = g_flags_register_static("ReadLabelStatusFlags", - read_label_status_flags_values); + type = g_flags_register_static("DeviceStatusFlags", + device_status_flags_values); } return type; } @@ -123,43 +136,76 @@ GType read_label_status_flags_get_type(void) { /* Device class definition starts here. */ struct DevicePrivate_s { - /* This is the return value of the device_get_property_list() - method. */ - GArray *property_list; - GHashTable * property_response; + /* hash table mapping ID to SimpleProperty object */ + GHashTable * simple_properties; + + /* In writing mode, after a short block is written, no additional blocks + * are allowed the file is finished and a new file started. This is only + * used for assertions. */ + gboolean wrote_short_block; + + /* Holds an error message if the function returned an error. */ + char * errmsg; + + /* temporary holding place for device_status_error() */ + char * statusmsg; + DeviceStatusFlags last_status; }; /* This holds the default response to a particular property. */ typedef struct { - PropertyAccessFlags access; + DeviceProperty *prop; GValue response; -} PropertyResponse; + PropertySurety surety; + PropertySource source; +} SimpleProperty; #define selfp (self->private) /* here are local prototypes, so we can make function pointers. */ -static void device_init (Device * o) G_GNUC_UNUSED; -static void device_class_init (DeviceClass * c) G_GNUC_UNUSED; - -static void property_response_free(PropertyResponse *o); - -static gboolean default_device_open_device(Device * self, char * device_name); -static gboolean default_device_finish(Device * self); -static gboolean default_device_start(Device * self, DeviceAccessMode mode, - char * label, char * timestamp); -static gboolean default_device_start_file (Device * self, - const dumpfile_t * jobinfo); -static gboolean default_device_write_block (Device * self, guint size, - gpointer data, gboolean last); -static gboolean default_device_write_from_fd(Device *self, int fd); -static gboolean default_device_finish_file (Device * self); -static dumpfile_t* default_device_seek_file (Device * self, guint file); -static gboolean default_device_seek_block (Device * self, guint64 block); -static int default_device_read_block (Device * self, gpointer buffer, - int * size); -static gboolean default_device_read_to_fd(Device *self, int fd); -static gboolean default_device_property_get(Device * self, DevicePropertyId ID, - GValue * value); +static void device_init (Device * o); +static void device_class_init (DeviceClass * c); +static void device_base_init (DeviceClass * c); + +static void simple_property_free(SimpleProperty *o); + +static void default_device_open_device(Device * self, char * device_name, + char * device_type, char * device_node); +static gboolean default_device_configure(Device *self, gboolean use_global_config); +static gboolean default_device_write_from_fd(Device *self, + queue_fd_t *queue_fd); +static gboolean default_device_read_to_fd(Device *self, queue_fd_t *queue_fd); +static gboolean default_device_property_get_ex(Device * self, DevicePropertyId id, + GValue * val, + PropertySurety *surety, + PropertySource *source); +static gboolean default_device_property_set_ex(Device *self, + DevicePropertyId id, + GValue * val, + PropertySurety surety, + PropertySource source); +static void set_properties_from_global_config(Device * device); +static void set_properties_from_device_config(Device * device, device_config_t *dc); + +static gboolean property_get_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_set_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean property_get_min_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_max_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_canonical_name_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); /* pointer to the class of our parent */ static GObjectClass *parent_class = NULL; @@ -168,11 +214,11 @@ GType device_get_type (void) { static GType type = 0; - + if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (DeviceClass), - (GBaseInitFunc) NULL, + (GBaseInitFunc) device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) device_class_init, (GClassFinalizeFunc) NULL, @@ -204,13 +250,15 @@ static void device_finalize(GObject *obj_self) { amfree(self->device_name); amfree(self->volume_label); amfree(self->volume_time); - g_array_free(selfp->property_list, TRUE); - g_hash_table_destroy(selfp->property_response); + amfree(self->volume_header); + amfree(selfp->errmsg); + amfree(selfp->statusmsg); + g_hash_table_destroy(selfp->simple_properties); amfree(self->private); } static void -device_init (Device * self G_GNUC_UNUSED) +device_init (Device * self) { self->private = malloc(sizeof(DevicePrivate)); self->device_name = NULL; @@ -221,40 +269,92 @@ device_init (Device * self G_GNUC_UNUSED) self->in_file = FALSE; self->volume_label = NULL; self->volume_time = NULL; - selfp->property_list = g_array_new(TRUE, FALSE, sizeof(DeviceProperty)); - selfp->property_response = + self->status = DEVICE_STATUS_SUCCESS; + self->min_block_size = 1; + self->max_block_size = SIZE_MAX; /* subclasses *really* should choose something smaller */ + self->block_size = DISK_BLOCK_BYTES; + selfp->errmsg = NULL; + selfp->statusmsg = NULL; + selfp->last_status = 0; + selfp->simple_properties = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, - (GDestroyNotify) property_response_free); + (GDestroyNotify) simple_property_free); } static void -device_class_init (DeviceClass * c G_GNUC_UNUSED) +device_class_init (DeviceClass * device_class) { - GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c; + GObjectClass *g_object_class = (GObjectClass*) device_class; parent_class = g_type_class_ref (G_TYPE_OBJECT); - c->open_device = default_device_open_device; - c->finish = default_device_finish; - c->read_label = NULL; - c->start = default_device_start; - c->start_file = default_device_start_file; - c->write_block = default_device_write_block; - c->write_from_fd = default_device_write_from_fd; - c->finish_file = default_device_finish_file; - c->seek_file = default_device_seek_file; - c->seek_block = default_device_seek_block; - c->read_block = default_device_read_block; - c->read_to_fd = default_device_read_to_fd; - c->property_get = default_device_property_get; - c->property_set = NULL; - c->recycle_file = NULL; + device_class->open_device = default_device_open_device; + device_class->configure = default_device_configure; + device_class->write_from_fd = default_device_write_from_fd; + device_class->read_to_fd = default_device_read_to_fd; + device_class->property_get_ex = default_device_property_get_ex; + device_class->property_set_ex = default_device_property_set_ex; g_object_class->finalize = device_finalize; } -static void property_response_free(PropertyResponse * resp) { +static void +device_base_init (DeviceClass * device_class) +{ + /* The base_init function is called once each time a child class is + * created, before the class_init functions (even our own) are called. */ + + device_class->class_properties = g_array_new(FALSE, TRUE, sizeof(DeviceProperty)); + device_class->class_properties_list = NULL; + + device_class_register_property(device_class, PROPERTY_BLOCK_SIZE, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + property_get_block_size_fn, + property_set_block_size_fn); + + device_class_register_property(device_class, PROPERTY_MIN_BLOCK_SIZE, + PROPERTY_ACCESS_GET_MASK, + property_get_min_block_size_fn, + NULL); + + device_class_register_property(device_class, PROPERTY_MAX_BLOCK_SIZE, + PROPERTY_ACCESS_GET_MASK, + property_get_max_block_size_fn, + NULL); + + device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, + PROPERTY_ACCESS_GET_MASK, + property_get_canonical_name_fn, + NULL); + + device_class_register_property(device_class, PROPERTY_CONCURRENCY, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); + + device_class_register_property(device_class, PROPERTY_STREAMING, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); + + device_class_register_property(device_class, PROPERTY_APPENDABLE, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); + + device_class_register_property(device_class, PROPERTY_PARTIAL_DELETION, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); + + device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); +} + +static void simple_property_free(SimpleProperty * resp) { g_value_unset(&(resp->response)); amfree(resp); } @@ -273,7 +373,7 @@ regex_message(int result, regex_t *regex) { static gboolean handle_device_regex(const char * user_name, char ** driver_name, - char ** device) { + char ** device, char **errmsg) { regex_t regex; int reg_result; regmatch_t pmatch[3]; @@ -284,28 +384,31 @@ handle_device_regex(const char * user_name, char ** driver_name, reg_result = regcomp(®ex, regex_string, REG_EXTENDED | REG_ICASE); if (reg_result != 0) { char * message = regex_message(reg_result, ®ex); - g_fprintf(stderr, "Error compiling regular expression \"%s\": %s\n", - regex_string, message); - amfree(message); + *errmsg = newvstrallocf(*errmsg, "Error compiling regular expression \"%s\": %s\n", + regex_string, message); + amfree(message); return FALSE; } reg_result = regexec(®ex, user_name, 3, pmatch, 0); if (reg_result != 0 && reg_result != REG_NOMATCH) { char * message = regex_message(reg_result, ®ex); - g_fprintf(stderr, "Error applying regular expression \"%s\" to string \"%s\":\n" - "%s\n", user_name, regex_string, message); + *errmsg = newvstrallocf(*errmsg, + "Error applying regular expression \"%s\" to string \"%s\": %s\n", + user_name, regex_string, message); + amfree(message); regfree(®ex); return FALSE; } else if (reg_result == REG_NOMATCH) { #ifdef WANT_TAPE_DEVICE - g_fprintf(stderr, "\"%s\" uses deprecated device naming convention; \n" + g_warning( + "\"%s\" uses deprecated device naming convention; \n" "using \"tape:%s\" instead.\n", user_name, user_name); *driver_name = stralloc("tape"); *device = stralloc(user_name); #else /* !WANT_TAPE_DEVICE */ - g_fprintf(stderr, "\"%s\" is not a valid device name.\n", user_name); + errmsg = newvstrallocf(errmsg, "\"%s\" is not a valid device name.\n", user_name); regfree(®ex); return FALSE; #endif /* WANT_TAPE_DEVICE */ @@ -317,168 +420,202 @@ handle_device_regex(const char * user_name, char ** driver_name, return TRUE; } +/* helper function for device_open */ +static Device * +make_null_error(char *errmsg, DeviceStatusFlags status) +{ + DeviceFactory factory; + Device *device; + + factory = lookup_device_factory("null"); + g_assert(factory != NULL); + + device = factory("null:", "null", ""); + device_set_error(device, errmsg, status); + + return device; +} + Device* device_open (char * device_name) { - char *device_driver_name = NULL; - char *device_node_name = NULL; + char *device_type = NULL; + char *device_node = NULL; + char *errmsg = NULL; + char *unaliased_name = NULL; DeviceFactory factory; Device *device; + device_config_t *dc; - g_return_val_if_fail (device_name != NULL, NULL); + g_assert(device_name != NULL); if (driverList == NULL) { - g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, - "device_open() called without device_api_init()!\n"); + g_critical("device_open() called without device_api_init()!"); g_assert_not_reached(); } - if (!handle_device_regex(device_name, &device_driver_name, &device_node_name)) { - amfree(device_driver_name); - amfree(device_node_name); - return NULL; + if (device_name == NULL) + return make_null_error(stralloc(_("No device name specified")), DEVICE_STATUS_DEVICE_ERROR); + + /* look up the unaliased device name in the configuration */ + if ((dc = lookup_device_config(device_name))) { + if (!(unaliased_name = device_config_get_tapedev(dc)) + || unaliased_name[0] == '\0') { + return make_null_error( + vstrallocf(_("Device '%s' has no tapedev"), device_name), + DEVICE_STATUS_DEVICE_ERROR); + } + } else { + unaliased_name = device_name; + } + + if (!handle_device_regex(unaliased_name, &device_type, &device_node, + &errmsg)) { + amfree(device_type); + amfree(device_node); + return make_null_error(errmsg, DEVICE_STATUS_DEVICE_ERROR); } - factory = lookup_device_factory(device_driver_name); + factory = lookup_device_factory(device_type); if (factory == NULL) { - g_fprintf(stderr, "Device driver %s is not known.\n", - device_driver_name); - amfree(device_driver_name); - amfree(device_node_name); - return NULL; + Device *nulldev = make_null_error(vstrallocf(_("Device type %s is not known."), + device_type), DEVICE_STATUS_DEVICE_ERROR); + amfree(device_type); + amfree(device_node); + return nulldev; } - device = factory(device_driver_name, device_node_name); - amfree(device_driver_name); - amfree(device_node_name); + device = factory(device_name, device_type, device_node); + g_assert(device != NULL); /* factories must always return a device */ + + amfree(device_type); + amfree(device_node); + return device; } -void -device_add_property (Device * self, DeviceProperty * prop, GValue * response) +char * +device_error(Device * self) { - unsigned int i; - g_return_if_fail (self != NULL); - g_return_if_fail (IS_DEVICE (self)); - g_assert(selfp->property_list != NULL); - g_assert(selfp->property_response != NULL); - - /* Delete it if it already exists. */ - for(i = 0; i < selfp->property_list->len; i ++) { - if (g_array_index(selfp->property_list, - DeviceProperty, i).base->ID == prop->base->ID) { - g_array_remove_index_fast(selfp->property_list, i); - break; - } - } - - g_array_append_val(selfp->property_list, *prop); - - if (response != NULL) { - PropertyResponse * property_response; - - g_return_if_fail(G_IS_VALUE(response)); - - property_response = malloc(sizeof(*property_response)); - property_response->access = prop->access; - bzero(&(property_response->response), - sizeof(property_response->response)); - g_value_init(&(property_response->response), - G_VALUE_TYPE(response)); - g_value_copy(response, &(property_response->response)); - - g_hash_table_insert(selfp->property_response, - GINT_TO_POINTER(prop->base->ID), - property_response); + if (self == NULL) { + return device_error_or_status(self); + } else if (selfp->errmsg) { + return selfp->errmsg; + } else { + return "Unknown Device error"; } } -const DeviceProperty * -device_property_get_list (Device * self) +char * +device_status_error(Device * self) { - g_return_val_if_fail (self != NULL, (const DeviceProperty * )0); - g_return_val_if_fail (IS_DEVICE (self), (const DeviceProperty * )0); + char **status_strv; + char *statusmsg; - return (const DeviceProperty*) selfp->property_list->data; -} - -guint device_write_min_size(Device * self) { - GValue g_tmp; - int block_size, min_block_size; - - bzero(&g_tmp, sizeof(g_tmp)); - device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp); - block_size = g_value_get_int(&g_tmp); - g_value_unset(&g_tmp); - if (block_size > 0) { - return block_size; + if (self == NULL) { + return device_error_or_status(self); } - /* variable block size */ - device_property_get(self, PROPERTY_MIN_BLOCK_SIZE, &g_tmp); - min_block_size = g_value_get_uint(&g_tmp); - g_value_unset(&g_tmp); - return min_block_size; -} + /* reuse a previous statusmsg, if it was for the same status */ + if (selfp->statusmsg && selfp->last_status == self->status) + return selfp->statusmsg; -guint device_write_max_size(Device * self) { - GValue g_tmp; - int block_size, max_block_size; - - bzero(&g_tmp, sizeof(g_tmp)); - device_property_get(self, PROPERTY_BLOCK_SIZE, &g_tmp); - block_size = g_value_get_int(&g_tmp); - g_value_unset(&g_tmp); - if (block_size > 0) { - return block_size; + amfree(selfp->statusmsg); + + status_strv = g_flags_nick_to_strv(self->status, DEVICE_STATUS_FLAGS_TYPE); + g_assert(g_strv_length(status_strv) > 0); + if (g_strv_length(status_strv) == 1) { + statusmsg = stralloc(*status_strv); + } else { + char * status_list = g_english_strjoinv(status_strv, "or"); + statusmsg = g_strdup_printf("one of %s", status_list); + amfree(status_list); } + g_strfreev(status_strv); - /* variable block size */ - device_property_get(self, PROPERTY_MAX_BLOCK_SIZE, &g_tmp); - max_block_size = g_value_get_uint(&g_tmp); - g_value_unset(&g_tmp); - return max_block_size; + selfp->statusmsg = statusmsg; + selfp->last_status = self->status; + return statusmsg; } -guint device_read_max_size(Device * self) { - GValue g_tmp; - - bzero(&g_tmp, sizeof(g_tmp)); - if (device_property_get(self, PROPERTY_READ_BUFFER_SIZE, &g_tmp)) { - guint rval = g_value_get_uint(&g_tmp); - g_value_unset(&g_tmp); - return rval; +char * +device_error_or_status(Device * self) +{ + if (self == NULL) { + return "Device is NULL"; + } else if (selfp->errmsg) { + return selfp->errmsg; } else { - return device_write_max_size(self); + return device_status_error(self); + } +} + +void +device_set_error(Device *self, char *errmsg, DeviceStatusFlags new_flags) +{ + char **flags_strv; + char *flags_str; + char *device_name; + + if (!self) { + g_warning("device_set_error called with a NULL device: '%s'", errmsg? errmsg:"(NULL)"); + amfree(errmsg); + return; + } + + device_name = self->device_name? self->device_name : "(unknown device)"; + + if (errmsg && (!selfp->errmsg || strcmp(errmsg, selfp->errmsg) != 0)) + g_debug("Device %s error = '%s'", device_name, errmsg); + + amfree(selfp->errmsg); + selfp->errmsg = errmsg; + + if (new_flags != DEVICE_STATUS_SUCCESS) { + flags_strv = g_flags_name_to_strv(new_flags, DEVICE_STATUS_FLAGS_TYPE); + g_assert(g_strv_length(flags_strv) > 0); + flags_str = g_english_strjoinv(flags_strv, "and"); + g_debug("Device %s setting status flag(s): %s", device_name, flags_str); + amfree(flags_str); + g_strfreev(flags_strv); } + + self->status = new_flags; } char * device_build_amanda_header(Device * self, const dumpfile_t * info, int * size, gboolean * oneblock) { char *amanda_header; - unsigned int min_header_length; - unsigned int header_buffer_size; + size_t min_header_length; + size_t header_buffer_size; - min_header_length = device_write_min_size(self); + min_header_length = self->block_size; amanda_header = build_header(info, min_header_length); header_buffer_size = MAX(min_header_length, strlen(amanda_header)+1); if (size != NULL) *size = header_buffer_size; if (oneblock != NULL) - *oneblock = (header_buffer_size <= device_write_max_size(self)); + *oneblock = (header_buffer_size <= self->block_size); return amanda_header; } dumpfile_t * make_tapestart_header(Device * self, char * label, char * timestamp) { dumpfile_t * rval; + GValue val; + bzero(&val, sizeof(val)); - g_return_val_if_fail(label != NULL, NULL); + g_assert(label != NULL); rval = malloc(sizeof(*rval)); fh_init(rval); rval->type = F_TAPESTART; + if (device_property_get(self, PROPERTY_BLOCK_SIZE, &val)) { + rval->blocksize = g_value_get_int(&val); + g_value_unset(&val); + } + amfree(self->volume_time); if (get_timestamp_state(timestamp) == TIME_STATE_REPLACE) { self->volume_time = get_proper_stamp_from_time(time(NULL)); @@ -503,71 +640,72 @@ dumpfile_t * make_tapeend_header(void) { return rval; } -/* Try setting max/fixed blocksize on a device. Check results, fallback, and - * print messages for problems. */ -static void try_set_blocksize(Device * device, guint blocksize, - gboolean try_max_first) { +/* Try setting the blocksize on a device. Check results, fallback, and + * set error status for problems. */ +static gboolean +try_set_blocksize(Device * device, guint blocksize) { GValue val; gboolean success; bzero(&val, sizeof(val)); - g_value_init(&val, G_TYPE_UINT); - g_value_set_uint(&val, blocksize); - if (try_max_first) { - success = device_property_set(device, - PROPERTY_MAX_BLOCK_SIZE, - &val); - if (!success) { - g_fprintf(stderr, "Setting MAX_BLOCK_SIZE to %u " - "not supported for device %s.\n" - "trying BLOCK_SIZE instead.\n", - blocksize, device->device_name); - } else { - g_value_unset(&val); - return; - } - } - g_value_unset(&val); g_value_init(&val, G_TYPE_INT); g_value_set_int(&val, blocksize); - success = device_property_set(device, - PROPERTY_BLOCK_SIZE, - &val); + success = device_property_set(device, PROPERTY_BLOCK_SIZE, &val); + g_value_unset(&val); + if (!success) { - g_fprintf(stderr, "Setting BLOCK_SIZE to %u " - "not supported for device %s.\n", - blocksize, device->device_name); + device_set_error(device, + vstrallocf(_("Setting BLOCK_SIZE to %u " + "not supported for device %s.\n"), + blocksize, device->device_name), + DEVICE_STATUS_DEVICE_ERROR); } - g_value_unset(&val); + + return success; } /* A GHFunc (callback for g_hash_table_foreach) */ static void set_device_property(gpointer key_p, gpointer value_p, gpointer user_data_p) { - char * property_s = key_p; - char * value_s = value_p; + char * property_s = key_p; + property_t * property = value_p; Device * device = user_data_p; const DevicePropertyBase* property_base; GValue property_value; + char * value; g_return_if_fail(IS_DEVICE(device)); g_return_if_fail(property_s != NULL); - g_return_if_fail(value_s != NULL); + g_return_if_fail(property != NULL); + g_return_if_fail(property->values != NULL); + + /* don't continue beating on a device that's already erroring */ + if (device_in_error(device)) return; property_base = device_property_get_by_name(property_s); if (property_base == NULL) { /* Nonexistant property name. */ - g_fprintf(stderr, _("Unknown device property name %s.\n"), property_s); + device_set_error(device, + vstrallocf(_("unknown device property name '%s'"), property_s), + DEVICE_STATUS_DEVICE_ERROR); return; } + if (g_slist_length(property->values) > 1) { + device_set_error(device, + vstrallocf(_("multiple values for device property '%s'"), property_s), + DEVICE_STATUS_DEVICE_ERROR); + return; + } bzero(&property_value, sizeof(property_value)); g_value_init(&property_value, property_base->type); - if (!g_value_set_from_string(&property_value, value_s)) { + value = property->values->data; + if (!g_value_set_from_string(&property_value, value)) { /* Value type could not be interpreted. */ - g_fprintf(stderr, - _("Could not parse property value %s for property type %s.\n"), - value_s, g_type_name(property_base->type)); + device_set_error(device, + vstrallocf(_("Could not parse property value '%s' for property '%s'"), + value, g_type_name(property_base->type)), + DEVICE_STATUS_DEVICE_ERROR); return; } else { g_assert (G_VALUE_HOLDS(&property_value, property_base->type)); @@ -575,15 +713,21 @@ static void set_device_property(gpointer key_p, gpointer value_p, if (!device_property_set(device, property_base->ID, &property_value)) { /* Device rejects property. */ - g_fprintf(stderr, _("Could not set property %s to %s on device %s.\n"), - property_base->name, value_s, device->device_name); + if (!device_in_error(device)) { + device_set_error(device, + vstrallocf(_("Could not set property '%s' to '%s' on %s"), + property_base->name, value, device->device_name), + DEVICE_STATUS_DEVICE_ERROR); + } return; } } -/* Set up first-run properties, including DEVICE_MAX_VOLUME_USAGE property - * based on the tapetype. */ -void device_set_startup_properties_from_config(Device * device) { +/* Set up properties based on various taper-related configuration parameters + * and from the tapetype. + */ +static void +set_properties_from_global_config(Device * device) { char * tapetype_name = getconf_str(CNF_TAPETYPE); if (tapetype_name != NULL) { tapetype_t * tapetype = lookup_tapetype(tapetype_name); @@ -613,17 +757,16 @@ void device_set_startup_properties_from_config(Device * device) { &val); g_value_unset(&val); if (!success) { - g_fprintf(stderr, "Setting READ_BUFFER_SIZE to %llu " - "not supported for device %s.\n", - 1024*(long long unsigned int)blocksize_kb, - device->device_name); + /* a non-fatal error */ + g_warning("Setting READ_BUFFER_SIZE to %ju not supported for device %s.", + 1024*(uintmax_t)blocksize_kb, device->device_name); } } if (tapetype_seen(tapetype, TAPETYPE_BLOCKSIZE)) { blocksize_kb = tapetype_get_blocksize(tapetype); - try_set_blocksize(device, blocksize_kb * 1024, - !tapetype_get_file_pad(tapetype)); + /* TODO: handle errors */ + (void)try_set_blocksize(device, blocksize_kb * 1024); } } } @@ -632,6 +775,33 @@ void device_set_startup_properties_from_config(Device * device) { set_device_property, device); } +/* Set properties specified within a device definition */ +static void +set_properties_from_device_config(Device * device, device_config_t *dc) { + g_hash_table_foreach(device_config_get_property(dc), + set_device_property, device); +} + +static gboolean +default_device_configure(Device *self, gboolean use_global_config) +{ + device_config_t *dc; + + if (device_in_error(self)) + return FALSE; + + if (use_global_config) + set_properties_from_global_config(self); + + if (device_in_error(self)) + return FALSE; + + if ((dc = lookup_device_config(self->device_name))) + set_properties_from_device_config(self, dc); + + return !device_in_error(self); +} + void device_clear_volume_details(Device * device) { if (device == NULL || device->access_mode != ACCESS_NULL) { return; @@ -646,137 +816,243 @@ void device_clear_volume_details(Device * device) { incomplete functionality. But they do offer the useful commonality that all devices can expect to need. */ -/* This function only updates access_mode, volume_label, and volume_time. */ +static void default_device_open_device(Device * self, char * device_name, + char * device_type G_GNUC_UNUSED, char * device_node G_GNUC_UNUSED) { + /* Set the device_name property */ + self->device_name = stralloc(device_name); +} + static gboolean -default_device_start (Device * self, DeviceAccessMode mode, char * label, - char * timestamp) { - if (mode != ACCESS_WRITE && self->volume_label == NULL) { - g_debug("default_device_start calling device_read_label with mode %d", mode); - if (device_read_label(self) != READ_LABEL_STATUS_SUCCESS) - return FALSE; - } else if (mode == ACCESS_WRITE) { - self->volume_label = newstralloc(self->volume_label, label); - self->volume_time = newstralloc(self->volume_time, timestamp); - } - self->access_mode = mode; +property_get_block_size_fn( + Device *self, + DevicePropertyBase *base G_GNUC_UNUSED, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + g_value_unset_init(val, G_TYPE_INT); + g_assert(self->block_size < G_MAXINT); /* gsize -> gint */ + g_value_set_int(val, (gint)self->block_size); + + if (surety) + *surety = self->block_size_surety; + + if (source) + *source = self->block_size_source; return TRUE; } -static gboolean default_device_open_device(Device * self, - char * device_name) { - DeviceProperty prop; - guint i; +static gboolean +property_set_block_size_fn( + Device *self, + DevicePropertyBase *base G_GNUC_UNUSED, + GValue *val, + PropertySurety surety, + PropertySource source) +{ + gint block_size = g_value_get_int(val); - self->device_name = stralloc(device_name); + g_assert(block_size >= 0); /* int -> gsize (unsigned) */ + if ((gsize)block_size < self->min_block_size + || (gsize)block_size > self->max_block_size) + return FALSE; - prop.base = &device_property_canonical_name; - prop.access = PROPERTY_ACCESS_GET_MASK; - - for(i = 0; i < selfp->property_list->len; i ++) { - if (g_array_index(selfp->property_list, - DeviceProperty, i).base->ID == prop.base->ID) { - return TRUE; - } - } - /* If we got here, the property was not registered. */ - device_add_property(self, &prop, NULL); + self->block_size = block_size; + self->block_size_surety = surety; + self->block_size_source = source; return TRUE; } -/* This default implementation does very little. */ static gboolean -default_device_finish (Device * self) { - self->access_mode = ACCESS_NULL; +property_get_min_block_size_fn( + Device *self, + DevicePropertyBase *base G_GNUC_UNUSED, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + g_value_unset_init(val, G_TYPE_UINT); + g_assert(self->block_size < G_MAXUINT); /* gsize -> guint */ + g_value_set_uint(val, (guint)self->min_block_size); + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DEFAULT; + return TRUE; } -/* This function updates the file, in_file, and block attributes. */ static gboolean -default_device_start_file (Device * self, - const dumpfile_t * jobInfo G_GNUC_UNUSED) { - self->in_file = TRUE; - if (self->file <= 0) - self->file = 1; - else - self->file ++; - self->block = 0; +property_get_max_block_size_fn( + Device *self, + DevicePropertyBase *base G_GNUC_UNUSED, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + g_value_unset_init(val, G_TYPE_UINT); + g_assert(self->block_size < G_MAXUINT); /* gsize -> guint */ + g_value_set_uint(val, (guint)self->max_block_size); + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DEFAULT; + return TRUE; } -/* This function lies: It updates the block number and maybe calls - device_finish_file(), but returns FALSE. */ static gboolean -default_device_write_block(Device * self, guint size G_GNUC_UNUSED, - gpointer data G_GNUC_UNUSED, gboolean last_block) { - self->block ++; - if (last_block) - device_finish_file(self); - return FALSE; -} +property_get_canonical_name_fn( + Device *self, + DevicePropertyBase *base G_GNUC_UNUSED, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + g_value_unset_init(val, G_TYPE_STRING); + g_value_set_string(val, self->device_name); -/* This function lies: It updates the block number, but returns - -1. */ -static int -default_device_read_block(Device * self, gpointer buf G_GNUC_UNUSED, - int * size G_GNUC_UNUSED) { - self->block ++; - return -1; -} + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DEFAULT; -/* This function just updates the in_file field. */ -static gboolean -default_device_finish_file(Device * self) { - self->in_file = FALSE; return TRUE; } -/* This function just updates the file number. */ -static dumpfile_t * -default_device_seek_file(Device * self, guint file) { - self->in_file = TRUE; - self->file = file; - return NULL; +/* util function */ +static PropertyPhaseFlags +state_to_phase( + Device *self) +{ + if (self->access_mode == ACCESS_NULL) { + return PROPERTY_PHASE_BEFORE_START; + } else if (IS_WRITABLE_ACCESS_MODE(self->access_mode)) { + if (self->in_file) { + return PROPERTY_PHASE_INSIDE_FILE_WRITE; + } else { + return PROPERTY_PHASE_BETWEEN_FILE_WRITE; + } + } else { /* read mode */ + if (self->in_file) { + return PROPERTY_PHASE_INSIDE_FILE_READ; + } else { + return PROPERTY_PHASE_BETWEEN_FILE_READ; + } + } } -/* This function just updates the block number. */ +/* This default implementation serves up static responses, and + implements a few default responses based on values from the Device + struct. */ static gboolean -default_device_seek_block(Device * self, guint64 block) { - self->block = block; +default_device_property_get_ex( + Device * self, + DevicePropertyId id, + GValue * val, + PropertySurety *surety, + PropertySource *source) +{ + DeviceProperty *prop; + GArray *class_properties; + PropertyPhaseFlags cur_phase; + + /* Most of this function's job is to sanity-check everything, then + * call the relevant getter. */ + + if (device_in_error(self)) + return FALSE; + + class_properties = DEVICE_GET_CLASS(self)->class_properties; + if (id >= class_properties->len) + return FALSE; + + prop = &g_array_index(class_properties, DeviceProperty, id); + if (prop->base == NULL) + return FALSE; + + if (val || surety || source) { + /* check the phase */ + cur_phase = state_to_phase(self); + if (!(prop->access & cur_phase)) + return FALSE; + + if (prop->getter == NULL) + return FALSE; + + if (!prop->getter(self, prop->base, val, surety, source)) + return FALSE; + } + return TRUE; } -/* This default implementation serves up static responses, and - implements a default response to the "canonical name" property. */ - static gboolean -default_device_property_get(Device * self, DevicePropertyId ID, - GValue * value) { - const PropertyResponse * resp; - - resp = (PropertyResponse*)g_hash_table_lookup(selfp->property_response, - GINT_TO_POINTER(ID)); - if (resp == NULL) { - if (ID == PROPERTY_CANONICAL_NAME) { - g_value_unset_init(value, G_TYPE_STRING); - g_value_set_string(value, self->device_name); - return TRUE; - } else { - return FALSE; - } - } +default_device_property_set_ex( + Device *self, + DevicePropertyId id, + GValue * val, + PropertySurety surety, + PropertySource source) +{ + DeviceProperty *prop; + GArray *class_properties; + PropertyPhaseFlags cur_phase; + + /* Most of this function's job is to sanity-check everything, then + * call the relevant setter. */ + + if (device_in_error(self)) + return FALSE; + + class_properties = DEVICE_GET_CLASS(self)->class_properties; + if (id >= class_properties->len) + return FALSE; - g_value_unset_copy(&resp->response, value); + prop = &g_array_index(class_properties, DeviceProperty, id); + if (prop->base == NULL) + return FALSE; + + /* check that the type matches */ + if (!G_VALUE_HOLDS(val, prop->base->type)) + return FALSE; + + /* check the phase */ + cur_phase = state_to_phase(self) << PROPERTY_PHASE_SHIFT; + if (!(prop->access & cur_phase)) + return FALSE; + + if (prop->setter == NULL) + return FALSE; + + if (!prop->setter(self, prop->base, val, surety, source)) + return FALSE; return TRUE; } +const GSList * +device_property_get_list (Device * self) +{ + g_assert(IS_DEVICE(self)); + + return DEVICE_GET_CLASS(self)->class_properties_list; +} + static gboolean -default_device_read_to_fd(Device *self, int fd) { +default_device_read_to_fd(Device *self, queue_fd_t *queue_fd) { GValue val; StreamingRequirement streaming_mode; + if (device_in_error(self)) return FALSE; + /* Get the device's parameters */ bzero(&val, sizeof(val)); if (!device_property_get(self, PROPERTY_STREAMING, &val) @@ -791,17 +1067,19 @@ default_device_read_to_fd(Device *self, int fd) { device_read_producer, self, fd_write_consumer, - GINT_TO_POINTER(fd), - device_read_max_size(self), + queue_fd, + self->block_size, DEFAULT_MAX_BUFFER_MEMORY, streaming_mode); } static gboolean -default_device_write_from_fd(Device *self, int fd) { +default_device_write_from_fd(Device *self, queue_fd_t *queue_fd) { GValue val; StreamingRequirement streaming_mode; + if (device_in_error(self)) return FALSE; + /* Get the device's parameters */ bzero(&val, sizeof(val)); if (!device_property_get(self, PROPERTY_STREAMING, &val) @@ -814,10 +1092,10 @@ default_device_write_from_fd(Device *self, int fd) { return QUEUE_SUCCESS == do_consumer_producer_queue_full( fd_read_producer, - GINT_TO_POINTER(fd), + queue_fd, device_write_consumer, self, - device_write_max_size(self), + self->block_size, DEFAULT_MAX_BUFFER_MEMORY, streaming_mode); } @@ -828,294 +1106,396 @@ default_device_write_from_fd(Device *self, int fd) { * will do what you expect vis-a-vis virtual functions. But don't put code * in them beyond error checking and VFT lookup. */ -gboolean -device_open_device (Device * self, char * device_name) +void +device_open_device (Device * self, char * device_name, + char * device_type, char * device_node) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (device_name != NULL, FALSE); - klass = DEVICE_GET_CLASS(self); - - if(klass->open_device) - return (*klass->open_device)(self,device_name); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE(self)); + g_assert(device_name != NULL); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->open_device); + (klass->open_device)(self, device_name, device_type, device_node); } -ReadLabelStatusFlags device_read_label(Device * self) { +DeviceStatusFlags device_read_label(Device * self) { DeviceClass * klass; - g_debug("device_read_label; mode = %d", self->access_mode); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(IS_DEVICE(self), FALSE); - g_return_val_if_fail(self->access_mode == ACCESS_NULL, FALSE); + + g_assert(self != NULL); + g_assert(IS_DEVICE(self)); + g_assert(self->access_mode == ACCESS_NULL); klass = DEVICE_GET_CLASS(self); - if (klass->read_label) { - return (klass->read_label)(self); - } else { - return ~ READ_LABEL_STATUS_SUCCESS; - } + g_assert(klass->read_label); + return (klass->read_label)(self); } gboolean device_finish (Device * self) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - - if (self->access_mode == ACCESS_NULL) - return TRUE; - - klass = DEVICE_GET_CLASS(self); - if (klass->finish) { - return (*klass->finish)(self); - } else { - return FALSE; - } + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->finish); + return (klass->finish)(self); +} + +gboolean +device_configure (Device * self, gboolean use_global_config) +{ + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(self->access_mode == ACCESS_NULL); + + klass = DEVICE_GET_CLASS(self); + if(klass->configure) { + return (klass->configure)(self, use_global_config); + } else { + device_set_error(self, + stralloc(_("Unimplemented method")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } } -/* For a good combination of synchronization and public simplicity, - this stub function does not take a timestamp, but the actual - implementation function does. We generate the timestamp here with - time(). */ gboolean device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp) { - DeviceClass *klass; - - g_debug("device_start mode = %d", mode); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (mode != ACCESS_NULL, FALSE); - g_return_val_if_fail (mode != ACCESS_WRITE || label != NULL, - FALSE); - klass = DEVICE_GET_CLASS(self); - - if(klass->start) { - char * local_timestamp = NULL; - gboolean rv; - - /* fill in a timestamp if none was given */ - if (mode == ACCESS_WRITE && - get_timestamp_state(timestamp) == TIME_STATE_REPLACE) { - local_timestamp = timestamp = - get_proper_stamp_from_time(time(NULL)); - } - - rv = (*klass->start)(self, mode, label, timestamp); - amfree(local_timestamp); - g_debug("device_start done; dev->access_mode = %d, result %d", self->access_mode, rv); - return rv; - } else { - return FALSE; - } + DeviceClass *klass; + char * local_timestamp = NULL; + gboolean rv; + + g_assert(IS_DEVICE (self)); + g_assert(mode != ACCESS_NULL); + g_assert(mode != ACCESS_WRITE || label != NULL); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->start); + + /* For a good combination of synchronization and public simplicity, + this stub function does not require a timestamp, but the actual + implementation function does. We generate the timestamp here with + time(). */ + if (mode == ACCESS_WRITE && + get_timestamp_state(timestamp) == TIME_STATE_REPLACE) { + local_timestamp = timestamp = + get_proper_stamp_from_time(time(NULL)); + } + + rv = (klass->start)(self, mode, label, timestamp); + amfree(local_timestamp); + return rv; } gboolean -device_write_block (Device * self, guint size, gpointer block, - gboolean short_block) +device_write_block (Device * self, guint size, gpointer block) { DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (size > 0, FALSE); - g_return_val_if_fail (short_block || - size >= device_write_min_size(self), FALSE); - g_return_val_if_fail (size <= device_write_max_size(self), FALSE); - g_return_val_if_fail (block != NULL, FALSE); - g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), - FALSE); + + g_assert(IS_DEVICE (self)); + g_assert(size > 0); + + /* these are all things that the caller should take care to + * guarantee, so we just assert them here */ + g_assert(size <= self->block_size); + g_assert(self->in_file); + g_assert(!selfp->wrote_short_block); + g_assert(block != NULL); + g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); + + if (size < self->block_size) + selfp->wrote_short_block = TRUE; klass = DEVICE_GET_CLASS(self); - - if(klass->write_block) - return (*klass->write_block)(self,size, block, short_block); - else - return FALSE; + g_assert(klass->write_block); + return (*klass->write_block)(self,size, block); } gboolean -device_write_from_fd (Device * self, int fd) +device_write_from_fd (Device * self, queue_fd_t * queue_fd) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (fd >= 0, FALSE); - g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), - FALSE); - - klass = DEVICE_GET_CLASS(self); - - if(klass->write_from_fd) - return (*klass->write_from_fd)(self,fd); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(queue_fd->fd >= 0); + g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->write_from_fd); + return (klass->write_from_fd)(self,queue_fd); } gboolean -device_start_file (Device * self, const dumpfile_t * jobInfo) { +device_start_file (Device * self, dumpfile_t * jobInfo) { DeviceClass * klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (!(self->in_file), FALSE); - g_return_val_if_fail (jobInfo != NULL, FALSE); + + g_assert(IS_DEVICE (self)); + g_assert(!(self->in_file)); + g_assert(jobInfo != NULL); + + selfp->wrote_short_block = FALSE; klass = DEVICE_GET_CLASS(self); - - if(klass->start_file) - return (*klass->start_file)(self, jobInfo ); - else - return FALSE; + g_assert(klass->start_file); + return (klass->start_file)(self, jobInfo ); } gboolean device_finish_file (Device * self) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (IS_WRITABLE_ACCESS_MODE(self->access_mode), - FALSE); - g_return_val_if_fail (self->in_file, FALSE); - - klass = DEVICE_GET_CLASS(self); - - if(klass->finish_file) - return (*klass->finish_file)(self); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(IS_WRITABLE_ACCESS_MODE(self->access_mode)); + g_assert(self->in_file); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->finish_file); + return (klass->finish_file)(self); } dumpfile_t* device_seek_file (Device * self, guint file) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, NULL); - g_return_val_if_fail (IS_DEVICE (self), NULL); - g_return_val_if_fail (self->access_mode == ACCESS_READ, - NULL); - - klass = DEVICE_GET_CLASS(self); - - if(klass->seek_file) - return (*klass->seek_file)(self,file); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(self->access_mode == ACCESS_READ); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->seek_file); + return (klass->seek_file)(self,file); } gboolean device_seek_block (Device * self, guint64 block) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (self->access_mode == ACCESS_READ, - FALSE); - g_return_val_if_fail (self->in_file, FALSE); - - klass = DEVICE_GET_CLASS(self); - - if(klass->seek_block) - return (*klass->seek_block)(self,block); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(self->access_mode == ACCESS_READ); + g_assert(self->in_file); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->seek_block); + return (klass->seek_block)(self,block); } int device_read_block (Device * self, gpointer buffer, int * size) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, -1); - g_return_val_if_fail (IS_DEVICE (self), -1); - g_return_val_if_fail (size != NULL, -1); - g_return_val_if_fail (self->access_mode == ACCESS_READ, -1); - if (*size != 0) { - g_return_val_if_fail (buffer != NULL, -1); - } + DeviceClass *klass; - /* Do a quick check here, so fixed-block subclasses don't have to. */ - if (*size == 0 && - device_write_min_size(self) == device_write_max_size(self)) { - *size = device_write_min_size(self); - return 0; - } + g_assert(IS_DEVICE (self)); + g_assert(size != NULL); + g_assert(self->access_mode == ACCESS_READ); - klass = DEVICE_GET_CLASS(self); + if (*size != 0) { + g_assert(buffer != NULL); + } - if(klass->read_block) - return (*klass->read_block)(self,buffer,size); - else - return -1; + klass = DEVICE_GET_CLASS(self); + g_assert(klass->read_block); + return (klass->read_block)(self,buffer,size); } gboolean -device_read_to_fd (Device * self, int fd) +device_read_to_fd (Device * self, queue_fd_t *queue_fd) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (fd >= 0, FALSE); - g_return_val_if_fail (self->access_mode == ACCESS_READ, FALSE); - - klass = DEVICE_GET_CLASS(self); - - if(klass->read_to_fd) - return (*klass->read_to_fd)(self,fd); - else - return FALSE; + DeviceClass *klass; + + g_assert(IS_DEVICE (self)); + g_assert(queue_fd->fd >= 0); + g_assert(self->access_mode == ACCESS_READ); + + klass = DEVICE_GET_CLASS(self); + g_assert(klass->read_to_fd); + return (klass->read_to_fd)(self,queue_fd); } gboolean -device_property_get (Device * self, DevicePropertyId id, GValue * val) +device_property_get_ex( + Device * self, + DevicePropertyId id, + GValue * val, + PropertySurety *surety, + PropertySource *source) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (device_property_get_by_id(id) != NULL, FALSE); + DeviceClass *klass; - klass = DEVICE_GET_CLASS(self); + g_assert(IS_DEVICE (self)); + g_assert(device_property_get_by_id(id) != NULL); - /* FIXME: Check access flags? */ + klass = DEVICE_GET_CLASS(self); - if(klass->property_get) - return (*klass->property_get)(self,id,val); - else - return FALSE; + g_assert(klass->property_get_ex); + return (klass->property_get_ex)(self, id, val, surety, source); } -gboolean -device_property_set (Device * self, DevicePropertyId id, GValue * val) +gboolean +device_property_set_ex( + Device * self, + DevicePropertyId id, + GValue * val, + PropertySurety surety, + PropertySource source) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); + DeviceClass *klass; - klass = DEVICE_GET_CLASS(self); + g_assert(IS_DEVICE (self)); - /* FIXME: Check access flags? */ + klass = DEVICE_GET_CLASS(self); - if(klass->property_set) - return (*klass->property_set)(self,id,val); - else - return FALSE; + g_assert(klass->property_set_ex); + return (klass->property_set_ex)(self, id, val, surety, source); } gboolean device_recycle_file (Device * self, guint filenum) { - DeviceClass *klass; - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (IS_DEVICE (self), FALSE); - g_return_val_if_fail (self->access_mode == ACCESS_APPEND, FALSE); + DeviceClass *klass; - klass = DEVICE_GET_CLASS(self); + g_assert(self != NULL); + g_assert(IS_DEVICE (self)); + g_assert(self->access_mode == ACCESS_APPEND); + g_assert(!self->in_file); + + klass = DEVICE_GET_CLASS(self); - if(klass->recycle_file) - return (*klass->recycle_file)(self,filenum); - else - return FALSE; + g_assert(klass->recycle_file); + return (klass->recycle_file)(self,filenum); } +/* Property handling */ + +void +device_class_register_property( + DeviceClass *klass, + DevicePropertyId id, + PropertyAccessFlags access, + PropertyGetFn getter, + PropertySetFn setter) +{ + DevicePropertyBase *base; + DeviceProperty *prop; + GSList *proplist; + guint i; + + g_assert(klass != NULL); + + base = device_property_get_by_id(id); + g_assert(base != NULL); + + if (klass->class_properties->len <= id) { + g_array_set_size(klass->class_properties, id+1); + } + + prop = &g_array_index(klass->class_properties, DeviceProperty, id); + prop->base = base; + prop->access = access; + prop->getter = getter; + prop->setter = setter; + + /* completely rewrite the list of prop pointers, as they may have changed, + * or we may have replaced an existing property*/ + + if (klass->class_properties_list) { + g_slist_free(klass->class_properties_list); + } + + proplist = NULL; + for (i = 0; i < klass->class_properties->len; i++) { + prop = &g_array_index(klass->class_properties, DeviceProperty, i); + if (!prop->base) + continue; + proplist = g_slist_prepend(proplist, prop); + } + + klass->class_properties_list = proplist; +} + +gboolean +device_set_simple_property( + Device *self, + DevicePropertyId id, + GValue *val, + PropertySurety surety, + PropertySource source) +{ + SimpleProperty *simp; + DeviceProperty *prop; + + prop = &g_array_index(DEVICE_GET_CLASS(self)->class_properties, + DeviceProperty, id); + + /* these assertions should already be checked, but let's be sure */ + g_assert(prop->base != NULL); /* prop must be registered with device */ + g_assert(G_VALUE_HOLDS(val, prop->base->type)); + + simp = g_new0(SimpleProperty, 1); + simp->prop = prop; + g_value_unset_copy(val, &(simp->response)); + simp->surety = surety; + simp->source = source; + + g_hash_table_insert(selfp->simple_properties, + GINT_TO_POINTER(id), + simp); + + return TRUE; +} + +gboolean +device_simple_property_set_fn( + Device *self, + DevicePropertyBase *base, + GValue *val, + PropertySurety surety, + PropertySource source) +{ + return device_set_simple_property(self, base->ID, val, surety, source); +} + +gboolean +device_get_simple_property( + Device *self, + DevicePropertyId id, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + SimpleProperty *simp = + g_hash_table_lookup(selfp->simple_properties, + GINT_TO_POINTER(id)); + + if (!simp) + return FALSE; + + if (val) + g_value_unset_copy(&(simp->response), val); + + if (surety) + *surety = simp->surety; + + if (source) + *source = simp->source; + + return TRUE; +} + +gboolean +device_simple_property_get_fn( + Device *self, + DevicePropertyBase *base, + GValue *val, + PropertySurety *surety, + PropertySource *source) +{ + return device_get_simple_property(self, base->ID, val, surety, source); +} diff --git a/device-src/device.h b/device-src/device.h index 262be39..0230970 100644 --- a/device-src/device.h +++ b/device-src/device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* The Device API abstracts device workings, interaction, properties, and @@ -52,135 +52,237 @@ typedef enum { /* * Type checking and casting macros */ +GType device_get_type (void); #define TYPE_DEVICE (device_get_type()) #define DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device) #define DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), device_get_type(), Device const) #define DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), device_get_type(), DeviceClass) #define IS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), device_get_type ()) - #define DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), device_get_type(), DeviceClass) typedef struct DevicePrivate_s DevicePrivate; +/* This structure is a Flags (bitwise OR of values). Zero indicates success; + * any other value indicates some kind of problem reading the label. If + * multiple bits are set, it does not necessarily indicate that /all/ of + * the specified issues occured, but rather that /at least one/ did. */ +typedef enum { + /* When changing, Also update device_status_flags_values in + * device-src/device.c and perl/Amanda/Device.swg */ + DEVICE_STATUS_SUCCESS = 0, + + /* The device is in an unresolvable error state, and + * further retries are unlikely to change the status */ + DEVICE_STATUS_DEVICE_ERROR = (1 << 0), + + /* The device is in use, and should be retried later */ + DEVICE_STATUS_DEVICE_BUSY = (1 << 1), + + /* The device itself is OK, but has no media loaded. This + * may change if media is loaded by the user or a changer */ + DEVICE_STATUS_VOLUME_MISSING = (1 << 2), + + /* The device is OK and media is laoded, but there is + * no Amanda header or an invalid header on the media. */ + DEVICE_STATUS_VOLUME_UNLABELED = (1 << 3), + + /* The device is OK, but there was an unresolvable error + * loading the header from the media, so subsequent reads + * or writes will probably fail. */ + DEVICE_STATUS_VOLUME_ERROR = (1 << 4), + + DEVICE_STATUS_FLAGS_MAX = (1 << 5) +} DeviceStatusFlags; + +#define DEVICE_STATUS_FLAGS_MASK (DEVICE_STATUS_MAX-1) +#define DEVICE_STATUS_FLAGS_TYPE (device_status_flags_get_type()) +GType device_status_flags_get_type(void); + /* * Main object structure */ -typedef struct { +typedef struct Device { GObject __parent__; /* You can peek at the stuff below, but only subclasses should change these values.*/ - /* What file, block are we at? (and are we in the middle of a - * file?) This is automatically updated by - * the default implementations of start_file, finish_file, - * write_block, read_block, seek_file, and seek_block. */ + /* What file, block are we at? (and are we in the middle of a * file?) */ int file; guint64 block; gboolean in_file; - /* Holds the user-specified device name. */ + + /* Holds the user-specified device name, which may be an alias */ char * device_name; - /* Holds the user-specified access-mode. */ + + /* Holds the user-specified access-mode, or ACCESS_NULL if the device + * has not yet been started*/ DeviceAccessMode access_mode; + /* In reading mode, FALSE unless all the data from the current file - * was successfully read. */ + * was successfully read. In writing mode, TRUE if the end of tape + * has been reached. */ gboolean is_eof; + /* Holds the label and time of the currently-inserted volume, * or NULL if it has not been read/written yet. */ char * volume_label; char * volume_time; + /* The most recently read volume header, or NULL if no header was + * read from this device. Callers can use this to glean information + * about the volume beyond volume_label and volume_time. */ + dumpfile_t *volume_header; + + /* The latest status for the device */ + DeviceStatusFlags status; + + /* device block-size ranges. These are also available as properties, + * and by default users can set block_size via property BLOCK_SIZE. + * Writers should use block_size, and readers should initially use + * block_size, and expand buffers as directed by read_block. */ + gsize min_block_size; + gsize max_block_size; + gsize block_size; + + /* surety and source for the block size; if you set block_size directly, + * set these, too! */ + PropertySurety block_size_surety; + PropertySource block_size_source; + DevicePrivate * private; } Device; -/* Pointer to factory function for device types. The factory functions - take control of their arguments, which should be dynamically - allocated. The factory should call open_device() with this - device_name. */ -typedef Device* (*DeviceFactory)(char * device_type, - char * device_name); +/* Pointer to factory function for device types. + * + * device_name is the full name ("tape:/dev/nst0") + * device_prefix is the prefix ("tape") + * device_node is what follows the prefix ("/dev/nst0") + * + * The caller retains responsibility to free or otherwise handle + * the passed strings. + */ +typedef Device* (*DeviceFactory)(char *device_name, + char * device_prefix, + char * device_node); /* This function registers a new device with the allocation system. * Call it after you register your type with the GLib type system. - * This function takes ownership of the strings inside device_prefix_list, - * but not the device_prefix_list itself. */ + * This function assumes that the strings in device_prefix_list are + * statically allocated. */ extern void register_device(DeviceFactory factory, const char ** device_prefix_list); -/* This structure is a Flags (bitwise OR of values). Zero indicates success; - * any other value indicates some kind of problem reading the label. If - * multiple bits are set, it does not necessarily indicate that /all/ of - * the specified issues occured, but rather that /at least one/ did. */ -typedef enum { - /* When changing, Also update read_label_status_flags_values in device.c */ - READ_LABEL_STATUS_SUCCESS = 0, - READ_LABEL_STATUS_DEVICE_MISSING = (1 << 0), - READ_LABEL_STATUS_DEVICE_ERROR = (1 << 1), - READ_LABEL_STATUS_VOLUME_MISSING = (1 << 2), - READ_LABEL_STATUS_VOLUME_UNLABELED = (1 << 3), - READ_LABEL_STATUS_VOLUME_ERROR = (1 << 4), - READ_LABEL_STATUS_FLAGS_MAX = (1 << 5) -} ReadLabelStatusFlags; - -#define READ_LABEL_STATUS_FLAGS_MASK (READ_LABEL_STATUS_MAX-1) -#define READ_LABEL_STATUS_FLAGS_TYPE (read_label_status_flags_get_type()) -GType read_label_status_flags_get_type(void); - /* * Class definition */ typedef struct _DeviceClass DeviceClass; struct _DeviceClass { GObjectClass __parent__; - gboolean (* open_device) (Device * self, - char * device_name); /* protected */ - ReadLabelStatusFlags (* read_label)(Device * self); + void (* open_device) (Device * self, char * device_name, + char * device_prefix, char * device_node); + gboolean (* configure) (Device * self, gboolean use_global_config); + DeviceStatusFlags (* read_label)(Device * self); gboolean (* start) (Device * self, DeviceAccessMode mode, char * label, char * timestamp); - gboolean (* start_file) (Device * self, const dumpfile_t * info); - gboolean (* write_block) (Device * self, guint size, gpointer data, - gboolean last_block); - gboolean (* write_from_fd) (Device * self, int fd); + gboolean (* start_file) (Device * self, dumpfile_t * info); + gboolean (* write_block) (Device * self, guint size, gpointer data); + gboolean (* write_from_fd) (Device * self, queue_fd_t *queue_fd); gboolean (* finish_file) (Device * self); dumpfile_t* (* seek_file) (Device * self, guint file); gboolean (* seek_block) (Device * self, guint64 block); int (* read_block) (Device * self, gpointer buf, int * size); - gboolean (* read_to_fd) (Device * self, int fd); - gboolean (* property_get) (Device * self, DevicePropertyId id, - GValue * val); - gboolean (* property_set) (Device * self, DevicePropertyId id, - GValue * val); + gboolean (* read_to_fd) (Device * self, queue_fd_t *queue_fd); + gboolean (* property_get_ex) (Device * self, DevicePropertyId id, + GValue * val, + PropertySurety *surety, + PropertySource *source); + gboolean (* property_set_ex) (Device * self, + DevicePropertyId id, + GValue * val, + PropertySurety surety, + PropertySource source); gboolean (* recycle_file) (Device * self, guint filenum); gboolean (* finish) (Device * self); + + /* array of DeviceProperty objects for this class, keyed by ID */ + GArray *class_properties; + + /* The return value of device_property_get_list */ + GSList * class_properties_list; }; +/* + * Device Instantiation + */ + +/* This is how you get a new Device. Pass in a device name or alias. + * + * A Device is *always* returned, even for an invalid device name. You + * must check the resulting device->status to know if the device is valid + * to be used. If device->status is not DEVICE_STATUS_SUCCESS, then there + * was an error opening the device. + * + * Note that the Amanda configuration must be initialized, as this function + * looks for device definitions and other configuration information. + */ +Device* device_open (char * device_name); + +/* Once you have a new device, you should configure it. This sets properties + * on the device based on the user's configuation. If USE_GLOBAL_CONFIG is + * true, then any global device_property parameters are processed, along with + * tapetype and othe relevant parameters. + */ +gboolean device_configure(Device *self, gboolean use_global_config); /* - * Public methods + * Error Handling + */ + +/* return the error message or the string "Unknown Device error". The + * string remains the responsibility of the Device, and should not + * be freed by the caller. */ +char *device_error(Device * self); + +/* return a string version of the status. The string remains the + * responsibility of the Device, and should not be freed by the + * caller. */ +char *device_status_error(Device * self); + +/* Return errmsg if it is set or a string version of the status. The + * string remains the responsibility of the Device, and should not + * be freed by the caller. */ +char *device_error_or_status(Device * self); + +/* Set the error message for this device; for use internally to the + * API. The string becomes the responsibility of the Device. If + * ERRMSG is NULL, the message is cleared. Note that the given flags + * are OR'd with any existing status flags. */ +void device_set_error(Device * self, char *errmsg, DeviceStatusFlags new_flags); + +/* Mostly for internal use, this is a boolean check to see whether a given + * device is in an error state. If this is TRUE, most operations on the + * device will fail. * - * Note to implementors: The default implementation of many of these - * methods does not follow the documentation. For example, the default - * implementation of device_read_block will always return -1, but - * nonetheless update the block index in the Device structure. In - * general, it is OK to chain up to the default implmentation after - * successfully implementing whatever appears below. The particulars - * of what the default implementations do is documented in device.c. + * The check is for DEVICE_STATUS_DEVICE_ERROR *alone*; if any other bits + * (e.g., VOLUME_UNLABELED) are set, then the device may not actually be in + * an error state. */ -GType device_get_type (void); +#define device_in_error(dev) \ + ((DEVICE(dev))->status == DEVICE_STATUS_DEVICE_ERROR) -/* This is how you get a new Device. Pass in a device name like - * file:/path/to/storage, and (assuming everything goes OK) you will get - * back a nice happy Device* that you can do operations on. Note that you - * must device_start() it before you can do anything besides talk about - * properties or read the label. device_name remains the responsibility - * of the caller. */ -Device* device_open (char * device_name); +/* + * Public methods + */ -/* This instructs the device to read the label on the current - * volume. device->volume_label will not be initalized until after this - * is called. You are encouraged to read the label only after setting any - * properties that may affect the label-reading process. */ -ReadLabelStatusFlags device_read_label (Device * self); +/* This instructs the device to read the label on the current volume. + * device->volume_label will not be initalized until read_label or start is + * called. You are encouraged to read the label only after setting any + * properties that may affect the label-reading process. Also, after + * calling this function, device->volume_label and device->volume_time + * will be non-NULL if and only if this function returns + * DEVICE_STATUS_SUCCESS. */ +DeviceStatusFlags device_read_label (Device * self); /* This tells the Device that it's OK to start reading and writing * data. Before you call this, you can only call @@ -190,56 +292,47 @@ ReadLabelStatusFlags device_read_label (Device * self); * You should pass a label and timestamp if and only if you are * opening in WRITE mode (not READ or APPEND). The label and timestamp * remain the caller's responsibility in terms of memory management. The - * passed timestamp may be NULL, in which case it will be filled in with - * the current time. */ + * passed timestamp may be NULL, in which case it will be filled in with + * the current time. + * + * Note that implementations need not calculate a the current time: the + * dispatch function does it for you. */ gboolean device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); /* This undoes device_start, returning you to the NULL state. Do this * if you want to (for example) change access mode. - * + * * Note to subclass implementors: Call this function first from your * finalization function. */ gboolean device_finish (Device * self); -/* But you can't write any data until you call this function, too. - * This function does not take ownership of the passed dumpfile_t; you must - * free it yourself. */ +/* But you can't write any data until you call this function, too. This + * function does not take ownership of the passed dumpfile_t; you must free it + * yourself. Note that this function *does* set the blocksize field of the + * header properly, based on the size of the header block. */ gboolean device_start_file (Device * self, - const dumpfile_t * jobInfo); - -guint device_write_min_size (Device * self); -guint device_write_max_size (Device * self); -guint device_read_max_size (Device * self); + dumpfile_t * jobInfo); -/* Does what you expect. size had better be inside the block size - * range, or this function will write nothing. - * - * The short_block parameter needs some additional explanation: If - * short_block is set to TRUE, then this function will accept a write - * smaller than the minimum block size, subject to the following - * caveats: - * % The block may be padded with NULL bytes, which will be present on - * restore. - * % device_write_block will automatically call device_finish_file() - * after writing this short block. - * It is permitted to use short_block with a block that is not short; - * in this case, it is equivalent to calling device_write() and then - * calling device_finish_file(). */ +/* Does what you expect. Size must be device->block_size or less. + * If less, then this is the final block in the file, and no more blocks + * may be written until finish_file and start_file have been called. */ gboolean device_write_block (Device * self, guint size, - gpointer data, - gboolean short_block); + gpointer data); /* This will drain the given fd (reading until EOF), and write the - * resulting data out to the device using maximally-sized blocks. */ + * resulting data out to the device using maximally-sized blocks. + * This function does not call device_finish_file automatically. + */ gboolean device_write_from_fd (Device * self, - int fd); + queue_fd_t *queue_fd); -/* Call this when you are finished writing a file. This function will - * write a filemark or the local equivalent, flush the buffers, and do - * whatever dirty work needs to be done at such a point in time. */ +/* Call this when you are finished writing a file. + * This function will write a filemark or the local + * equivalent, flush the buffers, and do whatever dirty work needs + * to be done at such a point in time. */ gboolean device_finish_file (Device * self); /* For reading only: Seeks to the beginning of a particular @@ -247,10 +340,11 @@ gboolean device_finish_file (Device * self); * ACCESS_WRITE will start you out at the first file, and opening in * ACCESS_APPEND will automatically seek to the end of the medium. * - * If the requested file doesn't exist, this function will seek to the - * next-numbered valid file. You can check where this function seeked to - * by examining the file field of the Device structure. If the requested - * file number is exactly one more than the last valid file, this + * If the requested file doesn't exist, as might happen when a volume has + * had files recycled, then this function will seek to the next file that + * does exist. You can check which file this function selected by + * examining the file field of the Device structure. If the requested + * file number is *exactly* one more than the last valid file, this * function returns a TAPEEND header. * * If an error occurs or if the requested file is two or more beyond the @@ -282,39 +376,53 @@ gboolean device_seek_block (Device * self, * no read is performed, the function returns 0, and *size is set * to the minimum buffer size required to read the next block. If an * error occurs, the function returns -1 and *size is left unchanged. - * - * It is not an error if buffer == NULL and *size == 0. This should be - * treated as a query as to the possible size of the next block. */ -int device_read_block (Device * self, - gpointer buffer, - int * size); + * + * Note that this function may request a block size bigger than + * dev->block_size, if it discovers an oversized block. This allows Amanda to + * read from volumes regardless of the block size used to write them. It is not + * an error if buffer == NULL and *size == 0. This should be treated as a query + * as to the possible size of the next block, although it is not an error for + * the next read to request an even larger block size. */ +int device_read_block (Device * self, gpointer buffer, int * size); /* This is the reading equivalent of device_write_from_fd(). It will * read from the device from the current location until end of file, * and drains the results out into the specified fd. Returns FALSE if * there is a problem writing to the fd. */ gboolean device_read_to_fd (Device * self, - int fd); + queue_fd_t *queue_fd); -/* This function tells you what properties are supported by this - * device, and when you are allowed to get and set them. The return - * value is an array of DeviceProperty structs. The last struct in - * the array is zeroed, so you know when the end is (check the - * pointer element "base"). The return value from this function on any - * given object (or physical device) should be invariant. */ -const DeviceProperty * device_property_get_list (Device * self); +/* This function tells you what properties are supported by this device, and + * when you are allowed to get and set them. The return value is an list of + * DeviceProperty structs. Do not free the resulting list. */ +const GSList * device_property_get_list (Device * self); /* These functions get or set a particular property. The val should be * compatible with the DevicePropertyBase associated with the given - * DevicePropertyId, and this function should only be called when - * DeviceProperty.access says it is OK. Otherwise you will get an - * error and not the tasty property action you wanted. */ -gboolean device_property_get (Device * self, + * DevicePropertyId, and these functions should only be called when + * DeviceProperty.access says it is OK. Otherwise you will get an error and not + * the tasty property action you wanted. + * + * All device_property_get_ex parameters but the first two are output + * parameters, and can be left NULL if you are not interested in their value. + * If you only need the value, use the simpler device_property_get macro. */ + +gboolean device_property_get_ex (Device * self, DevicePropertyId id, - GValue * val); -gboolean device_property_set (Device * self, + GValue * val, + PropertySurety *surety, + PropertySource *source); +#define device_property_get(self, id, val) \ + device_property_get_ex((self), (id), (val), NULL, NULL) + +gboolean device_property_set_ex (Device * self, DevicePropertyId id, - GValue * val); + GValue * val, + PropertySurety surety, + PropertySource source); +#define device_property_set(self, id, val) \ + device_property_set_ex((self), (id), (val), \ + PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_USER) /* On devices that support it (check PROPERTY_PARTIAL_DELETION), * this will free only the space associated with a particular file. @@ -332,28 +440,12 @@ gboolean device_recycle_file (Device * self, /* Protected methods. Don't call these except in subclass implementations. */ -/* Registers a new device / property pair. Every superclass of Device - * should call this in its init() function. At the moment, any - * particular property Id can only be registered once per object. - * - * If you want to register a standard response to a property (e.g., - * whether or not the device supports compression), you can pass a - * non-NULL response. Then the default implementation of - * device_get_property (which you may override) will return this - * response. - * The contents of prop and response are copied into a private array, so the - * calling function retains ownership of all arguments. - */ -void device_add_property(Device * self, DeviceProperty * prop, - GValue * response); - /* This method provides post-construction initalization once the * device name is known. It should only be used by Device * factories. It is provided here as a virtual method (instead of * a static function) because some devices may want to chain * initilization to their parents. */ -gboolean device_open_device (Device * self, - char * device_name); +void device_open_device (Device * self, char *device_name, char *device_type, char *device_node); /* Builds a proper header based on device block size possibilities. * If non-null, size is filled in with the number of bytes that should @@ -371,13 +463,54 @@ dumpfile_t * make_tapestart_header(Device * self, char * label, /* Does what you expect. Uses the current time. */ dumpfile_t * make_tapeend_header(void); -/* Set up first-run properties from loaded configuration file, including - * DEVICE_MAX_VOLUME_USAGE property based on the tapetype. */ -void device_set_startup_properties_from_config(Device * device); - /* Erase any stored volume information. Use this if something happens (e.g., * a property is set) that voids previously-read volume details. * This function is a NOOP unless the device is in the NULL state. */ void device_clear_volume_details(Device * device); +/* Property Handling */ + +/* Registers a property for a new device class; device drivers' GClassInitFunc + * should call this function for each device-specific property of the class. + * If either getter or setter is NULL, then the corresponding operation will + * return FALSE. + * + * Note that this will replace any existing registration (e.g., from a parent + * class). + */ +void device_class_register_property(DeviceClass *klass, DevicePropertyId id, + PropertyAccessFlags access, + PropertyGetFn getter, + PropertySetFn setter); + +/* Set a 'simple' property on the device. This tucks the value away in the + * object, to be retrieved by device_simple_property_get_fn. This is most + * often used in GInstanceInit functions, but can be used at any time to set or + * change the value of a simple property */ +gboolean device_set_simple_property(Device *self, DevicePropertyId id, + GValue *val, PropertySurety surety, + PropertySource source); + +/* Get a simple property set with device_set_simple_property. This is a little + * bit quicker than calling device_property_get_ex(), and does not affect the + * device's error state. Returns FALSE if the property has not been set. + * Surety and source are output parameters and will be ignored if they are + * NULL. */ +gboolean device_get_simple_property(Device *self, DevicePropertyId id, + GValue *val, PropertySurety *surety, + PropertySource *source); + +/* A useful PropertySetFn. If your subclass also needs to intercept sets, for + * example to flush a cache or update a member variable, then write a stub + * function which "calls up" to this function. */ +gboolean device_simple_property_set_fn(Device *self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, + PropertySource source); + +/* A useful PropertyGetFn -- returns the value, source, and surety set with + * device_set_simple_property */ +gboolean device_simple_property_get_fn(Device *self, DevicePropertyBase *base, + GValue *val, PropertySurety *surety, + PropertySource *source); + #endif /* DEVICE_H */ diff --git a/device-src/null-device.c b/device-src/null-device.c index a6b1a02..eefa4ac 100644 --- a/device-src/null-device.c +++ b/device-src/null-device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,26 +14,61 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "device.h" -#include "null-device.h" #define NULL_DEVICE_MIN_BLOCK_SIZE (1) -#define NULL_DEVICE_MAX_BLOCK_SIZE SHRT_MAX +#define NULL_DEVICE_MAX_BLOCK_SIZE (INT_MAX) +#define NULL_DEVICE_DEFAULT_BLOCK_SIZE DISK_BLOCK_BYTES + +/* + * Type checking and casting macros + */ +#define TYPE_NULL_DEVICE (null_device_get_type()) +#define NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice) +#define NULL_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice const) +#define NULL_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), null_device_get_type(), NullDeviceClass) +#define IS_NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), null_device_get_type ()) +#define NULL_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), null_device_get_type(), NullDeviceClass) +static GType null_device_get_type (void); + +/* + * Main object structure + */ +typedef struct _NullDevice NullDevice; +struct _NullDevice { + Device __parent__; +}; + +/* + * Class definition + */ +typedef struct _NullDeviceClass NullDeviceClass; +struct _NullDeviceClass { + DeviceClass __parent__; + gboolean in_file; +}; + +void null_device_register(void); /* here are local prototypes */ static void null_device_init (NullDevice * o); static void null_device_class_init (NullDeviceClass * c); +static void null_device_base_init (NullDeviceClass * c); +static DeviceStatusFlags null_device_read_label(Device * dself); +static void null_device_open_device(Device * self, char *device_name, + char * device_type, char * device_node); static gboolean null_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); -static gboolean null_device_write_block (Device * self, guint size, - gpointer data, gboolean last); -static Device* null_device_factory(char * device_type, - char * device_name); +static gboolean null_device_finish (Device * pself); +static gboolean null_device_start_file(Device * self, dumpfile_t * jobInfo); +static gboolean null_device_write_block (Device * self, guint size, gpointer data); +static gboolean null_device_finish_file(Device * self); +static Device* null_device_factory(char * device_name, char * device_type, char * device_node); /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; @@ -43,7 +78,7 @@ void null_device_register(void) { register_device(null_device_factory, device_prefix_list); } -GType +static GType null_device_get_type (void) { static GType type = 0; @@ -51,7 +86,7 @@ null_device_get_type (void) if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (NullDeviceClass), - (GBaseInitFunc) NULL, + (GBaseInitFunc) null_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) null_device_class_init, (GClassFinalizeFunc) NULL, @@ -72,124 +107,178 @@ null_device_get_type (void) static void null_device_init (NullDevice * self) { - Device * o; - DeviceProperty prop; + Device * dself; GValue response; - o = (Device*)(self); + dself = (Device*)(self); bzero(&response, sizeof(response)); /* Register properties */ - prop.base = &device_property_concurrency; - prop.access = PROPERTY_ACCESS_GET_MASK; g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_CONCURRENCY, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - - prop.base = &device_property_streaming; g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); - device_add_property(o, &prop, &response); - g_value_unset(&response); - - prop.base = &device_property_block_size; - g_value_init(&response, G_TYPE_INT); - g_value_set_int(&response, -1); - device_add_property(o, &prop, &response); - g_value_unset(&response); - - prop.base = &device_property_min_block_size; - g_value_init(&response, G_TYPE_UINT); - g_value_set_uint(&response, NULL_DEVICE_MIN_BLOCK_SIZE); - device_add_property(o, &prop, &response); - - prop.base = &device_property_max_block_size; - g_value_set_uint(&response, NULL_DEVICE_MAX_BLOCK_SIZE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_STREAMING, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_appendable; g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_APPENDABLE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); + g_value_unset(&response); - prop.base = &device_property_partial_deletion; - device_add_property(o, &prop, &response); + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, FALSE); + device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_canonical_name; + /* this device's canonical name is always "null:", regardless of + * the name the user supplies; note that we install the simple + * getter in null_device_class_init. */ g_value_init(&response, G_TYPE_STRING); g_value_set_static_string(&response, "null:"); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_CANONICAL_NAME, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); g_value_unset(&response); - prop.base = &device_property_medium_access_type; g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_WRITE_ONLY); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); } static void -null_device_class_init (NullDeviceClass * c G_GNUC_UNUSED) +null_device_class_init (NullDeviceClass * c) { DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); + device_class->read_label = null_device_read_label; + device_class->open_device = null_device_open_device; device_class->start = null_device_start; + device_class->finish = null_device_finish; + device_class->start_file = null_device_start_file; device_class->write_block = null_device_write_block; + device_class->finish_file = null_device_finish_file; } +static void +null_device_base_init (NullDeviceClass * c) +{ + DeviceClass *device_class = (DeviceClass *)c; -static Device* null_device_factory(char * device_type, - char * device_name G_GNUC_UNUSED) { + /* Our canonical name is simpler than most devices' */ + device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + device_simple_property_set_fn); +} + + +static Device* null_device_factory(char * device_name, char * device_type, char * device_node) { + Device * device; g_assert(0 == strcmp(device_type, "null")); - return DEVICE(g_object_new(TYPE_NULL_DEVICE, NULL)); - + device = DEVICE(g_object_new(TYPE_NULL_DEVICE, NULL)); + device_open_device(device, device_name, device_type, device_node); + return device; } /* Begin virtual function overrides */ -static gboolean +static DeviceStatusFlags +null_device_read_label(Device * dself) { + if (device_in_error(dself)) return FALSE; + + device_set_error(dself, + stralloc(_("Can't open NULL device for reading or appending.")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; +} + +static void +null_device_open_device(Device * pself, char *device_name, + char * device_type, char * device_node) +{ + pself->min_block_size = NULL_DEVICE_MIN_BLOCK_SIZE; + pself->max_block_size = NULL_DEVICE_MAX_BLOCK_SIZE; + pself->block_size = NULL_DEVICE_DEFAULT_BLOCK_SIZE; + + if (parent_class->open_device) { + parent_class->open_device(pself, device_name, device_type, device_node); + } +} + +static gboolean null_device_start (Device * pself, DeviceAccessMode mode, char * label, char * timestamp) { NullDevice * self; self = NULL_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); + + if (device_in_error(self)) return FALSE; + + pself->access_mode = mode; + pself->in_file = FALSE; if (mode == ACCESS_WRITE) { - if (parent_class->start) { - return parent_class->start((Device*)self, mode, label, timestamp); - } else { - return TRUE; - } + pself->volume_label = newstralloc(pself->volume_label, label); + pself->volume_time = newstralloc(pself->volume_time, timestamp); + return TRUE; } else { - g_fprintf(stderr, "Can't open NULL device for reading or appending.\n"); + device_set_error(pself, + stralloc(_("Can't open NULL device for reading or appending.")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } +/* This default implementation does very little. */ static gboolean -null_device_write_block (Device * pself, guint size, gpointer data, - gboolean last_block) { +null_device_finish (Device * pself) { + if (device_in_error(pself)) return FALSE; + + pself->access_mode = ACCESS_NULL; + return TRUE; +} + +static gboolean +null_device_start_file(Device * d_self, + dumpfile_t * jobInfo G_GNUC_UNUSED) +{ + d_self->in_file = TRUE; + d_self->block = 0; + if (d_self->file <= 0) + d_self->file = 1; + else + d_self->file ++; + + return TRUE; +} + +static gboolean +null_device_write_block (Device * pself, guint size G_GNUC_UNUSED, + gpointer data G_GNUC_UNUSED) { NullDevice * self; self = NULL_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (data != NULL, FALSE); - - if ((size < NULL_DEVICE_MIN_BLOCK_SIZE && !last_block) || - size > NULL_DEVICE_MAX_BLOCK_SIZE) { - return FALSE; - } else { - if (parent_class->write_block) { - /* Calls device_finish_file(). */ - parent_class->write_block((Device*)self, size, data, last_block); - } - return TRUE; - } - g_assert_not_reached(); + if (device_in_error(self)) return FALSE; + + pself->block++; + + return TRUE; +} + +static gboolean +null_device_finish_file(Device * pself) { + if (device_in_error(pself)) return FALSE; + + pself->in_file = FALSE; + return TRUE; } diff --git a/device-src/null-device.h b/device-src/null-device.h deleted file mode 100644 index b68a824..0000000 --- a/device-src/null-device.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -/* The NULL device accepts data and sends it to the bit bucket. Like - /dev/null, you cannot read from the NULL device -- only - write. While useful for testing, the NULL device is incredibly - dangerous in practice (because it eats your data). So it will - generate warnings whenever you use it. */ - -#include -#include -#ifndef __NULL_DEVICE_H__ -#define __NULL_DEVICE_H__ - -/* This header file is very boring, because the class just overrides - existing methods. */ - -/* - * Type checking and casting macros - */ -#define TYPE_NULL_DEVICE (null_device_get_type()) -#define NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice) -#define NULL_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), null_device_get_type(), NullDevice const) -#define NULL_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), null_device_get_type(), NullDeviceClass) -#define IS_NULL_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), null_device_get_type ()) - -#define NULL_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), null_device_get_type(), NullDeviceClass) - -/* - * Main object structure - */ -#ifndef __TYPEDEF_NULL_DEVICE__ -#define __TYPEDEF_NULL_DEVICE__ -typedef struct _NullDevice NullDevice; -#endif -struct _NullDevice { - Device __parent__; -}; - -/* - * Class definition - */ -typedef struct _NullDeviceClass NullDeviceClass; -struct _NullDeviceClass { - DeviceClass __parent__; - gboolean in_file; -}; - - -/* - * Public methods - */ -GType null_device_get_type (void); -void null_device_register (void); - -#endif diff --git a/device-src/property.c b/device-src/property.c index 3980a3f..275cc80 100644 --- a/device-src/property.c +++ b/device-src/property.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,13 +14,18 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #include "amanda.h" #include "property.h" +#include "glib-util.h" + +/***** + * Property-specific Types, etc. + */ static const GEnumValue _concurrency_paradigm_values[] = { { CONCURRENCY_PARADIGM_EXCLUSIVE, @@ -93,7 +98,7 @@ GType media_access_mode_get_type (void) { /* Copy function for GBoxed QualifiedSize. */ static gpointer qualified_size_copy(gpointer source) { - gpointer rval = malloc(sizeof(QualifiedSize)); + gpointer rval = g_new(QualifiedSize, 1); memcpy(rval, source, sizeof(QualifiedSize)); return rval; } @@ -108,122 +113,98 @@ GType qualified_size_get_type (void) { return type; } -static const GFlagsValue _feature_support_flags_values[] = { - { FEATURE_STATUS_ENABLED, - "FEATURE_STATUS_ENABLED", - "enabled" }, - { FEATURE_STATUS_DISABLED, - "FEATURE_STATUS_DISABLED", - "disabled" }, - { FEATURE_SURETY_BAD, - "FEATURE_SURETY_BAD", - "bad" }, - { FEATURE_SURETY_GOOD, - "FEATURE_SURETY_GOOD", - "good" }, - { FEATURE_SOURCE_DEFAULT, - "FEATURE_SOURCE_DEFAULT", - "default" }, - { FEATURE_SOURCE_DETECTED, - "FEATURE_SOURCE_DETECTED", - "detected" }, - { FEATURE_SOURCE_USER, - "FEATURE_SOURCE_USER", - "user"}, - { 0, NULL, NULL } -}; +/****** + * Property registration and lookup + */ -GType feature_support_get_type (void) { - static GType type = 0; - if (G_UNLIKELY(type == 0)) { - type = g_flags_register_static ("FeatureSupportFlags", - _feature_support_flags_values); - } - return type; -} +static GPtrArray *device_property_bases = NULL; +static GHashTable *device_property_bases_by_name = NULL; -gboolean feature_support_flags_is_valid(FeatureSupportFlags f) { - int status = 0, surety = 0, source = 0; - - if (f & FEATURE_STATUS_ENABLED) - status ++; - if (f & FEATURE_STATUS_DISABLED) - status ++; - if (f & FEATURE_SURETY_BAD) - surety ++; - if (f & FEATURE_SURETY_GOOD) - surety ++; - if (f & FEATURE_SOURCE_DEFAULT) - source ++; - if (f & FEATURE_SOURCE_DETECTED) - source ++; - if (f & FEATURE_SOURCE_USER) - source ++; - - return (!(f & ~FEATURE_SUPPORT_FLAGS_MASK) && - status == 1 && surety == 1 && source == 1); +DevicePropertyBase* device_property_get_by_id(DevicePropertyId id) { + if (!device_property_bases || id >= device_property_bases->len) + return NULL; + + return g_ptr_array_index(device_property_bases, id); } -static GSList* device_property_base_list = NULL; +DevicePropertyBase* device_property_get_by_name(const char *name) { + gpointer rv; -const DevicePropertyBase* device_property_get_by_id(DevicePropertyId id) { - GSList *iter; + if (!device_property_bases_by_name) + return NULL; - iter = device_property_base_list; - while (iter != NULL) { - DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data); - if (rval->ID == id) { - return rval; - } - iter = g_slist_next(iter); - } + rv = g_hash_table_lookup(device_property_bases_by_name, name); + if (rv) + return (DevicePropertyBase *)rv; return NULL; } -const DevicePropertyBase* device_property_get_by_name(const char *name) { - GSList *iter = device_property_base_list; +#define toupper_and_underscore(c) (((c)=='-')? '_' : g_ascii_toupper((c))) +static guint +device_property_hash( + gconstpointer key) +{ + /* modified version of glib's hash function, copyright + * GLib Team and others 1997-2000. */ + const char *p = key; + guint h = toupper_and_underscore(*p); + + if (h) + for (p += 1; *p != '\0'; p++) + h = (h << 5) - h + toupper_and_underscore(*p); + + return h; +} - g_return_val_if_fail(name != NULL, NULL); +static gboolean +device_property_equal( + gconstpointer v1, + gconstpointer v2) +{ + const char *s1 = v1, *s2 = v2; - while (iter != NULL) { - DevicePropertyBase* rval = (DevicePropertyBase*)(iter->data); - if (strcasecmp(rval->name, name) == 0) { - return rval; - } - iter = g_slist_next(iter); + while (*s1 && *s2) { + if (toupper_and_underscore(*s1) != toupper_and_underscore(*s2)) + return FALSE; + s1++, s2++; } + if (*s1 || *s2) + return FALSE; - return NULL; + return TRUE; } -DevicePropertyId device_property_register(DevicePropertyBase* base) { - static guint id = 0; - g_assert(base != NULL); - g_assert(base->ID == -1); - g_assert(base->name != NULL); - g_assert(base->description != NULL); - - base->ID = id++; - - device_property_base_list = g_slist_prepend(device_property_base_list, - base); - return id; -} +void +device_property_fill_and_register(DevicePropertyBase *base, + GType type, const char * name, const char * desc) { + + /* create the hash table and array if necessary */ + if (!device_property_bases) { + device_property_bases = g_ptr_array_new(); + device_property_bases_by_name = g_hash_table_new(device_property_hash, device_property_equal); + } -/* Does the same thing, but fills in a new DevicePropertyBase. */ -static void -device_property_fill_and_register(DevicePropertyBase * base, - GType type, - const char * name, - const char * desc) { + /* check for a duplicate */ + if (device_property_get_by_name(name)) { + g_critical("A property named '%s' already exists!", name); + } + + /* allocate space for this DPB and fill it in */ + base->ID = device_property_bases->len; base->type = type; - base->name = name; - base->description = desc; - base->ID = -1; - device_property_register(base); + base->name = name; /* no strdup -- it's statically allocated */ + base->description = desc; /* ditto */ + + /* add it to the array and hash table; note that its array index and its + * ID are the same. */ + g_ptr_array_add(device_property_bases, base); + g_hash_table_insert(device_property_bases_by_name, (gpointer)name, (gpointer)base); } +/****** + * Initialization + */ void device_property_init(void) { device_property_fill_and_register(&device_property_concurrency, @@ -241,13 +222,16 @@ void device_property_init(void) { "averaged for some (currently undefined) period of time)"); device_property_fill_and_register(&device_property_block_size, G_TYPE_INT, "block_size", - "Device blocking factor in bytes."); + "Block size to use while writing."); device_property_fill_and_register(&device_property_min_block_size, G_TYPE_UINT, "min_block_size", "Minimum supported blocking factor."); device_property_fill_and_register(&device_property_max_block_size, G_TYPE_UINT, "max_block_size", "Maximum supported blocking factor."); + device_property_fill_and_register(&device_property_read_buffer_size, + G_TYPE_UINT, "read_buffer_size", + "Minimum size of a read for this device (maximum expected block size)"); device_property_fill_and_register(&device_property_appendable, G_TYPE_BOOLEAN, "appendable", "Does device support appending to previously-written media?"); @@ -267,43 +251,6 @@ void device_property_init(void) { device_property_fill_and_register(&device_property_max_volume_usage, G_TYPE_UINT64, "max_volume_usage", "Artificial limit to data written to volume."); - device_property_fill_and_register(&device_property_fsf, - FEATURE_SUPPORT_FLAGS_TYPE, "fsf", - "Does this drive support the MTFSF command?"); - device_property_fill_and_register(&device_property_bsf, - FEATURE_SUPPORT_FLAGS_TYPE, "bsf", - "Does this drive support the MTBSF command?" ); - device_property_fill_and_register(&device_property_fsr, - FEATURE_SUPPORT_FLAGS_TYPE, "fsr", - "Does this drive support the MTFSR command?"); - device_property_fill_and_register(&device_property_bsr, - FEATURE_SUPPORT_FLAGS_TYPE, "bsr", - "Does this drive support the MTBSR command?"); - /* FIXME: Is this feature even useful? */ - device_property_fill_and_register(&device_property_eom, - FEATURE_SUPPORT_FLAGS_TYPE, "eom", - "Does this drive support the MTEOM command?"); - device_property_fill_and_register(&device_property_bsf_after_eom, - FEATURE_SUPPORT_FLAGS_TYPE, - "bsf_after_eom", - "Does this drive require an MTBSF after MTEOM in order to append?" ); - device_property_fill_and_register(&device_property_final_filemarks, - G_TYPE_UINT, "final_filemarks", - "How many filemarks to write after the last tape file?" ); - device_property_fill_and_register(&device_property_read_buffer_size, - G_TYPE_UINT, "read_buffer_size", - "What buffer size should be used for reading?"); - device_property_fill_and_register(&device_property_s3_secret_key, - G_TYPE_STRING, "s3_secret_key", - "Secret access key to authenticate with Amazon S3"); - device_property_fill_and_register(&device_property_s3_access_key, - G_TYPE_STRING, "s3_access_key", - "Access key ID to authenticate with Amazon S3"); -#ifdef WANT_DEVPAY - device_property_fill_and_register(&device_property_s3_user_token, - G_TYPE_STRING, "s3_user_token", - "User token for authentication Amazon devpay requests"); -#endif device_property_fill_and_register(&device_property_verbose, G_TYPE_BOOLEAN, "verbose", "Should the device produce verbose output?"); @@ -316,21 +263,11 @@ DevicePropertyBase device_property_compression_rate; DevicePropertyBase device_property_block_size; DevicePropertyBase device_property_min_block_size; DevicePropertyBase device_property_max_block_size; +DevicePropertyBase device_property_read_buffer_size; DevicePropertyBase device_property_appendable; DevicePropertyBase device_property_canonical_name; DevicePropertyBase device_property_medium_access_type; DevicePropertyBase device_property_partial_deletion; DevicePropertyBase device_property_free_space; DevicePropertyBase device_property_max_volume_usage; -DevicePropertyBase device_property_fsf; -DevicePropertyBase device_property_bsf; -DevicePropertyBase device_property_fsr; -DevicePropertyBase device_property_bsr; -DevicePropertyBase device_property_eom; -DevicePropertyBase device_property_bsf_after_eom; -DevicePropertyBase device_property_final_filemarks; -DevicePropertyBase device_property_read_buffer_size; -DevicePropertyBase device_property_s3_access_key; -DevicePropertyBase device_property_s3_secret_key; -DevicePropertyBase device_property_s3_user_token; DevicePropertyBase device_property_verbose; diff --git a/device-src/property.h b/device-src/property.h index 8138a05..273f2de 100644 --- a/device-src/property.h +++ b/device-src/property.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #ifndef DEVICE_PROPERTY_H @@ -23,6 +23,7 @@ #include #include +#include "queueing.h" /* for StreamingRequirement */ /* The properties interface defines define capabilities and other interesting * properties. */ @@ -37,7 +38,7 @@ typedef enum { } PropertyPhaseFlags; #define PROPERTY_PHASE_MASK (PROPERTY_PHASE_MAX-1) -#define PROPERTY_PHASE_SHIFT (PROPERTY_PHASE_MASK/2) +#define PROPERTY_PHASE_SHIFT 8 typedef enum { PROPERTY_ACCESS_GET_BEFORE_START = (PROPERTY_PHASE_BEFORE_START), @@ -63,13 +64,37 @@ typedef enum { #define PROPERTY_ACCESS_GET_MASK (PROPERTY_PHASE_MASK) #define PROPERTY_ACCESS_SET_MASK (PROPERTY_PHASE_MASK << PROPERTY_PHASE_SHIFT) +/* Some properties can only be occasionally (or unreliably) detected, so + * this enum allows the user to override the detected or default + * setting. Surety indicates a level of confidence in the value, while + * source describes how we found out about it. */ +typedef enum { + /* Support is not based on conclusive evidence. */ + PROPERTY_SURETY_BAD, + /* Support is based on conclusive evidence. */ + PROPERTY_SURETY_GOOD, +} PropertySurety; -/* This structure is usually statically allocated. - * It holds information about a property that is common to all devices of - * a given type. */ +typedef enum { + /* property is from default setting. */ + PROPERTY_SOURCE_DEFAULT, + /* property is from device query. */ + PROPERTY_SOURCE_DETECTED, + /* property is from user override (configuration). */ + PROPERTY_SOURCE_USER, +} PropertySource; + +/***** + * Initialization + */ -typedef int DevicePropertyId; +/* This should be called exactly once from device_api_init(). */ +extern void device_property_init(void); +/* This structure is usually statically allocated. It holds information about + * a property that is common across all devices. + */ +typedef guint DevicePropertyId; typedef struct { DevicePropertyId ID; /* Set by device_property_register() */ GType type; @@ -77,24 +102,55 @@ typedef struct { const char *description; } DevicePropertyBase; -/* This structure is usually held inside a Device object. It holds - * information about a property that is specific to the device/medium - * in question. */ -typedef struct { - const DevicePropertyBase *base; - PropertyAccessFlags access; -} DeviceProperty; - /* Registers a new property and returns its ID. This function takes ownership - * of its argument; it must not be freed later. */ + * of its argument; it must not be freed later. It should be called from a + * device driver's registration function. */ extern DevicePropertyId device_property_register(DevicePropertyBase*); -/* This should be called exactly once from device_api_init(). */ -extern void device_property_init(void); +/* Does the same thing, but fills in a new DevicePropertyBase with the given + * values first, and does not return the ID. This is more convenient for + * device-specific properties. */ +extern void device_property_fill_and_register( + DevicePropertyBase * base, + GType type, + const char * name, + const char * desc); /* Gets a DevicePropertyBase from its ID. */ -extern const DevicePropertyBase* device_property_get_by_id(DevicePropertyId); -extern const DevicePropertyBase* device_property_get_by_name(const char*); +DevicePropertyBase* device_property_get_by_id(DevicePropertyId); +DevicePropertyBase* device_property_get_by_name(const char*); + +/***** + * Class-level Property Information + */ + +/* This structure is held inside a Device object. It holds information about a + * property that is specific to the device driver, but not to a specific + * instance of the driver. */ +struct Device; /* forward declaration */ +typedef gboolean (*PropertySetFn)( + struct Device *self, + DevicePropertyBase *base, + GValue *val, + PropertySurety surety, + PropertySource source); +typedef gboolean (*PropertyGetFn)( + struct Device *self, + DevicePropertyBase *base, + GValue *val, + PropertySurety *surety, + PropertySource *source); + +typedef struct { + DevicePropertyBase *base; + PropertyAccessFlags access; + PropertySetFn setter; + PropertyGetFn getter; +} DeviceProperty; + +/***** + * Property-specific Types, etc. + */ /* Standard property value types here. * Important: see property.c for the other half of type declarations.*/ @@ -106,11 +162,6 @@ typedef enum { #define CONCURRENCY_PARADIGM_TYPE concurrency_paradigm_get_type() GType concurrency_paradigm_get_type (void); -typedef enum { - STREAMING_REQUIREMENT_NONE, - STREAMING_REQUIREMENT_DESIRED, - STREAMING_REQUIREMENT_REQUIRED -} StreamingRequirement; #define STREAMING_REQUIREMENT_TYPE streaming_requirement_get_type() GType streaming_requirement_get_type (void); @@ -138,46 +189,6 @@ typedef struct { #define QUALIFIED_SIZE_TYPE qualified_size_get_type() GType qualified_size_get_type (void); -/* Some features can only be occasionally (or unreliably) detected, so - this enum allows the user to override the detected or default - setting. */ -typedef enum { - /* Feature support status. (exactly one of these is set) */ - /* Feature is supported & will be used */ - FEATURE_STATUS_ENABLED = (1 << 0), - /* Features will not be used. */ - FEATURE_STATUS_DISABLED = (1 << 1), - - /* Feature support confidence. (exactly one of these is set). */ - /* Support is not based on conclusive evidence. */ - FEATURE_SURETY_BAD = (1 << 2), - /* Support is based on conclusive evidence. */ - FEATURE_SURETY_GOOD = (1 << 3), - - /* Source of this information. (exactly one of these is set). */ - /* Source of status is from default setting. */ - FEATURE_SOURCE_DEFAULT = (1 << 4), - /* Source of status is from device query. */ - FEATURE_SOURCE_DETECTED = (1 << 5), - /* Source of status is from user override. */ - FEATURE_SOURCE_USER = (1 << 6), - - FEATURE_SUPPORT_FLAGS_MAX = (1 << 7) -} FeatureSupportFlags; - -#define FEATURE_SUPPORT_FLAGS_MASK (FEATURE_SUPPORT_FLAGS_MAX-1) -#define FEATURE_SUPPORT_FLAGS_STATUS_MASK (FEATURE_STATUS_ENABLED | \ - FEATURE_STATUS_DISABLED) -#define FEATURE_SUPPORT_FLAGS_SURETY_MASK (FEATURE_SURETY_BAD | \ - FEATURE_SURETY_GOOD) -#define FEATURE_SUPPORT_FLAGS_SOURCE_MASK (FEATURE_SOURCE_DEFAULT | \ - FEATURE_SOURCE_DETECTED | \ - FEATURE_SOURCE_USER) -/* Checks that mutually exclusive flags are not set. */ -gboolean feature_support_flags_is_valid(FeatureSupportFlags); -#define FEATURE_SUPPORT_FLAGS_TYPE feature_support_get_type() -GType feature_support_get_type (void); - /* Standard property definitions follow. See also property.c. */ /* Value is a ConcurrencyParadigm */ @@ -197,16 +208,22 @@ extern DevicePropertyBase device_property_compression; extern DevicePropertyBase device_property_compression_rate; #define PROPERTY_COMPRESSION_RATE (device_property_compression_rate.ID) -/* Value is a gint, where a negative number indicates variable block size. */ +/* Value is a gint; gives the write block size. */ extern DevicePropertyBase device_property_block_size; #define PROPERTY_BLOCK_SIZE (device_property_block_size.ID) -/* Value is a guint. */ +/* Read-only. Value is a guint. */ extern DevicePropertyBase device_property_min_block_size; extern DevicePropertyBase device_property_max_block_size; #define PROPERTY_MIN_BLOCK_SIZE (device_property_min_block_size.ID) #define PROPERTY_MAX_BLOCK_SIZE (device_property_max_block_size.ID) +/* Value is a guint; gives the minimum buffer size for reads. Only + * the tape device implements this, but it corresponds to the tapetype + * readblocksize parameter, so it's a global property*/ +extern DevicePropertyBase device_property_read_buffer_size; +#define PROPERTY_READ_BUFFER_SIZE (device_property_read_buffer_size.ID) + /* Value is a gboolean. */ extern DevicePropertyBase device_property_appendable; #define PROPERTY_APPENDABLE (device_property_appendable.ID) @@ -217,7 +234,7 @@ extern DevicePropertyBase device_property_canonical_name; /* Value is MediaAccessMode. */ extern DevicePropertyBase device_property_medium_access_type; -#define PROPERTY_MEDIUM_TYPE (device_property_medium_access_type.ID) +#define PROPERTY_MEDIUM_ACCESS_TYPE (device_property_medium_access_type.ID) /* Value is a gboolean. */ extern DevicePropertyBase device_property_partial_deletion; @@ -234,53 +251,8 @@ extern DevicePropertyBase device_property_free_space; extern DevicePropertyBase device_property_max_volume_usage; #define PROPERTY_MAX_VOLUME_USAGE (device_property_max_volume_usage.ID) -/* Tape device properties. These properties do not exist on non-linear - devices. All of them have a value type of FeatureSupportFlags. */ -extern DevicePropertyBase device_property_fsf; -#define PROPERTY_FSF (device_property_fsf.ID) - -extern DevicePropertyBase device_property_bsf; -#define PROPERTY_BSF (device_property_bsf.ID) - -extern DevicePropertyBase device_property_fsr; -#define PROPERTY_FSR (device_property_fsr.ID) - -extern DevicePropertyBase device_property_bsr; -#define PROPERTY_BSR (device_property_bsr.ID) - -/* Is EOM supported? Must be able to read file number afterwards as - well. */ -extern DevicePropertyBase device_property_eom; -#define PROPERTY_EOM (device_property_eom.ID) - -/* Is it necessary to perform a BSF after EOM? */ -extern DevicePropertyBase device_property_bsf_after_eom; -#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID) - -/* How many filemarks to write at EOD? (Default is 2). - * This property is a G_TYPE_UINT, but can only really be set to 1 or 2. */ -extern DevicePropertyBase device_property_final_filemarks; -#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID) - -/* What buffer size is used for reading? */ -extern DevicePropertyBase device_property_read_buffer_size; -#define PROPERTY_READ_BUFFER_SIZE (device_property_read_buffer_size.ID) - -/* Authentication information for Amazon S3. Both of these are strings. */ -extern DevicePropertyBase device_property_s3_secret_key; -extern DevicePropertyBase device_property_s3_access_key; -#define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID) -#define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID) - -#ifdef WANT_DEVPAY -/* Same, but for S3 with DevPay. This directory can be relative to the - * config director, or absolute. */ -extern DevicePropertyBase device_property_s3_user_token; -#define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID) -#endif - /* Should the device produce verbose output? Value is a gboolean. Not - * recognized by all devices. */ + * present in all devices. */ extern DevicePropertyBase device_property_verbose; #define PROPERTY_VERBOSE (device_property_verbose.ID) diff --git a/device-src/queueing.c b/device-src/queueing.c deleted file mode 100644 index 2ec0e8c..0000000 --- a/device-src/queueing.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -#include "queueing.h" -#include "device.h" -#include "semaphore.h" -#include "amanda.h" - -/* Queueing framework here. */ -typedef struct { - guint block_size; - ProducerFunctor producer; - gpointer producer_user_data; - ConsumerFunctor consumer; - gpointer consumer_user_data; - GAsyncQueue *data_queue, *free_queue; - semaphore_t *free_memory; - StreamingRequirement streaming_mode; -} queue_data_t; - -static queue_buffer_t *invent_buffer(void) { - queue_buffer_t *rval; - rval = malloc(sizeof(*rval)); - - rval->data = NULL; - rval->alloc_size = 0; - rval->data_size = 0; - rval->offset = 0; - - return rval; -} - -void free_buffer(queue_buffer_t *buf) { - if (buf != NULL) - amfree(buf->data); - amfree(buf); -} - -static queue_buffer_t * merge_buffers(queue_buffer_t *buf1, - queue_buffer_t *buf2) { - if (buf1 == NULL) - return buf2; - else if (buf2 == NULL) - return buf1; - - if (buf2->offset >= buf1->data_size) { - /* We can fit buf1 at the beginning of buf2. */ - memcpy(buf2->data + buf2->offset - buf1->data_size, - buf1->data + buf1->offset, - buf1->data_size); - buf2->offset -= buf1->data_size; - buf2->data_size += buf1->data_size; - free_buffer(buf1); - return buf2; - } else if (buf1->alloc_size - buf1->offset - buf1->data_size - >= buf2->data_size) { - /* We can fit buf2 at the end of buf1. */ - memcpy(buf1->data + buf1->offset + buf1->data_size, - buf2->data + buf2->offset, buf2->data_size); - buf1->data_size += buf2->data_size; - free_buffer(buf2); - return buf1; - } else { - /* We can grow buf1 and put everything there. */ - if (buf1->offset != 0) { - /* But first we have to fix up buf1. */ - memmove(buf1->data, buf1->data + buf1->offset, buf1->data_size); - buf1->offset = 0; - } - buf1->alloc_size = buf1->data_size + buf2->data_size; - buf1->data = realloc(buf1->data, buf1->alloc_size); - memcpy(buf1->data + buf1->data_size, buf2->data + buf2->offset, - buf2->data_size); - buf1->data_size = buf1->alloc_size; - free_buffer(buf2); - return buf1; - } -} - -/* Invalidate the first "bytes" bytes of the buffer, by adjusting the - offset and data size. */ -static void consume_buffer(queue_buffer_t* buf, int bytes) { - buf->offset += bytes; - buf->data_size -= bytes; -} - -/* Looks at the buffer to see how much free space it has. If it has more than - * twice the data size of unused space at the end, or more than four times - * the data size of unused space at the beginning, then that space is - * reclaimed. */ -static void heatshrink_buffer(queue_buffer_t *buf) { - if (buf == NULL) - return; - - if (G_UNLIKELY(buf->data_size * 4 > buf->offset)) { - /* Consolodate with memmove. We will reclaim the space in the next - * step. */ - memmove(buf->data, buf->data + buf->offset, buf->data_size); - buf->offset = 0; - } - - if (buf->alloc_size > buf->data_size*2 + buf->offset) { - buf->alloc_size = buf->data_size + buf->offset; - buf->data = realloc(buf->data, buf->alloc_size); - } -} - -static gpointer do_producer_thread(gpointer datap) { - queue_data_t* data = datap; - - for (;;) { - queue_buffer_t *buf; - gboolean result; - - semaphore_decrement(data->free_memory, 0); - buf = g_async_queue_try_pop(data->free_queue); - if (buf != NULL && buf->data == NULL) { - /* Consumer is finished, then so are we. */ - amfree(buf); - return GINT_TO_POINTER(TRUE); - } - - if (buf == NULL) { - buf = invent_buffer(); - } - buf->offset = 0; - buf->data_size = 0; - - result = data->producer(data->producer_user_data, buf, - data->block_size); - - // Producers can allocate way too much memory. - heatshrink_buffer(buf); - - if (buf->data_size > 0) { - semaphore_force_adjust(data->free_memory, -buf->alloc_size); - - g_async_queue_push(data->data_queue, buf); - buf = NULL; - } else { - g_assert(result != PRODUCER_MORE); - free_buffer(buf); - buf = NULL; - } - - - if (result == PRODUCER_MORE) { - continue; - } else { - /* We are finished (and the first to do so). */ - g_async_queue_push(data->data_queue, invent_buffer()); - semaphore_force_set(data->free_memory, INT_MIN); - - return GINT_TO_POINTER(result == PRODUCER_FINISHED); - } - } -} - -static gpointer do_consumer_thread(gpointer datap) { - queue_data_t* data = datap; - gboolean finished = FALSE; - queue_buffer_t *buf = NULL; - - if (data->streaming_mode != STREAMING_REQUIREMENT_NONE) { - semaphore_wait_empty(data->free_memory); - } - - for (;;) { - gboolean result; - - if (finished) { - return GINT_TO_POINTER(TRUE); - } - - while (buf == NULL || buf->data_size < data->block_size) { - queue_buffer_t *next_buf; - if (data->streaming_mode == STREAMING_REQUIREMENT_DESIRED) { - do { - next_buf = g_async_queue_try_pop(data->data_queue); - if (next_buf == NULL) { - semaphore_wait_empty(data->free_memory); - } - } while (next_buf == NULL); - } else { - next_buf = g_async_queue_pop(data->data_queue); - g_assert(next_buf != NULL); - } - - if (next_buf->data == NULL) { - /* Producer is finished, then so are we.*/ - free_buffer(next_buf); - if (buf != NULL) { - /* But we can't quit yet, we have a buffer to flush.*/ - finished = TRUE; - break; - } else { - /* We are so outta here. */ - return GINT_TO_POINTER(TRUE); - } - } - - semaphore_increment(data->free_memory, next_buf->alloc_size); - - buf = merge_buffers(buf, next_buf); - } - - result = data->consumer(data->consumer_user_data, buf); - - if (result > 0) { - consume_buffer(buf, result); - if (buf->data_size == 0) { - g_async_queue_push(data->free_queue, buf); - buf = NULL; - } - continue; - } else { - free_buffer(buf); - return GINT_TO_POINTER(FALSE); - } - } -} - -/* Empties a buffer queue and frees all the buffers associated with it. - * - * If full_cleanup is TRUE, then we delete the queue itself. - * If full_cleanup is FALSE, then we leave the queue around, with a - * signal element in it. */ -static void cleanup_buffer_queue(GAsyncQueue *Q, gboolean full_cleanup) { - g_async_queue_lock(Q); - for (;;) { - queue_buffer_t *buftmp; - buftmp = g_async_queue_try_pop_unlocked(Q); - if (buftmp == NULL) - break; - - free_buffer(buftmp); - } - if (!full_cleanup) - g_async_queue_push_unlocked(Q, invent_buffer()); - - g_async_queue_unlock(Q); - - if (full_cleanup) - g_async_queue_unref(Q); -} - -/* This function sacrifices performance, but will still work just - fine, on systems where threads are not supported. */ -static queue_result_flags -do_unthreaded_consumer_producer_queue(guint block_size, - ProducerFunctor producer, - gpointer producer_user_data, - ConsumerFunctor consumer, - gpointer consumer_user_data) { - queue_buffer_t *buf = NULL, *next_buf = NULL; - gboolean finished = FALSE; - queue_result_flags rval = 0; - - /* The basic theory of operation here is to read until we have - enough data to write, then write until we don't.. */ - while (!finished) { - int result; - - while ((buf == NULL || buf->data_size < block_size) && !finished) { - if (next_buf == NULL) - next_buf = invent_buffer(); - - result = producer(producer_user_data, next_buf, block_size); - - if (result != PRODUCER_MORE) { - finished = TRUE; - if (result != PRODUCER_FINISHED) { - rval |= QUEUE_PRODUCER_ERROR; - } - } - - buf = merge_buffers(buf, next_buf); - next_buf = NULL; - } - - while (buf != NULL && buf->data_size > 0 && - (buf->data_size >= block_size || finished)) { - result = consumer(consumer_user_data, buf); - - if (result > 0) { - consume_buffer(buf, result); - if (buf->data_size == 0) { - next_buf = buf; - buf = NULL; - } - } else { - finished = TRUE; - rval |= QUEUE_CONSUMER_ERROR; - break; - } - } - } - - free_buffer(buf); - free_buffer(next_buf); - return rval; -} - -gboolean do_consumer_producer_queue(ProducerFunctor producer, - gpointer producer_user_data, - ConsumerFunctor consumer, - gpointer consumer_user_data) { - return QUEUE_SUCCESS == - do_consumer_producer_queue_full(producer, producer_user_data, - consumer, consumer_user_data, - 0, DEFAULT_MAX_BUFFER_MEMORY, - STREAMING_REQUIREMENT_NONE); -} - -queue_result_flags -do_consumer_producer_queue_full(ProducerFunctor producer, - gpointer producer_user_data, - ConsumerFunctor consumer, - gpointer consumer_user_data, - int block_size, - size_t max_memory, - StreamingRequirement streaming_mode) { - GThread * producer_thread; - GThread * consumer_thread; - queue_data_t queue_data; - gpointer producer_result; - gpointer consumer_result; - queue_result_flags rval; - - if (block_size <= 0) { - block_size = DISK_BLOCK_BYTES; - } - - g_return_val_if_fail(producer != NULL, FALSE); - g_return_val_if_fail(consumer != NULL, FALSE); - - if (!g_thread_supported()) { - return do_unthreaded_consumer_producer_queue(block_size, producer, - producer_user_data, - consumer, - consumer_user_data); - } - - queue_data.block_size = block_size; - queue_data.producer = producer; - queue_data.producer_user_data = producer_user_data; - queue_data.consumer = consumer; - queue_data.consumer_user_data = consumer_user_data; - queue_data.streaming_mode = streaming_mode; - - queue_data.data_queue = g_async_queue_new(); - queue_data.free_queue = g_async_queue_new(); - - max_memory = MAX(1,MIN(max_memory, INT_MAX / 2)); - queue_data.free_memory = semaphore_new_with_value(max_memory); - - producer_thread = g_thread_create(do_producer_thread, &queue_data, - TRUE, - NULL /* FIXME: Should handle - errors. */); - consumer_thread = g_thread_create(do_consumer_thread, &queue_data, - TRUE, - NULL /* FIXME: Should handle - errors. */); - - /* The order of cleanup here is very important, to avoid deadlock. */ - /* 1) Reap the consumer. */ - consumer_result = g_thread_join(consumer_thread); - /* 2) Stop the producer. */ - semaphore_force_set(queue_data.free_memory, -1); - /* 3) Cleanup the free queue; add a signal flag. */ - cleanup_buffer_queue(queue_data.free_queue, FALSE); - /* 4) Restart the producer (so it can exit). */ - semaphore_force_set(queue_data.free_memory, INT_MAX); - /* 5) Reap the producer. */ - producer_result = g_thread_join(producer_thread); - - cleanup_buffer_queue(queue_data.free_queue, TRUE); - cleanup_buffer_queue(queue_data.data_queue, TRUE); - - semaphore_free(queue_data.free_memory); - - rval = 0; - if (!GPOINTER_TO_INT(producer_result)) { - rval |= QUEUE_PRODUCER_ERROR; - } - if (!GPOINTER_TO_INT(consumer_result)) { - rval |= QUEUE_CONSUMER_ERROR; - } - return rval; -} - -/* Commonly-useful producers and consumers below. */ - -producer_result_t device_read_producer(gpointer devicep, - queue_buffer_t *buffer, - int hint_size G_GNUC_UNUSED) { - Device* device; - - device = (Device*) devicep; - g_assert(IS_DEVICE(device)); - - buffer->offset = 0; - for (;;) { - int result, read_size; - read_size = buffer->alloc_size; - result = device_read_block(device, buffer->data, &read_size); - if (result > 0) { - buffer->data_size = read_size; - return PRODUCER_MORE; - } else if (result == 0) { - buffer->data = realloc(buffer->data, read_size); - buffer->alloc_size = read_size; - } else if (device->is_eof) { - return PRODUCER_FINISHED; - } else { - buffer->data_size = 0; - return PRODUCER_ERROR; - } - } -} - -int device_write_consumer(gpointer devicep, queue_buffer_t *buffer) { - Device* device; - unsigned int write_size; - static gboolean wrote_blocksize = FALSE; - - device = (Device*) devicep; - g_assert(IS_DEVICE(device)); - write_size = MIN(buffer->data_size, - device_write_max_size(device)); - - if (!wrote_blocksize) { - wrote_blocksize = TRUE; - dbprintf("USING BLOCKSIZE %d bytes\n", write_size); - } - - if (device_write_block(device, write_size, - buffer->data + buffer->offset, - buffer->data_size < - device_write_min_size(device))) { - /* Success! */ - return write_size; - } else { - /* Nope, really an error. */ - return -1; - } -} - -producer_result_t fd_read_producer(gpointer fdp, queue_buffer_t *buffer, - int hint_size) { - int fd; - - fd = GPOINTER_TO_INT(fdp); - g_assert(fd >= 0); - g_assert(buffer->data_size == 0); - - buffer->offset = 0; - - if (buffer->data == NULL) { - /* Set up the buffer. */ - buffer->data = malloc(hint_size); - buffer->alloc_size = hint_size; - } - - for (;;) { - int result; - result = read(fd, buffer->data, buffer->alloc_size); - - if (result > 0) { - buffer->data_size = result; - return PRODUCER_MORE; - } else if (result == 0) { - /* End of file. */ - return PRODUCER_FINISHED; - } else if (0 -#ifdef EAGAIN - || errno == EAGAIN -#endif -#ifdef EWOULDBLOCK - || errno == EWOULDBLOCK -#endif -#ifdef EINTR - || errno == EINTR -#endif - ) { - /* Try again. */ - continue; - } else { - /* Error occured. */ - g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno)); - return PRODUCER_ERROR; - } - } -} - -int fd_write_consumer(gpointer fdp, queue_buffer_t *buffer) { - int fd; - - fd = GPOINTER_TO_INT(fdp); - g_assert(fd >= 0); - - g_return_val_if_fail(buffer->data_size > 0, 0); - - for (;;) { - int write_size; - write_size = write(fd, buffer->data + buffer->offset, - buffer->data_size); - - if (write_size > 0) { - return write_size; - } else if (0 -#ifdef EAGAIN - || errno == EAGAIN -#endif -#ifdef EWOULDBLOCK - || errno == EWOULDBLOCK -#endif -#ifdef EINTR - || errno == EINTR -#endif - ) { - /* Try again. */ - continue; - } else { - /* Error occured. */ - g_fprintf(stderr, "Error writing fd %d: %s\n", fd, strerror(errno)); - return -1; - } - } -} diff --git a/device-src/queueing.h b/device-src/queueing.h deleted file mode 100644 index 4a22081..0000000 --- a/device-src/queueing.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -#ifndef QUEUEING_H -#define QUEUEING_H - -/* This file contains the code for fast threaded reading and writing to/from - * media, for devices that don't require any special handling. Some - * devices (e.g., CD-ROM) may use a different method for bulk reads or - * writes. */ - -#include -#include "property.h" - -#define DEFAULT_MAX_BUFFER_MEMORY (1*1024*1024) - -/* Valid data in this structure starts at data + offset, and has size - * data_size. Allocation starts at data and has size alloc_size. */ -typedef struct { - char *data; - guint alloc_size; - guint data_size; - guint offset; -} queue_buffer_t; - -void free_buffer(queue_buffer_t*); - -typedef enum { - PRODUCER_MORE, /* Means the producer should be run again. */ - PRODUCER_FINISHED, /* Means that no error occured, but the - producer should not be run again. */ - PRODUCER_ERROR /* Means an error occured, and the producer - should not be run again. */ -} producer_result_t; - -typedef enum { - QUEUE_SUCCESS = 0, - QUEUE_PRODUCER_ERROR = 1 << 0, - QUEUE_CONSUMER_ERROR = 1 << 1, - QUEUE_INTERNAL_ERROR = 1 << 2 -} queue_result_flags; - -/* The producer takes the given buffer (which is not itself NULL, but - * may contain a NULL data segment), and fills it with data. The - * producer should feel free to allocate or reallocate data as - * necessary; the queueing system will free it when necessary. The - * result of the production operation is specified in the return - * value, but if the buffer is left without data, then that is - * interpreted as PRODUCER_ERROR. It is preferred (but not required) - * that the producer produce hint_size bytes of data, - * - * The consumer takes the given buffer (which will not be NULL, nor - * contain a NULL data segment) and processess it. If there is a - * problem consuming data (such that no further data should be - * consumed), the consumer may return -1. Otherwise, the consumer - * should return the number of bytes actually consumed. - * If an error occurs, return -1, regardless of the number of bytes consumed. - * If the amount of data written is not a full block, then this is the - * last (partial block) of data. The consumer should do whatever is - * appropriate in that case. - * - * Note that the handling of the queue_buffer_t is different between - * the two functions: The producer should update queue_buffer_t as - * necessary to corespond to read data, while the consumer should - * leave the queue_buffer_t unadjusted: The queueing framework will - * invalidate data in the buffer according to the return value of the - * consumer.*/ -typedef producer_result_t (* ProducerFunctor)(gpointer user_data, - queue_buffer_t* buffer, - int hint_size); -typedef int (* ConsumerFunctor)(gpointer user_data, - queue_buffer_t* buffer); - - -/* These functions make the magic happen. The first one assumes - reasonable defaults, the second one provides more options. - % producer : A function that provides data to write. - % producer_user_data : A pointer to pass to that function. - % consumer : A function that writes data out. - % consumer_user_data : A pointer to pass to that function. - % block_size : Size of chunks to write out to consumer. If - nonpositive, data will be written in - variable-sized chunks. - % max_memory : Amount of memory to be used for buffering. - (default is DEFAULT_MAX_BUFFER_MEMORY). - % streaming_mode : Describes streaming mode. - STREAMING_REQUIREMENT_NONE: Data will be written as fast - as possible. No prebuffering - will be done. - STREAMING_REQUIREMENT_DESIRED: max_memory bytes of data will - be prebuffered, and if the - buffer ever empties, no data - will be written until it - fills again. - STREAMING_REQUIREMENT_REQUIRED: max_memory bytes of data will - be prebuffered, and - thereafter data will be - written as fast as possible. -*/ -gboolean -do_consumer_producer_queue(ProducerFunctor producer, - gpointer producer_user_data, - ConsumerFunctor consumer, - gpointer consumer_user_data); -queue_result_flags -do_consumer_producer_queue_full(ProducerFunctor producer, - gpointer producer_user_data, - ConsumerFunctor consumer, - gpointer consumer_user_data, - int block_size, - size_t max_memory, - StreamingRequirement streaming_mode); - -/* Some commonly-useful producers and consumers.*/ - -/* These functions will call device_read_block and device_write_block - * respectively. The user data should be a Device*. - * - * device_write_consumer assumes that the block_size passed to - * do_consumer_producer_queue_full is at least device_write_min_size(); - * do_consumer_thread() will not pass a buffer of less than block_size - * to the consumer unless it has received EOF from the producer thread. - */ -producer_result_t device_read_producer(gpointer device, - queue_buffer_t *buffer, - int hint_size); -int device_write_consumer(gpointer device, queue_buffer_t *buffer); - -/* These functions will call read() or write() respectively. The user - data should be a file descriptor stored with GINT_TO_POINTER. */ -producer_result_t fd_read_producer(gpointer fd, queue_buffer_t *buffer, - int hint_size); -int fd_write_consumer(gpointer fd, queue_buffer_t *buffer); - - - -#endif /* QUEUEING_H */ diff --git a/device-src/rait-device.c b/device-src/rait-device.c index 72f7c6d..5b34892 100644 --- a/device-src/rait-device.c +++ b/device-src/rait-device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,17 +14,70 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* The RAIT device encapsulates some number of other devices into a single * redundant device. */ -#include "rait-device.h" #include #include "property.h" #include "util.h" +#include +#include "glib-util.h" +#include "device.h" +#include "fileheader.h" +#include "semaphore.h" + +/* Just a note about the failure mode of different operations: + - Recovers from a failure (enters degraded mode) + open_device() + seek_file() -- explodes if headers don't match. + seek_block() -- explodes if headers don't match. + read_block() -- explodes if data doesn't match. + + - Operates in degraded mode (but dies if a new problem shows up) + read_label() -- but dies on label mismatch. + start() -- but dies when writing in degraded mode. + property functions + finish() + + - Dies in degraded mode (even if remaining devices are OK) + start_file() + write_block() + finish_file() + recycle_file() +*/ + +/* + * Type checking and casting macros + */ +#define TYPE_RAIT_DEVICE (rait_device_get_type()) +#define RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice) +#define RAIT_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice const) +#define RAIT_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), rait_device_get_type(), RaitDeviceClass) +#define IS_RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), rait_device_get_type ()) + +#define RAIT_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), rait_device_get_type(), RaitDeviceClass) +static GType rait_device_get_type (void); + +/* + * Main object structure + */ +typedef struct RaitDevice_s { + Device __parent__; + + struct RaitDevicePrivate_s * private; +} RaitDevice; + +/* + * Class definition + */ +typedef struct _RaitDeviceClass RaitDeviceClass; +struct _RaitDeviceClass { + DeviceClass __parent__; +}; typedef enum { RAIT_STATUS_COMPLETE, /* All subdevices OK. */ @@ -32,63 +85,133 @@ typedef enum { RAIT_STATUS_FAILED /* Two or more subdevices failed. */ } RaitStatus; -struct RaitDevicePrivate_s { +/* Older versions of glib have a deadlock in their thread pool implementations, + * so we include a simple thread-pool implementation here to replace it. + * + * This implementation assumes that threads are used for paralellizing a single + * operation, so all threads run a function to completion before the main thread + * continues. This simplifies some of the locking semantics, and in particular + * there is no need to wait for stray threads to finish an operation when + * finalizing the RaitDevice object or when beginning a new operation. + */ +#if !(GLIB_CHECK_VERSION(2,10,0)) +#define USE_INTERNAL_THREADPOOL +#endif + +typedef struct RaitDevicePrivate_s { GPtrArray * children; /* These flags are only relevant for reading. */ RaitStatus status; /* If status == RAIT_STATUS_DEGRADED, this holds the index of the failed node. It holds a negative number otherwise. */ int failed; - guint block_size; -}; + + /* the child block size */ + gsize child_block_size; + +#ifdef USE_INTERNAL_THREADPOOL + /* array of ThreadInfo for performing parallel operations */ + GArray *threads; + + /* value of this semaphore is the number of threaded operations + * in progress */ + semaphore_t *threads_sem; +#endif +} RaitDevicePrivate; + +#ifdef USE_INTERNAL_THREADPOOL +typedef struct ThreadInfo { + GThread *thread; + + /* struct fields below are protected by this mutex and condition variable */ + GMutex *mutex; + GCond *cond; + + gboolean die; + GFunc func; + gpointer data; + + /* give threads access to active_threads and its mutex/cond */ + struct RaitDevicePrivate_s *private; +} ThreadInfo; +#endif + #define PRIVATE(o) (o->private) +#define rait_device_in_error(dev) \ + (device_in_error((dev)) || PRIVATE(RAIT_DEVICE((dev)))->status == RAIT_STATUS_FAILED) + +void rait_device_register (void); + /* here are local prototypes */ static void rait_device_init (RaitDevice * o); static void rait_device_class_init (RaitDeviceClass * c); -static gboolean rait_device_open_device (Device * self, char * device_name); +static void rait_device_base_init (RaitDeviceClass * c); +static void rait_device_open_device (Device * self, char * device_name, char * device_type, char * device_node); static gboolean rait_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); -static gboolean rait_device_start_file(Device * self, const dumpfile_t * info); -static gboolean rait_device_write_block (Device * self, guint size, - gpointer data, gboolean last_block); +static gboolean rait_device_configure(Device * self, gboolean use_global_config); +static gboolean rait_device_start_file(Device * self, dumpfile_t * info); +static gboolean rait_device_write_block (Device * self, guint size, gpointer data); static gboolean rait_device_finish_file (Device * self); static dumpfile_t * rait_device_seek_file (Device * self, guint file); static gboolean rait_device_seek_block (Device * self, guint64 block); static int rait_device_read_block (Device * self, gpointer buf, int * size); -static gboolean rait_device_property_get (Device * self, DevicePropertyId id, - GValue * val); -static gboolean rait_device_property_set (Device * self, DevicePropertyId id, - GValue * val); static gboolean rait_device_recycle_file (Device * self, guint filenum); static gboolean rait_device_finish (Device * self); -static ReadLabelStatusFlags rait_device_read_label(Device * dself); +static DeviceStatusFlags rait_device_read_label(Device * dself); static void find_simple_params(RaitDevice * self, guint * num_children, - guint * data_children, int * blocksize); + guint * data_children); -/* pointer to the class of our parent */ -static DeviceClass *parent_class = NULL; +/* property handlers */ -/* This function is replicated here in case we have GLib from before 2.4. - * It should probably go eventually. */ -#if !GLIB_CHECK_VERSION(2,4,0) -static void -g_ptr_array_foreach (GPtrArray *array, - GFunc func, - gpointer user_data) -{ - guint i; +static gboolean property_get_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); - g_return_if_fail (array); +static gboolean property_set_block_size_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); - for (i = 0; i < array->len; i++) - (*func) (array->pdata[i], user_data); -} -#endif +static gboolean property_get_canonical_name_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_concurrency_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_streaming_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_boolean_and_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_medium_access_type_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_get_free_space_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); -GType +static gboolean property_get_max_volume_usage_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); + +static gboolean property_set_max_volume_usage_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + + +/* pointer to the class of our parent */ +static DeviceClass *parent_class = NULL; + +static GType rait_device_get_type (void) { static GType type = 0; @@ -96,7 +219,7 @@ rait_device_get_type (void) if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (RaitDeviceClass), - (GBaseInitFunc) NULL, + (GBaseInitFunc) rait_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rait_device_class_init, (GClassFinalizeFunc) NULL, @@ -116,14 +239,15 @@ rait_device_get_type (void) static void g_object_unref_foreach(gpointer data, gpointer user_data G_GNUC_UNUSED) { - g_return_if_fail(G_IS_OBJECT(data)); - g_object_unref(data); + if (data != NULL && G_IS_OBJECT(data)) { + g_object_unref(data); + } } static void rait_device_finalize(GObject *obj_self) { - RaitDevice *self G_GNUC_UNUSED = RAIT_DEVICE (obj_self); + RaitDevice *self = RAIT_DEVICE (obj_self); if(G_OBJECT_CLASS(parent_class)->finalize) \ (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self); if(self->private->children) { @@ -132,27 +256,64 @@ rait_device_finalize(GObject *obj_self) g_ptr_array_free (self->private->children, TRUE); self->private->children = NULL; } +#ifdef USE_INTERNAL_THREADPOOL + g_assert(PRIVATE(self)->threads_sem == NULL || PRIVATE(self)->threads_sem->value == 0); + + if (PRIVATE(self)->threads) { + guint i; + + for (i = 0; i < PRIVATE(self)->threads->len; i++) { + ThreadInfo *inf = &g_array_index(PRIVATE(self)->threads, ThreadInfo, i); + if (inf->thread) { + /* NOTE: the thread is waiting on this condition right now, not + * executing an operation. */ + + /* ask the thread to die */ + g_mutex_lock(inf->mutex); + inf->die = TRUE; + g_cond_signal(inf->cond); + g_mutex_unlock(inf->mutex); + + /* and wait for it to die, which should happen soon */ + g_thread_join(inf->thread); + } + + if (inf->mutex) + g_mutex_free(inf->mutex); + if (inf->cond) + g_cond_free(inf->cond); + } + } + + if (PRIVATE(self)->threads_sem) + semaphore_free(PRIVATE(self)->threads_sem); +#endif amfree(self->private); } static void rait_device_init (RaitDevice * o G_GNUC_UNUSED) { - PRIVATE(o) = malloc(sizeof(RaitDevicePrivate)); + PRIVATE(o) = g_new(RaitDevicePrivate, 1); PRIVATE(o)->children = g_ptr_array_new(); PRIVATE(o)->status = RAIT_STATUS_COMPLETE; PRIVATE(o)->failed = -1; +#ifdef USE_INTERNAL_THREADPOOL + PRIVATE(o)->threads = NULL; + PRIVATE(o)->threads_sem = NULL; +#endif } static void -rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED) +rait_device_class_init (RaitDeviceClass * c) { - GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) c; + GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = (DeviceClass *)c; parent_class = g_type_class_ref (TYPE_DEVICE); device_class->open_device = rait_device_open_device; + device_class->configure = rait_device_configure; device_class->start = rait_device_start; device_class->start_file = rait_device_start_file; device_class->write_block = rait_device_write_block; @@ -160,20 +321,18 @@ rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED) device_class->seek_file = rait_device_seek_file; device_class->seek_block = rait_device_seek_block; device_class->read_block = rait_device_read_block; - device_class->property_get = rait_device_property_get; - device_class->property_set = rait_device_property_set; device_class->recycle_file = rait_device_recycle_file; device_class->finish = rait_device_finish; device_class->read_label = rait_device_read_label; g_object_class->finalize = rait_device_finalize; +#ifndef USE_INTERNAL_THREADPOOL +#if !GLIB_CHECK_VERSION(2,10,2) /* Versions of glib before 2.10.2 crash if * g_thread_pool_set_max_unused_threads is called before the first * invocation of g_thread_pool_new. So we make up a thread pool, but don't * start any threads in it, and free it */ - -#if !GLIB_CHECK_VERSION(2,10,2) { GThreadPool *pool = g_thread_pool_new((GFunc)-1, NULL, -1, FALSE, NULL); g_thread_pool_free(pool, TRUE, FALSE); @@ -181,6 +340,53 @@ rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED) #endif g_thread_pool_set_max_unused_threads(-1); +#endif +} + +static void +rait_device_base_init (RaitDeviceClass * c) +{ + DeviceClass *device_class = (DeviceClass *)c; + + /* the RAIT device overrides most of the standard properties, so that it + * can calculate them by querying the same property on the children */ + device_class_register_property(device_class, PROPERTY_BLOCK_SIZE, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + property_get_block_size_fn, + property_set_block_size_fn); + + device_class_register_property(device_class, PROPERTY_CANONICAL_NAME, + PROPERTY_ACCESS_GET_MASK, + property_get_canonical_name_fn, NULL); + + device_class_register_property(device_class, PROPERTY_CONCURRENCY, + PROPERTY_ACCESS_GET_MASK, + property_get_concurrency_fn, NULL); + + device_class_register_property(device_class, PROPERTY_STREAMING, + PROPERTY_ACCESS_GET_MASK, + property_get_streaming_fn, NULL); + + device_class_register_property(device_class, PROPERTY_APPENDABLE, + PROPERTY_ACCESS_GET_MASK, + property_get_boolean_and_fn, NULL); + + device_class_register_property(device_class, PROPERTY_PARTIAL_DELETION, + PROPERTY_ACCESS_GET_MASK, + property_get_boolean_and_fn, NULL); + + device_class_register_property(device_class, PROPERTY_MEDIUM_ACCESS_TYPE, + PROPERTY_ACCESS_GET_MASK, + property_get_medium_access_type_fn, NULL); + + device_class_register_property(device_class, PROPERTY_FREE_SPACE, + PROPERTY_ACCESS_GET_MASK, + property_get_free_space_fn, NULL); + + device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE, + PROPERTY_ACCESS_GET_MASK, + property_get_max_volume_usage_fn, + property_set_max_volume_usage_fn); } /* This function does something a little clever and a little @@ -194,12 +400,81 @@ rait_device_class_init (RaitDeviceClass * c G_GNUC_UNUSED) * * When it returns, all the operations have been successfully * executed. If you want results from your operations, do it yourself - * through the array. */ -static void do_thread_pool_op(GFunc func, GPtrArray * ops, gpointer data) { + * through the array. + */ + +#ifdef USE_INTERNAL_THREADPOOL +static gpointer rait_thread_pool_func(gpointer data) { + ThreadInfo *inf = data; + + g_mutex_lock(inf->mutex); + while (TRUE) { + while (!inf->die && !inf->func) + g_cond_wait(inf->cond, inf->mutex); + + if (inf->die) + break; + + if (inf->func) { + /* invoke the function */ + inf->func(inf->data, NULL); + inf->func = NULL; + inf->data = NULL; + + /* indicate that we're finished; will not block */ + semaphore_down(inf->private->threads_sem); + } + } + g_mutex_unlock(inf->mutex); + return NULL; +} + +static void do_thread_pool_op(RaitDevice *self, GFunc func, GPtrArray * ops) { + guint i; + + if (PRIVATE(self)->threads_sem == NULL) + PRIVATE(self)->threads_sem = semaphore_new_with_value(0); + + if (PRIVATE(self)->threads == NULL) + PRIVATE(self)->threads = g_array_sized_new(FALSE, TRUE, + sizeof(ThreadInfo), ops->len); + + g_assert(PRIVATE(self)->threads_sem->value == 0); + + if (PRIVATE(self)->threads->len < ops->len) + g_array_set_size(PRIVATE(self)->threads, ops->len); + + /* the semaphore will hit zero when each thread has decremented it */ + semaphore_force_set(PRIVATE(self)->threads_sem, ops->len); + + for (i = 0; i < ops->len; i++) { + ThreadInfo *inf = &g_array_index(PRIVATE(self)->threads, ThreadInfo, i); + if (!inf->thread) { + inf->mutex = g_mutex_new(); + inf->cond = g_cond_new(); + inf->private = PRIVATE(self); + inf->thread = g_thread_create(rait_thread_pool_func, inf, TRUE, NULL); + } + + /* set up the info the thread needs and trigger it to start */ + g_mutex_lock(inf->mutex); + inf->data = g_ptr_array_index(ops, i); + inf->func = func; + g_cond_signal(inf->cond); + g_mutex_unlock(inf->mutex); + } + + /* wait until semaphore hits zero */ + semaphore_wait_empty(PRIVATE(self)->threads_sem); +} + +#else /* USE_INTERNAL_THREADPOOL */ + +static void do_thread_pool_op(RaitDevice *self G_GNUC_UNUSED, GFunc func, GPtrArray * ops) { GThreadPool * pool; guint i; - pool = g_thread_pool_new(func, data, -1, FALSE, NULL); + pool = g_thread_pool_new(func, NULL, -1, FALSE, NULL); for (i = 0; i < ops->len; i ++) { g_thread_pool_push(pool, g_ptr_array_index(ops, i), NULL); } @@ -207,9 +482,10 @@ static void do_thread_pool_op(GFunc func, GPtrArray * ops, gpointer data) { g_thread_pool_free(pool, FALSE, TRUE); } +#endif /* USE_INTERNAL_THREADPOOL */ + /* This does the above, in a serial fashion (and without using threads) */ -static void do_unthreaded_ops(GFunc func, GPtrArray * ops, - gpointer data G_GNUC_UNUSED) { +static void do_unthreaded_ops(RaitDevice *self G_GNUC_UNUSED, GFunc func, GPtrArray * ops) { guint i; for (i = 0; i < ops->len; i ++) { @@ -220,231 +496,358 @@ static void do_unthreaded_ops(GFunc func, GPtrArray * ops, /* This is the one that code below should call. It switches automatically between do_thread_pool_op and do_unthreaded_ops, depending on g_thread_supported(). */ -static void do_rait_child_ops(GFunc func, GPtrArray * ops, gpointer data) { +static void do_rait_child_ops(RaitDevice *self, GFunc func, GPtrArray * ops) { if (g_thread_supported()) { - do_thread_pool_op(func, ops, data); + do_thread_pool_op(self, func, ops); } else { - do_unthreaded_ops(func, ops, data); + do_unthreaded_ops(self, func, ops); } } -/* Take a text string user_name, and break it out into an argv-style - array of strings. For example, {foo,{bar,baz},bat} would return the - strings "foo", "{bar,baz}", "bat", and NULL. Returns NULL on - error. */ -static char ** parse_device_name(char * user_name) { - GPtrArray * rval; - char * cur_end = user_name; - char * cur_begin = user_name; - - rval = g_ptr_array_new(); - - /* Check opening brace. */ - if (*cur_begin != '{') - return NULL; - cur_begin ++; - - cur_end = cur_begin; - for (;;) { - switch (*cur_end) { - case ',': { - g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin)); - cur_end ++; - cur_begin = cur_end; - continue; - } +/* Helper for parse_device_name; returns a list of un-escaped strings for + * the first "component" of str, where a component is a plain string or a + * brace-enclosed set of alternatives. str is pointing to the first character + * of the next component on return. */ +static GPtrArray * +parse_device_name_component(char **str) +{ + GPtrArray *result = g_ptr_array_new(); + + if (**str == '{') { + char *p = (*str)+1; + char *local = g_malloc(strlen(*str)+1); + char *current = local; + char *c = current; + + while (1) { + if (*p == '\0' || *p == '{') { + /* unterminated { .. } or extra '{' */ + amfree(local); + g_ptr_array_free(result, TRUE); + return NULL; + } + + if (*p == '}' || *p == ',') { + *c = '\0'; + g_ptr_array_add(result, g_strdup(current)); + current = ++c; + + if (*p == '}') + break; + else + p++; + } + + if (*p == '\\') { + if (*(p+1) == '{' || *(p+1) == '}' || *(p+1) == '\\' || *(p+1) == ',') + p++; + } + *(c++) = *(p++); + } - case '{': - /* We read until the matching closing brace. */ - while (*cur_end != '}' && *cur_end != '\0') - cur_end ++; - if (*cur_end == '}') - cur_end ++; - continue; - - case '}': - g_ptr_array_add(rval, g_strndup(cur_begin, cur_end - cur_begin)); - goto OUTER_END; /* break loop, not switch */ - - case '\0': - /* Unexpected NULL; abort. */ - g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name); - g_ptr_array_free_full(rval); - return NULL; - - default: - cur_end ++; - continue; - } - g_assert_not_reached(); - } - OUTER_END: - - if (cur_end[1] != '\0') { - g_fprintf(stderr, "Invalid RAIT device name %s\n", user_name); - g_ptr_array_free_full(rval); - return NULL; + amfree(local); + + if (*p) + *str = p+1; + else + *str = p; + } else { + /* no braces -- just un-escape a plain string */ + char *local = g_malloc(strlen(*str)+1); + char *r = local; + char *p = *str; + + while (*p && *p != '{') { + if (*p == '\\') { + if (*(p+1) == '{' || *(p+1) == '}' || *(p+1) == '\\' || *(p+1) == ',') + p++; + } + *(r++) = *(p++); + } + *r = '\0'; + g_ptr_array_add(result, local); + *str = p; } - g_ptr_array_add(rval, NULL); + return result; +} + +/* Take a text string user_name, and break it out into an argv-style + array of strings, using a {..,..} syntax similar to shell brace expansion. + For example: + + "{foo,bar,bat}" -> [ "foo", "bar", "bat" ] + "foo{1,2}bar" -> [ "foo1bar", "foo2bar" ] + "foo{1\,2,3}bar" -> [ "foo1,2bar", "foo3bar" ] + "{a,b}-{1,2}" -> [ "a-1", "a-2", "b-1", "b-2" ] + + Note that nested braces are not processed. Braces, commas, and backslashes + may be escaped with backslashes. Returns NULL on invalid strings. + */ + +static GPtrArray * +parse_device_name(char * user_name) +{ + GPtrArray *rval = g_ptr_array_new(); + + g_ptr_array_add(rval, g_strdup("")); - return (char**) g_ptr_array_free(rval, FALSE); + while (*user_name) { + GPtrArray *new_components; + GPtrArray *new_rval; + guint i, j; + + new_components = parse_device_name_component(&user_name); + if (!new_components) { + /* parse error */ + g_ptr_array_free(rval, TRUE); + return NULL; + } + + new_rval = g_ptr_array_new(); + + /* do a cartesian join of rval and new_components */ + for (i = 0; i < rval->len; i++) { + for (j = 0; j < new_components->len; j++) { + g_ptr_array_add(new_rval, g_strconcat( + g_ptr_array_index(rval, i), + g_ptr_array_index(new_components, j), + NULL)); + } + } + + g_ptr_array_free(rval, TRUE); + g_ptr_array_free(new_components, TRUE); + rval = new_rval; + } + + return rval; } -/* Find a workable block size. */ -static gboolean find_block_size(RaitDevice * self) { - uint min = 0; - uint max = G_MAXUINT; - uint result; - GValue val; - gboolean rval; +static char * +child_device_names_to_rait_name(RaitDevice * self) { + GString *rait_name = NULL; guint i; - guint data_children; - + + rait_name = g_string_new("rait:{"); + for (i = 0; i < self->private->children->len; i ++) { - uint child_min, child_max; - GValue property_result; - bzero(&property_result, sizeof(property_result)); + Device *child = g_ptr_array_index(self->private->children, i); + const char *child_name = NULL; + GValue val; + gboolean got_prop = FALSE; + + bzero(&val, sizeof(val)); + + if ((signed)i != self->private->failed) { + if (device_property_get(child, PROPERTY_CANONICAL_NAME, &val)) { + child_name = g_value_get_string(&val); + got_prop = TRUE; + } + } - if (!device_property_get(g_ptr_array_index(self->private->children, i), - PROPERTY_MIN_BLOCK_SIZE, &property_result)) - return FALSE; - child_min = g_value_get_uint(&property_result); - g_return_val_if_fail(child_min > 0, FALSE); - if (!device_property_get(g_ptr_array_index(self->private->children, i), - PROPERTY_MAX_BLOCK_SIZE, &property_result)) - return FALSE; - child_max = g_value_get_uint(&property_result); - g_return_val_if_fail(child_max > 0, FALSE); - - if (child_min > max || child_max < min || child_min == 0) { - return FALSE; - } else { - min = MAX(min, child_min); - max = MIN(max, child_max); - } - } + if (!got_prop) + child_name = "MISSING"; - /* Now pick a number. */ - g_assert(min <= max); - if (max < MAX_TAPE_BLOCK_BYTES) - result = max; - else if (min > MAX_TAPE_BLOCK_BYTES) - result = min; - else - result = MAX_TAPE_BLOCK_BYTES; + g_string_append_printf(rait_name, "%s%s", child_name, + (i < self->private->children->len-1)? "," : ""); - /* User reads and writes bigger blocks. */ - find_simple_params(self, NULL, &data_children, NULL); - self->private->block_size = result * data_children; + if (got_prop) + g_value_unset(&val); + } - bzero(&val, sizeof(val)); - g_value_init(&val, G_TYPE_INT); - g_value_set_int(&val, result); - /* We can't do device_property_set because it's disallowed - according to the registered property base. */ - rval = rait_device_property_set(DEVICE(self), PROPERTY_BLOCK_SIZE, &val); - g_value_unset(&val); - return rval; + g_string_append(rait_name, "}"); + return g_string_free(rait_name, FALSE); } -/* Register properties that belong to the RAIT device proper, and not - to subdevices. */ -static void register_rait_properties(RaitDevice * self) { - Device * o = DEVICE(self); - DeviceProperty prop; +/* Find a workable child block size, based on the block size ranges of our + * child devices. + * + * The algorithm is to construct the intersection of all child devices' + * [min,max] block size ranges, and then pick the block size closest to 32k + * that is in the resulting range. This avoids picking ridiculously small (1 + * byte) or large (INT_MAX) block sizes when using devices with wide-open block + * size ranges. + + * This function returns the calculated child block size directly, and the RAIT + * device's blocksize via rait_size, if not NULL. It is resilient to errors in + * a single child device, but sets the device's error status and returns 0 if + * it cannot determine an agreeable block size. + */ +static gsize +calculate_block_size_from_children(RaitDevice * self, gsize *rait_size) +{ + gsize min = 0; + gsize max = SIZE_MAX; + gboolean found_one = FALSE; + gsize result; + guint i; + + for (i = 0; i < self->private->children->len; i ++) { + gsize child_min = SIZE_MAX, child_max = 0; + Device *child; + GValue property_result; + PropertySource source; - prop.access = PROPERTY_ACCESS_GET_MASK; + bzero(&property_result, sizeof(property_result)); - prop.base = &device_property_min_block_size; - device_add_property(o, &prop, NULL); + if ((signed)i == self->private->failed) + continue; - prop.base = &device_property_max_block_size; - device_add_property(o, &prop, NULL); - - prop.base = &device_property_block_size; - device_add_property(o, &prop, NULL); + child = g_ptr_array_index(self->private->children, i); + if (!device_property_get_ex(child, PROPERTY_BLOCK_SIZE, + &property_result, NULL, &source)) { + g_warning("Error getting BLOCK_SIZE from %s: %s", + child->device_name, device_error_or_status(child)); + continue; + } - prop.base = &device_property_canonical_name; - device_add_property(o, &prop, NULL); -} + /* if the block size has been set explicitly, then we need to use that blocksize; + * otherwise (even if it was DETECTED), override it. */ + if (source == PROPERTY_SOURCE_USER) { + child_min = child_max = g_value_get_int(&property_result); + } else { + if (!device_property_get(child, PROPERTY_MIN_BLOCK_SIZE, + &property_result)) { + g_warning("Error getting MIN_BLOCK_SIZE from %s: %s", + child->device_name, device_error_or_status(child)); + continue; + } + child_min = g_value_get_uint(&property_result); + + if (!device_property_get(child, PROPERTY_MAX_BLOCK_SIZE, + &property_result)) { + g_warning("Error getting MAX_BLOCK_SIZE from %s: %s", + child->device_name, device_error_or_status(child)); + continue; + } + child_max = g_value_get_uint(&property_result); + + if (child_min == 0 || child_max == 0 || (child_min > child_max)) { + g_warning("Invalid min, max block sizes from %s", child->device_name); + continue; + } + } -static void property_hash_union(GHashTable * properties, - const DeviceProperty * prop) { - PropertyAccessFlags before, after; - gpointer tmp; - gboolean found; - - found = g_hash_table_lookup_extended(properties, - GUINT_TO_POINTER(prop->base->ID), - NULL, &tmp); - before = GPOINTER_TO_UINT(tmp); - - if (!found) { - after = prop->access; - } else { - after = before & prop->access; + found_one = TRUE; + min = MAX(min, child_min); + max = MIN(max, child_max); } - - g_hash_table_insert(properties, GUINT_TO_POINTER(prop->base->ID), - GUINT_TO_POINTER(after)); -} -/* A GHRFunc. */ -static gboolean zero_value(gpointer key G_GNUC_UNUSED, gpointer value, - gpointer user_data G_GNUC_UNUSED) { - return (0 == GPOINTER_TO_UINT(value)); -} + if (!found_one) { + device_set_error((Device*)self, + stralloc(_("Could not find any child devices' block size ranges")), + DEVICE_STATUS_DEVICE_ERROR); + return 0; + } -/* A GHFunc */ -static void register_property_hash(gpointer key, gpointer value, - gpointer user_data) { - DevicePropertyId id = GPOINTER_TO_UINT(key); - DeviceProperty prop; - Device * device = (Device*)user_data; + if (min > max) { + device_set_error((Device*)self, + stralloc(_("No block size is acceptable to all child devices")), + DEVICE_STATUS_DEVICE_ERROR); + return 0; + } - g_assert(IS_DEVICE(device)); + /* Now pick a number. If 32k is in range, we use that; otherwise, we use + * the nearest acceptable size. */ + result = CLAMP(32768, min, max); - prop.access = GPOINTER_TO_UINT(value); - prop.base = device_property_get_by_id(id); + if (rait_size) { + guint data_children; + find_simple_params(self, NULL, &data_children); + *rait_size = result * data_children; + } - device_add_property(device, &prop, NULL); + return result; } -/* This function figures out which properties exist for all children, and - * exports the unioned access mask. */ -static void register_properties(RaitDevice * self) { - GHashTable * properties; /* PropertyID => PropertyAccessFlags */ - guint j; - - properties = g_hash_table_new(g_direct_hash, g_direct_equal); +/* Set BLOCK_SIZE on all children */ +static gboolean +set_block_size_on_children(RaitDevice *self, gsize child_block_size) +{ + GValue val; + guint i; + PropertySource source; - /* Iterate the device list, find all properties. */ - for (j = 0; j < self->private->children->len; j ++) { - int i; - Device * child = g_ptr_array_index(self->private->children, j); - const DeviceProperty* device_property_list; + bzero(&val, sizeof(val)); - device_property_list = device_property_get_list(child); - for (i = 0; device_property_list[i].base != NULL; i ++) { - property_hash_union(properties, &(device_property_list[i])); - } + g_assert(child_block_size < INT_MAX); + g_value_init(&val, G_TYPE_INT); + g_value_set_int(&val, (gint)child_block_size); + + for (i = 0; i < self->private->children->len; i ++) { + Device *child; + GValue property_result; + + bzero(&property_result, sizeof(property_result)); + + if ((signed)i == self->private->failed) + continue; + + child = g_ptr_array_index(self->private->children, i); + + /* first, make sure the block size is at its default, or is already + * correct */ + if (device_property_get_ex(child, PROPERTY_BLOCK_SIZE, + &property_result, NULL, &source)) { + gsize from_child = g_value_get_int(&property_result); + if (source != PROPERTY_SOURCE_DEFAULT + && from_child != child_block_size) { + device_set_error((Device *)self, + vstrallocf(_("Child device %s already has its block size set to %zd, not %zd"), + child->device_name, from_child, child_block_size), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + } else { + /* failing to get the block size isn't necessarily fatal.. */ + g_warning("Error getting BLOCK_SIZE from %s: %s", + child->device_name, device_error_or_status(child)); + } + g_value_unset(&property_result); + + if (!device_property_set(child, PROPERTY_BLOCK_SIZE, &val)) { + device_set_error((Device *)self, + vstrallocf(_("Error setting block size on %s"), child->device_name), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } } - /* Then toss properties that can't be accessed. */ - g_hash_table_foreach_remove(properties, zero_value, NULL); - g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_BLOCK_SIZE)); - g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MIN_BLOCK_SIZE)); - g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_MAX_BLOCK_SIZE)); - g_hash_table_remove(properties, GINT_TO_POINTER(PROPERTY_CANONICAL_NAME)); + return TRUE; +} + +/* The time for users to specify block sizes has ended; set this device's + * block-size attributes for easy access by other RAIT functions. Returns + * FALSE on error, with the device's error status already set. */ +static gboolean +fix_block_size(RaitDevice *self) +{ + Device *dself = (Device *)self; + gsize my_block_size, child_block_size; + + if (dself->block_size_source == PROPERTY_SOURCE_DEFAULT) { + child_block_size = calculate_block_size_from_children(self, &my_block_size); + if (child_block_size == 0) + return FALSE; + + self->private->child_block_size = child_block_size; + dself->block_size = my_block_size; + dself->block_size_surety = PROPERTY_SURETY_GOOD; + dself->block_size_source = PROPERTY_SOURCE_DETECTED; + } else { + guint data_children; - /* Finally, register the lot. */ - g_hash_table_foreach(properties, register_property_hash, self); + find_simple_params(self, NULL, &data_children); + g_assert((dself->block_size % data_children) == 0); + child_block_size = dself->block_size / data_children; + } - g_hash_table_destroy(properties); + /* now tell the children we mean it */ + if (!set_block_size_on_children(self, child_block_size)) + return FALSE; - /* Then we have some of our own properties to register. */ - register_rait_properties(self); + return TRUE; } /* This structure contains common fields for many operations. Not all @@ -477,7 +880,9 @@ static gboolean extract_boolean_pointer_op(gpointer data) { /* Does the equivalent of this perl command: ! (first { !extractor($_) } @_ That is, calls extractor on each element of the array, and returns - TRUE if and only if all calls to extractor return TRUE. + TRUE if and only if all calls to extractor return TRUE. This function + stops as soon as an extractor returns false, so it's best if extractor + functions have no side effects. */ static gboolean g_ptr_array_and(GPtrArray * array, BooleanExtractor extractor) { @@ -493,23 +898,6 @@ static gboolean g_ptr_array_and(GPtrArray * array, return TRUE; } -/* Calls extractor on each element of the array, and returns - TRUE if at least one of the calls to extractor return TRUE. -*/ -static gboolean g_ptr_array_or(GPtrArray * array, - BooleanExtractor extractor) { - guint i; - if (array == NULL || array->len <= 0) - return FALSE; - - for (i = 0; i < array->len; i ++) { - if (extractor(g_ptr_array_index(array, i))) - return TRUE; - } - - return FALSE; -} - /* Takes a RaitDevice, and makes a GPtrArray of GenericOp. */ static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) { GPtrArray * rval; @@ -518,7 +906,12 @@ static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) { rval = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { GenericOp * op; - op = malloc(sizeof(*op)); + + if ((signed)i == self->private->failed) { + continue; + } + + op = g_new(GenericOp, 1); op->child = g_ptr_array_index(self->private->children, i); op->child_index = i; g_ptr_array_add(rval, op); @@ -533,20 +926,22 @@ static GPtrArray * make_generic_boolean_op_array(RaitDevice* self) { occured. */ static gboolean g_ptr_array_union_robust(RaitDevice * self, GPtrArray * ops, BooleanExtractor extractor) { - int nfailed; + int nfailed = 0; + int lastfailed = 0; guint i; /* We found one or more failed elements. See which elements failed, and * isolate them*/ - nfailed = 0; for (i = 0; i < ops->len; i ++) { GenericOp * op = g_ptr_array_index(ops, i); if (!extractor(op)) { self->private->failed = op->child_index; - g_fprintf(stderr, "RAIT array %s isolated device %s\n", + g_warning("RAIT array %s isolated device %s: %s", DEVICE(self)->device_name, - op->child->device_name); + op->child->device_name, + device_error(op->child)); nfailed++; + lastfailed = i; } } @@ -557,27 +952,37 @@ static gboolean g_ptr_array_union_robust(RaitDevice * self, GPtrArray * ops, /* a single failure in COMPLETE just puts us in DEGRADED mode */ if (self->private->status == RAIT_STATUS_COMPLETE && nfailed == 1) { self->private->status = RAIT_STATUS_DEGRADED; - g_fprintf(stderr, "RAIT array %s DEGRADED\n", DEVICE(self)->device_name); + self->private->failed = lastfailed; + g_warning("RAIT array %s DEGRADED", DEVICE(self)->device_name); return TRUE; } else { self->private->status = RAIT_STATUS_FAILED; - g_fprintf(stderr, "RAIT array %s FAILED\n", DEVICE(self)->device_name); + g_warning("RAIT array %s FAILED", DEVICE(self)->device_name); return FALSE; } } typedef struct { - Device * result; /* IN */ - char * device_name; /* OUT */ + RaitDevice * self; + char *rait_name; + char * device_name; /* IN */ + Device * result; /* OUT */ } OpenDeviceOp; /* A GFunc. */ -static void open_device_do_op(gpointer data, +static void device_open_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { OpenDeviceOp * op = data; - op->result = device_open(op->device_name); - amfree(op->device_name); + if (strcmp(op->device_name, "ERROR") == 0 || + strcmp(op->device_name, "MISSING") == 0 || + strcmp(op->device_name, "DEGRADED") == 0) { + g_warning("RAIT device %s contains a missing element, attempting " + "degraded mode.\n", op->rait_name); + op->result = NULL; + } else { + op->result = device_open(op->device_name); + } } /* Returns TRUE if and only if the volume label and time are equal. */ @@ -586,64 +991,111 @@ static gboolean compare_volume_results(Device * a, Device * b) { && 0 == compare_possibly_null_strings(a->volume_label, b->volume_label)); } -static gboolean -rait_device_open_device (Device * dself, char * device_name) { - char ** device_names; - GPtrArray * open_device_ops; +/* Stickes new_message at the end of *old_message; frees new_message and + * may change *old_message. */ +static void append_message(char ** old_message, char * new_message) { + char * rval; + if (*old_message == NULL || **old_message == '\0') { + rval = new_message; + } else { + rval = g_strdup_printf("%s; %s", *old_message, new_message); + amfree(new_message); + } + amfree(*old_message); + *old_message = rval; +} + +static void +rait_device_open_device (Device * dself, char * device_name, + char * device_type G_GNUC_UNUSED, char * device_node) { + GPtrArray *device_names; + GPtrArray * device_open_ops; guint i; gboolean failure; + char *failure_errmsgs; + DeviceStatusFlags failure_flags; RaitDevice * self; self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail (device_name != NULL, FALSE); - device_names = parse_device_name(device_name); - - if (device_names == NULL) - return FALSE; + device_names = parse_device_name(device_node); + + if (device_names == NULL) { + device_set_error(dself, + vstrallocf(_("Invalid RAIT device name '%s'"), device_name), + DEVICE_STATUS_DEVICE_ERROR); + return; + } /* Open devices in a separate thread, in case they have to rewind etc. */ - open_device_ops = g_ptr_array_new(); + device_open_ops = g_ptr_array_new(); - for (i = 0; device_names[i] != NULL; i ++) { + for (i = 0; i < device_names->len; i++) { OpenDeviceOp *op; + char *name = g_ptr_array_index(device_names, i); - op = malloc(sizeof(*op)); - op->device_name = device_names[i]; + op = g_new(OpenDeviceOp, 1); + op->device_name = name; op->result = NULL; - g_ptr_array_add(open_device_ops, op); + op->self = self; + op->rait_name = device_name; + g_ptr_array_add(device_open_ops, op); } - free(device_names); - do_rait_child_ops(open_device_do_op, open_device_ops, NULL); + g_ptr_array_free(device_names, TRUE); + do_rait_child_ops(self, device_open_do_op, device_open_ops); failure = FALSE; + failure_errmsgs = NULL; + failure_flags = 0; + /* Check results of opening devices. */ - for (i = 0; i < open_device_ops->len; i ++) { - OpenDeviceOp *op = g_ptr_array_index(open_device_ops, i); - - if (op->result != NULL) { - g_ptr_array_add(self->private->children, op->result); + for (i = 0; i < device_open_ops->len; i ++) { + OpenDeviceOp *op = g_ptr_array_index(device_open_ops, i); + + if (op->result != NULL && + op->result->status == DEVICE_STATUS_SUCCESS) { + g_ptr_array_add(self->private->children, op->result); } else { - failure = TRUE; + char * this_failure_errmsg = + g_strdup_printf("%s: %s", op->device_name, + device_error_or_status(op->result)); + DeviceStatusFlags status = + op->result == NULL ? + DEVICE_STATUS_DEVICE_ERROR : op->result->status; + append_message(&failure_errmsgs, + strdup(this_failure_errmsg)); + failure_flags |= status; + if (self->private->status == RAIT_STATUS_COMPLETE) { + /* The first failure just puts us in degraded mode. */ + g_warning("%s: %s", + device_name, this_failure_errmsg); + g_warning("%s: %s failed, entering degraded mode.", + device_name, op->device_name); + g_ptr_array_add(self->private->children, op->result); + self->private->status = RAIT_STATUS_DEGRADED; + self->private->failed = i; + } else { + /* The second and further failures are fatal. */ + failure = TRUE; + } } + amfree(op->device_name); } - g_ptr_array_free_full(open_device_ops); - - failure = failure || !find_block_size(self); - if (failure) - return FALSE; /* This will clean up any created children. */ + g_ptr_array_free_full(device_open_ops); - register_properties(self); + if (failure) { + self->private->status = RAIT_STATUS_FAILED; + device_set_error(dself, failure_errmsgs, failure_flags); + return; + } /* Chain up. */ if (parent_class->open_device) { - return parent_class->open_device(dself, device_name); - } else { - return TRUE; + parent_class->open_device(dself, device_name, device_type, device_node); } + return; } /* A GFunc. */ @@ -653,72 +1105,63 @@ static void read_label_do_op(gpointer data, op->result = GINT_TO_POINTER(device_read_label(op->child)); } -static ReadLabelStatusFlags rait_device_read_label(Device * dself) { +static DeviceStatusFlags rait_device_read_label(Device * dself) { RaitDevice * self; GPtrArray * ops; - ReadLabelStatusFlags failed_result = 0; - ReadLabelStatusFlags rval; - GenericOp * failed_op = NULL; /* If this is non-null, we will isolate. */ + DeviceStatusFlags failed_result = 0; + char *failed_errmsg = NULL; unsigned int i; Device * first_success = NULL; self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); + amfree(dself->volume_time); amfree(dself->volume_label); + amfree(dself->volume_header); + + if (rait_device_in_error(self)) + return dself->status | DEVICE_STATUS_DEVICE_ERROR; + + /* nail down our block size, if we haven't already */ + if (!fix_block_size(self)) + return FALSE; ops = make_generic_boolean_op_array(self); - do_rait_child_ops(read_label_do_op, ops, NULL); + do_rait_child_ops(self, read_label_do_op, ops); for (i = 0; i < ops->len; i ++) { GenericOp * op = g_ptr_array_index(ops, i); - ReadLabelStatusFlags result = GPOINTER_TO_INT(op->result); - if (op->result == READ_LABEL_STATUS_SUCCESS) { + DeviceStatusFlags result = GPOINTER_TO_INT(op->result); + if (op->result == DEVICE_STATUS_SUCCESS) { if (first_success == NULL) { /* This is the first successful device. */ first_success = op->child; } else if (!compare_volume_results(first_success, op->child)) { /* Doesn't match. :-( */ - g_fprintf(stderr, "Inconsistant volume labels: " - "Got %s/%s against %s/%s.\n", + failed_errmsg = vstrallocf("Inconsistent volume labels/datestamps: " + "Got %s/%s on %s against %s/%s on %s.", first_success->volume_label, - first_success->volume_time, + first_success->volume_time, + first_success->device_name, op->child->volume_label, - op->child->volume_time); - failed_result |= READ_LABEL_STATUS_VOLUME_ERROR; - failed_op = NULL; + op->child->volume_time, + op->child->device_name); + g_warning("%s", failed_errmsg); + failed_result |= DEVICE_STATUS_VOLUME_ERROR; } } else { - if (failed_result == 0 && - self->private->status == RAIT_STATUS_COMPLETE) { - /* This is the first failed device; note it and we'll isolate - later. */ - failed_op = op; - failed_result = result; - } else { - /* We've encountered multiple failures. OR them together. */ - failed_result |= result; - failed_op = NULL; - } + failed_result |= result; } } - if (failed_op != NULL) { - /* We have a single device to isolate. */ - failed_result = READ_LABEL_STATUS_SUCCESS; /* Recover later */ - self->private->failed = failed_op->child_index; - g_fprintf(stderr, "RAIT array %s Isolated device %s.\n", - dself->device_name, - failed_op->child->device_name); - } - - if (failed_result != READ_LABEL_STATUS_SUCCESS) { + if (failed_result != DEVICE_STATUS_SUCCESS) { /* We had multiple failures or an inconsistency. */ - rval = failed_result; + device_set_error(dself, failed_errmsg, failed_result); } else { /* Everything peachy. */ - rval = READ_LABEL_STATUS_SUCCESS; + amfree(failed_errmsg); + g_assert(first_success != NULL); if (first_success->volume_label != NULL) { dself->volume_label = g_strdup(first_success->volume_label); @@ -726,11 +1169,14 @@ static ReadLabelStatusFlags rait_device_read_label(Device * dself) { if (first_success->volume_time != NULL) { dself->volume_time = g_strdup(first_success->volume_time); } + if (first_success->volume_header != NULL) { + dself->volume_header = dumpfile_copy(first_success->volume_header); + } } g_ptr_array_free_full(ops); - return rval; + return dself->status; } typedef struct { @@ -756,25 +1202,74 @@ static void start_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { } } -static gboolean -rait_device_start (Device * dself, DeviceAccessMode mode, char * label, +static gboolean +rait_device_configure(Device * dself, gboolean use_global_config) +{ + RaitDevice *self = RAIT_DEVICE(dself); + guint i; + + for (i = 0; i < self->private->children->len; i ++) { + Device *child; + + if ((signed)i == self->private->failed) + continue; + + child = g_ptr_array_index(self->private->children, i); + /* unconditionally configure the child without the global + * configuration */ + if (!device_configure(child, FALSE)) + return FALSE; + } + + if (parent_class->configure) { + return parent_class->configure(dself, use_global_config); + } + + return TRUE; +} + +static gboolean +rait_device_start (Device * dself, DeviceAccessMode mode, char * label, char * timestamp) { GPtrArray * ops; guint i; gboolean success; RaitDevice * self; + DeviceStatusFlags total_status; + char *failure_errmsgs = NULL; char * label_from_device = NULL; self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); - amfree(dself->volume_label); - amfree(dself->volume_time); + if (rait_device_in_error(self)) return FALSE; + + /* No starting in degraded mode. */ + if (self->private->status != RAIT_STATUS_COMPLETE && + (mode == ACCESS_WRITE || mode == ACCESS_APPEND)) { + device_set_error(dself, + g_strdup_printf(_("RAIT device %s is read-only " + "because it is in degraded mode.\n"), + dself->device_name), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + /* nail down our block size, if we haven't already */ + if (!fix_block_size(self)) + return FALSE; + + dself->access_mode = mode; + dself->in_file = FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { StartOp * op; - op = malloc(sizeof(*op)); + + if ((signed)i == self->private->failed) { + continue; + } + + op = g_new(StartOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->mode = mode; op->label = g_strdup(label); @@ -782,30 +1277,42 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, g_ptr_array_add(ops, op); } - do_rait_child_ops(start_do_op, ops, NULL); + do_rait_child_ops(self, start_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); - /* check that all of the volume labels agree */ - if (success) { - for (i = 0; i < self->private->children->len; i ++) { - Device *child = g_ptr_array_index(self->private->children, i); - + /* Check results of starting devices; this is mostly about the + * VOLUME_UNLABELED flag. */ + total_status = 0; + for (i = 0; i < ops->len; i ++) { + StartOp * op = g_ptr_array_index(ops, i); + Device *child = op->base.child; + + total_status |= child->status; + if (child->status != DEVICE_STATUS_SUCCESS) { + /* record the error message and move on. */ + append_message(&failure_errmsgs, + g_strdup_printf("%s: %s", + child->device_name, + device_error_or_status(child))); + } else { if (child->volume_label != NULL && child->volume_time != NULL) { if (dself->volume_label != NULL && dself->volume_time != NULL) { if (strcmp(child->volume_label, dself->volume_label) != 0 || strcmp(child->volume_time, dself->volume_time) != 0) { /* Mismatch! (Two devices provided different labels) */ - g_fprintf(stderr, "%s: Label (%s/%s) is different " - "from label (%s/%s) found at " - "device %s", - child->device_name, - child->volume_label, - child->volume_time, - dself->volume_label, - dself->volume_time, - label_from_device); - success = FALSE; + char * this_message = + g_strdup_printf("%s: Label (%s/%s) is different " + "from label (%s/%s) found at " + "device %s", + child->device_name, + child->volume_label, + child->volume_time, + dself->volume_label, + dself->volume_time, + label_from_device); + append_message(&failure_errmsgs, this_message); + total_status |= DEVICE_STATUS_DEVICE_ERROR; } } else { /* First device with a volume. */ @@ -815,11 +1322,11 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, } } else { /* Device problem, it says it succeeded but sets no label? */ - g_fprintf(stderr, "%s: %s", - child->device_name, - "Says label read, but device->volume_label " - " is NULL."); - success = FALSE; + char * this_message = + g_strdup_printf("%s: Says label read, but no volume " + "label found.", child->device_name); + append_message(&failure_errmsgs, this_message); + total_status |= DEVICE_STATUS_DEVICE_ERROR; } } } @@ -827,18 +1334,20 @@ rait_device_start (Device * dself, DeviceAccessMode mode, char * label, amfree(label_from_device); g_ptr_array_free_full(ops); + dself->status = total_status; + if (!success) { + device_set_error(dself, failure_errmsgs, total_status); return FALSE; - } else if (parent_class->start) { - return parent_class->start(dself, mode, label, timestamp); - } else { - return TRUE; } + + amfree(failure_errmsgs); + return TRUE; } typedef struct { GenericOp base; - const dumpfile_t * info; /* IN */ + dumpfile_t * info; /* IN */ int fileno; } StartFileOp; @@ -854,7 +1363,7 @@ static void start_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { } static gboolean -rait_device_start_file (Device * dself, const dumpfile_t * info) { +rait_device_start_file (Device * dself, dumpfile_t * info) { GPtrArray * ops; guint i; gboolean success; @@ -862,18 +1371,22 @@ rait_device_start_file (Device * dself, const dumpfile_t * info) { int actual_file = -1; self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); + + if (rait_device_in_error(self)) return FALSE; + if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { StartFileOp * op; - op = malloc(sizeof(*op)); + op = g_new(StartFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); - op->info = info; + /* each child gets its own copy of the header, to munge as it + * likes (setting blocksize, at least) */ + op->info = dumpfile_copy(info); g_ptr_array_add(ops, op); } - do_rait_child_ops(start_file_do_op, ops, NULL); + do_rait_child_ops(self, start_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); @@ -887,38 +1400,45 @@ rait_device_start_file (Device * dself, const dumpfile_t * info) { } if (actual_file != op->fileno) { /* File number mismatch! Aah, my hair is on fire! */ - g_fprintf(stderr, "File number mismatch in " - "rait_device_start_file(): " - "Child %s reported file number " - "%d, another child reported " - "file number %d.", - op->base.child->device_name, - op->fileno, actual_file); + device_set_error(dself, + g_strdup_printf("File number mismatch in " + "rait_device_start_file(): " + "Child %s reported file number " + "%d, another child reported " + "file number %d.", + op->base.child->device_name, + op->fileno, actual_file), + DEVICE_STATUS_DEVICE_ERROR); success = FALSE; op->base.result = FALSE; } } + for (i = 0; i < ops->len && success; i ++) { + StartFileOp * op = g_ptr_array_index(ops, i); + if (op->info) dumpfile_free(op->info); + } g_ptr_array_free_full(ops); - g_assert(actual_file >= 1); - dself->file = actual_file - 1; /* chain-up, below, will re-increment this */ - dself->in_file = TRUE; - if (!success) { - g_fprintf(stderr, _("One or more devices failed to start_file")); + if (!device_in_error(dself)) { + device_set_error(dself, stralloc("One or more devices " + "failed to start_file"), + DEVICE_STATUS_DEVICE_ERROR); + } return FALSE; - } else if (parent_class->start_file) { - return parent_class->start_file(dself, info); - } else { - return TRUE; } + + dself->in_file = TRUE; + g_assert(actual_file >= 1); + dself->file = actual_file; + + return TRUE; } static void find_simple_params(RaitDevice * self, guint * num_children, - guint * data_children, - int * blocksize) { + guint * data_children) { int num, data; num = self->private->children->len; @@ -930,17 +1450,12 @@ static void find_simple_params(RaitDevice * self, *num_children = num; if (data_children != NULL) *data_children = data; - - if (blocksize != NULL) { - *blocksize = device_write_min_size(DEVICE(self)); - } } typedef struct { GenericOp base; guint size; /* IN */ gpointer data; /* IN */ - gboolean short_block; /* IN */ gboolean data_needs_free; /* bookkeeping */ } WriteBlockOp; @@ -950,8 +1465,7 @@ static void write_block_do_op(gpointer data, WriteBlockOp * op = data; op->base.result = - GINT_TO_POINTER(device_write_block(op->base.child, op->size, op->data, - op->short_block)); + GINT_TO_POINTER(device_write_block(op->base.child, op->size, op->data)); } /* Parity block generation. Performance of this function can be improved @@ -996,12 +1510,12 @@ static char * extract_data_block(char * data, guint size, char * rval; guint chunk_size; - g_return_val_if_fail(chunks > 0 && chunk > 0 && chunk <= chunks, NULL); - g_return_val_if_fail(data != NULL, NULL); - g_return_val_if_fail(size > 0 && size % (chunks - 1) == 0, NULL); + g_assert(chunks > 0 && chunk > 0 && chunk <= chunks); + g_assert(data != NULL); + g_assert(size > 0 && size % (chunks - 1) == 0); chunk_size = size / (chunks - 1); - rval = malloc(chunk_size); + rval = g_malloc(chunk_size); if (chunks != chunk) { /* data block. */ memcpy(rval, data + chunk_size * (chunk - 1), chunk_size); @@ -1013,32 +1527,35 @@ static char * extract_data_block(char * data, guint size, } static gboolean -rait_device_write_block (Device * dself, guint size, gpointer data, - gboolean last_block) { +rait_device_write_block (Device * dself, guint size, gpointer data) { GPtrArray * ops; guint i; gboolean success; guint data_children, num_children; - int blocksize; + gsize blocksize = dself->block_size; RaitDevice * self; + gboolean last_block = (size < blocksize); self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); - find_simple_params(RAIT_DEVICE(self), &num_children, &data_children, - &blocksize); + if (rait_device_in_error(self)) return FALSE; + if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; + + find_simple_params(RAIT_DEVICE(self), &num_children, &data_children); num_children = self->private->children->len; if (num_children != 1) data_children = num_children - 1; else data_children = num_children; - g_return_val_if_fail(size % data_children == 0 || last_block, FALSE); + g_assert(size % data_children == 0 || last_block); + /* zero out to the end of a short block -- tape devices only write + * whole blocks. */ if (last_block) { char *new_data; - new_data = malloc(blocksize); + new_data = g_malloc(blocksize); memcpy(new_data, data, size); bzero(new_data + size, blocksize - size); @@ -1049,9 +1566,8 @@ rait_device_write_block (Device * dself, guint size, gpointer data, ops = g_ptr_array_sized_new(num_children); for (i = 0; i < self->private->children->len; i ++) { WriteBlockOp * op; - op = malloc(sizeof(*op)); + op = g_malloc(sizeof(*op)); op->base.child = g_ptr_array_index(self->private->children, i); - op->short_block = last_block; op->size = size / data_children; if (num_children <= 2) { op->data = data; @@ -1063,7 +1579,7 @@ rait_device_write_block (Device * dself, guint size, gpointer data, g_ptr_array_add(ops, op); } - do_rait_child_ops(write_block_do_op, ops, NULL); + do_rait_child_ops(self, write_block_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); @@ -1086,16 +1602,12 @@ rait_device_write_block (Device * dself, guint size, gpointer data, * status, and finish_file all of the non-EOF children. What's * more fun is when one device fails and must be isolated at * the same time another hits EOF. */ - g_fprintf(stderr, "One or more devices failed to write_block"); + device_set_error(dself, + stralloc("One or more devices failed to write_block"), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else { - /* We don't chain up here because we must handle finish_file - differently. If we were called with last_block, then the - children have already called finish_file themselves. So we - update the device block numbers manually. */ dself->block ++; - if (last_block) - dself->in_file = FALSE; return TRUE; } @@ -1105,29 +1617,41 @@ rait_device_write_block (Device * dself, guint size, gpointer data, static void finish_file_do_op(gpointer data, gpointer user_data G_GNUC_UNUSED) { GenericOp * op = data; - op->result = GINT_TO_POINTER(device_finish_file(op->child)); + if (op->child) { + op->result = GINT_TO_POINTER(device_finish_file(op->child)); + } else { + op->result = FALSE; + } } static gboolean -rait_device_finish_file (Device * self) { +rait_device_finish_file (Device * dself) { GPtrArray * ops; gboolean success; + RaitDevice * self = RAIT_DEVICE(dself); - ops = make_generic_boolean_op_array(RAIT_DEVICE(self)); + g_assert(self != NULL); + if (rait_device_in_error(dself)) return FALSE; + if (self->private->status != RAIT_STATUS_COMPLETE) return FALSE; + + ops = make_generic_boolean_op_array(self); - do_rait_child_ops(finish_file_do_op, ops, NULL); + do_rait_child_ops(self, finish_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); if (!success) { + /* TODO: be more specific here */ + device_set_error(dself, + g_strdup("One or more devices failed to finish_file"), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; - } else if (parent_class->finish_file) { - return parent_class->finish_file(self); - } else { - return TRUE; } + + dself->in_file = FALSE; + return TRUE; } typedef struct { @@ -1151,21 +1675,27 @@ rait_device_seek_file (Device * dself, guint file) { dumpfile_t * rval; RaitDevice * self = RAIT_DEVICE(dself); guint actual_file = 0; - g_return_val_if_fail(self != NULL, FALSE); + gboolean in_file = FALSE; + + if (rait_device_in_error(self)) return NULL; + + dself->in_file = FALSE; + dself->is_eof = FALSE; + dself->block = 0; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { SeekFileOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ - op = malloc(sizeof(*op)); + op = g_new(SeekFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; op->requested_file = file; g_ptr_array_add(ops, op); } - do_rait_child_ops(seek_file_do_op, ops, NULL); + do_rait_child_ops(self, seek_file_do_op, ops); /* This checks for NULL values, but we still have to check for consistant headers. */ @@ -1173,23 +1703,29 @@ rait_device_seek_file (Device * dself, guint file) { ops, extract_boolean_pointer_op); rval = NULL; - for (i = 0; i < self->private->children->len; i ++) { + for (i = 0; i < ops->len; i ++) { SeekFileOp * this_op; dumpfile_t * this_result; guint this_actual_file; - if ((int)i == self->private->failed) - continue; + gboolean this_in_file; this_op = (SeekFileOp*)g_ptr_array_index(ops, i); + + if ((signed)this_op->base.child_index == self->private->failed) + continue; + this_result = this_op->base.result; this_actual_file = this_op->actual_file; + this_in_file = this_op->base.child->in_file; if (rval == NULL) { rval = this_result; actual_file = this_actual_file; + in_file = this_in_file; } else { if (headers_are_equal(rval, this_result) && - actual_file == this_actual_file) { + actual_file == this_actual_file && + in_file == this_in_file) { /* Do nothing. */ } else { success = FALSE; @@ -1202,11 +1738,17 @@ rait_device_seek_file (Device * dself, guint file) { if (!success) { amfree(rval); + /* TODO: be more specific here */ + device_set_error(dself, + g_strdup("One or more devices failed to seek_file"), + DEVICE_STATUS_DEVICE_ERROR); return NULL; - } else if (parent_class->seek_file) { - parent_class->seek_file(dself, file); } + /* update our state */ + dself->in_file = in_file; + dself->file = actual_file; + return rval; } @@ -1229,21 +1771,22 @@ rait_device_seek_block (Device * dself, guint64 block) { gboolean success; RaitDevice * self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); + + if (rait_device_in_error(self)) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { SeekBlockOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ - op = malloc(sizeof(*op)); + op = g_new(SeekBlockOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; op->block = block; g_ptr_array_add(ops, op); } - do_rait_child_ops(seek_block_do_op, ops, NULL); + do_rait_child_ops(self, seek_block_do_op, ops); success = g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_generic_op); @@ -1251,12 +1794,15 @@ rait_device_seek_block (Device * dself, guint64 block) { g_ptr_array_free_full(ops); if (!success) { + /* TODO: be more specific here */ + device_set_error(dself, + stralloc("One or more devices failed to seek_block"), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; - } else if (parent_class->seek_block) { - return parent_class->seek_block(dself, block); - } else { - return success; } + + dself->block = block; + return TRUE; } typedef struct { @@ -1273,6 +1819,10 @@ static void read_block_do_op(gpointer data, op->base.result = GINT_TO_POINTER(device_read_block(op->base.child, op->buffer, &(op->read_size))); + if (op->read_size > op->desired_read_size) { + g_warning("child device %s tried to return an oversized block, which the RAIT device does not support", + op->base.child->device_name); + } } /* A BooleanExtractor. This one checks for a successful read. */ @@ -1302,14 +1852,18 @@ static int g_ptr_array_count(GPtrArray * array, BooleanExtractor filter) { static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, gpointer buf, size_t bufsize) { guint num_children, data_children; - int blocksize, child_blocksize; + gsize blocksize; + gsize child_blocksize; guint i; int parity_child; gpointer parity_block = NULL; gboolean success; success = TRUE; - find_simple_params(self, &num_children, &data_children, &blocksize); + + blocksize = DEVICE(self)->block_size; + find_simple_params(self, &num_children, &data_children); + if (num_children > 1) parity_child = num_children - 1; else @@ -1329,6 +1883,7 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, child_blocksize); } } + g_assert(parity_block != NULL); /* should have found parity_child */ if (self->private->status == RAIT_STATUS_COMPLETE) { if (num_children >= 2) { @@ -1337,7 +1892,7 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, gpointer constructed_parity; GPtrArray * data_extents; - constructed_parity = malloc(child_blocksize); + constructed_parity = g_malloc(child_blocksize); data_extents = g_ptr_array_sized_new(data_children); for (i = 0; i < data_children; i ++) { ReadBlockOp * op = g_ptr_array_index(ops, i); @@ -1351,8 +1906,10 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, if (0 != memcmp(parity_block, constructed_parity, child_blocksize)) { - g_fprintf(stderr, "RAIT is inconsistant: " - "Parity block did not match data blocks.\n"); + device_set_error(DEVICE(self), + stralloc(_("RAIT is inconsistent: Parity block did not match data blocks.")), + DEVICE_STATUS_DEVICE_ERROR); + /* TODO: can't we just isolate the device in this case? */ success = FALSE; } g_ptr_array_free(data_extents, TRUE); @@ -1388,6 +1945,7 @@ static gboolean raid_block_reconstruction(RaitDevice * self, GPtrArray * ops, g_assert_not_reached(); } } else { + /* device is already in FAILED state -- we shouldn't even be here */ success = FALSE; } return success; @@ -1399,24 +1957,23 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) { guint i; gboolean success; guint num_children, data_children; - int blocksize; + gsize blocksize = dself->block_size; gsize child_blocksize; RaitDevice * self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, -1); - find_simple_params(self, &num_children, &data_children, - &blocksize); + if (rait_device_in_error(self)) return -1; + + find_simple_params(self, &num_children, &data_children); /* tell caller they haven't given us a big enough buffer */ - if (blocksize < *size) { - *size = blocksize; + if (blocksize > (gsize)*size) { + g_assert(blocksize < INT_MAX); + *size = (int)blocksize; return 0; } - g_return_val_if_fail(*size >= (int)device_write_min_size(dself), -1); - - g_assert(blocksize % data_children == 0); /* If not we are screwed */ + g_assert(blocksize % data_children == 0); /* see find_block_size */ child_blocksize = blocksize / data_children; ops = g_ptr_array_sized_new(num_children); @@ -1424,22 +1981,27 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) { ReadBlockOp * op; if ((int)i == self->private->failed) continue; /* This device is broken. */ - op = malloc(sizeof(*op)); + op = g_new(ReadBlockOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->base.child_index = i; - op->buffer = malloc(child_blocksize); - op->desired_read_size = op->read_size = blocksize / data_children; + op->buffer = g_malloc(child_blocksize); + op->desired_read_size = op->read_size = child_blocksize; g_ptr_array_add(ops, op); } - do_rait_child_ops(read_block_do_op, ops, NULL); + do_rait_child_ops(self, read_block_do_op, ops); if (g_ptr_array_count(ops, extract_boolean_read_block_op_data)) { if (!g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_read_block_op_data)) { + /* TODO: be more specific */ + device_set_error(dself, + stralloc(_("Error occurred combining blocks from child devices")), + DEVICE_STATUS_DEVICE_ERROR); success = FALSE; } else { + /* raid_block_reconstruction sets the error status if necessary */ success = raid_block_reconstruction(RAIT_DEVICE(self), ops, buf, (size_t)*size); } @@ -1448,11 +2010,15 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) { if (g_ptr_array_union_robust(RAIT_DEVICE(self), ops, extract_boolean_read_block_op_eof)) { - /* We hit EOF. */ + device_set_error(dself, + stralloc(_("EOF")), + DEVICE_STATUS_SUCCESS); dself->is_eof = TRUE; dself->in_file = FALSE; } else { - g_fprintf(stderr, _("All child devices failed to read, but not all are at eof")); + device_set_error(dself, + stralloc(_("All child devices failed to read, but not all are at eof")), + DEVICE_STATUS_DEVICE_ERROR); } } @@ -1463,8 +2029,7 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) { g_ptr_array_free_full(ops); if (success) { - if (parent_class->read_block) - parent_class->read_block(dself, buf, size); + dself->block++; *size = blocksize; return blocksize; } else { @@ -1472,29 +2037,41 @@ rait_device_read_block (Device * dself, gpointer buf, int * size) { } } +/* property utility functions */ + typedef struct { GenericOp base; DevicePropertyId id; /* IN */ GValue value; /* IN/OUT */ - gboolean label_changed; /* Did the device label change? OUT; _set only*/ + PropertySurety surety; /* IN (for set) */ + PropertySource source; /* IN (for set) */ } PropertyOp; /* Creates a GPtrArray of PropertyOf for a get or set operation. */ static GPtrArray * make_property_op_array(RaitDevice * self, DevicePropertyId id, - GValue * value) { + GValue * value, + PropertySurety surety, + PropertySource source) { guint i; GPtrArray * ops; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { PropertyOp * op; - op = malloc(sizeof(*op)); + + if ((signed)i == self->private->failed) { + continue; + } + + op = g_new(PropertyOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->id = id; bzero(&(op->value), sizeof(op->value)); if (value != NULL) { g_value_unset_copy(value, &(op->value)); } + op->surety = surety; + op->source = source; g_ptr_array_add(ops, op); } @@ -1512,16 +2089,134 @@ static void property_get_do_op(gpointer data, &(op->value))); } -/* Merge ConcurrencyParadigm results. */ -static gboolean property_get_concurrency(GPtrArray * ops, GValue * val) { - ConcurrencyParadigm result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; - guint i = 0; - +/* A GFunc. */ +static void property_set_do_op(gpointer data, + gpointer user_data G_GNUC_UNUSED) { + PropertyOp * op = data; + + op->base.result = + GINT_TO_POINTER(device_property_set_ex(op->base.child, op->id, + &(op->value), op->surety, + op->source)); + g_value_unset(&(op->value)); +} + +/* PropertyGetFns and PropertySetFns */ + +static gboolean +property_get_block_size_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + gsize my_block_size; + + if (dself->block_size_source != PROPERTY_SOURCE_DEFAULT) { + my_block_size = dself->block_size; + + if (surety) + *surety = dself->block_size_surety; + } else { + gsize child_block_size; + child_block_size = calculate_block_size_from_children(self, + &my_block_size); + if (child_block_size == 0) + return FALSE; + + if (surety) + *surety = PROPERTY_SURETY_BAD; /* may still change */ + } + + if (val) { + g_value_unset_init(val, G_TYPE_INT); + g_assert(my_block_size < G_MAXINT); /* gsize -> gint */ + g_value_set_int(val, (gint)my_block_size); + } + + if (source) + *source = dself->block_size_source; + + return TRUE; +} + +static gboolean +property_set_block_size_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety surety, PropertySource source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + gint my_block_size = g_value_get_int(val); + guint data_children; + + find_simple_params(self, NULL, &data_children); + if ((my_block_size % data_children) != 0) { + device_set_error(dself, + vstrallocf(_("Block size must be a multiple of %d"), data_children), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + dself->block_size = my_block_size; + dself->block_size_source = source; + dself->block_size_surety = surety; + + if (!fix_block_size(self)) + return FALSE; + + return TRUE; +} + +static gboolean +property_get_canonical_name_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + char *canonical = child_device_names_to_rait_name(self); + + if (val) { + g_value_unset_init(val, G_TYPE_STRING); + g_value_set_string(val, canonical); + g_free(canonical); + } + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + + return TRUE; +} + +static gboolean +property_get_concurrency_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + ConcurrencyParadigm result; + guint i; + GPtrArray * ops; + gboolean success; + + ops = make_property_op_array(self, PROPERTY_CONCURRENCY, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); + + /* find the most restrictive paradigm acceptable to all + * child devices */ + result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; + success = TRUE; for (i = 0; i < ops->len; i ++) { ConcurrencyParadigm cur; PropertyOp * op = g_ptr_array_index(ops, i); - g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == - CONCURRENCY_PARADIGM_TYPE, FALSE); + + if (!op->base.result + || G_VALUE_TYPE(&(op->value)) != CONCURRENCY_PARADIGM_TYPE) { + success = FALSE; + break; + } + cur = g_value_get_enum(&(op->value)); if (result == CONCURRENCY_PARADIGM_EXCLUSIVE || cur == CONCURRENCY_PARADIGM_EXCLUSIVE) { @@ -1533,25 +2228,57 @@ static gboolean property_get_concurrency(GPtrArray * ops, GValue * val) { cur == CONCURRENCY_PARADIGM_RANDOM_ACCESS) { result = CONCURRENCY_PARADIGM_RANDOM_ACCESS; } else { - g_return_val_if_fail(FALSE, FALSE); + success = FALSE; + break; } } - g_value_unset_init(val, CONCURRENCY_PARADIGM_TYPE); - g_value_set_enum(val, result); - return TRUE; + g_ptr_array_free_full(ops); + + if (success) { + if (val) { + g_value_unset_init(val, CONCURRENCY_PARADIGM_TYPE); + g_value_set_enum(val, result); + } + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + } + + return success; } -/* Merge StreamingRequirement results. */ -static gboolean property_get_streaming(GPtrArray * ops, GValue * val) { - StreamingRequirement result = STREAMING_REQUIREMENT_NONE; - guint i = 0; - +static gboolean +property_get_streaming_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + StreamingRequirement result; + guint i; + GPtrArray * ops; + gboolean success; + + ops = make_property_op_array(self, PROPERTY_STREAMING, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); + + /* combine the child streaming requirements, selecting the strongest + * requirement of the bunch. */ + result = STREAMING_REQUIREMENT_NONE; + success = TRUE; for (i = 0; i < ops->len; i ++) { StreamingRequirement cur; PropertyOp * op = g_ptr_array_index(ops, i); - g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == - STREAMING_REQUIREMENT_TYPE, FALSE); + + if (!op->base.result + || G_VALUE_TYPE(&(op->value)) != STREAMING_REQUIREMENT_TYPE) { + success = FALSE; + break; + } + cur = g_value_get_enum(&(op->value)); if (result == STREAMING_REQUIREMENT_REQUIRED || cur == STREAMING_REQUIREMENT_REQUIRED) { @@ -1563,68 +2290,182 @@ static gboolean property_get_streaming(GPtrArray * ops, GValue * val) { cur == STREAMING_REQUIREMENT_NONE) { result = STREAMING_REQUIREMENT_NONE; } else { - g_return_val_if_fail(FALSE, FALSE); + success = FALSE; + break; } } - g_value_unset_init(val, STREAMING_REQUIREMENT_TYPE); - g_value_set_enum(val, result); - return TRUE; + g_ptr_array_free_full(ops); + + if (success) { + if (val) { + g_value_unset_init(val, STREAMING_REQUIREMENT_TYPE); + g_value_set_enum(val, result); + } + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + } + + return success; +} + +static gboolean +property_get_boolean_and_fn(Device *dself, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + gboolean result; + guint i; + GPtrArray * ops; + gboolean success; + + ops = make_property_op_array(self, base->ID, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); + + /* combine the child values, applying a simple AND */ + result = TRUE; + success = TRUE; + for (i = 0; i < ops->len; i ++) { + PropertyOp * op = g_ptr_array_index(ops, i); + + if (!op->base.result || !G_VALUE_HOLDS_BOOLEAN(&(op->value))) { + success = FALSE; + break; + } + + if (!g_value_get_boolean(&(op->value))) { + result = FALSE; + break; + } + } + + g_ptr_array_free_full(ops); + + if (success) { + if (val) { + g_value_unset_init(val, G_TYPE_BOOLEAN); + g_value_set_boolean(val, result); + } + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + } + + return success; } - -/* Merge MediaAccessMode results. */ -static gboolean property_get_medium_type(GPtrArray * ops, GValue * val) { - MediaAccessMode result = 0; - guint i = 0; +static gboolean +property_get_medium_access_type_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + MediaAccessMode result; + guint i; + GPtrArray * ops; + gboolean success; + + ops = make_property_op_array(self, PROPERTY_MEDIUM_ACCESS_TYPE, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); + + /* combine the modes as best we can */ + result = 0; + success = TRUE; for (i = 0; i < ops->len; i ++) { MediaAccessMode cur; PropertyOp * op = g_ptr_array_index(ops, i); - g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == - MEDIA_ACCESS_MODE_TYPE, FALSE); + + if (!op->base.result || G_VALUE_TYPE(&(op->value)) != MEDIA_ACCESS_MODE_TYPE) { + success = FALSE; + break; + } + cur = g_value_get_enum(&(op->value)); - - if (i == 0) { - result = cur; - } else if ((result == MEDIA_ACCESS_MODE_READ_ONLY && - cur == MEDIA_ACCESS_MODE_WRITE_ONLY) || - (result == MEDIA_ACCESS_MODE_WRITE_ONLY && - cur == MEDIA_ACCESS_MODE_READ_ONLY)) { - /* Invalid combination; one device can only read, other - can only write. */ - return FALSE; - } else if (result == MEDIA_ACCESS_MODE_READ_ONLY || - cur == MEDIA_ACCESS_MODE_READ_ONLY) { - result = MEDIA_ACCESS_MODE_READ_ONLY; - } else if (result == MEDIA_ACCESS_MODE_WRITE_ONLY || - cur == MEDIA_ACCESS_MODE_WRITE_ONLY) { - result = MEDIA_ACCESS_MODE_WRITE_ONLY; - } else if (result == MEDIA_ACCESS_MODE_WORM || - cur == MEDIA_ACCESS_MODE_WORM) { - result = MEDIA_ACCESS_MODE_WORM; - } else if (result == MEDIA_ACCESS_MODE_READ_WRITE && - cur == MEDIA_ACCESS_MODE_READ_WRITE) { - result = MEDIA_ACCESS_MODE_READ_WRITE; - } else { - g_return_val_if_fail(FALSE, FALSE); - } + + if (i == 0) { + result = cur; + } else if ((result == MEDIA_ACCESS_MODE_READ_ONLY && + cur == MEDIA_ACCESS_MODE_WRITE_ONLY) || + (result == MEDIA_ACCESS_MODE_WRITE_ONLY && + cur == MEDIA_ACCESS_MODE_READ_ONLY)) { + /* Invalid combination; one device can only read, other + can only write. */ + success = FALSE; + break; + } else if (result == MEDIA_ACCESS_MODE_READ_ONLY || + cur == MEDIA_ACCESS_MODE_READ_ONLY) { + result = MEDIA_ACCESS_MODE_READ_ONLY; + } else if (result == MEDIA_ACCESS_MODE_WRITE_ONLY || + cur == MEDIA_ACCESS_MODE_WRITE_ONLY) { + result = MEDIA_ACCESS_MODE_WRITE_ONLY; + } else if (result == MEDIA_ACCESS_MODE_WORM || + cur == MEDIA_ACCESS_MODE_WORM) { + result = MEDIA_ACCESS_MODE_WORM; + } else if (result == MEDIA_ACCESS_MODE_READ_WRITE && + cur == MEDIA_ACCESS_MODE_READ_WRITE) { + result = MEDIA_ACCESS_MODE_READ_WRITE; + } else { + success = FALSE; + break; + } } - - g_value_unset_init(val, MEDIA_ACCESS_MODE_TYPE); - g_value_set_enum(val, result); - return TRUE; + + g_ptr_array_free_full(ops); + + if (success) { + if (val) { + g_value_unset_init(val, MEDIA_ACCESS_MODE_TYPE); + g_value_set_enum(val, result); + } + + if (surety) + *surety = PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + } + + return success; } - -/* Merge QualifiedSize results. */ -static gboolean property_get_free_space(GPtrArray * ops, GValue * val) { + +static gboolean +property_get_free_space_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); QualifiedSize result; - guint i = 0; + guint i; + GPtrArray * ops; + guint data_children; + + ops = make_property_op_array(self, PROPERTY_MEDIUM_ACCESS_TYPE, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); + /* Find the minimal available space of any child, with some funny business + * to deal with varying degrees of accuracy. */ + result.accuracy = SIZE_ACCURACY_UNKNOWN; + result.bytes = 0; for (i = 0; i < ops->len; i ++) { QualifiedSize cur; PropertyOp * op = g_ptr_array_index(ops, i); - g_return_val_if_fail(G_VALUE_TYPE(&(op->value)) == - QUALIFIED_SIZE_TYPE, FALSE); + + if (!op->base.result || G_VALUE_TYPE(&(op->value)) != QUALIFIED_SIZE_TYPE) { + /* maybe this child can't tell us .. so this is just an estimate */ + if (result.accuracy == SIZE_ACCURACY_REAL) + result.accuracy = SIZE_ACCURACY_ESTIMATE; + + continue; + } + cur = *(QualifiedSize*)(g_value_get_boxed(&(op->value))); if (result.accuracy != cur.accuracy) { @@ -1642,171 +2483,124 @@ static gboolean property_get_free_space(GPtrArray * ops, GValue * val) { } } - g_value_unset_init(val, QUALIFIED_SIZE_TYPE); - g_value_set_boxed(val, &result); - return TRUE; -} - -/* Merge boolean results by ANDing them together. */ -static gboolean property_get_boolean_and(GPtrArray * ops, GValue * val) { - gboolean result = FALSE; - guint i = 0; + g_ptr_array_free_full(ops); - for (i = 0; i < ops->len; i ++) { - gboolean cur; - PropertyOp * op = g_ptr_array_index(ops, i); - g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(&(op->value)), FALSE); - cur = g_value_get_boolean(&(op->value)); + /* result contains the minimum size available on any child. We + * can use that space on each of our data children, so the total + * is larger */ + find_simple_params(self, NULL, &data_children); + result.bytes *= data_children; - result = result && cur; + if (val) { + g_value_unset_init(val, QUALIFIED_SIZE_TYPE); + g_value_set_boxed(val, &result); } - g_value_unset_init(val, G_TYPE_BOOLEAN); - g_value_set_boolean(val, result); + if (surety) + *surety = (result.accuracy == SIZE_ACCURACY_UNKNOWN)? + PROPERTY_SURETY_BAD : PROPERTY_SURETY_GOOD; + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + return TRUE; } - -static gboolean -rait_device_property_get (Device * dself, DevicePropertyId id, GValue * val) { - GPtrArray * ops; +static gboolean +property_get_max_volume_usage_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + guint64 result; guint i; - gboolean success; - GValue result; - GValue * first_value; - RaitDevice * self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); + GPtrArray * ops; + guint data_children; - /* Some properties are handled completely differently. */ - if (id == PROPERTY_BLOCK_SIZE) { - g_value_unset_init(val, G_TYPE_INT); - g_value_set_int(val, self->private->block_size); - return TRUE; - } else if (id == PROPERTY_MIN_BLOCK_SIZE || - id == PROPERTY_MAX_BLOCK_SIZE) { - g_value_unset_init(val, G_TYPE_UINT); - g_value_set_uint(val, self->private->block_size); - return TRUE; - } else if (id == PROPERTY_CANONICAL_NAME) { - if (parent_class->property_get != NULL) { - return parent_class->property_get(dself, id, val); - } else { - return FALSE; - } - } + ops = make_property_op_array(self, PROPERTY_MAX_VOLUME_USAGE, NULL, 0, 0); + do_rait_child_ops(self, property_get_do_op, ops); - ops = make_property_op_array(self, id, NULL); - - do_rait_child_ops(property_get_do_op, ops, NULL); - - if (id == PROPERTY_CONCURRENCY) { - success = property_get_concurrency(ops, val); - } else if (id == PROPERTY_STREAMING) { - success = property_get_streaming(ops, val); - } else if (id == PROPERTY_APPENDABLE || - id == PROPERTY_PARTIAL_DELETION) { - success = property_get_boolean_and(ops, val); - } else if (id == PROPERTY_MEDIUM_TYPE) { - success = property_get_medium_type(ops, val); - } else if (id == PROPERTY_FREE_SPACE) { - success = property_get_free_space(ops, val); - } else { - /* Generic handling; if all results are the same, we succeed - and return that result. If not, we fail. */ - success = TRUE; - - /* Set up comparison value. */ - bzero(&result, sizeof(result)); - first_value = &(((PropertyOp*)g_ptr_array_index(ops,0))->value); - if (G_IS_VALUE(first_value)) { - g_value_unset_copy(first_value, &result); - } else { - success = FALSE; - } - - for (i = 0; i < ops->len; i ++) { - PropertyOp * op = g_ptr_array_index(ops, i); - if (!GPOINTER_TO_INT(op->base.result) || - !G_IS_VALUE(first_value) || - !g_value_compare(&result, &(op->value))) { - success = FALSE; - } - /* free the GValue if the child call succeeded */ - if (GPOINTER_TO_INT(op->base.result)) - g_value_unset(&(op->value)); - } + /* look for the smallest value that is set */ + result = 0; + for (i = 0; i < ops->len; i ++) { + guint64 cur; + PropertyOp * op = g_ptr_array_index(ops, i); - if (success) { - memcpy(val, &result, sizeof(result)); - } else if (G_IS_VALUE(&result)) { - g_value_unset(&result); - } + if (!op->base.result || !G_VALUE_HOLDS_UINT64(&(op->value))) { + continue; /* ignore children without this property */ + } + + cur = g_value_get_uint64(&(op->value)); + + result = MIN(cur, result); } g_ptr_array_free_full(ops); - return success; -} + if (result) { + /* result contains the minimum usage on any child. We can use that space + * on each of our data children, so the total is larger */ + find_simple_params(self, NULL, &data_children); + result *= data_children; -/* A GFunc. */ -static void property_set_do_op(gpointer data, - gpointer user_data G_GNUC_UNUSED) { - PropertyOp * op = data; - gboolean label_set = (op->base.child->volume_label != NULL); - op->base.result = - GINT_TO_POINTER(device_property_set(op->base.child, op->id, - &(op->value))); - op->label_changed = (label_set != (op->base.child->volume_label != NULL)); -} + if (val) { + g_value_unset_init(val, G_TYPE_UINT64); + g_value_set_uint64(val, result); + } -/* A BooleanExtractor */ -static gboolean extract_label_changed_property_op(gpointer data) { - PropertyOp * op = data; - return op->label_changed; -} + if (surety) + *surety = PROPERTY_SURETY_GOOD; -/* A GFunc. */ -static void clear_volume_details_do_op(gpointer data, - gpointer user_data G_GNUC_UNUSED) { - GenericOp * op = data; - device_clear_volume_details(op->child); + if (source) + *source = PROPERTY_SOURCE_DETECTED; + + return TRUE; + } else { + /* no result from any children, so we effectively don't have this property */ + return FALSE; + } } -static gboolean -rait_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) { - RaitDevice * self; - GPtrArray * ops; +static gboolean +property_set_max_volume_usage_fn(Device *dself, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety surety, PropertySource source) +{ + RaitDevice *self = RAIT_DEVICE(dself); + guint64 parent_usage; + guint64 child_usage; + GValue child_val; + guint i; gboolean success; - gboolean label_changed; + GPtrArray * ops; + guint data_children; - self = RAIT_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); + parent_usage = g_value_get_uint64(val); + find_simple_params(self, NULL, &data_children); - /* it doesn't make sense to hand these properties down to our child devices, - * so we'll just pretend we set them. This is a 2.6.0 hack -- the device gets - * this right in 2.6.1. */ - if (id == PROPERTY_BLOCK_SIZE - || id == PROPERTY_MIN_BLOCK_SIZE - || id == PROPERTY_MAX_BLOCK_SIZE) { - return TRUE; /* lies! */ - } + child_usage = parent_usage / data_children; - ops = make_property_op_array(self, id, val); - - do_rait_child_ops(property_set_do_op, ops, NULL); + bzero(&child_val, sizeof(child_val)); + g_value_init(&child_val, G_TYPE_UINT64); + g_value_set_uint64(&child_val, child_usage); - success = g_ptr_array_union_robust(self, ops, extract_boolean_generic_op); - label_changed = g_ptr_array_or(ops, extract_label_changed_property_op); - g_ptr_array_free_full(ops); + ops = make_property_op_array(self, PROPERTY_MAX_VOLUME_USAGE, + &child_val, surety, source); + do_rait_child_ops(self, property_set_do_op, ops); + + /* if any of the kids succeeded, then we did too */ + success = FALSE; + for (i = 0; i < ops->len; i ++) { + PropertyOp * op = g_ptr_array_index(ops, i); - if (label_changed) { - /* At least one device considered this property set a label-changing - * operation, so now we clear labels on all devices. */ - ops = make_generic_boolean_op_array(self); - do_rait_child_ops(clear_volume_details_do_op, ops, NULL); - g_ptr_array_free_full(ops); + if (op->base.result) { + success = TRUE; + break; + } } + g_ptr_array_free_full(ops); + return success; } @@ -1830,30 +2624,32 @@ rait_device_recycle_file (Device * dself, guint filenum) { gboolean success; RaitDevice * self = RAIT_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); + + if (rait_device_in_error(self)) return FALSE; ops = g_ptr_array_sized_new(self->private->children->len); for (i = 0; i < self->private->children->len; i ++) { RecycleFileOp * op; - op = malloc(sizeof(*op)); + op = g_new(RecycleFileOp, 1); op->base.child = g_ptr_array_index(self->private->children, i); op->filenum = filenum; g_ptr_array_add(ops, op); } - do_rait_child_ops(recycle_file_do_op, ops, NULL); + do_rait_child_ops(self, recycle_file_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); if (!success) { + /* TODO: be more specific here */ + device_set_error(dself, + stralloc(_("One or more devices failed to recycle_file")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; - } else if (parent_class->recycle_file) { - return parent_class->recycle_file(dself, filenum); - } else { - return TRUE; } + return TRUE; } /* GFunc */ @@ -1867,65 +2663,31 @@ rait_device_finish (Device * self) { GPtrArray * ops; gboolean success; + if (rait_device_in_error(self)) return FALSE; + ops = make_generic_boolean_op_array(RAIT_DEVICE(self)); - do_rait_child_ops(finish_do_op, ops, NULL); + do_rait_child_ops(RAIT_DEVICE(self), finish_do_op, ops); success = g_ptr_array_and(ops, extract_boolean_generic_op); g_ptr_array_free_full(ops); - if (!success) { + self->access_mode = ACCESS_NULL; + + if (!success) return FALSE; - } else if (parent_class->finish) { - return parent_class->finish(self); - } else { - return TRUE; - } + + return TRUE; } -Device * -rait_device_factory (char * type, char * name) { +static Device * +rait_device_factory (char * device_name, char * device_type, char * device_node) { Device * rval; - g_assert(0 == strcmp(type, "rait")); + g_assert(0 == strcmp(device_type, "rait")); rval = DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL)); - if (!device_open_device(rval, name)) { - g_object_unref(rval); - return NULL; - } else { - return rval; - } -} - -Device * rait_device_new_from_devices(Device ** devices) { - RaitDevice * rval; - int i; - gboolean success = TRUE; - - g_return_val_if_fail(devices != NULL && *devices != NULL, NULL); - - rval = RAIT_DEVICE(g_object_new(TYPE_RAIT_DEVICE, NULL)); - - for (i = 0; devices[i] != NULL; i ++) { - g_assert(IS_DEVICE(devices[i])); - if (devices[i]->access_mode != ACCESS_NULL) { - success = FALSE; - break; - } - g_object_ref(devices[i]); - g_ptr_array_add(PRIVATE(rval)->children, devices[i]); - } - - success = success && find_block_size(rval); - - if (!success) { - g_ptr_array_free(PRIVATE(rval)->children, TRUE); - return NULL; - } else { - register_properties(rval); - - return DEVICE(rval); - } + device_open_device(rval, device_name, device_type, device_node); + return rval; } void diff --git a/device-src/rait-device.h b/device-src/rait-device.h deleted file mode 100644 index b7df6bb..0000000 --- a/device-src/rait-device.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -/* The RAIT device encapsulates some number of other devices into a single - * redundant device. */ - -#ifndef RAIT_DEVICE_H -#define RAIT_DEVICE_H - -#include -#include -#include "device.h" - -/* - * Type checking and casting macros - */ -#define TYPE_RAIT_DEVICE (rait_device_get_type()) -#define RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice) -#define RAIT_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), rait_device_get_type(), RaitDevice const) -#define RAIT_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), rait_device_get_type(), RaitDeviceClass) -#define IS_RAIT_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), rait_device_get_type ()) - -#define RAIT_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), rait_device_get_type(), RaitDeviceClass) - -/* - * Main object structure - */ -typedef struct RaitDevicePrivate_s RaitDevicePrivate; -typedef struct RaitDevice_s { - Device __parent__; - - RaitDevicePrivate * private; -} RaitDevice; - -/* - * Class definition - */ -typedef struct _RaitDeviceClass RaitDeviceClass; -struct _RaitDeviceClass { - DeviceClass __parent__; -}; - - -/* - * Public methods - */ -GType rait_device_get_type (void); -Device * rait_device_factory (char * type, - char * name); -/* Pass this factory a NULL-terminated array of Devices, and it will make a - RAIT out of them. The returned device refss the passed devices, so unref - them yourself. */ -Device * rait_device_new_from_devices(Device ** devices); -void rait_device_register (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif diff --git a/device-src/s3-device.c b/device-src/s3-device.c index bebb6ef..0fe3bb0 100644 --- a/device-src/s3-device.c +++ b/device-src/s3-device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* An S3 device uses Amazon's S3 service (http://www.amazon.com/s3) to store @@ -35,7 +35,7 @@ #include "amanda.h" #include "conffile.h" #include "device.h" -#include "s3-device.h" +#include "s3.h" #include #ifdef HAVE_OPENSSL_HMAC_H # include @@ -49,16 +49,81 @@ # endif #endif +/* + * Type checking and casting macros + */ +#define TYPE_S3_DEVICE (s3_device_get_type()) +#define S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device) +#define S3_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device const) +#define S3_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), s3_device_get_type(), S3DeviceClass) +#define IS_S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), s3_device_get_type ()) + +#define S3_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), s3_device_get_type(), S3DeviceClass) +static GType s3_device_get_type (void); + +/* + * Main object structure + */ +typedef struct _S3MetadataFile S3MetadataFile; + +typedef struct _S3Device S3Device; +struct _S3Device { + Device __parent__; + + /* The "easy" curl handle we use to access Amazon S3 */ + S3Handle *s3; + + /* S3 access information */ + char *bucket; + char *prefix; + + /* The S3 access information. */ + char *secret_key; + char *access_key; + char *user_token; + gboolean is_devpay; + + char *bucket_location; + + /* a cache for unsuccessful reads (where we get the file but the caller + * doesn't have space for it or doesn't want it), where we expect the + * next call will request the same file. + */ + char *cached_buf; + char *cached_key; + int cached_size; + + /* Produce verbose output? */ + gboolean verbose; + + /* Use SSL? */ + gboolean use_ssl; +}; + +/* + * Class definition + */ +typedef struct _S3DeviceClass S3DeviceClass; +struct _S3DeviceClass { + DeviceClass __parent__; +}; + + /* * Constants and static data */ +#define S3_DEVICE_NAME "s3" +#define DEVPAY_DEVICE_NAME "s3zmanda" + /* Maximum key length as specified in the S3 documentation * (*excluding* null terminator) */ #define S3_MAX_KEY_LENGTH 1024 +/* Note: for compatability, min can only be decreased and max increased */ #define S3_DEVICE_MIN_BLOCK_SIZE 1024 -#define S3_DEVICE_MAX_BLOCK_SIZE (10*1024*1024) +#define S3_DEVICE_MAX_BLOCK_SIZE (100*1024*1024) +#define S3_DEVICE_DEFAULT_BLOCK_SIZE (10*1024*1024) /* This goes in lieu of file number for metadata. */ #define SPECIAL_INFIX "special-" @@ -66,10 +131,35 @@ /* pointer to the class of our parent */ static DeviceClass *parent_class = NULL; +/* + * device-specific properties + */ + +/* Authentication information for Amazon S3. Both of these are strings. */ +static DevicePropertyBase device_property_s3_access_key; +static DevicePropertyBase device_property_s3_secret_key; +#define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID) +#define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID) + +/* Same, but for S3 with DevPay. */ +static DevicePropertyBase device_property_s3_user_token; +#define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID) + +/* Location constraint for new buckets created on Amazon S3. */ +static DevicePropertyBase device_property_s3_bucket_location; +#define PROPERTY_S3_BUCKET_LOCATION (device_property_s3_bucket_location.ID) + +/* Whether to use SSL with Amazon S3. */ +static DevicePropertyBase device_property_s3_ssl; +#define PROPERTY_S3_SSL (device_property_s3_ssl.ID) + + /* * prototypes */ +void s3_device_register(void); + /* * utility functions */ @@ -133,17 +223,15 @@ static gboolean delete_file(S3Device *self, int file); -/* Set up self->s3 as best as possible. Unless SILENT is TRUE, - * any problems will generate warnings (with g_warning). Regardless, - * the return value is TRUE iff self->s3 is useable. +/* Set up self->s3 as best as possible. + * + * The return value is TRUE iff self->s3 is useable. * * @param self: the S3Device object - * @param silent: silence warnings * @returns: TRUE if the handle is set up */ static gboolean -setup_handle(S3Device * self, - gboolean ignore_problems); +setup_handle(S3Device * self); /* * class mechanics */ @@ -158,17 +246,43 @@ static void s3_device_finalize(GObject * o); static Device* -s3_device_factory(char * device_type, - char * device_name); +s3_device_factory(char * device_name, char * device_type, char * device_node); + +/* + * Property{Get,Set}Fns */ + +static gboolean s3_device_set_access_key_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean s3_device_set_secret_key_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean s3_device_set_user_token_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean s3_device_set_bucket_location_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean s3_device_set_verbose_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); + +static gboolean s3_device_set_ssl_fn(Device *self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); /* * virtual functions */ -static gboolean -s3_device_open_device(Device *pself, - char *device_name); +static void +s3_device_open_device(Device *pself, char *device_name, + char * device_type, char * device_node); -static ReadLabelStatusFlags s3_device_read_label(Device * self); +static DeviceStatusFlags s3_device_read_label(Device * self); static gboolean s3_device_start(Device * self, @@ -176,15 +290,17 @@ s3_device_start(Device * self, char * label, char * timestamp); +static gboolean +s3_device_finish(Device * self); + static gboolean s3_device_start_file(Device * self, - const dumpfile_t * jobInfo); + dumpfile_t * jobInfo); static gboolean s3_device_write_block(Device * self, guint size, - gpointer data, - gboolean last); + gpointer data); static gboolean s3_device_finish_file(Device * self); @@ -206,15 +322,10 @@ static gboolean s3_device_recycle_file(Device *pself, guint file); -static gboolean s3_device_property_set(Device * p_self, DevicePropertyId id, - GValue * val); -static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id, - GValue * val); /* * Private functions */ -/* {{{ file_and_block_to_key */ static char * file_and_block_to_key(S3Device *self, int file, @@ -225,9 +336,7 @@ file_and_block_to_key(S3Device *self, g_assert(strlen(s3_key) <= S3_MAX_KEY_LENGTH); return s3_key; } -/* }}} */ -/* {{{ special_file_to_key */ static char * special_file_to_key(S3Device *self, char *special_name, @@ -238,46 +347,46 @@ special_file_to_key(S3Device *self, else return g_strdup_printf("%sf%08x-%s", self->prefix, file, special_name); } -/* }}} */ -/* {{{ write_amanda_header */ static gboolean write_amanda_header(S3Device *self, char *label, char * timestamp) { - char * amanda_header = NULL; + CurlBuffer amanda_header = {NULL, 0, 0, 0}; char * key = NULL; - int header_size; gboolean header_fits, result; dumpfile_t * dumpinfo = NULL; + Device *d_self = DEVICE(self); /* build the header */ dumpinfo = make_tapestart_header(DEVICE(self), label, timestamp); - amanda_header = device_build_amanda_header(DEVICE(self), dumpinfo, - &header_size, &header_fits); + amanda_header.buffer = device_build_amanda_header(DEVICE(self), dumpinfo, + /* casting guint* to int* */ + (int*) &amanda_header.buffer_len, &header_fits); if (!header_fits) { - fprintf(stderr, - _("Amanda tapestart header won't fit in a single block!\n")); - g_free(amanda_header); + device_set_error(d_self, + stralloc(_("Amanda tapestart header won't fit in a single block!")), + DEVICE_STATUS_DEVICE_ERROR); + g_free(amanda_header.buffer); return FALSE; } /* write out the header and flush the uploads. */ key = special_file_to_key(self, "tapestart", -1); - result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size); - g_free(amanda_header); + result = s3_upload(self->s3, self->bucket, key, S3_BUFFER_READ_FUNCS, + &amanda_header, NULL, NULL); + g_free(amanda_header.buffer); g_free(key); if (!result) { - fprintf(stderr, _("While writing amanda header: %s\n"), - s3_strerror(self->s3)); + device_set_error(d_self, + vstrallocf(_("While writing amanda header: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); } return result; } -/* }}} */ -/* {{{ seek_to_end */ static gboolean seek_to_end(S3Device *self) { int last_file; @@ -292,7 +401,6 @@ seek_to_end(S3Device *self) { return TRUE; } -/* }}} */ /* Convert an object name into a file number, assuming the given prefix * length. Returns -1 if the object name is invalid, or 0 if the object name @@ -302,7 +410,8 @@ static int key_to_file(guint prefix_len, const char * key) { int i; /* skip the prefix */ - g_return_val_if_fail(strlen(key) > prefix_len, -1); + if (strlen(key) <= prefix_len) + return -1; key += prefix_len; @@ -311,7 +420,8 @@ static int key_to_file(guint prefix_len, const char * key) { } /* check that key starts with 'f' */ - g_return_val_if_fail(key[0] == 'f', -1); + if (key[0] != 'f') + return -1; key++; /* check that key is of the form "%08x-" */ @@ -334,7 +444,6 @@ static int key_to_file(guint prefix_len, const char * key) { return file; } -/* {{{ find_last_file */ /* Find the number of the last file that contains any data (even just a header). * Returns -1 in event of an error */ @@ -344,12 +453,14 @@ find_last_file(S3Device *self) { GSList *keys; unsigned int prefix_len = strlen(self->prefix); int last_file = 0; + Device *d_self = DEVICE(self); /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys); if (!result) { - fprintf(stderr, _("While listing S3 keys: %s\n"), - s3_strerror(self->s3)); + device_set_error(d_self, + vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } @@ -363,9 +474,7 @@ find_last_file(S3Device *self) { return last_file; } -/* }}} */ -/* {{{ find_next_file */ /* Find the number of the file following the requested one, if any. * Returns 0 if there is no such file or -1 in event of an error */ @@ -375,12 +484,14 @@ find_next_file(S3Device *self, int last_file) { GSList *keys; unsigned int prefix_len = strlen(self->prefix); int next_file = 0; + Device *d_self = DEVICE(self); /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */ result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys); if (!result) { - fprintf(stderr, _("While listing S3 keys: %s\n"), - s3_strerror(self->s3)); + device_set_error(d_self, + vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } @@ -403,9 +514,7 @@ find_next_file(S3Device *self, int last_file) { return last_file; } -/* }}} */ -/* {{{ delete_file */ static gboolean delete_file(S3Device *self, int file) @@ -413,11 +522,13 @@ delete_file(S3Device *self, gboolean result; GSList *keys; char *my_prefix = g_strdup_printf("%sf%08x-", self->prefix, file); + Device *d_self = DEVICE(self); result = s3_list_keys(self->s3, self->bucket, my_prefix, NULL, &keys); if (!result) { - fprintf(stderr, _("While listing S3 keys: %s\n"), - s3_strerror(self->s3)); + device_set_error(d_self, + vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } @@ -425,8 +536,10 @@ delete_file(S3Device *self, for (; keys; keys = g_slist_remove(keys, keys->data)) { if (self->verbose) g_debug(_("Deleting %s"), (char*)keys->data); if (!s3_delete(self->s3, self->bucket, keys->data)) { - fprintf(stderr, _("While deleting key '%s': %s\n"), - (char*)keys->data, s3_strerror(self->s3)); + device_set_error(d_self, + vstrallocf(_("While deleting key '%s': %s"), + (char*)keys->data, s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR); g_slist_free(keys); return FALSE; } @@ -434,24 +547,40 @@ delete_file(S3Device *self, return TRUE; } -/* }}} */ /* * Class mechanics */ -/* {{{ s3_device_register */ void s3_device_register(void) { - static const char * device_prefix_list[] = { "s3", NULL }; + static const char * device_prefix_list[] = { S3_DEVICE_NAME, DEVPAY_DEVICE_NAME, NULL }; g_assert(s3_init()); + + /* set up our properties */ + device_property_fill_and_register(&device_property_s3_secret_key, + G_TYPE_STRING, "s3_secret_key", + "Secret access key to authenticate with Amazon S3"); + device_property_fill_and_register(&device_property_s3_access_key, + G_TYPE_STRING, "s3_access_key", + "Access key ID to authenticate with Amazon S3"); + device_property_fill_and_register(&device_property_s3_user_token, + G_TYPE_STRING, "s3_user_token", + "User token for authentication Amazon devpay requests"); + device_property_fill_and_register(&device_property_s3_bucket_location, + G_TYPE_STRING, "s3_bucket_location", + "Location constraint for buckets on Amazon S3"); + device_property_fill_and_register(&device_property_s3_ssl, + G_TYPE_BOOLEAN, "s3_ssl", + "Whether to use SSL with Amazon S3"); + + + /* register the device itself */ register_device(s3_device_factory, device_prefix_list); } -/* }}} */ -/* {{{ s3_device_get_type */ -GType +static GType s3_device_get_type(void) { static GType type = 0; @@ -476,86 +605,56 @@ s3_device_get_type(void) return type; } -/* }}} */ -/* {{{ s3_device_init */ static void s3_device_init(S3Device * self) { - Device * o; - DeviceProperty prop; + Device * dself = DEVICE(self); GValue response; - self->initializing = TRUE; - - /* Register property values */ - o = (Device*)(self); + /* Register property values + * Note: Some aren't added until s3_device_open_device() + */ bzero(&response, sizeof(response)); - prop.base = &device_property_concurrency; - prop.access = PROPERTY_ACCESS_GET_MASK; g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_SHARED_READ); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_CONCURRENCY, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - - prop.base = &device_property_streaming; + g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); - device_add_property(o, &prop, &response); - g_value_unset(&response); - - prop.base = &device_property_block_size; - g_value_init(&response, G_TYPE_INT); - g_value_set_int(&response, -1); /* indicates a variable block size; see below */ - device_add_property(o, &prop, &response); - g_value_unset(&response); - - prop.base = &device_property_min_block_size; - g_value_init(&response, G_TYPE_UINT); - g_value_set_uint(&response, S3_DEVICE_MIN_BLOCK_SIZE); - device_add_property(o, &prop, &response); - - prop.base = &device_property_max_block_size; - g_value_set_uint(&response, S3_DEVICE_MAX_BLOCK_SIZE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_STREAMING, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_appendable; g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_APPENDABLE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); + g_value_unset(&response); - prop.base = &device_property_partial_deletion; + g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_canonical_name; - g_value_init(&response, G_TYPE_STRING); - g_value_set_static_string(&response, "s3:"); - device_add_property(o, &prop, &response); + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, FALSE); + device_set_simple_property(dself, PROPERTY_COMPRESSION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_medium_access_type; g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - - prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; - prop.base = &device_property_s3_secret_key; - device_add_property(o, &prop, NULL); - prop.base = &device_property_s3_access_key; - device_add_property(o, &prop, NULL); -#ifdef WANT_DEVPAY - prop.base = &device_property_s3_user_token; - device_add_property(o, &prop, NULL); -#endif + } -/* }}} */ -/* {{{ s3_device_class_init */ static void s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED) { @@ -567,6 +666,7 @@ s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED) device_class->open_device = s3_device_open_device; device_class->read_label = s3_device_read_label; device_class->start = s3_device_start; + device_class->finish = s3_device_finish; device_class->start_file = s3_device_start_file; device_class->write_block = s3_device_write_block; @@ -577,81 +677,227 @@ s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED) device_class->read_block = s3_device_read_block; device_class->recycle_file = s3_device_recycle_file; - device_class->property_set = s3_device_property_set; - device_class->property_get = s3_device_property_get; - g_object_class->finalize = s3_device_finalize; + + device_class_register_property(device_class, PROPERTY_S3_ACCESS_KEY, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_access_key_fn); + + device_class_register_property(device_class, PROPERTY_S3_SECRET_KEY, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_secret_key_fn); + + device_class_register_property(device_class, PROPERTY_S3_USER_TOKEN, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_user_token_fn); + + device_class_register_property(device_class, PROPERTY_S3_BUCKET_LOCATION, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_bucket_location_fn); + + device_class_register_property(device_class, PROPERTY_VERBOSE, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_verbose_fn); + + device_class_register_property(device_class, PROPERTY_S3_SSL, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + s3_device_set_ssl_fn); + + device_class_register_property(device_class, PROPERTY_COMPRESSION, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + NULL); +} + +static gboolean +s3_device_set_access_key_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + + amfree(self->access_key); + self->access_key = g_value_dup_string(val); + device_clear_volume_details(p_self); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +s3_device_set_secret_key_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + + amfree(self->secret_key); + self->secret_key = g_value_dup_string(val); + device_clear_volume_details(p_self); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +s3_device_set_user_token_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + + if (!self->is_devpay) { + device_set_error(p_self, stralloc(_( + "Can't set a user token unless DevPay is in use")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + amfree(self->user_token); + self->user_token = g_value_dup_string(val); + device_clear_volume_details(p_self); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +s3_device_set_bucket_location_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + + if (self->use_ssl && !s3_curl_location_compat()) { + device_set_error(p_self, stralloc(_( + "Location constraint given for Amazon S3 bucket, " + "but libcurl is too old support wildcard certificates.")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + if (!s3_bucket_location_compat(self->bucket)) { + device_set_error(p_self, g_strdup_printf(_( + "Location constraint given for Amazon S3 bucket, " + "but the bucket name (%s) is not usable as a subdomain."), + self->bucket), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + amfree(self->bucket_location); + self->bucket_location = g_value_dup_string(val); + device_clear_volume_details(p_self); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +s3_device_set_verbose_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + + self->verbose = g_value_get_boolean(val); + /* Our S3 handle may not yet have been instantiated; if so, it will + * get the proper verbose setting when it is created */ + if (self->s3) + s3_verbose(self->s3, self->verbose); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +s3_device_set_ssl_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + S3Device *self = S3_DEVICE(p_self); + gboolean new_val; + + new_val = g_value_get_boolean(val); + /* Our S3 handle may not yet have been instantiated; if so, it will + * get the proper use_ssl setting when it is created */ + if (self->s3 && !s3_use_ssl(self->s3, new_val)) { + device_set_error(p_self, g_strdup_printf(_( + "Error setting S3 SSL/TLS use " + "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + self->use_ssl = new_val; + + return device_simple_property_set_fn(p_self, base, val, surety, source); } -/* }}} */ -/* {{{ s3_device_factory */ static Device* -s3_device_factory(char * device_type, - char * device_name) +s3_device_factory(char * device_name, char * device_type, char * device_node) { Device *rval; S3Device * s3_rval; - g_assert(0 == strcmp(device_type, "s3")); + g_assert(0 == strcmp(device_type, S3_DEVICE_NAME) || + 0 == strcmp(device_type, DEVPAY_DEVICE_NAME)); rval = DEVICE(g_object_new(TYPE_S3_DEVICE, NULL)); s3_rval = (S3Device*)rval; - if (!device_open_device(rval, device_name)) { - g_object_unref(rval); - return NULL; - } else { - s3_rval->initializing = FALSE; - return rval; - } - + device_open_device(rval, device_name, device_type, device_node); + return rval; } -/* }}} */ /* * Virtual function overrides */ -/* {{{ s3_device_open_device */ -static gboolean -s3_device_open_device(Device *pself, - char *device_name) +static void +s3_device_open_device(Device *pself, char *device_name, + char * device_type, char * device_node) { S3Device *self = S3_DEVICE(pself); char * name_colon; + GValue tmp_value; - g_return_val_if_fail(self != NULL, FALSE); + pself->min_block_size = S3_DEVICE_MIN_BLOCK_SIZE; + pself->max_block_size = S3_DEVICE_MAX_BLOCK_SIZE; + pself->block_size = S3_DEVICE_DEFAULT_BLOCK_SIZE; /* Device name may be bucket/prefix, to support multiple volumes in a * single bucket. */ - name_colon = index(device_name, '/'); + name_colon = index(device_node, '/'); if (name_colon == NULL) { - self->bucket = g_strdup(device_name); + self->bucket = g_strdup(device_node); self->prefix = g_strdup(""); } else { - self->bucket = g_strndup(device_name, name_colon - device_name); + self->bucket = g_strndup(device_node, name_colon - device_node); self->prefix = g_strdup(name_colon + 1); } + self->is_devpay = !strcmp(device_type, DEVPAY_DEVICE_NAME); + if (self->bucket == NULL || self->bucket[0] == '\0') { - fprintf(stderr, _("Empty bucket name in device %s.\n"), device_name); + device_set_error(pself, + vstrallocf(_("Empty bucket name in device %s"), device_name), + DEVICE_STATUS_DEVICE_ERROR); amfree(self->bucket); amfree(self->prefix); - return FALSE; + return; } g_debug(_("S3 driver using bucket '%s', prefix '%s'"), self->bucket, self->prefix); - /* default value */ + /* default values */ self->verbose = FALSE; + /* use SSL if available */ + self->use_ssl = s3_curl_supports_ssl(); + bzero(&tmp_value, sizeof(GValue)); + g_value_init(&tmp_value, G_TYPE_BOOLEAN); + g_value_set_boolean(&tmp_value, self->use_ssl); + device_set_simple_property(pself, device_property_s3_ssl.ID, + &tmp_value, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); + if (parent_class->open_device) { - parent_class->open_device(pself, device_name); + parent_class->open_device(pself, device_name, device_type, device_node); } - - return TRUE; } -/* }}} */ -/* {{{ s3_device_finalize */ static void s3_device_finalize(GObject * obj_self) { S3Device *self = S3_DEVICE (obj_self); @@ -661,55 +907,68 @@ static void s3_device_finalize(GObject * obj_self) { if(self->s3) s3_free(self->s3); if(self->bucket) g_free(self->bucket); if(self->prefix) g_free(self->prefix); + if(self->access_key) g_free(self->access_key); + if(self->secret_key) g_free(self->secret_key); + if(self->user_token) g_free(self->user_token); + if(self->bucket_location) g_free(self->bucket_location); } -/* }}} */ -static gboolean setup_handle(S3Device * self, G_GNUC_UNUSED gboolean silent) { +static gboolean setup_handle(S3Device * self) { + Device *d_self = DEVICE(self); if (self->s3 == NULL) { - if (self->access_key == NULL) { - if (!silent) fprintf(stderr, _("No S3 access key specified\n")); + if (self->access_key == NULL) return FALSE; - } - if (self->secret_key == NULL) { - if (!silent) fprintf(stderr, _("No S3 secret key specified\n")); + if (self->secret_key == NULL) return FALSE; - } -#ifdef WANT_DEVPAY - if (self->user_token == NULL) { - if (!silent) fprintf(stderr, _("No S3 user token specified\n")); + if (self->is_devpay && self->user_token == NULL) return FALSE; - } -#endif - self->s3 = s3_open(self->access_key, self->secret_key -#ifdef WANT_DEVPAY - , self->user_token -#endif - ); + + self->s3 = s3_open(self->access_key, self->secret_key, self->user_token, + self->bucket_location); if (self->s3 == NULL) { - fprintf(stderr, "Internal error creating S3 handle.\n"); + device_set_error(d_self, + stralloc(_("Internal error creating S3 handle")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } s3_verbose(self->s3, self->verbose); + if (!s3_use_ssl(self->s3, self->use_ssl)) { + device_set_error(d_self, g_strdup_printf(_( + "Error setting S3 SSL/TLS use " + "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + return TRUE; } -/* {{{ s3_device_read_label */ -static ReadLabelStatusFlags +static DeviceStatusFlags s3_device_read_label(Device *pself) { S3Device *self = S3_DEVICE(pself); char *key; - gpointer buf; - guint buf_size; - dumpfile_t amanda_header; - - if (!setup_handle(self, self->initializing)) - return READ_LABEL_STATUS_DEVICE_ERROR; + CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE}; + dumpfile_t *amanda_header; + + /* note that this may be called from s3_device_start, when + * self->access_mode is not ACCESS_NULL */ + + amfree(pself->volume_label); + amfree(pself->volume_time); + amfree(pself->volume_header); + + if (device_in_error(self)) return pself->status; + + if (!setup_handle(self)) { + device_set_error(pself, stralloc(_("Error setting up S3 interface")), DEVICE_STATUS_DEVICE_ERROR); + return pself->status; + } key = special_file_to_key(self, "tapestart", -1); - if (!s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE)) { + if (!s3_read(self->s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL)) { guint response_code; s3_error_code_t s3_error_code; s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); @@ -718,36 +977,42 @@ s3_device_read_label(Device *pself) { if (response_code == 404 && (s3_error_code == S3_ERROR_NoSuchKey || s3_error_code == S3_ERROR_NoSuchBucket)) { g_debug(_("Amanda header not found while reading tapestart header (this is expected for empty tapes)")); - return READ_LABEL_STATUS_VOLUME_UNLABELED; + device_set_error(pself, + stralloc(_("Amanda header not found -- unlabeled volume?")), + DEVICE_STATUS_DEVICE_ERROR + | DEVICE_STATUS_VOLUME_ERROR + | DEVICE_STATUS_VOLUME_UNLABELED); + return pself->status; } /* otherwise, log it and return */ - fprintf(stderr, _("While trying to read tapestart header: %s\n"), - s3_strerror(self->s3)); - return READ_LABEL_STATUS_DEVICE_ERROR; + device_set_error(pself, + vstrallocf(_("While trying to read tapestart header: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); + return pself->status; } - g_assert(buf != NULL); - fh_init(&amanda_header); - parse_file_header(buf, &amanda_header, buf_size); + g_assert(buf.buffer != NULL); + amanda_header = g_new(dumpfile_t, 1); + parse_file_header(buf.buffer, amanda_header, buf.buffer_pos); + pself->volume_header = amanda_header; - g_free(buf); + g_free(buf.buffer); - if (amanda_header.type != F_TAPESTART) { - fprintf(stderr, _("Invalid amanda header\n")); - return READ_LABEL_STATUS_VOLUME_ERROR; + if (amanda_header->type != F_TAPESTART) { + device_set_error(pself, stralloc(_("Invalid amanda header")), DEVICE_STATUS_VOLUME_ERROR); + return pself->status; } - amfree(pself->volume_label); - pself->volume_label = g_strdup(amanda_header.name); - amfree(pself->volume_time); - pself->volume_time = g_strdup(amanda_header.datestamp); + pself->volume_label = g_strdup(amanda_header->name); + pself->volume_time = g_strdup(amanda_header->datestamp); + /* pself->volume_header is already set */ - return READ_LABEL_STATUS_SUCCESS; + device_set_error(pself, NULL, DEVICE_STATUS_SUCCESS); + + return pself->status; } -/* }}} */ -/* {{{ s3_device_start */ static gboolean s3_device_start (Device * pself, DeviceAccessMode mode, char * label, char * timestamp) { @@ -755,10 +1020,18 @@ s3_device_start (Device * pself, DeviceAccessMode mode, int file, last_file; self = S3_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - if (!setup_handle(self, FALSE)) - return FALSE; + if (device_in_error(self)) return FALSE; + + if (!setup_handle(self)) { + device_set_error(pself, + stralloc(_("Error setting up S3 interface")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } + + pself->access_mode = mode; + pself->in_file = FALSE; /* try creating the bucket, in case it doesn't exist */ if (mode != ACCESS_READ && !s3_make_bucket(self->s3, self->bucket)) { @@ -770,23 +1043,20 @@ s3_device_start (Device * pself, DeviceAccessMode mode, * return FALSE */ if (response_code != 409 || s3_error_code != S3_ERROR_BucketAlreadyExists) { - fprintf(stderr, _("While creating new S3 bucket: %s\n"), - s3_strerror(self->s3)); + device_set_error(pself, + vstrallocf(_("While creating new S3 bucket: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } } - /* call up to the parent (Device) to set access_mode, volume_label, - * and volume_time, either from the arguments (ACCESS_WRITE) or by - * reading from the 0th file (otherwise) - */ - if (parent_class->start) - if (!parent_class->start((Device*)self, mode, label, timestamp)) - return FALSE; - /* take care of any dirty work for this mode */ switch (mode) { case ACCESS_READ: + if (pself->volume_label == NULL && s3_device_read_label(pself) != DEVICE_STATUS_SUCCESS) { + /* s3_device_read_label already set our error message */ + return FALSE; + } break; case ACCESS_WRITE: @@ -794,156 +1064,73 @@ s3_device_start (Device * pself, DeviceAccessMode mode, last_file = find_last_file(self); if (last_file < 0) return FALSE; for (file = 0; file <= last_file; file++) { - if (!delete_file(self, file)) return FALSE; + if (!delete_file(self, file)) + /* delete_file already set our error message */ + return FALSE; } /* write a new amanda header */ if (!write_amanda_header(self, label, timestamp)) { return FALSE; } + + pself->volume_label = newstralloc(pself->volume_label, label); + pself->volume_time = newstralloc(pself->volume_time, timestamp); + + /* unset the VOLUME_UNLABELED flag, if it was set */ + device_set_error(pself, NULL, DEVICE_STATUS_SUCCESS); break; case ACCESS_APPEND: + if (pself->volume_label == NULL && s3_device_read_label(pself) != DEVICE_STATUS_SUCCESS) { + /* s3_device_read_label already set our error message */ + return FALSE; + } return seek_to_end(self); break; + case ACCESS_NULL: g_assert_not_reached(); } - g_assert(pself->access_mode == mode); - return TRUE; } -/* }}} */ - -static gboolean s3_device_property_get(Device * p_self, DevicePropertyId id, - GValue * val) { - S3Device * self; - const DevicePropertyBase * base; - - self = S3_DEVICE(p_self); - g_return_val_if_fail(self != NULL, FALSE); - - base = device_property_get_by_id(id); - g_return_val_if_fail(self != NULL, FALSE); - - g_value_unset_init(val, base->type); - - if (id == PROPERTY_S3_SECRET_KEY) { - if (self->secret_key != NULL) { - g_value_set_string(val, self->secret_key); - return TRUE; - } else { - return FALSE; - } - } else if (id == PROPERTY_S3_ACCESS_KEY) { - if (self->access_key != NULL) { - g_value_set_string(val, self->access_key); - return TRUE; - } else { - return FALSE; - } - } -#ifdef WANT_DEVPAY - else if (id == PROPERTY_S3_USER_TOKEN) { - if (self->user_token != NULL) { - g_value_set_string(val, self->user_token); - return TRUE; - } else { - return FALSE; - } - } -#endif /* WANT_DEVPAY */ - else if (id == PROPERTY_VERBOSE) { - g_value_set_boolean(val, self->verbose); - return TRUE; - } else { - /* chain up */ - if (parent_class->property_get) { - return (parent_class->property_get)(p_self, id, val); - } else { - return FALSE; - } - } - - g_assert_not_reached(); -} - -static gboolean s3_device_property_set(Device * p_self, DevicePropertyId id, - GValue * val) { - S3Device * self; - const DevicePropertyBase * base; - - self = S3_DEVICE(p_self); - g_return_val_if_fail(self != NULL, FALSE); - - base = device_property_get_by_id(id); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE); +static gboolean +s3_device_finish (Device * pself) { + if (device_in_error(pself)) return FALSE; - if (id == PROPERTY_S3_SECRET_KEY) { - if (p_self->access_mode != ACCESS_NULL) - return FALSE; - amfree(self->secret_key); - self->secret_key = g_value_dup_string(val); - device_clear_volume_details(p_self); - return TRUE; - } else if (id == PROPERTY_S3_ACCESS_KEY) { - if (p_self->access_mode != ACCESS_NULL) - return FALSE; - amfree(self->access_key); - self->access_key = g_value_dup_string(val); - device_clear_volume_details(p_self); - return TRUE; - } -#ifdef WANT_DEVPAY - else if (id == PROPERTY_S3_USER_TOKEN) { - if (p_self->access_mode != ACCESS_NULL) - return FALSE; - amfree(self->user_token); - self->user_token = g_value_dup_string(val); - device_clear_volume_details(p_self); - return TRUE; - } -#endif /* WANT_DEVPAY */ - else if (id == PROPERTY_VERBOSE) { - self->verbose = g_value_get_boolean(val); - /* Our S3 handle may not yet have been instantiated; if so, it will - * get the proper verbose setting when it is created */ - if (self->s3) - s3_verbose(self->s3, self->verbose); - return TRUE; - } else { - if (parent_class->property_set) { - return (parent_class->property_set)(p_self, id, val); - } else { - return FALSE; - } - } + /* we're not in a file anymore */ + pself->access_mode = ACCESS_NULL; - g_assert_not_reached(); + return TRUE; } /* functions for writing */ -/* {{{ s3_device_start_file */ static gboolean -s3_device_start_file (Device *pself, const dumpfile_t *jobInfo) { +s3_device_start_file (Device *pself, dumpfile_t *jobInfo) { S3Device *self = S3_DEVICE(pself); - char *amanda_header; - int header_size; + CurlBuffer amanda_header = {NULL, 0, 0, 0}; gboolean header_fits, result; char *key; - g_return_val_if_fail (self != NULL, FALSE); + if (device_in_error(self)) return FALSE; + + /* Set the blocksize to zero, since there's no header to skip (it's stored + * in a distinct file, rather than block zero) */ + jobInfo->blocksize = 0; /* Build the amanda header. */ - amanda_header = device_build_amanda_header(pself, jobInfo, - &header_size, &header_fits); - g_return_val_if_fail(amanda_header != NULL, FALSE); - g_return_val_if_fail(header_fits, FALSE); + amanda_header.buffer = device_build_amanda_header(pself, jobInfo, + (int *) &amanda_header.buffer_len, &header_fits); + if (!header_fits) { + device_set_error(pself, + stralloc(_("Amanda file header won't fit in a single block!")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } /* set the file and block numbers correctly */ pself->file = (pself->file > 0)? pself->file+1 : 1; @@ -952,101 +1139,99 @@ s3_device_start_file (Device *pself, const dumpfile_t *jobInfo) { /* write it out as a special block (not the 0th) */ key = special_file_to_key(self, "filestart", pself->file); - result = s3_upload(self->s3, self->bucket, key, amanda_header, header_size); - g_free(amanda_header); + result = s3_upload(self->s3, self->bucket, key, S3_BUFFER_READ_FUNCS, + &amanda_header, NULL, NULL); + g_free(amanda_header.buffer); g_free(key); if (!result) { - fprintf(stderr, _("While writing filestart header: %s\n"), - s3_strerror(self->s3)); + device_set_error(pself, + vstrallocf(_("While writing filestart header: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } return TRUE; } -/* }}} */ -/* {{{ s3_device_write_block */ static gboolean -s3_device_write_block (Device * pself, guint size, gpointer data, - gboolean last_block) { +s3_device_write_block (Device * pself, guint size, gpointer data) { gboolean result; char *filename; - S3Device * self = S3_DEVICE(pself);; + S3Device * self = S3_DEVICE(pself); + CurlBuffer to_write = {data, size, 0, 0}; g_assert (self != NULL); g_assert (data != NULL); + if (device_in_error(self)) return FALSE; filename = file_and_block_to_key(self, pself->file, pself->block); - result = s3_upload(self->s3, self->bucket, filename, data, size); + result = s3_upload(self->s3, self->bucket, filename, S3_BUFFER_READ_FUNCS, + &to_write, NULL, NULL); g_free(filename); if (!result) { - fprintf(stderr, _("While writing data block to S3: %s\n"), - s3_strerror(self->s3)); + device_set_error(pself, + vstrallocf(_("While writing data block to S3: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } pself->block++; - /* if this is the last block, finish the file */ - if (last_block) { - return s3_device_finish_file(pself); - } - return TRUE; } -/* }}} */ -/* {{{ s3_device_finish_file */ static gboolean s3_device_finish_file (Device * pself) { + if (device_in_error(pself)) return FALSE; + /* we're not in a file anymore */ pself->in_file = FALSE; return TRUE; } -/* }}} */ -/* {{{ s3_device_recycle_file */ static gboolean s3_device_recycle_file(Device *pself, guint file) { S3Device *self = S3_DEVICE(pself); + if (device_in_error(self)) return FALSE; return delete_file(self, file); + /* delete_file already set our error message if necessary */ } -/* }}} */ /* functions for reading */ -/* {{{ s3_device_seek_file */ static dumpfile_t* s3_device_seek_file(Device *pself, guint file) { S3Device *self = S3_DEVICE(pself); gboolean result; char *key; - gpointer buf; - guint buf_size; + CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE}; dumpfile_t *amanda_header; + const char *errmsg = NULL; + + if (device_in_error(self)) return NULL; pself->file = file; + pself->is_eof = FALSE; + pself->in_file = FALSE; pself->block = 0; - pself->in_file = TRUE; /* read it in */ key = special_file_to_key(self, "filestart", pself->file); - result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE); + result = s3_read(self->s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, + &buf, NULL, NULL); g_free(key); if (!result) { guint response_code; s3_error_code_t s3_error_code; - s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); + s3_error(self->s3, &errmsg, &response_code, &s3_error_code, NULL, NULL, NULL); /* if it's an expected error (not found), check what to do. */ if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) { int next_file; - pself->file = -1; - pself->in_file = FALSE; next_file = find_next_file(self, pself->file); if (next_file > 0) { /* Note short-circut of dispatcher. */ @@ -1054,131 +1239,196 @@ s3_device_seek_file(Device *pself, guint file) { } else if (next_file == 0) { /* No next file. Check if we are one past the end. */ key = special_file_to_key(self, "filestart", pself->file - 1); - result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, - S3_DEVICE_MAX_BLOCK_SIZE); + result = s3_read(self->s3, self->bucket, key, + S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL); g_free(key); if (result) { + /* pself->file, etc. are already correct */ return make_tapeend_header(); } else { + device_set_error(pself, + stralloc(_("Attempt to read past tape-end file")), + DEVICE_STATUS_SUCCESS); return NULL; } } } else { - /* An error occured finding out if we are the last file. */ + /* An unexpected error occured finding out if we are the last file. */ + device_set_error(pself, + stralloc(errmsg), + DEVICE_STATUS_DEVICE_ERROR); return NULL; } } /* and make a dumpfile_t out of it */ - g_assert(buf != NULL); + g_assert(buf.buffer != NULL); amanda_header = g_new(dumpfile_t, 1); fh_init(amanda_header); - parse_file_header(buf, amanda_header, buf_size); - g_free(buf); + parse_file_header(buf.buffer, amanda_header, buf.buffer_pos); + g_free(buf.buffer); switch (amanda_header->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: - return amanda_header; + break; default: - fprintf(stderr, - _("Invalid amanda header while reading file header\n")); + device_set_error(pself, + stralloc(_("Invalid amanda header while reading file header")), + DEVICE_STATUS_VOLUME_ERROR); g_free(amanda_header); return NULL; } + + pself->in_file = TRUE; + return amanda_header; } -/* }}} */ -/* {{{ s3_device_seek_block */ static gboolean s3_device_seek_block(Device *pself, guint64 block) { + if (device_in_error(pself)) return FALSE; + pself->block = block; return TRUE; } -/* }}} */ -/* {{{ s3_device_read_block */ +typedef struct s3_read_block_data { + gpointer data; + int size_req; + int size_written; + + CurlBuffer curl; +} s3_read_block_data; + +/* wrapper around s3_buffer_write_func to write as much data as possible to + * the user's buffer, and switch to a dynamically allocated buffer if that + * isn't large enough */ +static size_t +s3_read_block_write_func(void *ptr, size_t size, size_t nmemb, void *stream) +{ + s3_read_block_data *dat = stream; + guint new_bytes, bytes_needed; + + /* if data is NULL, call through to s3_buffer_write_func */ + if (!dat->data) { + return s3_buffer_write_func(ptr, size, nmemb, (void *)(&dat->curl)); + } + + new_bytes = (guint) size * nmemb; + bytes_needed = dat->size_written + new_bytes; + + if (bytes_needed > (guint)dat->size_written) { + /* this read will overflow the user's buffer, so malloc ourselves + * a new buffer and keep reading */ + dat->curl.buffer = g_malloc(bytes_needed); + dat->curl.buffer_len = bytes_needed; + dat->curl.buffer_pos = dat->size_written; + memcpy(dat->curl.buffer, dat->data, dat->size_written); + dat->data = NULL; /* signal that the user's buffer is too small */ + return s3_buffer_write_func(ptr, size, nmemb, (void *)(&dat->curl)); + } + + memcpy(dat->data + dat->size_written, ptr, bytes_needed); + return new_bytes; +} + static int s3_device_read_block (Device * pself, gpointer data, int *size_req) { S3Device * self = S3_DEVICE(pself); char *key; - gpointer buf; + s3_read_block_data dat = {NULL, 0, 0, { NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE} }; gboolean result; - guint buf_size; g_assert (self != NULL); + if (device_in_error(self)) return -1; /* get the file*/ key = file_and_block_to_key(self, pself->file, pself->block); g_assert(key != NULL); if (self->cached_key && (0 == strcmp(key, self->cached_key))) { - /* use the cached copy and clear the cache */ - buf = self->cached_buf; - buf_size = self->cached_size; + if (*size_req >= self->cached_size) { + /* use the cached copy and clear the cache */ + memcpy(data, self->cached_buf, self->cached_size); + *size_req = self->cached_size; + + g_free(key); + g_free(self->cached_key); + self->cached_key = NULL; + g_free(self->cached_buf); + self->cached_buf = NULL; + + pself->block++; + return *size_req; + } else { + *size_req = self->cached_size; + g_free(key); + return 0; + } + } - self->cached_buf = NULL; - g_free(self->cached_key); - self->cached_key = NULL; - } else { - /* clear the cache and actually download the file */ - if (self->cached_buf) { - g_free(self->cached_buf); - self->cached_buf = NULL; - } - if (self->cached_key) { - g_free(self->cached_key); - self->cached_key = NULL; - } + /* clear the cache, as it's useless to us */ + if (self->cached_key) { + g_free(self->cached_key); + self->cached_key = NULL; - result = s3_read(self->s3, self->bucket, key, &buf, &buf_size, S3_DEVICE_MAX_BLOCK_SIZE); - if (!result) { - guint response_code; - s3_error_code_t s3_error_code; - s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); + g_free(self->cached_buf); + self->cached_buf = NULL; + } - g_free(key); - key = NULL; + /* set up dat for the write_func callback */ + if (!data || *size_req <= 0) { + dat.data = NULL; + dat.size_req = 0; + } else { + dat.data = data; + dat.size_req = *size_req; + } - /* if it's an expected error (not found), just return -1 */ - if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) { - pself->is_eof = TRUE; - pself->in_file = FALSE; - return -1; - } + result = s3_read(self->s3, self->bucket, key, s3_read_block_write_func, + s3_buffer_reset_func, &dat, NULL, NULL); + if (!result) { + guint response_code; + s3_error_code_t s3_error_code; + s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL); + + g_free(key); + key = NULL; + + /* if it's an expected error (not found), just return -1 */ + if (response_code == 404 && s3_error_code == S3_ERROR_NoSuchKey) { + pself->is_eof = TRUE; + pself->in_file = FALSE; + device_set_error(pself, + stralloc(_("EOF")), + DEVICE_STATUS_SUCCESS); + return -1; + } - /* otherwise, log it and return FALSE */ - fprintf(stderr, _("While reading data block from S3: %s\n"), - s3_strerror(self->s3)); - return -1; - } + /* otherwise, log it and return FALSE */ + device_set_error(pself, + vstrallocf(_("While reading data block from S3: %s"), s3_strerror(self->s3)), + DEVICE_STATUS_VOLUME_ERROR); + return -1; } - /* INVARIANT: cache is NULL */ - g_assert(self->cached_buf == NULL); - g_assert(self->cached_key == NULL); - - /* now see how the caller wants to deal with that */ - if (data == NULL || *size_req < 0 || buf_size > (guint)*size_req) { - /* A size query or short buffer -- load the cache and return the size*/ - self->cached_buf = buf; + if (dat.data == NULL) { + /* data was larger than the available space, so cache it and return + * the actual size */ + self->cached_buf = dat.curl.buffer; + self->cached_size = dat.curl.buffer_pos; self->cached_key = key; - self->cached_size = buf_size; + key = NULL; - *size_req = buf_size; + *size_req = dat.curl.buffer_pos; return 0; - } else { - /* ok, all checks are passed -- copy the data */ - *size_req = buf_size; - g_memmove(data, buf, buf_size); - g_free(key); - g_free(buf); - - /* move on to the next block */ - pself->block++; - - return buf_size; } + + /* ok, the read went directly to the user's buffer, so we need only + * set and return the size */ + pself->block++; + g_free(key); + *size_req = dat.size_req; + return dat.size_req; } -/* }}} */ diff --git a/device-src/s3-device.h b/device-src/s3-device.h deleted file mode 100644 index 286cb36..0000000 --- a/device-src/s3-device.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -#ifndef __S3_DEVICE_H__ -#define __S3_DEVICE_H__ -#include -#include -#include -#include "s3.h" - -/* - * Constants - */ - -/* - * Type checking and casting macros - */ -#define TYPE_S3_DEVICE (s3_device_get_type()) -#define S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device) -#define S3_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), s3_device_get_type(), S3Device const) -#define S3_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), s3_device_get_type(), S3DeviceClass) -#define IS_S3_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), s3_device_get_type ()) - -#define S3_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), s3_device_get_type(), S3DeviceClass) - -/* - * Main object structure - */ -typedef struct _S3MetadataFile S3MetadataFile; - -#ifndef __TYPEDEF_S3_DEVICE__ -#define __TYPEDEF_S3_DEVICE__ -typedef struct _S3Device S3Device; -#endif -struct _S3Device { - Device __parent__; - - /* The "easy" curl handle we use to access Amazon S3 */ - S3Handle *s3; - - /* S3 access information */ - char *bucket; - char *prefix; - - /* The S3 access information. */ - char *secret_key; - char *access_key; -#ifdef WANT_DEVPAY - char *user_token; -#endif - - /* a cache for unsuccessful reads (where we get the file but the caller - * doesn't have space for it or doesn't want it), where we expect the - * next call will request the same file. - */ - char *cached_buf; - char *cached_key; - int cached_size; - - /* Produce verbose output? */ - gboolean verbose; - /* Set to FALSE once s3_device_open_device is finished. */ - gboolean initializing; -}; - -/* - * Class definition - */ -typedef struct _S3DeviceClass S3DeviceClass; -struct _S3DeviceClass { - DeviceClass __parent__; -}; - - -/* - * Public methods - */ -GType s3_device_get_type (void); -void s3_device_register (void); - -#endif diff --git a/device-src/s3-util.c b/device-src/s3-util.c new file mode 100644 index 0000000..2fe517f --- /dev/null +++ b/device-src/s3-util.c @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + + +#ifdef HAVE_CONFIG_H +/* use a relative path here to avoid conflicting with Perl's config.h. */ +#include "../config/config.h" +#endif +#ifdef HAVE_REGEX_H +#include +#include +#endif +#ifdef HAVE_AMANDA_H +#include "amanda.h" +#endif + +#include +#include +#include +#include +#include +#include "s3-util.h" + +#ifdef HAVE_REGEX_H +int +s3_regexec_wrap(regex_t *regex, + const char *str, + size_t nmatch, + regmatch_t pmatch[], + int eflags) +{ + char *message; + int size; + int reg_result; + + reg_result = regexec(regex, str, nmatch, pmatch, eflags); + if (reg_result != 0 && reg_result != REG_NOMATCH) { + size = regerror(reg_result, regex, NULL, 0); + message = g_malloc(size); + regerror(reg_result, regex, message, size); + + /* this is programmer error (bad regexp), so just log + * and abort(). There's no good way to signal a + * permanaent error from interpret_response. */ + g_critical(_("Regex error: %s"), message); + } + + return reg_result; +} +#else + +int +s3_regexec_wrap(regex_t *regex, + const char *str, + size_t nmatch, + regmatch_t pmatch[], + int eflags) +{ + GMatchInfo *match_info; + int ret = REG_NOERROR; + guint i; + + g_assert(regex && *regex); + g_regex_match(*regex, str, eflags, &match_info); + if (g_match_info_matches(match_info)) { + g_assert(g_match_info_get_match_count(match_info) <= (glong) nmatch); + for (i = 0; i < nmatch; i++) { + pmatch[i].rm_eo = pmatch[i].rm_so = -1; + g_match_info_fetch_pos(match_info, i, &pmatch[i].rm_so, &pmatch[i].rm_eo); + } + } else { + ret = REG_NOMATCH; + } + g_match_info_free(match_info); + return ret; +} +#endif + +#ifndef HAVE_AMANDA_H +char* +find_regex_substring(const char* base_string, const regmatch_t match) +{ + g_assert(match.rm_eo >= match.rm_so); + return g_strndup(base_string+match.rm_so, match.rm_eo - match.rm_so); +} +#endif + +gchar* +s3_base64_encode(const GByteArray *to_enc) { + BIO *bio_b64 = NULL, *bio_buff = NULL; + long bio_b64_len; + char *bio_b64_data = NULL, *ret = NULL; + if (!to_enc) return NULL; + + /* Initialize base64 encoding filter */ + bio_b64 = BIO_new(BIO_f_base64()); + g_assert(bio_b64); + BIO_set_flags(bio_b64, BIO_FLAGS_BASE64_NO_NL); + + /* Initialize memory buffer for the base64 encoding */ + bio_buff = BIO_new(BIO_s_mem()); + g_assert(bio_buff); + bio_buff = BIO_push(bio_b64, bio_buff); + + /* Write the MD5 hash into the buffer to encode it in base64 */ + BIO_write(bio_buff, to_enc->data, to_enc->len); + /* BIO_flush is a macro and GCC 4.1.2 complains without this cast*/ + (void) BIO_flush(bio_buff); + + /* Pull out the base64 encoding of the MD5 hash */ + bio_b64_len = BIO_get_mem_data(bio_buff, &bio_b64_data); + g_assert(bio_b64_data); + ret = g_strndup(bio_b64_data, bio_b64_len); + + /* If bio_b64 is freed separately, freeing bio_buff will + * invalidly free memory and potentially segfault. + */ + BIO_free_all(bio_buff); + return ret; +} + +gchar* +s3_hex_encode(const GByteArray *to_enc) { + guint i; + gchar *ret = NULL, table[] = "0123456789abcdef"; + if (!to_enc) return NULL; + + ret = g_new(gchar, to_enc->len*2 + 1); + for (i = 0; i < to_enc->len; i++) { + /* most significant 4 bits */ + ret[i*2] = table[to_enc->data[i] >> 4]; + /* least significant 4 bits */ + ret[i*2 + 1] = table[to_enc->data[i] & 0xf]; + } + ret[to_enc->len*2] = '\0'; + + return ret; +} + +GByteArray* +s3_compute_md5_hash(const GByteArray *to_hash) { + MD5_CTX md5_ctx; + GByteArray *ret; + if (!to_hash) return NULL; + + ret = g_byte_array_sized_new(S3_MD5_HASH_BYTE_LEN); + g_byte_array_set_size(ret, S3_MD5_HASH_BYTE_LEN); + + MD5_Init(&md5_ctx); + MD5_Update(&md5_ctx, to_hash->data, to_hash->len); + MD5_Final(ret->data, &md5_ctx); + + return ret; +} diff --git a/device-src/s3-util.h b/device-src/s3-util.h new file mode 100644 index 0000000..20634f2 --- /dev/null +++ b/device-src/s3-util.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#ifndef __S3_UTIL_H__ +#define __S3_UTIL_H__ + +#ifdef HAVE_REGEX_H +# ifdef HAVE_SYS_TYPES_H +# include +# endif +#include +#endif +#include + +/* + * Constants + */ + +/* number of raw bytes in MD5 hash */ +#define S3_MD5_HASH_BYTE_LEN 16 +/* length of an MD5 hash encoded as base64 (not including terminating NULL) */ +#define S3_MD5_HASH_B64_LEN 25 +/* length of an MD5 hash encoded as hexadecimal (not including terminating NULL) */ +#define S3_MD5_HASH_HEX_LEN 32 + +/* + * Types + */ + +#ifndef HAVE_REGEX_H +typedef GRegex* regex_t; + +typedef gint regoff_t; +typedef struct +{ + regoff_t rm_so; /* Byte offset from string's start to substring's start. */ + regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ +} regmatch_t; + +typedef enum +{ + REG_NOERROR = 0, /* Success. */ + REG_NOMATCH /* Didn't find a match (for regexec). */ +} reg_errcode_t; +#endif + +/* + * Functions + */ + +#ifndef USE_GETTEXT +/* we don't use gettextize, so hack around this ... */ +#define _(str) (str) +#endif + +/* + * Wrapper around regexec to handle programmer errors. + * Only returns if the regexec returns 0 (match) or REG_NOMATCH. + * See regexec(3) documentation for the rest. + */ +int +s3_regexec_wrap(regex_t *regex, + const char *str, + size_t nmatch, + regmatch_t pmatch[], + int eflags); + + +#ifndef HAVE_AMANDA_H +char* +find_regex_substring(const char* base_string, + const regmatch_t match); +#endif + +/* + * Encode bytes using Base-64 + * + * @note: GLib 2.12+ has a function for this (g_base64_encode) + * but we support much older versions. gnulib does as well, but its + * hard to use correctly (see its notes). + * + * @param to_enc: The data to encode. + * @returns: A new, null-terminated string or NULL if to_enc is NULL. + */ +gchar* +s3_base64_encode(const GByteArray *to_enc); + +/* + * Encode bytes using hexadecimal + * + * @param to_enc: The data to encode. + * @returns: A new, null-terminated string or NULL if to_enc is NULL. + */ +gchar* +s3_hex_encode(const GByteArray *to_enc); + +/* + * Compute the MD5 hash of a blob of data. + * + * @param to_hash: The data to compute the hash for. + * @returns: A new GByteArray containing the MD5 hash of data or + * NULL if to_hash is NULL. + */ +GByteArray* +s3_compute_md5_hash(const GByteArray *to_hash); + +#endif diff --git a/device-src/s3.c b/device-src/s3.c index dfd29dc..a9dbd67 100644 --- a/device-src/s3.c +++ b/device-src/s3.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,28 +14,47 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* TODO - * - Compute and send Content-MD5 header - * - check SSL certificate * - collect speed statistics * - debugging mode */ +#ifdef HAVE_CONFIG_H +/* use a relative path here to avoid conflicting with Perl's config.h. */ +#include "../config/config.h" +#endif #include +#include "s3.h" +#include "s3-util.h" +#ifdef HAVE_REGEX_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_STAT_H #include +#endif +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_DIRENT_H #include -#include +#endif +#ifdef HAVE_TIME_H #include +#endif +#ifdef HAVE_UTIL_H #include "util.h" +#endif +#ifdef HAVE_AMANDA_H #include "amanda.h" -#include "s3.h" -#include "base64.h" +#endif + #include /* Constant renamed after version 7.10.7 */ @@ -61,25 +80,26 @@ #include #include - -/* - * Constants / definitions - */ +#include /* Maximum key length as specified in the S3 documentation * (*excluding* null terminator) */ #define S3_MAX_KEY_LENGTH 1024 #define AMAZON_SECURITY_HEADER "x-amz-security-token" +#define AMAZON_BUCKET_CONF_TEMPLATE "\ + \n\ + %s\n\ + " /* parameters for exponential backoff in the face of retriable errors */ /* start at 0.01s */ -#define EXPONENTIAL_BACKOFF_START_USEC 10000 +#define EXPONENTIAL_BACKOFF_START_USEC G_USEC_PER_SEC/100 /* double at each retry */ #define EXPONENTIAL_BACKOFF_BASE 2 -/* retry 15 times (for a total of about 5 minutes spent waiting) */ -#define EXPONENTIAL_BACKOFF_MAX_RETRIES 5 +/* retry 14 times (for a total of about 3 minutes spent waiting) */ +#define EXPONENTIAL_BACKOFF_MAX_RETRIES 14 /* general "reasonable size" parameters */ #define MAX_ERROR_RESPONSE_LEN (100*1024) @@ -87,6 +107,7 @@ /* Results which should always be retried */ #define RESULT_HANDLING_ALWAYS_RETRY \ { 400, S3_ERROR_RequestTimeout, 0, S3_RESULT_RETRY }, \ + { 404, S3_ERROR_NoSuchBucket, 0, S3_RESULT_RETRY }, \ { 409, S3_ERROR_OperationAborted, 0, S3_RESULT_RETRY }, \ { 412, S3_ERROR_PreconditionFailed, 0, S3_RESULT_RETRY }, \ { 500, S3_ERROR_InternalError, 0, S3_RESULT_RETRY }, \ @@ -95,7 +116,8 @@ { 0, 0, CURLE_PARTIAL_FILE, S3_RESULT_RETRY }, \ { 0, 0, CURLE_OPERATION_TIMEOUTED, S3_RESULT_RETRY }, \ { 0, 0, CURLE_SEND_ERROR, S3_RESULT_RETRY }, \ - { 0, 0, CURLE_RECV_ERROR, S3_RESULT_RETRY } + { 0, 0, CURLE_RECV_ERROR, S3_RESULT_RETRY }, \ + { 0, 0, CURLE_GOT_NOTHING, S3_RESULT_RETRY } /* * Data structures and associated functions @@ -106,13 +128,14 @@ struct S3Handle { char *access_key; char *secret_key; -#ifdef WANT_DEVPAY char *user_token; -#endif + + char *bucket_location; CURL *curl; gboolean verbose; + gboolean use_ssl; /* information from the last request */ char *last_message; @@ -124,6 +147,33 @@ struct S3Handle { guint last_response_body_size; }; +typedef struct { + CurlBuffer resp_buf; + s3_write_func write_func; + s3_reset_func reset_func; + gpointer write_data; + + gboolean headers_done; + char *etag; +} S3InternalData; + +/* Callback function to examine headers one-at-a-time + * + * @note this is the same as CURLOPT_HEADERFUNCTION + * + * @param data: The pointer to read data from + * @param size: The size of each "element" of the data buffer in bytes + * @param nmemb: The number of elements in the data buffer. + * So, the buffer's size is size*nmemb bytes. + * @param stream: the header_data (an opaque pointer) + * + * @return The number of bytes written to the buffer or + * CURL_WRITEFUNC_PAUSE to pause. + * If it's the number of bytes written, it should match the buffer size + */ +typedef size_t (*s3_header_func)(void *data, size_t size, size_t nmemb, void *stream); + + /* * S3 errors */ @@ -153,12 +203,6 @@ s3_error_code_from_name(char *s3_error_name); static const char * s3_error_name_from_code(s3_error_code_t s3_error_code); -/* Does this install of curl support SSL? - * - * @returns: boolean - */ -static gboolean -s3_curl_supports_ssl(void); /* * result handling */ @@ -201,27 +245,31 @@ lookup_result(const result_handling_t *result_handling, /* * Precompiled regular expressions */ - -static const char *error_name_regex_string = "[:space:]*([^<]*)[:space:]*"; -static const char *message_regex_string = "[:space:]*([^<]*)[:space:]*"; -static regex_t error_name_regex, message_regex; +static regex_t etag_regex, error_name_regex, message_regex, subdomain_regex, + location_con_regex; /* * Utility functions */ -/* Build a resource URI as /[bucket[/key]], with proper URL - * escaping. +/* Construct the URL for an Amazon S3 REST request. * - * The caller is responsible for freeing the resulting string. + * A new string is allocated and returned; it is the responsiblity of the caller. * - * @param bucket: the bucket, or NULL if none is involved - * @param key: the key within the bucket, or NULL if none is involved - * @returns: completed URI + * @param hdl: the S3Handle object + * @param verb: capitalized verb for this request ('PUT', 'GET', etc.) + * @param bucket: the bucket being accessed, or NULL for none + * @param key: the key being accessed, or NULL for none + * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none + * @param use_subdomain: if TRUE, a subdomain of s3.amazonaws.com will be used */ static char * -build_resource(const char *bucket, - const char *key); +build_url(const char *bucket, + const char *key, + const char *subresource, + const char *query, + gboolean use_subdomain, + gboolean use_ssl); /* Create proper authorization headers for an Amazon S3 REST * request to C{headers}. @@ -234,12 +282,22 @@ build_resource(const char *bucket, * * @param hdl: the S3Handle object * @param verb: capitalized verb for this request ('PUT', 'GET', etc.) - * @param resource: the resource being accessed + * @param bucket: the bucket being accessed, or NULL for none + * @param key: the key being accessed, or NULL for none + * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none + * @param md5_hash: the MD5 hash of the request body, or NULL for none + * @param use_subdomain: if TRUE, a subdomain of s3.amazonaws.com will be used */ static struct curl_slist * authenticate_request(S3Handle *hdl, const char *verb, - const char *resource); + const char *bucket, + const char *key, + const char *subresource, + const char *md5_hash, + gboolean use_subdomain); + + /* Interpret the response to an S3 operation, assuming CURL completed its request * successfully. This function fills in the relevant C{hdl->last*} members. @@ -247,50 +305,99 @@ authenticate_request(S3Handle *hdl, * @param hdl: The S3Handle object * @param body: the response body * @param body_len: the length of the response body + * @param etag: The response's ETag header + * @param content_md5: The hex-encoded MD5 hash of the request body, + * which will be checked against the response's ETag header. + * If NULL, the header is not checked. + * If non-NULL, then the body should have the response headers at its beginnning. * @returns: TRUE if the response should be retried (e.g., network error) */ static gboolean interpret_response(S3Handle *hdl, CURLcode curl_code, char *curl_error_buffer, - void *body, - guint body_len); + gchar *body, + guint body_len, + const char *etag, + const char *content_md5); /* Perform an S3 operation. This function handles all of the details * of retryig requests and so on. * + * The concepts of bucket and keys are defined by the Amazon S3 API. + * See: "Components of Amazon S3" - API Version 2006-03-01 pg. 8 + * + * Individual sub-resources are defined in several places. In the REST API, + * they they are represented by a "flag" in the "query string". + * See: "Constructing the CanonicalizedResource Element" - API Version 2006-03-01 pg. 60 + * * @param hdl: the S3Handle object - * @param resource: the UTF-8 encoded resource to access - (without query parameters) - * @param uri: the urlencoded URI to access at Amazon (may be identical to resource) * @param verb: the HTTP request method - * @param request_body: the request body, or NULL if none should be sent - * @param request_body_size: the length of the request body - * @param max_response_size: the maximum number of bytes to accept in the - * response, or 0 for no limit. - * @param preallocate_response_size: for more efficient operation, preallocate - * a buffer of this size for the response body. Addition space will be allocated - * if the response exceeds this size. + * @param bucket: the bucket to access, or NULL for none + * @param key: the key to access, or NULL for none + * @param subresource: the "sub-resource" to request (e.g. "acl") or NULL for none + * @param query: the query string to send (not including th initial '?'), + * or NULL for none + * @param read_func: the callback for reading data + * Will use s3_empty_read_func if NULL is passed in. + * @param read_reset_func: the callback for to reset reading data + * @param size_func: the callback to get the number of bytes to upload + * @param md5_func: the callback to get the MD5 hash of the data to upload + * @param read_data: pointer to pass to the above functions + * @param write_func: the callback for writing data. + * Will use s3_counter_write_func if NULL is passed in. + * @param write_reset_func: the callback for to reset writing data + * @param write_data: pointer to pass to C{write_func} + * @param progress_func: the callback for progress information + * @param progress_data: pointer to pass to C{progress_func} * @param result_handling: instructions for handling the results; see above. * @returns: the result specified by result_handling; details of the response * are then available in C{hdl->last*} */ static s3_result_t perform_request(S3Handle *hdl, - const char *resource, - const char *uri, const char *verb, - const void *request_body, - guint request_body_size, - guint max_response_size, - guint preallocate_response_size, + const char *bucket, + const char *key, + const char *subresource, + const char *query, + s3_read_func read_func, + s3_reset_func read_reset_func, + s3_size_func size_func, + s3_md5_func md5_func, + gpointer read_data, + s3_write_func write_func, + s3_reset_func write_reset_func, + gpointer write_data, + s3_progress_func progress_func, + gpointer progress_data, const result_handling_t *result_handling); /* - * Static function implementations + * a CURLOPT_WRITEFUNCTION to save part of the response in memory and + * call an external function if one was provided. */ +static size_t +s3_internal_write_func(void *ptr, size_t size, size_t nmemb, void * stream); -/* {{{ s3_error_code_from_name */ +/* + * a function to reset to our internal buffer + */ +static void +s3_internal_reset_func(void * stream); + +/* + * a CURLOPT_HEADERFUNCTION to save the ETag header only. + */ +static size_t +s3_internal_header_func(void *ptr, size_t size, size_t nmemb, void * stream); + +static gboolean +compile_regexes(void); + +/* + * Static function implementations + */ static s3_error_code_t s3_error_code_from_name(char *s3_error_name) { @@ -300,59 +407,47 @@ s3_error_code_from_name(char *s3_error_name) /* do a brute-force search through the list, since it's not sorted */ for (i = 0; i < S3_ERROR_END; i++) { - if (strcasecmp(s3_error_name, s3_error_code_names[i]) == 0) + if (g_strcasecmp(s3_error_name, s3_error_code_names[i]) == 0) return i; } return S3_ERROR_Unknown; } -/* }}} */ -/* {{{ s3_error_name_from_code */ static const char * s3_error_name_from_code(s3_error_code_t s3_error_code) { if (s3_error_code >= S3_ERROR_END) s3_error_code = S3_ERROR_Unknown; - if (s3_error_code == 0) - return NULL; - return s3_error_code_names[s3_error_code]; } -/* }}} */ -/* {{{ s3_curl_supports_ssl */ -static gboolean +gboolean s3_curl_supports_ssl(void) { static int supported = -1; - if (supported == -1) { #if defined(CURL_VERSION_SSL) - curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); - if (info->features & CURL_VERSION_SSL) - supported = 1; - else - supported = 0; + curl_version_info_data *info = curl_version_info(CURLVERSION_NOW); + if (info->features & CURL_VERSION_SSL) + supported = 1; + else + supported = 0; #else - supported = 0; + supported = 0; #endif } return supported; } -/* }}} */ -/* {{{ lookup_result */ static s3_result_t lookup_result(const result_handling_t *result_handling, guint response_code, s3_error_code_t s3_error_code, CURLcode curl_code) { - g_return_val_if_fail(result_handling != NULL, S3_RESULT_FAIL); - while (result_handling->response_code || result_handling->s3_error_code || result_handling->curl_code) { @@ -369,137 +464,210 @@ lookup_result(const result_handling_t *result_handling, /* return the result for the terminator, as the default */ return result_handling->result; } -/* }}} */ -/* {{{ build_resource */ static char * -build_resource(const char *bucket, - const char *key) +build_url(const char *bucket, + const char *key, + const char *subresource, + const char *query, + gboolean use_subdomain, + gboolean use_ssl) { + GString *url = NULL; char *esc_bucket = NULL, *esc_key = NULL; - char *resource = NULL; - if (bucket) - if (!(esc_bucket = curl_escape(bucket, 0))) - goto cleanup; + /* scheme */ + url = g_string_new("http"); + if (use_ssl) + g_string_append(url, "s"); - if (key) - if (!(esc_key = curl_escape(key, 0))) - goto cleanup; + g_string_append(url, "://"); - if (esc_bucket) { - if (esc_key) { - resource = g_strdup_printf("/%s/%s", esc_bucket, esc_key); - } else { - resource = g_strdup_printf("/%s", esc_bucket); - } - } else { - resource = g_strdup("/"); + /* domain */ + if (use_subdomain && bucket) + g_string_append_printf(url, "%s.s3.amazonaws.com/", bucket); + else + g_string_append(url, "s3.amazonaws.com/"); + + /* path */ + if (!use_subdomain && bucket) { + esc_bucket = curl_escape(bucket, 0); + if (!esc_bucket) goto cleanup; + g_string_append_printf(url, "%s", esc_bucket); + if (key) + g_string_append(url, "/"); } + + if (key) { + esc_key = curl_escape(key, 0); + if (!esc_key) goto cleanup; + g_string_append_printf(url, "%s", esc_key); + } + + /* query string */ + if (subresource || query) + g_string_append(url, "?"); + + if (subresource) + g_string_append(url, subresource); + + if (subresource && query) + g_string_append(url, "&"); + + if (query) + g_string_append(url, query); + cleanup: if (esc_bucket) curl_free(esc_bucket); if (esc_key) curl_free(esc_key); - return resource; + return g_string_free(url, FALSE); } -/* }}} */ -/* {{{ authenticate_request */ static struct curl_slist * authenticate_request(S3Handle *hdl, const char *verb, - const char *resource) + const char *bucket, + const char *key, + const char *subresource, + const char *md5_hash, + gboolean use_subdomain) { time_t t; struct tm tmp; char date[100]; - char * buf; + char *buf = NULL; HMAC_CTX ctx; - char md_value[EVP_MAX_MD_SIZE+1]; - char auth_base64[40]; - unsigned int md_len; + GByteArray *md = NULL; + char *auth_base64 = NULL; struct curl_slist *headers = NULL; - char * auth_string; + char *esc_bucket = NULL, *esc_key = NULL; + GString *auth_string = NULL; + + /* Build the string to sign, per the S3 spec. + * See: "Authenticating REST Requests" - API Version 2006-03-01 pg 58 + */ + + /* verb */ + auth_string = g_string_new(verb); + g_string_append(auth_string, "\n"); + + /* Content-MD5 header */ + if (md5_hash) + g_string_append(auth_string, md5_hash); + g_string_append(auth_string, "\n"); + + /* Content-Type is empty*/ + g_string_append(auth_string, "\n"); + /* calculate the date */ t = time(NULL); +#ifdef _WIN32 + if (!localtime_s(&tmp, &t)) g_debug("localtime error"); +#else if (!localtime_r(&t, &tmp)) perror("localtime"); +#endif if (!strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %Z", &tmp)) perror("strftime"); + g_string_append(auth_string, date); + g_string_append(auth_string, "\n"); + + if (hdl->user_token) { + g_string_append(auth_string, AMAZON_SECURITY_HEADER); + g_string_append(auth_string, ":"); + g_string_append(auth_string, hdl->user_token); + g_string_append(auth_string, ","); + g_string_append(auth_string, STS_PRODUCT_TOKEN); + g_string_append(auth_string, "\n"); + } + + /* CanonicalizedResource */ + g_string_append(auth_string, "/"); + if (bucket) { + if (use_subdomain) + g_string_append(auth_string, bucket); + else { + esc_bucket = curl_escape(bucket, 0); + if (!esc_bucket) goto cleanup; + g_string_append(auth_string, esc_bucket); + } + } + + if (bucket && (use_subdomain || key)) + g_string_append(auth_string, "/"); + + if (key) { + esc_key = curl_escape(key, 0); + if (!esc_key) goto cleanup; + g_string_append(auth_string, esc_key); + } + + if (subresource) { + g_string_append(auth_string, "?"); + g_string_append(auth_string, subresource); + } + /* run HMAC-SHA1 on the canonicalized string */ + md = g_byte_array_sized_new(EVP_MAX_MD_SIZE+1); HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, hdl->secret_key, strlen(hdl->secret_key), EVP_sha1(), NULL); - auth_string = g_strconcat(verb, "\n\n\n", date, "\n", -#ifdef WANT_DEVPAY - AMAZON_SECURITY_HEADER, ":", - hdl->user_token, ",", - STS_PRODUCT_TOKEN, "\n", -#endif - resource, NULL); - HMAC_Update(&ctx, (unsigned char*) auth_string, strlen(auth_string)); - g_free(auth_string); - md_len = EVP_MAX_MD_SIZE; - HMAC_Final(&ctx, (unsigned char*)md_value, &md_len); + HMAC_Init_ex(&ctx, hdl->secret_key, (int) strlen(hdl->secret_key), EVP_sha1(), NULL); + HMAC_Update(&ctx, (unsigned char*) auth_string->str, auth_string->len); + HMAC_Final(&ctx, md->data, &md->len); HMAC_CTX_cleanup(&ctx); - base64_encode(md_value, md_len, auth_base64, sizeof(auth_base64)); + auth_base64 = s3_base64_encode(md); /* append the new headers */ -#ifdef WANT_DEVPAY - /* Devpay headers are included in hash. */ - buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", hdl->user_token); - headers = curl_slist_append(headers, buf); - amfree(buf); - - buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", STS_PRODUCT_TOKEN); - headers = curl_slist_append(headers, buf); - amfree(buf); -#endif + if (hdl->user_token) { + /* Devpay headers are included in hash. */ + buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", hdl->user_token); + headers = curl_slist_append(headers, buf); + g_free(buf); + + buf = g_strdup_printf(AMAZON_SECURITY_HEADER ": %s", STS_PRODUCT_TOKEN); + headers = curl_slist_append(headers, buf); + g_free(buf); + } buf = g_strdup_printf("Authorization: AWS %s:%s", hdl->access_key, auth_base64); headers = curl_slist_append(headers, buf); - amfree(buf); + g_free(buf); + if (md5_hash && '\0' != md5_hash[0]) { + buf = g_strdup_printf("Content-MD5: %s", md5_hash); + headers = curl_slist_append(headers, buf); + g_free(buf); + } + buf = g_strdup_printf("Date: %s", date); headers = curl_slist_append(headers, buf); - amfree(buf); + g_free(buf); +cleanup: + g_free(esc_bucket); + g_free(esc_key); + g_byte_array_free(md, TRUE); + g_free(auth_base64); + g_string_free(auth_string, TRUE); return headers; } -/* }}} */ - -/* {{{ interpret_response */ -static void -regex_error(regex_t *regex, int reg_result) -{ - char *message; - int size; - - size = regerror(reg_result, regex, NULL, 0); - message = g_malloc(size); - if (!message) abort(); /* we're really out of luck */ - regerror(reg_result, regex, message, size); - - /* this is programmer error (bad regexp), so just log - * and abort(). There's no good way to signal a - * permanaent error from interpret_response. */ - g_error(_("Regex error: %s"), message); - g_assert_not_reached(); -} static gboolean interpret_response(S3Handle *hdl, CURLcode curl_code, char *curl_error_buffer, - void *body, - guint body_len) + gchar *body, + guint body_len, + const char *etag, + const char *content_md5) { long response_code = 0; regmatch_t pmatch[2]; - int reg_result; char *error_name = NULL, *message = NULL; char *body_copy = NULL; + gboolean ret = TRUE; if (!hdl) return FALSE; @@ -517,8 +685,17 @@ interpret_response(S3Handle *hdl, curl_easy_getinfo(hdl->curl, CURLINFO_RESPONSE_CODE, &response_code); hdl->last_response_code = response_code; - /* 2xx and 3xx codes won't have a response body*/ + /* check ETag, if present */ + if (etag && content_md5 && 200 == response_code) { + if (etag && g_strcasecmp(etag, content_md5)) + hdl->last_message = g_strdup("S3 Error: Possible data corruption (ETag returned by Amazon did not match the MD5 hash of the data sent)"); + else + ret = FALSE; + return ret; + } + if (200 <= response_code && response_code < 400) { + /* 2xx and 3xx codes won't have a response body we care about */ hdl->last_s3_error_code = S3_ERROR_None; return FALSE; } @@ -539,29 +716,11 @@ interpret_response(S3Handle *hdl, body_copy = g_strndup(body, body_len); if (!body_copy) goto cleanup; - reg_result = regexec(&error_name_regex, body_copy, 2, pmatch, 0); - if (reg_result != 0) { - if (reg_result == REG_NOMATCH) { - error_name = NULL; - } else { - regex_error(&error_name_regex, reg_result); - g_assert_not_reached(); - } - } else { + if (!s3_regexec_wrap(&error_name_regex, body_copy, 2, pmatch, 0)) error_name = find_regex_substring(body_copy, pmatch[1]); - } - reg_result = regexec(&message_regex, body_copy, 2, pmatch, 0); - if (reg_result != 0) { - if (reg_result == REG_NOMATCH) { - message = NULL; - } else { - regex_error(&message_regex, reg_result); - g_assert_not_reached(); - } - } else { + if (!s3_regexec_wrap(&message_regex, body_copy, 2, pmatch, 0)) message = find_regex_substring(body_copy, pmatch[1]); - } if (error_name) { hdl->last_s3_error_code = s3_error_code_from_name(error_name); @@ -573,19 +732,19 @@ interpret_response(S3Handle *hdl, } cleanup: - if (body_copy) g_free(body_copy); - if (message) g_free(message); - if (error_name) g_free(error_name); + g_free(body_copy); + g_free(message); + g_free(error_name); return FALSE; } -/* }}} */ -/* {{{ perform_request */ -size_t buffer_readfunction(void *ptr, size_t size, - size_t nmemb, void * stream) { +/* a CURLOPT_READFUNCTION to read data from a buffer. */ +size_t +s3_buffer_read_func(void *ptr, size_t size, size_t nmemb, void * stream) +{ CurlBuffer *data = stream; - guint bytes_desired = size * nmemb; + guint bytes_desired = (guint) size * nmemb; /* check the number of bytes remaining, just to be safe */ if (bytes_desired > data->buffer_len - data->buffer_pos) @@ -598,10 +757,34 @@ size_t buffer_readfunction(void *ptr, size_t size, } size_t -buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream) +s3_buffer_size_func(void *stream) +{ + CurlBuffer *data = stream; + return data->buffer_len; +} + +GByteArray* +s3_buffer_md5_func(void *stream) +{ + CurlBuffer *data = stream; + GByteArray req_body_gba = {(guint8 *)data->buffer, data->buffer_len}; + + return s3_compute_md5_hash(&req_body_gba); +} + +void +s3_buffer_reset_func(void *stream) +{ + CurlBuffer *data = stream; + data->buffer_pos = 0; +} + +/* a CURLOPT_WRITEFUNCTION to write data to a buffer. */ +size_t +s3_buffer_write_func(void *ptr, size_t size, size_t nmemb, void *stream) { CurlBuffer * data = stream; - guint new_bytes = size * nmemb; + guint new_bytes = (guint) size * nmemb; guint bytes_needed = data->buffer_pos + new_bytes; /* error out if the new size is greater than the maximum allowed */ @@ -618,7 +801,8 @@ buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream) data->buffer = g_realloc(data->buffer, new_size); data->buffer_len = new_size; } - g_return_val_if_fail(data->buffer, 0); /* returning zero signals an error to libcurl */ + if (!data->buffer) + return 0; /* returning zero signals an error to libcurl */ /* actually copy the data to the buffer */ memcpy(data->buffer + data->buffer_pos, ptr, new_bytes); @@ -628,44 +812,154 @@ buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream) return new_bytes; } +/* a CURLOPT_READFUNCTION that writes nothing. */ +size_t +s3_empty_read_func(G_GNUC_UNUSED void *ptr, G_GNUC_UNUSED size_t size, G_GNUC_UNUSED size_t nmemb, G_GNUC_UNUSED void * stream) +{ + return 0; +} + +size_t +s3_empty_size_func(G_GNUC_UNUSED void *stream) +{ + return 0; +} + +GByteArray* +s3_empty_md5_func(G_GNUC_UNUSED void *stream) +{ + static const GByteArray empty = {(guint8 *) "", 0}; + + return s3_compute_md5_hash(&empty); +} + +/* a CURLOPT_WRITEFUNCTION to write data that just counts data. + * s3_write_data should be NULL or a pointer to an gint64. + */ +size_t +s3_counter_write_func(G_GNUC_UNUSED void *ptr, size_t size, size_t nmemb, void *stream) +{ + gint64 *count = (gint64*) stream, inc = nmemb*size; + + if (count) *count += inc; + return inc; +} + +void +s3_counter_reset_func(void *stream) +{ + gint64 *count = (gint64*) stream; + + if (count) *count = 0; +} + +#ifdef _WIN32 +/* a CURLOPT_READFUNCTION to read data from a file. */ +size_t +s3_file_read_func(void *ptr, size_t size, size_t nmemb, void * stream) +{ + HANDLE *hFile = (HANDLE *) stream; + DWORD bytes_read; + + ReadFile(hFile, ptr, (DWORD) size*nmemb, &bytes_read, NULL); + return bytes_read; +} + +size_t +s3_file_size_func(void *stream) +{ + HANDLE *hFile = (HANDLE *) stream; + DWORD size = GetFileSize(hFile, NULL); + + if (INVALID_FILE_SIZE == size) { + return -1; + } else { + return size; + } +} + +GByteArray* +s3_file_md5_func(void *stream) +{ +#define S3_MD5_BUF_SIZE (10*1024) + HANDLE *hFile = (HANDLE *) stream; + guint8 buf[S3_MD5_BUF_SIZE]; + DWORD bytes_read; + MD5_CTX md5_ctx; + GByteArray *ret = NULL; + + g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); + + ret = g_byte_array_sized_new(S3_MD5_HASH_BYTE_LEN); + g_byte_array_set_size(ret, S3_MD5_HASH_BYTE_LEN); + MD5_Init(&md5_ctx); + + while (ReadFile(hFile, buf, S3_MD5_BUF_SIZE, &bytes_read, NULL)) { + MD5_Update(&md5_ctx, buf, bytes_read); + } + MD5_Final(ret->data, &md5_ctx); + + g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); + return ret; +#undef S3_MD5_BUF_SIZE +} + +GByteArray* +s3_file_reset_func(void *stream) +{ + g_assert(INVALID_SET_FILE_POINTER != SetFilePointer(hFile, 0, NULL, FILE_BEGIN)); +} + +/* a CURLOPT_WRITEFUNCTION to write data to a file. */ +size_t +s3_file_write_func(void *ptr, size_t size, size_t nmemb, void *stream) +{ + HANDLE *hFile = (HANDLE *) stream; + DWORD bytes_written; + + WriteFile(hFile, ptr, (DWORD) size*nmemb, &bytes_written, NULL); + return bytes_written; +} +#endif + static int curl_debug_message(CURL *curl G_GNUC_UNUSED, - curl_infotype type, - char *s, - size_t len, - void *unused G_GNUC_UNUSED) + curl_infotype type, + char *s, + size_t len, + void *unused G_GNUC_UNUSED) { char *lineprefix; char *message; char **lines, **line; switch (type) { - case CURLINFO_TEXT: - lineprefix=""; - break; - - case CURLINFO_HEADER_IN: - lineprefix="Hdr In: "; - break; - - case CURLINFO_HEADER_OUT: - lineprefix="Hdr Out: "; - break; - - default: - /* ignore data in/out -- nobody wants to see that in the - * debug logs! */ - return 0; + case CURLINFO_TEXT: + lineprefix=""; + break; + + case CURLINFO_HEADER_IN: + lineprefix="Hdr In: "; + break; + + case CURLINFO_HEADER_OUT: + lineprefix="Hdr Out: "; + break; + + default: + /* ignore data in/out -- nobody wants to see that in the + * debug logs! */ + return 0; } /* split the input into lines */ - message = g_strndup(s, len); + message = g_strndup(s, (gsize) len); lines = g_strsplit(message, "\n", -1); g_free(message); for (line = lines; *line; line++) { - if (**line == '\0') continue; /* skip blank lines */ - g_debug("%s%s", lineprefix, *line); + if (**line == '\0') continue; /* skip blank lines */ + g_debug("%s%s", lineprefix, *line); } g_strfreev(lines); @@ -674,39 +968,89 @@ curl_debug_message(CURL *curl G_GNUC_UNUSED, static s3_result_t perform_request(S3Handle *hdl, - const char *resource, - const char *uri, const char *verb, - const void *request_body, - guint request_body_size, - guint max_response_size, - guint preallocate_response_size, + const char *bucket, + const char *key, + const char *subresource, + const char *query, + s3_read_func read_func, + s3_reset_func read_reset_func, + s3_size_func size_func, + s3_md5_func md5_func, + gpointer read_data, + s3_write_func write_func, + s3_reset_func write_reset_func, + gpointer write_data, + s3_progress_func progress_func, + gpointer progress_data, const result_handling_t *result_handling) { - const char *baseurl; + gboolean use_subdomain; char *url = NULL; s3_result_t result = S3_RESULT_FAIL; /* assume the worst.. */ CURLcode curl_code = CURLE_OK; char curl_error_buffer[CURL_ERROR_SIZE] = ""; struct curl_slist *headers = NULL; - CurlBuffer readdata = { (void*)request_body, request_body_size, 0, 0 }; - CurlBuffer writedata = { NULL, 0, 0, max_response_size }; + S3InternalData int_writedata = {{NULL, 0, 0, MAX_ERROR_RESPONSE_LEN}, NULL, NULL, NULL, FALSE, NULL}; gboolean should_retry; guint retries = 0; gulong backoff = EXPONENTIAL_BACKOFF_START_USEC; + /* corresponds to PUT, HEAD, GET, and POST */ + int curlopt_upload = 0, curlopt_nobody = 0, curlopt_httpget = 0, curlopt_post = 0; + /* do we want to examine the headers */ + const char *curlopt_customrequest = NULL; + /* for MD5 calculation */ + GByteArray *md5_hash = NULL; + gchar *md5_hash_hex = NULL, *md5_hash_b64 = NULL; + size_t request_body_size = 0; - g_return_val_if_fail(hdl != NULL && hdl->curl != NULL, S3_RESULT_FAIL); + g_assert(hdl != NULL && hdl->curl != NULL); s3_reset(hdl); - baseurl = s3_curl_supports_ssl()? "https://s3.amazonaws.com":"http://s3.amazonaws.com"; - url = g_strconcat(baseurl, uri, NULL); + use_subdomain = hdl->bucket_location? TRUE : FALSE; + url = build_url(bucket, key, subresource, query, use_subdomain, hdl->use_ssl); if (!url) goto cleanup; - if (preallocate_response_size) { - writedata.buffer = g_malloc(preallocate_response_size); - if (!writedata.buffer) goto cleanup; - writedata.buffer_len = preallocate_response_size; + /* libcurl may behave strangely if these are not set correctly */ + if (!strncmp(verb, "PUT", 4)) { + curlopt_upload = 1; + } else if (!strncmp(verb, "GET", 4)) { + curlopt_httpget = 1; + } else if (!strncmp(verb, "POST", 5)) { + curlopt_post = 1; + } else if (!strncmp(verb, "HEAD", 5)) { + curlopt_nobody = 1; + } else { + curlopt_customrequest = verb; + } + + if (size_func) { + request_body_size = size_func(read_data); + } + if (md5_func) { + + md5_hash = md5_func(read_data); + if (md5_hash) { + md5_hash_b64 = s3_base64_encode(md5_hash); + md5_hash_hex = s3_hex_encode(md5_hash); + g_byte_array_free(md5_hash, TRUE); + } + } + if (!read_func) { + /* Curl will use fread() otherwise */ + read_func = s3_empty_read_func; + } + + if (write_func) { + int_writedata.write_func = write_func; + int_writedata.reset_func = write_reset_func; + int_writedata.write_data = write_data; + } else { + /* Curl will use fwrite() otherwise */ + int_writedata.write_func = s3_counter_write_func; + int_writedata.reset_func = s3_counter_reset_func; + int_writedata.write_data = NULL; } while (1) { @@ -714,68 +1058,79 @@ perform_request(S3Handle *hdl, if (headers) { curl_slist_free_all(headers); } - readdata.buffer_pos = 0; - writedata.buffer_pos = 0; - curl_error_buffer[0] = '\0'; + curl_error_buffer[0] = '\0'; + if (read_reset_func) { + read_reset_func(read_data); + } + /* calls write_reset_func */ + s3_internal_reset_func(&int_writedata); /* set up the request */ - headers = authenticate_request(hdl, verb, resource); + headers = authenticate_request(hdl, verb, bucket, key, subresource, + md5_hash_b64, hdl->bucket_location? TRUE : FALSE); if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_VERBOSE, hdl->verbose))) goto curl_error; - if (hdl->verbose) - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_DEBUGFUNCTION, - curl_debug_message))) - goto curl_error; + if (hdl->verbose) { + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_DEBUGFUNCTION, + curl_debug_message))) + goto curl_error; + } if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_ERRORBUFFER, curl_error_buffer))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOPROGRESS, 1))) goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_FOLLOWLOCATION, 1))) + goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_URL, url))) goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPHEADER, headers))) goto curl_error; - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST, - verb))) + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEFUNCTION, s3_internal_write_func))) goto curl_error; - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEFUNCTION, buffer_writefunction))) + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEDATA, &int_writedata))) goto curl_error; - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_WRITEDATA, &writedata))) + /* Note: we always have to set this apparently, for consistent "end of header" detection */ + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HEADERFUNCTION, s3_internal_header_func))) + goto curl_error; + /* Note: if set, CURLOPT_HEADERDATA seems to also be used for CURLOPT_WRITEDATA ? */ + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HEADERDATA, &int_writedata))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_PROGRESSFUNCTION, progress_func))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_PROGRESSDATA, progress_data))) goto curl_error; - if (max_response_size) { -#ifdef CURLOPT_MAXFILESIZE_LARGE - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE_LARGE, (curl_off_t)max_response_size))) - goto curl_error; -#else -# ifdef CURLOPT_MAXFILESIZE - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_MAXFILESIZE, (long)max_response_size))) - goto curl_error; -# else - /* no MAXFILESIZE option -- that's OK */ -# endif -#endif - } - if (request_body) { - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 1))) - goto curl_error; #ifdef CURLOPT_INFILESIZE_LARGE - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)request_body_size))) - goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)request_body_size))) + goto curl_error; #else - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE, (long)request_body_size))) - goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_INFILESIZE, (long)request_body_size))) + goto curl_error; #endif - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, buffer_readfunction))) + + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_HTTPGET, curlopt_httpget))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, curlopt_upload))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_POST, curlopt_post))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_NOBODY, curlopt_nobody))) + goto curl_error; + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CUSTOMREQUEST, + curlopt_customrequest))) + goto curl_error; + + + if (curlopt_upload) { + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, read_func))) goto curl_error; - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, &readdata))) + if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READDATA, read_data))) goto curl_error; } else { /* Clear request_body options. */ - if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_UPLOAD, 0))) - goto curl_error; if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_READFUNCTION, NULL))) goto curl_error; @@ -791,7 +1146,7 @@ perform_request(S3Handle *hdl, /* interpret the response into hdl->last* */ curl_error: /* (label for short-circuiting the curl_easy_perform call) */ should_retry = interpret_response(hdl, curl_code, curl_error_buffer, - writedata.buffer, writedata.buffer_pos); + int_writedata.resp_buf.buffer, int_writedata.resp_buf.buffer_pos, int_writedata.etag, md5_hash_hex); /* and, unless we know we need to retry, see what we're to do now */ if (!should_retry) { @@ -825,56 +1180,168 @@ perform_request(S3Handle *hdl, } cleanup: - if (url) g_free(url); + g_free(url); if (headers) curl_slist_free_all(headers); + g_free(md5_hash_b64); + g_free(md5_hash_hex); /* we don't deallocate the response body -- we keep it for later */ - hdl->last_response_body = writedata.buffer; - hdl->last_response_body_size = writedata.buffer_pos; + hdl->last_response_body = int_writedata.resp_buf.buffer; + hdl->last_response_body_size = int_writedata.resp_buf.buffer_pos; hdl->last_num_retries = retries; return result; } -/* }}} */ -/* - * Public function implementations - */ -/* {{{ s3_init */ -gboolean -s3_init(void) +static size_t +s3_internal_write_func(void *ptr, size_t size, size_t nmemb, void * stream) +{ + S3InternalData *data = (S3InternalData *) stream; + size_t bytes_saved; + + if (!data->headers_done) + return size*nmemb; + + bytes_saved = s3_buffer_write_func(ptr, size, nmemb, &data->resp_buf); + if (data->write_func) { + return data->write_func(ptr, size, nmemb, data->write_data); + } else { + return bytes_saved; + } +} + +static void +s3_internal_reset_func(void * stream) +{ + S3InternalData *data = (S3InternalData *) stream; + + s3_buffer_reset_func(&data->resp_buf); + data->headers_done = FALSE; + data->etag = NULL; + if (data->reset_func) { + data->reset_func(data->write_data); + } +} + +static size_t +s3_internal_header_func(void *ptr, size_t size, size_t nmemb, void * stream) { + static const char *final_header = "\r\n"; + char *header; + regmatch_t pmatch[2]; + S3InternalData *data = (S3InternalData *) stream; + + header = g_strndup((gchar *) ptr, (gsize) size*nmemb); + if (!s3_regexec_wrap(&etag_regex, header, 2, pmatch, 0)) + data->etag = find_regex_substring(header, pmatch[1]); + if (!strcmp(final_header, header)) + data->headers_done = TRUE; + + return size*nmemb; +} + +static gboolean +compile_regexes(void) +{ +#ifdef HAVE_REGEX_H + + /* using POSIX regular expressions */ + struct {const char * str; int flags; regex_t *regex;} regexes[] = { + {"[[:space:]]*([^<]*)[[:space:]]*", REG_EXTENDED | REG_ICASE, &error_name_regex}, + {"^ETag:[[:space:]]*\"([^\"]+)\"[[:space:]]*$", REG_EXTENDED | REG_ICASE | REG_NEWLINE, &etag_regex}, + {"[[:space:]]*([^<]*)[[:space:]]*", REG_EXTENDED | REG_ICASE, &message_regex}, + {"^[a-z0-9]((-*[a-z0-9])|(\\.[a-z0-9])){2,62}$", REG_EXTENDED | REG_NOSUB, &subdomain_regex}, + {"(/>)|(>([^<]*))", REG_EXTENDED | REG_ICASE, &location_con_regex}, + {NULL, 0, NULL} + }; char regmessage[1024]; - int size; + int size, i; int reg_result; - reg_result = regcomp(&error_name_regex, error_name_regex_string, REG_EXTENDED | REG_ICASE); - if (reg_result != 0) { - size = regerror(reg_result, &error_name_regex, regmessage, sizeof(regmessage)); - g_error(_("Regex error: %s"), regmessage); - return FALSE; + for (i = 0; regexes[i].str; i++) { + reg_result = regcomp(regexes[i].regex, regexes[i].str, regexes[i].flags); + if (reg_result != 0) { + size = regerror(reg_result, regexes[i].regex, regmessage, sizeof(regmessage)); + g_error(_("Regex error: %s"), regmessage); + return FALSE; + } } +#else /* ! HAVE_REGEX_H */ + /* using PCRE via GLib */ + struct {const char * str; int flags; regex_t *regex;} regexes[] = { + {"\\s*([^<]*)\\s*", + G_REGEX_OPTIMIZE | G_REGEX_CASELESS, + &error_name_regex}, + {"^ETag:\\s*\"([^\"]+)\"\\s*$", + G_REGEX_OPTIMIZE | G_REGEX_CASELESS, + &etag_regex}, + {"\\s*([^<]*)\\s*", + G_REGEX_OPTIMIZE | G_REGEX_CASELESS, + &message_regex}, + {"^[a-z0-9]((-*[a-z0-9])|(\\.[a-z0-9])){2,62}$", + G_REGEX_OPTIMIZE | G_REGEX_NO_AUTO_CAPTURE, + &subdomain_regex}, + {"(/>)|(>([^<]*))", + G_REGEX_CASELESS, + &location_con_regex}, + {NULL, 0, NULL} + }; + int i; + GError *err = NULL; + + for (i = 0; regexes[i].str; i++) { + *(regexes[i].regex) = g_regex_new(regexes[i].str, regexes[i].flags, 0, &err); + if (err) { + g_error(_("Regex error: %s"), err->message); + g_error_free(err); + return FALSE; + } + } +#endif + return TRUE; +} - reg_result = regcomp(&message_regex, message_regex_string, REG_EXTENDED | REG_ICASE); - if (reg_result != 0) { - size = regerror(reg_result, &message_regex, regmessage, sizeof(regmessage)); - g_error(_("Regex error: %s"), regmessage); - return FALSE; +/* + * Public function implementations + */ + +gboolean s3_init(void) +{ + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; + static gboolean init = FALSE, ret; + + /* n.b. curl_global_init is called in common-src/glib-util.c:glib_init() */ + + g_static_mutex_lock (&mutex); + if (!init) { + ret = compile_regexes(); + init = TRUE; } + g_static_mutex_unlock(&mutex); + return ret; +} - return TRUE; +gboolean +s3_curl_location_compat(void) +{ + curl_version_info_data *info; + + info = curl_version_info(CURLVERSION_NOW); + return info->version_num > 0x070a02; +} + +gboolean +s3_bucket_location_compat(const char *bucket) +{ + return !s3_regexec_wrap(&subdomain_regex, bucket, 0, NULL, 0); } -/* }}} */ -/* {{{ s3_open */ S3Handle * s3_open(const char *access_key, - const char *secret_key -#ifdef WANT_DEVPAY - , - const char *user_token -#endif + const char *secret_key, + const char *user_token, + const char *bucket_location ) { S3Handle *hdl; @@ -882,17 +1349,17 @@ s3_open(const char *access_key, if (!hdl) goto error; hdl->verbose = FALSE; + hdl->use_ssl = s3_curl_supports_ssl(); + g_assert(access_key); hdl->access_key = g_strdup(access_key); - if (!hdl->access_key) goto error; - + g_assert(secret_key); hdl->secret_key = g_strdup(secret_key); - if (!hdl->secret_key) goto error; - -#ifdef WANT_DEVPAY + /* NULL is okay */ hdl->user_token = g_strdup(user_token); - if (!hdl->user_token) goto error; -#endif + + /* NULL is okay */ + hdl->bucket_location = g_strdup(bucket_location); hdl->curl = curl_easy_init(); if (!hdl->curl) goto error; @@ -903,28 +1370,23 @@ error: s3_free(hdl); return NULL; } -/* }}} */ -/* {{{ s3_free */ void s3_free(S3Handle *hdl) { s3_reset(hdl); if (hdl) { - if (hdl->access_key) g_free(hdl->access_key); - if (hdl->secret_key) g_free(hdl->secret_key); -#ifdef WANT_DEVPAY + g_free(hdl->access_key); + g_free(hdl->secret_key); if (hdl->user_token) g_free(hdl->user_token); -#endif + if (hdl->bucket_location) g_free(hdl->bucket_location); if (hdl->curl) curl_easy_cleanup(hdl->curl); g_free(hdl); } } -/* }}} */ -/* {{{ s3_reset */ void s3_reset(S3Handle *hdl) { @@ -950,9 +1412,7 @@ s3_reset(S3Handle *hdl) hdl->last_response_body_size = 0; } } -/* }}} */ -/* {{{ s3_error */ void s3_error(S3Handle *hdl, const char **message, @@ -979,17 +1439,25 @@ s3_error(S3Handle *hdl, if (num_retries) *num_retries = 0; } } -/* }}} */ -/* {{{ s3_verbose */ void s3_verbose(S3Handle *hdl, gboolean verbose) { hdl->verbose = verbose; } -/* }}} */ -/* {{{ s3_sterror */ +gboolean +s3_use_ssl(S3Handle *hdl, gboolean use_ssl) +{ + gboolean ret = TRUE; + if (use_ssl & !s3_curl_supports_ssl()) { + ret = FALSE; + } else { + hdl->use_ssl = use_ssl; + } + return ret; +} + char * s3_strerror(S3Handle *hdl) { @@ -1019,13 +1487,12 @@ s3_strerror(S3Handle *hdl) return g_strdup_printf("%s%s%s%s%s", message, s3_info, curl_info, response_info, retries_info); } -/* }}} */ -/* {{{ s3_upload */ /* Perform an upload. When this function returns, KEY and * BUFFER remain the responsibility of the caller. * * @param self: the s3 device + * @param bucket: the bucket to which the upload should be made * @param key: the key to which the upload should be made * @param buffer: the data to be uploaded * @param buffer_len: the length of the data to upload @@ -1035,10 +1502,14 @@ gboolean s3_upload(S3Handle *hdl, const char *bucket, const char *key, - gpointer buffer, - guint buffer_len) + s3_read_func read_func, + s3_reset_func reset_func, + s3_size_func size_func, + s3_md5_func md5_func, + gpointer read_data, + s3_progress_func progress_func, + gpointer progress_data) { - char *resource = NULL; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, @@ -1046,21 +1517,16 @@ s3_upload(S3Handle *hdl, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; - g_return_val_if_fail(hdl != NULL, FALSE); + g_assert(hdl != NULL); - resource = build_resource(bucket, key); - if (resource) { - result = perform_request(hdl, resource, resource, "PUT", - buffer, buffer_len, MAX_ERROR_RESPONSE_LEN, 0, - result_handling); - g_free(resource); - } + result = perform_request(hdl, "PUT", bucket, key, NULL, NULL, + read_func, reset_func, size_func, md5_func, read_data, + NULL, NULL, NULL, progress_func, progress_data, + result_handling); return result == S3_RESULT_OK; } -/* }}} */ -/* {{{ s3_list_keys */ /* Private structure for our "thunk", which tracks where the user is in the list * of keys. */ @@ -1092,17 +1558,17 @@ list_start_element(GMarkupParseContext *context G_GNUC_UNUSED, struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data; thunk->want_text = 0; - if (strcasecmp(element_name, "contents") == 0) { + if (g_strcasecmp(element_name, "contents") == 0) { thunk->in_contents = 1; - } else if (strcasecmp(element_name, "commonprefixes") == 0) { + } else if (g_strcasecmp(element_name, "commonprefixes") == 0) { thunk->in_common_prefixes = 1; - } else if (strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { + } else if (g_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { thunk->want_text = 1; - } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) { + } else if (g_strcasecmp(element_name, "key") == 0 && thunk->in_contents) { thunk->want_text = 1; - } else if (strcasecmp(element_name, "istruncated")) { + } else if (g_strcasecmp(element_name, "istruncated")) { thunk->want_text = 1; - } else if (strcasecmp(element_name, "nextmarker")) { + } else if (g_strcasecmp(element_name, "nextmarker")) { thunk->want_text = 1; } } @@ -1115,20 +1581,20 @@ list_end_element(GMarkupParseContext *context G_GNUC_UNUSED, { struct list_keys_thunk *thunk = (struct list_keys_thunk *)user_data; - if (strcasecmp(element_name, "contents") == 0) { + if (g_strcasecmp(element_name, "contents") == 0) { thunk->in_contents = 0; - } else if (strcasecmp(element_name, "commonprefixes") == 0) { + } else if (g_strcasecmp(element_name, "commonprefixes") == 0) { thunk->in_common_prefixes = 0; - } else if (strcasecmp(element_name, "key") == 0 && thunk->in_contents) { + } else if (g_strcasecmp(element_name, "key") == 0 && thunk->in_contents) { thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text); thunk->text = NULL; - } else if (strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { + } else if (g_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) { thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text); thunk->text = NULL; - } else if (strcasecmp(element_name, "istruncated") == 0) { - if (thunk->text && strncasecmp(thunk->text, "false", 5) != 0) + } else if (g_strcasecmp(element_name, "istruncated") == 0) { + if (thunk->text && g_strncasecmp(thunk->text, "false", 5) != 0) thunk->is_truncated = TRUE; - } else if (strcasecmp(element_name, "nextmarker") == 0) { + } else if (g_strcasecmp(element_name, "nextmarker") == 0) { if (thunk->next_marker) g_free(thunk->next_marker); thunk->next_marker = thunk->text; thunk->text = NULL; @@ -1150,78 +1616,55 @@ list_text(GMarkupParseContext *context G_GNUC_UNUSED, } } -/* Helper function for list_fetch */ -static gboolean -list_build_url_component(char **rv, - const char *delim, - const char *key, - const char *value) -{ - char *esc_value = NULL; - char *new_rv = NULL; - - esc_value = curl_escape(value, 0); - if (!esc_value) goto cleanup; - - new_rv = g_strconcat(*rv, delim, key, "=", esc_value, NULL); - if (!new_rv) goto cleanup; - - g_free(*rv); - *rv = new_rv; - curl_free(esc_value); - - return TRUE; - -cleanup: - if (new_rv) g_free(new_rv); - if (esc_value) curl_free(esc_value); - - return FALSE; -} - /* Perform a fetch from S3; several fetches may be involved in a * single listing operation */ static s3_result_t list_fetch(S3Handle *hdl, - const char *resource, + const char *bucket, const char *prefix, const char *delimiter, const char *marker, const char *max_keys) { - char *urldelim = "?"; - char *uri = g_strdup(resource); - s3_result_t result = S3_RESULT_FAIL; + s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; - - /* build the URI */ - if (prefix) { - if (!list_build_url_component(&uri, urldelim, "prefix", prefix)) goto cleanup; - urldelim = "&"; - } - if (delimiter) { - if (!list_build_url_component(&uri, urldelim, "delimiter", delimiter)) goto cleanup; - urldelim = "&"; - } - if (marker) { - if (!list_build_url_component(&uri, urldelim, "marker", marker)) goto cleanup; - urldelim = "&"; - } - if (max_keys) { - if (!list_build_url_component(&uri, urldelim, "max-keys", max_keys)) goto cleanup; - urldelim = "&"; + const char* pos_parts[][2] = { + {"prefix", prefix}, + {"delimiter", delimiter}, + {"marker", marker}, + {"make-keys", max_keys}, + {NULL, NULL} + }; + char *esc_value; + GString *query; + guint i; + gboolean have_prev_part = FALSE; + + /* loop over possible parts to build query string */ + query = g_string_new(""); + for (i = 0; pos_parts[i][0]; i++) { + if (pos_parts[i][1]) { + if (have_prev_part) + g_string_append(query, "&"); + else + have_prev_part = TRUE; + esc_value = curl_escape(pos_parts[i][1], 0); + g_string_append_printf(query, "%s=%s", pos_parts[i][0], esc_value); + curl_free(esc_value); + } } /* and perform the request on that URI */ - result = perform_request(hdl, resource, uri, "GET", NULL, - 0, MAX_ERROR_RESPONSE_LEN, 0, result_handling); + result = perform_request(hdl, "GET", bucket, NULL, NULL, query->str, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + result_handling); + + if (query) g_string_free(query, TRUE); -cleanup: - if (uri) g_free(uri); return result; } @@ -1232,7 +1675,6 @@ s3_list_keys(S3Handle *hdl, const char *delimiter, GSList **list) { - char *resource = NULL; struct list_keys_thunk thunk; GMarkupParseContext *ctxt = NULL; static GMarkupParser parser = { list_start_element, list_end_element, list_text, NULL, NULL }; @@ -1245,13 +1687,10 @@ s3_list_keys(S3Handle *hdl, thunk.text = NULL; thunk.next_marker = NULL; - resource = build_resource(bucket, NULL); - if (!resource) goto cleanup; - /* Loop until S3 has given us the entire picture */ do { /* get some data from S3 */ - result = list_fetch(hdl, resource, prefix, delimiter, thunk.next_marker, NULL); + result = list_fetch(hdl, bucket, prefix, delimiter, thunk.next_marker, NULL); if (result != S3_RESULT_OK) goto cleanup; /* run the parser over it */ @@ -1285,7 +1724,6 @@ cleanup: if (err) g_error_free(err); if (thunk.text) g_free(thunk.text); if (thunk.next_marker) g_free(thunk.next_marker); - if (resource) g_free(resource); if (ctxt) g_markup_parse_context_free(ctxt); if (result != S3_RESULT_OK) { @@ -1296,18 +1734,17 @@ cleanup: return TRUE; } } -/* }}} */ -/* {{{ s3_read */ gboolean s3_read(S3Handle *hdl, const char *bucket, const char *key, - gpointer *buf_ptr, - guint *buf_size, - guint max_size) + s3_write_func write_func, + s3_reset_func reset_func, + gpointer write_data, + s3_progress_func progress_func, + gpointer progress_data) { - char *resource = NULL; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, @@ -1315,41 +1752,21 @@ s3_read(S3Handle *hdl, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; - g_return_val_if_fail(hdl != NULL, FALSE); - g_assert(buf_ptr != NULL); - g_assert(buf_size != NULL); - - *buf_ptr = NULL; - *buf_size = 0; + g_assert(hdl != NULL); + g_assert(write_func != NULL); - resource = build_resource(bucket, key); - if (resource) { - result = perform_request(hdl, resource, resource, - "GET", NULL, 0, max_size, 0, result_handling); - g_free(resource); - - /* copy the pointer to the result parameters and remove - * our reference to it */ - if (result == S3_RESULT_OK) { - *buf_ptr = hdl->last_response_body; - *buf_size = hdl->last_response_body_size; - - hdl->last_response_body = NULL; - hdl->last_response_body_size = 0; - } - } + result = perform_request(hdl, "GET", bucket, key, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, write_func, reset_func, write_data, + progress_func, progress_data, result_handling); return result == S3_RESULT_OK; } -/* }}} */ -/* {{{ s3_delete */ gboolean s3_delete(S3Handle *hdl, const char *bucket, const char *key) { - char *resource = NULL; s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 204, 0, 0, S3_RESULT_OK }, @@ -1357,41 +1774,106 @@ s3_delete(S3Handle *hdl, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; - g_return_val_if_fail(hdl != NULL, FALSE); + g_assert(hdl != NULL); - resource = build_resource(bucket, key); - if (resource) { - result = perform_request(hdl, resource, resource, "DELETE", NULL, 0, - MAX_ERROR_RESPONSE_LEN, 0, result_handling); - g_free(resource); - } + result = perform_request(hdl, "DELETE", bucket, key, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + result_handling); return result == S3_RESULT_OK; } -/* }}} */ -/* {{{ s3_make_bucket */ gboolean s3_make_bucket(S3Handle *hdl, const char *bucket) { - char *resource = NULL; - s3_result_t result = result = S3_RESULT_FAIL; + char *body = NULL; + s3_result_t result = S3_RESULT_FAIL; static result_handling_t result_handling[] = { { 200, 0, 0, S3_RESULT_OK }, RESULT_HANDLING_ALWAYS_RETRY, { 0, 0, 0, /* default: */ S3_RESULT_FAIL } }; + regmatch_t pmatch[4]; + char *loc_end_open, *loc_content; + CurlBuffer buf = {NULL, 0, 0, 0}, *ptr = NULL; + s3_read_func read_func = NULL; + s3_reset_func reset_func = NULL; + s3_md5_func md5_func = NULL; + s3_size_func size_func = NULL; + + g_assert(hdl != NULL); + + if (hdl->bucket_location) { + if (s3_bucket_location_compat(bucket)) { + ptr = &buf; + buf.buffer = g_strdup_printf(AMAZON_BUCKET_CONF_TEMPLATE, hdl->bucket_location); + buf.buffer_len = (guint) strlen(body); + buf.buffer_pos = 0; + buf.max_buffer_size = buf.buffer_len; + read_func = s3_buffer_read_func; + reset_func = s3_buffer_reset_func; + size_func = s3_buffer_size_func; + md5_func = s3_buffer_md5_func; + } else { + hdl->last_message = g_strdup_printf(_( + "Location constraint given for Amazon S3 bucket, " + "but the bucket name (%s) is not usable as a subdomain."), bucket); + return FALSE; + } + } - g_return_val_if_fail(hdl != NULL, FALSE); + result = perform_request(hdl, "PUT", bucket, NULL, NULL, NULL, + read_func, reset_func, size_func, md5_func, ptr, + NULL, NULL, NULL, NULL, NULL, result_handling); + + if (result == S3_RESULT_OK || + (hdl->bucket_location && result != S3_RESULT_OK + && hdl->last_s3_error_code == S3_ERROR_BucketAlreadyOwnedByYou)) { + /* verify the that the location constraint on the existing bucket matches + * the one that's configured. + */ + result = perform_request(hdl, "GET", bucket, NULL, "location", NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, result_handling); + + /* note that we can check only one of the three AND conditions above + * and infer that the others are true + */ + if (result == S3_RESULT_OK && hdl->bucket_location) { + /* return to the default state of failure */ + result = S3_RESULT_FAIL; - resource = build_resource(bucket, NULL); - if (resource) { - result = perform_request(hdl, resource, resource, "PUT", NULL, 0, - MAX_ERROR_RESPONSE_LEN, 0, result_handling); - g_free(resource); + if (body) g_free(body); + /* use strndup to get a null-terminated string */ + body = g_strndup(hdl->last_response_body, hdl->last_response_body_size); + if (!body) goto cleanup; + + if (!s3_regexec_wrap(&location_con_regex, body, 4, pmatch, 0)) { + loc_end_open = find_regex_substring(body, pmatch[1]); + loc_content = find_regex_substring(body, pmatch[3]); + + /* The case of an empty string is special because XML allows + * "self-closing" tags + */ + if ('\0' == hdl->bucket_location[0] && + '/' != loc_end_open[0] && '\0' != hdl->bucket_location[0]) + hdl->last_message = _("An empty location constraint is " + "configured, but the bucket has a non-empty location constraint"); + else if (strncmp(loc_content, hdl->bucket_location, strlen(hdl->bucket_location))) + hdl->last_message = _("The location constraint configured " + "does not match the constraint currently on the bucket"); + else + result = S3_RESULT_OK; + } else { + hdl->last_message = _("Unexpected location response from Amazon S3"); + } + } } +cleanup: + if (body) g_free(body); + return result == S3_RESULT_OK; + } -/* }}} */ diff --git a/device-src/s3.h b/device-src/s3.h index 086b6f0..b3d3b39 100644 --- a/device-src/s3.h +++ b/device-src/s3.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #ifndef __S3_H__ @@ -32,15 +32,85 @@ * in different threads simultaneously. */ typedef struct S3Handle S3Handle; +/* Callback function to read data to upload + * + * @note this is the same as CURLOPT_READFUNCTION + * + * @param data: The pointer to write data to + * @param size: The size of each "element" of the data buffer in bytes + * @param nmemb: The number of elements in the data buffer. + * So, the buffer's size is size*nmemb bytes. + * @param stream: The read_data (an opaque pointer) + * + * @return The number of bytes written to the buffer, + * CURL_READFUNC_PAUSE to pause, or CURL_READFUNC_ABORT to abort. + * Return 0 only if there's no more data to be uploaded. + */ +typedef size_t (*s3_read_func)(void *data, size_t size, size_t nmemb, void *stream); + +/* This function is called to get size of the upload data + * + * @param data: The write_data (opaque pointer) + * + * @return The number of bytes of data, negative for error + */ +typedef size_t (*s3_size_func)(void *data); + +/* This function is called to get MD5 hash of the upload data + * + * @param data: The write_data (opaque pointer) + * + * @return The MD5 hash, NULL on error + */ +typedef GByteArray* (*s3_md5_func)(void *data); + +/* This function is called to reset an upload or download data stream + * to the beginning + * + * @param data: The read_data or write_data (opaque pointer) + * + * @return The number of bytes of data, negative for error + */ +typedef void (*s3_reset_func)(void *data); + +/* Callback function to write data that's been downloaded + * + * @note this is the same as CURLOPT_WRITEFUNCTION + * + * @param data: The pointer to read data from + * @param size: The size of each "element" of the data buffer in bytes + * @param nmemb: The number of elements in the data buffer. + * So, the buffer's size is size*nmemb bytes. + * @param stream: the write_data (an opaque pointer) + * + * @return The number of bytes written to the buffer or + * CURL_WRITEFUNC_PAUSE to pause. + * If it's the number of bytes written, it should match the buffer size + */ +typedef size_t (*s3_write_func)(void *data, size_t size, size_t nmemb, void *stream); + +/** + * Callback function to track progress + * + * @note this is the same as CURLOPT_PROGRESSFUNCTION + * + * @param data: The progress_data + * @param dltotal: The total number of bytes to downloaded + * @param dlnow: The current number of bytes downloaded + * @param ultotal: The total number of bytes to downloaded + * @param ulnow: The current number of bytes downloaded + * + * @return 0 to continue, non-zero to abort. + */ +typedef curl_progress_callback s3_progress_func; + /* * Constants */ -#ifdef WANT_DEVPAY /* These are assumed to be already URL-escaped. */ -# define STS_BASE_URL "https://sts.amazonaws.com/" +# define STS_BASE_URL "https://ls.amazonaws.com/" # define STS_PRODUCT_TOKEN "{ProductToken}AAAGQXBwVGtu4geoGybuwuk8VEEPzJ9ZANpu0yzbf9g4Gs5Iarzff9B7qaDBEEaWcAzWpcN7zmdMO765jOtEFc4DWTRNkpPSzUnTdkHbdYUamath73OreaZtB86jy/JF0gsHZfhxeKc/3aLr8HNT//DsX3r272zYHLDPWWUbFguOwqNjllnt6BshYREx59l8RrWABLSa37dyJeN+faGvz3uQxiDakZRn3LfInOE6d9+fTFl50LPoP08LCqI/SJfpouzWix7D/cep3Jq8yYNyM1rgAOTF7/wh7r8OuPDLJ/xZUDLfykePIAM=" -#endif /* This preprocessor magic will enumerate constants named S3_ERROR_XxxYyy for * each of the errors in parentheses. @@ -56,6 +126,7 @@ typedef struct S3Handle S3Handle; S3_ERROR(OperationAborted), \ S3_ERROR(BadDigest), \ S3_ERROR(BucketAlreadyExists), \ + S3_ERROR(BucketAlreadyOwnedByYou), \ S3_ERROR(BucketNotEmpty), \ S3_ERROR(CredentialsNotSupported), \ S3_ERROR(EntityTooLarge), \ @@ -106,10 +177,37 @@ typedef enum { * Functions */ -/* Initialize S3 operation +/* Does this install of curl support SSL? + * + * @returns: boolean + */ +gboolean +s3_curl_supports_ssl(void); + +/* Checks if the version of libcurl being used supports and checks + * wildcard certificates correctly (used for the subdomains required + * by location constraints). + * + * @returns: true if the version of libcurl is new enough + */ +gboolean +s3_curl_location_compat(void); + +/* Checks if a bucket name is compatible with setting a location + * constraint. * - * As a requirement of C{curl_global_init}, which this function calls, - * s3_init I{must} be called before any other threads are started. + * @note This doesn't guarantee that bucket name is entirely valid, + * just that using it as one (or more) subdomain(s) of s3.amazonaws.com + * won't fail; that would prevent the reporting of useful messages from + * the service. + * + * @param bucket: the bucket name + * @returns: true if the bucket name is compatible + */ +gboolean +s3_bucket_location_compat(const char *bucket); + +/* Initialize S3 operation * * If an error occurs in this function, diagnostic information is * printed to stderr. @@ -120,13 +218,19 @@ gboolean s3_init(void); /* Set up an S3Handle. + * + * The concept of a bucket is defined by the Amazon S3 API. + * See: "Components of Amazon S3" - API Version 2006-03-01 pg. 8 + * + * @param access_key: the secret key for Amazon Web Services + * @param secret_key: the secret key for Amazon Web Services + * @param user_token: the user token for Amazon DevPay + * @param bucket_location: the location constraint for buckets + * @returns: the new S3Handle */ S3Handle * -s3_open(const char * access_key, const char *secret_key -#ifdef WANT_DEVPAY - , const char * user_token -#endif - ); +s3_open(const char * access_key, const char *secret_key, const char * user_token, + const char * bucket_location); /* Deallocate an S3Handle * @@ -178,7 +282,16 @@ s3_error(S3Handle *hdl, */ void s3_verbose(S3Handle *hdl, - gboolean verbose); + gboolean verbose); + +/* Control the use of SSL with HTTP transactions. + * + * @param hdl: the S3Handle object + * @param use_ssl: if true, use SSL (if curl supports it) + * @returns: true if the setting is valid + */ +gboolean +s3_use_ssl(S3Handle *hdl, gboolean use_ssl); /* Get the error information from the last operation on this handle, * formatted as a string. @@ -199,16 +312,27 @@ s3_strerror(S3Handle *hdl); * @param hdl: the S3Handle object * @param bucket: the bucket to which the upload should be made * @param key: the key to which the upload should be made - * @param buffer: the data to be uploaded - * @param buffer_len: the length of the data to upload + * @param read_func: the callback for reading data + * @param reset_func: the callback for to reset reading data + * @param size_func: the callback to get the number of bytes to upload + * @param md5_func: the callback to get the MD5 hash of the data to upload + * @param read_data: pointer to pass to the above functions + * @param progress_func: the callback for progress information + * @param progress_data: pointer to pass to C{progress_func} + * * @returns: false if an error ocurred */ gboolean s3_upload(S3Handle *hdl, const char *bucket, const char *key, - gpointer buffer, - guint buffer_len); + s3_read_func read_func, + s3_reset_func reset_func, + s3_size_func size_func, + s3_md5_func md5_func, + gpointer read_data, + s3_progress_func progress_func, + gpointer progress_data); /* List all of the files matching the pseudo-glob C{PREFIX*DELIMITER*}, * returning only that portion which matches C{PREFIX*DELIMITER}. S3 supports @@ -229,26 +353,28 @@ s3_list_keys(S3Handle *hdl, const char *delimiter, GSList **list); -/* Read an entire file. The buffer returned is the responsibility of the caller. A - * buffer is only returned if no error occurred, and will be NULL otherwise. +/* Read an entire file, passing the contents to write_func buffer + * by buffer. * * @param hdl: the S3Handle object * @param bucket: the bucket to read from * @param key: the key to read from - * @param buf_ptr: (result) a pointer to a C{gpointer} which will contain a pointer to - * the block read - * @param buf_size: (result) a pointer to a C{guint} which will contain the size of the - * block read - * @param max_size: maximum size of the file + * @param write_func: the callback for writing data + * @param reset_func: the callback for to reset writing data + * @param write_data: pointer to pass to C{write_func} + * @param progress_func: the callback for progress information + * @param progress_data: pointer to pass to C{progress_func} * @returns: FALSE if an error occurs */ gboolean s3_read(S3Handle *hdl, const char *bucket, const char *key, - gpointer *buf_ptr, - guint *buf_size, - guint max_size); + s3_write_func write_func, + s3_reset_func reset_func, + gpointer write_data, + s3_progress_func progress_func, + gpointer progress_data); /* Delete a file. * @@ -286,13 +412,68 @@ typedef struct { guint max_buffer_size; } CurlBuffer; +#define S3_BUFFER_READ_FUNCS s3_buffer_read_func, s3_buffer_reset_func, s3_buffer_size_func, s3_buffer_md5_func + +#define S3_BUFFER_WRITE_FUNCS s3_buffer_write_func, s3_buffer_reset_func + /* a CURLOPT_READFUNCTION to read data from a buffer. */ -size_t buffer_readfunction(void *ptr, size_t size, - size_t nmemb, void * stream); +size_t +s3_buffer_read_func(void *ptr, size_t size, size_t nmemb, void * stream); + +size_t +s3_buffer_size_func(void *stream); + +GByteArray* +s3_buffer_md5_func(void *stream); + +void +s3_buffer_reset_func(void *stream); + +#define S3_EMPTY_READ_FUNCS s3_empty_read_func, NULL, s3_empty_size_func, s3_empty_md5_func /* a CURLOPT_WRITEFUNCTION to write data to a buffer. */ size_t -buffer_writefunction(void *ptr, size_t size, size_t nmemb, void *stream); +s3_buffer_write_func(void *ptr, size_t size, size_t nmemb, void *stream); + +/* a CURLOPT_READFUNCTION that writes nothing. */ +size_t +s3_empty_read_func(void *ptr, size_t size, size_t nmemb, void * stream); + +size_t +s3_empty_size_func(void *stream); + +GByteArray* +s3_empty_md5_func(void *stream); + +#define S3_COUNTER_WRITE_FUNCS s3_counter_write_func, s3_counter_reset_func + +/* a CURLOPT_WRITEFUNCTION to write data that just counts data. + * s3_write_data should be NULL or a pointer to an gint64. + */ +size_t +s3_counter_write_func(void *ptr, size_t size, size_t nmemb, void *stream); + +void +s3_counter_reset_func(void *stream); + +#ifdef _WIN32 +/* a CURLOPT_READFUNCTION to read data from a file. */ +size_t +s3_file_read_func(void *ptr, size_t size, size_t nmemb, void * stream); + +size_t +s3_file_size_func(void *stream); + +GByteArray* +s3_file_md5_func(void *stream); + +size_t +s3_file_reset_func(void *stream); + +/* a CURLOPT_WRITEFUNCTION to write data to a file. */ +size_t +s3_file_write_func(void *ptr, size_t size, size_t nmemb, void *stream); +#endif /* Adds a null termination to a buffer. */ void terminate_buffer(CurlBuffer *); diff --git a/device-src/semaphore.c b/device-src/semaphore.c deleted file mode 100644 index 20a2a95..0000000 --- a/device-src/semaphore.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -/* GLib does not provide semaphores, which are useful in queue.c. - So, we implement it here. */ - -#include "semaphore.h" -#include "amanda.h" - -semaphore_t* semaphore_new_with_value(int value) { - semaphore_t *rval; - - if (!g_thread_supported()) - return NULL; - - rval = malloc(sizeof(*rval)); - rval->value = value; - rval->mutex = g_mutex_new(); - rval->decrement_cond = g_cond_new(); - rval->zero_cond = g_cond_new(); - - if (rval->mutex == NULL || rval->decrement_cond == NULL || - rval->zero_cond == NULL) { - semaphore_free(rval); - return NULL; - } else { - return rval; - } -} - -void semaphore_free(semaphore_t* o) { - g_mutex_free(o->mutex); - g_cond_free(o->decrement_cond); - g_cond_free(o->zero_cond); - free(o); -} - -/* This function checks if the semaphore would is zero or negative. - * If so, the zero_cond is signalled. We assume that the mutex is - * locked. */ -static void check_empty(semaphore_t * o) { - if (o->value <= 0) { - g_cond_broadcast(o->zero_cond); - } -} - -void semaphore_increment(semaphore_t* o, unsigned int inc) { - g_return_if_fail(o != NULL); - g_return_if_fail(inc != 0); - - semaphore_force_adjust(o, inc); -} - -void semaphore_decrement(semaphore_t* o, unsigned int dec) { - int sdec; - g_return_if_fail(o != NULL); - sdec = (int) dec; - g_return_if_fail(sdec >= 0); - - g_mutex_lock(o->mutex); - while (o->value < sdec) { - g_cond_wait(o->decrement_cond, o->mutex); - } - o->value -= sdec; - check_empty(o); - g_mutex_unlock(o->mutex); -} - -void semaphore_force_adjust(semaphore_t* o, int inc) { - g_return_if_fail(o != NULL); - - g_mutex_lock(o->mutex); - o->value += inc; - if (inc < 0) - check_empty(o); - else - g_cond_broadcast(o->decrement_cond); - g_mutex_unlock(o->mutex); - -} - -void semaphore_force_set(semaphore_t* o, int value) { - int oldvalue; - g_return_if_fail(o != NULL); - - g_mutex_lock(o->mutex); - oldvalue = o->value; - o->value = value; - if (value < oldvalue) - check_empty(o); - else - g_cond_broadcast(o->decrement_cond); - g_mutex_unlock(o->mutex); - -} - -void semaphore_wait_empty(semaphore_t * o) { - g_return_if_fail(o != NULL); - - g_mutex_lock(o->mutex); - while (o->value > 0) { - g_cond_wait(o->zero_cond, o->mutex); - } - g_mutex_unlock(o->mutex); -} diff --git a/device-src/semaphore.h b/device-src/semaphore.h deleted file mode 100644 index 17d41fe..0000000 --- a/device-src/semaphore.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -/* GLib does not provide semaphores, which are useful in queue.c. - So, we implement it here. */ - -#include - -#ifndef SEMAPHORE_H - -typedef struct { - int value; - GMutex *mutex; - GCond * decrement_cond; - GCond * zero_cond; -} semaphore_t; - -/* Create a new semaphore object with the given value. - * - * @param value: new value - * @returns: newly allocated semaphore_t - */ -semaphore_t* semaphore_new_with_value(int value); - -/* Shortcut to make a new semaphore with value 1. - */ -#define semaphore_new() semaphore_new_with_value(1) - -/* Free a semaphore allocated by semaphore_with_new_value(). Be sure the - * semaphore is no longer in use by any threads. - * - * @param sem: the semaphore to free - */ -void semaphore_free(semaphore_t *sem); - -/* Increment the value of the semaphore by incr. This corresponds to - * Dijkstra's V(), or the typical semaphore's release(). - * - * This function will not block, but may wake other threads waiting - * on semaphore_decrement(). - * - * @param sem: the semaphore - * @param incr: added to the semaphore's value - */ -void semaphore_increment(semaphore_t *sem, unsigned int incr); - -/* Shortcut to increment the semaphore by 1. - */ -#define semaphore_up(semaphore) semphore_increment(semaphore,1) - -/* Decrement the value of the semaphore by incr. If this operation - * would make the semaphore zero or less, block until the semaphore - * value is large enough, then perform the decerement operation. Threads - * waiting on semaphore_wait_empty() may be awakened if the value - * reaches 0. - * - * @param sem: the semaphore - * @param decr: subtracted from the semaphore's value - */ -void semaphore_decrement(semaphore_t *sem, unsigned int decr); - -/* Shortcut to decrement the semaphore by 1. - */ -#define semaphore_down(semaphore) semaphore_decrement(semaphore, 1) - -/* Increment or decrement (with a negative incr) the value without - * blocking. Threads waiting on semaphore_decrement() or - * semaphore_wait_empty() will be awakened if necessary. - * - * @param sem: the semaphore - * @param incr: added to the semaphore's value - */ -void semaphore_force_adjust(semaphore_t *sem, int incr); - -/* Set the semaphore to a given value without blocking. Threads - * waiting on semaphore_decrement() or semaphore_wait_empty() - * will be awakened if necessary. - * - * @param sem: the semaphore - * @param value: the new value - */ -void semaphore_force_set(semaphore_t *sem, int value); - -/* Block until the semaphore's value is zero. - * - * @param sem: the semaphore - */ -void semaphore_wait_empty(semaphore_t *sem); - -#endif /* SEMAPHORE_H */ diff --git a/device-src/tape-aix.c b/device-src/tape-aix.c index a9665a7..cd2e626 100644 --- a/device-src/tape-aix.c +++ b/device-src/tape-aix.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,11 +14,12 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #include +#include "glib-util.h" #include "tape-ops.h" /* Tape operations for AIX systems. Most of this stuff is based on @@ -75,7 +76,7 @@ gboolean tape_bsr(int fd, guint count) { return 0 == ioctl(fd, STIOCTOP, &st); } -gint tape_eod(int fd) { +gint tape_eod(int fd G_GNUC_UNUSED) { g_assert_not_reached(); return TAPE_OP_ERROR; } @@ -87,55 +88,27 @@ gboolean tape_weof(int fd, guint8 count) { return 0 == ioctl(fd, STIOCTOP, &st); } -gboolean tape_setcompression(int fd, gboolean on) { +gboolean tape_setcompression(int fd G_GNUC_UNUSED, gboolean on G_GNUC_UNUSED) { return FALSE; } -ReadLabelStatusFlags tape_is_tape_device(int fd) { - /* AIX doesn't have a no-op. */ - return READ_LABEL_STATUS_SUCCESS; +DeviceStatusFlags tape_is_tape_device(int fd G_GNUC_UNUSED) { + /* AIX doesn't have a no-op, so we'll just assume this is a tape device */ + return DEVICE_STATUS_SUCCESS; } -TapeCheckResult tape_is_ready(int fd) { - return TAPE_CHECK_UNKNOWN; +DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) { + return DEVICE_STATUS_SUCCESS; } -void tape_device_discover_capabilities(TapeDevice * t_self) { - Device * self; - GValue val; - - self = DEVICE(t_self); - g_return_if_fail(self != NULL); - - bzero(&val, sizeof(val)); - g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_EOM, &val); - - g_value_unset_init(&val, G_TYPE_UINT); - g_value_set_uint(&val, 2); - device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +void tape_device_detect_capabilities(TapeDevice * t_self) { + tape_device_set_capabilities(t_self, + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/ + 2, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT /* final_filemarks*/ + ); } diff --git a/device-src/tape-device.c b/device-src/tape-device.c index 1274fcd..f63e35a 100644 --- a/device-src/tape-device.c +++ b/device-src/tape-device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #include /* memset() */ @@ -34,6 +34,8 @@ struct TapeDevicePrivate_s { /* This holds the total number of bytes written to the device, modulus RESETOFS_THRESHOLD. */ int write_count; + char * device_filename; + gsize read_buffer_size; }; /* Possible (abstracted) results from a system I/O operation. */ @@ -49,24 +51,49 @@ typedef enum { RESULT_MAX } IoResult; +/* + * Our device-specific properties. These are not static because they are + * accessed from the OS-specific tape-*.c files. + */ +DevicePropertyBase device_property_broken_gmt_online; +DevicePropertyBase device_property_fsf; +DevicePropertyBase device_property_bsf; +DevicePropertyBase device_property_fsr; +DevicePropertyBase device_property_bsr; +DevicePropertyBase device_property_eom; +DevicePropertyBase device_property_bsf_after_eom; +DevicePropertyBase device_property_final_filemarks; + +void tape_device_register(void); + +#define tape_device_read_size(self) \ + (((TapeDevice *)(self))->private->read_buffer_size? \ + ((TapeDevice *)(self))->private->read_buffer_size : ((Device *)(self))->block_size) + /* here are local prototypes */ static void tape_device_init (TapeDevice * o); static void tape_device_class_init (TapeDeviceClass * c); -static gboolean tape_device_open_device (Device * self, char * device_name); -static ReadLabelStatusFlags tape_device_read_label(Device * self); -static gboolean tape_device_write_block(Device * self, guint size, - gpointer data, gboolean short_block); +static void tape_device_base_init (TapeDeviceClass * c); +static gboolean tape_device_set_feature_property_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source); +static gboolean tape_device_set_final_filemarks_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source); +static gboolean tape_device_set_compression_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source); +static gboolean tape_device_set_read_buffer_size_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source); +static void tape_device_open_device (Device * self, char * device_name, char * device_type, char * device_node); +static Device * tape_device_factory (char * device_name, char * device_type, char * device_node); +static DeviceStatusFlags tape_device_read_label(Device * self); +static gboolean tape_device_write_block(Device * self, guint size, gpointer data); static int tape_device_read_block(Device * self, gpointer buf, int * size_req); static gboolean tape_device_start (Device * self, DeviceAccessMode mode, char * label, char * timestamp); -static gboolean tape_device_start_file (Device * self, const dumpfile_t * ji); +static gboolean tape_device_start_file (Device * self, dumpfile_t * ji); +static gboolean tape_device_finish_file (Device * self); static dumpfile_t * tape_device_seek_file (Device * self, guint file); static gboolean tape_device_seek_block (Device * self, guint64 block); -static gboolean tape_device_property_get (Device * self, DevicePropertyId id, - GValue * val); -static gboolean tape_device_property_set (Device * self, DevicePropertyId id, - GValue * val); static gboolean tape_device_finish (Device * self); static IoResult tape_device_robust_read (TapeDevice * self, void * buf, int * count); @@ -87,7 +114,7 @@ GType tape_device_get_type (void) if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (TapeDeviceClass), - (GBaseInitFunc) NULL, + (GBaseInitFunc) tape_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tape_device_class_init, (GClassFinalizeFunc) NULL, @@ -107,86 +134,96 @@ GType tape_device_get_type (void) static void tape_device_init (TapeDevice * self) { - Device * device_self; - DeviceProperty prop; + Device * d_self; GValue response; - device_self = (Device*)self; + d_self = DEVICE(self); bzero(&response, sizeof(response)); - self->private = malloc(sizeof(TapeDevicePrivate)); + self->private = g_new0(TapeDevicePrivate, 1); /* Clear all fields. */ - self->min_block_size = self->fixed_block_size = 32768; - self->max_block_size = self->read_block_size = MAX_TAPE_BLOCK_BYTES; + d_self->block_size = 32768; + d_self->min_block_size = 32768; + d_self->max_block_size = LARGEST_BLOCK_ESTIMATE; + self->broken_gmt_online = FALSE; self->fd = -1; - - self->fsf = self->bsf = self->fsr = self->bsr = self->eom = - self->bsf_after_eom = self->compression = self->first_file = 0; + + /* set all of the feature properties to an unsure default of FALSE */ + self->broken_gmt_online = FALSE; + self->fsf = FALSE; + self->bsf = FALSE; + self->fsr = FALSE; + self->bsr = FALSE; + self->eom = FALSE; + self->bsf_after_eom = FALSE; + + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, FALSE); + device_set_simple_property(d_self, PROPERTY_BROKEN_GMT_ONLINE, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_FSF, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_BSF, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_FSR, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_BSR, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_EOM, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + device_set_simple_property(d_self, PROPERTY_BSF_AFTER_EOM, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + g_value_unset(&response); + self->final_filemarks = 2; + g_value_init(&response, G_TYPE_UINT); + g_value_set_uint(&response, self->final_filemarks); + device_set_simple_property(d_self, PROPERTY_FINAL_FILEMARKS, + &response, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT); + g_value_unset(&response); + + self->private->read_buffer_size = 0; + g_value_init(&response, G_TYPE_UINT); + g_value_set_uint(&response, self->private->read_buffer_size); + device_set_simple_property(d_self, PROPERTY_READ_BUFFER_SIZE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT); + g_value_unset(&response); self->private->write_count = 0; + self->private->device_filename = NULL; - /* Register properites */ - prop.base = &device_property_concurrency; - prop.access = PROPERTY_ACCESS_GET_MASK; + /* Static properites */ g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_EXCLUSIVE); - device_add_property(device_self, &prop, &response); + device_set_simple_property(d_self, PROPERTY_CONCURRENCY, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_streaming; g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_DESIRED); - device_add_property(device_self, &prop, &response); + device_set_simple_property(d_self, PROPERTY_STREAMING, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_appendable; g_value_init(&response, G_TYPE_BOOLEAN); - g_value_set_boolean(&response, TRUE); - device_add_property(device_self, &prop, &response); + g_value_set_boolean(&response, FALSE); + device_set_simple_property(d_self, PROPERTY_APPENDABLE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); + g_value_unset(&response); - prop.base = &device_property_partial_deletion; + g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, FALSE); - device_add_property(device_self, &prop, &response); + device_set_simple_property(d_self, PROPERTY_PARTIAL_DELETION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_medium_access_type; g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); - device_add_property(device_self, &prop, &response); + device_set_simple_property(d_self, PROPERTY_MEDIUM_ACCESS_TYPE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - - prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK; - prop.base = &device_property_compression; - device_add_property(device_self, &prop, NULL); - - prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; - prop.base = &device_property_min_block_size; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_max_block_size; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_block_size; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_fsf; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_bsf; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_fsr; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_bsr; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_eom; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_bsf_after_eom; - device_add_property(device_self, &prop, NULL); - prop.base = &device_property_final_filemarks; - device_add_property(device_self, &prop, NULL); - - prop.access = PROPERTY_ACCESS_GET_MASK; - prop.base = &device_property_canonical_name; - device_add_property(device_self, &prop, NULL); } static void tape_device_finalize(GObject * obj_self) { @@ -197,6 +234,7 @@ static void tape_device_finalize(GObject * obj_self) { robust_close(self->fd); self->fd = -1; + amfree(self->private->device_filename); amfree(self->private); } @@ -214,160 +252,421 @@ tape_device_class_init (TapeDeviceClass * c) device_class->read_block = tape_device_read_block; device_class->start = tape_device_start; device_class->start_file = tape_device_start_file; + device_class->finish_file = tape_device_finish_file; device_class->seek_file = tape_device_seek_file; device_class->seek_block = tape_device_seek_block; - device_class->property_get = tape_device_property_get; - device_class->property_set = tape_device_property_set; device_class->finish = tape_device_finish; g_object_class->finalize = tape_device_finalize; } +static void +tape_device_base_init (TapeDeviceClass * c) +{ + DeviceClass *device_class = (DeviceClass *)c; + + device_class_register_property(device_class, PROPERTY_BROKEN_GMT_ONLINE, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_FSF, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_BSF, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_FSR, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_BSR, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_EOM, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_BSF_AFTER_EOM, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_feature_property_fn); + + device_class_register_property(device_class, PROPERTY_FINAL_FILEMARKS, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_final_filemarks_fn); + + /* We don't (yet?) support reading the device's compression state, so not + * gettable. */ + device_class_register_property(device_class, PROPERTY_COMPRESSION, + PROPERTY_ACCESS_SET_MASK, + NULL, + tape_device_set_compression_fn); + + device_class_register_property(device_class, PROPERTY_READ_BUFFER_SIZE, + PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START, + device_simple_property_get_fn, + tape_device_set_read_buffer_size_fn); +} + +static gboolean +tape_device_set_feature_property_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + TapeDevice *self = TAPE_DEVICE(p_self); + GValue old_val; + gboolean old_bool, new_bool; + PropertySurety old_surety; + PropertySource old_source; + + new_bool = g_value_get_boolean(val); + + /* get the old source and surety and see if we're willing to make this change */ + bzero(&old_val, sizeof(old_val)); + if (device_get_simple_property(p_self, base->ID, &old_val, &old_surety, &old_source)) { + old_bool = g_value_get_boolean(&old_val); + + if (old_surety == PROPERTY_SURETY_GOOD && old_source == PROPERTY_SOURCE_DETECTED) { + if (new_bool != old_bool) { + device_set_error(p_self, vstrallocf(_( + "Value for property '%s' was autodetected and cannot be changed"), + base->name), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } else { + /* pretend we set it, but don't change surety/source */ + return TRUE; + } + } + } + + /* (note: PROPERTY_* are not constants, so we can't use switch) */ + if (base->ID == PROPERTY_BROKEN_GMT_ONLINE) + self->broken_gmt_online = new_bool; + else if (base->ID == PROPERTY_FSF) + self->fsf = new_bool; + else if (base->ID == PROPERTY_BSF) + self->bsf = new_bool; + else if (base->ID == PROPERTY_FSR) + self->fsr = new_bool; + else if (base->ID == PROPERTY_BSR) + self->bsr = new_bool; + else if (base->ID == PROPERTY_EOM) + self->eom = new_bool; + else if (base->ID == PROPERTY_BSF_AFTER_EOM) + self->bsf_after_eom = new_bool; + else + return FALSE; /* shouldn't happen */ + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +tape_device_set_final_filemarks_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + TapeDevice *self = TAPE_DEVICE(p_self); + GValue old_val; + gboolean old_int, new_int; + PropertySurety old_surety; + PropertySource old_source; + + new_int = g_value_get_uint(val); + + /* get the old source and surety and see if we're willing to make this change */ + bzero(&old_val, sizeof(old_val)); + if (device_get_simple_property(p_self, base->ID, &old_val, &old_surety, &old_source)) { + old_int = g_value_get_uint(&old_val); + + if (old_surety == PROPERTY_SURETY_GOOD && old_source == PROPERTY_SOURCE_DETECTED) { + if (new_int != old_int) { + device_set_error(p_self, vstrallocf(_( + "Value for property '%s' was autodetected and cannot be changed"), + base->name), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } else { + /* pretend we set it, but don't change surety/source */ + return TRUE; + } + } + } + + self->final_filemarks = new_int; + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +tape_device_set_compression_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + TapeDevice *self = TAPE_DEVICE(p_self); + gboolean request = g_value_get_boolean(val); + + /* We allow this property to be set at any time. This is mostly + * because setting compression is a hit-and-miss proposition + * at any time; some drives accept the mode setting but don't + * actually support compression, while others do support + * compression but do it via density settings or some other + * way. Set this property whenever you want, but all we'll do + * is report whether or not the ioctl succeeded. */ + if (tape_setcompression(self->fd, request)) { + /* looks good .. let's start the device over, though */ + device_clear_volume_details(p_self); + } else { + return FALSE; + } + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +static gboolean +tape_device_set_read_buffer_size_fn(Device *p_self, DevicePropertyBase *base, + GValue *val, PropertySurety surety, PropertySource source) +{ + TapeDevice *self = TAPE_DEVICE(p_self); + guint buffer_size = g_value_get_uint(val); + + if (buffer_size != 0 && + ((gsize)buffer_size < p_self->block_size || + (gsize)buffer_size > p_self->max_block_size)) + return FALSE; + + self->private->read_buffer_size = buffer_size; + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + void tape_device_register(void) { static const char * device_prefix_list[] = { "tape", NULL }; + + /* First register tape-specific properties */ + device_property_fill_and_register(&device_property_broken_gmt_online, + G_TYPE_BOOLEAN, "broken_gmt_online", + "Does this drive support the GMT_ONLINE macro?"); + + device_property_fill_and_register(&device_property_fsf, + G_TYPE_BOOLEAN, "fsf", + "Does this drive support the MTFSF command?"); + + device_property_fill_and_register(&device_property_bsf, + G_TYPE_BOOLEAN, "bsf", + "Does this drive support the MTBSF command?" ); + + device_property_fill_and_register(&device_property_fsr, + G_TYPE_BOOLEAN, "fsr", + "Does this drive support the MTFSR command?"); + + device_property_fill_and_register(&device_property_bsr, + G_TYPE_BOOLEAN, "bsr", + "Does this drive support the MTBSR command?"); + + /* FIXME: Is this feature even useful? */ + device_property_fill_and_register(&device_property_eom, + G_TYPE_BOOLEAN, "eom", + "Does this drive support the MTEOM command?"); + + device_property_fill_and_register(&device_property_bsf_after_eom, + G_TYPE_BOOLEAN, + "bsf_after_eom", + "Does this drive require an MTBSF after MTEOM in order to append?" ); + + device_property_fill_and_register(&device_property_final_filemarks, + G_TYPE_UINT, "final_filemarks", + "How many filemarks to write after the last tape file?" ); + + /* Then the device itself */ register_device(tape_device_factory, device_prefix_list); } -/* Open the tape device, trying various combinations of O_RDWR and - O_NONBLOCK. Returns -1 and sets status_result for errors */ -static int try_open_tape_device(TapeDevice * self, char * device_filename, - ReadLabelStatusFlags *status_result) { +static int try_open_tape_device(TapeDevice * self, char * device_filename) { int fd; int save_errno; - ReadLabelStatusFlags new_status; - TapeCheckResult tcr; - *status_result = READ_LABEL_STATUS_SUCCESS; + DeviceStatusFlags new_status; -#ifdef O_NONBLOCK - fd = robust_open(device_filename, O_RDWR | O_NONBLOCK, 0); + fd = robust_open(device_filename, O_RDWR,0); save_errno = errno; - if (fd < 0 && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) { - /* Maybe we don't support O_NONBLOCK for tape devices. */ - fd = robust_open(device_filename, O_RDWR, 0); - save_errno = errno; - } -#else - fd = robust_open(device_filename, O_RDWR); - save_errno = errno; -#endif if (fd >= 0) { self->write_open_errno = 0; } else { if (errno == EACCES || errno == EPERM) { /* Device is write-protected. */ self->write_open_errno = errno; -#ifdef O_NONBLOCK - fd = robust_open(device_filename, O_RDONLY | O_NONBLOCK, 0); - save_errno = errno; - if (fd < 0 && (save_errno == EWOULDBLOCK || save_errno == EINVAL)) { - fd = robust_open(device_filename, O_RDONLY, 0); - save_errno = errno; - } -#else - fd = robust_open(device_filename, O_RDONLY); + fd = robust_open(device_filename, O_RDONLY,0); save_errno = errno; -#endif } } -#ifdef O_NONBLOCK - /* Clear O_NONBLOCK for operations from now on. */ - if (fd >= 0) - fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); - errno = save_errno; - /* function continues after #endif */ - -#endif /* O_NONBLOCK */ if (fd < 0) { - g_fprintf(stderr, _("Can't open tape device %s: %s\n"), - DEVICE(self)->device_name, strerror(errno)); - *status_result = READ_LABEL_STATUS_DEVICE_ERROR; + DeviceStatusFlags status_flag = 0; + if (errno == EBUSY) + status_flag = DEVICE_STATUS_DEVICE_BUSY; + else + status_flag = DEVICE_STATUS_DEVICE_ERROR; + device_set_error(DEVICE(self), + vstrallocf(_("Can't open tape device %s: %s"), self->private->device_filename, strerror(errno)), + status_flag); return -1; } /* Check that this is actually a tape device. */ new_status = tape_is_tape_device(fd); - if (new_status & (READ_LABEL_STATUS_DEVICE_ERROR | READ_LABEL_STATUS_VOLUME_MISSING)) { - g_fprintf(stderr, _("File %s is not a tape device\n"), - DEVICE(self)->device_name); + if (new_status & DEVICE_STATUS_DEVICE_ERROR) { + device_set_error(DEVICE(self), + vstrallocf(_("File %s is not a tape device"), self->private->device_filename), + new_status); + robust_close(fd); + return -1; + } + if (new_status & DEVICE_STATUS_VOLUME_MISSING) { + device_set_error(DEVICE(self), + vstrallocf(_("Tape device %s is not ready or is empty"), self->private->device_filename), + new_status); robust_close(fd); - *status_result = new_status; return -1; } - tcr = tape_is_ready(fd); - if (new_status == TAPE_CHECK_FAILURE) { - g_fprintf(stderr, _("Tape device %s is not ready or is empty\n"), - DEVICE(self)->device_name); + new_status = tape_is_ready(fd, self); + if (new_status & DEVICE_STATUS_VOLUME_MISSING) { + device_set_error(DEVICE(self), + vstrallocf(_("Tape device %s is empty"), self->private->device_filename), + new_status); + robust_close(fd); + return -1; + } + if (new_status != DEVICE_STATUS_SUCCESS) { + device_set_error(DEVICE(self), + vstrallocf(_("Tape device %s is not ready or is empty"), self->private->device_filename), + new_status); robust_close(fd); - *status_result = READ_LABEL_STATUS_DEVICE_ERROR; return -1; } return fd; } -static gboolean -tape_device_open_device (Device * d_self, char * device_name) { +static void +tape_device_open_device (Device * d_self, char * device_name G_GNUC_UNUSED, + char * device_type G_GNUC_UNUSED, char * device_node) { TapeDevice * self; self = TAPE_DEVICE(d_self); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (device_name != NULL, FALSE); + + self->fd = -1; + self->private->device_filename = stralloc(device_node); /* Get tape drive/OS info */ - tape_device_discover_capabilities(self); - - /* And verify the above. */ - g_assert(feature_support_flags_is_valid(self->fsf)); - g_assert(feature_support_flags_is_valid(self->bsf)); - g_assert(feature_support_flags_is_valid(self->fsr)); - g_assert(feature_support_flags_is_valid(self->bsr)); - g_assert(feature_support_flags_is_valid(self->eom)); - g_assert(feature_support_flags_is_valid(self->bsf_after_eom)); - g_assert(self->final_filemarks == 1 || - self->final_filemarks == 2); + tape_device_detect_capabilities(self); /* Chain up */ if (parent_class->open_device) { - if (!(parent_class->open_device)(d_self, device_name)) { - robust_close(self->fd); - return FALSE; - } + parent_class->open_device(d_self, device_node, device_type, device_node); } +} - return TRUE; +void +tape_device_set_capabilities(TapeDevice *self, + gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source, + gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source, + gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source, + gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source, + gboolean eom, PropertySurety eom_surety, PropertySource eom_source, + gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source, + guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source) +{ + Device *dself = DEVICE(self); + GValue val; + + /* this function is called by tape_device_detect_capabilities, and basically + * exists to take care of the GValue mechanics in one place */ + + g_assert(final_filemarks == 1 || final_filemarks == 2); + + bzero(&val, sizeof(val)); + g_value_init(&val, G_TYPE_BOOLEAN); + + self->fsf = fsf; + g_value_set_boolean(&val, fsf); + device_set_simple_property(dself, PROPERTY_FSF, &val, fsf_surety, fsf_source); + + self->bsf = bsf; + g_value_set_boolean(&val, bsf); + device_set_simple_property(dself, PROPERTY_BSF, &val, bsf_surety, bsf_source); + + self->fsr = fsr; + g_value_set_boolean(&val, fsr); + device_set_simple_property(dself, PROPERTY_FSR, &val, fsr_surety, fsr_source); + + self->bsr = bsr; + g_value_set_boolean(&val, bsr); + device_set_simple_property(dself, PROPERTY_BSR, &val, bsr_surety, bsr_source); + + self->eom = eom; + g_value_set_boolean(&val, eom); + device_set_simple_property(dself, PROPERTY_EOM, &val, eom_surety, eom_source); + + self->bsf_after_eom = bsf_after_eom; + g_value_set_boolean(&val, bsf_after_eom); + device_set_simple_property(dself, PROPERTY_BSF_AFTER_EOM, &val, bae_surety, bae_source); + + g_value_unset(&val); + g_value_init(&val, G_TYPE_UINT); + + self->final_filemarks = final_filemarks; + g_value_set_uint(&val, final_filemarks); + device_set_simple_property(dself, PROPERTY_FINAL_FILEMARKS, &val, ff_surety, ff_source); + + g_value_unset(&val); } -static ReadLabelStatusFlags tape_device_read_label(Device * dself) { +static DeviceStatusFlags tape_device_read_label(Device * dself) { TapeDevice * self; char * header_buffer; int buffer_len; IoResult result; - dumpfile_t header; + dumpfile_t *header; + DeviceStatusFlags new_status; self = TAPE_DEVICE(dself); - g_return_val_if_fail(self != NULL, FALSE); amfree(dself->volume_label); amfree(dself->volume_time); + amfree(dself->volume_header); + + if (device_in_error(self)) return dself->status; + + header = dself->volume_header = g_new(dumpfile_t, 1); + fh_init(header); if (self->fd == -1) { - ReadLabelStatusFlags status; - self->fd = try_open_tape_device(self, dself->device_name, &status); + self->fd = try_open_tape_device(self, self->private->device_filename); + /* if the open failed, then try_open_tape_device already set the + * approppriate error status */ if (self->fd == -1) - return status; + return dself->status; } /* Rewind it. */ if (!tape_rewind(self->fd)) { - g_fprintf(stderr, "Error rewinding device %s\n", - dself->device_name); - return (READ_LABEL_STATUS_DEVICE_ERROR | - READ_LABEL_STATUS_VOLUME_ERROR); - } + device_set_error(dself, + vstrallocf(_("Error rewinding device %s"), self->private->device_filename), + DEVICE_STATUS_DEVICE_ERROR + | DEVICE_STATUS_VOLUME_ERROR); + robust_close(self->fd); + return dself->status; + } - buffer_len = self->read_block_size; + buffer_len = tape_device_read_size(self); header_buffer = malloc(buffer_len); result = tape_device_robust_read(self, header_buffer, &buffer_len); @@ -375,66 +674,83 @@ static ReadLabelStatusFlags tape_device_read_label(Device * dself) { free(header_buffer); tape_rewind(self->fd); /* I/O error. */ - g_fprintf(stderr, "Error reading Amanda header.\n"); if (result == RESULT_NO_DATA) { - return (READ_LABEL_STATUS_VOLUME_ERROR | - READ_LABEL_STATUS_VOLUME_UNLABELED); + new_status = (DEVICE_STATUS_VOLUME_ERROR | + DEVICE_STATUS_VOLUME_UNLABELED); } else { - return (READ_LABEL_STATUS_DEVICE_ERROR | - READ_LABEL_STATUS_VOLUME_ERROR | - READ_LABEL_STATUS_VOLUME_UNLABELED); + new_status = (DEVICE_STATUS_DEVICE_ERROR | + DEVICE_STATUS_VOLUME_ERROR | + DEVICE_STATUS_VOLUME_UNLABELED); } + device_set_error(dself, stralloc(_("Error reading Amanda header")), new_status); + return dself->status; } - parse_file_header(header_buffer, &header, buffer_len); + parse_file_header(header_buffer, header, buffer_len); amfree(header_buffer); - if (header.type != F_TAPESTART) { - return READ_LABEL_STATUS_VOLUME_UNLABELED; - } - - dself->volume_label = g_strdup(header.name); - dself->volume_time = g_strdup(header.datestamp); - - if (parent_class->read_label) { - return parent_class->read_label(dself); - } else { - return READ_LABEL_STATUS_SUCCESS; + if (header->type != F_TAPESTART) { + device_set_error(dself, + stralloc(_("No tapestart header -- unlabeled device?")), + DEVICE_STATUS_VOLUME_UNLABELED); + return dself->status; } + + dself->volume_label = g_strdup(header->name); + dself->volume_time = g_strdup(header->datestamp); + /* dself->volume_header is already set */ + + device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); + + return dself->status; } static gboolean -tape_device_write_block(Device * pself, guint size, - gpointer data, gboolean short_block) { +tape_device_write_block(Device * pself, guint size, gpointer data) { TapeDevice * self; char *replacement_buffer = NULL; IoResult result; self = TAPE_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (self->fd >= 0, FALSE); - - if (short_block && self->min_block_size > size) { - replacement_buffer = malloc(self->min_block_size); + + g_assert(self->fd >= 0); + if (device_in_error(self)) return FALSE; + + /* zero out to the end of a short block -- tape devices only write + * whole blocks. */ + if (size < pself->block_size) { + replacement_buffer = malloc(pself->block_size); memcpy(replacement_buffer, data, size); - bzero(replacement_buffer+size, self->min_block_size-size); - + bzero(replacement_buffer+size, pself->block_size-size); + data = replacement_buffer; - size = self->min_block_size; + size = pself->block_size; } result = tape_device_robust_write(self, data, size); - if (result == RESULT_SUCCESS) { - if (parent_class->write_block) { - (parent_class->write_block)(pself, size, data, short_block); - } - amfree(replacement_buffer); - return TRUE; - } else { - amfree(replacement_buffer); - return FALSE; + amfree(replacement_buffer); + + switch (result) { + case RESULT_SUCCESS: + break; + + case RESULT_NO_SPACE: + device_set_error(pself, + stralloc(_("No space left on device")), + DEVICE_STATUS_VOLUME_ERROR); + pself->is_eof = TRUE; + return FALSE; + + default: + case RESULT_ERROR: + device_set_error(pself, + vstrallocf(_("Error writing block: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; } - - g_assert_not_reached(); + + pself->block++; + + return TRUE; } static int tape_device_read_block (Device * pself, gpointer buf, @@ -442,13 +758,17 @@ static int tape_device_read_block (Device * pself, gpointer buf, TapeDevice * self; int size; IoResult result; + gssize read_block_size = tape_device_read_size(pself); self = TAPE_DEVICE(pself); - g_return_val_if_fail (self != NULL, -1); - if (buf == NULL || *size_req < (int)self->read_block_size) { + g_assert(self->fd >= 0); + if (device_in_error(self)) return -1; + + g_assert(read_block_size < INT_MAX); /* data type mismatch */ + if (buf == NULL || *size_req < (int)read_block_size) { /* Just a size query. */ - *size_req = self->read_block_size; + *size_req = (int)read_block_size; return 0; } @@ -457,32 +777,51 @@ static int tape_device_read_block (Device * pself, gpointer buf, switch (result) { case RESULT_SUCCESS: *size_req = size; + pself->block++; return size; case RESULT_SMALL_BUFFER: { - int new_size; + gsize new_size; + GValue newval; + /* If this happens, it means that we have: * (next block size) > (buffer size) >= (read_block_size) * The solution is to ask for an even bigger buffer. We also play * some games to refrain from reading above the SCSI limit or from - * integer overflow. */ + * integer overflow. Note that not all devices will tell us about + * this problem -- some will just discard the "extra" data. */ new_size = MIN(INT_MAX/2 - 1, *size_req) * 2; if (new_size > LARGEST_BLOCK_ESTIMATE && *size_req < LARGEST_BLOCK_ESTIMATE) { new_size = LARGEST_BLOCK_ESTIMATE; } - if (new_size <= *size_req) { - return -1; - } else { - *size_req = new_size; - return 0; - } + g_assert (new_size > (gsize)*size_req); + + g_warning("Device %s indicated blocksize %zd was too small; using %zd.", + pself->device_name, (gsize)*size_req, new_size); + *size_req = (int)new_size; + self->private->read_buffer_size = new_size; + + bzero(&newval, sizeof(newval)); + g_value_init(&newval, G_TYPE_UINT); + g_value_set_uint(&newval, self->private->read_buffer_size); + device_set_simple_property(pself, PROPERTY_READ_BUFFER_SIZE, + &newval, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); + g_value_unset(&newval); + + return 0; } case RESULT_NO_DATA: pself->is_eof = TRUE; pself->in_file = FALSE; + device_set_error(pself, + stralloc(_("EOF")), + DEVICE_STATUS_SUCCESS); return -1; default: + device_set_error(pself, + vstrallocf(_("Error reading from tape device: %s"), strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return -1; } @@ -506,17 +845,37 @@ static gboolean write_tapestart_header(TapeDevice * self, char * label, &header_fits); amfree(header); g_assert(header_buf != NULL); - + if (!header_fits) { amfree(header_buf); - g_fprintf(stderr, "Tapestart header won't fit in a single block!\n"); + device_set_error(d_self, + stralloc(_("Tapestart header won't fit in a single block!")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } - g_assert(header_size >= (int)self->min_block_size); + g_assert(header_size >= (int)d_self->min_block_size); result = tape_device_robust_write(self, header_buf, header_size); + if (result != RESULT_SUCCESS) { + device_set_error(d_self, + vstrallocf(_("Error writing tapestart header: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + amfree(header_buf); + return FALSE; + } + amfree(header_buf); - return (result == RESULT_SUCCESS); + + if (!tape_weof(self->fd, 1)) { + device_set_error(d_self, + vstrallocf(_("Error writing filemark: %s"), + strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_VOLUME_ERROR); + return FALSE; + } + + return TRUE; + } static gboolean @@ -525,18 +884,20 @@ tape_device_start (Device * d_self, DeviceAccessMode mode, char * label, TapeDevice * self; self = TAPE_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); + + if (device_in_error(self)) return FALSE; if (self->fd == -1) { - ReadLabelStatusFlags status; - self->fd = try_open_tape_device(self, d_self->device_name, &status); + self->fd = try_open_tape_device(self, self->private->device_filename); + /* if the open failed, then try_open_tape_device already set the + * approppriate error status */ if (self->fd == -1) - return FALSE; /* can't do anything with status here */ + return FALSE; } if (mode != ACCESS_WRITE && d_self->volume_label == NULL) { /* we need a labeled volume for APPEND and READ */ - if (tape_device_read_label(d_self) != READ_LABEL_STATUS_SUCCESS) + if (tape_device_read_label(d_self) != DEVICE_STATUS_SUCCESS) return FALSE; } @@ -546,27 +907,45 @@ tape_device_start (Device * d_self, DeviceAccessMode mode, char * label, if (IS_WRITABLE_ACCESS_MODE(mode)) { if (self->write_open_errno != 0) { /* We tried and failed to open the device in write mode. */ - g_fprintf(stderr, "Can't open tape device %s for writing: %s\n", - d_self->device_name, strerror(self->write_open_errno)); + device_set_error(d_self, + vstrallocf(_("Can't open tape device %s for writing: %s"), + self->private->device_filename, strerror(self->write_open_errno)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } else if (!tape_rewind(self->fd)) { - g_fprintf(stderr, "Couldn't rewind device: %s\n", - strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Couldn't rewind device: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; } } /* Position the tape */ switch (mode) { case ACCESS_APPEND: - if (!tape_device_eod(self)) + if (d_self->volume_label == NULL && device_read_label(d_self) != DEVICE_STATUS_SUCCESS) { + /* device_read_label already set our error message */ return FALSE; - self->first_file = TRUE; + } + + if (!tape_device_eod(self)) { + device_set_error(d_self, + vstrallocf(_("Couldn't seek to end of tape: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } break; case ACCESS_READ: + if (d_self->volume_label == NULL && device_read_label(d_self) != DEVICE_STATUS_SUCCESS) { + /* device_read_label already set our error message */ + return FALSE; + } + if (!tape_rewind(self->fd)) { - g_fprintf(stderr, "Error rewinding device %s\n", - d_self->device_name); + device_set_error(d_self, + vstrallocf(_("Couldn't rewind device: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } d_self->file = 0; @@ -574,24 +953,27 @@ tape_device_start (Device * d_self, DeviceAccessMode mode, char * label, case ACCESS_WRITE: if (!write_tapestart_header(self, label, timestamp)) { + /* write_tapestart_header already set the error status */ return FALSE; } - self->first_file = TRUE; + + d_self->volume_label = newstralloc(d_self->volume_label, label); + d_self->volume_time = newstralloc(d_self->volume_time, timestamp); + + /* unset the VOLUME_UNLABELED flag, if it was set */ + device_set_error(d_self, NULL, DEVICE_STATUS_SUCCESS); + d_self->file = 0; break; default: g_assert_not_reached(); } - if (parent_class->start) { - return parent_class->start(d_self, mode, label, timestamp); - } else { - return TRUE; - } + return TRUE; } static gboolean tape_device_start_file(Device * d_self, - const dumpfile_t * info) { + dumpfile_t * info) { TapeDevice * self; IoResult result; char * amanda_header; @@ -599,35 +981,57 @@ static gboolean tape_device_start_file(Device * d_self, gboolean header_fits; self = TAPE_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail (self->fd >= 0, FALSE); - if (!(d_self->access_mode == ACCESS_APPEND && self->first_file)) { - if (!tape_weof(self->fd, 1)) { - g_fprintf(stderr, "Error writing filemark: %s\n", strerror(errno)); - return FALSE; - } - } + g_assert(self->fd >= 0); + if (device_in_error(self)) return FALSE; - self->first_file = FALSE; + /* set the blocksize in the header properly */ + info->blocksize = d_self->block_size; /* Make the Amanda header suitable for writing to the device. */ /* Then write the damn thing. */ amanda_header = device_build_amanda_header(d_self, info, &header_size, &header_fits); - g_return_val_if_fail(amanda_header != NULL, FALSE); - g_return_val_if_fail(header_fits, FALSE); + if (!header_fits) { + device_set_error(d_self, + stralloc(_("Amanda file header won't fit in a single block!")), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; + } result = tape_device_robust_write(self, amanda_header, header_size); + if (result != RESULT_SUCCESS) { + device_set_error(d_self, + vstrallocf(_("Error writing file header: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + amfree(amanda_header); + return FALSE; + } amfree(amanda_header); - if (result == RESULT_SUCCESS) { - /* Chain up. */ - if (parent_class->start_file) { - parent_class->start_file(d_self, info); - } - return TRUE; - } else { + + /* arrange the file numbers correctly */ + d_self->in_file = TRUE; + d_self->block = 0; + if (d_self->file >= 0) + d_self->file ++; + return TRUE; +} + +static gboolean +tape_device_finish_file (Device * d_self) { + TapeDevice * self; + + self = TAPE_DEVICE(d_self); + if (device_in_error(d_self)) return FALSE; + + if (!tape_weof(self->fd, 1)) { + device_set_error(d_self, + vstrallocf(_("Error writing filemark: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } + + d_self->in_file = FALSE; + return TRUE; } static dumpfile_t * @@ -640,9 +1044,8 @@ tape_device_seek_file (Device * d_self, guint file) { IoResult result; self = TAPE_DEVICE(d_self); - g_return_val_if_fail(d_self != NULL, NULL); - d_self->in_file = FALSE; + if (device_in_error(self)) return NULL; difference = file - d_self->file; @@ -651,21 +1054,31 @@ tape_device_seek_file (Device * d_self, guint file) { difference --; } + d_self->in_file = FALSE; + d_self->is_eof = FALSE; + d_self->block = 0; + if (difference > 0) { /* Seeking forwards */ if (!tape_device_fsf(self, difference)) { tape_rewind(self->fd); + device_set_error(d_self, + vstrallocf(_("Could not seek forward to file %d"), file), + DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } } else if (difference < 0) { /* Seeking backwards */ if (!tape_device_bsf(self, -difference, d_self->file)) { tape_rewind(self->fd); + device_set_error(d_self, + vstrallocf(_("Could not seek backward to file %d"), file), + DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return NULL; } } - buffer_len = self->read_block_size; + buffer_len = tape_device_read_size(d_self); header_buffer = malloc(buffer_len); d_self->is_eof = FALSE; result = tape_device_robust_read(self, header_buffer, &buffer_len); @@ -678,28 +1091,38 @@ tape_device_seek_file (Device * d_self, guint file) { * filemark, which indicates end of tape. This should * work even with QIC tapes on operating systems with * proper support. */ + d_self->file = file; /* other attributes are already correct */ return make_tapeend_header(); } /* I/O error. */ - g_fprintf(stderr, "Error reading Amanda header.\n"); - return FALSE; + device_set_error(d_self, + stralloc(_("Error reading Amanda header")), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); + return NULL; } - rval = malloc(sizeof(*rval)); + rval = g_new(dumpfile_t, 1); parse_file_header(header_buffer, rval, buffer_len); amfree(header_buffer); switch (rval->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: - d_self->in_file = TRUE; - d_self->file = file; - return rval; + break; + default: tape_rewind(self->fd); + device_set_error(d_self, + stralloc(_("Invalid amanda header while reading file header")), + DEVICE_STATUS_VOLUME_ERROR); amfree(rval); return NULL; } + + d_self->in_file = TRUE; + d_self->file = file; + + return rval; } static gboolean @@ -708,246 +1131,41 @@ tape_device_seek_block (Device * d_self, guint64 block) { int difference; self = TAPE_DEVICE(d_self); - g_return_val_if_fail(d_self != NULL, FALSE); + + if (device_in_error(self)) return FALSE; difference = block - d_self->block; if (difference > 0) { - if (!tape_device_fsr(self, difference)) + if (!tape_device_fsr(self, difference)) { + device_set_error(d_self, + vstrallocf(_("Could not seek forward to block %ju"), (uintmax_t)block), + DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return FALSE; + } } else if (difference < 0) { - if (!tape_device_bsr(self, difference, d_self->file, d_self->block)) - return FALSE; - } - - if (parent_class->seek_block) { - return (parent_class->seek_block)(d_self, block); - } else { - return TRUE; - } -} - -/* Just checks that the flag is valid before setting it. */ -static gboolean get_feature_flag(GValue * val, FeatureSupportFlags f) { - if (feature_support_flags_is_valid(f)) { - g_value_set_flags(val, f); - return TRUE; - } else { - return FALSE; - } -} - -static gboolean -tape_device_property_get (Device * d_self, DevicePropertyId id, GValue * val) { - TapeDevice * self; - const DevicePropertyBase * base; - - self = TAPE_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); - - base = device_property_get_by_id(id); - g_return_val_if_fail(self != NULL, FALSE); - - g_value_unset_init(val, base->type); - - if (id == PROPERTY_COMPRESSION) { - g_value_set_boolean(val, self->compression); - return TRUE; - } else if (id == PROPERTY_MIN_BLOCK_SIZE) { - g_value_set_uint(val, self->min_block_size); - return TRUE; - } else if (id == PROPERTY_MAX_BLOCK_SIZE) { - g_value_set_uint(val, self->max_block_size); - return TRUE; - } else if (id == PROPERTY_BLOCK_SIZE) { - if (self->fixed_block_size == 0) { - g_value_set_int(val, -1); - } else { - g_value_set_int(val, self->fixed_block_size); - } - return TRUE; - } else if (id == PROPERTY_FSF) { - return get_feature_flag(val, self->fsf); - } else if (id == PROPERTY_BSF) { - return get_feature_flag(val, self->bsf); - } else if (id == PROPERTY_FSR) { - return get_feature_flag(val, self->fsr); - } else if (id == PROPERTY_BSR) { - return get_feature_flag(val, self->bsr); - } else if (id == PROPERTY_EOM) { - return get_feature_flag(val, self->eom); - } else if (id == PROPERTY_BSF_AFTER_EOM) { - return get_feature_flag(val, self->bsf_after_eom); - } else if (id == PROPERTY_FINAL_FILEMARKS) { - g_value_set_uint(val, self->final_filemarks); - return TRUE; - } else { - /* Chain up */ - if (parent_class->property_get) { - return (parent_class->property_get)(d_self, id, val); - } else { + if (!tape_device_bsr(self, difference, d_self->file, d_self->block)) { + device_set_error(d_self, + vstrallocf(_("Could not seek backward to block %ju"), (uintmax_t)block), + DEVICE_STATUS_VOLUME_ERROR | DEVICE_STATUS_DEVICE_ERROR); return FALSE; - } + } } - g_assert_not_reached(); -} - -/* We don't allow overriding of flags with _GOOD surety. That way, if - e.g., a feature has no matching IOCTL on a given platform, we don't - ever try to set it. */ -static gboolean flags_settable(FeatureSupportFlags request, - FeatureSupportFlags existing) { - if (!feature_support_flags_is_valid(request)) - return FALSE; - else if (!feature_support_flags_is_valid(existing)) - return TRUE; - else if (request == existing) - return TRUE; - else if (existing & FEATURE_SURETY_GOOD) - return FALSE; - else - return TRUE; + d_self->block = block; + return TRUE; } -/* If the access listed is NULL, and the provided flags can override the - existing ones, then do it and return TRUE. */ -static gboolean try_set_feature(DeviceAccessMode mode, - FeatureSupportFlags request, - FeatureSupportFlags * existing) { - if (mode != ACCESS_NULL) { - return FALSE; - } else if (flags_settable(request, *existing)) { - *existing = request; - return TRUE; - } else { - return FALSE; - } -} - static gboolean -tape_device_property_set (Device * d_self, DevicePropertyId id, GValue * val) { +tape_device_finish (Device * d_self) { TapeDevice * self; - FeatureSupportFlags feature_request_flags = 0; - const DevicePropertyBase * base; self = TAPE_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); - - base = device_property_get_by_id(id); - g_return_val_if_fail(self != NULL, FALSE); - - g_return_val_if_fail(G_VALUE_HOLDS(val, base->type), FALSE); - - if (base->type == FEATURE_SUPPORT_FLAGS_TYPE) { - feature_request_flags = g_value_get_flags(val); - g_return_val_if_fail( - feature_support_flags_is_valid(feature_request_flags), FALSE); - } - - if (id == PROPERTY_COMPRESSION) { - /* We allow this property to be set at any time. This is mostly - * because setting compression is a hit-and-miss proposition - * at any time; some drives accept the mode setting but don't - * actually support compression, while others do support - * compression but do it via density settings or some other - * way. Set this property whenever you want, but all we'll do - * is report whether or not the ioctl succeeded. */ - gboolean request = g_value_get_boolean(val); - if (tape_setcompression(self->fd, request)) { - self->compression = request; - device_clear_volume_details(d_self); - return TRUE; - } else { - return FALSE; - } - } else if (id == PROPERTY_MIN_BLOCK_SIZE) { - if (d_self->access_mode != ACCESS_NULL) - return FALSE; - self->min_block_size = g_value_get_uint(val); - device_clear_volume_details(d_self); - return TRUE; - } else if (id == PROPERTY_MAX_BLOCK_SIZE) { - if (d_self->access_mode != ACCESS_NULL) - return FALSE; - self->max_block_size = g_value_get_uint(val); - device_clear_volume_details(d_self); - return TRUE; - } else if (id == PROPERTY_BLOCK_SIZE) { - if (d_self->access_mode != ACCESS_NULL) - return FALSE; - - self->fixed_block_size = g_value_get_int(val); - device_clear_volume_details(d_self); - return TRUE; - } else if (id == PROPERTY_READ_BUFFER_SIZE) { - if (d_self->access_mode != ACCESS_NULL) - return FALSE; - self->read_block_size = g_value_get_uint(val); - device_clear_volume_details(d_self); - return TRUE; - } else if (id == PROPERTY_FSF) { - return try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->fsf)); - } else if (id == PROPERTY_BSF) { - return try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->bsf)); - } else if (id == PROPERTY_FSR) { - return try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->fsr)); - } else if (id == PROPERTY_BSR) { - return try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->bsr)); - } else if (id == PROPERTY_EOM) { - /* Setting this to disabled also clears BSF after EOM. */ - if (try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->eom))) { - feature_request_flags &= ~FEATURE_SUPPORT_FLAGS_STATUS_MASK; - feature_request_flags |= FEATURE_STATUS_DISABLED; - self->bsf_after_eom = feature_request_flags; - return TRUE; - } else { - return FALSE; - } - } else if (id == PROPERTY_BSF_AFTER_EOM) { - /* You can only set this if EOM is enabled. */ - if (self->bsf | FEATURE_STATUS_DISABLED) - return FALSE; - else - return try_set_feature(d_self->access_mode, - feature_request_flags, - &(self->bsf_after_eom)); - } else if (id == PROPERTY_FINAL_FILEMARKS) { - guint request = g_value_get_uint(val); - if (request == 1 || request == 2) { - self->final_filemarks = request; - return TRUE; - } else { - return FALSE; - } - } else { - /* Chain up */ - if (parent_class->property_set) { - return (parent_class->property_set)(d_self, id, val); - } else { - return FALSE; - } - } - g_assert_not_reached(); -} - -static gboolean -tape_device_finish (Device * d_self) { - TapeDevice * self; + if (device_in_error(self)) return FALSE; - self = TAPE_DEVICE(d_self); - g_return_val_if_fail(self != NULL, FALSE); + if (d_self->access_mode == ACCESS_NULL) + return TRUE; /* Polish off this file, if relevant. */ if (d_self->in_file && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { @@ -957,29 +1175,30 @@ tape_device_finish (Device * d_self) { /* Write an extra filemark, if needed. The OS will give us one for sure. */ + /* device_finish_file already wrote one for us */ + /* if (self->final_filemarks > 1 && IS_WRITABLE_ACCESS_MODE(d_self->access_mode)) { if (!tape_weof(self->fd, 1)) { - g_fprintf(stderr, "Error writing final filemark: %s\n", - strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Error writing final filemark: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } } + */ /* Rewind. */ if (!tape_rewind(self->fd)) { - g_fprintf(stderr, "Error rewinding tape: %s\n", strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Couldn't rewind device: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } d_self->access_mode = ACCESS_NULL; - if (parent_class->finish) { - return (parent_class->finish)(d_self); - } else { - return TRUE; - } - + return TRUE; } /* Works just like read(), except for the following: @@ -992,10 +1211,9 @@ tape_device_robust_read (TapeDevice * self, void * buf, int * count) { int result; d_self = (Device*)self; - g_return_val_if_fail(self != NULL, RESULT_ERROR); - g_return_val_if_fail(*count >= 0, RESULT_ERROR); + /* Callers should ensure this. */ - g_assert((guint)(*count) <= self->read_block_size); + g_assert(*count >= 0); for (;;) { result = read(self->fd, buf, *count); @@ -1019,8 +1237,7 @@ tape_device_robust_read (TapeDevice * self, void * buf, int * count) { ) { /* Interrupted system call */ continue; - } else if ((self->fixed_block_size == 0) && - (0 + } else if ((0 #ifdef ENOMEM || errno == ENOMEM /* bad user-space buffer */ #endif @@ -1034,8 +1251,10 @@ tape_device_robust_read (TapeDevice * self, void * buf, int * count) { /* Buffer too small. */ return RESULT_SMALL_BUFFER; } else { - g_fprintf(stderr, "Error reading %d bytes from %s: %s\n", - *count, d_self->device_name, strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Error reading %d bytes from %s: %s"), + *count, self->private->device_filename, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return RESULT_ERROR; } } @@ -1051,8 +1270,11 @@ tape_device_robust_read (TapeDevice * self, void * buf, int * count) { static void check_resetofs(TapeDevice * self G_GNUC_UNUSED, int count G_GNUC_UNUSED) { #ifdef NEED_RESETOFS + Device * d_self; int result; + d_self = (Device*)self; + self->private->write_count += count; if (self->private->write_count < RESETOFS_THRESHOLD) { return; @@ -1060,8 +1282,8 @@ static void check_resetofs(TapeDevice * self G_GNUC_UNUSED, result = lseek(self->fd, 0, SEEK_SET); if (result < 0) { - g_fprintf(stderr, - "Warning: lseek() failed during kernel 2GB workaround.\n"); + g_warning(_("lseek() failed during kernel 2GB workaround: %s"), + strerror(errno)); } #endif } @@ -1071,7 +1293,6 @@ tape_device_robust_write (TapeDevice * self, void * buf, int count) { Device * d_self; int result; - g_return_val_if_fail(self != NULL, RESULT_ERROR); d_self = (Device*)self; check_resetofs(self, count); @@ -1086,9 +1307,10 @@ tape_device_robust_write (TapeDevice * self, void * buf, int count) { return RESULT_SUCCESS; } else if (result >= 0) { /* write() returned a short count. This should not happen. */ - g_fprintf(stderr, - "Mysterious short write on tape device: Tried %d, got %d.\n", - count, result); + device_set_error(d_self, + vstrallocf(_("Mysterious short write on tape device: Tried %d, got %d"), + count, result), + DEVICE_STATUS_DEVICE_ERROR); return RESULT_ERROR; } else if (0 #ifdef EAGAIN @@ -1114,16 +1336,17 @@ tape_device_robust_write (TapeDevice * self, void * buf, int count) { /* Probably EOT. Print a message if we got EIO. */ #ifdef EIO if (errno == EIO) { - g_fprintf(stderr, "Got EIO on %s, assuming end of tape.\n", - d_self->device_name); + g_warning(_("Got EIO on %s, assuming end of tape"), + self->private->device_filename); } #endif return RESULT_NO_SPACE; } else { /* WTF */ - g_fprintf(stderr, - "Kernel gave unexpected write() result of \"%s\" on device %s.\n", - strerror(errno), d_self->device_name); + device_set_error(d_self, + vstrallocf(_("Kernel gave unexpected write() result of \"%s\" on device %s"), + strerror(errno), self->private->device_filename), + DEVICE_STATUS_DEVICE_ERROR); return RESULT_ERROR; } } @@ -1138,10 +1361,10 @@ tape_device_robust_write (TapeDevice * self, void * buf, int count) { actually read. */ static int drain_tape_blocks(TapeDevice * self, int count) { char * buffer; - int buffer_size; + gsize buffer_size; int i; - buffer_size = self->read_block_size; + buffer_size = tape_device_read_size(self); buffer = malloc(sizeof(buffer_size)); @@ -1153,7 +1376,7 @@ static int drain_tape_blocks(TapeDevice * self, int count) { i ++; continue; } else if (result == 0) { - free(buffer); + amfree(buffer); return i; } else { /* First check for interrupted system call. */ @@ -1187,7 +1410,7 @@ static int drain_tape_blocks(TapeDevice * self, int count) { buffer_size *= 2; if (buffer_size > 32*1024*1024) { - free(buffer); + amfree(buffer); return -1; } else { buffer = realloc(buffer, buffer_size); @@ -1197,6 +1420,7 @@ static int drain_tape_blocks(TapeDevice * self, int count) { } } + amfree(buffer); return count; } @@ -1205,10 +1429,7 @@ static int drain_tape_blocks(TapeDevice * self, int count) { static gboolean tape_device_fsf (TapeDevice * self, guint count) { - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); - - if (self->fsf & FEATURE_STATUS_ENABLED) { + if (self->fsf) { return tape_fsf(self->fd, count); } else { guint i; @@ -1223,10 +1444,7 @@ tape_device_fsf (TapeDevice * self, guint count) { /* Seek back over count + 1 filemarks to the start of the given file. */ static gboolean tape_device_bsf (TapeDevice * self, guint count, guint file) { - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); - - if (self->bsf & FEATURE_STATUS_ENABLED) { + if (self->bsf) { /* The BSF operation is not very smart; it includes the filemark of the present file as part of the count, and seeks to the wrong (BOT) side of the filemark. We compensate for @@ -1251,10 +1469,7 @@ tape_device_bsf (TapeDevice * self, guint count, guint file) { static gboolean tape_device_fsr (TapeDevice * self, guint count) { - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); - - if (self->fsr & FEATURE_STATUS_ENABLED) { + if (self->fsr) { return tape_fsr(self->fd, count); } else { int result = drain_tape_blocks(self, count); @@ -1267,13 +1482,7 @@ tape_device_fsr (TapeDevice * self, guint count) { static gboolean tape_device_bsr (TapeDevice * self, guint count, guint file, guint block) { - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); - - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); - - if (self->bsr & FEATURE_STATUS_ENABLED) { + if (self->bsr) { return tape_bsr(self->fd, count); } else { /* We BSF, then FSR. */ @@ -1290,11 +1499,9 @@ tape_device_bsr (TapeDevice * self, guint count, guint file, guint block) { static gboolean tape_device_eod (TapeDevice * self) { Device * d_self; - g_return_val_if_fail (self != NULL, (gboolean )0); - g_return_val_if_fail (IS_TAPE_DEVICE (self), (gboolean )0); d_self = (Device*)self; - if (self->eom & FEATURE_STATUS_ENABLED) { + if (self->eom) { int result; result = tape_eod(self->fd); if (result == TAPE_OP_ERROR) { @@ -1333,15 +1540,11 @@ tape_device_eod (TapeDevice * self) { } } -Device * -tape_device_factory (char * device_type, char * device_name) { +static Device * +tape_device_factory (char * device_name, char * device_type, char * device_node) { Device * rval; g_assert(0 == strcmp(device_type, "tape")); rval = DEVICE(g_object_new(TYPE_TAPE_DEVICE, NULL)); - if (!device_open_device(rval, device_name)) { - g_object_unref(rval); - return NULL; - } else { - return rval; - } + device_open_device(rval, device_name, device_type, device_node); + return rval; } diff --git a/device-src/tape-device.h b/device-src/tape-device.h index 7bfa1da..201fcb7 100644 --- a/device-src/tape-device.h +++ b/device-src/tape-device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #ifndef TAPE_DEVICE_H @@ -23,16 +23,21 @@ #include +/* Unlike other Device classes, this class is implemented across multiple source + * files, so its class declaration is placed in a header file. + */ + /* * Type checking and casting macros */ + #define TYPE_TAPE_DEVICE (tape_device_get_type()) #define TAPE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice) #define TAPE_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), tape_device_get_type(), TapeDevice const) #define TAPE_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), tape_device_get_type(), TapeDeviceClass) #define IS_TAPE_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), tape_device_get_type ()) - #define TAPE_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), tape_device_get_type(), TapeDeviceClass) +GType tape_device_get_type (void); /* * Main object structure @@ -43,13 +48,13 @@ typedef struct _TapeDevice { /* It should go without saying that all this stuff is * look-but-don't-touch. */ - guint min_block_size, max_block_size, fixed_block_size, read_block_size; - FeatureSupportFlags fsf, bsf, fsr, bsr, eom, bsf_after_eom; + + /* characteristics of the device */ + gboolean fsf, bsf, fsr, bsr, eom, bsf_after_eom, broken_gmt_online; int final_filemarks; - gboolean compression; + /* 0 if we opened with O_RDWR; error otherwise. */ gboolean write_open_errno; - gboolean first_file; /* Is this the first file in append mode? */ int fd; TapeDevicePrivate * private; @@ -63,13 +68,45 @@ struct _TapeDeviceClass { DeviceClass __parent__; }; +/* Tape device properties. These properties do not exist on non-linear + devices. */ +extern DevicePropertyBase device_property_broken_gmt_online; +#define PROPERTY_BROKEN_GMT_ONLINE (device_property_broken_gmt_online.ID) -/* - * Public methods - */ -GType tape_device_get_type (void); -Device* tape_device_factory (char * type, - char * name); -void tape_device_register (void); +extern DevicePropertyBase device_property_fsf; +#define PROPERTY_FSF (device_property_fsf.ID) + +extern DevicePropertyBase device_property_bsf; +#define PROPERTY_BSF (device_property_bsf.ID) + +extern DevicePropertyBase device_property_fsr; +#define PROPERTY_FSR (device_property_fsr.ID) + +extern DevicePropertyBase device_property_bsr; +#define PROPERTY_BSR (device_property_bsr.ID) + +/* Is EOM supported? Must be able to read file number afterwards as + well. */ +extern DevicePropertyBase device_property_eom; +#define PROPERTY_EOM (device_property_eom.ID) + +/* Is it necessary to perform a BSF after EOM? */ +extern DevicePropertyBase device_property_bsf_after_eom; +#define PROPERTY_BSF_AFTER_EOM (device_property_bsf_after_eom.ID) + +/* How many filemarks to write at EOD? (Default is 2). + * This property is a G_TYPE_UINT, but can only really be set to 1 or 2. */ +extern DevicePropertyBase device_property_final_filemarks; +#define PROPERTY_FINAL_FILEMARKS (device_property_final_filemarks.ID) + +/* useful callback for tape ops */ +void tape_device_set_capabilities(TapeDevice *self, + gboolean fsf, PropertySurety fsf_surety, PropertySource fsf_source, + gboolean bsf, PropertySurety bsf_surety, PropertySource bsf_source, + gboolean fsr, PropertySurety fsr_surety, PropertySource fsr_source, + gboolean bsr, PropertySurety bsr_surety, PropertySource bsr_source, + gboolean eom, PropertySurety eom_surety, PropertySource eom_source, + gboolean bsf_after_eom, PropertySurety bae_surety, PropertySource bae_source, + guint final_filemarks, PropertySurety ff_surety, PropertySource ff_source); #endif diff --git a/device-src/tape-ops.h b/device-src/tape-ops.h index bebe28a..8a7d4e1 100644 --- a/device-src/tape-ops.h +++ b/device-src/tape-ops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #ifndef TAPE_OPS_H @@ -31,33 +31,30 @@ # include #endif -/* Return codes for tape_eod */ -#define TAPE_OP_ERROR -1 -#define TAPE_POSITION_UNKNOWN -2 +/* This file declares functions which are implemented in each of tape-*.c. The + * appropriate C file is selected at configure time. */ -/* Real Operations (always return FALSE if not implemented). These are - * implemented in one of tape-{uware,aix,xenix,posix}.c, depending on - * the platform. */ +/* Real Operations (always return FALSE if not implemented) */ gboolean tape_rewind(int fd); gboolean tape_fsf(int fd, guint count); gboolean tape_bsf(int fd, guint count); gboolean tape_fsr(int fd, guint count); gboolean tape_bsr(int fd, guint count); -/* Returns tape position file number, or one of the return codes above. */ + +/* Sets attributes of the device to indicate which of the above operations + * are available in this device. */ +void tape_device_detect_capabilities(TapeDevice * self); + +/* Returns tape position file number, or one of these: */ +#define TAPE_OP_ERROR -1 +#define TAPE_POSITION_UNKNOWN -2 gint tape_eod(int fd); + gboolean tape_weof(int fd, guint8 count); gboolean tape_setcompression(int fd, gboolean on); -typedef enum { - TAPE_CHECK_SUCCESS, - TAPE_CHECK_UNKNOWN, - TAPE_CHECK_FAILURE -} TapeCheckResult; -ReadLabelStatusFlags tape_is_tape_device(int fd); -TapeCheckResult tape_is_ready(int fd); - -/* Also implemented in above files. Sets properties on the device. */ -void tape_device_discover_capabilities(TapeDevice * self); +DeviceStatusFlags tape_is_tape_device(int fd); +DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self); #endif diff --git a/device-src/tape-posix.c b/device-src/tape-posix.c index 70e9480..80e2a50 100644 --- a/device-src/tape-posix.c +++ b/device-src/tape-posix.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ #include "amanda.h" @@ -131,83 +131,60 @@ gboolean tape_setcompression(int fd G_GNUC_UNUSED, #endif } -ReadLabelStatusFlags tape_is_tape_device(int fd) { +DeviceStatusFlags tape_is_tape_device(int fd) { struct mtop mt; mt.mt_op = MTNOP; mt.mt_count = 1; if (0 == ioctl(fd, MTIOCTOP, &mt)) { - return READ_LABEL_STATUS_SUCCESS; + return DEVICE_STATUS_SUCCESS; +#ifdef ENOMEDIUM + } else if (errno == ENOMEDIUM) { + return DEVICE_STATUS_VOLUME_MISSING; +#endif } else { - dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s", + dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s\n", strerror(errno)); if (errno == EIO) { /* some devices return EIO while the drive is busy loading */ - return READ_LABEL_STATUS_DEVICE_ERROR|READ_LABEL_STATUS_VOLUME_MISSING; + return DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_DEVICE_BUSY; } else { - return READ_LABEL_STATUS_DEVICE_ERROR; + return DEVICE_STATUS_DEVICE_ERROR; } } } -TapeCheckResult tape_is_ready(int fd) { +DeviceStatusFlags tape_is_ready(int fd, TapeDevice *t_self G_GNUC_UNUSED) { struct mtget get; if (0 == ioctl(fd, MTIOCGET, &get)) { -#if defined(GMT_DR_OPEN) - if (!GMT_DR_OPEN(get.mt_gstat)) { - return TAPE_CHECK_SUCCESS; +#if defined(GMT_ONLINE) || defined(GMT_DR_OPEN) + if (1 +#ifdef GMT_ONLINE + && (t_self->broken_gmt_online || GMT_ONLINE(get.mt_gstat)) +#endif +#ifdef GMT_DR_OPEN + && !GMT_DR_OPEN(get.mt_gstat) +#endif + ) { + return DEVICE_STATUS_SUCCESS; } else { - dbprintf("tape_is_read: ioctl(MTIOCGET) failed: %s", strerror(errno)); - return TAPE_CHECK_FAILURE; + return DEVICE_STATUS_VOLUME_MISSING; } #else /* Neither macro is defined. */ - return TAPE_CHECK_UNKNOWN; + return DEVICE_STATUS_SUCCESS; #endif } else { - return TAPE_CHECK_FAILURE; + return DEVICE_STATUS_VOLUME_ERROR; } } -void tape_device_discover_capabilities(TapeDevice * t_self) { - Device * self; - GValue val; - - self = DEVICE(t_self); - g_return_if_fail(self != NULL); - - bzero(&val, sizeof(val)); - g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_EOM, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSF_AFTER_EOM, &val); - - g_value_unset_init(&val, G_TYPE_UINT); - g_value_set_uint(&val, 2); - device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +void tape_device_detect_capabilities(TapeDevice * t_self) { + tape_device_set_capabilities(t_self, + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* eom*/ + FALSE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/ + 2, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT /* final_filemarks*/ + ); } diff --git a/device-src/tape-uware.c b/device-src/tape-uware.c index 0b86761..ab13a5b 100644 --- a/device-src/tape-uware.c +++ b/device-src/tape-uware.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* Tape operations for SVR4 systems. Most of this stuff is based on @@ -23,6 +23,7 @@ #include #include +#include "glib-util.h" /* Uncomment to test on non-SYSV4 systems. */ /* --- @@ -63,7 +64,7 @@ gboolean tape_bsr(int fd, guint count) { return 0 == ioctl(fd, T_SBB, count); } -int tape_eod(int fd) { +gint tape_eod(int fd G_GNUC_UNUSED) { g_assert_not_reached(); return TAPE_OP_ERROR; } @@ -83,58 +84,29 @@ gboolean tape_setcompression(int fd, gboolean on) { return 0 == ioctl(fd, T_SETCOMP, cmd); } -ReadLabelStatusFlags tape_is_tape_device(int fd) { +DeviceStatusFlags tape_is_tape_device(int fd) { /* If we can read block information, it's probably a tape device. */ struct blklen result; if (0 == ioctl(fd, T_RDBLKLEN, &result)) { - return READ_LABEL_STATUS_SUCCESS; + return DEVICE_STATUS_SUCCESS; } else { - dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s", - strerror(errno)); - return READ_LABEL_STATUS_DEVICE_ERROR; + return DEVICE_STATUS_DEVICE_ERROR; } } -TapeCheckResult tape_is_tape_ready(int fd) { - return TAPE_CHECK_UNKNOWN; +DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) { + /* No good way to determine this, so assume it's ready */ + return DEVICE_STATUS_SUCCESS; } -void tape_device_discover_capabilities(TapeDevice * t_self) { - Device * self; - GValue val; - - self = DEVICE(t_self); - g_return_if_fail(self != NULL); - - bzero(&val, sizeof(val)); - g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_EOM, &val); - - g_value_unset_init(&val, G_TYPE_UINT); - g_value_set_uint(&val, 2); - device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +void tape_device_detect_capabilities(TapeDevice * t_self) { + tape_device_set_capabilities(t_self, + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/ + 2, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT /* final_filemarks*/ + ); } diff --git a/device-src/tape-xenix.c b/device-src/tape-xenix.c index 1890cd2..0d65443 100644 --- a/device-src/tape-xenix.c +++ b/device-src/tape-xenix.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ /* Tape operations for XENIX systems. Most of this stuff is based on @@ -25,6 +25,7 @@ #include #include +#include "glib-util.h" /* Uncomment to test compilation on non-XENIX systems. */ /* --- @@ -41,35 +42,35 @@ gboolean tape_rewind(int fd) { } gboolean tape_fsf(int fd, guint count) { - while (--count >= 0) { + while (count-- > 0) { if (0 != ioctl(fd, T_RFM)) return FALSE; } return TRUE; } -gboolean tape_bsf(int fd, guint count) { +gboolean tape_bsf(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) { g_assert_not_reached(); return FALSE; } -gboolean tape_fsr(int fd, guint count) { +gboolean tape_fsr(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) { g_assert_not_reached(); return FALSE; } -gboolean tape_bsr(int fd, guint count) { +gboolean tape_bsr(int fd G_GNUC_UNUSED, guint count G_GNUC_UNUSED) { g_assert_not_reached(); return FALSE; } -gint tape_eod(int fd) { +gint tape_eod(int fd G_GNUC_UNUSED) { g_assert_not_reached(); return TAPE_OP_ERROR; } gboolean tape_weof(int fd, guint8 count) { - while (count -- > 0) { + while (count-- > 0) { if (0 != ioctl(fd, T_WFM)) return FALSE; } @@ -77,62 +78,32 @@ gboolean tape_weof(int fd, guint8 count) { return TRUE; } -gboolean tape_setcompression(int fd, gboolean on) { +gboolean tape_setcompression(int fd G_GNUC_UNUSED, gboolean on G_GNUC_UNUSED) { return FALSE; } -ReadLabelStatusFlags tape_is_tape_device(int fd) { +DeviceStatusFlags tape_is_tape_device(int fd) { struct tape_info result; if (0 == ioctl(fd, MT_STATUS, &result)) { - return READ_LABEL_STATUS_SUCCESS; + return DEVICE_STATUS_SUCCESS; } else { - dbprintf("tape_is_tape_device: ioctl(MTIOCTOP/MTNOP) failed: %s", - strerror(errno)); - return READ_LABEL_STATUS_DEVICE_ERROR; + return DEVICE_STATUS_DEVICE_ERROR; } } -TapeCheckResult tape_is_ready(int fd) { +DeviceStatusFlags tape_is_ready(int fd G_GNUC_UNUSED, TapeDevice *t_self G_GNUC_UNUSED) { /* We can probably do better. */ - return TAPE_CHECK_UNKNOWN; + return DEVICE_STATUS_SUCCESS; } -void tape_device_discover_capabilities(TapeDevice * t_self) { - Device * self; - GValue val; - - self = DEVICE(t_self); - g_return_if_fail(self != NULL); - - bzero(&val, sizeof(val)); - g_value_init(&val, FEATURE_SUPPORT_FLAGS_TYPE); - - g_value_set_flags(&val, - FEATURE_STATUS_ENABLED | FEATURE_SURETY_BAD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSF, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_FSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_BSR, &val); - - g_value_set_flags(&val, - FEATURE_STATUS_DISABLED | FEATURE_SURETY_GOOD | - FEATURE_SOURCE_DEFAULT); - device_property_set(self, PROPERTY_EOM, &val); - - g_value_unset_init(&val, G_TYPE_UINT); - g_value_set_uint(&val, 2); - device_property_set(self, PROPERTY_FINAL_FILEMARKS, &val); +void tape_device_detect_capabilities(TapeDevice * t_self) { + tape_device_set_capabilities(t_self, + TRUE, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT, /* fsf*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* fsr*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsr*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* eom*/ + FALSE, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DEFAULT, /* bsf_after_eom*/ + 2, PROPERTY_SURETY_BAD, PROPERTY_SOURCE_DEFAULT /* final_filemarks*/ + ); } diff --git a/device-src/tests/Makefile.am b/device-src/tests/Makefile.am deleted file mode 100644 index 9c54473..0000000 --- a/device-src/tests/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# Makefile for Amanda tape library. - -INCLUDES = -I$(top_builddir)/common-src \ - -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/gnulib \ - -I$(top_srcdir)/device-src - -# automake-style tests - -noinst_PROGRAMS = queue_test device_test $(TESTS) - -### -# Because libamanda includes routines (e.g. regex) provided by some system -# libraries, and because of the way libtool sets up the command line, we -# need to list libamanda twice here, first to override the system library -# routines, and second to pick up any references in the other libraries. -### -LDADD = ../../common-src/libamanda.la \ - ../libamdevice.la \ - ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la - - -TESTS = semaphore-test vfs_test - -semaphore_test_SOURCES = semaphore-test.c - -vfs_test_SOURCES = vfs_test.c diff --git a/device-src/tests/Makefile.in b/device-src/tests/Makefile.in deleted file mode 100644 index 37fe55e..0000000 --- a/device-src/tests/Makefile.in +++ /dev/null @@ -1,964 +0,0 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Makefile for Amanda tape library. - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -noinst_PROGRAMS = queue_test$(EXEEXT) device_test$(EXEEXT) \ - $(am__EXEEXT_1) -TESTS = semaphore-test$(EXEEXT) vfs_test$(EXEEXT) -subdir = device-src/tests -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = \ - $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ - $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ - $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ - $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ - $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ - $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ - $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ - $(top_srcdir)/config/macro-archive/xsltproc.m4 \ - $(top_srcdir)/config/amanda/amplot.m4 \ - $(top_srcdir)/config/amanda/bsd-security.m4 \ - $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ - $(top_srcdir)/config/amanda/bsdudp-security.m4 \ - $(top_srcdir)/config/amanda/changer.m4 \ - $(top_srcdir)/config/amanda/components.m4 \ - $(top_srcdir)/config/amanda/compress.m4 \ - $(top_srcdir)/config/amanda/config.m4 \ - $(top_srcdir)/config/amanda/debugging.m4 \ - $(top_srcdir)/config/amanda/defaults.m4 \ - $(top_srcdir)/config/amanda/devprefix.m4 \ - $(top_srcdir)/config/amanda/dirs.m4 \ - $(top_srcdir)/config/amanda/documentation.m4 \ - $(top_srcdir)/config/amanda/dumpers.m4 \ - $(top_srcdir)/config/amanda/flags.m4 \ - $(top_srcdir)/config/amanda/flock.m4 \ - $(top_srcdir)/config/amanda/funcs.m4 \ - $(top_srcdir)/config/amanda/getfsent.m4 \ - $(top_srcdir)/config/amanda/i18n.m4 \ - $(top_srcdir)/config/amanda/ipv6.m4 \ - $(top_srcdir)/config/amanda/krb4-security.m4 \ - $(top_srcdir)/config/amanda/krb5-security.m4 \ - $(top_srcdir)/config/amanda/lfs.m4 \ - $(top_srcdir)/config/amanda/libs.m4 \ - $(top_srcdir)/config/amanda/net.m4 \ - $(top_srcdir)/config/amanda/progs.m4 \ - $(top_srcdir)/config/amanda/readdir.m4 \ - $(top_srcdir)/config/amanda/readline.m4 \ - $(top_srcdir)/config/amanda/rsh-security.m4 \ - $(top_srcdir)/config/amanda/s3-device.m4 \ - $(top_srcdir)/config/amanda/shmem.m4 \ - $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ - $(top_srcdir)/config/amanda/ssh-security.m4 \ - $(top_srcdir)/config/amanda/summary.m4 \ - $(top_srcdir)/config/amanda/swig.m4 \ - $(top_srcdir)/config/amanda/syshacks.m4 \ - $(top_srcdir)/config/amanda/tape.m4 \ - $(top_srcdir)/config/amanda/types.m4 \ - $(top_srcdir)/config/amanda/userid.m4 \ - $(top_srcdir)/config/amanda/version.m4 \ - $(top_srcdir)/config/gnulib/alloca.m4 \ - $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ - $(top_srcdir)/config/gnulib/base64.m4 \ - $(top_srcdir)/config/gnulib/eoverflow.m4 \ - $(top_srcdir)/config/gnulib/extensions.m4 \ - $(top_srcdir)/config/gnulib/float_h.m4 \ - $(top_srcdir)/config/gnulib/fsusage.m4 \ - $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gettimeofday.m4 \ - $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/include_next.m4 \ - $(top_srcdir)/config/gnulib/inet_ntop.m4 \ - $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longlong.m4 \ - $(top_srcdir)/config/gnulib/malloc.m4 \ - $(top_srcdir)/config/gnulib/mkdtemp.m4 \ - $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ - $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/physmem.m4 \ - $(top_srcdir)/config/gnulib/safe-read.m4 \ - $(top_srcdir)/config/gnulib/safe-write.m4 \ - $(top_srcdir)/config/gnulib/snprintf.m4 \ - $(top_srcdir)/config/gnulib/socklen.m4 \ - $(top_srcdir)/config/gnulib/sockpfaf.m4 \ - $(top_srcdir)/config/gnulib/ssize_t.m4 \ - $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint.m4 \ - $(top_srcdir)/config/gnulib/stdio_h.m4 \ - $(top_srcdir)/config/gnulib/stdlib_h.m4 \ - $(top_srcdir)/config/gnulib/strdup.m4 \ - $(top_srcdir)/config/gnulib/string_h.m4 \ - $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ - $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ - $(top_srcdir)/config/gnulib/sys_time_h.m4 \ - $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ - $(top_srcdir)/config/gnulib/unistd_h.m4 \ - $(top_srcdir)/config/gnulib/vasnprintf.m4 \ - $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar.m4 \ - $(top_srcdir)/config/gettext-macros/gettext.m4 \ - $(top_srcdir)/config/gettext-macros/iconv.m4 \ - $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ - $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ - $(top_srcdir)/config/gettext-macros/lib-link.m4 \ - $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ - $(top_srcdir)/config/gettext-macros/nls.m4 \ - $(top_srcdir)/config/gettext-macros/po.m4 \ - $(top_srcdir)/config/gettext-macros/progtest.m4 \ - $(top_srcdir)/config/gettext-macros/size_max.m4 \ - $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ - $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ - $(top_srcdir)/config/gettext-macros/wint_t.m4 \ - $(top_srcdir)/config/gettext-macros/xsize.m4 \ - $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config/config.h -CONFIG_CLEAN_FILES = -am__EXEEXT_1 = semaphore-test$(EXEEXT) vfs_test$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) -device_test_SOURCES = device_test.c -device_test_OBJECTS = device_test.$(OBJEXT) -device_test_LDADD = $(LDADD) -device_test_DEPENDENCIES = ../../common-src/libamanda.la \ - ../libamdevice.la ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la -queue_test_SOURCES = queue_test.c -queue_test_OBJECTS = queue_test.$(OBJEXT) -queue_test_LDADD = $(LDADD) -queue_test_DEPENDENCIES = ../../common-src/libamanda.la \ - ../libamdevice.la ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la -am_semaphore_test_OBJECTS = semaphore-test.$(OBJEXT) -semaphore_test_OBJECTS = $(am_semaphore_test_OBJECTS) -semaphore_test_LDADD = $(LDADD) -semaphore_test_DEPENDENCIES = ../../common-src/libamanda.la \ - ../libamdevice.la ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la -am_vfs_test_OBJECTS = vfs_test.$(OBJEXT) -vfs_test_OBJECTS = $(am_vfs_test_OBJECTS) -vfs_test_LDADD = $(LDADD) -vfs_test_DEPENDENCIES = ../../common-src/libamanda.la \ - ../libamdevice.la ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = device_test.c queue_test.c $(semaphore_test_SOURCES) \ - $(vfs_test_SOURCES) -DIST_SOURCES = device_test.c queue_test.c $(semaphore_test_SOURCES) \ - $(vfs_test_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMANDA_DBGDIR = @AMANDA_DBGDIR@ -AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ -AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ -AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ -AMLINT = @AMLINT@ -AMLINTFLAGS = @AMLINTFLAGS@ -AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ -AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ -AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ -AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ -AMTAR = @AMTAR@ -AR = @AR@ -ARPA_INET_H = @ARPA_INET_H@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BINARY_OWNER = @BINARY_OWNER@ -BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ -BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ -BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ -BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ -BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ -CAT = @CAT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ -CHIO = @CHIO@ -CHS = @CHS@ -CLIENT_LOGIN = @CLIENT_LOGIN@ -CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ -COMPRESS = @COMPRESS@ -CONFIG_DIR = @CONFIG_DIR@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CONFIG = @CURL_CONFIG@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DD = @DD@ -DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ -DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ -DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_SERVER = @DEFAULT_SERVER@ -DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ -DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOC_BUILD_DATE = @DOC_BUILD_DATE@ -DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ -EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLOAT_H = @FLOAT_H@ -GETCONF = @GETCONF@ -GETTEXT = @GETTEXT@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_MKENUMS = @GLIB_MKENUMS@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ -GNULIB_CHOWN = @GNULIB_CHOWN@ -GNULIB_DUP2 = @GNULIB_DUP2@ -GNULIB_FCHDIR = @GNULIB_FCHDIR@ -GNULIB_FFLUSH = @GNULIB_FFLUSH@ -GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ -GNULIB_FSEEK = @GNULIB_FSEEK@ -GNULIB_FSEEKO = @GNULIB_FSEEKO@ -GNULIB_FTELL = @GNULIB_FTELL@ -GNULIB_FTELLO = @GNULIB_FTELLO@ -GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ -GNULIB_GETCWD = @GNULIB_GETCWD@ -GNULIB_GETDELIM = @GNULIB_GETDELIM@ -GNULIB_GETLINE = @GNULIB_GETLINE@ -GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ -GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ -GNULIB_LCHOWN = @GNULIB_LCHOWN@ -GNULIB_LSEEK = @GNULIB_LSEEK@ -GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ -GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ -GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ -GNULIB_READLINK = @GNULIB_READLINK@ -GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ -GNULIB_SLEEP = @GNULIB_SLEEP@ -GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ -GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ -GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ -GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ -GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ -GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ -GNUPLOT = @GNUPLOT@ -GNUTAR = @GNUTAR@ -GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GOBJECT_QUERY = @GOBJECT_QUERY@ -GREP = @GREP@ -GZIP = @GZIP@ -HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ -HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ -HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ -HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ -HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ -HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ -HAVE_DUP2 = @HAVE_DUP2@ -HAVE_FSEEKO = @HAVE_FSEEKO@ -HAVE_FTELLO = @HAVE_FTELLO@ -HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ -HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_IO_H = @HAVE_IO_H@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ -HAVE_LSTAT = @HAVE_LSTAT@ -HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_MKDTEMP = @HAVE_MKDTEMP@ -HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ -HAVE_READLINK = @HAVE_READLINK@ -HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ -HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ -HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ -HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ -HAVE_SLEEP = @HAVE_SLEEP@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ -HAVE_STRCASESTR = @HAVE_STRCASESTR@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRNDUP = @HAVE_STRNDUP@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ -HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ -HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ -HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ -HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_UNISTD_H = @HAVE_UNISTD_H@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_VASPRINTF = @HAVE_VASPRINTF@ -HAVE_VISIBILITY = @HAVE_VISIBILITY@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ -HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ -HAVE__BOOL = @HAVE__BOOL@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBCURL = @LIBCURL@ -LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -MAILER = @MAILER@ -MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ -MCUTIL = @MCUTIL@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -MT = @MT@ -MTX = @MTX@ -MT_FILE_FLAG = @MT_FILE_FLAG@ -NETINET_IN_H = @NETINET_IN_H@ -NEXT_FLOAT_H = @NEXT_FLOAT_H@ -NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ -NEXT_STDINT_H = @NEXT_STDINT_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STDLIB_H = @NEXT_STDLIB_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ -NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ -NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ -NEXT_UNISTD_H = @NEXT_UNISTD_H@ -NEXT_WCHAR_H = @NEXT_WCHAR_H@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCAT = @PCAT@ -PERL = @PERL@ -PERLEXTLIBS = @PERLEXTLIBS@ -PERL_INC = @PERL_INC@ -PKG_CONFIG = @PKG_CONFIG@ -POSUB = @POSUB@ -PRINT = @PRINT@ -PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -REPLACE_CHOWN = @REPLACE_CHOWN@ -REPLACE_FCHDIR = @REPLACE_FCHDIR@ -REPLACE_FFLUSH = @REPLACE_FFLUSH@ -REPLACE_FPRINTF = @REPLACE_FPRINTF@ -REPLACE_FSEEK = @REPLACE_FSEEK@ -REPLACE_FSEEKO = @REPLACE_FSEEKO@ -REPLACE_FTELL = @REPLACE_FTELL@ -REPLACE_FTELLO = @REPLACE_FTELLO@ -REPLACE_GETCWD = @REPLACE_GETCWD@ -REPLACE_GETLINE = @REPLACE_GETLINE@ -REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ -REPLACE_LCHOWN = @REPLACE_LCHOWN@ -REPLACE_LSEEK = @REPLACE_LSEEK@ -REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ -REPLACE_PRINTF = @REPLACE_PRINTF@ -REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ -REPLACE_SPRINTF = @REPLACE_SPRINTF@ -REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ -REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ -REPLACE_VPRINTF = @REPLACE_VPRINTF@ -REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ -REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ -REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ -RESTORE = @RESTORE@ -SAMBA_CLIENT = @SAMBA_CLIENT@ -SERVICE_SUFFIX = @SERVICE_SUFFIX@ -SETUID_GROUP = @SETUID_GROUP@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ -SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ -SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ -SORT = @SORT@ -SSH = @SSH@ -STDBOOL_H = @STDBOOL_H@ -STDINT_H = @STDINT_H@ -STRIP = @STRIP@ -SVN = @SVN@ -SWIG = @SWIG@ -SWIG_LIB = @SWIG_LIB@ -SYS_SOCKET_H = @SYS_SOCKET_H@ -SYS_STAT_H = @SYS_STAT_H@ -SYS_TIME_H = @SYS_TIME_H@ -USE_NLS = @USE_NLS@ -USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ -VDUMP = @VDUMP@ -VERSION = @VERSION@ -VERSION_COMMENT = @VERSION_COMMENT@ -VERSION_MAJOR = @VERSION_MAJOR@ -VERSION_MINOR = @VERSION_MINOR@ -VERSION_PATCH = @VERSION_PATCH@ -VERSION_SUFFIX = @VERSION_SUFFIX@ -VRESTORE = @VRESTORE@ -VXDUMP = @VXDUMP@ -VXRESTORE = @VXRESTORE@ -WCHAR_H = @WCHAR_H@ -WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WINT_T_SUFFIX = @WINT_T_SUFFIX@ -XFSDUMP = @XFSDUMP@ -XFSRESTORE = @XFSRESTORE@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XSLREL = @XSLREL@ -XSLTPROC = @XSLTPROC@ -XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -_libcurl_config = @_libcurl_config@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -amincludedir = @amincludedir@ -amlibdir = @amlibdir@ -amlibexecdir = @amlibexecdir@ -amperldir = @amperldir@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -INCLUDES = -I$(top_builddir)/common-src \ - -I$(top_srcdir)/common-src \ - -I$(top_srcdir)/gnulib \ - -I$(top_srcdir)/device-src - - -### -# Because libamanda includes routines (e.g. regex) provided by some system -# libraries, and because of the way libtool sets up the command line, we -# need to list libamanda twice here, first to override the system library -# routines, and second to pick up any references in the other libraries. -### -LDADD = ../../common-src/libamanda.la \ - ../libamdevice.la \ - ../../common-src/libamanda.la \ - ../../gnulib/libgnu.la - -semaphore_test_SOURCES = semaphore-test.c -vfs_test_SOURCES = vfs_test.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu device-src/tests/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu device-src/tests/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -device_test$(EXEEXT): $(device_test_OBJECTS) $(device_test_DEPENDENCIES) - @rm -f device_test$(EXEEXT) - $(LINK) $(device_test_OBJECTS) $(device_test_LDADD) $(LIBS) -queue_test$(EXEEXT): $(queue_test_OBJECTS) $(queue_test_DEPENDENCIES) - @rm -f queue_test$(EXEEXT) - $(LINK) $(queue_test_OBJECTS) $(queue_test_LDADD) $(LIBS) -semaphore-test$(EXEEXT): $(semaphore_test_OBJECTS) $(semaphore_test_DEPENDENCIES) - @rm -f semaphore-test$(EXEEXT) - $(LINK) $(semaphore_test_OBJECTS) $(semaphore_test_LDADD) $(LIBS) -vfs_test$(EXEEXT): $(vfs_test_OBJECTS) $(vfs_test_DEPENDENCIES) - @rm -f vfs_test$(EXEEXT) - $(LINK) $(vfs_test_OBJECTS) $(vfs_test_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semaphore-test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfs_test.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ - srcdir=$(srcdir); export srcdir; \ - list=' $(TESTS) '; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - echo "SKIP: $$tst"; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ - else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-exec-am: - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-generic clean-libtool clean-noinstPROGRAMS ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/device-src/tests/device_test.c b/device-src/tests/device_test.c deleted file mode 100644 index 9a46fee..0000000 --- a/device-src/tests/device_test.c +++ /dev/null @@ -1,198 +0,0 @@ -#include -#include -#include - -int blocksize; -unsigned int seed = 0; - -static char * make_rand_buf(int size) { - char * rval; - unsigned int i; - - rval = malloc(size); - i = size; - while (i > sizeof(int)) { - int rand; - rand = rand_r(&seed); - memcpy(rval + size - i, &rand, sizeof(int)); - i -= sizeof(int); - } - - if (size > 0) { - int rand; - rand = rand_r(&seed); - memcpy(rval + size - i, &rand, i); - } - - return rval; -} - -static gboolean write_whole_file(Device * device) { - dumpfile_t dumpfile; - char * tmp; - int i; - - fh_init(&dumpfile); - dumpfile.type = F_DUMPFILE; - tmp = get_timestamp_from_time(time(NULL)); - strcpy(dumpfile.datestamp, tmp); - amfree(tmp); - strcpy(dumpfile.name, "localhost"); - tmp = g_get_current_dir(); - strcpy(dumpfile.disk, tmp); - amfree(tmp); - strcpy(dumpfile.program, "TESTER"); - strcpy(dumpfile.recover_cmd, "recover_cmd"); - - blocksize = device_write_max_size(device); - - g_return_val_if_fail(device_start_file(device, &dumpfile), FALSE); - - for (i = 0; i < 1000; i ++) { - int size; - char * buf; - if (i == 999) - size = blocksize / 2; - else - size = blocksize; - buf = make_rand_buf(size); - g_return_val_if_fail(device_write_block(device, size, buf, i == 999), - FALSE); - amfree(buf); - } - - g_return_val_if_fail(device->in_file == FALSE, FALSE); - - return TRUE; -} - -static gboolean read_whole_file(Device * device, int fileno) { - int size = 0; - dumpfile_t * file = device_seek_file(device, fileno + 1); - int i; - char *buf; - - if (file == NULL) - g_assert_not_reached(); - else - amfree(file); - - g_return_val_if_fail(device_seek_block(device, 0), FALSE); - - g_return_val_if_fail(0 == device_read_block(device, NULL, &size), - FALSE); - g_assert(size >= blocksize); - - for (i = 0; i < 1000; i ++) { - int size, size2; - char buf2[blocksize]; - size2 = blocksize; - if (i == 999) - size = blocksize/2; - else - size = blocksize; - buf = make_rand_buf(size); - - g_return_val_if_fail(device_read_block(device, buf2, &size2), - FALSE); - g_assert(size2 == size || size2 == blocksize); - g_assert(memcmp(buf, buf2, size) == 0); - amfree(buf); - } - - size = blocksize; - buf = malloc(blocksize); - g_assert(-1 == device_read_block(device, &buf, &size)); - g_return_val_if_fail(device->is_eof, FALSE); - free(buf); - - return TRUE; -} - -static MediaAccessMode get_medium_type(Device * device) { - GValue value; - MediaAccessMode rval; - - bzero(&value, sizeof(value)); - - g_return_val_if_fail(device_property_get(device, PROPERTY_MEDIUM_TYPE, - &value), 0); - - rval = g_value_get_enum(&value); - g_value_unset(&value); - return rval; -} - -int main(int argc, char ** argv) { - Device * device; - int h; - MediaAccessMode medium_type; - - g_return_val_if_fail(argc == 2, 1); - - device_api_init(); - - device = device_open(argv[1]); - g_return_val_if_fail(device != NULL, 2); - - medium_type = get_medium_type(device); - - if (device->volume_label) { - printf("Last header: %s %s\n", device->volume_label, - device->volume_time); - } - - if (medium_type != MEDIA_ACCESS_MODE_READ_ONLY) { - g_return_val_if_fail(device_start(device, ACCESS_WRITE, - "foo", NULL), - 2); - - for (h = 0; h < 10; h ++) { - gboolean appendable; - GValue value; - g_return_val_if_fail(write_whole_file(device), 3); - - bzero(&value, sizeof(value)); - g_return_val_if_fail(device_property_get(device, - PROPERTY_APPENDABLE, - &value), 4); - appendable = g_value_get_boolean(&value); - g_value_unset(&value); - - if (appendable && h == 5) { - g_object_unref(device); - - device = device_open(argv[1]); - g_return_val_if_fail(device != NULL, 6); - - g_return_val_if_fail(device_start(device, ACCESS_APPEND, - "foo", NULL), - 2); - } - } - - g_object_unref(device); - - device = device_open(argv[1]); - g_return_val_if_fail(device != NULL, 6); - } - - /* Fixme: check for readable access mode. */ - if (medium_type != MEDIA_ACCESS_MODE_WRITE_ONLY) { - g_return_val_if_fail(device->volume_label, 7); - printf("This header: %s %s\n", device->volume_label, - device->volume_time); - - g_return_val_if_fail(device_start(device, ACCESS_READ, - "foo", NULL), - 2); - seed = 0; - for (h = 0; h < 10; h ++) { - g_return_val_if_fail(read_whole_file(device, h), 8); - } - } - - g_object_unref(device); - - return 0; -} diff --git a/device-src/tests/queue_test.c b/device-src/tests/queue_test.c deleted file mode 100644 index f6cef95..0000000 --- a/device-src/tests/queue_test.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include - -int main(void) { - /* ignore SIGPIPE */ - signal(SIGPIPE, SIG_IGN); - - /* Comment out this line to disable threads. */ - device_api_init(); - - /* The integer here is the block size to use. Set it to something - * bigger for better performance. */ - return !do_consumer_producer_queue_full(fd_read_producer, - GINT_TO_POINTER(0), - fd_write_consumer, - GINT_TO_POINTER(1), - 1, /* Block size */ - 10, /* Buffer size. */ - STREAMING_REQUIREMENT_DESIRED); -} diff --git a/device-src/tests/semaphore-test.c b/device-src/tests/semaphore-test.c deleted file mode 100644 index 2e523c7..0000000 --- a/device-src/tests/semaphore-test.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -#include "semaphore.h" -#include "amanda.h" -#include "util.h" - -/* - * test that decrement waits properly - */ - -struct test_decr_wait_data { - semaphore_t *sem; - gboolean increment_called; -}; - -static gpointer -test_decr_wait_thread(gpointer datap) -{ - struct test_decr_wait_data *data = datap; - - /* should block */ - semaphore_decrement(data->sem, 20); - - /* if increment hasn't been called yet, that's an error. */ - if (!data->increment_called) - return GINT_TO_POINTER(0); - - return GINT_TO_POINTER(1); -} - -static gboolean -test_decr_wait(void) -{ - GThread *th; - struct test_decr_wait_data data = { NULL, FALSE }; - int rv; - - data.sem = semaphore_new_with_value(10), - - /* die after 10 seconds (default signal disposition is to fail) */ - alarm(10); - - th = g_thread_create(test_decr_wait_thread, (gpointer)&data, TRUE, NULL); - - /* sleep to give semaphore_decrement() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* and then increment the semaphore enough that the decrement can succeed */ - data.increment_called = TRUE; - semaphore_increment(data.sem, 10); - - /* join the thread and see how it fared. */ - rv = GPOINTER_TO_INT(g_thread_join(th)); - - semaphore_free(data.sem); - - if (rv == 1) { - printf(" PASS: semaphore-test.test_decr_wait\n"); - return TRUE; - } else { - printf(" FAIL: semaphore-test.test_decr_wait\n"); - return FALSE; - } -} - - -/* - * test that semaphore_wait_empty waits properly - */ - -static gpointer -test_wait_empty_thread(gpointer datap) -{ - semaphore_t *sem = datap; - - /* should block */ - semaphore_decrement(sem, 20); - - /* value should be 10 now (decremented from 30) */ - if (sem->value != 10) - return GINT_TO_POINTER(1); - - /* sleep for a bit */ - g_usleep(G_USEC_PER_SEC / 4); - - /* decrement those last 10, which should trigger the zero */ - semaphore_decrement(sem, 10); - - return GINT_TO_POINTER(0); -} - -static gboolean -test_wait_empty(void) -{ - GThread *th; - semaphore_t *sem = semaphore_new_with_value(10); - int rv; - - /* die after 10 seconds (default signal disposition is to fail) */ - alarm(10); - - th = g_thread_create(test_wait_empty_thread, (gpointer)sem, TRUE, NULL); - - /* sleep to give semaphore_decrement() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* add another 10, so decrement can hit zero next time it's called */ - semaphore_increment(sem, 10); - - /* and wait on the semaphore emptying */ - semaphore_wait_empty(sem); - - /* join the thread and see how it fared. */ - rv = GPOINTER_TO_INT(g_thread_join(th)); - - semaphore_free(sem); - - if (rv == 1) { - printf(" PASS: semaphore-test.test_wait_empty\n"); - return TRUE; - } else { - printf(" FAIL: semaphore-test.test_wait_empty\n"); - return FALSE; - } -} - -/* - * test that semaphore_force_adjust correctly wakes both - * semaphore_decrement and semaphore_wait_empty. - */ - -static gpointer -test_force_adjust_thread(gpointer datap) -{ - semaphore_t *sem = datap; - - /* this should block */ - semaphore_decrement(sem, 20); - - /* and this should block, too - it's fun */ - semaphore_wait_empty(sem); - - return NULL; -} - -static gboolean -test_force_adjust(void) -{ - GThread *th; - semaphore_t *sem = semaphore_new_with_value(10); - - /* die after 10 seconds (default signal disposition is to fail) */ - alarm(10); - - th = g_thread_create(test_force_adjust_thread, (gpointer)sem, TRUE, NULL); - - /* sleep to give semaphore_decrement() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* add another 20, so decrement can proceed, but leave the value at 10 */ - semaphore_force_adjust(sem, 20); - - /* sleep to give semaphore_wait_empty() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* and empty out the semaphore */ - semaphore_force_adjust(sem, -10); - - g_thread_join(th); - - semaphore_free(sem); - - /* it we didn't hang yet, it's all good */ - printf(" PASS: semaphore-test.test_force_adjust\n"); - return TRUE; -} - -/* - * test that semaphore_force_set correctly wakes both - * semaphore_decrement and semaphore_wait_empty. - */ - -static gpointer -test_force_set_thread(gpointer datap) -{ - semaphore_t *sem = datap; - - /* this should block */ - semaphore_decrement(sem, 20); - - /* and this should block, too - it's fun */ - semaphore_wait_empty(sem); - - return NULL; -} - -static gboolean -test_force_set(void) -{ - GThread *th; - semaphore_t *sem = semaphore_new_with_value(10); - - /* die after 10 seconds (default signal disposition is to fail) */ - alarm(10); - - th = g_thread_create(test_force_set_thread, (gpointer)sem, TRUE, NULL); - - /* sleep to give semaphore_decrement() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* set it to 30, so decrement can proceed, but leave the value at 10 */ - semaphore_force_set(sem, 30); - - /* sleep to give semaphore_wait_empty() a chance to block (or not). */ - g_usleep(G_USEC_PER_SEC / 4); - - /* and empty out the semaphore */ - semaphore_force_set(sem, 0); - - g_thread_join(th); - - semaphore_free(sem); - - /* it we didn't hang yet, it's all good */ - printf(" PASS: semaphore-test.test_force_set\n"); - return TRUE; -} - -/* - * Main loop - */ - -int -main(void) -{ - gboolean pass = TRUE; - -#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) - amanda_thread_init(); - - pass = test_decr_wait() && pass; - pass = test_wait_empty() && pass; - pass = test_force_adjust() && pass; - pass = test_force_set() && pass; - - return pass?0:1; -#else - printf("No thread support on this platform -- nothing to test\n"); - return 0; -#endif -} diff --git a/device-src/tests/vfs_test.c b/device-src/tests/vfs_test.c deleted file mode 100644 index b05ee78..0000000 --- a/device-src/tests/vfs_test.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -#include -#include -#include "util.h" - -/* global so the 'atexit' handler can access it */ - -static void -cleanup_vtape_dir(char *device_path) -{ - char *quoted = g_shell_quote(device_path); - char *cmd = vstralloc("rm -rf ", quoted, NULL); - - /* would you rather write 'rm -rf' here? */ - if (system(cmd) == -1) { - exit(1); - } - - amfree(cmd); - amfree(quoted); -} - -static char * -setup_vtape_dir(void) -{ - char *cwd = g_get_current_dir(); - char *device_path = NULL; - char *data_dir = NULL; - - device_path = vstralloc(cwd, "/vfs-test-XXXXXX", NULL); - amfree(cwd); - - if (mkdtemp(device_path) == NULL) { - fprintf(stderr, "Could not create temporary directory in %s\n", cwd); - return NULL; - } - - /* append "/data/" to that for the VFS device*/ - data_dir = vstralloc(device_path, "/data/", NULL); - if (mkdir(data_dir, 0777) == -1) { - fprintf(stderr, "Could not create %s: %s\n", cwd, strerror(errno)); - amfree(data_dir); - return NULL; - } - - amfree(data_dir); - return device_path; -} - -static Device * -setup_device(char *device_path) -{ - Device *device; - char *device_name = NULL; - - device_name = vstralloc("file:", device_path, NULL); - device = device_open(device_name); - if (!device) { - fprintf(stderr, "Could not open device %s\n", device_name); - } - - amfree(device_name); - return device; -} - -static gboolean -check_free_space(Device *device) -{ - GValue value; - QualifiedSize qsize; - - bzero(&value, sizeof(value)); - if (!device_property_get(device, PROPERTY_FREE_SPACE, &value)) { - fprintf(stderr, "Could not get property_free_space\n"); - return FALSE; - } - - qsize = *(QualifiedSize*)g_value_get_boxed(&value); - g_value_unset(&value); - - if (qsize.accuracy != SIZE_ACCURACY_REAL) { - fprintf(stderr, "property_free_space accuracy is not SIZE_ACCURACY_REAL\n"); - return FALSE; - } - - if (qsize.bytes == 0) { - fprintf(stderr, "property_free_space returned bytes=0\n"); - return FALSE; - } - - return TRUE; -} - -int -main(int argc G_GNUC_UNUSED, char **argv G_GNUC_UNUSED) -{ - Device *device = NULL; - gboolean ok = TRUE; - char *device_path = NULL; - pid_t pid; - amwait_t status; - - amanda_thread_init(); - - device_path = setup_vtape_dir(); - - /* run the tests in a subprocess so we can clean up even if they fail */ - switch (pid = fork()) { - case -1: /* error */ - perror("fork"); - g_assert_not_reached(); - - case 0: /* child */ - device_api_init(); - - device = setup_device(device_path); - if (!device) - return 1; - - ok = ok && check_free_space(device); - - g_object_unref(device); - - if (!ok) exit(1); - exit(0); - g_assert_not_reached(); - - default: /* parent */ - if (waitpid(pid, &status, 0) == -1) - perror("waitpid"); - - /* cleanup */ - cleanup_vtape_dir(device_path); - amfree(device_path); - - /* figure our own return status */ - if (WIFEXITED(status)) - return WEXITSTATUS(status); - else if (WIFSIGNALED(status)) { - fprintf(stderr, "Test failed with signal %d\n", (int)WTERMSIG(status)); - return 1; - } else { - /* weird.. */ - return 1; - } - g_assert_not_reached(); - } -} diff --git a/device-src/vfs-device.c b/device-src/vfs-device.c index a69b584..667c548 100644 --- a/device-src/vfs-device.c +++ b/device-src/vfs-device.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 2.1 as @@ -14,18 +14,57 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ -#include /* memset() */ - #include "amanda.h" -#include "vfs-device.h" +#include /* memset() */ #include "fsusage.h" #include "util.h" +#include "device.h" #include +/* + * Type checking and casting macros + */ +#define TYPE_VFS_DEVICE (vfs_device_get_type()) +#define VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice) +#define VFS_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice const) +#define VFS_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), vfs_device_get_type(), VfsDeviceClass) +#define IS_VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), vfs_device_get_type ()) + +#define VFS_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), vfs_device_get_type(), VfsDeviceClass) +static GType vfs_device_get_type (void); + +/* + * Main object structure + */ +typedef struct { + Device __parent__; + + /*< private >*/ + char * dir_name; + char * file_name; + int file_lock_fd; + char * file_lock_name; + int volume_lock_fd; + char * volume_lock_name; + int open_file_fd; + + /* Properties */ + guint64 volume_bytes; + guint64 volume_limit; +} VfsDevice; + +/* + * Class definition + */ +typedef struct { + DeviceClass __parent__; +} VfsDeviceClass; + + /* This regex will match all VfsDevice files in a directory. We use it for cleanup and verification. Note that this regex does NOT match the volume label. */ @@ -35,6 +74,14 @@ generated by lockfile_name(0). */ #define VOLUME_LOCKFILE_NAME "00000-lock" +#define VFS_DEVICE_MIN_BLOCK_SIZE (1) +#define VFS_DEVICE_MAX_BLOCK_SIZE (INT_MAX) +#define VFS_DEVICE_DEFAULT_BLOCK_SIZE (DISK_BLOCK_BYTES) +#define VFS_DEVICE_LABEL_SIZE (32768) + +/* This looks dangerous, but is actually modified by the umask. */ +#define VFS_DEVICE_CREAT_MODE 0666 + /* Possible (abstracted) results from a system I/O operation. */ typedef enum { RESULT_SUCCESS, @@ -46,29 +93,27 @@ typedef enum { RESULT_MAX } IoResult; +void vfs_device_register(void); + /* here are local prototypes */ static void vfs_device_init (VfsDevice * o); static void vfs_device_class_init (VfsDeviceClass * c); +static void vfs_device_base_init (VfsDeviceClass * c); static void vfs_device_finalize (GObject * o); static gboolean vfs_device_start(Device * pself, DeviceAccessMode mode, char * label, char * timestamp); -static gboolean vfs_device_open_device (Device * pself, - char * device_name); -static gboolean vfs_device_start_file (Device * pself, const dumpfile_t * ji); +static gboolean vfs_device_finish (Device * pself); +static void vfs_device_open_device (Device * pself, char * device_name, + char * device_type, char * device_node); +static gboolean vfs_device_start_file (Device * pself, dumpfile_t * ji); static gboolean vfs_device_finish_file (Device * pself); static dumpfile_t * vfs_device_seek_file (Device * self, guint file); static gboolean vfs_device_seek_block (Device * self, guint64 block); -static gboolean vfs_device_property_get (Device * pself, DevicePropertyId ID, - GValue * val); -static gboolean vfs_device_property_set (Device * pself, DevicePropertyId ID, - GValue * val); static gboolean vfs_device_recycle_file (Device * pself, guint filenum); -static Device * vfs_device_factory(char * device_type, - char * device_name); -static ReadLabelStatusFlags vfs_device_read_label(Device * dself); -static gboolean vfs_device_write_block(Device * self, guint size, - gpointer data, gboolean last_block); +static Device * vfs_device_factory(char * device_name, char * device_type, char * device_node); +static DeviceStatusFlags vfs_device_read_label(Device * dself); +static gboolean vfs_device_write_block(Device * self, guint size, gpointer data); static int vfs_device_read_block(Device * self, gpointer data, int * size_req); static IoResult vfs_device_robust_write(VfsDevice * self, char *buf, int count); @@ -77,21 +122,29 @@ static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, /* Various helper functions. */ static void release_file(VfsDevice * self); -static gboolean check_is_dir(const char * name, gboolean printmsg); +static gboolean check_is_dir(Device * d_self, const char * name); static char* file_number_to_file_name(VfsDevice * self, guint file); static gboolean file_number_to_file_name_functor(const char * filename, gpointer datap); +static gboolean vfs_device_set_max_volume_usage_fn(Device *p_self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source); +gboolean vfs_device_get_free_space_fn(struct Device *p_self, + DevicePropertyBase *base, GValue *val, + PropertySurety *surety, PropertySource *source); //static char* lockfile_name(VfsDevice * self, guint file); static gboolean open_lock(VfsDevice * self, int file, gboolean exclusive); static void promote_volume_lock(VfsDevice * self); static void demote_volume_lock(VfsDevice * self); -static gboolean delete_vfs_files(VfsDevice * self); +static void delete_vfs_files(VfsDevice * self); static gboolean delete_vfs_files_functor(const char * filename, gpointer self); static gboolean check_dir_empty_functor(const char * filename, gpointer self); static gboolean clear_and_prepare_label(VfsDevice * self, char * label, char * timestamp); +static int search_vfs_directory(VfsDevice *self, const char * regex, + SearchDirectoryFunctor functor, gpointer user_data); static gint get_last_file_number(VfsDevice * self); static gboolean get_last_file_number_functor(const char * filename, gpointer datap); @@ -106,7 +159,7 @@ void vfs_device_register(void) { register_device(vfs_device_factory, device_prefix_list); } -GType +static GType vfs_device_get_type (void) { static GType type = 0; @@ -114,7 +167,7 @@ vfs_device_get_type (void) if G_UNLIKELY(type == 0) { static const GTypeInfo info = { sizeof (VfsDeviceClass), - (GBaseInitFunc) NULL, + (GBaseInitFunc) vfs_device_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vfs_device_class_init, (GClassFinalizeFunc) NULL, @@ -134,77 +187,57 @@ vfs_device_get_type (void) static void vfs_device_init (VfsDevice * self) { - Device * o; - DeviceProperty prop; + Device * dself = DEVICE(self); GValue response; - self->dir_handle = NULL; self->dir_name = self->file_name = NULL; self->file_lock_name = self->volume_lock_name = NULL; self->file_lock_fd = self->volume_lock_fd = self->open_file_fd = -1; - self->block_size = VFS_DEVICE_DEFAULT_BLOCK_SIZE; self->volume_bytes = 0; self->volume_limit = 0; /* Register Properties */ - o = DEVICE(self); bzero(&response, sizeof(response)); - prop.base = &device_property_concurrency; - prop.access = PROPERTY_ACCESS_GET_MASK; + g_value_init(&response, CONCURRENCY_PARADIGM_TYPE); g_value_set_enum(&response, CONCURRENCY_PARADIGM_RANDOM_ACCESS); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_CONCURRENCY, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_streaming; g_value_init(&response, STREAMING_REQUIREMENT_TYPE); g_value_set_enum(&response, STREAMING_REQUIREMENT_NONE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_STREAMING, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_min_block_size; - g_value_init(&response, G_TYPE_UINT); - g_value_set_uint(&response, VFS_DEVICE_MIN_BLOCK_SIZE); - device_add_property(o, &prop, &response); - - prop.base = &device_property_max_block_size; - g_value_set_uint(&response, VFS_DEVICE_MAX_BLOCK_SIZE); - device_add_property(o, &prop, &response); + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, TRUE); + device_set_simple_property(dself, PROPERTY_APPENDABLE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - prop.base = &device_property_appendable; g_value_init(&response, G_TYPE_BOOLEAN); g_value_set_boolean(&response, TRUE); - device_add_property(o, &prop, &response); - - prop.base = &device_property_partial_deletion; - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_PARTIAL_DELETION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - /* This one is handled by Device's get_property handler. */ - prop.base = &device_property_canonical_name; - device_add_property(o, &prop, NULL); + g_value_init(&response, G_TYPE_BOOLEAN); + g_value_set_boolean(&response, FALSE); + device_set_simple_property(dself, PROPERTY_COMPRESSION, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); + g_value_unset(&response); - prop.base = &device_property_medium_access_type; g_value_init(&response, MEDIA_ACCESS_MODE_TYPE); g_value_set_enum(&response, MEDIA_ACCESS_MODE_READ_WRITE); - device_add_property(o, &prop, &response); + device_set_simple_property(dself, PROPERTY_MEDIUM_ACCESS_TYPE, + &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED); g_value_unset(&response); - - /* These are dynamic, handled in vfs_device_property_xxx */ - prop.base = &device_property_block_size; - prop.access = PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START; - device_add_property(o, &prop, NULL); - - prop.base = &device_property_max_volume_usage; - prop.access = - (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & - (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE); - device_add_property(o, &prop, NULL); } static void -vfs_device_class_init (VfsDeviceClass * c G_GNUC_UNUSED) +vfs_device_class_init (VfsDeviceClass * c) { GObjectClass *g_object_class = (GObjectClass*) c; DeviceClass *device_class = (DeviceClass *)c; @@ -220,12 +253,84 @@ vfs_device_class_init (VfsDeviceClass * c G_GNUC_UNUSED) device_class->finish_file = vfs_device_finish_file; device_class->seek_file = vfs_device_seek_file; device_class->seek_block = vfs_device_seek_block; - device_class->property_get = vfs_device_property_get; - device_class->property_set = vfs_device_property_set; device_class->recycle_file = vfs_device_recycle_file; + device_class->finish = vfs_device_finish; g_object_class->finalize = vfs_device_finalize; } +static void +vfs_device_base_init (VfsDeviceClass * c) +{ + DeviceClass *device_class = (DeviceClass *)c; + + device_class_register_property(device_class, PROPERTY_FREE_SPACE, + PROPERTY_ACCESS_GET_MASK, + vfs_device_get_free_space_fn, + NULL); + + device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE, + (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) & + (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE), + device_simple_property_get_fn, + vfs_device_set_max_volume_usage_fn); + + device_class_register_property(device_class, PROPERTY_COMPRESSION, + PROPERTY_ACCESS_GET_MASK, + device_simple_property_get_fn, + NULL); +} + +gboolean +vfs_device_set_max_volume_usage_fn(Device *p_self, + DevicePropertyBase *base, GValue *val, + PropertySurety surety, PropertySource source) +{ + VfsDevice *self = VFS_DEVICE(p_self); + + self->volume_limit = g_value_get_uint64(val); + + return device_simple_property_set_fn(p_self, base, val, surety, source); +} + +gboolean +vfs_device_get_free_space_fn(struct Device *p_self, + DevicePropertyBase *base G_GNUC_UNUSED, GValue *val, + PropertySurety *surety, PropertySource *source) +{ + VfsDevice *self = VFS_DEVICE(p_self); + QualifiedSize qsize; + struct fs_usage fsusage; + guint64 bytes_avail; + + if (get_fs_usage(self->dir_name, NULL, &fsusage) == 0) { + if (fsusage.fsu_bavail_top_bit_set) + bytes_avail = 0; + else + bytes_avail = fsusage.fsu_bavail * fsusage.fsu_blocksize; + if (self->volume_limit && (guint64)self->volume_limit < bytes_avail / 1024) + bytes_avail = (guint64)self->volume_limit * 1024; + + qsize.accuracy = SIZE_ACCURACY_REAL; + qsize.bytes = bytes_avail; + if (surety) + *surety = PROPERTY_SURETY_GOOD; + } else { + g_warning(_("get_fs_usage('%s') failed: %s"), self->dir_name, strerror(errno)); + qsize.accuracy = SIZE_ACCURACY_UNKNOWN; + qsize.bytes = 0; + if (surety) + *surety = PROPERTY_SURETY_BAD; + } + + g_value_unset_init(val, QUALIFIED_SIZE_TYPE); + g_value_set_boxed(val, &qsize); + + if (source) + *source = PROPERTY_SOURCE_DETECTED; + + return TRUE; +} + /* Drops everything associated with the volume file: Its name and fd, its lock, and its lock's name and fd. */ static void release_file(VfsDevice * self) { @@ -254,11 +359,6 @@ static void vfs_device_finalize(GObject * obj_self) { amfree(self->dir_name); - if(self->dir_handle) { - closedir (self->dir_handle); - self->dir_handle = NULL; - } - release_file(self); if (self->volume_lock_fd >= 0) { @@ -269,38 +369,31 @@ static void vfs_device_finalize(GObject * obj_self) { amfree(self->volume_lock_name); } -static Device * vfs_device_factory(char * device_type, - char * device_name) { +static Device * vfs_device_factory(char * device_name, char * device_type, char * device_node) { Device * rval; g_assert(0 == strcmp(device_type, "file")); rval = DEVICE(g_object_new(TYPE_VFS_DEVICE, NULL)); - if (!device_open_device(rval, device_name)) { - g_object_unref(rval); - return NULL; - } else { - return rval; - } + device_open_device(rval, device_name, device_type, device_node); + return rval; } -static gboolean check_is_dir(const char * name, gboolean printmsg) { +static gboolean check_is_dir(Device * d_self, const char * name) { struct stat dir_status; if (stat(name, &dir_status) < 0) { #ifdef EINTR if (errno == EINTR) { - return check_is_dir(name, printmsg); + return check_is_dir(d_self, name); } #endif /* EINTR */ - if (printmsg) { - g_fprintf(stderr, "Error checking directory %s: %s\n", - name, strerror(errno)); - } + device_set_error(d_self, + vstrallocf(_("Error checking directory %s: %s"), name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else if (!S_ISDIR(dir_status.st_mode)) { - if (printmsg) { - g_fprintf(stderr, "VFS Device path %s is not a directory.\n", - name); - } + device_set_error(d_self, + vstrallocf(_("VFS Device path %s is not a directory"), name), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } else { return TRUE; @@ -325,11 +418,9 @@ static gboolean file_number_to_file_name_functor(const char * filename, /* Just to be thorough, let's check that it's a real file. */ if (0 != stat(result_tmp, &file_status)) { - g_fprintf(stderr, "Cannot stat file %s (%s), ignoring it.\n", - result_tmp, strerror(errno)); + g_warning(_("Cannot stat file %s (%s), ignoring it"), result_tmp, strerror(errno)); } else if (!S_ISREG(file_status.st_mode)) { - g_fprintf(stderr, "%s is not a regular file, ignoring it.\n", - result_tmp); + g_warning(_("%s is not a regular file, ignoring it"), result_tmp); } else { data->count ++; if (data->result == NULL) { @@ -349,15 +440,14 @@ static char * file_number_to_file_name(VfsDevice * self, guint device_file) { char * regex; fnfn_data data; - g_return_val_if_fail(self != NULL, NULL); data.self = self; data.count = 0; data.result = NULL; regex = g_strdup_printf("^0*%u\\.", device_file); - search_directory(self->dir_handle, regex, - file_number_to_file_name_functor, &data); + search_vfs_directory(self, regex, + file_number_to_file_name_functor, &data); amfree(regex); @@ -365,8 +455,7 @@ static char * file_number_to_file_name(VfsDevice * self, guint device_file) { g_assert(data.result == NULL); return NULL; } else if (data.count > 1) { - g_fprintf(stderr, - "Found multiple names for file number %d, choosing file %s.\n", + g_warning("Found multiple names for file number %d, choosing file %s", device_file, data.result); return data.result; } else { @@ -401,6 +490,7 @@ static gboolean open_lock(G_GNUC_UNUSED VfsDevice * self, /* int fd; char * name; + Device *d_self = DEVICE(self); if (file < 0) { if (self->volume_lock_name == NULL) { self->volume_lock_name = lockfile_name(self, 0); @@ -422,8 +512,9 @@ static gboolean open_lock(G_GNUC_UNUSED VfsDevice * self, fd = robust_open(name, O_CREAT | O_WRONLY, VFS_DEVICE_CREAT_MODE); if (fd < 0) { - g_fprintf(stderr, "Can't open lock file %s: %s\n", - name, strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Can't open lock file %s: %s"), name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } @@ -459,14 +550,12 @@ static gboolean update_volume_size_functor(const char * filename, char * full_filename; struct stat stat_buf; VfsDevice * self = user_data; - g_return_val_if_fail(IS_VFS_DEVICE(self), FALSE); - + full_filename = vstralloc(self->dir_name, "/", filename, NULL); if (stat(full_filename, &stat_buf) < 0) { /* Log it and keep going. */ - g_fprintf(stderr, "Couldn't stat file %s: %s\n", - full_filename, strerror(errno)); + g_warning(_("Couldn't stat file %s: %s"), full_filename, strerror(errno)); amfree(full_filename); return TRUE; } @@ -479,48 +568,26 @@ static gboolean update_volume_size_functor(const char * filename, static void update_volume_size(VfsDevice * self) { self->volume_bytes = 0; - search_directory(self->dir_handle, "^[0-9]+\\.", - update_volume_size_functor, self); + search_vfs_directory(self, "^[0-9]+\\.", + update_volume_size_functor, self); } -static gboolean -vfs_device_open_device (Device * pself, char * device_name) { +static void +vfs_device_open_device (Device * pself, char * device_name, char * device_type, char * device_node) { VfsDevice * self; - dumpfile_t * rval; - self = VFS_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (device_name != NULL, FALSE); + + pself->min_block_size = VFS_DEVICE_MIN_BLOCK_SIZE; + pself->max_block_size = VFS_DEVICE_MAX_BLOCK_SIZE; + pself->block_size = VFS_DEVICE_DEFAULT_BLOCK_SIZE; /* We don't have to free this ourselves; it will be freed by * vfs_device_finalize whether we succeed here or not. */ - self->dir_name = g_strconcat(device_name, "/data/", NULL); - if (!check_is_dir(self->dir_name, TRUE)) { - return FALSE; - } - - /* Next open the directory itself. */ - self->dir_handle = opendir(self->dir_name); - if (self->dir_handle == NULL) { - g_fprintf(stderr, "Couldn't open directory %s for reading: %s\n", - device_name, strerror(errno)); - return FALSE; - } - - if (!open_lock(self, -1, FALSE)) - return FALSE; - - /* Not an error if this fails. Note that we ignore the class hierarchy. - */ - rval = vfs_device_seek_file(pself, 0); - amfree(rval); + self->dir_name = g_strconcat(device_node, "/data/", NULL); if (parent_class->open_device) { - /* Will call vfs_device_read_label. */ - return (parent_class->open_device)(pself, device_name); - } else { - return TRUE; + parent_class->open_device(pself, device_name, device_type, device_node); } } @@ -528,10 +595,11 @@ vfs_device_open_device (Device * pself, char * device_name) { static gboolean delete_vfs_files_functor(const char * filename, gpointer user_data) { VfsDevice * self; + Device * d_self; char * path_name; self = VFS_DEVICE(user_data); - g_return_val_if_fail(self != NULL, FALSE); + d_self = DEVICE(self); /* Skip the volume lock. */ if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0) @@ -539,8 +607,7 @@ static gboolean delete_vfs_files_functor(const char * filename, path_name = vstralloc(self->dir_name, "/", filename, NULL); if (unlink(path_name) != 0) { - g_fprintf(stderr, "Error unlinking %s: %s\n", path_name, - strerror(errno)); + g_warning(_("Error unlinking %s: %s"), path_name, strerror(errno)); } amfree(path_name); return TRUE; @@ -548,14 +615,12 @@ static gboolean delete_vfs_files_functor(const char * filename, /* delete_vfs_files deletes all VfsDevice files in the directory except the volume lockfile. */ -static gboolean delete_vfs_files(VfsDevice * self) { +static void delete_vfs_files(VfsDevice * self) { g_assert(self != NULL); - g_assert(self->dir_handle != NULL); /* This function assumes that the volume is locked! */ - search_directory(self->dir_handle, VFS_DEVICE_FILE_REGEX, - delete_vfs_files_functor, self); - return TRUE; + search_vfs_directory(self, VFS_DEVICE_FILE_REGEX, + delete_vfs_files_functor, self); } /* This is a functor suitable for search_directory. It simply prints a @@ -564,16 +629,17 @@ static gboolean check_dir_empty_functor(const char * filename, gpointer user_data) { VfsDevice * self; char * path_name; + Device *d_self; self = VFS_DEVICE(user_data); - g_return_val_if_fail(self != NULL, FALSE); + d_self = DEVICE(self); if (strcmp(filename, VOLUME_LOCKFILE_NAME) == 0) return TRUE; path_name = vstralloc(self->dir_name, "/", filename, NULL); - g_fprintf(stderr, "Found spurious storage file %s\n", path_name); + g_warning(_("Found spurious storage file %s"), path_name); amfree(path_name); return TRUE; @@ -584,17 +650,21 @@ static gboolean write_amanda_header(VfsDevice * self, const dumpfile_t * header) { char * label_buffer; IoResult result; - - g_return_val_if_fail(header != NULL, FALSE); - g_return_val_if_fail(self != NULL, FALSE); + Device *d_self = DEVICE(self); + + g_assert(header != NULL); + label_buffer = build_header(header, VFS_DEVICE_LABEL_SIZE); if (strlen(label_buffer)+1 > VFS_DEVICE_LABEL_SIZE) { amfree(label_buffer); - g_fprintf(stderr, "Amanda header header won't fit on VFS device!\n"); + device_set_error(d_self, + stralloc(_("Amanda file header won't fit in a single block!")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } result = vfs_device_robust_write(self, label_buffer, VFS_DEVICE_LABEL_SIZE); + /* vfs_device_robust_write sets error status if necessary */ amfree(label_buffer); return (result == RESULT_SUCCESS); } @@ -605,17 +675,16 @@ static gboolean write_amanda_header(VfsDevice * self, static gboolean clear_and_prepare_label(VfsDevice * self, char * label, char * timestamp) { dumpfile_t * label_header; + Device *d_self = DEVICE(self); release_file(self); /* Delete any extant data, except our volume lock. */ - if (!delete_vfs_files(self)) { - return FALSE; - } + delete_vfs_files(self); /* Print warnings about any remaining files. */ - search_directory(self->dir_handle, VFS_DEVICE_FILE_REGEX, - check_dir_empty_functor, self); + search_vfs_directory(self, VFS_DEVICE_FILE_REGEX, + check_dir_empty_functor, self); self->file_name = g_strdup_printf("%s/00000.%s", self->dir_name, label); @@ -623,84 +692,132 @@ static gboolean clear_and_prepare_label(VfsDevice * self, char * label, O_CREAT | O_EXCL | O_WRONLY, VFS_DEVICE_CREAT_MODE); if (self->open_file_fd < 0) { - g_fprintf(stderr, "Can't open file %s: %s\n", self->file_name, - strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Can't open file %s: %s"), self->file_name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return FALSE; } label_header = make_tapestart_header(DEVICE(self), label, timestamp); - if (write_amanda_header(self, label_header)) { - amfree(label_header); - self->volume_bytes = VFS_DEVICE_LABEL_SIZE; - return TRUE; - } else { + if (!write_amanda_header(self, label_header)) { + /* write_amanda_header sets error status if necessary */ amfree(label_header); return FALSE; } + amfree(label_header); + self->volume_bytes = VFS_DEVICE_LABEL_SIZE; + return TRUE; } -static ReadLabelStatusFlags vfs_device_read_label(Device * dself) { +/* Just like search_directory, but returns -1 in the event of an error */ +static int +search_vfs_directory( + VfsDevice *self, + const char * regex, + SearchDirectoryFunctor functor, + gpointer user_data) +{ + Device *dself = DEVICE(self); + DIR *dir_handle; + int result = -1; + + dir_handle = opendir(self->dir_name); + if (dir_handle == NULL) { + device_set_error(dself, + vstrallocf(_("Couldn't open device %s (directory %s) for reading: %s"), + dself->device_name, self->dir_name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + goto error; + } + + /* TODO: is this the right moment to acquire a lock?? */ + + result = search_directory(dir_handle, regex, functor, user_data); + +error: + if (dir_handle) + closedir(dir_handle); + return result; +} + +static DeviceStatusFlags vfs_device_read_label(Device * dself) { dumpfile_t * amanda_header; VfsDevice * self; self = VFS_DEVICE(dself); - g_return_val_if_fail(self != NULL, ~READ_LABEL_STATUS_SUCCESS); + g_assert(self != NULL); + + if (!check_is_dir(dself, self->dir_name)) { + /* error message set by check_is_dir */ + return FALSE; + } + + amfree(dself->volume_label); + amfree(dself->volume_time); + amfree(dself->volume_header); - amanda_header = vfs_device_seek_file(dself, 0); + if (device_in_error(self)) return dself->status; + + amanda_header = dself->volume_header = vfs_device_seek_file(dself, 0); if (amanda_header == NULL) { /* This means an error occured getting locks or opening the header * file. */ - return (READ_LABEL_STATUS_DEVICE_ERROR | - READ_LABEL_STATUS_VOLUME_ERROR | - READ_LABEL_STATUS_VOLUME_UNLABELED); + device_set_error(dself, + stralloc("Error loading device header -- unlabeled volume?"), + DEVICE_STATUS_DEVICE_ERROR + | DEVICE_STATUS_VOLUME_ERROR + | DEVICE_STATUS_VOLUME_UNLABELED); + return dself->status; } if (amanda_header->type != F_TAPESTART) { /* This is an error, and should not happen. */ - g_fprintf(stderr, "Got a bad volume label\n"); + device_set_error(dself, + stralloc(_("Got a bad volume label")), + DEVICE_STATUS_VOLUME_ERROR); amfree(amanda_header); - return READ_LABEL_STATUS_VOLUME_ERROR; + return dself->status; } dself->volume_label = g_strdup(amanda_header->name); dself->volume_time = g_strdup(amanda_header->datestamp); - amfree(amanda_header); + /* dself->volume_header is already set */ + + device_set_error(dself, NULL, DEVICE_STATUS_SUCCESS); update_volume_size(self); - if (parent_class->read_label) { - return (parent_class->read_label)(dself); - } else { - return READ_LABEL_STATUS_SUCCESS; - } + return dself->status; } -static gboolean vfs_device_write_block(Device * pself, guint size, - gpointer data, gboolean last_block) { +static gboolean vfs_device_write_block(Device * pself, guint size, gpointer data) { VfsDevice * self = VFS_DEVICE(pself); IoResult result; - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(last_block || size >= (guint)self->block_size, FALSE); - g_return_val_if_fail(pself->in_file, FALSE); + + if (device_in_error(self)) return FALSE; + g_assert(self->open_file_fd >= 0); if (self->volume_limit > 0 && self->volume_bytes + size > self->volume_limit) { /* Simulate EOF. */ pself->is_eof = TRUE; + device_set_error(pself, + stralloc(_("No space left on device")), + DEVICE_STATUS_VOLUME_ERROR); return FALSE; } result = vfs_device_robust_write(self, data, size); - if (result == RESULT_SUCCESS) { - self->volume_bytes += size; - if (parent_class->write_block) { - (parent_class->write_block)(pself, size, data, last_block); - } - return TRUE; - } else { + if (result != RESULT_SUCCESS) { + /* vfs_device_robust_write set error status appropriately */ return FALSE; } + + self->volume_bytes += size; + pself->block ++; + + return TRUE; } static int @@ -710,25 +827,34 @@ vfs_device_read_block(Device * pself, gpointer data, int * size_req) { IoResult result; self = VFS_DEVICE(pself); - g_return_val_if_fail (self != NULL, -1); - if (data == NULL || *size_req < self->block_size) { + if (device_in_error(self)) return -1; + + if (data == NULL || (gsize)*size_req < pself->block_size) { /* Just a size query. */ - *size_req = self->block_size; + g_assert(pself->block_size < INT_MAX); + *size_req = (int)pself->block_size; return 0; } - size = self->block_size; + size = pself->block_size; result = vfs_device_robust_read(self, data, &size); switch (result) { case RESULT_SUCCESS: *size_req = size; + pself->block++; return size; case RESULT_NO_DATA: pself->is_eof = TRUE; pself->in_file = FALSE; + device_set_error(pself, + stralloc(_("EOF")), + DEVICE_STATUS_SUCCESS); return -1; default: + device_set_error(pself, + vstrallocf(_("Error reading from data file: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); return -1; } @@ -740,25 +866,53 @@ static gboolean vfs_device_start(Device * pself, char * timestamp) { VfsDevice * self; self = VFS_DEVICE(pself); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(parent_class->start != NULL, FALSE); - + + if (!check_is_dir(pself, self->dir_name)) { + /* error message set by check_is_dir */ + return FALSE; + } + + pself->in_file = FALSE; + if (mode == ACCESS_WRITE) { promote_volume_lock(self); if (!clear_and_prepare_label(self, label, timestamp)) { + /* clear_and_prepare_label sets error status if necessary */ demote_volume_lock(self); return FALSE; } + + pself->volume_label = newstralloc(pself->volume_label, label); + pself->volume_time = newstralloc(pself->volume_time, timestamp); + + /* unset the VOLUME_UNLABELED flag, if it was set */ + device_set_error(pself, NULL, DEVICE_STATUS_SUCCESS); + demote_volume_lock(self); + pself->access_mode = mode; + } else { + if (pself->volume_label == NULL && device_read_label(pself) != DEVICE_STATUS_SUCCESS) { + /* device_read_label already set our error message */ + return FALSE; + } else { + pself->access_mode = mode; + } } release_file(self); - if (parent_class->start) { - return parent_class->start(pself, mode, label, timestamp); - } else { - return TRUE; - } + return TRUE; +} + +static gboolean +vfs_device_finish (Device * pself) { + VfsDevice * self; + self = VFS_DEVICE(pself); + + if (device_in_error(self)) return FALSE; + + pself->access_mode = ACCESS_NULL; + return TRUE; } typedef struct { @@ -771,11 +925,10 @@ static gboolean get_last_file_number_functor(const char * filename, gpointer datap) { guint64 file; glfn_data * data = (glfn_data*)datap; - g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE); + file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ if (file > G_MAXINT) { - g_fprintf(stderr, "Super-large device file %s found, ignoring.\n", - filename); + g_warning(_("Super-large device file %s found, ignoring"), filename); return TRUE; } /* This condition is needlessly complex due to sign issues. */ @@ -788,15 +941,18 @@ static gboolean get_last_file_number_functor(const char * filename, static gint get_last_file_number(VfsDevice * self) { glfn_data data; int count; + Device *d_self = DEVICE(self); data.self = self; data.rval = -1; - count = search_directory(self->dir_handle, "^[0-9]+\\.", - get_last_file_number_functor, &data); + count = search_vfs_directory(self, "^[0-9]+\\.", + get_last_file_number_functor, &data); if (count <= 0) { /* Somebody deleted something important while we weren't looking. */ - g_fprintf(stderr, "Error identifying VFS device contents!\n"); + device_set_error(d_self, + stralloc(_("Error identifying VFS device contents!")), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } else { g_assert(data.rval >= 0); @@ -816,11 +972,10 @@ static gboolean get_next_file_number_functor(const char * filename, gpointer datap) { guint file; gnfn_data * data = (gnfn_data*)datap; - g_return_val_if_fail(IS_VFS_DEVICE(data->self), FALSE); + file = g_ascii_strtoull(filename, NULL, 10); /* Guaranteed to work. */ if (file > G_MAXINT) { - g_fprintf(stderr, "Super-large device file %s found, ignoring.\n", - filename); + g_warning(_("Super-large device file %s found, ignoring"), filename); return TRUE; } /* This condition is needlessly complex due to sign issues. */ @@ -836,16 +991,19 @@ static gboolean get_next_file_number_functor(const char * filename, static gint get_next_file_number(VfsDevice * self, guint request) { gnfn_data data; int count; + Device *d_self = DEVICE(self); data.self = self; data.request = request; data.best_found = -1; - count = search_directory(self->dir_handle, "^[0-9]+\\.", - get_next_file_number_functor, &data); + count = search_vfs_directory(self, "^[0-9]+\\.", + get_next_file_number_functor, &data); if (count <= 0) { /* Somebody deleted something important while we weren't looking. */ - g_fprintf(stderr, "Error identifying VFS device contents!\n"); + device_set_error(d_self, + stralloc(_("Error identifying VFS device contents!")), + DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR); return -1; } @@ -885,16 +1043,21 @@ char * make_new_file_name(VfsDevice * self, const dumpfile_t * ji) { } static gboolean -vfs_device_start_file (Device * pself, const dumpfile_t * ji) { +vfs_device_start_file (Device * pself, dumpfile_t * ji) { VfsDevice * self; - self = VFS_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (ji != NULL, FALSE); + + if (device_in_error(self)) return FALSE; + + /* set the blocksize in the header to 32k, since the VFS header is always + * 32k regardless of the block_size setting */ + ji->blocksize = 32768; if (self->volume_limit > 0 && self->volume_bytes + VFS_DEVICE_LABEL_SIZE > self->volume_limit) { - /* No more room. */ + device_set_error(pself, + stralloc(_("No space left on device")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; } @@ -906,32 +1069,37 @@ vfs_device_start_file (Device * pself, const dumpfile_t * ji) { 5) Chain up. */ self->file_name = make_new_file_name(self, ji); - if (self->file_name == NULL) + if (self->file_name == NULL) { + device_set_error(pself, + stralloc(_("Could not create header filename")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; + } self->open_file_fd = robust_open(self->file_name, O_CREAT | O_EXCL | O_RDWR, VFS_DEVICE_CREAT_MODE); if (self->open_file_fd < 0) { - g_fprintf(stderr, "Can't create file %s: %s\n", self->file_name, - strerror(errno)); + device_set_error(pself, + vstrallocf(_("Can't create file %s: %s"), self->file_name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); release_file(self); return FALSE; } if (!write_amanda_header(self, ji)) { + /* write_amanda_header sets error status if necessary */ release_file(self); return FALSE; } + /* handle some accounting business */ self->volume_bytes += VFS_DEVICE_LABEL_SIZE; - /* make_new_file_name set pself->file for us, but the parent class will increment it, so decrement it now */ - pself->file--; + pself->in_file = TRUE; + pself->block = 0; + /* make_new_file_name set pself->file for us */ - if (parent_class->start_file) { - parent_class->start_file(pself, ji); - } return TRUE; } @@ -939,16 +1107,13 @@ static gboolean vfs_device_finish_file (Device * pself) { VfsDevice * self; self = VFS_DEVICE(pself); - g_return_val_if_fail(self != NULL, FALSE); + + if (device_in_error(self)) return FALSE; release_file(self); - - if (parent_class->finish_file) { - return parent_class->finish_file(pself); - } else { - return TRUE; - } - g_assert_not_reached(); + + pself->in_file = FALSE; + return TRUE; } /* This function is used for two purposes, rather than one. In @@ -965,9 +1130,12 @@ vfs_device_seek_file (Device * pself, guint requested_file) { IoResult result; self = VFS_DEVICE(pself); - g_return_val_if_fail (self != NULL, NULL); + + if (device_in_error(self)) return NULL; pself->in_file = FALSE; + pself->is_eof = FALSE; + pself->block = 0; release_file(self); @@ -983,26 +1151,37 @@ vfs_device_seek_file (Device * pself, guint requested_file) { tmp_file_name = file_number_to_file_name(self, requested_file - 1); if (tmp_file_name != NULL) { free(tmp_file_name); + pself->file = requested_file; /* other attributes are already correct */ return make_tapeend_header(); } else { + device_set_error(pself, + stralloc(_("Attempt to read past tape-end file")), + DEVICE_STATUS_SUCCESS); return NULL; } } if (!open_lock(self, file, FALSE)) { + device_set_error(pself, + stralloc(_("could not acquire lock")), + DEVICE_STATUS_DEVICE_ERROR); return NULL; } self->file_name = file_number_to_file_name(self, file); if (self->file_name == NULL) { + device_set_error(pself, + vstrallocf(_("File %d not found"), file), + DEVICE_STATUS_VOLUME_ERROR); release_file(self); return NULL; } self->open_file_fd = robust_open(self->file_name, O_RDONLY, 0); - if (self->open_file_fd <= 0) { - g_fprintf(stderr, "Couldn't open file %s: %s\n", self->file_name, - strerror(errno)); + if (self->open_file_fd < 0) { + device_set_error(pself, + vstrallocf(_("Couldn't open file %s: %s"), self->file_name, strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); amfree(self->file_name); release_file(self); return NULL; @@ -1011,34 +1190,42 @@ vfs_device_seek_file (Device * pself, guint requested_file) { result = vfs_device_robust_read(self, header_buffer, &header_buffer_size); if (result != RESULT_SUCCESS) { - g_fprintf(stderr, "Problem reading Amanda header.\n"); + device_set_error(pself, + vstrallocf(_("Problem reading Amanda header: %s"), device_error(pself)), + DEVICE_STATUS_VOLUME_ERROR); release_file(self); return NULL; } - rval = malloc(sizeof(*rval)); + rval = g_new(dumpfile_t, 1); parse_file_header(header_buffer, rval, header_buffer_size); - if (file > 0) { - switch (rval->type) { + switch (rval->type) { case F_DUMPFILE: case F_CONT_DUMPFILE: case F_SPLIT_DUMPFILE: - /* Chain up. */ - if (parent_class->seek_file) { - parent_class->seek_file(pself, file); - } - return rval; + break; + + case F_TAPESTART: + /* file 0 should have a TAPESTART header; vfs_device_read_label + * uses this */ + if (requested_file == 0) + break; + /* FALLTHROUGH */ + default: + device_set_error(pself, + stralloc(_("Invalid amanda header while reading file header")), + DEVICE_STATUS_VOLUME_ERROR); amfree(rval); release_file(self); return NULL; - } - } else if (file == 0) { - return rval; - } else { - amfree(rval); - return NULL; } + + /* update our state */ + pself->in_file = TRUE; + pself->file = file; + + return rval; } static gboolean @@ -1047,89 +1234,30 @@ vfs_device_seek_block (Device * pself, guint64 block) { off_t result; self = VFS_DEVICE(pself); - g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (self->open_file_fd >= 0, FALSE); + + g_assert(self->open_file_fd >= 0); g_assert(sizeof(off_t) >= sizeof(guint64)); + if (device_in_error(self)) return FALSE; /* Pretty simple. We figure out the blocksize and use that. */ result = lseek(self->open_file_fd, - (block) * self->block_size + VFS_DEVICE_LABEL_SIZE, + (block) * pself->block_size + VFS_DEVICE_LABEL_SIZE, SEEK_SET); - return (result != (off_t)(-1)); -} -static gboolean -vfs_device_property_get (Device * pself, DevicePropertyId ID, GValue * val) { - VfsDevice * self; - self = VFS_DEVICE(pself); - g_return_val_if_fail(self != NULL, FALSE); - if (ID == PROPERTY_BLOCK_SIZE) { - g_value_unset_init(val, G_TYPE_INT); - g_value_set_int(val, self->block_size); - return TRUE; - } else if (ID == PROPERTY_MAX_VOLUME_USAGE) { - g_value_unset_init(val, G_TYPE_UINT64); - g_value_set_uint64(val, self->volume_limit); - return TRUE; - } else if (ID == PROPERTY_FREE_SPACE) { - QualifiedSize qsize; - struct fs_usage fsusage; - guint64 bytes_avail; - - if (get_fs_usage(self->dir_name, NULL, &fsusage) == 0) { - if (fsusage.fsu_bavail_top_bit_set) - bytes_avail = 0; - else - bytes_avail = fsusage.fsu_bavail * fsusage.fsu_blocksize; - if (self->volume_limit && (guint64)self->volume_limit < bytes_avail / 1024) - bytes_avail = (guint64)self->volume_limit * 1024; - - qsize.accuracy = SIZE_ACCURACY_REAL; - qsize.bytes = bytes_avail; - } else { - g_warning(_("get_fs_usage('%s') failed: %s"), self->dir_name, strerror(errno)); - qsize.accuracy = SIZE_ACCURACY_UNKNOWN; - qsize.bytes = 0; - } - g_value_unset_init(val, QUALIFIED_SIZE_TYPE); - g_value_set_boxed(val, &qsize); - return TRUE; - } else { - if (parent_class->property_get) { - return parent_class->property_get(pself, ID, val); - } else { - return FALSE; - } - } - g_assert_not_reached(); -} + pself->block = block; -static gboolean -vfs_device_property_set (Device * pself, DevicePropertyId ID, GValue * val) { - VfsDevice * self; - self = VFS_DEVICE(pself); - g_return_val_if_fail(self != NULL, FALSE); - if (ID == PROPERTY_BLOCK_SIZE) { - int block_size = g_value_get_int(val); - g_return_val_if_fail(block_size > 0, FALSE); - self->block_size = block_size; - return TRUE; - } else if (ID == PROPERTY_MAX_VOLUME_USAGE) { - self->volume_limit = g_value_get_uint64(val); - return TRUE; - } else { - if (parent_class->property_set) { - return parent_class->property_set(pself, ID, val); - } else { - return FALSE; - } + if (result == (off_t)(-1)) { + device_set_error(pself, + vstrallocf(_("Error seeking within file: %s"), strerror(errno)), + DEVICE_STATUS_DEVICE_ERROR); + return FALSE; } - g_assert_not_reached(); + + return TRUE; } static gboolean try_unlink(const char * file) { if (unlink(file) < 0) { - g_fprintf(stderr, "Can't unlink file %s: %s\n", file, strerror(errno)); return FALSE; } else { return TRUE; @@ -1143,8 +1271,8 @@ vfs_device_recycle_file (Device * pself, guint filenum) { off_t file_size; self = VFS_DEVICE(pself); - g_return_val_if_fail(self != NULL, FALSE); - g_return_val_if_fail(!(pself->in_file), FALSE); + + if (device_in_error(self)) return FALSE; /* Game Plan: * 1) Get a write lock on the file in question. @@ -1155,22 +1283,41 @@ vfs_device_recycle_file (Device * pself, guint filenum) { */ self->file_name = file_number_to_file_name(self, filenum); - - if (self->file_name == NULL) + if (self->file_name == NULL) { + device_set_error(pself, + vstrallocf(_("File %d not found"), filenum), + DEVICE_STATUS_VOLUME_ERROR); return FALSE; + } - if (!open_lock(self, filenum, TRUE)) + if (!open_lock(self, filenum, FALSE)) { + device_set_error(pself, + stralloc(_("could not acquire lock")), + DEVICE_STATUS_DEVICE_ERROR); return FALSE; + } if (0 != stat(self->file_name, &file_status)) { - fprintf(stderr, "Cannot stat file %s (%s), so not removing.\n", - self->file_name, strerror(errno)); + device_set_error(pself, + vstrallocf(_("Cannot stat file %s (%s), so not removing"), + self->file_name, strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); return FALSE; } file_size = file_status.st_size; - if (!try_unlink(self->file_name) || - !try_unlink(self->file_lock_name)) { + if (!try_unlink(self->file_name)) { + device_set_error(pself, + vstrallocf(_("Unlink of %s failed: %s"), self->file_name, strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); + release_file(self); + return FALSE; + } + + if (!try_unlink(self->file_lock_name)) { + device_set_error(pself, + vstrallocf(_("Unlink of %s failed: %s"), self->file_lock_name, strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); release_file(self); return FALSE; } @@ -1183,6 +1330,7 @@ vfs_device_recycle_file (Device * pself, guint filenum) { static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, int *count) { int fd = self->open_file_fd; + Device *d_self = DEVICE(self); int want = *count, got = 0; while (got < want) { @@ -1213,9 +1361,11 @@ static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, continue; } else { /* Error occured. */ - g_fprintf(stderr, "Error reading fd %d: %s\n", fd, strerror(errno)); + device_set_error(d_self, + vstrallocf(_("Error reading fd %d: %s"), fd, strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); *count = got; - return -1; + return RESULT_ERROR; } } @@ -1226,6 +1376,7 @@ static IoResult vfs_device_robust_read(VfsDevice * self, char *buf, static IoResult vfs_device_robust_write(VfsDevice * self, char *buf, int count) { int fd = self->open_file_fd; + Device *d_self = DEVICE(self); int rval = 0; while (rval < count) { @@ -1256,12 +1407,15 @@ vfs_device_robust_write(VfsDevice * self, char *buf, int count) { #endif ) { /* We are definitely out of space. */ + device_set_error(d_self, + vstrallocf(_("No space left on device: %s"), strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); return RESULT_NO_SPACE; } else { /* Error occured. Note that here we handle EIO as an error. */ - g_fprintf(stderr, "Error writing device fd %d: %s\n", - fd, strerror(errno)); - + device_set_error(d_self, + vstrallocf(_("Error writing device fd %d: %s"), fd, strerror(errno)), + DEVICE_STATUS_VOLUME_ERROR); return RESULT_ERROR; } } diff --git a/device-src/vfs-device.h b/device-src/vfs-device.h deleted file mode 100644 index 6b5796f..0000000 --- a/device-src/vfs-device.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - */ - -/* The VFS device is the driver formerly known as the vtape driver or - * the file driver. It uses a directory on the UNIX filesystem as a - * data store. */ - -#include -#include -#include "device.h" -#include - -#ifndef VFS_DEVICE_H -#define VFS_DEVICE_H - -#define VFS_DEVICE_MIN_BLOCK_SIZE (1) -#define VFS_DEVICE_MAX_BLOCK_SIZE (INT_MAX) -#define VFS_DEVICE_DEFAULT_BLOCK_SIZE (MAX_TAPE_BLOCK_BYTES) -#define VFS_DEVICE_LABEL_SIZE (32768) - -/* This looks dangerous, but is actually modified by the umask. */ -#define VFS_DEVICE_CREAT_MODE 0666 - -/* - * Type checking and casting macros - */ -#define TYPE_VFS_DEVICE (vfs_device_get_type()) -#define VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice) -#define VFS_DEVICE_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), vfs_device_get_type(), VfsDevice const) -#define VFS_DEVICE_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), vfs_device_get_type(), VfsDeviceClass) -#define IS_VFS_DEVICE(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), vfs_device_get_type ()) - -#define VFS_DEVICE_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), vfs_device_get_type(), VfsDeviceClass) - -/* - * Main object structure - */ -typedef struct { - Device __parent__; - - /*< private >*/ - DIR * dir_handle; - char * dir_name; - char * file_name; - int file_lock_fd; - char * file_lock_name; - int volume_lock_fd; - char * volume_lock_name; - int open_file_fd; - - /* Properties */ - int block_size; - guint64 volume_bytes; - guint64 volume_limit; -} VfsDevice; - -/* - * Class definition - */ -typedef struct { - DeviceClass __parent__; -} VfsDeviceClass; - - -/* - * Public methods - */ -GType vfs_device_get_type (void); -void vfs_device_register (void); - -#endif - diff --git a/device-src/vfs-test.c b/device-src/vfs-test.c new file mode 100644 index 0000000..1a0c436 --- /dev/null +++ b/device-src/vfs-test.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +#include "glib-util.h" +#include "amanda.h" +#include "device.h" +#include "conffile.h" +#include "testutils.h" + +/* Global state set up for the tests */ +static char *device_path = NULL; + +/* + * Utilities + */ + +static void +cleanup_vtape_dir(char *device_path) +{ + char *quoted = g_shell_quote(device_path); + char *cmd = vstralloc("rm -rf ", quoted, NULL); + + /* would you rather write 'rm -rf' here? */ + if (system(cmd) == -1) { + exit(1); + } + + amfree(cmd); + amfree(quoted); +} + +static char * +setup_vtape_dir(void) +{ + char *cwd = g_get_current_dir(); + char *device_path = NULL; + char *data_dir = NULL; + + device_path = vstralloc(cwd, "/vfs-test-XXXXXX", NULL); + amfree(cwd); + + if (mkdtemp(device_path) == NULL) { + fprintf(stderr, "Could not create temporary directory in %s\n", cwd); + return NULL; + } + + /* append "/data/" to that for the VFS device*/ + data_dir = vstralloc(device_path, "/data/", NULL); + if (mkdir(data_dir, 0777) == -1) { + fprintf(stderr, "Could not create %s: %s\n", cwd, strerror(errno)); + amfree(data_dir); + return NULL; + } + + amfree(data_dir); + return device_path; +} + +static Device * +setup_device(void) +{ + Device *device; + char *device_name = NULL; + + device_name = vstralloc("file:", device_path, NULL); + device = device_open(device_name); + if (device->status != DEVICE_STATUS_SUCCESS) { + g_critical("Could not open device %s: %s\n", device_name, device_error(device)); + } + + amfree(device_name); + return device; +} + +/* + * Tests + */ + +static int +test_vfs_free_space(void) +{ + Device *device = NULL; + GValue value; + QualifiedSize qsize; + + device = setup_device(); + if (!device) + return FALSE; + + bzero(&value, sizeof(value)); + if (!device_property_get(device, PROPERTY_FREE_SPACE, &value)) { + g_debug("Could not get property_free_space\n"); + return FALSE; + } + + qsize = *(QualifiedSize*)g_value_get_boxed(&value); + g_value_unset(&value); + + if (qsize.accuracy != SIZE_ACCURACY_REAL) { + g_debug("property_free_space accuracy is not SIZE_ACCURACY_REAL\n"); + return FALSE; + } + + if (qsize.bytes == 0) { + g_debug("property_free_space returned bytes=0\n"); + return FALSE; + } + + g_object_unref(device); + + return TRUE; +} + +/* + * Main driver + */ + +int +main(int argc, char **argv) +{ + int result; + static TestUtilsTest tests[] = { + TU_TEST(test_vfs_free_space, 5), + TU_END() + }; + + glib_init(); + config_init(0, NULL); + device_api_init(); + + /* TODO: if more tests are added, we'll need a setup/cleanup hook + * for testutils */ + device_path = setup_vtape_dir(); + + result = testutils_run_tests(argc, argv, tests); + + cleanup_vtape_dir(device_path); + amfree(device_path); + + return result; +} diff --git a/dumper-src/Makefile.am b/dumper-src/Makefile.am deleted file mode 100644 index ed1aef9..0000000 --- a/dumper-src/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# Makefile for Amanda wrapper programs. - -include $(top_srcdir)/config/automake/vars.am -include $(top_srcdir)/config/automake/scripts.am -include $(top_srcdir)/config/automake/installperms.am -include $(top_srcdir)/config/automake/precompile.am - -INCLUDES = -I$(top_builddir)/common-src \ - -I$(top_srcdir)/common-src - -AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) -AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) - -SCRIPTS_PERL = \ - amgtar - -SCRIPTS_INCLUDE = \ - generic-dumper -EXTRA_DIST += generic-dumper.pl - -CHECK_PERL = $(SCRIPTS_PERL) $(SCRIPTS_INCLUDE) - -dumperdir = $(DUMPER_DIR) -dumper_SCRIPTS = $(SCRIPTS_PERL) -dumper_DATA = $(SCRIPTS_INCLUDE) - -INSTALLPERMS_data = dest=$(dumperdir) chown=amanda $(dumper_SCRIPTS) diff --git a/dumper-src/Makefile.in b/dumper-src/Makefile.in deleted file mode 100644 index bd21ff1..0000000 --- a/dumper-src/Makefile.in +++ /dev/null @@ -1,1088 +0,0 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Makefile for Amanda wrapper programs. - -# vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License version 2.1 as -# published by the Free Software Foundation. -# -# This library 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 Lesser General Public -# License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this library; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -# -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - -# simple include file to pre-define variables which are then +='d by other -# scripts in this directory. - -# vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License version 2.1 as -# published by the Free Software Foundation. -# -# This library 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 Lesser General Public -# License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this library; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -# -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - -# SYNOPSIS: -# -# Automake magic to handle the various tasks of building scripts. Scripts can -# be built down to extensionless executables (e.g., foo.pl -> foo), or to -# files with the usual extension (foo-lib.sh.in -> foo.sh). -# -# Files which support it are syntax-checked when the user invokes 'make check'. -# -# All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. -# -# USAGE: -# -# include $(top_srcdir)/config/automake/vars.am -# include $(top_srcdir)/config/automake/scripts.am -# ... -# SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm -# SCRIPTS_SHELL = shell1 shell2 sh-lib.sh -# SCRIPTS_AWK = talk balk chalk awk-lib.awk -# -# with the corresponding files in the repository: -# -# fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in -# shell1.sh shell2.sh sh-lib.sh.in -# talk.awk balk.awk chalk.awk awk-lib.awk.in -# -# by default, all shell and perl scripts are syntax checked. If this is -# a problem (for example, perl scripts depending on Amanda extension -# modules), then assign to CHECK_{PERL,SHELL} the list of files you wish -# to be checked (which can be empty). -# -# To add extra flags to the perl checks (e.g., to add new -I flags), set -# CHECK_PERL_FLAGS. - -# Implementation note: -# -# This file uses config.status to substitute @foo@ in those scripts while -# converting them. It also adds the executable bits (a+x) to extensionless -# files. The substitution works even though the files are not listed in -# configure.in - -# vim:ft=automake -# -# Adjust post-install permissions settings. This rule works off two -# specially-formatted variables, INSTALLPERMS_exec and INSTALLPERMS_data. -# Each is a whitespace-separated list of commands, all of which are either -# a variable assignment or a filename. Three variables are available: -# -# - dest= sets the destination directory to e.g., $(sbindir) -# - chown= controls changes in ownership; value is first argument to chown -# - chmod= controls changes in permissions; value is first argument to chmod -# -# As a special case, chown=amanda is taken as equivalent to -# chown=$(BINARY_OWNER):$(SETUID_GROUP), which may otherwise have problems with -# whitespace in the user/group names. -# -# when a filename is seen, the currently active variables are applied. -# -# Note that scripts are data, not executables! -# -# EXAMPLE -# -# sbin_PROGRAMS = foo bar bing -# libexec_PROGRAMS = pro gram -# sbin_SCRIPTS = sk ript -# INSTALLPERMS_exec = \ -# dest=$(sbindir) chown=amanda chmod= \ -# foo bar \ -# chmod=u+s,o-rwx \ -# bing -# dest=$(libexecdir) chmod= \ -# $(libexec_PROGRAMS) -# INSTALLPERMS_data = \ -# dest=$(sbindir) chown=amanda chmod= \ -# $(sbin_SCRIPTS) -# -# This whole operation is not required when making builds for packaging, -# and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. - -# vim:ft=automake - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/config/automake/installperms.am \ - $(top_srcdir)/config/automake/precompile.am \ - $(top_srcdir)/config/automake/scripts.am \ - $(top_srcdir)/config/automake/vars.am -subdir = dumper-src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = \ - $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ - $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ - $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ - $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ - $(top_srcdir)/config/macro-archive/docbook-dtd.m4 \ - $(top_srcdir)/config/macro-archive/docbook-xslt-min.m4 \ - $(top_srcdir)/config/macro-archive/docbook-xslt.m4 \ - $(top_srcdir)/config/macro-archive/xsltproc.m4 \ - $(top_srcdir)/config/amanda/amplot.m4 \ - $(top_srcdir)/config/amanda/bsd-security.m4 \ - $(top_srcdir)/config/amanda/bsdtcp-security.m4 \ - $(top_srcdir)/config/amanda/bsdudp-security.m4 \ - $(top_srcdir)/config/amanda/changer.m4 \ - $(top_srcdir)/config/amanda/components.m4 \ - $(top_srcdir)/config/amanda/compress.m4 \ - $(top_srcdir)/config/amanda/config.m4 \ - $(top_srcdir)/config/amanda/debugging.m4 \ - $(top_srcdir)/config/amanda/defaults.m4 \ - $(top_srcdir)/config/amanda/devprefix.m4 \ - $(top_srcdir)/config/amanda/dirs.m4 \ - $(top_srcdir)/config/amanda/documentation.m4 \ - $(top_srcdir)/config/amanda/dumpers.m4 \ - $(top_srcdir)/config/amanda/flags.m4 \ - $(top_srcdir)/config/amanda/flock.m4 \ - $(top_srcdir)/config/amanda/funcs.m4 \ - $(top_srcdir)/config/amanda/getfsent.m4 \ - $(top_srcdir)/config/amanda/i18n.m4 \ - $(top_srcdir)/config/amanda/ipv6.m4 \ - $(top_srcdir)/config/amanda/krb4-security.m4 \ - $(top_srcdir)/config/amanda/krb5-security.m4 \ - $(top_srcdir)/config/amanda/lfs.m4 \ - $(top_srcdir)/config/amanda/libs.m4 \ - $(top_srcdir)/config/amanda/net.m4 \ - $(top_srcdir)/config/amanda/progs.m4 \ - $(top_srcdir)/config/amanda/readdir.m4 \ - $(top_srcdir)/config/amanda/readline.m4 \ - $(top_srcdir)/config/amanda/rsh-security.m4 \ - $(top_srcdir)/config/amanda/s3-device.m4 \ - $(top_srcdir)/config/amanda/shmem.m4 \ - $(top_srcdir)/config/amanda/socklen_t_equiv.m4 \ - $(top_srcdir)/config/amanda/ssh-security.m4 \ - $(top_srcdir)/config/amanda/summary.m4 \ - $(top_srcdir)/config/amanda/swig.m4 \ - $(top_srcdir)/config/amanda/syshacks.m4 \ - $(top_srcdir)/config/amanda/tape.m4 \ - $(top_srcdir)/config/amanda/types.m4 \ - $(top_srcdir)/config/amanda/userid.m4 \ - $(top_srcdir)/config/amanda/version.m4 \ - $(top_srcdir)/config/gnulib/alloca.m4 \ - $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \ - $(top_srcdir)/config/gnulib/base64.m4 \ - $(top_srcdir)/config/gnulib/eoverflow.m4 \ - $(top_srcdir)/config/gnulib/extensions.m4 \ - $(top_srcdir)/config/gnulib/float_h.m4 \ - $(top_srcdir)/config/gnulib/fsusage.m4 \ - $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ - $(top_srcdir)/config/gnulib/gettimeofday.m4 \ - $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ - $(top_srcdir)/config/gnulib/include_next.m4 \ - $(top_srcdir)/config/gnulib/inet_ntop.m4 \ - $(top_srcdir)/config/gnulib/intmax_t.m4 \ - $(top_srcdir)/config/gnulib/lock.m4 \ - $(top_srcdir)/config/gnulib/longlong.m4 \ - $(top_srcdir)/config/gnulib/malloc.m4 \ - $(top_srcdir)/config/gnulib/mkdtemp.m4 \ - $(top_srcdir)/config/gnulib/netinet_in_h.m4 \ - $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \ - $(top_srcdir)/config/gnulib/physmem.m4 \ - $(top_srcdir)/config/gnulib/safe-read.m4 \ - $(top_srcdir)/config/gnulib/safe-write.m4 \ - $(top_srcdir)/config/gnulib/snprintf.m4 \ - $(top_srcdir)/config/gnulib/socklen.m4 \ - $(top_srcdir)/config/gnulib/sockpfaf.m4 \ - $(top_srcdir)/config/gnulib/ssize_t.m4 \ - $(top_srcdir)/config/gnulib/stdbool.m4 \ - $(top_srcdir)/config/gnulib/stdint.m4 \ - $(top_srcdir)/config/gnulib/stdio_h.m4 \ - $(top_srcdir)/config/gnulib/stdlib_h.m4 \ - $(top_srcdir)/config/gnulib/strdup.m4 \ - $(top_srcdir)/config/gnulib/string_h.m4 \ - $(top_srcdir)/config/gnulib/sys_socket_h.m4 \ - $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ - $(top_srcdir)/config/gnulib/sys_time_h.m4 \ - $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ - $(top_srcdir)/config/gnulib/unistd_h.m4 \ - $(top_srcdir)/config/gnulib/vasnprintf.m4 \ - $(top_srcdir)/config/gnulib/visibility.m4 \ - $(top_srcdir)/config/gnulib/wchar.m4 \ - $(top_srcdir)/config/gettext-macros/gettext.m4 \ - $(top_srcdir)/config/gettext-macros/iconv.m4 \ - $(top_srcdir)/config/gettext-macros/inttypes_h.m4 \ - $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ - $(top_srcdir)/config/gettext-macros/lib-link.m4 \ - $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ - $(top_srcdir)/config/gettext-macros/nls.m4 \ - $(top_srcdir)/config/gettext-macros/po.m4 \ - $(top_srcdir)/config/gettext-macros/progtest.m4 \ - $(top_srcdir)/config/gettext-macros/size_max.m4 \ - $(top_srcdir)/config/gettext-macros/stdint_h.m4 \ - $(top_srcdir)/config/gettext-macros/wchar_t.m4 \ - $(top_srcdir)/config/gettext-macros/wint_t.m4 \ - $(top_srcdir)/config/gettext-macros/xsize.m4 \ - $(top_srcdir)/config/libtool.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config/config.h -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(dumperdir)" "$(DESTDIR)$(dumperdir)" -dumperSCRIPT_INSTALL = $(INSTALL_SCRIPT) -SCRIPTS = $(dumper_SCRIPTS) -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -dumperDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dumper_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -ALLOCA_H = @ALLOCA_H@ -AMANDA_DBGDIR = @AMANDA_DBGDIR@ -AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@ -AMANDA_STATIC_LDFLAGS = @AMANDA_STATIC_LDFLAGS@ -AMANDA_TMPDIR = @AMANDA_TMPDIR@ -AMANDA_WARNING_CFLAGS = @AMANDA_WARNING_CFLAGS@ -AMLINT = @AMLINT@ -AMLINTFLAGS = @AMLINTFLAGS@ -AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@ -AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ -AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ -AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ -AMTAR = @AMTAR@ -AR = @AR@ -ARPA_INET_H = @ARPA_INET_H@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASH = @BASH@ -BINARY_OWNER = @BINARY_OWNER@ -BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ -BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ -BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ -BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ -BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ -CAT = @CAT@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ -CHIO = @CHIO@ -CHS = @CHS@ -CLIENT_LOGIN = @CLIENT_LOGIN@ -CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ -COMPRESS = @COMPRESS@ -CONFIG_DIR = @CONFIG_DIR@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CURL_CONFIG = @CURL_CONFIG@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DD = @DD@ -DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ -DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ -DEFAULT_CONFIG = @DEFAULT_CONFIG@ -DEFAULT_SERVER = @DEFAULT_SERVER@ -DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ -DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOC_BUILD_DATE = @DOC_BUILD_DATE@ -DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EOVERFLOW = @EOVERFLOW@ -EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLOAT_H = @FLOAT_H@ -GETCONF = @GETCONF@ -GETTEXT = @GETTEXT@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_MKENUMS = @GLIB_MKENUMS@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ -GNULIB_CHOWN = @GNULIB_CHOWN@ -GNULIB_DUP2 = @GNULIB_DUP2@ -GNULIB_FCHDIR = @GNULIB_FCHDIR@ -GNULIB_FFLUSH = @GNULIB_FFLUSH@ -GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ -GNULIB_FSEEK = @GNULIB_FSEEK@ -GNULIB_FSEEKO = @GNULIB_FSEEKO@ -GNULIB_FTELL = @GNULIB_FTELL@ -GNULIB_FTELLO = @GNULIB_FTELLO@ -GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ -GNULIB_GETCWD = @GNULIB_GETCWD@ -GNULIB_GETDELIM = @GNULIB_GETDELIM@ -GNULIB_GETLINE = @GNULIB_GETLINE@ -GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ -GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ -GNULIB_LCHOWN = @GNULIB_LCHOWN@ -GNULIB_LSEEK = @GNULIB_LSEEK@ -GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ -GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@ -GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@ -GNULIB_MBSCHR = @GNULIB_MBSCHR@ -GNULIB_MBSCSPN = @GNULIB_MBSCSPN@ -GNULIB_MBSLEN = @GNULIB_MBSLEN@ -GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@ -GNULIB_MBSNLEN = @GNULIB_MBSNLEN@ -GNULIB_MBSPBRK = @GNULIB_MBSPBRK@ -GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@ -GNULIB_MBSRCHR = @GNULIB_MBSRCHR@ -GNULIB_MBSSEP = @GNULIB_MBSSEP@ -GNULIB_MBSSPN = @GNULIB_MBSSPN@ -GNULIB_MBSSTR = @GNULIB_MBSSTR@ -GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ -GNULIB_MEMMEM = @GNULIB_MEMMEM@ -GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ -GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ -GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ -GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ -GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ -GNULIB_READLINK = @GNULIB_READLINK@ -GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ -GNULIB_SLEEP = @GNULIB_SLEEP@ -GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ -GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ -GNULIB_STPCPY = @GNULIB_STPCPY@ -GNULIB_STPNCPY = @GNULIB_STPNCPY@ -GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ -GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ -GNULIB_STRDUP = @GNULIB_STRDUP@ -GNULIB_STRNDUP = @GNULIB_STRNDUP@ -GNULIB_STRNLEN = @GNULIB_STRNLEN@ -GNULIB_STRPBRK = @GNULIB_STRPBRK@ -GNULIB_STRSEP = @GNULIB_STRSEP@ -GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ -GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ -GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ -GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ -GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ -GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ -GNULIB_WCWIDTH = @GNULIB_WCWIDTH@ -GNUPLOT = @GNUPLOT@ -GNUTAR = @GNUTAR@ -GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@ -GOBJECT_QUERY = @GOBJECT_QUERY@ -GREP = @GREP@ -GZIP = @GZIP@ -HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ -HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ -HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ -HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ -HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@ -HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ -HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ -HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ -HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ -HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ -HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ -HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ -HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ -HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ -HAVE_DUP2 = @HAVE_DUP2@ -HAVE_FSEEKO = @HAVE_FSEEKO@ -HAVE_FTELLO = @HAVE_FTELLO@ -HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ -HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ -HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ -HAVE_IO_H = @HAVE_IO_H@ -HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ -HAVE_LSTAT = @HAVE_LSTAT@ -HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ -HAVE_MEMPCPY = @HAVE_MEMPCPY@ -HAVE_MKDTEMP = @HAVE_MKDTEMP@ -HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ -HAVE_READLINK = @HAVE_READLINK@ -HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ -HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ -HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ -HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ -HAVE_SLEEP = @HAVE_SLEEP@ -HAVE_STDINT_H = @HAVE_STDINT_H@ -HAVE_STPCPY = @HAVE_STPCPY@ -HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ -HAVE_STRCASESTR = @HAVE_STRCASESTR@ -HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ -HAVE_STRNDUP = @HAVE_STRNDUP@ -HAVE_STRPBRK = @HAVE_STRPBRK@ -HAVE_STRSEP = @HAVE_STRSEP@ -HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ -HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ -HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ -HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ -HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ -HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ -HAVE_UNISTD_H = @HAVE_UNISTD_H@ -HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ -HAVE_VASPRINTF = @HAVE_VASPRINTF@ -HAVE_VISIBILITY = @HAVE_VISIBILITY@ -HAVE_WCHAR_H = @HAVE_WCHAR_H@ -HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@ -HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ -HAVE__BOOL = @HAVE__BOOL@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBCURL = @LIBCURL@ -LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -MAILER = @MAILER@ -MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ -MCUTIL = @MCUTIL@ -MKDIR_P = @MKDIR_P@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -MT = @MT@ -MTX = @MTX@ -MT_FILE_FLAG = @MT_FILE_FLAG@ -NETINET_IN_H = @NETINET_IN_H@ -NEXT_FLOAT_H = @NEXT_FLOAT_H@ -NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@ -NEXT_STDINT_H = @NEXT_STDINT_H@ -NEXT_STDIO_H = @NEXT_STDIO_H@ -NEXT_STDLIB_H = @NEXT_STDLIB_H@ -NEXT_STRING_H = @NEXT_STRING_H@ -NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ -NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ -NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ -NEXT_UNISTD_H = @NEXT_UNISTD_H@ -NEXT_WCHAR_H = @NEXT_WCHAR_H@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCAT = @PCAT@ -PERL = @PERL@ -PERLEXTLIBS = @PERLEXTLIBS@ -PERL_INC = @PERL_INC@ -PKG_CONFIG = @PKG_CONFIG@ -POSUB = @POSUB@ -PRINT = @PRINT@ -PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -REPLACE_CHOWN = @REPLACE_CHOWN@ -REPLACE_FCHDIR = @REPLACE_FCHDIR@ -REPLACE_FFLUSH = @REPLACE_FFLUSH@ -REPLACE_FPRINTF = @REPLACE_FPRINTF@ -REPLACE_FSEEK = @REPLACE_FSEEK@ -REPLACE_FSEEKO = @REPLACE_FSEEKO@ -REPLACE_FTELL = @REPLACE_FTELL@ -REPLACE_FTELLO = @REPLACE_FTELLO@ -REPLACE_GETCWD = @REPLACE_GETCWD@ -REPLACE_GETLINE = @REPLACE_GETLINE@ -REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ -REPLACE_LCHOWN = @REPLACE_LCHOWN@ -REPLACE_LSEEK = @REPLACE_LSEEK@ -REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ -REPLACE_PRINTF = @REPLACE_PRINTF@ -REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ -REPLACE_SPRINTF = @REPLACE_SPRINTF@ -REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ -REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ -REPLACE_VPRINTF = @REPLACE_VPRINTF@ -REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ -REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ -REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ -RESTORE = @RESTORE@ -SAMBA_CLIENT = @SAMBA_CLIENT@ -SERVICE_SUFFIX = @SERVICE_SUFFIX@ -SETUID_GROUP = @SETUID_GROUP@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ -SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ -SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ -SORT = @SORT@ -SSH = @SSH@ -STDBOOL_H = @STDBOOL_H@ -STDINT_H = @STDINT_H@ -STRIP = @STRIP@ -SVN = @SVN@ -SWIG = @SWIG@ -SWIG_LIB = @SWIG_LIB@ -SYS_SOCKET_H = @SYS_SOCKET_H@ -SYS_STAT_H = @SYS_STAT_H@ -SYS_TIME_H = @SYS_TIME_H@ -USE_NLS = @USE_NLS@ -USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ -VDUMP = @VDUMP@ -VERSION = @VERSION@ -VERSION_COMMENT = @VERSION_COMMENT@ -VERSION_MAJOR = @VERSION_MAJOR@ -VERSION_MINOR = @VERSION_MINOR@ -VERSION_PATCH = @VERSION_PATCH@ -VERSION_SUFFIX = @VERSION_SUFFIX@ -VRESTORE = @VRESTORE@ -VXDUMP = @VXDUMP@ -VXRESTORE = @VXRESTORE@ -WCHAR_H = @WCHAR_H@ -WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@ -WINT_T_SUFFIX = @WINT_T_SUFFIX@ -XFSDUMP = @XFSDUMP@ -XFSRESTORE = @XFSRESTORE@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XSLREL = @XSLREL@ -XSLTPROC = @XSLTPROC@ -XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -_libcurl_config = @_libcurl_config@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -amincludedir = @amincludedir@ -amlibdir = @amlibdir@ -amlibexecdir = @amlibexecdir@ -amperldir = @amperldir@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUFFIXES = -EXTRA_DIST = generic-dumper.pl -BUILT_SOURCES = -MOSTLYCLEANFILES = - -# config.status leaves config.log files around -CLEANFILES = config.log - -# and we'll need to clean up our generated files for distclean -DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) -MAINTAINERCLEANFILES = - -# syntax-check shell scripts on 'make check' -CHECK_SHELL = $(SCRIPTS_SHELL) - -# sed expression to strip leading directories from a filename; this converts e.g., -# src/foo/bar.so to bar.so. -strip_leading_dirs = s|^.*/|| -INCLUDES = -I$(top_builddir)/common-src \ - -I$(top_srcdir)/common-src - -AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) -AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -SCRIPTS_PERL = \ - amgtar - -SCRIPTS_INCLUDE = \ - generic-dumper - -CHECK_PERL = $(SCRIPTS_PERL) $(SCRIPTS_INCLUDE) -dumperdir = $(DUMPER_DIR) -dumper_SCRIPTS = $(SCRIPTS_PERL) -dumper_DATA = $(SCRIPTS_INCLUDE) -INSTALLPERMS_data = dest=$(dumperdir) chown=amanda $(dumper_SCRIPTS) -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/scripts.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dumper-src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu dumper-src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-dumperSCRIPTS: $(dumper_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(dumperdir)" || $(MKDIR_P) "$(DESTDIR)$(dumperdir)" - @list='$(dumper_SCRIPTS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(dumperSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(dumperdir)/$$f'"; \ - $(dumperSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(dumperdir)/$$f"; \ - else :; fi; \ - done - -uninstall-dumperSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dumper_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f '$(DESTDIR)$(dumperdir)/$$f'"; \ - rm -f "$(DESTDIR)$(dumperdir)/$$f"; \ - done - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-dumperDATA: $(dumper_DATA) - @$(NORMAL_INSTALL) - test -z "$(dumperdir)" || $(MKDIR_P) "$(DESTDIR)$(dumperdir)" - @list='$(dumper_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dumperDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(dumperdir)/$$f'"; \ - $(dumperDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dumperdir)/$$f"; \ - done - -uninstall-dumperDATA: - @$(NORMAL_UNINSTALL) - @list='$(dumper_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(dumperdir)/$$f'"; \ - rm -f "$(DESTDIR)$(dumperdir)/$$f"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(SCRIPTS) $(DATA) -installdirs: - for dir in "$(DESTDIR)$(dumperdir)" "$(DESTDIR)$(dumperdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-dumperDATA install-dumperSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook - -install-dvi: install-dvi-am - -install-exec-am: - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-dumperDATA uninstall-dumperSCRIPTS - -.MAKE: install-am install-data-am install-exec-am install-strip - -.PHONY: all all-am check check-am check-local clean clean-generic \ - clean-libtool dist-hook distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ - install-data-hook install-dumperDATA install-dumperSCRIPTS \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-exec-hook install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dumperDATA uninstall-dumperSCRIPTS - - -# Perl -%: %.pl $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - chmod a+x $@ - -%.pl: %.pl.in $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - -%.pm: %.pm.in $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - -# Shell -%: %.sh $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - chmod a+x $@ - -%.sh: %.sh.in $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - -# Awk -%: %.awk $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - chmod a+x $@ - -%.awk: %.awk.in $(top_builddir)/config.status - $(top_builddir)/config.status --file=$@:$< - -# syntax-check perl scripts on 'make check' -check-perl: $(CHECK_PERL) - @CHECK_PERL="$(CHECK_PERL)"; \ - if test -n "$(PERL)"; then \ - for perlobj in $$CHECK_PERL; do \ - $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ - done; \ - fi -check-local: check-perl -check-shell: $(CHECK_SHELL) - @CHECK_SHELL="$(CHECK_SHELL)"; \ - if test -n "$$CHECK_SHELL"; then \ - if test -n "$(BASH)"; then \ - for shobj in $$CHECK_SHELL; do \ - if $(BASH) -n $$shobj; then \ - echo "$$shobj syntax OK"; \ - else \ - echo "$$shobj syntax error"; \ - exit 1; \ - fi; \ - done; \ - else \ - echo "No 'bash' available -- cannot syntax-check shell scripts"; \ - fi; \ - fi -check-local: check-shell - -# make sure that the sources for all shell and perl scripts get included -# in the distribution -dist-scripts: - SCRIPTS_PERL="$(SCRIPTS_PERL)"; SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; SCRIPTS_AWK="$(SCRIPTS_AWK)"; \ - for script in $$SCRIPTS_PERL; do \ - test -f $(srcdir)/$${script}.pl && { cp -p $(srcdir)/$${script}.pl $(distdir)/ || exit 1; } \ - done; \ - for script in $$SCRIPTS_SHELL; do \ - test -f $(srcdir)/$${script}.sh && { cp -p $(srcdir)/$${script}.sh $(distdir)/ || exit 1; } \ - done; \ - for script in $$SCRIPTS_AWK; do \ - test -f $(srcdir)/$${script}.awk && { cp -p $(srcdir)/$${script}.awk $(distdir)/ || exit 1; } \ - done; \ - for script in $$SCRIPTS_SHELL $$SCRIPTS_PERL $$SCRIPTS_AWK; do \ - test -f $(srcdir)/$${script}.in && { cp -p $(srcdir)/$${script}.in $(distdir)/ || exit 1; } \ - done; \ - true -dist-hook: dist-scripts - -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data - -# A rule to make precompiler output from C files. This is not used during -# ordinary builds, but but can very useful in debugging problems on strange -# architectures. With this rule, we can ask users to 'make foo.i' and send -# the result to us. -# -# It touches some automake internals ($COMPILE), but since it's not -# build-critical, that's OK. -%.i : %.c - $(COMPILE) -E -o $@ $< -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/dumper-src/amgtar.pl b/dumper-src/amgtar.pl deleted file mode 100644 index 8fe9024..0000000 --- a/dumper-src/amgtar.pl +++ /dev/null @@ -1,326 +0,0 @@ -#!@PERL@ -T -# - -# Run perl. -eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}' - & eval 'exec @PERL@ -S $0 $argv:q' - if 0; - -delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'}; -$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin"; - -$debug=1; -push(@INC, ".", "@DUMPER_DIR@"); - -use File::Copy; -use IPC::Open3; -use Sys::Hostname; - - -open(DEBUG,">>@AMANDA_DBGDIR@/amgtar.$$.debug") if ($debug==1); - -$prefix='@prefix@'; -$prefix = $prefix; -$exec_prefix="@exec_prefix@"; -$exec_prefix=$exec_prefix; -$amlibexecdir="@amlibexecdir@"; -$amlibexecdir=$amlibexecdir; - -$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@'; -$suf = ''; -if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) { - $suf='-@VERSION@'; -} - -$myhost = hostname; -$myhost =~ s/\..*$//; -$runtar="${amlibexecdir}/runtar${suf}"; -$gnulist = '@GNUTAR_LISTED_INCREMENTAL_DIR@'; -$gnutar = '@GNUTAR@'; - - - -$max_level = 9; -$index_line = 1; -$index_xml = 0; -$message_line = 1; -$message_xml = 0; -$record = 1; -$include_file = 1; -$include_list = 1; -$exclude_file = 1; -$exclude_list = 1; -$collection = 0; - -#$user_support = ""; -#$group_support = ""; - -#$user_selfcheck = ""; -#$group_selfcheck = ""; - -#$user_estimate = ""; -#$group_estimate = ""; - -#$user_estimate_parse = ""; -#$group_estimate_parse = ""; - -$user_backup = "root"; -#$group_backup = ""; - -#$user_backup_parse = ""; -#$group_backup_parse = ""; - -#$user_index_from_output = ""; -#$group_index_from_output = ""; - -#$user_index_from_image = ""; -#$group_index_from_image = ""; - -#$user_restore = ""; -#$group_restore = ""; - -#$user_print_command = ""; -#$group_print_command = ""; - -$user_default = "amanda"; -$group_default = "amanda"; - - -sub command_support { - my($config, $host, $disk, $device, $level) = @_; - print "CONFIG YES\n"; - print DEBUG "STDOUT: CONFIG YES\n" if ($debug == 1); - print "HOST YES\n"; - print DEBUG "STDOUT: HOST YES\n" if ($debug == 1); - print "DISK YES\n"; - print DEBUG "STDOUT: DISK YES\n" if ($debug == 1); - print "MAX-LEVEL 9\n"; - print DEBUG "STDOUT: MAX-LEVEL 9\n" if ($debug == 1); - print "INDEX-LINE YES\n"; - print DEBUG "STDOUT: INDEX-LINE YES\n" if ($debug == 1); - print "INDEX-XML NO\n"; - print DEBUG "STDOUT: INDEX-XML NO\n" if ($debug == 1); - print "MESSAGE-LINE YES\n"; - print DEBUG "STDOUT: MESSAGE-LINE YES\n" if ($debug == 1); - print "MESSAGE-XML NO\n"; - print DEBUG "STDOUT: MESSAGE-XML NO\n" if ($debug == 1); - print "RECORD YES\n"; - print DEBUG "STDOUT: RECORD YES\n" if ($debug == 1); - print "INCLUDE-FILE YES\n"; - print "INCLUDE-LIST YES\n"; - print "EXCLUDE-FILE YES\n"; - print "EXCLUDE-LIST YES\n"; - print "COLLECTION NO\n"; -} - -sub command_selfcheck { - my($config, $host, $disk, $device, $level) = @_; - print DEBUG "STDOUT: OK $disk\n" if ($debug == 1); - print DEBUG "STDOUT: OK $device\n" if ($debug == 1); - print "OK $disk\n"; - print "OK $device\n"; - #check binary - #check statefile - #check amdevice - #check property include/exclude -} - -sub command_estimate { - my($config, $host, $disk, $device, $level) = @_; - my($listdir) = "$host$disk"; - $listdir =~ s/\//_/g; - if($level == 0) { - open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die(); - close(GNULIST) || die(); - } - else { - my($prev_level) = $level - 1; - if (-f "${gnulist}/${listdir}_${prev_level}") { - copy("${gnulist}/${listdir}_${prev_level}", "${gnulist}/${listdir}_${level}.new"); - } else { - open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die(); - close(GNULIST) || die(); - #print "ERROR file ${gnulist}/${listdir}_${level}.new doesn't exist\n"; - } - } - command_estimate_opt_direct($config, $host, $disk, $device, $level, $listdir); -} - - -sub command_estimate_opt_direct { - my($config, $host, $disk, $device, $level, $listdir) = @_; - my($size) = -1; - my(@cmd) = ($runtar, $config, $gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", "."); - #my(@cmd) = ($gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", "."); - print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1); - open3(\*WTRFH, '>&STDOUT', \*ESTIMATE, @cmd); - - $size = parse_estimate(ESTIMATE); - close(ESTIMATE); - output_size($size); - unlink "${gnulist}/${listdir}_${level}.new"; - exit 0; -} - -sub parse_estimate { - my($fh) = @_; - my($size) = -1; - while(<$fh>) { -print DEBUG "READ 2: $_" if ($debug == 1); - if ($_ =~ /^Total bytes written: (\d*)/) { - $size = $1; - last; - } - } - return $size; -} - -sub output_size { - my($size) = @_; - if($size == -1) { - print DEBUG "STDOUT A: -1 -1\n" if ($debug == 1); - print "-1 -1\n"; - exit 2; - } - else { - my($ksize) = int $size / (1024); - $ksize=32 if ($ksize<32); - print DEBUG "STDOUT B: $ksize 1\n" if ($debug == 1); - print "$ksize 1\n"; - } -} - -sub command_backup { - my($config, $host, $disk, $device, $level) = @_; - my($listdir) = "$host$disk"; - my($verbose) = ""; - $listdir =~ s/\//_/g; - -print DEBUG "config =" . $config . "\n" if ($debug == 1); -print DEBUG "host =" . $host . "\n" if ($debug == 1); -print DEBUG "disk =" . $disk . "\n" if ($debug == 1); -print DEBUG "device =" . $device . "\n" if ($debug == 1); -print DEBUG "level =" . $level . "\n" if ($debug == 1); - - if($level == 0) { - open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die(); - close(GNULIST) || die(); - } - else { - my($prev_level) = $level - 1; - copy("${gnulist}/${listdir}_${prev_level}", - "${gnulist}/${listdir}_${level}.new"); - } - - if(defined($opt_index)) { - $verbose = "--verbose"; - } - my(@cmd) = ($runtar, $config, $gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", "."); - #my(@cmd) = ($gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", "."); - - print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1); - - open3(\*WTRFH, '>&STDOUT', \*INDEX, @cmd) || die(); - - if(defined($opt_index)) { - open(INDEXOUT, '>&=3') || die(); - parse_backup(INDEX, STDERR, INDEXOUT); - close(INDEXOUT); - } - else { - parse_backup(INDEX, STDERR, undef); - } - close(INDEX); - close(WTRFH); - - if(defined($opt_record)) { - rename "${gnulist}/${listdir}_${level}.new", - "${gnulist}/${listdir}_${level}"; - } - else { - unlink "${gnulist}/${listdir}_${level}.new"; - } - exit 0; -} - -sub parse_backup { - my($fhin, $fhout, $indexout) = @_; - my($size) = -1; - while(<$fhin>) { -print DEBUG "READ 3: $_" if ($debug == 1); - if ( /^\.\//) { - if(defined($indexout)) { - if(defined($opt_index)) { - s/^\.//; -print DEBUG "INDEXOUT: $_" if ($debug == 1); - print $indexout $_; - } - } - } - else { - if (/^Total bytes written: (\d*)/) { - $size = $1; - $ksize = int ($size / 1024); - } - elsif(defined($fhout)) { - next if /: Directory is new$/; -print DEBUG "FHOUT 2: $_" if ($debug == 1); - print $fhout $_; - } - } - } - if(defined($fhout)) { - if ($size == -1) { -print DEBUG "FHOUT 4: $command -1 -1\n" if ($debug == 1); - print $fhout "$command -1 -1\n"; - } - else { - my($ksize) = int ($size/1024); -print DEBUG "FHOUT 5: sendbackup: size $ksize\n" if ($debug == 1); - print $fhout "sendbackup: size $ksize\n"; -print DEBUG "FHOUT 5: sendbackup: end\n" if ($debug == 1); - print $fhout "sendbackup: end\n"; - } - } -} - -sub command_index_from_output { - index_from_output(STDIN, STDOUT); - exit 0; -} - -sub index_from_output { - my($fhin, $fhout) = @_; - my($size) = -1; - while(<$fhin>) { -print DEBUG "READ 4: $_" if ($debug == 1); - next if /^Total bytes written:/; - next if !/^\.\//; - s/^\.//; -print DEBUG "FHOUT 6: $_" if ($debug == 1); - print $fhout $_; - } -} - -sub command_index_from_image { - my($config, $host, $disk, $device, $level) = @_; - open(INDEX, "$gnutar --list --file - |") || die(); - index_from_output(INDEX, STDOUT); -} - -sub command_restore { - my($config, $host, $disk, $device, $level) = @_; - -# $ARGV[0] = undef; - my(@cmd) = ($gnutar, "--numeric-owner", "-xpGvf", "-"); - for($i=1;defined $ARGV[$i]; $i++) { - push @cmd, $ARGV[$i]; - } - print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1); - exec @cmd; -} - -sub command_print_command { -} - -require "generic-dumper" diff --git a/dumper-src/generic-dumper.pl b/dumper-src/generic-dumper.pl deleted file mode 100644 index f1fc6d3..0000000 --- a/dumper-src/generic-dumper.pl +++ /dev/null @@ -1,273 +0,0 @@ -require "newgetopt.pl"; -use Text::ParseWords; - -print DEBUG "FHOUT 6: ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[7]=" . $ARGV[7] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[8]=" . $ARGV[8] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: ARGV[9]=" . $ARGV[9] . "\n" if ($debug == 1); - -$result = &NGetOpt ("config=s", "host=s", "disk=s", "device=s", "level=s", "index=s", "message=s", "collection", "record"); -$result = $result; - -print DEBUG "FHOUT 6: config =" . $opt_config . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: disk =" . $opt_disk . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: host =" . $opt_host . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: device =" . $opt_device . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: level =" . $opt_level . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: index =" . $opt_index . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: message =" . $opt_message. "\n" if ($debug == 1); -print DEBUG "FHOUT 6: collection=" . $opt_collection. "\n" if ($debug == 1); -print DEBUG "FHOUT 6: record =" . $opt_record . "\n" if ($debug == 1); - -print DEBUG "FHOUT 6: A-ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1); -print DEBUG "FHOUT 6: A-ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1); - -if (defined $opt_config) { - $opt_config =~ /^([\_\.A-Za-z0-9]*)$/; - $opt_config = $1; -} - -if (defined $opt_host) { - $opt_host =~ /^([\_\.A-Za-z0-9]*)$/; - $opt_host = $1; -} - -if (defined $opt_disk) { - $opt_disk =~ /^([\/\_\:\.A-Za-z0-9]*)$/; - $opt_disk = $1; -} - -if (defined $opt_device) { - $opt_device =~ /^([\/\_\:\.A-Za-z0-9]*)$/; - $opt_device = $1; -} - -if (defined $opt_level) { - $opt_level =~ /^(\d)$/; - $opt_level = $1; -} - -# Read tool property - -$command = $ARGV[0]; - -%property = (); -while($property_line = ) { - chomp $property_line; - ($prop_name, $prop_value) = shellwords($property_line); - push @{$property{$prop_name}}, $prop_value; - print DEBUG "$prop_name = $prop_value\n" if ($debug == 1); -} - -if ($debug == 1) { - foreach $prop_name (keys(%property)) { - print DEBUG "PROPERTY: $prop_name\n"; - print DEBUG " VALUE: ", join(',',@{$property{$prop_name}}) , "\n"; - } -} - -sub wrapper_support(); -sub wrapper_selfcheck(); -sub wrapper_estimate(); -sub wrapper_backup(); -sub wrapper_restore(); - -if ($command eq "support") { - wrapper_support(); -} -elsif ($command eq "selfcheck") { - wrapper_selfcheck(); -} -elsif ($command eq "estimate") { - wrapper_estimate(); -} -elsif ($command eq "backup") { - wrapper_backup(); -} -elsif ($command eq "restore") { - wrapper_restore(); -} -else { - printf STDERR "Unknown command `$command'.\n"; - exit 1; -} - - -sub wrapper_support() { - if(defined(&command_support)) { - command_support($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - exit 0; - } - print "LEVEL 0-", $max_level , "\n" if defined($max_level); - print "INDEX-LINE YES\n" if defined($index_line) && $index_line == 1; - print "INDEX-XML NO\n" if defined($index_xml) && $index_xml == 1; - print "MESSAGE-LINE YES\n" if defined($message_line) && $message_line == 1; - print "MESSAGE-XML NO\n" if defined($message_xml) && $message_xml == 1; - print "RECORD YES\n" if defined($record) && $record == 1; - print "INCLUDE-FILE NO\n" if defined($include_file) && $include_file == 1; - print "INCLUDE-LIST NO\n" if defined($include_list) && $include_list == 1; - print "EXCLUDE-FILE NO\n" if defined($exclude_file) && $exclude_file == 1; - print "EXCLUDE-LIST NO\n" if defined($exclude_list) && $exclude_list == 1; - print "COLLECTION NO\n" if defined($collection) && $collection == 1; - exit 1; -} - -sub wrapper_selfcheck() { - if(defined(&command_selfcheck)) { - command_selfcheck($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - exit 1; - } -} - -sub wrapper_estimate() { - if(defined(&command_estimate)) { - command_estimate($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } else { - exit 1; - } -} - -sub wrapper_estimate_parse() { - if(defined(&command_estimate_parse)) { - command_estimate_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - printf STDERR "`estimate-parse' is not supported.\n"; - exit 1; - } -} - -sub wrapper_backup() { - if(defined(&command_backup)) { - command_backup($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } else { -print DEBUG "wrapper_backup: !defined(command_backup)\n" if ($debug == 1); - exit 1; - } -} - -sub wrapper_backup_parse() { - if(defined(&command_backup_parse)) { - command_backup_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - printf STDERR "`backup-parse' is not supported.\n"; - exit 1; - } -} - -sub wrapper_index_from_output() { - if(defined(&command_index_from_output)) { - command_index_from_output($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - printf STDERR "`index-from-output' is not supported.\n"; - exit 1; - } -} - -sub wrapper_index_from_image() { - if(defined(&command_index_from_image)) { - command_index_from_image($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - printf STDERR "command `index-from-image' is not supported.\n"; - exit 1; - } -} - -sub wrapper_restore() { - if(defined(&command_restore)) { - command_restore($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level); - } - else { - printf STDERR "`restore' is not supported.\n"; - exit 1; - } -} - -sub parse_options() { - my($no_option) = @_; - my($options, @options, $option, $name, $option_name, $value); - - while($no_option <= $#ARGV) { - $options = $ARGV[${no_option}]; - @options = split (/;/,$options); - foreach $option (@options) { - if( $option =~ /=/ ) { - ($name,$value) = split(/=/,$option); - } - else { - $name = $option; - $value = 1; - } - $option_name = "option_$name"; - $option_name =~ s/\-/\_/g; - $$option_name = $value; - } - $no_option++; - } -} - -sub check_file { - my($filename, $mode) = @_; - - stat($filename); - - if($mode eq "e") { - if( -e _ ) { - print "OK $filename exists\n"; - } - else { - print "ERROR [can not find $filename]\n"; - } - } - elsif($mode eq "x") { - if( -x _ ) { - print "OK $filename executable\n"; - } - else { - print "ERROR [can not execute $filename]\n"; - } - } - elsif($mode eq "r") { - if( -r _ ) { - print "OK $filename readable\n"; - } - else { - print "ERROR [can not read $filename]\n"; - } - } - elsif($mode eq "w") { - if( -w _ ) { - print "OK $filename writable\n"; - } - else { - print "ERROR [can not write $filename]\n"; - } - } - else { - print "ERROR [check_file: unknow mode $mode]\n"; - } -} - -sub check_dir { -} - -sub check_suid { -} - -1; diff --git a/example/Makefile.am b/example/Makefile.am index 824aead..6e51c9a 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1,13 +1,14 @@ # Makefile for sample configuration files +include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am -amanda_dir = $(localstatedir)/lib/amanda +amanda_dir = $(amdatadir) templatedir = $(amanda_dir)/template.d exampledir = $(amanda_dir)/example lbltempldir = $(amanda_dir)/example/label-templates -EXTRA_DIST = chg-multi.conf \ +EXTRA_DIST += chg-multi.conf \ chg-scsi.conf \ config.site \ disklist \ @@ -26,6 +27,7 @@ dist_template_DATA = template.d/advanced.conf \ dist_example_DATA = amanda.conf \ amanda-client.conf \ inetd.conf.amandaclient \ + inetd.conf.amandaserver \ xinetd.amandaclient \ xinetd.amandaserver diff --git a/example/Makefile.in b/example/Makefile.in index f866f46..57f13b1 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,28 @@ # Makefile for sample configuration files +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two @@ -43,7 +65,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -53,7 +75,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -78,11 +108,18 @@ DIST_COMMON = $(dist_example_DATA) $(dist_lbltempl_DATA) \ $(dist_template_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/amanda-client.conf.in \ $(srcdir)/amanda.conf.in $(srcdir)/chg-mcutil.conf.in \ - $(top_srcdir)/config/automake/installperms.am + $(srcdir)/inetd.conf.amandaclient.in \ + $(srcdir)/inetd.conf.amandaserver.in \ + $(srcdir)/xinetd.amandaclient.in \ + $(srcdir)/xinetd.amandaserver.in \ + $(top_srcdir)/config/automake/installperms.am \ + $(top_srcdir)/config/automake/vars.am +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) subdir = example ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -116,6 +153,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -138,7 +176,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -166,7 +206,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -177,7 +216,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -191,7 +229,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config/config.h -CONFIG_CLEAN_FILES = amanda-client.conf amanda.conf chg-mcutil.conf +CONFIG_CLEAN_FILES = amanda-client.conf amanda.conf \ + xinetd.amandaclient xinetd.amandaserver \ + inetd.conf.amandaclient inetd.conf.amandaserver \ + chg-mcutil.conf SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -209,6 +250,7 @@ DATA = $(dist_example_DATA) $(dist_lbltempl_DATA) \ $(dist_template_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -223,8 +265,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -236,16 +280,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -259,6 +315,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -266,7 +323,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -279,6 +336,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -289,9 +347,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -301,6 +362,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -325,8 +387,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -335,11 +399,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -353,6 +421,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -361,9 +430,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -371,7 +441,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -380,8 +452,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -389,7 +463,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -398,10 +471,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -417,6 +492,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -433,6 +510,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -441,7 +520,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -477,26 +555,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -504,7 +593,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -514,6 +607,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -523,7 +617,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -532,6 +633,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -560,6 +662,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -578,6 +681,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -607,22 +712,44 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = chg-multi.conf chg-scsi.conf config.site disklist \ + chg-mcutil.conf +BUILT_SOURCES = +MOSTLYCLEANFILES = +CLEANFILES = +DISTCLEANFILES = $(am__append_1) +MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| -amanda_dir = $(localstatedir)/lib/amanda +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" +amanda_dir = $(amdatadir) templatedir = $(amanda_dir)/template.d exampledir = $(amanda_dir)/example lbltempldir = $(amanda_dir)/example/label-templates -EXTRA_DIST = chg-multi.conf \ - chg-scsi.conf \ - config.site \ - disklist \ - chg-mcutil.conf - dist_template_DATA = template.d/advanced.conf \ template.d/amanda-harddisk.conf \ template.d/amanda-single-tape.conf \ @@ -636,6 +763,7 @@ dist_template_DATA = template.d/advanced.conf \ dist_example_DATA = amanda.conf \ amanda-client.conf \ inetd.conf.amandaclient \ + inetd.conf.amandaserver \ xinetd.amandaclient \ xinetd.amandaserver @@ -652,10 +780,12 @@ INSTALLPERMS_data = chown=amanda \ dest=$(exampledir) $(dist_example_DATA) \ dest=$(libtempldir) $(dist_libtempl_DATA) -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -688,6 +818,14 @@ amanda-client.conf: $(top_builddir)/config.status $(srcdir)/amanda-client.conf.i cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ amanda.conf: $(top_builddir)/config.status $(srcdir)/amanda.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +xinetd.amandaclient: $(top_builddir)/config.status $(srcdir)/xinetd.amandaclient.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +xinetd.amandaserver: $(top_builddir)/config.status $(srcdir)/xinetd.amandaserver.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +inetd.conf.amandaclient: $(top_builddir)/config.status $(srcdir)/inetd.conf.amandaclient.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +inetd.conf.amandaserver: $(top_builddir)/config.status $(srcdir)/inetd.conf.amandaserver.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ chg-mcutil.conf: $(top_builddir)/config.status $(srcdir)/chg-mcutil.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ @@ -781,13 +919,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(lbltempldir)" "$(DESTDIR)$(templatedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -802,17 +942,20 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am @@ -891,52 +1034,40 @@ uninstall-am: uninstall-dist_exampleDATA uninstall-dist_lbltemplDATA \ uninstall-dist_lbltemplDATA uninstall-dist_templateDATA -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/example/amanda-client.conf b/example/amanda-client.conf index 2179acb..6cee640 100644 --- a/example/amanda-client.conf +++ b/example/amanda-client.conf @@ -6,9 +6,9 @@ conf "DailySet1" # your config name -index_server "kdc.localdomain" # your amindexd server -tape_server "kdc.localdomain" # your amidxtaped server -#tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device +index_server "localhost.localdomain" # your amindexd server +tape_server "localhost.localdomain" # your amidxtaped server +tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device # if not set, Use configure or ask server. # if set to empty string "", ask server # amrecover will use the changer if set to the value diff --git a/example/amanda-client.conf.in b/example/amanda-client.conf.in index 10e859d..a6577aa 100644 --- a/example/amanda-client.conf.in +++ b/example/amanda-client.conf.in @@ -8,7 +8,7 @@ conf "@DEFAULT_CONFIG@" # your config name index_server "@DEFAULT_SERVER@" # your amindexd server tape_server "@DEFAULT_TAPE_SERVER@" # your amidxtaped server -#tapedev "@EXAMPLE_TAPEDEV@" # your tape device +tapedev "@EXAMPLE_TAPEDEV@" # your tape device # if not set, Use configure or ask server. # if set to empty string "", ask server # amrecover will use the changer if set to the value diff --git a/example/amanda.conf b/example/amanda.conf index 61316b5..db0066c 100644 --- a/example/amanda.conf +++ b/example/amanda.conf @@ -251,11 +251,7 @@ indexdir "/etc/amanda/DailySet1/index" # index directory # are, and how fast the tape device is. # A filemark is the amount of wasted space every time a tape section -# ends. If you run `make tapetype' in tape-src, you'll get a program -# that generates tapetype entries, but it is slow as hell, use it only -# if you really must and, if you do, make sure you post the data to -# the amanda mailing list, so that others can use what you found out -# by searching the archives. +# ends. # For completeness Amanda should calculate the inter-record gaps too, # but it doesn't. For EXABYTE and DAT tapes this is ok. Anyone using @@ -725,6 +721,47 @@ define interface local { # use 400 kbps #} +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" + #default from gnutar_list_dir setting in amanda-client.conf +} + +define dumptype dt_amgtar { + program "APPLICATION" + application "app_amgtar" +} + +#define application-tool and dumptype for the amstar application +define application-tool app_amstar { + comment "amstar" + plugin "amstar" + #property "STAR-PATH" "/path/to/star" + #property "STAR-TARDUMP" "/path/to/tardumps" # default /etc/tardumps + #property "STAR-DLE-TARDUMP" "no" + # if 'yes' then create a different tardump file for each DLE, + # it is required if you do many dump in parallel (maxdump>1) +} + +define dumptype dt_amstar { + program "APPLICATION" + application "app_amstar" +} + +#define a script-tool to send an email +define script-tool sc-email { + comment "script-email" + plugin "script-email" + execute_on pre-dle-amcheck, pre-host-amcheck, post-dle-amcheck, post-host-amcheck, pre-dle-estimate, pre-host-estimate, post-dle-estimate, post-host-estimate, pre-dle-backup, pre-host-backup, post-dle-backup, post-host-backup + execute_where server # or client + property "mailto" "martinea" +} +#your dumptype must include: script "sc-email" +#to use the script + # You may include other amanda configuration files, so you can share # dumptypes, tapetypes and interface definitions among several # configurations. diff --git a/example/amanda.conf.in b/example/amanda.conf.in index 5e9df2b..57f1bef 100644 --- a/example/amanda.conf.in +++ b/example/amanda.conf.in @@ -251,11 +251,7 @@ indexdir "@CONFIG_DIR@/@DEFAULT_CONFIG@/index" # index directory # are, and how fast the tape device is. # A filemark is the amount of wasted space every time a tape section -# ends. If you run `make tapetype' in tape-src, you'll get a program -# that generates tapetype entries, but it is slow as hell, use it only -# if you really must and, if you do, make sure you post the data to -# the amanda mailing list, so that others can use what you found out -# by searching the archives. +# ends. # For completeness Amanda should calculate the inter-record gaps too, # but it doesn't. For EXABYTE and DAT tapes this is ok. Anyone using @@ -725,6 +721,47 @@ define interface local { # use 400 kbps #} +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" + #default from gnutar_list_dir setting in amanda-client.conf +} + +define dumptype dt_amgtar { + program "APPLICATION" + application "app_amgtar" +} + +#define application-tool and dumptype for the amstar application +define application-tool app_amstar { + comment "amstar" + plugin "amstar" + #property "STAR-PATH" "/path/to/star" + #property "STAR-TARDUMP" "/path/to/tardumps" # default /etc/tardumps + #property "STAR-DLE-TARDUMP" "no" + # if 'yes' then create a different tardump file for each DLE, + # it is required if you do many dump in parallel (maxdump>1) +} + +define dumptype dt_amstar { + program "APPLICATION" + application "app_amstar" +} + +#define a script-tool to send an email +define script-tool sc-email { + comment "script-email" + plugin "script-email" + execute_on pre-dle-amcheck, pre-host-amcheck, post-dle-amcheck, post-host-amcheck, pre-dle-estimate, pre-host-estimate, post-dle-estimate, post-host-estimate, pre-dle-backup, pre-host-backup, post-dle-backup, post-host-backup + execute_where server # or client + property "mailto" "martinea" +} +#your dumptype must include: script "sc-email" +#to use the script + # You may include other amanda configuration files, so you can share # dumptypes, tapetypes and interface definitions among several # configurations. diff --git a/example/inetd.conf.amandaclient b/example/inetd.conf.amandaclient index d103b6d..49ee6df 100644 --- a/example/inetd.conf.amandaclient +++ b/example/inetd.conf.amandaclient @@ -1,2 +1,2 @@ -#amanda stream tcp nowait amandabackup /usr/lib/amanda/amandad -auth=bsdtcp amdump -amanda stream tcp nowait amandabackup /usr/lib/amanda/amandad amandad -auth=bsdtcp amdump +#amanda stream tcp nowait amandabackup /usr/libexec/amanda/amandad -auth=bsdtcp amdump +amanda stream tcp nowait amandabackup /usr/libexec/amanda/amandad amandad -auth=bsdtcp amdump diff --git a/example/inetd.conf.amandaclient.in b/example/inetd.conf.amandaclient.in new file mode 100644 index 0000000..9d60e06 --- /dev/null +++ b/example/inetd.conf.amandaclient.in @@ -0,0 +1,2 @@ +#amanda stream tcp nowait amandabackup @amlibexecdir@/amandad -auth=bsdtcp amdump +amanda stream tcp nowait amandabackup @amlibexecdir@/amandad amandad -auth=bsdtcp amdump diff --git a/example/inetd.conf.amandaserver b/example/inetd.conf.amandaserver new file mode 100644 index 0000000..be6a575 --- /dev/null +++ b/example/inetd.conf.amandaserver @@ -0,0 +1 @@ +amanda stream tcp nowait amandabackup /usr/libexec/amanda/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped diff --git a/example/inetd.conf.amandaserver.in b/example/inetd.conf.amandaserver.in new file mode 100644 index 0000000..3228c79 --- /dev/null +++ b/example/inetd.conf.amandaserver.in @@ -0,0 +1 @@ +amanda stream tcp nowait amandabackup @amlibexecdir@/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped diff --git a/example/template.d/advanced.conf b/example/template.d/advanced.conf index 6036089..53f57e3 100644 --- a/example/template.d/advanced.conf +++ b/example/template.d/advanced.conf @@ -25,7 +25,7 @@ taperalgo first # The algorithm used to choose which dump image to send # largestfit The largest dump image that will fit on the current tape. # smallest The smallest dump image. # last Last in - first out. -displayunit "m" # Possible values: "k|m|g|t" +displayunit "g" # Possible values: "k|m|g|t" # Default: k. # The unit used to print many numbers. # k=kilo, m=mega, g=giga, t=tera @@ -52,8 +52,8 @@ device_output_buffer_size 1280k # Use with caution. ## label_new_tapes "DailySet1-%%%" -maxdumpsize -1 # Maximum number of bytes the planner will schedule - # for a run (default: runtapes * tape_length). +maxdumpsize -1 # Maximum total size the planner will schedule + # for a run (default: runtapes * tape_length) (kbytes). amrecover_do_fsf yes # amrecover will call amrestore with the # -f flag for faster positioning of the tape. amrecover_check_label yes # amrecover will call amrestore with the diff --git a/example/template.d/advanced.conf.in b/example/template.d/advanced.conf.in index 19b963e..1a0ee06 100644 --- a/example/template.d/advanced.conf.in +++ b/example/template.d/advanced.conf.in @@ -25,7 +25,7 @@ taperalgo first # The algorithm used to choose which dump image to send # largestfit The largest dump image that will fit on the current tape. # smallest The smallest dump image. # last Last in - first out. -displayunit "m" # Possible values: "k|m|g|t" +displayunit "g" # Possible values: "k|m|g|t" # Default: k. # The unit used to print many numbers. # k=kilo, m=mega, g=giga, t=tera @@ -52,8 +52,8 @@ device_output_buffer_size 1280k # Use with caution. ## label_new_tapes "DailySet1-%%%" -maxdumpsize -1 # Maximum number of bytes the planner will schedule - # for a run (default: runtapes * tape_length). +maxdumpsize -1 # Maximum total size the planner will schedule + # for a run (default: runtapes * tape_length) (kbytes). amrecover_do_fsf yes # amrecover will call amrestore with the # -f flag for faster positioning of the tape. amrecover_check_label yes # amrecover will call amrestore with the diff --git a/example/template.d/amanda-S3.conf b/example/template.d/amanda-S3.conf index 70297b0..e05b66d 100644 --- a/example/template.d/amanda-S3.conf +++ b/example/template.d/amanda-S3.conf @@ -14,7 +14,7 @@ tpchanger "chg-multi" # the tape-changer glue script tapedev "S3:" # the no-rewind tape device to be used changerfile "/etc/amanda/DailySet1/changer.conf" #changerdev "/dev/sg1" -tapetype HARDDISK # what kind of tape it is (see tapetypes below) +tapetype S3 # what kind of tape it is (see tapetypes below) holdingdisk hd2 { directory "/var/lib/amanda/holdings/DailySet1" @@ -34,9 +34,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes @@ -47,6 +56,10 @@ define tapetype HARDDISK { length 5000 mbytes } +define tapetype S3 { + comment "S3 Bucket" + length 10240 gigabytes # Bucket size 10TB +} includefile "./advanced.conf" includefile "/etc/amanda/template.d/dumptypes" diff --git a/example/template.d/amanda-S3.conf.in b/example/template.d/amanda-S3.conf.in index 96592d6..149fc9e 100644 --- a/example/template.d/amanda-S3.conf.in +++ b/example/template.d/amanda-S3.conf.in @@ -14,7 +14,7 @@ tpchanger "chg-multi" # the tape-changer glue script tapedev "S3:" # the no-rewind tape device to be used changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer.conf" #changerdev "/dev/sg1" -tapetype HARDDISK # what kind of tape it is (see tapetypes below) +tapetype S3 # what kind of tape it is (see tapetypes below) holdingdisk hd2 { directory "/var/lib/amanda/holdings/@DEFAULT_CONFIG@" @@ -34,9 +34,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes @@ -47,6 +56,10 @@ define tapetype HARDDISK { length 5000 mbytes } +define tapetype S3 { + comment "S3 Bucket" + length 10240 gigabytes # Bucket size 10TB +} includefile "./advanced.conf" includefile "@CONFIG_DIR@/template.d/dumptypes" diff --git a/example/template.d/amanda-harddisk.conf b/example/template.d/amanda-harddisk.conf index 395a836..4a48973 100644 --- a/example/template.d/amanda-harddisk.conf +++ b/example/template.d/amanda-harddisk.conf @@ -26,9 +26,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/amanda-harddisk.conf.in b/example/template.d/amanda-harddisk.conf.in index e1c920b..53ec87b 100644 --- a/example/template.d/amanda-harddisk.conf.in +++ b/example/template.d/amanda-harddisk.conf.in @@ -26,9 +26,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/amanda-single-tape.conf b/example/template.d/amanda-single-tape.conf index 8cd47c9..0add4f3 100644 --- a/example/template.d/amanda-single-tape.conf +++ b/example/template.d/amanda-single-tape.conf @@ -11,7 +11,6 @@ tapecycle 10 tapes # the number of tapes in rotation # cycle runtapes 1 # number of tapes to be used in a single run of amdump -tpchanger "chg-manual" # the tape-changer glue script tapedev "tape:/dev/nst0" # the no-rewind tape device to be used changerfile "/etc/amanda/DailySet1/chg-manual.conf" changerdev "/dev/null" @@ -34,9 +33,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/amanda-single-tape.conf.in b/example/template.d/amanda-single-tape.conf.in index 6012305..7a26942 100644 --- a/example/template.d/amanda-single-tape.conf.in +++ b/example/template.d/amanda-single-tape.conf.in @@ -11,7 +11,6 @@ tapecycle 10 tapes # the number of tapes in rotation # cycle runtapes 1 # number of tapes to be used in a single run of amdump -tpchanger "chg-manual" # the tape-changer glue script tapedev "tape:/dev/nst0" # the no-rewind tape device to be used changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/chg-manual.conf" changerdev "/dev/null" @@ -34,9 +33,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/amanda-tape-changer.conf b/example/template.d/amanda-tape-changer.conf index 382259f..d60fbd5 100644 --- a/example/template.d/amanda-tape-changer.conf +++ b/example/template.d/amanda-tape-changer.conf @@ -33,9 +33,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/amanda-tape-changer.conf.in b/example/template.d/amanda-tape-changer.conf.in index f46e729..d2922a2 100644 --- a/example/template.d/amanda-tape-changer.conf.in +++ b/example/template.d/amanda-tape-changer.conf.in @@ -33,9 +33,18 @@ define dumptype global { auth "bsdtcp" } +#define application-tool and dumptype for the amgtar application +define application-tool app_amgtar { + comment "amgtar" + plugin "amgtar" + #property "GNUTAR-PATH" "/path/to/gtar" + #property "GNUTAR-LISTDIR" "/path/to/gnutar_list_dir" +} + define dumptype gui-base { global - program "GNUTAR" + program "APPLICATION" + application "app_amgtar" comment "gui base dumptype dumped with tar" compress none index yes diff --git a/example/template.d/dumptypes b/example/template.d/dumptypes index d0f2ae8..da67d45 100644 --- a/example/template.d/dumptypes +++ b/example/template.d/dumptypes @@ -419,4 +419,3 @@ define dumptype gui-encrypt-compress { encrypt server server_encrypt "/usr/sbin/amcryptsimple" } - diff --git a/example/template.d/tapetypes b/example/template.d/tapetypes index effaeed..4a85795 100644 --- a/example/template.d/tapetypes +++ b/example/template.d/tapetypes @@ -6,11 +6,7 @@ # are, and how fast the tape device is. # A filemark is the amount of wasted space every time a tape section -# ends. If you run `make tapetype' in tape-src, you'll get a program -# that generates tapetype entries, but it is slow as hell, use it only -# if you really must and, if you do, make sure you post the data to -# the amanda mailing list, so that others can use what you found out -# by searching the archives. +# ends. # For completeness Amanda should calculate the inter-record gaps too, # but it doesn't. For EXABYTE and DAT tapes this is ok. Anyone using diff --git a/example/xinetd.amandaclient b/example/xinetd.amandaclient index 7747b0f..9fc402b 100644 --- a/example/xinetd.amandaclient +++ b/example/xinetd.amandaclient @@ -6,14 +6,13 @@ service amanda { disable = no - flags = IPv4 - flags = IPv6 + flags = IPv6 socket_type = stream protocol = tcp wait = no user = amandabackup group = disk groups = yes - server = /usr/libexec/amanda/amandad + server = /usr/libexec/amanda/amandad server_args = -auth=bsdtcp amdump } diff --git a/example/xinetd.amandaclient.in b/example/xinetd.amandaclient.in new file mode 100644 index 0000000..f7f3d7c --- /dev/null +++ b/example/xinetd.amandaclient.in @@ -0,0 +1,18 @@ +# default: on +# +# description: The Amanda backup client should be enabled for systems +# which will be backed up by an Amanda backup server. + +service amanda +{ + disable = no + flags = IPv6 + socket_type = stream + protocol = tcp + wait = no + user = amandabackup + group = disk + groups = yes + server = @amlibexecdir@/amandad + server_args = -auth=bsdtcp amdump +} diff --git a/example/xinetd.amandaserver b/example/xinetd.amandaserver index 8279d4e..c67f730 100644 --- a/example/xinetd.amandaserver +++ b/example/xinetd.amandaserver @@ -1,13 +1,12 @@ # default: on # # description: Amanda services for Amanda server and client. -# +# service amanda { disable = no - flags = IPv4 - flags = IPv6 + flags = IPv6 socket_type = stream protocol = tcp wait = no diff --git a/example/xinetd.amandaserver.in b/example/xinetd.amandaserver.in new file mode 100644 index 0000000..367d0e8 --- /dev/null +++ b/example/xinetd.amandaserver.in @@ -0,0 +1,18 @@ +# default: on +# +# description: Amanda services for Amanda server and client. +# + +service amanda +{ + disable = no + flags = IPv6 + socket_type = stream + protocol = tcp + wait = no + user = amandabackup + group = disk + groups = yes + server = @amlibexecdir@/amandad + server_args = -auth=bsdtcp amdump amindexd amidxtaped +} diff --git a/gnulib/Makefile.am b/gnulib/Makefile.am index 78cdadf..097892e 100644 --- a/gnulib/Makefile.am +++ b/gnulib/Makefile.am @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage full-read full-write getaddrinfo getopt lock mkdtemp physmem visibility AUTOMAKE_OPTIONS = 1.5 gnits @@ -53,14 +53,14 @@ BUILT_SOURCES += $(ALLOCA_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca_.h +alloca.h: alloca.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca_.h; \ + cat $(srcdir)/alloca.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += alloca.h alloca.h-t -EXTRA_DIST += alloca_.h +EXTRA_DIST += alloca.in.h ## end gnulib module alloca-opt @@ -94,17 +94,17 @@ BUILT_SOURCES += $(FLOAT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -float.h: float_.h +float.h: float.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ - < $(srcdir)/float_.h; \ + < $(srcdir)/float.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += float.h float.h-t -EXTRA_DIST += float_.h +EXTRA_DIST += float.in.h ## end gnulib module float @@ -138,6 +138,25 @@ EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c ## end gnulib module getaddrinfo +## begin gnulib module getopt + +BUILT_SOURCES += $(GETOPT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +getopt.h: getopt.in.h + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/getopt.in.h; \ + } > $@-t + mv -f $@-t $@ +MOSTLYCLEANFILES += getopt.h getopt.h-t + +EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h + +EXTRA_libgnu_la_SOURCES += getopt.c getopt1.c + +## end gnulib module getopt + ## begin gnulib module gettext-h libgnu_la_SOURCES += gettext.h @@ -209,20 +228,20 @@ BUILT_SOURCES += $(NETINET_IN_H) # We need the following in order to create when the system # doesn't have one. -netinet/in.h: +netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ - < $(srcdir)/netinet_in_.h; \ + < $(srcdir)/netinet_in.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t MOSTLYCLEANDIRS += netinet -EXTRA_DIST += netinet_in_.h +EXTRA_DIST += netinet_in.in.h ## end gnulib module netinet_in @@ -274,15 +293,15 @@ BUILT_SOURCES += $(STDBOOL_H) # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool_.h +stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdbool.h stdbool.h-t -EXTRA_DIST += stdbool_.h +EXTRA_DIST += stdbool.in.h ## end gnulib module stdbool @@ -292,7 +311,7 @@ BUILT_SOURCES += $(STDINT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint_.h +stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ @@ -317,12 +336,12 @@ stdint.h: stdint_.h -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - < $(srcdir)/stdint_.h; \ + < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdint.h stdint.h-t -EXTRA_DIST += stdint_.h +EXTRA_DIST += stdint.in.h ## end gnulib module stdint @@ -332,7 +351,7 @@ BUILT_SOURCES += stdio.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdio.h: stdio_.h +stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -346,6 +365,8 @@ stdio.h: stdio_.h -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \ -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ @@ -365,6 +386,8 @@ stdio.h: stdio_.h -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ @@ -374,12 +397,12 @@ stdio.h: stdio_.h -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdio_.h; \ + < $(srcdir)/stdio.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdio.h stdio.h-t -EXTRA_DIST += stdio_.h +EXTRA_DIST += stdio.in.h ## end gnulib module stdio @@ -389,7 +412,7 @@ BUILT_SOURCES += stdlib.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib_.h +stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -400,19 +423,26 @@ stdlib.h: stdlib_.h -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdlib_.h; \ + < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdlib.h stdlib.h-t -EXTRA_DIST += stdlib_.h +EXTRA_DIST += stdlib.in.h ## end gnulib module stdlib @@ -431,7 +461,7 @@ BUILT_SOURCES += string.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -string.h: string_.h +string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -461,15 +491,16 @@ string.h: string_.h -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ + -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ + -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ - -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ - -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ @@ -479,13 +510,20 @@ string.h: string_.h -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/string_.h; \ + < $(srcdir)/string.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += string.h string.h-t -EXTRA_DIST += string_.h +EXTRA_DIST += string.in.h ## end gnulib module string @@ -495,7 +533,7 @@ BUILT_SOURCES += $(SYS_SOCKET_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/socket.h: sys_socket_.h +sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -503,13 +541,13 @@ sys/socket.h: sys_socket_.h -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ - < $(srcdir)/sys_socket_.h; \ + < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t MOSTLYCLEANDIRS += sys -EXTRA_DIST += sys_socket_.h +EXTRA_DIST += sys_socket.in.h ## end gnulib module sys_socket @@ -519,7 +557,7 @@ BUILT_SOURCES += $(SYS_STAT_H) # We need the following in order to create when the system # has one that is incomplete. -sys/stat.h: sys_stat_.h +sys/stat.h: sys_stat.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ @@ -528,13 +566,13 @@ sys/stat.h: sys_stat_.h -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \ - < $(srcdir)/sys_stat_.h; \ + < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t MOSTLYCLEANDIRS += sys -EXTRA_DIST += sys_stat_.h +EXTRA_DIST += sys_stat.in.h ## end gnulib module sys_stat @@ -544,7 +582,7 @@ BUILT_SOURCES += $(SYS_TIME_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/time.h: sys_time_.h +sys/time.h: sys_time.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ @@ -553,12 +591,12 @@ sys/time.h: sys_time_.h -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ - < $(srcdir)/sys_time_.h; \ + < $(srcdir)/sys_time.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += sys/time.h sys/time.h-t -EXTRA_DIST += sys_time_.h +EXTRA_DIST += sys_time.in.h ## end gnulib module sys_time @@ -577,7 +615,7 @@ BUILT_SOURCES += unistd.h # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd_.h +unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ @@ -585,30 +623,37 @@ unistd.h: unistd_.h -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ - < $(srcdir)/unistd_.h; \ + < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += unistd.h unistd.h-t -EXTRA_DIST += unistd_.h +EXTRA_DIST += unistd.in.h ## end gnulib module unistd @@ -627,7 +672,7 @@ BUILT_SOURCES += $(WCHAR_H) # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar_.h +wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -637,12 +682,12 @@ wchar.h: wchar_.h -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/wchar_.h; \ + < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ MOSTLYCLEANFILES += wchar.h wchar.h-t -EXTRA_DIST += wchar_.h +EXTRA_DIST += wchar.in.h ## end gnulib module wchar @@ -662,4 +707,4 @@ mostlyclean-local: mostlyclean-generic : # Make sure regenerate/* are in the distribution tarball -EXTRA_DIST += regenerate/getaddrinfo-cygwin.patch regenerate/no-error.patch regenerate/regenerate +EXTRA_DIST += regenerate/getaddrinfo-cygwin.patch regenerate/no-error.patch regenerate/no-restrict.patch regenerate/regenerate diff --git a/gnulib/Makefile.in b/gnulib/Makefile.in index aab44ad..009c668 100644 --- a/gnulib/Makefile.in +++ b/gnulib/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -23,7 +23,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage getaddrinfo lock mkdtemp physmem visibility +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl base64 fsusage full-read full-write getaddrinfo getopt lock mkdtemp physmem visibility @@ -52,6 +52,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -85,6 +86,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -107,7 +109,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -135,7 +139,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -146,7 +149,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -169,7 +171,7 @@ libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS) libgnu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgnu_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -188,6 +190,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -202,8 +205,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -215,16 +220,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -238,6 +255,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -245,7 +263,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -258,6 +276,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -268,9 +287,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -280,6 +302,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -304,8 +327,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -314,11 +339,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -332,6 +361,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -340,9 +370,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -350,7 +381,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -359,8 +392,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -368,7 +403,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -377,10 +411,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -396,6 +432,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -412,6 +450,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -420,7 +460,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -456,26 +495,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -483,7 +533,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -493,6 +547,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -502,7 +557,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -511,6 +573,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -539,6 +602,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -557,6 +621,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -586,6 +652,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = 1.5 gnits @@ -594,30 +661,31 @@ noinst_LIBRARIES = noinst_LTLIBRARIES = libgnu.la # Make sure regenerate/* are in the distribution tarball -EXTRA_DIST = alloca_.h float_.h fsusage.c fsusage.h gai_strerror.c \ - getaddrinfo.c getaddrinfo.h gettimeofday.c \ - $(top_srcdir)/config/config.rpath inet_ntop.c inet_ntop.h \ - $(top_srcdir)/config/link-warning.h \ +EXTRA_DIST = alloca.in.h float.in.h fsusage.c fsusage.h gai_strerror.c \ + getaddrinfo.c getaddrinfo.h getopt.c getopt.in.h getopt1.c \ + getopt_int.h gettimeofday.c $(top_srcdir)/config/config.rpath \ + inet_ntop.c inet_ntop.h $(top_srcdir)/config/link-warning.h \ $(top_srcdir)/config/config.rpath malloc.c mkdtemp.c \ - netinet_in_.h physmem.c physmem.h safe-read.c safe-read.h \ - safe-write.c safe-write.h snprintf.c stdbool_.h stdint_.h \ - stdio_.h stdlib_.h strdup.c string_.h sys_socket_.h \ - sys_stat_.h sys_time_.h tempname.c tempname.h unistd_.h \ + netinet_in.in.h physmem.c physmem.h safe-read.c safe-read.h \ + safe-write.c safe-write.h snprintf.c stdbool.in.h stdint.in.h \ + stdio.in.h stdlib.in.h strdup.c string.in.h sys_socket.in.h \ + sys_stat.in.h sys_time.in.h tempname.c tempname.h unistd.in.h \ asnprintf.c float+.h printf-args.c printf-args.h \ printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \ - wchar_.h regenerate/getaddrinfo-cygwin.patch \ - regenerate/no-error.patch regenerate/regenerate -BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) $(FLOAT_H) $(NETINET_IN_H) \ - $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h string.h \ - $(SYS_SOCKET_H) $(SYS_STAT_H) $(SYS_TIME_H) unistd.h \ + wchar.in.h regenerate/getaddrinfo-cygwin.patch \ + regenerate/no-error.patch regenerate/no-restrict.patch \ + regenerate/regenerate +BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) $(FLOAT_H) $(GETOPT_H) \ + $(NETINET_IN_H) $(STDBOOL_H) $(STDINT_H) stdio.h stdlib.h \ + string.h $(SYS_SOCKET_H) $(SYS_STAT_H) $(SYS_TIME_H) unistd.h \ $(WCHAR_H) SUFFIXES = MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \ - arpa/inet.h-t float.h float.h-t netinet/in.h netinet/in.h-t \ - stdbool.h stdbool.h-t stdint.h stdint.h-t stdio.h stdio.h-t \ - stdlib.h stdlib.h-t string.h string.h-t sys/socket.h \ - sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ - unistd.h unistd.h-t wchar.h wchar.h-t + arpa/inet.h-t float.h float.h-t getopt.h getopt.h-t \ + netinet/in.h netinet/in.h-t stdbool.h stdbool.h-t stdint.h \ + stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t string.h \ + string.h-t sys/socket.h sys/socket.h-t sys/stat.h sys/stat.h-t \ + sys/time.h sys/time.h-t unistd.h unistd.h-t wchar.h wchar.h-t MOSTLYCLEANDIRS = arpa netinet sys sys CLEANFILES = DISTCLEANFILES = @@ -630,9 +698,10 @@ libgnu_la_SOURCES = base64.h base64.c full-read.h full-read.c \ libgnu_la_LIBADD = $(gl_LTLIBOBJS) libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) EXTRA_libgnu_la_SOURCES = fsusage.c gai_strerror.c getaddrinfo.c \ - gettimeofday.c inet_ntop.c malloc.c mkdtemp.c physmem.c \ - safe-read.c safe-write.c snprintf.c strdup.c tempname.c \ - asnprintf.c printf-args.c printf-parse.c vasnprintf.c + getopt.c getopt1.c gettimeofday.c inet_ntop.c malloc.c \ + mkdtemp.c physmem.c safe-read.c safe-write.c snprintf.c \ + strdup.c tempname.c asnprintf.c printf-args.c printf-parse.c \ + vasnprintf.c libgnu_la_LDFLAGS = $(AM_LDFLAGS) # Use this preprocessor expression to decide whether #include_next works. @@ -702,6 +771,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full-write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gai_strerror.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@ @@ -749,8 +820,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -762,8 +833,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -773,13 +844,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -931,9 +1001,9 @@ uninstall-am: # We need the following in order to create when the system # doesn't have one that works with the given compiler. -alloca.h: alloca_.h +alloca.h: alloca.in.h { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca_.h; \ + cat $(srcdir)/alloca.in.h; \ } > $@-t mv -f $@-t $@ @@ -949,40 +1019,48 @@ arpa/inet.h: # We need the following in order to create when the system # doesn't have one that works with the given compiler. -float.h: float_.h +float.h: float.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ - < $(srcdir)/float_.h; \ + < $(srcdir)/float.in.h; \ } > $@-t mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +getopt.h: getopt.in.h + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/getopt.in.h; \ + } > $@-t + mv -f $@-t $@ + # We need the following in order to create when the system # doesn't have one. -netinet/in.h: +netinet/in.h: netinet_in.in.h @MKDIR_P@ netinet rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \ -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \ - < $(srcdir)/netinet_in_.h; \ + < $(srcdir)/netinet_in.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works. -stdbool.h: stdbool_.h +stdbool.h: stdbool.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdint.h: stdint_.h +stdint.h: stdint.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ @@ -1007,13 +1085,13 @@ stdint.h: stdint_.h -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ - < $(srcdir)/stdint_.h; \ + < $(srcdir)/stdint.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdio.h: stdio_.h +stdio.h: stdio.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -1027,6 +1105,8 @@ stdio.h: stdio_.h -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \ + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \ -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \ -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \ -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \ @@ -1046,6 +1126,8 @@ stdio.h: stdio_.h -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ @@ -1055,13 +1137,13 @@ stdio.h: stdio_.h -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdio_.h; \ + < $(srcdir)/stdio.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -stdlib.h: stdlib_.h +stdlib.h: stdlib.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -1072,20 +1154,27 @@ stdlib.h: stdlib_.h -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \ -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \ -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \ + -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \ + -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \ + -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \ -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \ -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \ + -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/stdlib_.h; \ + < $(srcdir)/stdlib.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -string.h: string_.h +string.h: string.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -1115,15 +1204,16 @@ string.h: string_.h -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \ -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \ -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \ + -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \ -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \ -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \ + -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \ + -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ - -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ - -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \ @@ -1133,14 +1223,21 @@ string.h: string_.h -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/string_.h; \ + < $(srcdir)/string.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/socket.h: sys_socket_.h +sys/socket.h: sys_socket.in.h @MKDIR_P@ sys { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -1148,13 +1245,13 @@ sys/socket.h: sys_socket_.h -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ - < $(srcdir)/sys_socket_.h; \ + < $(srcdir)/sys_socket.in.h; \ } > $@-t mv -f $@-t $@ # We need the following in order to create when the system # has one that is incomplete. -sys/stat.h: sys_stat_.h +sys/stat.h: sys_stat.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ @@ -1163,13 +1260,13 @@ sys/stat.h: sys_stat_.h -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \ - < $(srcdir)/sys_stat_.h; \ + < $(srcdir)/sys_stat.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -sys/time.h: sys_time_.h +sys/time.h: sys_time.in.h @MKDIR_P@ sys rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ @@ -1178,13 +1275,13 @@ sys/time.h: sys_time_.h -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ - < $(srcdir)/sys_time_.h; \ + < $(srcdir)/sys_time.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create an empty placeholder for # when the system doesn't have one. -unistd.h: unistd_.h +unistd.h: unistd.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ @@ -1192,31 +1289,38 @@ unistd.h: unistd_.h -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \ -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ - < $(srcdir)/unistd_.h; \ + < $(srcdir)/unistd.in.h; \ } > $@-t mv $@-t $@ # We need the following in order to create when the system # version does not work standalone. -wchar.h: wchar_.h +wchar.h: wchar.in.h rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \ @@ -1226,7 +1330,7 @@ wchar.h: wchar_.h -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ - < $(srcdir)/wchar_.h; \ + < $(srcdir)/wchar.in.h; \ } > $@-t mv $@-t $@ diff --git a/gnulib/alloca.in.h b/gnulib/alloca.in.h new file mode 100644 index 0000000..6269607 --- /dev/null +++ b/gnulib/alloca.in.h @@ -0,0 +1,56 @@ +/* Memory allocation on the stack. + + Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software + Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ + +/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H + means there is a real alloca function. */ +#ifndef _GL_ALLOCA_H +#define _GL_ALLOCA_H + +/* alloca (N) returns a pointer to N bytes of memory + allocated on the stack, which will last until the function returns. + Use of alloca should be avoided: + - inside arguments of function calls - undefined behaviour, + - in inline functions - the allocation may actually last until the + calling function returns, + - for huge N (say, N >= 65536) - you never know how large (or small) + the stack is, and when the stack cannot fulfill the memory allocation + request, the program just crashes. + */ + +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# elif defined __DECC && defined __VMS +# define alloca __ALLOCA +# else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + +#endif /* _GL_ALLOCA_H */ diff --git a/gnulib/alloca_.h b/gnulib/alloca_.h deleted file mode 100644 index af274b9..0000000 --- a/gnulib/alloca_.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Memory allocation on the stack. - - Copyright (C) 1995, 1999, 2001-2004, 2006-2007 Free Software - Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. */ - -/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H - means there is a real alloca function. */ -#ifndef _GL_ALLOCA_H -#define _GL_ALLOCA_H - -/* alloca (N) returns a pointer to N bytes of memory - allocated on the stack, which will last until the function returns. - Use of alloca should be avoided: - - inside arguments of function calls - undefined behaviour, - - in inline functions - the allocation may actually last until the - calling function returns, - - for huge N (say, N >= 65536) - you never know how large (or small) - the stack is, and when the stack cannot fulfill the memory allocation - request, the program just crashes. - */ - -#ifndef alloca -# ifdef __GNUC__ -# define alloca __builtin_alloca -# elif defined _AIX -# define alloca __alloca -# elif defined _MSC_VER -# include -# define alloca _alloca -# else -# include -# ifdef __cplusplus -extern "C" -# endif -void *alloca (size_t); -# endif -#endif - -#endif /* _GL_ALLOCA_H */ diff --git a/gnulib/asnprintf.c b/gnulib/asnprintf.c index 26c3988..bf2abf3 100644 --- a/gnulib/asnprintf.c +++ b/gnulib/asnprintf.c @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/base64.c b/gnulib/base64.c index f237cd6..188b36a 100644 --- a/gnulib/base64.c +++ b/gnulib/base64.c @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -64,8 +64,8 @@ to_uchar (char ch) possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero terminate the output buffer. */ void -base64_encode (const char *restrict in, size_t inlen, - char *restrict out, size_t outlen) +base64_encode (const char *in, size_t inlen, + char *out, size_t outlen) { static const char b64str[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -310,8 +310,8 @@ isbase64 (char ch) that, when applicable, you must remove any line terminators that is part of the data stream before calling this function. */ bool -base64_decode (const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen) +base64_decode (const char *in, size_t inlen, + char *out, size_t *outlen) { size_t outleft = *outlen; diff --git a/gnulib/base64.h b/gnulib/base64.h index 6bb9a97..50f4712 100644 --- a/gnulib/base64.h +++ b/gnulib/base64.h @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -31,13 +31,13 @@ extern bool isbase64 (char ch); -extern void base64_encode (const char *restrict in, size_t inlen, - char *restrict out, size_t outlen); +extern void base64_encode (const char *in, size_t inlen, + char *out, size_t outlen); extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out); -extern bool base64_decode (const char *restrict in, size_t inlen, - char *restrict out, size_t *outlen); +extern bool base64_decode (const char *in, size_t inlen, + char *out, size_t *outlen); extern bool base64_decode_alloc (const char *in, size_t inlen, char **out, size_t *outlen); diff --git a/gnulib/float+.h b/gnulib/float+.h index 4de25a9..240fe36 100644 --- a/gnulib/float+.h +++ b/gnulib/float+.h @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/float.in.h b/gnulib/float.in.h new file mode 100644 index 0000000..2504032 --- /dev/null +++ b/gnulib/float.in.h @@ -0,0 +1,58 @@ +/* A correct . + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#ifndef _GL_FLOAT_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FLOAT_H@ + +#ifndef _GL_FLOAT_H +#define _GL_FLOAT_H + +/* 'long double' properties. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +/* Number of mantissa units, in base FLT_RADIX. */ +# undef LDBL_MANT_DIG +# define LDBL_MANT_DIG 64 +/* Number of decimal digits that is sufficient for representing a number. */ +# undef LDBL_DIG +# define LDBL_DIG 18 +/* x-1 where x is the smallest representable number > 1. */ +# undef LDBL_EPSILON +# define LDBL_EPSILON 1.0842021724855044340E-19L +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */ +# undef LDBL_MAX_EXP +# define LDBL_MAX_EXP 16384 +/* Minimum positive normalized number. */ +# undef LDBL_MIN +# define LDBL_MIN 3.3621031431120935063E-4932L +/* Maximum representable finite number. */ +# undef LDBL_MAX +# define LDBL_MAX 1.1897314953572317650E+4932L +/* Minimum e such that 10^e is in the range of normalized numbers. */ +# undef LDBL_MIN_10_EXP +# define LDBL_MIN_10_EXP (-4931) +/* Maximum e such that 10^e is in the range of representable finite numbers. */ +# undef LDBL_MAX_10_EXP +# define LDBL_MAX_10_EXP 4932 +#endif + +#endif /* _GL_FLOAT_H */ +#endif /* _GL_FLOAT_H */ diff --git a/gnulib/float_.h b/gnulib/float_.h deleted file mode 100644 index d61d630..0000000 --- a/gnulib/float_.h +++ /dev/null @@ -1,59 +0,0 @@ -/* A correct . - - Copyright (C) 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_FLOAT_H - -/* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_FLOAT_H@ - -#ifndef _GL_FLOAT_H -#define _GL_FLOAT_H - -/* 'long double' properties. */ -#if defined __i386__ && defined __BEOS__ -/* Number of mantissa units, in base FLT_RADIX. */ -# undef LDBL_MANT_DIG -# define LDBL_MANT_DIG 64 -/* Number of decimal digits that is sufficient for representing a number. */ -# undef LDBL_DIG -# define LDBL_DIG 18 -/* x-1 where x is the smallest representable number > 1. */ -# undef LDBL_EPSILON -# define LDBL_EPSILON 1.0842021724855044340E-19L -/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */ -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP (-16381) -/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */ -# undef LDBL_MAX_EXP -# define LDBL_MAX_EXP 16384 -/* Minimum positive normalized number. */ -# undef LDBL_MIN -# define LDBL_MIN 3.3621031431120935063E-4932L -/* Maximum representable finite number. */ -# undef LDBL_MAX -# define LDBL_MAX 1.1897314953572317650E+4932L -/* Minimum e such that 10^e is in the range of normalized numbers. */ -# undef LDBL_MIN_10_EXP -# define LDBL_MIN_10_EXP (-4931) -/* Maximum e such that 10^e is in the range of representable finite numbers. */ -# undef LDBL_MAX_10_EXP -# define LDBL_MAX_10_EXP 4932 -#endif - -#endif /* _GL_FLOAT_H */ -#endif /* _GL_FLOAT_H */ diff --git a/gnulib/fsusage.c b/gnulib/fsusage.c index 337bf53..23d40ea 100644 --- a/gnulib/fsusage.c +++ b/gnulib/fsusage.c @@ -3,10 +3,10 @@ Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/fsusage.h b/gnulib/fsusage.h index 7fa9f8d..b32abe1 100644 --- a/gnulib/fsusage.h +++ b/gnulib/fsusage.h @@ -3,10 +3,10 @@ Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Space usage statistics for a file system. Blocks are 512-byte. */ diff --git a/gnulib/full-read.c b/gnulib/full-read.c index 8c3472a..fb7212b 100644 --- a/gnulib/full-read.c +++ b/gnulib/full-read.c @@ -1,10 +1,10 @@ /* An interface to read that retries after partial reads and interrupts. Copyright (C) 2002, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #define FULL_READ #include "full-write.c" diff --git a/gnulib/full-read.h b/gnulib/full-read.h index 05d83a7..a341ee0 100644 --- a/gnulib/full-read.h +++ b/gnulib/full-read.h @@ -2,10 +2,10 @@ Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, read to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/full-write.c b/gnulib/full-write.c index cc16872..51f2d38 100644 --- a/gnulib/full-write.c +++ b/gnulib/full-write.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/full-write.h b/gnulib/full-write.h index d20d2fe..9a80146 100644 --- a/gnulib/full-write.h +++ b/gnulib/full-write.h @@ -2,10 +2,10 @@ Copyright (C) 2002-2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/gai_strerror.c b/gnulib/gai_strerror.c index aa733d6..9e4abbe 100644 --- a/gnulib/gai_strerror.c +++ b/gnulib/gai_strerror.c @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/getaddrinfo.c b/gnulib/getaddrinfo.c index 55462c4..b14f809 100644 --- a/gnulib/getaddrinfo.c +++ b/gnulib/getaddrinfo.c @@ -5,7 +5,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -123,10 +123,10 @@ validate_family (int family) /* Translate name of a service location and/or a service name to set of socket addresses. */ int -getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res) +getaddrinfo (const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct addrinfo **res) { struct addrinfo *tmp; int port = 0; @@ -332,14 +332,14 @@ freeaddrinfo (struct addrinfo *ai) cur = ai; ai = ai->ai_next; - if (cur->ai_canonname) free (cur->ai_canonname); + free (cur->ai_canonname); free (cur); } } -int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, +int getnameinfo(const struct sockaddr *sa, socklen_t salen, + char *node, socklen_t nodelen, + char *service, socklen_t servicelen, int flags) { #ifdef WIN32_NATIVE diff --git a/gnulib/getaddrinfo.h b/gnulib/getaddrinfo.h index b4ef242..9708097 100644 --- a/gnulib/getaddrinfo.h +++ b/gnulib/getaddrinfo.h @@ -5,7 +5,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -113,10 +113,10 @@ struct addrinfo socket addresses. For more details, see the POSIX:2001 specification . */ -extern int getaddrinfo (const char *restrict nodename, - const char *restrict servname, - const struct addrinfo *restrict hints, - struct addrinfo **restrict res); +extern int getaddrinfo (const char *nodename, + const char *servname, + const struct addrinfo *hints, + struct addrinfo **res); #endif #if !HAVE_DECL_FREEADDRINFO @@ -137,9 +137,9 @@ extern const char *gai_strerror (int ecode); /* Convert socket address to printable node and service names. For more details, see the POSIX:2001 specification . */ -extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, +extern int getnameinfo(const struct sockaddr *sa, socklen_t salen, + char *node, socklen_t nodelen, + char *service, socklen_t servicelen, int flags); #endif diff --git a/gnulib/getopt.c b/gnulib/getopt.c new file mode 100644 index 0000000..f1e6d1f --- /dev/null +++ b/gnulib/getopt.c @@ -0,0 +1,1186 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004,2006,2008 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#ifndef _LIBC +# include +#endif + +#include "getopt.h" + +#include +#include +#include +#include + +#ifdef _LIBC +# include +#else +# include "gettext.h" +# define _(msgid) gettext (msgid) +#endif + +#if defined _LIBC && defined USE_IN_LIBIO +# include +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + +/* Unlike standard Unix `getopt', functions like `getopt_long' + let the user intersperse the options with the other arguments. + + As `getopt_long' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Using `getopt' or setting the environment variable POSIXLY_CORRECT + disables permutation. + Then the application's behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_int.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Keep a global copy of all internal members of getopt_data. */ + +static struct _getopt_data getopt_data; + + +#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (d->__nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (char **argv, struct _getopt_data *d) +{ + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + d->__nonoption_flags_max_len), + '\0', top + 1 - d->__nonoption_flags_max_len); + d->__nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (int argc, char **argv, const char *optstring, + int posixly_correct, struct _getopt_data *d) +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + d->__first_nonopt = d->__last_nonopt = d->optind; + + d->__nextchar = NULL; + + d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + d->__ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + d->__ordering = REQUIRE_ORDER; + ++optstring; + } + else if (d->__posixly_correct) + d->__ordering = REQUIRE_ORDER; + else + d->__ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (!d->__posixly_correct + && argc == __libc_argc && argv == __libc_argv) + { + if (d->__nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + d->__nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = d->__nonoption_flags_max_len = strlen (orig_str); + if (d->__nonoption_flags_max_len < argc) + d->__nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (d->__nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + d->__nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', d->__nonoption_flags_max_len - len); + } + } + d->__nonoption_flags_len = d->__nonoption_flags_max_len; + } + else + d->__nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. + + If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT + environment variable were set. */ + +int +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct, struct _getopt_data *d) +{ + int print_errors = d->opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + d->optarg = NULL; + + if (d->optind == 0 || !d->__initialized) + { + if (d->optind == 0) + d->optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring, + posixly_correct, d); + d->__initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ + || (d->optind < d->__nonoption_flags_len \ + && __getopt_nonoption_flags[d->optind] == '1')) +#else +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') +#endif + + if (d->__nextchar == NULL || *d->__nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; + + if (d->__ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (d->optind != argc && !strcmp (argv[d->optind], "--")) + { + d->optind++; + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; + + d->optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (d->optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (d->__ordering == REQUIRE_ORDER) + return -1; + d->optarg = argv[d->optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + d->__nextchar = (argv[d->optind] + 1 + + (longopts != NULL && argv[d->optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[d->optind][1] == '-' + || (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + d->optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind - 1][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#else + fprintf (stderr, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#else + fprintf (stderr, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + + d->__nextchar += strlen (d->__nextchar); + + d->optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->__nextchar = (char *) ""; + d->optind++; + d->optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *d->__nextchar++; + char *temp = strchr (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*d->__nextchar == '\0') + ++d->optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (d->__posixly_correct) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: illegal option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); +#endif + } + else + { +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: invalid option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `d->optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; + nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + + d->__nextchar += strlen (d->__nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + d->__nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + d->optind++; + } + else + d->optarg = NULL; + d->__nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; + } + } + return c; + } +} + +int +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct) +{ + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, longind, + long_only, posixly_correct, &getopt_data); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + +int +getopt (int argc, char *const *argv, const char *optstring) +{ + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); +} + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/gnulib/getopt.in.h b/gnulib/getopt.in.h new file mode 100644 index 0000000..d2d3e6e --- /dev/null +++ b/gnulib/getopt.in.h @@ -0,0 +1,225 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* Standalone applications should #define __GETOPT_PREFIX to an + identifier that prefixes the external functions and variables + defined in this header. When this happens, include the + headers that might declare getopt so that they will not cause + confusion if included after this file. Then systematically rename + identifiers so that they do not collide with the system functions + and variables. Renaming avoids problems with some compilers and + linkers. */ +#if defined __GETOPT_PREFIX && !defined __need_getopt +# include +# include +# include +# undef __need_getopt +# undef getopt +# undef getopt_long +# undef getopt_long_only +# undef optarg +# undef opterr +# undef optind +# undef optopt +# define __GETOPT_CONCAT(x, y) x ## y +# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) +# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) +# define getopt __GETOPT_ID (getopt) +# define getopt_long __GETOPT_ID (getopt_long) +# define getopt_long_only __GETOPT_ID (getopt_long_only) +# define optarg __GETOPT_ID (optarg) +# define opterr __GETOPT_ID (opterr) +# define optind __GETOPT_ID (optind) +# define optopt __GETOPT_ID (optopt) +#endif + +/* Standalone applications get correct prototypes for getopt_long and + getopt_long_only; they declare "char **argv". libc uses prototypes + with "char *const *argv" that are incorrect because getopt_long and + getopt_long_only can permute argv; this is required for backward + compatibility (e.g., for LSB 2.0.1). + + This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', + but it caused redefinition warnings if both unistd.h and getopt.h were + included, since unistd.h includes getopt.h having previously defined + __need_getopt. + + The only place where __getopt_argv_const is used is in definitions + of getopt_long and getopt_long_only below, but these are visible + only if __need_getopt is not defined, so it is quite safe to rewrite + the conditional as follows: +*/ +#if !defined __need_getopt +# if defined __GETOPT_PREFIX +# define __getopt_argv_const /* empty */ +# else +# define __getopt_argv_const const +# endif +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifndef __THROW +# ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) (0) +# endif +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ + const char *name; + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `-', then non-option arguments are treated as + arguments to the option '\1'. This behavior is specific to the GNU + `getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in + the environment, then do not permute arguments. */ + +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW; + +#ifndef __need_getopt +extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; +extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind) + __THROW; + +#endif + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/gnulib/getopt1.c b/gnulib/getopt1.c new file mode 100644 index 0000000..d6a3ecf --- /dev/null +++ b/gnulib/getopt1.c @@ -0,0 +1,170 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#ifdef _LIBC +# include +#else +# include +# include "getopt.h" +#endif +#include "getopt_int.h" + +#include + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 0, 0); +} + +int +_getopt_long_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 0, 0, d); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (int argc, char *__getopt_argv_const *argv, + const char *options, + const struct option *long_options, int *opt_index) +{ + return _getopt_internal (argc, (char **) argv, options, long_options, + opt_index, 1, 0); +} + +int +_getopt_long_only_r (int argc, char **argv, const char *options, + const struct option *long_options, int *opt_index, + struct _getopt_data *d) +{ + return _getopt_internal_r (argc, argv, options, long_options, opt_index, + 1, 0, d); +} + + +#ifdef TEST + +#include + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/gnulib/getopt_int.h b/gnulib/getopt_int.h new file mode 100644 index 0000000..3c6628b --- /dev/null +++ b/gnulib/getopt_int.h @@ -0,0 +1,130 @@ +/* Internal declarations for getopt. + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#ifndef _GETOPT_INT_H +#define _GETOPT_INT_H 1 + +extern int _getopt_internal (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct); + + +/* Reentrant versions which can handle parsing multiple argument + vectors at the same time. */ + +/* Data type for reentrant functions. */ +struct _getopt_data +{ + /* These have exactly the same meaning as the corresponding global + variables, except that they are used for the reentrant + versions of getopt. */ + int optind; + int opterr; + int optopt; + char *optarg; + + /* Internal members. */ + + /* True if the internal members have been initialized. */ + int __initialized; + + /* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + char *__nextchar; + + /* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters, or by calling getopt. + + PERMUTE is the default. We permute the contents of ARGV as we + scan, so that eventually all the non-options are at the end. + This allows options to be given in any order, even with programs + that were not written to expect this. + + RETURN_IN_ORDER is an option available to programs that were + written to expect options and other ARGV-elements in any order + and that care about the ordering of the two. We describe each + non-option ARGV-element as if it were the argument of an option + with character code 1. Using `-' as the first character of the + list of option characters selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + + enum + { + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + } __ordering; + + /* If the POSIXLY_CORRECT environment variable is set + or getopt was called. */ + int __posixly_correct; + + + /* Handle permutation of arguments. */ + + /* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first + of them; `last_nonopt' is the index after the last of them. */ + + int __first_nonopt; + int __last_nonopt; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + int __nonoption_flags_max_len; + int __nonoption_flags_len; +# endif +}; + +/* The initializer is necessary to set OPTIND and OPTERR to their + default values and to clear the initialization flag. */ +#define _GETOPT_DATA_INITIALIZER { 1, 1 } + +extern int _getopt_internal_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only, int __posixly_correct, + struct _getopt_data *__data); + +extern int _getopt_long_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + struct _getopt_data *__data); + +extern int _getopt_long_only_r (int ___argc, char **___argv, + const char *__shortopts, + const struct option *__longopts, + int *__longind, + struct _getopt_data *__data); + +#endif /* getopt_int.h */ diff --git a/gnulib/gettext.h b/gnulib/gettext.h index 9d76ec9..763dd3c 100644 --- a/gnulib/gettext.h +++ b/gnulib/gettext.h @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/gettimeofday.c b/gnulib/gettimeofday.c index bd5576c..7579130 100644 --- a/gnulib/gettimeofday.c +++ b/gnulib/gettimeofday.c @@ -5,7 +5,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -48,7 +48,7 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer; localtime uses for its result. */ struct tm * -localtime (time_t const *timep) +rpl_localtime (time_t const *timep) { #undef localtime extern struct tm *localtime (time_t const *); @@ -62,7 +62,7 @@ localtime (time_t const *timep) /* Same as above, since gmtime and localtime use the same buffer. */ struct tm * -gmtime (time_t const *timep) +rpl_gmtime (time_t const *timep) { #undef gmtime extern struct tm *gmtime (time_t const *); @@ -80,7 +80,7 @@ gmtime (time_t const *timep) /* This is a wrapper for tzset, for systems on which tzset may clobber the static buffer used for localtime's result. */ void -tzset (void) +rpl_tzset (void) { #undef tzset extern void tzset (void); @@ -98,7 +98,7 @@ tzset (void) causes problems. */ int -rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz) +rpl_gettimeofday (struct timeval *tv, void *tz) { #undef gettimeofday #if HAVE_GETTIMEOFDAY diff --git a/gnulib/inet_ntop.c b/gnulib/inet_ntop.c index 537b59f..a49b1e3 100644 --- a/gnulib/inet_ntop.c +++ b/gnulib/inet_ntop.c @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -70,8 +70,8 @@ static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t si * Paul Vixie, 1996. */ const char * -inet_ntop (int af, const void *restrict src, - char *restrict dst, socklen_t cnt) +inet_ntop (int af, const void *src, + char *dst, socklen_t cnt) { switch (af) { diff --git a/gnulib/inet_ntop.h b/gnulib/inet_ntop.h index bd1e085..aecb214 100644 --- a/gnulib/inet_ntop.h +++ b/gnulib/inet_ntop.h @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -37,6 +37,6 @@ . */ #if !HAVE_DECL_INET_NTOP -extern const char *inet_ntop (int af, const void *restrict src, - char *restrict dst, socklen_t cnt); +extern const char *inet_ntop (int af, const void *src, + char *dst, socklen_t cnt); #endif diff --git a/gnulib/lock.c b/gnulib/lock.c index 34a59ab..73cdc41 100644 --- a/gnulib/lock.c +++ b/gnulib/lock.c @@ -1,9 +1,9 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2006 Free Software Foundation, Inc. + Copyright (C) 2005-2007 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -250,7 +250,24 @@ glthread_rwlock_destroy (gl_rwlock_t *lock) # if HAVE_PTHREAD_MUTEX_RECURSIVE -# if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) +# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + +void +glthread_recursive_lock_init (gl_recursive_lock_t *lock) +{ + pthread_mutexattr_t attributes; + + if (pthread_mutexattr_init (&attributes) != 0) + abort (); + if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0) + abort (); + if (pthread_mutex_init (lock, &attributes) != 0) + abort (); + if (pthread_mutexattr_destroy (&attributes) != 0) + abort (); +} + +# else void glthread_recursive_lock_init (gl_recursive_lock_t *lock) diff --git a/gnulib/lock.h b/gnulib/lock.h index e6b312a..0494732 100644 --- a/gnulib/lock.h +++ b/gnulib/lock.h @@ -1,9 +1,9 @@ /* Locking in multithreaded situations. - Copyright (C) 2005-2006 Free Software Foundation, Inc. + Copyright (C) 2005-2007 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -147,13 +147,33 @@ typedef pthread_mutex_t gl_lock_t; # define gl_lock_initializer \ PTHREAD_MUTEX_INITIALIZER # define gl_lock_init(NAME) \ - if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_lock(NAME) \ - if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_unlock(NAME) \ - if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_destroy(NAME) \ - if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \ + abort (); \ + } \ + while (0) /* ------------------------- gl_rwlock_t datatype ------------------------- */ @@ -169,15 +189,40 @@ typedef pthread_rwlock_t gl_rwlock_t; # define gl_rwlock_initializer \ PTHREAD_RWLOCK_INITIALIZER # define gl_rwlock_init(NAME) \ - if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_rdlock(NAME) \ - if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_wrlock(NAME) \ - if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_unlock(NAME) \ - if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_destroy(NAME) \ - if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) \ + abort (); \ + } \ + while (0) # else @@ -195,15 +240,40 @@ typedef struct # define gl_rwlock_initializer \ { 0, PTHREAD_MUTEX_INITIALIZER } # define gl_rwlock_init(NAME) \ - if (pthread_in_use ()) glthread_rwlock_init (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_init (&NAME); \ + } \ + while (0) # define gl_rwlock_rdlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_rdlock (&NAME); \ + } \ + while (0) # define gl_rwlock_wrlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_wrlock (&NAME); \ + } \ + while (0) # define gl_rwlock_unlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_unlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_unlock (&NAME); \ + } \ + while (0) # define gl_rwlock_destroy(NAME) \ - if (pthread_in_use ()) glthread_rwlock_destroy (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_destroy (&NAME); \ + } \ + while (0) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); @@ -230,15 +300,40 @@ typedef struct # define gl_rwlock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } # define gl_rwlock_init(NAME) \ - if (pthread_in_use ()) glthread_rwlock_init (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_init (&NAME); \ + } \ + while (0) # define gl_rwlock_rdlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_rdlock (&NAME); \ + } \ + while (0) # define gl_rwlock_wrlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_wrlock (&NAME); \ + } \ + while (0) # define gl_rwlock_unlock(NAME) \ - if (pthread_in_use ()) glthread_rwlock_unlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_unlock (&NAME); \ + } \ + while (0) # define gl_rwlock_destroy(NAME) \ - if (pthread_in_use ()) glthread_rwlock_destroy (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_rwlock_destroy (&NAME); \ + } \ + while (0) extern void glthread_rwlock_init (gl_rwlock_t *lock); extern void glthread_rwlock_rdlock (gl_rwlock_t *lock); extern void glthread_rwlock_wrlock (gl_rwlock_t *lock); @@ -266,13 +361,34 @@ typedef pthread_mutex_t gl_recursive_lock_t; PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP # endif # define gl_recursive_lock_init(NAME) \ - if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort () + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_init (&NAME); \ + } \ + while (0) # define gl_recursive_lock_lock(NAME) \ - if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_recursive_lock_unlock(NAME) \ - if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_recursive_lock_destroy(NAME) \ - if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort () + do \ + { \ + if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \ + abort (); \ + } \ + while (0) +extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); # else @@ -290,13 +406,33 @@ typedef struct # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 } # define gl_recursive_lock_init(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_init (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_init (&NAME); \ + } \ + while (0) # define gl_recursive_lock_lock(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_lock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_unlock(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_unlock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_destroy(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_destroy (&NAME); \ + } \ + while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); @@ -323,13 +459,33 @@ typedef struct # define gl_recursive_lock_initializer \ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_init (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_init (&NAME); \ + } \ + while (0) # define gl_recursive_lock_lock(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_lock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_unlock(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_unlock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_destroy(NAME) \ - if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME) + do \ + { \ + if (pthread_in_use ()) \ + glthread_recursive_lock_destroy (&NAME); \ + } \ + while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); @@ -409,11 +565,26 @@ typedef pth_mutex_t gl_lock_t; # define gl_lock_initializer \ PTH_MUTEX_INIT # define gl_lock_init(NAME) \ - if (pth_in_use() && !pth_mutex_init (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_init (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_lock_lock(NAME) \ - if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \ + abort (); \ + } \ + while (0) # define gl_lock_unlock(NAME) \ - if (pth_in_use() && !pth_mutex_release (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_release (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_lock_destroy(NAME) \ (void)(&NAME) @@ -427,13 +598,35 @@ typedef pth_rwlock_t gl_rwlock_t; # define gl_rwlock_initializer \ PTH_RWLOCK_INIT # define gl_rwlock_init(NAME) \ - if (pth_in_use() && !pth_rwlock_init (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_rwlock_init (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_rwlock_rdlock(NAME) \ - if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort () + do \ + { \ + if (pth_in_use() \ + && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) \ + abort (); \ + } \ + while (0) # define gl_rwlock_wrlock(NAME) \ - if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort () + do \ + { \ + if (pth_in_use() \ + && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) \ + abort (); \ + } \ + while (0) # define gl_rwlock_unlock(NAME) \ - if (pth_in_use() && !pth_rwlock_release (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_rwlock_release (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_rwlock_destroy(NAME) \ (void)(&NAME) @@ -448,11 +641,26 @@ typedef pth_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_initializer \ PTH_MUTEX_INIT # define gl_recursive_lock_init(NAME) \ - if (pth_in_use() && !pth_mutex_init (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_init (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_recursive_lock_lock(NAME) \ - if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \ + abort (); \ + } \ + while (0) # define gl_recursive_lock_unlock(NAME) \ - if (pth_in_use() && !pth_mutex_release (&NAME)) abort () + do \ + { \ + if (pth_in_use() && !pth_mutex_release (&NAME)) \ + abort (); \ + } \ + while (0) # define gl_recursive_lock_destroy(NAME) \ (void)(&NAME) @@ -534,13 +742,33 @@ typedef mutex_t gl_lock_t; # define gl_lock_initializer \ DEFAULTMUTEX # define gl_lock_init(NAME) \ - if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) abort () + do \ + { \ + if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_lock(NAME) \ - if (thread_in_use () && mutex_lock (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && mutex_lock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_unlock(NAME) \ - if (thread_in_use () && mutex_unlock (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && mutex_unlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_lock_destroy(NAME) \ - if (thread_in_use () && mutex_destroy (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && mutex_destroy (&NAME) != 0) \ + abort (); \ + } \ + while (0) /* ------------------------- gl_rwlock_t datatype ------------------------- */ @@ -552,15 +780,40 @@ typedef rwlock_t gl_rwlock_t; # define gl_rwlock_initializer \ DEFAULTRWLOCK # define gl_rwlock_init(NAME) \ - if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) abort () + do \ + { \ + if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_rdlock(NAME) \ - if (thread_in_use () && rw_rdlock (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && rw_rdlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_wrlock(NAME) \ - if (thread_in_use () && rw_wrlock (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && rw_wrlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_unlock(NAME) \ - if (thread_in_use () && rw_unlock (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && rw_unlock (&NAME) != 0) \ + abort (); \ + } \ + while (0) # define gl_rwlock_destroy(NAME) \ - if (thread_in_use () && rwlock_destroy (&NAME) != 0) abort () + do \ + { \ + if (thread_in_use () && rwlock_destroy (&NAME) != 0) \ + abort (); \ + } \ + while (0) /* --------------------- gl_recursive_lock_t datatype --------------------- */ @@ -581,13 +834,33 @@ typedef struct # define gl_recursive_lock_initializer \ { DEFAULTMUTEX, (thread_t) 0, 0 } # define gl_recursive_lock_init(NAME) \ - if (thread_in_use ()) glthread_recursive_lock_init (&NAME) + do \ + { \ + if (thread_in_use ()) \ + glthread_recursive_lock_init (&NAME); \ + } \ + while (0) # define gl_recursive_lock_lock(NAME) \ - if (thread_in_use ()) glthread_recursive_lock_lock (&NAME) + do \ + { \ + if (thread_in_use ()) \ + glthread_recursive_lock_lock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_unlock(NAME) \ - if (thread_in_use ()) glthread_recursive_lock_unlock (&NAME) + do \ + { \ + if (thread_in_use ()) \ + glthread_recursive_lock_unlock (&NAME); \ + } \ + while (0) # define gl_recursive_lock_destroy(NAME) \ - if (thread_in_use ()) glthread_recursive_lock_destroy (&NAME) + do \ + { \ + if (thread_in_use ()) \ + glthread_recursive_lock_destroy (&NAME); \ + } \ + while (0) extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock); extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); diff --git a/gnulib/malloc.c b/gnulib/malloc.c index eba131d..f2f6663 100644 --- a/gnulib/malloc.c +++ b/gnulib/malloc.c @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/mkdtemp.c b/gnulib/mkdtemp.c index 36b6c75..6b9dd15 100644 --- a/gnulib/mkdtemp.c +++ b/gnulib/mkdtemp.c @@ -1,19 +1,18 @@ /* Copyright (C) 1999, 2001-2003, 2006-2007 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Extracted from misc/mkdtemp.c. */ diff --git a/gnulib/netinet_in.in.h b/gnulib/netinet_in.in.h new file mode 100644 index 0000000..c45e53b --- /dev/null +++ b/gnulib/netinet_in.in.h @@ -0,0 +1,43 @@ +/* Substitute for . + Copyright (C) 2007 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_NETINET_IN_H + +#if @HAVE_NETINET_IN_H@ + +/* On many platforms, assumes prior inclusion of + . */ +# include + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@ + +#endif + +#ifndef _GL_NETINET_IN_H +#define _GL_NETINET_IN_H + +#if !@HAVE_NETINET_IN_H@ + +/* A platform that lacks . */ + +# include + +#endif + +#endif /* _GL_NETINET_IN_H */ +#endif /* _GL_NETINET_IN_H */ diff --git a/gnulib/netinet_in_.h b/gnulib/netinet_in_.h deleted file mode 100644 index aa00e45..0000000 --- a/gnulib/netinet_in_.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Substitute for . - Copyright (C) 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_NETINET_IN_H - -#if @HAVE_NETINET_IN_H@ - -/* On many platforms, assumes prior inclusion of - . */ -# include - -/* The include_next requires a split double-inclusion guard. */ -# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@ - -#endif - -#ifndef _GL_NETINET_IN_H -#define _GL_NETINET_IN_H - -#if !@HAVE_NETINET_IN_H@ - -/* A platform that lacks . */ - -# include - -#endif - -#endif /* _GL_NETINET_IN_H */ -#endif /* _GL_NETINET_IN_H */ diff --git a/gnulib/physmem.c b/gnulib/physmem.c index 844817b..4b532e1 100644 --- a/gnulib/physmem.c +++ b/gnulib/physmem.c @@ -3,10 +3,10 @@ Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/gnulib/physmem.h b/gnulib/physmem.h index 931aede..95375d7 100644 --- a/gnulib/physmem.h +++ b/gnulib/physmem.h @@ -2,10 +2,10 @@ Copyright (C) 2000, 2003 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* Written by Paul Eggert. */ diff --git a/gnulib/printf-args.c b/gnulib/printf-args.c index 4978914..871c720 100644 --- a/gnulib/printf-args.c +++ b/gnulib/printf-args.c @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/printf-args.h b/gnulib/printf-args.h index 6f75e2a..67cb990 100644 --- a/gnulib/printf-args.h +++ b/gnulib/printf-args.h @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/printf-parse.c b/gnulib/printf-parse.c index 2e67980..28b9bd4 100644 --- a/gnulib/printf-parse.c +++ b/gnulib/printf-parse.c @@ -1,9 +1,9 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -49,7 +49,7 @@ #include /* Get intmax_t. */ -#ifdef IN_LIBINTL +#if defined IN_LIBINTL || defined IN_LIBASPRINTF # if HAVE_STDINT_H_WITH_UINTMAX # include # endif @@ -63,6 +63,9 @@ /* malloc(), realloc(), free(). */ #include +/* errno. */ +#include + /* Checked size_t computations. */ #include "xsize.h" @@ -89,7 +92,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ - return -1; + goto out_of_memory_1; a->count = 0; a_allocated = 0; @@ -109,13 +112,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ - goto error; \ + goto out_of_memory; \ memory = (argument *) (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ - goto error; \ + goto out_of_memory; \ a->arg = memory; \ } \ while (a->count <= n) \ @@ -389,6 +392,44 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) } cp++; } +#if defined __APPLE__ && defined __MACH__ + /* On MacOS X 10.3, PRIdMAX is defined as "qd". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'q') + { + if (64 / 8 > sizeof (long)) + { + /* int64_t = long long */ + flags += 16; + } + else + { + /* int64_t = long */ + flags += 8; + } + cp++; + } +#endif +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + /* On native Win32, PRIdMAX is defined as "I64d". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4') + { + if (64 / 8 > sizeof (long)) + { + /* __int64 = long long */ + flags += 16; + } + else + { + /* __int64 = long */ + flags += 8; + } + cp += 3; + } +#endif else break; } @@ -539,11 +580,11 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ - goto error; + goto out_of_memory; memory = (DIRECTIVE *) realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ - goto error; + goto out_of_memory; d->dir = memory; } } @@ -566,6 +607,16 @@ error: free (a->arg); if (d->dir) free (d->dir); + errno = EINVAL; + return -1; + +out_of_memory: + if (a->arg) + free (a->arg); + if (d->dir) + free (d->dir); +out_of_memory_1: + errno = ENOMEM; return -1; } diff --git a/gnulib/printf-parse.h b/gnulib/printf-parse.h index de7fc49..e5d68d7 100644 --- a/gnulib/printf-parse.h +++ b/gnulib/printf-parse.h @@ -3,7 +3,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/regenerate/no-restrict.patch b/gnulib/regenerate/no-restrict.patch new file mode 100644 index 0000000..dbb5809 --- /dev/null +++ b/gnulib/regenerate/no-restrict.patch @@ -0,0 +1,217 @@ +Index: gnulib/inet_ntop.c +=================================================================== +--- gnulib/inet_ntop.c (revision 10693) ++++ gnulib/inet_ntop.c (working copy) +@@ -70,8 +70,8 @@ + * Paul Vixie, 1996. + */ + const char * +-inet_ntop (int af, const void *restrict src, +- char *restrict dst, socklen_t cnt) ++inet_ntop (int af, const void *src, ++ char *dst, socklen_t cnt) + { + switch (af) + { +Index: gnulib/inet_ntop.h +=================================================================== +--- gnulib/inet_ntop.h (revision 10693) ++++ gnulib/inet_ntop.h (working copy) +@@ -37,6 +37,6 @@ + . */ + + #if !HAVE_DECL_INET_NTOP +-extern const char *inet_ntop (int af, const void *restrict src, +- char *restrict dst, socklen_t cnt); ++extern const char *inet_ntop (int af, const void *src, ++ char *dst, socklen_t cnt); + #endif +Index: gnulib/string.in.h +=================================================================== +--- gnulib/string.in.h (revision 10693) ++++ gnulib/string.in.h (working copy) +@@ -68,7 +68,7 @@ + last written byte. */ + #if @GNULIB_MEMPCPY@ + # if ! @HAVE_MEMPCPY@ +-extern void *mempcpy (void *restrict __dest, void const *restrict __src, ++extern void *mempcpy (void *__dest, void const *__src, + size_t __n); + # endif + #elif defined GNULIB_POSIXCHECK +@@ -96,7 +96,7 @@ + /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ + #if @GNULIB_STPCPY@ + # if ! @HAVE_STPCPY@ +-extern char *stpcpy (char *restrict __dst, char const *restrict __src); ++extern char *stpcpy (char *__dst, char const *__src); + # endif + #elif defined GNULIB_POSIXCHECK + # undef stpcpy +@@ -111,7 +111,7 @@ + #if @GNULIB_STPNCPY@ + # if ! @HAVE_STPNCPY@ + # define stpncpy gnu_stpncpy +-extern char *stpncpy (char *restrict __dst, char const *restrict __src, ++extern char *stpncpy (char *__dst, char const *__src, + size_t __n); + # endif + #elif defined GNULIB_POSIXCHECK +@@ -272,7 +272,7 @@ + See also strtok_r(). */ + #if @GNULIB_STRSEP@ + # if ! @HAVE_STRSEP@ +-extern char *strsep (char **restrict __stringp, char const *restrict __delim); ++extern char *strsep (char **__stringp, char const *__delim); + # endif + # if defined GNULIB_POSIXCHECK + # undef strsep +@@ -359,8 +359,8 @@ + See also strsep(). */ + #if @GNULIB_STRTOK_R@ + # if ! @HAVE_DECL_STRTOK_R@ +-extern char *strtok_r (char *restrict s, char const *restrict delim, +- char **restrict save_ptr); ++extern char *strtok_r (char *s, char const *delim, ++ char **save_ptr); + # endif + # if defined GNULIB_POSIXCHECK + # undef strtok_r +Index: gnulib/gettimeofday.c +=================================================================== +--- gnulib/gettimeofday.c (revision 10693) ++++ gnulib/gettimeofday.c (working copy) +@@ -98,7 +98,7 @@ + causes problems. */ + + int +-rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz) ++rpl_gettimeofday (struct timeval *tv, void *tz) + { + #undef gettimeofday + #if HAVE_GETTIMEOFDAY +Index: gnulib/sys_time.in.h +=================================================================== +--- gnulib/sys_time.in.h (revision 10693) ++++ gnulib/sys_time.in.h (working copy) +@@ -46,7 +46,7 @@ + # if @REPLACE_GETTIMEOFDAY@ + # undef gettimeofday + # define gettimeofday rpl_gettimeofday +-int gettimeofday (struct timeval *restrict, void *restrict); ++int gettimeofday (struct timeval *, void *); + # endif + + #endif /* _GL_SYS_TIME_H */ +Index: gnulib/base64.c +=================================================================== +--- gnulib/base64.c (revision 10693) ++++ gnulib/base64.c (working copy) +@@ -64,8 +64,8 @@ + possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero + terminate the output buffer. */ + void +-base64_encode (const char *restrict in, size_t inlen, +- char *restrict out, size_t outlen) ++base64_encode (const char *in, size_t inlen, ++ char *out, size_t outlen) + { + static const char b64str[64] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +@@ -310,8 +310,8 @@ + that, when applicable, you must remove any line terminators that is + part of the data stream before calling this function. */ + bool +-base64_decode (const char *restrict in, size_t inlen, +- char *restrict out, size_t *outlen) ++base64_decode (const char *in, size_t inlen, ++ char *out, size_t *outlen) + { + size_t outleft = *outlen; + +Index: gnulib/getaddrinfo.c +=================================================================== +--- gnulib/getaddrinfo.c (revision 10693) ++++ gnulib/getaddrinfo.c (working copy) +@@ -123,10 +123,10 @@ + /* Translate name of a service location and/or a service name to set of + socket addresses. */ + int +-getaddrinfo (const char *restrict nodename, +- const char *restrict servname, +- const struct addrinfo *restrict hints, +- struct addrinfo **restrict res) ++getaddrinfo (const char *nodename, ++ const char *servname, ++ const struct addrinfo *hints, ++ struct addrinfo **res) + { + struct addrinfo *tmp; + int port = 0; +@@ -337,9 +337,9 @@ + } + } + +-int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, +- char *restrict node, socklen_t nodelen, +- char *restrict service, socklen_t servicelen, ++int getnameinfo(const struct sockaddr *sa, socklen_t salen, ++ char *node, socklen_t nodelen, ++ char *service, socklen_t servicelen, + int flags) + { + #ifdef WIN32_NATIVE +Index: gnulib/base64.h +=================================================================== +--- gnulib/base64.h (revision 10693) ++++ gnulib/base64.h (working copy) +@@ -31,13 +31,13 @@ + + extern bool isbase64 (char ch); + +-extern void base64_encode (const char *restrict in, size_t inlen, +- char *restrict out, size_t outlen); ++extern void base64_encode (const char *in, size_t inlen, ++ char *out, size_t outlen); + + extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out); + +-extern bool base64_decode (const char *restrict in, size_t inlen, +- char *restrict out, size_t *outlen); ++extern bool base64_decode (const char *in, size_t inlen, ++ char *out, size_t *outlen); + + extern bool base64_decode_alloc (const char *in, size_t inlen, + char **out, size_t *outlen); +Index: gnulib/getaddrinfo.h +=================================================================== +--- gnulib/getaddrinfo.h (revision 10693) ++++ gnulib/getaddrinfo.h (working copy) +@@ -113,10 +113,10 @@ + socket addresses. + For more details, see the POSIX:2001 specification + . */ +-extern int getaddrinfo (const char *restrict nodename, +- const char *restrict servname, +- const struct addrinfo *restrict hints, +- struct addrinfo **restrict res); ++extern int getaddrinfo (const char *nodename, ++ const char *servname, ++ const struct addrinfo *hints, ++ struct addrinfo **res); + #endif + + #if !HAVE_DECL_FREEADDRINFO +@@ -137,9 +137,9 @@ + /* Convert socket address to printable node and service names. + For more details, see the POSIX:2001 specification + . */ +-extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, +- char *restrict node, socklen_t nodelen, +- char *restrict service, socklen_t servicelen, ++extern int getnameinfo(const struct sockaddr *sa, socklen_t salen, ++ char *node, socklen_t nodelen, ++ char *service, socklen_t servicelen, + int flags); + + #endif diff --git a/gnulib/regenerate/regenerate b/gnulib/regenerate/regenerate index a32ab34..5669916 100755 --- a/gnulib/regenerate/regenerate +++ b/gnulib/regenerate/regenerate @@ -1,7 +1,10 @@ #! /bin/bash -# Gnulib files in zmanda repo are from gnulib CVS updated with: -# cvs update -D '2007-10-25 17:00:00 -0600' +# Gnulib files in zmanda repo are from gnulib GIT. To check out the +# same version as was used to generate the source in the repository, +# run the following in your git repository: +# +# git checkout 03400ebfaa064922caf3767d6641d7e1cdc8cd1b # get to the project root cd `dirname $0`/../.. @@ -36,7 +39,8 @@ shopt -u nullglob ## Add your modules here, then see below if you need to patch them. ## ###################################################################### -GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage mkdtemp" +GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage" +GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt full-read full-write" ###################################################################### ## End modules ## @@ -59,16 +63,17 @@ PATCH_DIR="`pwd`/gnulib/regenerate" # Patch Makefile.am to not error out on warnings patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1 - # Add John's patches to getaddrinfo.c for use in cygwin patch -p0 < "${PATCH_DIR}/getaddrinfo-cygwin.patch" || exit 1 +# Add John's patches to eliminate restrict attributes. +patch -p0 < "${PATCH_DIR}/no-restrict.patch" || exit 1 # Add info to the makefile to ensure all this stuff gets put in # the distribution tarball ( echo "" echo "# Make sure regenerate/* are in the distribution tarball" - echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print ` + echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print | sort` ) >> gnulib/Makefile.am ###################################################################### diff --git a/gnulib/safe-read.c b/gnulib/safe-read.c index b7bf1d5..0cb1ede 100644 --- a/gnulib/safe-read.c +++ b/gnulib/safe-read.c @@ -3,10 +3,10 @@ Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/safe-read.h b/gnulib/safe-read.h index 3451955..ba19171 100644 --- a/gnulib/safe-read.h +++ b/gnulib/safe-read.h @@ -1,10 +1,10 @@ /* An interface to read() that retries after interrupts. Copyright (C) 2002, 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/safe-write.c b/gnulib/safe-write.c index 4c375a6..b644f7c 100644 --- a/gnulib/safe-write.c +++ b/gnulib/safe-write.c @@ -1,10 +1,10 @@ /* An interface to write that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #define SAFE_WRITE #include "safe-read.c" diff --git a/gnulib/safe-write.h b/gnulib/safe-write.h index c194636..da036a9 100644 --- a/gnulib/safe-write.h +++ b/gnulib/safe-write.h @@ -1,10 +1,10 @@ /* An interface to write() that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -12,8 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ #include diff --git a/gnulib/size_max.h b/gnulib/size_max.h index ed0bc13..2ccc5f0 100644 --- a/gnulib/size_max.h +++ b/gnulib/size_max.h @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/snprintf.c b/gnulib/snprintf.c index 7314c83..960cfdb 100644 --- a/gnulib/snprintf.c +++ b/gnulib/snprintf.c @@ -4,7 +4,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/stdbool.in.h b/gnulib/stdbool.in.h new file mode 100644 index 0000000..171d70a --- /dev/null +++ b/gnulib/stdbool.in.h @@ -0,0 +1,119 @@ +/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_STDBOOL_H +#define _GL_STDBOOL_H + +/* ISO C 99 for platforms that lack it. */ + +/* Usage suggestions: + + Programs that use should be aware of some limitations + and standards compliance issues. + + Standards compliance: + + - must be #included before 'bool', 'false', 'true' + can be used. + + - You cannot assume that sizeof (bool) == 1. + + - Programs should not undefine the macros bool, true, and false, + as C99 lists that as an "obsolescent feature". + + Limitations of this substitute, when used in a C89 environment: + + - must be #included before the '_Bool' type can be used. + + - You cannot assume that _Bool is a typedef; it might be a macro. + + - Bit-fields of type 'bool' are not supported. Portable code + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. + + - In C99, casts and automatic conversions to '_Bool' or 'bool' are + performed in such a way that every nonzero value gets converted + to 'true', and zero gets converted to 'false'. This doesn't work + with this substitute. With this substitute, only the values 0 and 1 + give the expected result when converted to _Bool' or 'bool'. + + Also, it is suggested that programs use 'bool' rather than '_Bool'; + this isn't required, but 'bool' is more common. */ + + +/* 7.16. Boolean type and values */ + +/* BeOS already #defines false 0, true 1. We use the same + definitions below, but temporarily we have to #undef them. */ +#ifdef __BEOS__ +# include /* defines bool but not _Bool */ +# undef false +# undef true +#endif + +/* For the sake of symbolic names in gdb, we define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But if we do + this, values of type '_Bool' may promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ +#if defined __cplusplus || defined __BEOS__ + /* A compiler known to have 'bool'. */ + /* If the compiler already has both 'bool' and '_Bool', we can assume they + are the same types. */ +# if !@HAVE__BOOL@ +typedef bool _Bool; +# endif +#else +# if !defined __GNUC__ + /* If @HAVE__BOOL@: + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when + the built-in _Bool type is used. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + Similar bugs are likely with other compilers as well; this file + wouldn't be used if was working. + So we override the _Bool type. + If !@HAVE__BOOL@: + Need to define _Bool ourselves. As 'signed char' or as an enum type? + Use of a typedef, with SunPRO C, leads to a stupid + "warning: _Bool is a keyword in ISO C99". + Use of an enum type, with IRIX cc, leads to a stupid + "warning(1185): enumerated type mixed with another type". + Even the existence of an enum type, without a typedef, + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. + The only benefit of the enum, debuggability, is not important + with these compilers. So use 'signed char' and no enum. */ +# define _Bool signed char +# else + /* With this compiler, trust the _Bool type if the compiler has it. */ +# if !@HAVE__BOOL@ +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif +# endif +#endif +#define bool _Bool + +/* The other macros must be usable in preprocessor directives. */ +#define false 0 +#define true 1 +#define __bool_true_false_are_defined 1 + +#endif /* _GL_STDBOOL_H */ diff --git a/gnulib/stdbool_.h b/gnulib/stdbool_.h deleted file mode 100644 index 150a010..0000000 --- a/gnulib/stdbool_.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (C) 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc. - Written by Bruno Haible , 2001. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_STDBOOL_H -#define _GL_STDBOOL_H - -/* ISO C 99 for platforms that lack it. */ - -/* Usage suggestions: - - Programs that use should be aware of some limitations - and standards compliance issues. - - Standards compliance: - - - must be #included before 'bool', 'false', 'true' - can be used. - - - You cannot assume that sizeof (bool) == 1. - - - Programs should not undefine the macros bool, true, and false, - as C99 lists that as an "obsolescent feature". - - Limitations of this substitute, when used in a C89 environment: - - - must be #included before the '_Bool' type can be used. - - - You cannot assume that _Bool is a typedef; it might be a macro. - - - Bit-fields of type 'bool' are not supported. Portable code - should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'. - - - In C99, casts and automatic conversions to '_Bool' or 'bool' are - performed in such a way that every nonzero value gets converted - to 'true', and zero gets converted to 'false'. This doesn't work - with this substitute. With this substitute, only the values 0 and 1 - give the expected result when converted to _Bool' or 'bool'. - - Also, it is suggested that programs use 'bool' rather than '_Bool'; - this isn't required, but 'bool' is more common. */ - - -/* 7.16. Boolean type and values */ - -/* BeOS already #defines false 0, true 1. We use the same - definitions below, but temporarily we have to #undef them. */ -#ifdef __BEOS__ -# include /* defines bool but not _Bool */ -# undef false -# undef true -#endif - -/* For the sake of symbolic names in gdb, we define true and false as - enum constants, not only as macros. - It is tempting to write - typedef enum { false = 0, true = 1 } _Bool; - so that gdb prints values of type 'bool' symbolically. But if we do - this, values of type '_Bool' may promote to 'int' or 'unsigned int' - (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' - (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the - enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || defined __BEOS__ - /* A compiler known to have 'bool'. */ - /* If the compiler already has both 'bool' and '_Bool', we can assume they - are the same types. */ -# if !@HAVE__BOOL@ -typedef bool _Bool; -# endif -#else -# if !defined __GNUC__ - /* If @HAVE__BOOL@: - Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when - the built-in _Bool type is used. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html - Similar bugs are likely with other compilers as well; this file - wouldn't be used if was working. - So we override the _Bool type. - If !@HAVE__BOOL@: - Need to define _Bool ourselves. As 'signed char' or as an enum type? - Use of a typedef, with SunPRO C, leads to a stupid - "warning: _Bool is a keyword in ISO C99". - Use of an enum type, with IRIX cc, leads to a stupid - "warning(1185): enumerated type mixed with another type". - The only benefit of the enum type, debuggability, is not important - with these compilers. So use 'signed char' and no typedef. */ -# define _Bool signed char -enum { false = 0, true = 1 }; -# else - /* With this compiler, trust the _Bool type if the compiler has it. */ -# if !@HAVE__BOOL@ -typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; -# endif -# endif -#endif -#define bool _Bool - -/* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 -#define __bool_true_false_are_defined 1 - -#endif /* _GL_STDBOOL_H */ diff --git a/gnulib/stdint.in.h b/gnulib/stdint.in.h new file mode 100644 index 0000000..67baceb --- /dev/null +++ b/gnulib/stdint.in.h @@ -0,0 +1,522 @@ +/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. + Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. + This file is part of gnulib. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* + * ISO C 99 for platforms that lack it. + * + */ + +#ifndef _GL_STDINT_H + +/* When including a system file that in turn includes , + use the system , not our substitute. This avoids + problems with (for example) VMS, whose includes + . */ +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* Get those types that are already defined in other system include + files, so that we can "#define int8_t signed char" below without + worrying about a later system include file containing a "typedef + signed char int8_t;" that will get messed up by our macro. Our + macros should all be consistent with the system versions, except + for the "fast" types and macros, which we recommend against using + in public interfaces due to compiler differences. */ + +#if @HAVE_STDINT_H@ +# if defined __sgi && ! defined __c99 + /* Bypass IRIX's if in C89 mode, since it merely annoys users + with "This header file is to be used only for c99 mode compilations" + diagnostics. */ +# define __STDINT_H__ +# endif + /* Other systems may have an incomplete or buggy . + Include it before , since any "#include " + in would reinclude us, skipping our contents because + _GL_STDINT_H is defined. + The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_STDINT_H@ +#endif + +#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _GL_STDINT_H + +/* defines some of the stdint.h types as well, on glibc, + IRIX 6.5, and OpenBSD 3.8 (via ). + AIX 5.2 isn't needed and causes troubles. + MacOS X 10.4.6 includes (which is us), but + relies on the system definitions, so include + after @NEXT_STDINT_H@. */ +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include +#endif + +/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ +#include + +#if @HAVE_INTTYPES_H@ + /* In OpenBSD 3.8, includes , which defines + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. + also defines intptr_t and uintptr_t. */ +# include +#elif @HAVE_SYS_INTTYPES_H@ + /* Solaris 7 has the types except the *_fast*_t types, and + the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ +# include +#endif + +#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ + /* Linux libc4 >= 4.6.7 and libc5 have a that defines + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is + included by . */ +# include +#endif + +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS + +/* Get WCHAR_MIN, WCHAR_MAX. */ +# if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# include +# endif + +#endif + +#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H + +/* Minimum and maximum values for a integer type under the usual assumption. + Return an unspecified value if BITS == 0, adding a check to pacify + picky compilers. */ + +#define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) + +#define _STDINT_MAX(signed, bits, zero) \ + ((signed) \ + ? ~ _STDINT_MIN (signed, bits, zero) \ + : /* The expression for the unsigned case. The subtraction of (signed) \ + is a nop in the unsigned case and avoids "signed integer overflow" \ + warnings in the signed case. */ \ + ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) + +/* 7.18.1.1. Exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef int8_t +#undef uint8_t +#define int8_t signed char +#define uint8_t unsigned char + +#undef int16_t +#undef uint16_t +#define int16_t short int +#define uint16_t unsigned short int + +#undef int32_t +#undef uint32_t +#define int32_t int +#define uint32_t unsigned int + +/* Do not undefine int64_t if gnulib is not being used with 64-bit + types, since otherwise it breaks platforms like Tandem/NSK. */ +#if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t +# define int64_t long int +# define GL_INT64_T +#elif defined _MSC_VER +# undef int64_t +# define int64_t __int64 +# define GL_INT64_T +#elif @HAVE_LONG_LONG_INT@ +# undef int64_t +# define int64_t long long int +# define GL_INT64_T +#endif + +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +# define uint64_t unsigned long int +# define GL_UINT64_T +#elif defined _MSC_VER +# undef uint64_t +# define uint64_t unsigned __int64 +# define GL_UINT64_T +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t +# define uint64_t unsigned long long int +# define GL_UINT64_T +#endif + +/* Avoid collision with Solaris 2.5.1 etc. */ +#define _UINT8_T +#define _UINT32_T +#define _UINT64_T + + +/* 7.18.1.2. Minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef int_least8_t +#undef uint_least8_t +#undef int_least16_t +#undef uint_least16_t +#undef int_least32_t +#undef uint_least32_t +#undef int_least64_t +#undef uint_least64_t +#define int_least8_t int8_t +#define uint_least8_t uint8_t +#define int_least16_t int16_t +#define uint_least16_t uint16_t +#define int_least32_t int32_t +#define uint_least32_t uint32_t +#ifdef GL_INT64_T +# define int_least64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_least64_t uint64_t +#endif + +/* 7.18.1.3. Fastest minimum-width integer types */ + +/* Note: Other substitutes may define these types differently. + It is not recommended to use these types in public header files. */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. Assume that 'long int' + is fast enough for all narrower integers. */ + +#undef int_fast8_t +#undef uint_fast8_t +#undef int_fast16_t +#undef uint_fast16_t +#undef int_fast32_t +#undef uint_fast32_t +#undef int_fast64_t +#undef uint_fast64_t +#define int_fast8_t long int +#define uint_fast8_t unsigned int_fast8_t +#define int_fast16_t long int +#define uint_fast16_t unsigned int_fast16_t +#define int_fast32_t long int +#define uint_fast32_t unsigned int_fast32_t +#ifdef GL_INT64_T +# define int_fast64_t int64_t +#endif +#ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +#endif + +/* 7.18.1.4. Integer types capable of holding object pointers */ + +#undef intptr_t +#undef uintptr_t +#define intptr_t long int +#define uintptr_t unsigned long int + +/* 7.18.1.5. Greatest-width integer types */ + +/* Note: These types are compiler dependent. It may be unwise to use them in + public header files. */ + +#undef intmax_t +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define intmax_t long long int +#elif defined GL_INT64_T +# define intmax_t int64_t +#else +# define intmax_t long int +#endif + +#undef uintmax_t +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define uintmax_t unsigned long long int +#elif defined GL_UINT64_T +# define uintmax_t uint64_t +#else +# define uintmax_t unsigned long int +#endif + +/* Verify that intmax_t and uintmax_t have the same size. Too much code + breaks if this is not the case. If this check fails, the reason is likely + to be found in the autoconf macros. */ +typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1]; + +/* 7.18.2. Limits of specified-width integer types */ + +#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS + +/* 7.18.2.1. Limits of exact-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. */ + +#undef INT8_MIN +#undef INT8_MAX +#undef UINT8_MAX +#define INT8_MIN (~ INT8_MAX) +#define INT8_MAX 127 +#define UINT8_MAX 255 + +#undef INT16_MIN +#undef INT16_MAX +#undef UINT16_MAX +#define INT16_MIN (~ INT16_MAX) +#define INT16_MAX 32767 +#define UINT16_MAX 65535 + +#undef INT32_MIN +#undef INT32_MAX +#undef UINT32_MAX +#define INT32_MIN (~ INT32_MAX) +#define INT32_MAX 2147483647 +#define UINT32_MAX 4294967295U + +#undef INT64_MIN +#undef INT64_MAX +#ifdef GL_INT64_T +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 + evaluates the latter incorrectly in preprocessor expressions. */ +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +#endif + +#undef UINT64_MAX +#ifdef GL_UINT64_T +# define UINT64_MAX UINTMAX_C (18446744073709551615) +#endif + +/* 7.18.2.2. Limits of minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types + are the same as the corresponding N_t types. */ + +#undef INT_LEAST8_MIN +#undef INT_LEAST8_MAX +#undef UINT_LEAST8_MAX +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define UINT_LEAST8_MAX UINT8_MAX + +#undef INT_LEAST16_MIN +#undef INT_LEAST16_MAX +#undef UINT_LEAST16_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define UINT_LEAST16_MAX UINT16_MAX + +#undef INT_LEAST32_MIN +#undef INT_LEAST32_MAX +#undef UINT_LEAST32_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define UINT_LEAST32_MAX UINT32_MAX + +#undef INT_LEAST64_MIN +#undef INT_LEAST64_MAX +#ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +#endif + +#undef UINT_LEAST64_MAX +#ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.3. Limits of fastest minimum-width integer types */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types + are taken from the same list of types. */ + +#undef INT_FAST8_MIN +#undef INT_FAST8_MAX +#undef UINT_FAST8_MAX +#define INT_FAST8_MIN LONG_MIN +#define INT_FAST8_MAX LONG_MAX +#define UINT_FAST8_MAX ULONG_MAX + +#undef INT_FAST16_MIN +#undef INT_FAST16_MAX +#undef UINT_FAST16_MAX +#define INT_FAST16_MIN LONG_MIN +#define INT_FAST16_MAX LONG_MAX +#define UINT_FAST16_MAX ULONG_MAX + +#undef INT_FAST32_MIN +#undef INT_FAST32_MAX +#undef UINT_FAST32_MAX +#define INT_FAST32_MIN LONG_MIN +#define INT_FAST32_MAX LONG_MAX +#define UINT_FAST32_MAX ULONG_MAX + +#undef INT_FAST64_MIN +#undef INT_FAST64_MAX +#ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +#endif + +#undef UINT_FAST64_MAX +#ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +#endif + +/* 7.18.2.4. Limits of integer types capable of holding object pointers */ + +#undef INTPTR_MIN +#undef INTPTR_MAX +#undef UINTPTR_MAX +#define INTPTR_MIN LONG_MIN +#define INTPTR_MAX LONG_MAX +#define UINTPTR_MAX ULONG_MAX + +/* 7.18.2.5. Limits of greatest-width integer types */ + +#undef INTMAX_MIN +#undef INTMAX_MAX +#ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +#else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +#endif + +#undef UINTMAX_MAX +#ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +#else +# define UINTMAX_MAX UINT32_MAX +#endif + +/* 7.18.3. Limits of other integer types */ + +/* ptrdiff_t limits */ +#undef PTRDIFF_MIN +#undef PTRDIFF_MAX +#define PTRDIFF_MIN \ + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) +#define PTRDIFF_MAX \ + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) + +/* sig_atomic_t limits */ +#undef SIG_ATOMIC_MIN +#undef SIG_ATOMIC_MAX +#define SIG_ATOMIC_MIN \ + _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) +#define SIG_ATOMIC_MAX \ + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ + 0@SIG_ATOMIC_T_SUFFIX@) + + +/* size_t limit */ +#undef SIZE_MAX +#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) + +/* wchar_t limits */ +#undef WCHAR_MIN +#undef WCHAR_MAX +#define WCHAR_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) +#define WCHAR_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) + +/* wint_t limits */ +#undef WINT_MIN +#undef WINT_MAX +#define WINT_MIN \ + _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) +#define WINT_MAX \ + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) + +#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ + +/* 7.18.4. Macros for integer constants */ + +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS + +/* 7.18.4.1. Macros for minimum-width integer constants */ +/* According to ISO C 99 Technical Corrigendum 1 */ + +/* Here we assume a standard architecture where the hardware integer + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ + +#undef INT8_C +#undef UINT8_C +#define INT8_C(x) x +#define UINT8_C(x) x + +#undef INT16_C +#undef UINT16_C +#define INT16_C(x) x +#define UINT16_C(x) x + +#undef INT32_C +#undef UINT32_C +#define INT32_C(x) x +#define UINT32_C(x) x ## U + +#undef INT64_C +#undef UINT64_C +#if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +#elif defined _MSC_VER +# define INT64_C(x) x##i64 +#elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +#endif +#if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +#elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +#endif + +/* 7.18.4.2. Macros for greatest-width integer constants */ + +#undef INTMAX_C +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +#elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +#else +# define INTMAX_C(x) x##L +#endif + +#undef UINTMAX_C +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +#elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +#else +# define UINTMAX_C(x) x##UL +#endif + +#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ + +#endif /* _GL_STDINT_H */ +#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff --git a/gnulib/stdint_.h b/gnulib/stdint_.h deleted file mode 100644 index 121118c..0000000 --- a/gnulib/stdint_.h +++ /dev/null @@ -1,508 +0,0 @@ -/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. - Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. - This file is part of gnulib. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* - * ISO C 99 for platforms that lack it. - * - */ - -#ifndef _GL_STDINT_H - -/* Get those types that are already defined in other system include - files, so that we can "#define int8_t signed char" below without - worrying about a later system include file containing a "typedef - signed char int8_t;" that will get messed up by our macro. Our - macros should all be consistent with the system versions, except - for the "fast" types and macros, which we recommend against using - in public interfaces due to compiler differences. */ - -#if @HAVE_STDINT_H@ -# if defined __sgi && ! defined __c99 - /* Bypass IRIX's if in C89 mode, since it merely annoys users - with "This header file is to be used only for c99 mode compilations" - diagnostics. */ -# define __STDINT_H__ -# endif - /* Other systems may have an incomplete or buggy . - Include it before , since any "#include " - in would reinclude us, skipping our contents because - _GL_STDINT_H is defined. - The include_next requires a split double-inclusion guard. */ -# @INCLUDE_NEXT@ @NEXT_STDINT_H@ -#endif - -#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H -#define _GL_STDINT_H - -/* defines some of the stdint.h types as well, on glibc, - IRIX 6.5, and OpenBSD 3.8 (via ). - AIX 5.2 isn't needed and causes troubles. - MacOS X 10.4.6 includes (which is us), but - relies on the system definitions, so include - after @NEXT_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ && ! defined _AIX -# include -#endif - -/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */ -#include - -#if @HAVE_INTTYPES_H@ - /* In OpenBSD 3.8, includes , which defines - int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. - also defines intptr_t and uintptr_t. */ -# define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -# include -# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H -#elif @HAVE_SYS_INTTYPES_H@ - /* Solaris 7 has the types except the *_fast*_t types, and - the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ -# include -#endif - -#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ - /* Linux libc4 >= 4.6.7 and libc5 have a that defines - int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is - included by . */ -# include -#endif - -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* Get WCHAR_MIN, WCHAR_MAX. */ -# if ! (defined WCHAR_MIN && defined WCHAR_MAX) -# include -# endif - -#endif - -/* Minimum and maximum values for a integer type under the usual assumption. - Return an unspecified value if BITS == 0, adding a check to pacify - picky compilers. */ - -#define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) - -#define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : ((((zero) + 1) << ((bits) ? (bits) - 1 : 0)) - 1) * 2 + 1) - -/* 7.18.1.1. Exact-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. */ - -#undef int8_t -#undef uint8_t -#define int8_t signed char -#define uint8_t unsigned char - -#undef int16_t -#undef uint16_t -#define int16_t short int -#define uint16_t unsigned short int - -#undef int32_t -#undef uint32_t -#define int32_t int -#define uint32_t unsigned int - -/* Do not undefine int64_t if gnulib is not being used with 64-bit - types, since otherwise it breaks platforms like Tandem/NSK. */ -#if LONG_MAX >> 31 >> 31 == 1 -# undef int64_t -# define int64_t long int -# define GL_INT64_T -#elif defined _MSC_VER -# undef int64_t -# define int64_t __int64 -# define GL_INT64_T -#elif @HAVE_LONG_LONG_INT@ -# undef int64_t -# define int64_t long long int -# define GL_INT64_T -#endif - -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# undef uint64_t -# define uint64_t unsigned long int -# define GL_UINT64_T -#elif defined _MSC_VER -# undef uint64_t -# define uint64_t unsigned __int64 -# define GL_UINT64_T -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# undef uint64_t -# define uint64_t unsigned long long int -# define GL_UINT64_T -#endif - -/* Avoid collision with Solaris 2.5.1 etc. */ -#define _UINT8_T -#define _UINT32_T -#define _UINT64_T - - -/* 7.18.1.2. Minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types - are the same as the corresponding N_t types. */ - -#undef int_least8_t -#undef uint_least8_t -#undef int_least16_t -#undef uint_least16_t -#undef int_least32_t -#undef uint_least32_t -#undef int_least64_t -#undef uint_least64_t -#define int_least8_t int8_t -#define uint_least8_t uint8_t -#define int_least16_t int16_t -#define uint_least16_t uint16_t -#define int_least32_t int32_t -#define uint_least32_t uint32_t -#ifdef GL_INT64_T -# define int_least64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_least64_t uint64_t -#endif - -/* 7.18.1.3. Fastest minimum-width integer types */ - -/* Note: Other substitutes may define these types differently. - It is not recommended to use these types in public header files. */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types - are taken from the same list of types. Assume that 'long int' - is fast enough for all narrower integers. */ - -#undef int_fast8_t -#undef uint_fast8_t -#undef int_fast16_t -#undef uint_fast16_t -#undef int_fast32_t -#undef uint_fast32_t -#undef int_fast64_t -#undef uint_fast64_t -#define int_fast8_t long int -#define uint_fast8_t unsigned int_fast8_t -#define int_fast16_t long int -#define uint_fast16_t unsigned int_fast16_t -#define int_fast32_t long int -#define uint_fast32_t unsigned int_fast32_t -#ifdef GL_INT64_T -# define int_fast64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_fast64_t uint64_t -#endif - -/* 7.18.1.4. Integer types capable of holding object pointers */ - -#undef intptr_t -#undef uintptr_t -#define intptr_t long int -#define uintptr_t unsigned long int - -/* 7.18.1.5. Greatest-width integer types */ - -/* Note: These types are compiler dependent. It may be unwise to use them in - public header files. */ - -#undef intmax_t -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define intmax_t long long int -#elif defined GL_INT64_T -# define intmax_t int64_t -#else -# define intmax_t long int -#endif - -#undef uintmax_t -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define uintmax_t unsigned long long int -#elif defined GL_UINT64_T -# define uintmax_t uint64_t -#else -# define uintmax_t unsigned long int -#endif - -/* 7.18.2. Limits of specified-width integer types */ - -#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS - -/* 7.18.2.1. Limits of exact-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. */ - -#undef INT8_MIN -#undef INT8_MAX -#undef UINT8_MAX -#define INT8_MIN (~ INT8_MAX) -#define INT8_MAX 127 -#define UINT8_MAX 255 - -#undef INT16_MIN -#undef INT16_MAX -#undef UINT16_MAX -#define INT16_MIN (~ INT16_MAX) -#define INT16_MAX 32767 -#define UINT16_MAX 65535 - -#undef INT32_MIN -#undef INT32_MAX -#undef UINT32_MAX -#define INT32_MIN (~ INT32_MAX) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U - -#undef INT64_MIN -#undef INT64_MAX -#ifdef GL_INT64_T -/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 - evaluates the latter incorrectly in preprocessor expressions. */ -# define INT64_MIN (- INTMAX_C (1) << 63) -# define INT64_MAX INTMAX_C (9223372036854775807) -#endif - -#undef UINT64_MAX -#ifdef GL_UINT64_T -# define UINT64_MAX UINTMAX_C (18446744073709551615) -#endif - -/* 7.18.2.2. Limits of minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types - are the same as the corresponding N_t types. */ - -#undef INT_LEAST8_MIN -#undef INT_LEAST8_MAX -#undef UINT_LEAST8_MAX -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define UINT_LEAST8_MAX UINT8_MAX - -#undef INT_LEAST16_MIN -#undef INT_LEAST16_MAX -#undef UINT_LEAST16_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define UINT_LEAST16_MAX UINT16_MAX - -#undef INT_LEAST32_MIN -#undef INT_LEAST32_MAX -#undef UINT_LEAST32_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define UINT_LEAST32_MAX UINT32_MAX - -#undef INT_LEAST64_MIN -#undef INT_LEAST64_MAX -#ifdef GL_INT64_T -# define INT_LEAST64_MIN INT64_MIN -# define INT_LEAST64_MAX INT64_MAX -#endif - -#undef UINT_LEAST64_MAX -#ifdef GL_UINT64_T -# define UINT_LEAST64_MAX UINT64_MAX -#endif - -/* 7.18.2.3. Limits of fastest minimum-width integer types */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types - are taken from the same list of types. */ - -#undef INT_FAST8_MIN -#undef INT_FAST8_MAX -#undef UINT_FAST8_MAX -#define INT_FAST8_MIN LONG_MIN -#define INT_FAST8_MAX LONG_MAX -#define UINT_FAST8_MAX ULONG_MAX - -#undef INT_FAST16_MIN -#undef INT_FAST16_MAX -#undef UINT_FAST16_MAX -#define INT_FAST16_MIN LONG_MIN -#define INT_FAST16_MAX LONG_MAX -#define UINT_FAST16_MAX ULONG_MAX - -#undef INT_FAST32_MIN -#undef INT_FAST32_MAX -#undef UINT_FAST32_MAX -#define INT_FAST32_MIN LONG_MIN -#define INT_FAST32_MAX LONG_MAX -#define UINT_FAST32_MAX ULONG_MAX - -#undef INT_FAST64_MIN -#undef INT_FAST64_MAX -#ifdef GL_INT64_T -# define INT_FAST64_MIN INT64_MIN -# define INT_FAST64_MAX INT64_MAX -#endif - -#undef UINT_FAST64_MAX -#ifdef GL_UINT64_T -# define UINT_FAST64_MAX UINT64_MAX -#endif - -/* 7.18.2.4. Limits of integer types capable of holding object pointers */ - -#undef INTPTR_MIN -#undef INTPTR_MAX -#undef UINTPTR_MAX -#define INTPTR_MIN LONG_MIN -#define INTPTR_MAX LONG_MAX -#define UINTPTR_MAX ULONG_MAX - -/* 7.18.2.5. Limits of greatest-width integer types */ - -#undef INTMAX_MIN -#undef INTMAX_MAX -#ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -#else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX -#endif - -#undef UINTMAX_MAX -#ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -#else -# define UINTMAX_MAX UINT32_MAX -#endif - -/* 7.18.3. Limits of other integer types */ - -/* ptrdiff_t limits */ -#undef PTRDIFF_MIN -#undef PTRDIFF_MAX -#define PTRDIFF_MIN \ - _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#define PTRDIFF_MAX \ - _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) - -/* sig_atomic_t limits */ -#undef SIG_ATOMIC_MIN -#undef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MIN \ - _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ - 0@SIG_ATOMIC_T_SUFFIX@) -#define SIG_ATOMIC_MAX \ - _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ - 0@SIG_ATOMIC_T_SUFFIX@) - - -/* size_t limit */ -#undef SIZE_MAX -#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) - -/* wchar_t limits */ -#undef WCHAR_MIN -#undef WCHAR_MAX -#define WCHAR_MIN \ - _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) -#define WCHAR_MAX \ - _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) - -/* wint_t limits */ -#undef WINT_MIN -#undef WINT_MAX -#define WINT_MIN \ - _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#define WINT_MAX \ - _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) - -#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */ - -/* 7.18.4. Macros for integer constants */ - -#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS - -/* 7.18.4.1. Macros for minimum-width integer constants */ -/* According to ISO C 99 Technical Corrigendum 1 */ - -/* Here we assume a standard architecture where the hardware integer - types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ - -#undef INT8_C -#undef UINT8_C -#define INT8_C(x) x -#define UINT8_C(x) x - -#undef INT16_C -#undef UINT16_C -#define INT16_C(x) x -#define UINT16_C(x) x - -#undef INT32_C -#undef UINT32_C -#define INT32_C(x) x -#define UINT32_C(x) x ## U - -#undef INT64_C -#undef UINT64_C -#if LONG_MAX >> 31 >> 31 == 1 -# define INT64_C(x) x##L -#elif defined _MSC_VER -# define INT64_C(x) x##i64 -#elif @HAVE_LONG_LONG_INT@ -# define INT64_C(x) x##LL -#endif -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# define UINT64_C(x) x##UL -#elif defined _MSC_VER -# define UINT64_C(x) x##ui64 -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# define UINT64_C(x) x##ULL -#endif - -/* 7.18.4.2. Macros for greatest-width integer constants */ - -#undef INTMAX_C -#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -#elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -#else -# define INTMAX_C(x) x##L -#endif - -#undef UINTMAX_C -#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -#elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -#else -# define UINTMAX_C(x) x##UL -#endif - -#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ - -#endif /* _GL_STDINT_H */ -#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff --git a/gnulib/stdio.in.h b/gnulib/stdio.in.h new file mode 100644 index 0000000..434fa8e --- /dev/null +++ b/gnulib/stdio.in.h @@ -0,0 +1,382 @@ +/* A GNU-like . + + Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#if defined __need_FILE || defined __need___FILE +/* Special invocation convention inside glibc header files. */ + +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDIO_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDIO_H@ + +#ifndef _GL_STDIO_H +#define _GL_STDIO_H + +#include +#include + +#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \ + || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \ + || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \ + || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) +/* Get off_t and ssize_t. */ +# include +#endif + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif +#endif + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_FPRINTF_POSIX@ +# if @REPLACE_FPRINTF@ +# define fprintf rpl_fprintf +extern int fprintf (FILE *fp, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fprintf +# define fprintf \ + (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ + "use gnulib module fprintf-posix for portable " \ + "POSIX compliance"), \ + fprintf) +#endif + +#if @GNULIB_VFPRINTF_POSIX@ +# if @REPLACE_VFPRINTF@ +# define vfprintf rpl_vfprintf +extern int vfprintf (FILE *fp, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vfprintf +# define vfprintf(s,f,a) \ + (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ + "use gnulib module vfprintf-posix for portable " \ + "POSIX compliance"), \ + vfprintf (s, f, a)) +#endif + +#if @GNULIB_PRINTF_POSIX@ +# if @REPLACE_PRINTF@ +/* Don't break __attribute__((format(printf,M,N))). */ +# define printf __printf__ +extern int printf (const char *format, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef printf +# define printf \ + (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ + "use gnulib module printf-posix for portable " \ + "POSIX compliance"), \ + printf) +/* Don't break __attribute__((format(printf,M,N))). */ +# define format(kind,m,n) format (__##kind##__, m, n) +# define __format__(kind,m,n) __format__ (__##kind##__, m, n) +# define ____printf____ __printf__ +# define ____scanf____ __scanf__ +# define ____strftime____ __strftime__ +# define ____strfmon____ __strfmon__ +#endif + +#if @GNULIB_VPRINTF_POSIX@ +# if @REPLACE_VPRINTF@ +# define vprintf rpl_vprintf +extern int vprintf (const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 1, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vprintf +# define vprintf(f,a) \ + (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ + "use gnulib module vprintf-posix for portable " \ + "POSIX compliance"), \ + vprintf (f, a)) +#endif + +#if @GNULIB_SNPRINTF@ +# if @REPLACE_SNPRINTF@ +# define snprintf rpl_snprintf +# endif +# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ +extern int snprintf (char *str, size_t size, const char *format, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef snprintf +# define snprintf \ + (GL_LINK_WARNING ("snprintf is unportable - " \ + "use gnulib module snprintf for portability"), \ + snprintf) +#endif + +#if @GNULIB_VSNPRINTF@ +# if @REPLACE_VSNPRINTF@ +# define vsnprintf rpl_vsnprintf +# endif +# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ +extern int vsnprintf (char *str, size_t size, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 3, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vsnprintf +# define vsnprintf(b,s,f,a) \ + (GL_LINK_WARNING ("vsnprintf is unportable - " \ + "use gnulib module vsnprintf for portability"), \ + vsnprintf (b, s, f, a)) +#endif + +#if @GNULIB_SPRINTF_POSIX@ +# if @REPLACE_SPRINTF@ +# define sprintf rpl_sprintf +extern int sprintf (char *str, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef sprintf +# define sprintf \ + (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ + "use gnulib module sprintf-posix for portable " \ + "POSIX compliance"), \ + sprintf) +#endif + +#if @GNULIB_VSPRINTF_POSIX@ +# if @REPLACE_VSPRINTF@ +# define vsprintf rpl_vsprintf +extern int vsprintf (char *str, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vsprintf +# define vsprintf(b,f,a) \ + (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ + "use gnulib module vsprintf-posix for portable " \ + "POSIX compliance"), \ + vsprintf (b, f, a)) +#endif + +#if @GNULIB_VASPRINTF@ +# if @REPLACE_VASPRINTF@ +# define asprintf rpl_asprintf +# define vasprintf rpl_vasprintf +# endif +# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@ + /* Write formatted output to a string dynamically allocated with malloc(). + If the memory allocation succeeds, store the address of the string in + *RESULT and return the number of resulting bytes, excluding the trailing + NUL. Upon memory allocation error, or some other error, return -1. */ + extern int asprintf (char **result, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + extern int vasprintf (char **result, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#endif + +#if @GNULIB_FOPEN@ +# if @REPLACE_FOPEN@ +# define fopen rpl_fopen +extern FILE * fopen (const char *filename, const char *mode); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fopen +# define fopen(f,m) \ + (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \ + "use gnulib module fopen for portability"), \ + fopen (f, m)) +#endif + +#if @GNULIB_FREOPEN@ +# if @REPLACE_FREOPEN@ +# define freopen rpl_freopen +extern FILE * freopen (const char *filename, const char *mode, FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef freopen +# define freopen(f,m,s) \ + (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \ + "use gnulib module freopen for portability"), \ + freopen (f, m, s)) +#endif + +#if @GNULIB_FSEEKO@ +# if @REPLACE_FSEEKO@ +/* Provide fseek, fseeko functions that are aware of a preceding + fflush(), and which detect pipes. */ +# define fseeko rpl_fseeko +extern int fseeko (FILE *fp, off_t offset, int whence); +# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence) +# endif +#elif defined GNULIB_POSIXCHECK +# undef fseeko +# define fseeko(f,o,w) \ + (GL_LINK_WARNING ("fseeko is unportable - " \ + "use gnulib module fseeko for portability"), \ + fseeko (f, o, w)) +#endif + +#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@ +extern int rpl_fseek (FILE *fp, long offset, int whence); +# undef fseek +# if defined GNULIB_POSIXCHECK +# define fseek(f,o,w) \ + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use fseeko function for handling of large files"), \ + rpl_fseek (f, o, w)) +# else +# define fseek rpl_fseek +# endif +#elif defined GNULIB_POSIXCHECK +# ifndef fseek +# define fseek(f,o,w) \ + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use fseeko function for handling of large files"), \ + fseek (f, o, w)) +# endif +#endif + +#if @GNULIB_FTELLO@ +# if @REPLACE_FTELLO@ +# define ftello rpl_ftello +extern off_t ftello (FILE *fp); +# define ftell(fp) ftello (fp) +# endif +#elif defined GNULIB_POSIXCHECK +# undef ftello +# define ftello(f) \ + (GL_LINK_WARNING ("ftello is unportable - " \ + "use gnulib module ftello for portability"), \ + ftello (f)) +#endif + +#if @GNULIB_FTELL@ && @REPLACE_FTELL@ +extern long rpl_ftell (FILE *fp); +# undef ftell +# if GNULIB_POSIXCHECK +# define ftell(f) \ + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use ftello function for handling of large files"), \ + rpl_ftell (f)) +# else +# define ftell rpl_ftell +# endif +#elif defined GNULIB_POSIXCHECK +# ifndef ftell +# define ftell(f) \ + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use ftello function for handling of large files"), \ + ftell (f)) +# endif +#endif + +#if @GNULIB_FFLUSH@ +# if @REPLACE_FFLUSH@ +# define fflush rpl_fflush + /* Flush all pending data on STREAM according to POSIX rules. Both + output and seekable input streams are supported. + Note! LOSS OF DATA can occur if fflush is applied on an input stream + that is _not_seekable_ or on an update stream that is _not_seekable_ + and in which the most recent operation was input. Seekability can + be tested with lseek(fileno(fp),0,SEEK_CUR). */ + extern int fflush (FILE *gl_stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fflush +# define fflush(f) \ + (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ + "use gnulib module fflush for portable " \ + "POSIX compliance"), \ + fflush (f)) +#endif + +#if @GNULIB_GETDELIM@ +# if !@HAVE_DECL_GETDELIM@ +/* Read input, up to (and including) the next occurrence of DELIMITER, from + STREAM, store it in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter, + FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getdelim +# define getdelim(l, s, d, f) \ + (GL_LINK_WARNING ("getdelim is unportable - " \ + "use gnulib module getdelim for portability"), \ + getdelim (l, s, d, f)) +#endif + +#if @GNULIB_GETLINE@ +# if @REPLACE_GETLINE@ +# undef getline +# define getline rpl_getline +# endif +# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@ +/* Read a line, up to (and including) the next newline, from STREAM, store it + in *LINEPTR (and NUL-terminate it). + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE + bytes of space. It is realloc'd as necessary. + Return the number of bytes read and stored at *LINEPTR (not including the + NUL terminator), or -1 on error or EOF. */ +extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getline +# define getline(l, s, f) \ + (GL_LINK_WARNING ("getline is unportable - " \ + "use gnulib module getline for portability"), \ + getline (l, s, f)) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDIO_H */ +#endif /* _GL_STDIO_H */ +#endif diff --git a/gnulib/stdio_.h b/gnulib/stdio_.h deleted file mode 100644 index 76d9856..0000000 --- a/gnulib/stdio_.h +++ /dev/null @@ -1,353 +0,0 @@ -/* A GNU-like . - - Copyright (C) 2004, 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if defined __need_FILE || defined __need___FILE -/* Special invocation convention inside glibc header files. */ - -#@INCLUDE_NEXT@ @NEXT_STDIO_H@ - -#else -/* Normal invocation convention. */ - -#ifndef _GL_STDIO_H - -/* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_STDIO_H@ - -#ifndef _GL_STDIO_H -#define _GL_STDIO_H - -#include -#include - -#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \ - || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \ - || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \ - || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@)) -/* Get off_t and ssize_t. */ -# include -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf -# endif -#endif - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_FPRINTF_POSIX@ -# if @REPLACE_FPRINTF@ -# define fprintf rpl_fprintf -extern int fprintf (FILE *fp, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fprintf -# define fprintf \ - (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \ - "use gnulib module fprintf-posix for portable " \ - "POSIX compliance"), \ - fprintf) -#endif - -#if @GNULIB_VFPRINTF_POSIX@ -# if @REPLACE_VFPRINTF@ -# define vfprintf rpl_vfprintf -extern int vfprintf (FILE *fp, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vfprintf -# define vfprintf(s,f,a) \ - (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \ - "use gnulib module vfprintf-posix for portable " \ - "POSIX compliance"), \ - vfprintf (s, f, a)) -#endif - -#if @GNULIB_PRINTF_POSIX@ -# if @REPLACE_PRINTF@ -/* Don't break __attribute__((format(printf,M,N))). */ -# define printf __printf__ -extern int printf (const char *format, ...) - __attribute__ ((__format__ (__printf__, 1, 2))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef printf -# define printf \ - (GL_LINK_WARNING ("printf is not always POSIX compliant - " \ - "use gnulib module printf-posix for portable " \ - "POSIX compliance"), \ - printf) -/* Don't break __attribute__((format(printf,M,N))). */ -# define format(kind,m,n) format (__##kind##__, m, n) -# define __format__(kind,m,n) __format__ (__##kind##__, m, n) -# define ____printf____ __printf__ -# define ____scanf____ __scanf__ -# define ____strftime____ __strftime__ -# define ____strfmon____ __strfmon__ -#endif - -#if @GNULIB_VPRINTF_POSIX@ -# if @REPLACE_VPRINTF@ -# define vprintf rpl_vprintf -extern int vprintf (const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 1, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vprintf -# define vprintf(f,a) \ - (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \ - "use gnulib module vprintf-posix for portable " \ - "POSIX compliance"), \ - vprintf (f, a)) -#endif - -#if @GNULIB_SNPRINTF@ -# if @REPLACE_SNPRINTF@ -# define snprintf rpl_snprintf -# endif -# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@ -extern int snprintf (char *str, size_t size, const char *format, ...) - __attribute__ ((__format__ (__printf__, 3, 4))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef snprintf -# define snprintf \ - (GL_LINK_WARNING ("snprintf is unportable - " \ - "use gnulib module snprintf for portability"), \ - snprintf) -#endif - -#if @GNULIB_VSNPRINTF@ -# if @REPLACE_VSNPRINTF@ -# define vsnprintf rpl_vsnprintf -# endif -# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@ -extern int vsnprintf (char *str, size_t size, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 3, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsnprintf -# define vsnprintf(b,s,f,a) \ - (GL_LINK_WARNING ("vsnprintf is unportable - " \ - "use gnulib module vsnprintf for portability"), \ - vsnprintf (b, s, f, a)) -#endif - -#if @GNULIB_SPRINTF_POSIX@ -# if @REPLACE_SPRINTF@ -# define sprintf rpl_sprintf -extern int sprintf (char *str, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef sprintf -# define sprintf \ - (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \ - "use gnulib module sprintf-posix for portable " \ - "POSIX compliance"), \ - sprintf) -#endif - -#if @GNULIB_VSPRINTF_POSIX@ -# if @REPLACE_VSPRINTF@ -# define vsprintf rpl_vsprintf -extern int vsprintf (char *str, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#elif defined GNULIB_POSIXCHECK -# undef vsprintf -# define vsprintf(b,f,a) \ - (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \ - "use gnulib module vsprintf-posix for portable " \ - "POSIX compliance"), \ - vsprintf (b, f, a)) -#endif - -#if @GNULIB_VASPRINTF@ -# if @REPLACE_VASPRINTF@ -# define asprintf rpl_asprintf -# define vasprintf rpl_vasprintf -# endif -# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@ - /* Write formatted output to a string dynamically allocated with malloc(). - If the memory allocation succeeds, store the address of the string in - *RESULT and return the number of resulting bytes, excluding the trailing - NUL. Upon memory allocation error, or some other error, return -1. */ - extern int asprintf (char **result, const char *format, ...) - __attribute__ ((__format__ (__printf__, 2, 3))); - extern int vasprintf (char **result, const char *format, va_list args) - __attribute__ ((__format__ (__printf__, 2, 0))); -# endif -#endif - -#if @GNULIB_FSEEKO@ -# if @REPLACE_FSEEKO@ -/* Provide fseek, fseeko functions that are aware of a preceding - fflush(), and which detect pipes. */ -# define fseeko rpl_fseeko -extern int fseeko (FILE *fp, off_t offset, int whence); -# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence) -# endif -#elif defined GNULIB_POSIXCHECK -# undef fseeko -# define fseeko(f,o,w) \ - (GL_LINK_WARNING ("fseeko is unportable - " \ - "use gnulib module fseeko for portability"), \ - fseeko (f, o, w)) -#endif - -#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@ -extern int rpl_fseek (FILE *fp, long offset, int whence); -# undef fseek -# if defined GNULIB_POSIXCHECK -# define fseek(f,o,w) \ - (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use fseeko function for handling of large files"), \ - rpl_fseek (f, o, w)) -# else -# define fseek rpl_fseek -# endif -#elif defined GNULIB_POSIXCHECK -# ifndef fseek -# define fseek(f,o,w) \ - (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use fseeko function for handling of large files"), \ - fseek (f, o, w)) -# endif -#endif - -#if @GNULIB_FTELLO@ -# if @REPLACE_FTELLO@ -# define ftello rpl_ftello -extern off_t ftello (FILE *fp); -# define ftell(fp) ftello (fp) -# endif -#elif defined GNULIB_POSIXCHECK -# undef ftello -# define ftello(f) \ - (GL_LINK_WARNING ("ftello is unportable - " \ - "use gnulib module ftello for portability"), \ - ftello (f)) -#endif - -#if @GNULIB_FTELL@ && @REPLACE_FTELL@ -extern long rpl_ftell (FILE *fp); -# undef ftell -# if GNULIB_POSIXCHECK -# define ftell(f) \ - (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use ftello function for handling of large files"), \ - rpl_ftell (f)) -# else -# define ftell rpl_ftell -# endif -#elif defined GNULIB_POSIXCHECK -# ifndef ftell -# define ftell(f) \ - (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ - "on 32-bit platforms - " \ - "use ftello function for handling of large files"), \ - ftell (f)) -# endif -#endif - -#if @GNULIB_FFLUSH@ -# if @REPLACE_FFLUSH@ -# define fflush rpl_fflush - /* Flush all pending data on STREAM according to POSIX rules. Both - output and seekable input streams are supported. - Note! LOSS OF DATA can occur if fflush is applied on an input stream - that is _not_seekable_ or on an update stream that is _not_seekable_ - and in which the most recent operation was input. Seekability can - be tested with lseek(fileno(fp),0,SEEK_CUR). */ - extern int fflush (FILE *gl_stream); -# endif -#elif defined GNULIB_POSIXCHECK -# undef fflush -# define fflush(f) \ - (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ - "use gnulib module fflush for portable " \ - "POSIX compliance"), \ - fflush (f)) -#endif - -#if @GNULIB_GETDELIM@ -# if !@HAVE_DECL_GETDELIM@ - /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and - NUL-terminate it). *LINEPTR is a pointer returned from malloc (or - NULL), pointing to *N characters of space. It is realloc'ed as - necessary. Returns the number of characters read (not including - the null terminator), or -1 on error or EOF. */ - extern ssize_t getdelim (char **, size_t *, int delim, FILE *); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getdelim -# define getdelim(l, s, d, f) \ - (GL_LINK_WARNING ("getdelim is unportable - " \ - "use gnulib module getdelim for portability"), \ - getdelim (l, s, d, f)) -#endif - -#if @GNULIB_GETLINE@ -# if @REPLACE_GETLINE@ -# undef getline -# define getline rpl_getline -# endif -# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@ - /* Read up to (and including) a newline from FP into *LINEPTR (and - NUL-terminate it). *LINEPTR is a pointer returned from malloc (or - NULL), pointing to *N characters of space. It is realloc'ed as - necessary. Returns the number of characters read (not including - the null terminator), or -1 on error or EOF. */ - extern ssize_t getline (char **, size_t *, FILE *); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getline -# define getline(l, s, f) \ - (GL_LINK_WARNING ("getline is unportable - " \ - "use gnulib module getline for portability"), \ - getline (l, s, f)) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDIO_H */ -#endif /* _GL_STDIO_H */ -#endif diff --git a/gnulib/stdlib.in.h b/gnulib/stdlib.in.h new file mode 100644 index 0000000..100ff52 --- /dev/null +++ b/gnulib/stdlib.in.h @@ -0,0 +1,208 @@ +/* A GNU-like . + + Copyright (C) 1995, 2001-2004, 2006-2007 Free Software Foundation, Inc. + + This program 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . */ + +#if defined __need_malloc_and_calloc +/* Special invocation convention inside glibc header files. */ + +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _GL_STDLIB_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ + +#ifndef _GL_STDLIB_H +#define _GL_STDLIB_H + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere + with proper operation of xargs. */ +#ifndef EXIT_FAILURE +# define EXIT_FAILURE 1 +#elif EXIT_FAILURE != 1 +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_MALLOC_POSIX@ +# if !@HAVE_MALLOC_POSIX@ +# undef malloc +# define malloc rpl_malloc +extern void * malloc (size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef malloc +# define malloc(s) \ + (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ + "use gnulib module malloc-posix for portability"), \ + malloc (s)) +#endif + + +#if @GNULIB_REALLOC_POSIX@ +# if !@HAVE_REALLOC_POSIX@ +# undef realloc +# define realloc rpl_realloc +extern void * realloc (void *ptr, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef realloc +# define realloc(p,s) \ + (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ + "use gnulib module realloc-posix for portability"), \ + realloc (p, s)) +#endif + + +#if @GNULIB_CALLOC_POSIX@ +# if !@HAVE_CALLOC_POSIX@ +# undef calloc +# define calloc rpl_calloc +extern void * calloc (size_t nmemb, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef calloc +# define calloc(n,s) \ + (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ + "use gnulib module calloc-posix for portability"), \ + calloc (n, s)) +#endif + + +#if @GNULIB_GETSUBOPT@ +/* Assuming *OPTIONP is a comma separated list of elements of the form + "token" or "token=value", getsubopt parses the first of these elements. + If the first element refers to a "token" that is member of the given + NULL-terminated array of tokens: + - It replaces the comma with a NUL byte, updates *OPTIONP to point past + the first option and the comma, sets *VALUEP to the value of the + element (or NULL if it doesn't contain an "=" sign), + - It returns the index of the "token" in the given array of tokens. + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. + For more details see the POSIX:2001 specification. + http://www.opengroup.org/susv3xsh/getsubopt.html */ +# if !@HAVE_GETSUBOPT@ +extern int getsubopt (char **optionp, char *const *tokens, char **valuep); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getsubopt +# define getsubopt(o,t,v) \ + (GL_LINK_WARNING ("getsubopt is unportable - " \ + "use gnulib module getsubopt for portability"), \ + getsubopt (o, t, v)) +#endif + + +#if @GNULIB_MKDTEMP@ +# if !@HAVE_MKDTEMP@ +/* Create a unique temporary directory from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the directory name unique. + Returns TEMPLATE, or a null pointer if it cannot get a unique name. + The directory is created mode 700. */ +extern char * mkdtemp (char * /*template*/); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkdtemp +# define mkdtemp(t) \ + (GL_LINK_WARNING ("mkdtemp is unportable - " \ + "use gnulib module mkdtemp for portability"), \ + mkdtemp (t)) +#endif + + +#if @GNULIB_MKSTEMP@ +# if @REPLACE_MKSTEMP@ +/* Create a unique temporary file from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the file name unique. + The file is then created, ensuring it didn't exist before. + The file is created read-write (mask at least 0600 & ~umask), but it may be + world-readable and world-writable (mask 0666 & ~umask), depending on the + implementation. + Returns the open file descriptor if successful, otherwise -1 and errno + set. */ +# define mkstemp rpl_mkstemp +extern int mkstemp (char * /*template*/); +# else +/* On MacOS X 10.3, only declares mkstemp. */ +# include +# endif +#elif defined GNULIB_POSIXCHECK +# undef mkstemp +# define mkstemp(t) \ + (GL_LINK_WARNING ("mkstemp is unportable - " \ + "use gnulib module mkstemp for portability"), \ + mkstemp (t)) +#endif + + +#if @GNULIB_PUTENV@ +# if @REPLACE_PUTENV@ +# undef putenv +# define putenv rpl_putenv +extern int putenv (char *string); +# endif +#endif + + +#if @GNULIB_SETENV@ +# if !@HAVE_SETENV@ +/* Set NAME to VALUE in the environment. + If REPLACE is nonzero, overwrite an existing value. */ +extern int setenv (const char *name, const char *value, int replace); +# endif +#endif + + +#if @GNULIB_UNSETENV@ +# if @HAVE_UNSETENV@ +# if @VOID_UNSETENV@ +/* On some systems, unsetenv() returns void. + This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */ +# define unsetenv(name) ((unsetenv)(name), 0) +# endif +# else +/* Remove the variable NAME from the environment. */ +extern int unsetenv (const char *name); +# endif +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STDLIB_H */ +#endif /* _GL_STDLIB_H */ +#endif diff --git a/gnulib/stdlib_.h b/gnulib/stdlib_.h deleted file mode 100644 index a4946e6..0000000 --- a/gnulib/stdlib_.h +++ /dev/null @@ -1,177 +0,0 @@ -/* A GNU-like . - - Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#if defined __need_malloc_and_calloc -/* Special invocation convention inside glibc header files. */ - -#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ - -#else -/* Normal invocation convention. */ - -#ifndef _GL_STDLIB_H - -/* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ - -#ifndef _GL_STDLIB_H -#define _GL_STDLIB_H - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -/* Some systems do not define EXIT_*, despite otherwise supporting C89. */ -#ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -#endif -/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere - with proper operation of xargs. */ -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#elif EXIT_FAILURE != 1 -# undef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_MALLOC_POSIX@ -# if !@HAVE_MALLOC_POSIX@ -# undef malloc -# define malloc rpl_malloc -extern void * malloc (size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef malloc -# define malloc(s) \ - (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \ - "use gnulib module malloc-posix for portability"), \ - malloc (s)) -#endif - - -#if @GNULIB_REALLOC_POSIX@ -# if !@HAVE_REALLOC_POSIX@ -# undef realloc -# define realloc rpl_realloc -extern void * realloc (void *ptr, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef realloc -# define realloc(p,s) \ - (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \ - "use gnulib module realloc-posix for portability"), \ - realloc (p, s)) -#endif - - -#if @GNULIB_CALLOC_POSIX@ -# if !@HAVE_CALLOC_POSIX@ -# undef calloc -# define calloc rpl_calloc -extern void * calloc (size_t nmemb, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef calloc -# define calloc(n,s) \ - (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \ - "use gnulib module calloc-posix for portability"), \ - calloc (n, s)) -#endif - - -#if @GNULIB_GETSUBOPT@ -/* Assuming *OPTIONP is a comma separated list of elements of the form - "token" or "token=value", getsubopt parses the first of these elements. - If the first element refers to a "token" that is member of the given - NULL-terminated array of tokens: - - It replaces the comma with a NUL byte, updates *OPTIONP to point past - the first option and the comma, sets *VALUEP to the value of the - element (or NULL if it doesn't contain an "=" sign), - - It returns the index of the "token" in the given array of tokens. - Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. - For more details see the POSIX:2001 specification. - http://www.opengroup.org/susv3xsh/getsubopt.html */ -# if !@HAVE_GETSUBOPT@ -extern int getsubopt (char **optionp, char *const *tokens, char **valuep); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getsubopt -# define getsubopt(o,t,v) \ - (GL_LINK_WARNING ("getsubopt is unportable - " \ - "use gnulib module getsubopt for portability"), \ - getsubopt (o, t, v)) -#endif - - -#if @GNULIB_MKDTEMP@ -# if !@HAVE_MKDTEMP@ -/* Create a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the directory name unique. - Returns TEMPLATE, or a null pointer if it cannot get a unique name. - The directory is created mode 700. */ -extern char * mkdtemp (char * /*template*/); -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkdtemp -# define mkdtemp(t) \ - (GL_LINK_WARNING ("mkdtemp is unportable - " \ - "use gnulib module mkdtemp for portability"), \ - mkdtemp (t)) -#endif - - -#if @GNULIB_MKSTEMP@ -# if @REPLACE_MKSTEMP@ -/* Create a unique temporary file from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the file name unique. - The file is then created, ensuring it didn't exist before. - The file is created read-write (mask at least 0600 & ~umask), but it may be - world-readable and world-writable (mask 0666 & ~umask), depending on the - implementation. - Returns the open file descriptor if successful, otherwise -1 and errno - set. */ -# define mkstemp rpl_mkstemp -extern int mkstemp (char * /*template*/); -# else -/* On MacOS X 10.3, only declares mkstemp. */ -# include -# endif -#elif defined GNULIB_POSIXCHECK -# undef mkstemp -# define mkstemp(t) \ - (GL_LINK_WARNING ("mkstemp is unportable - " \ - "use gnulib module mkstemp for portability"), \ - mkstemp (t)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STDLIB_H */ -#endif /* _GL_STDLIB_H */ -#endif diff --git a/gnulib/strdup.c b/gnulib/strdup.c index c614108..bebe5c8 100644 --- a/gnulib/strdup.c +++ b/gnulib/strdup.c @@ -5,7 +5,7 @@ This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, diff --git a/gnulib/string.in.h b/gnulib/string.in.h new file mode 100644 index 0000000..212846a --- /dev/null +++ b/gnulib/string.in.h @@ -0,0 +1,569 @@ +/* A GNU-like . + + Copyright (C) 1995-1996, 2001-2008 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_STRING_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#ifndef _GL_STRING_H +#define _GL_STRING_H + + +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) +# define __attribute__(Spec) /* empty */ +# endif +/* The attribute __pure__ was added in gcc 2.96. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) +# define __pure__ /* empty */ +# endif +#endif + + +/* The definition of GL_LINK_WARNING is copied here. */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Return the first occurrence of NEEDLE in HAYSTACK. */ +#if @GNULIB_MEMMEM@ +# if @REPLACE_MEMMEM@ +# define memmem rpl_memmem +# endif +# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@ +extern void *memmem (void const *__haystack, size_t __haystack_len, + void const *__needle, size_t __needle_len) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef memmem +# define memmem(a,al,b,bl) \ + (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \ + "use gnulib module memmem-simple for portability, " \ + "and module memmem for speed" ), \ + memmem (a, al, b, bl)) +#endif + +/* Copy N bytes of SRC to DEST, return pointer to bytes after the + last written byte. */ +#if @GNULIB_MEMPCPY@ +# if ! @HAVE_MEMPCPY@ +extern void *mempcpy (void *__dest, void const *__src, + size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef mempcpy +# define mempcpy(a,b,n) \ + (GL_LINK_WARNING ("mempcpy is unportable - " \ + "use gnulib module mempcpy for portability"), \ + mempcpy (a, b, n)) +#endif + +/* Search backwards through a block for a byte (specified as an int). */ +#if @GNULIB_MEMRCHR@ +# if ! @HAVE_DECL_MEMRCHR@ +extern void *memrchr (void const *, int, size_t) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef memrchr +# define memrchr(a,b,c) \ + (GL_LINK_WARNING ("memrchr is unportable - " \ + "use gnulib module memrchr for portability"), \ + memrchr (a, b, c)) +#endif + +/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ +#if @GNULIB_STPCPY@ +# if ! @HAVE_STPCPY@ +extern char *stpcpy (char *__dst, char const *__src); +# endif +#elif defined GNULIB_POSIXCHECK +# undef stpcpy +# define stpcpy(a,b) \ + (GL_LINK_WARNING ("stpcpy is unportable - " \ + "use gnulib module stpcpy for portability"), \ + stpcpy (a, b)) +#endif + +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +#if @GNULIB_STPNCPY@ +# if ! @HAVE_STPNCPY@ +# define stpncpy gnu_stpncpy +extern char *stpncpy (char *__dst, char const *__src, + size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef stpncpy +# define stpncpy(a,b,n) \ + (GL_LINK_WARNING ("stpncpy is unportable - " \ + "use gnulib module stpncpy for portability"), \ + stpncpy (a, b, n)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strchr() does not work with multibyte strings if the locale encoding is + GB18030 and the character to be searched is a digit. */ +# undef strchr +# define strchr(s,c) \ + (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ + "in some multibyte locales - " \ + "use mbschr if you care about internationalization"), \ + strchr (s, c)) +#endif + +/* Find the first occurrence of C in S or the final NUL byte. */ +#if @GNULIB_STRCHRNUL@ +# if ! @HAVE_STRCHRNUL@ +extern char *strchrnul (char const *__s, int __c_in) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strchrnul +# define strchrnul(a,b) \ + (GL_LINK_WARNING ("strchrnul is unportable - " \ + "use gnulib module strchrnul for portability"), \ + strchrnul (a, b)) +#endif + +/* Duplicate S, returning an identical malloc'd string. */ +#if @GNULIB_STRDUP@ +# if ! @HAVE_DECL_STRDUP@ && ! defined strdup +extern char *strdup (char const *__s); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strdup +# define strdup(a) \ + (GL_LINK_WARNING ("strdup is unportable - " \ + "use gnulib module strdup for portability"), \ + strdup (a)) +#endif + +/* Return a newly allocated copy of at most N bytes of STRING. */ +#if @GNULIB_STRNDUP@ +# if ! @HAVE_STRNDUP@ +# undef strndup +# define strndup rpl_strndup +# endif +# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ +extern char *strndup (char const *__string, size_t __n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strndup +# define strndup(a,n) \ + (GL_LINK_WARNING ("strndup is unportable - " \ + "use gnulib module strndup for portability"), \ + strndup (a, n)) +#endif + +/* Find the length (number of bytes) of STRING, but scan at most + MAXLEN bytes. If no '\0' terminator is found in that many bytes, + return MAXLEN. */ +#if @GNULIB_STRNLEN@ +# if ! @HAVE_DECL_STRNLEN@ +extern size_t strnlen (char const *__string, size_t __maxlen) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strnlen +# define strnlen(a,n) \ + (GL_LINK_WARNING ("strnlen is unportable - " \ + "use gnulib module strnlen for portability"), \ + strnlen (a, n)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strcspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strcspn +# define strcspn(s,a) \ + (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbscspn if you care about internationalization"), \ + strcspn (s, a)) +#endif + +/* Find the first occurrence in S of any character in ACCEPT. */ +#if @GNULIB_STRPBRK@ +# if ! @HAVE_STRPBRK@ +extern char *strpbrk (char const *__s, char const *__accept) + __attribute__ ((__pure__)); +# endif +# if defined GNULIB_POSIXCHECK +/* strpbrk() assumes the second argument is a list of single-byte characters. + Even in this simple case, it does not work with multibyte strings if the + locale encoding is GB18030 and one of the characters to be searched is a + digit. */ +# undef strpbrk +# define strpbrk(s,a) \ + (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbspbrk if you care about internationalization"), \ + strpbrk (s, a)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strpbrk +# define strpbrk(s,a) \ + (GL_LINK_WARNING ("strpbrk is unportable - " \ + "use gnulib module strpbrk for portability"), \ + strpbrk (s, a)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strspn() assumes the second argument is a list of single-byte characters. + Even in this simple case, it cannot work with multibyte strings. */ +# undef strspn +# define strspn(s,a) \ + (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbsspn if you care about internationalization"), \ + strspn (s, a)) +#endif + +#if defined GNULIB_POSIXCHECK +/* strrchr() does not work with multibyte strings if the locale encoding is + GB18030 and the character to be searched is a digit. */ +# undef strrchr +# define strrchr(s,c) \ + (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \ + "in some multibyte locales - " \ + "use mbsrchr if you care about internationalization"), \ + strrchr (s, c)) +#endif + +/* Search the next delimiter (char listed in DELIM) starting at *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP + to point to the next char after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of strtok() that is multithread-safe and supports + empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strtok_r(). */ +#if @GNULIB_STRSEP@ +# if ! @HAVE_STRSEP@ +extern char *strsep (char **__stringp, char const *__delim); +# endif +# if defined GNULIB_POSIXCHECK +# undef strsep +# define strsep(s,d) \ + (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbssep if you care about internationalization"), \ + strsep (s, d)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strsep +# define strsep(s,d) \ + (GL_LINK_WARNING ("strsep is unportable - " \ + "use gnulib module strsep for portability"), \ + strsep (s, d)) +#endif + +#if @GNULIB_STRSTR@ +# if @REPLACE_STRSTR@ +# define strstr rpl_strstr +char *strstr (const char *haystack, const char *needle) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +/* strstr() does not work with multibyte strings if the locale encoding is + different from UTF-8: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strstr +# define strstr(a,b) \ + (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \ + "work correctly on character strings in most " \ + "multibyte locales - " \ + "use mbsstr if you care about internationalization, " \ + "or use strstr if you care about speed"), \ + strstr (a, b)) +#endif + +/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive + comparison. */ +#if @GNULIB_STRCASESTR@ +# if @REPLACE_STRCASESTR@ +# define strcasestr rpl_strcasestr +# endif +# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@ +extern char *strcasestr (const char *haystack, const char *needle) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +/* strcasestr() does not work with multibyte strings: + It is a glibc extension, and glibc implements it only for unibyte + locales. */ +# undef strcasestr +# define strcasestr(a,b) \ + (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \ + "in multibyte locales - " \ + "use mbscasestr if you care about " \ + "internationalization, or use c-strcasestr if you want " \ + "a locale independent function"), \ + strcasestr (a, b)) +#endif + +/* Parse S into tokens separated by characters in DELIM. + If S is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = strtok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + This is a variant of strtok() that is multithread-safe. + + For the POSIX documentation for this function, see: + http://www.opengroup.org/susv3xsh/strtok.html + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + Caveat: It doesn't work with multibyte strings unless all of the delimiter + characters are ASCII characters < 0x30. + + See also strsep(). */ +#if @GNULIB_STRTOK_R@ +# if ! @HAVE_DECL_STRTOK_R@ +extern char *strtok_r (char *s, char const *delim, + char **save_ptr); +# endif +# if defined GNULIB_POSIXCHECK +# undef strtok_r +# define strtok_r(s,d,p) \ + (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \ + "in multibyte locales - " \ + "use mbstok_r if you care about internationalization"), \ + strtok_r (s, d, p)) +# endif +#elif defined GNULIB_POSIXCHECK +# undef strtok_r +# define strtok_r(s,d,p) \ + (GL_LINK_WARNING ("strtok_r is unportable - " \ + "use gnulib module strtok_r for portability"), \ + strtok_r (s, d, p)) +#endif + + +/* The following functions are not specified by POSIX. They are gnulib + extensions. */ + +#if @GNULIB_MBSLEN@ +/* Return the number of multibyte characters in the character string STRING. + This considers multibyte characters, unlike strlen, which counts bytes. */ +extern size_t mbslen (const char *string); +#endif + +#if @GNULIB_MBSNLEN@ +/* Return the number of multibyte characters in the character string starting + at STRING and ending at STRING + LEN. */ +extern size_t mbsnlen (const char *string, size_t len); +#endif + +#if @GNULIB_MBSCHR@ +/* Locate the first single-byte character C in the character string STRING, + and return a pointer to it. Return NULL if C is not found in STRING. + Unlike strchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ +extern char * mbschr (const char *string, int c); +#endif + +#if @GNULIB_MBSRCHR@ +/* Locate the last single-byte character C in the character string STRING, + and return a pointer to it. Return NULL if C is not found in STRING. + Unlike strrchr(), this function works correctly in multibyte locales with + encodings such as GB18030. */ +# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ +extern char * mbsrchr (const char *string, int c); +#endif + +#if @GNULIB_MBSSTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. + Unlike strstr(), this function works correctly in multibyte locales with + encodings different from UTF-8. */ +extern char * mbsstr (const char *haystack, const char *needle); +#endif + +#if @GNULIB_MBSCASECMP@ +/* Compare the character strings S1 and S2, ignoring case, returning less than, + equal to or greater than zero if S1 is lexicographically less than, equal to + or greater than S2. + Note: This function may, in multibyte locales, return 0 for strings of + different lengths! + Unlike strcasecmp(), this function works correctly in multibyte locales. */ +extern int mbscasecmp (const char *s1, const char *s2); +#endif + +#if @GNULIB_MBSNCASECMP@ +/* Compare the initial segment of the character string S1 consisting of at most + N characters with the initial segment of the character string S2 consisting + of at most N characters, ignoring case, returning less than, equal to or + greater than zero if the initial segment of S1 is lexicographically less + than, equal to or greater than the initial segment of S2. + Note: This function may, in multibyte locales, return 0 for initial segments + of different lengths! + Unlike strncasecmp(), this function works correctly in multibyte locales. + But beware that N is not a byte count but a character count! */ +extern int mbsncasecmp (const char *s1, const char *s2, size_t n); +#endif + +#if @GNULIB_MBSPCASECMP@ +/* Compare the initial segment of the character string STRING consisting of + at most mbslen (PREFIX) characters with the character string PREFIX, + ignoring case, returning less than, equal to or greater than zero if this + initial segment is lexicographically less than, equal to or greater than + PREFIX. + Note: This function may, in multibyte locales, return 0 if STRING is of + smaller length than PREFIX! + Unlike strncasecmp(), this function works correctly in multibyte + locales. */ +extern char * mbspcasecmp (const char *string, const char *prefix); +#endif + +#if @GNULIB_MBSCASESTR@ +/* Find the first occurrence of the character string NEEDLE in the character + string HAYSTACK, using case-insensitive comparison. + Note: This function may, in multibyte locales, return success even if + strlen (haystack) < strlen (needle) ! + Unlike strcasestr(), this function works correctly in multibyte locales. */ +extern char * mbscasestr (const char *haystack, const char *needle); +#endif + +#if @GNULIB_MBSCSPN@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strcspn(), this function works correctly in multibyte locales. */ +extern size_t mbscspn (const char *string, const char *accept); +#endif + +#if @GNULIB_MBSPBRK@ +/* Find the first occurrence in the character string STRING of any character + in the character string ACCEPT. Return the pointer to it, or NULL if none + exists. + Unlike strpbrk(), this function works correctly in multibyte locales. */ +# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ +extern char * mbspbrk (const char *string, const char *accept); +#endif + +#if @GNULIB_MBSSPN@ +/* Find the first occurrence in the character string STRING of any character + not in the character string REJECT. Return the number of bytes from the + beginning of the string to this occurrence, or to the end of the string + if none exists. + Unlike strspn(), this function works correctly in multibyte locales. */ +extern size_t mbsspn (const char *string, const char *reject); +#endif + +#if @GNULIB_MBSSEP@ +/* Search the next delimiter (multibyte character listed in the character + string DELIM) starting at the character string *STRINGP. + If one is found, overwrite it with a NUL, and advance *STRINGP to point + to the next multibyte character after it. Otherwise, set *STRINGP to NULL. + If *STRINGP was already NULL, nothing happens. + Return the old value of *STRINGP. + + This is a variant of mbstok_r() that supports empty fields. + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbstok_r(). */ +extern char * mbssep (char **stringp, const char *delim); +#endif + +#if @GNULIB_MBSTOK_R@ +/* Parse the character string STRING into tokens separated by characters in + the character string DELIM. + If STRING is NULL, the saved pointer in SAVE_PTR is used as + the next starting point. For example: + char s[] = "-abc-=-def"; + char *sp; + x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" + x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL + x = mbstok_r(NULL, "=", &sp); // x = NULL + // s = "abc\0-def\0" + + Caveat: It modifies the original string. + Caveat: These functions cannot be used on constant strings. + Caveat: The identity of the delimiting character is lost. + + See also mbssep(). */ +extern char * mbstok_r (char *string, const char *delim, char **save_ptr); +#endif + +/* Map any int, typically from errno, into an error message. */ +#if @GNULIB_STRERROR@ +# if @REPLACE_STRERROR@ +# undef strerror +# define strerror rpl_strerror +extern char *strerror (int); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strerror +# define strerror(e) \ + (GL_LINK_WARNING ("strerror is unportable - " \ + "use gnulib module strerror to guarantee non-NULL result"), \ + strerror (e)) +#endif + +#if @GNULIB_STRSIGNAL@ +# if @REPLACE_STRSIGNAL@ +# define strsignal rpl_strsignal +# endif +# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@ +extern char *strsignal (int __sig); +# endif +#elif defined GNULIB_POSIXCHECK +# undef strsignal +# define strsignal(a) \ + (GL_LINK_WARNING ("strsignal is unportable - " \ + "use gnulib module strsignal for portability"), \ + strsignal (a)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_STRING_H */ +#endif /* _GL_STRING_H */ diff --git a/gnulib/string_.h b/gnulib/string_.h deleted file mode 100644 index bfb22b0..0000000 --- a/gnulib/string_.h +++ /dev/null @@ -1,548 +0,0 @@ -/* A GNU-like . - - Copyright (C) 1995-1996, 2001-2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_STRING_H - -/* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_STRING_H@ - -#ifndef _GL_STRING_H -#define _GL_STRING_H - - -/* The definition of GL_LINK_WARNING is copied here. */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/* Return the first occurrence of NEEDLE in HAYSTACK. */ -#if @GNULIB_MEMMEM@ -# if ! @HAVE_DECL_MEMMEM@ -extern void *memmem (void const *__haystack, size_t __haystack_len, - void const *__needle, size_t __needle_len); -# endif -#elif defined GNULIB_POSIXCHECK -# undef memmem -# define memmem(a,al,b,bl) \ - (GL_LINK_WARNING ("memmem is unportable - " \ - "use gnulib module memmem for portability"), \ - memmem (a, al, b, bl)) -#endif - -/* Copy N bytes of SRC to DEST, return pointer to bytes after the - last written byte. */ -#if @GNULIB_MEMPCPY@ -# if ! @HAVE_MEMPCPY@ -extern void *mempcpy (void *restrict __dest, void const *restrict __src, - size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef mempcpy -# define mempcpy(a,b,n) \ - (GL_LINK_WARNING ("mempcpy is unportable - " \ - "use gnulib module mempcpy for portability"), \ - mempcpy (a, b, n)) -#endif - -/* Search backwards through a block for a byte (specified as an int). */ -#if @GNULIB_MEMRCHR@ -# if ! @HAVE_DECL_MEMRCHR@ -extern void *memrchr (void const *, int, size_t); -# endif -#elif defined GNULIB_POSIXCHECK -# undef memrchr -# define memrchr(a,b,c) \ - (GL_LINK_WARNING ("memrchr is unportable - " \ - "use gnulib module memrchr for portability"), \ - memrchr (a, b, c)) -#endif - -/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ -#if @GNULIB_STPCPY@ -# if ! @HAVE_STPCPY@ -extern char *stpcpy (char *restrict __dst, char const *restrict __src); -# endif -#elif defined GNULIB_POSIXCHECK -# undef stpcpy -# define stpcpy(a,b) \ - (GL_LINK_WARNING ("stpcpy is unportable - " \ - "use gnulib module stpcpy for portability"), \ - stpcpy (a, b)) -#endif - -/* Copy no more than N bytes of SRC to DST, returning a pointer past the - last non-NUL byte written into DST. */ -#if @GNULIB_STPNCPY@ -# if ! @HAVE_STPNCPY@ -# define stpncpy gnu_stpncpy -extern char *stpncpy (char *restrict __dst, char const *restrict __src, - size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef stpncpy -# define stpncpy(a,b,n) \ - (GL_LINK_WARNING ("stpncpy is unportable - " \ - "use gnulib module stpncpy for portability"), \ - stpncpy (a, b, n)) -#endif - -/* Compare strings S1 and S2, ignoring case, returning less than, equal to or - greater than zero if S1 is lexicographically less than, equal to or greater - than S2. - Note: This function does not work in multibyte locales. */ -#if ! @HAVE_STRCASECMP@ -extern int strcasecmp (char const *s1, char const *s2); -#endif -#if defined GNULIB_POSIXCHECK -/* strcasecmp() does not work with multibyte strings: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strcasecmp -# define strcasecmp(a,b) \ - (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscasecmp if you care about " \ - "internationalization, or use c_strcasecmp (from " \ - "gnulib module c-strcase) if you want a locale " \ - "independent function"), \ - strcasecmp (a, b)) -#endif - -/* Compare no more than N bytes of strings S1 and S2, ignoring case, - returning less than, equal to or greater than zero if S1 is - lexicographically less than, equal to or greater than S2. - Note: This function cannot work correctly in multibyte locales. */ -#if ! @HAVE_DECL_STRNCASECMP@ -extern int strncasecmp (char const *s1, char const *s2, size_t n); -#endif -#if defined GNULIB_POSIXCHECK -/* strncasecmp() does not work with multibyte strings: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strncasecmp -# define strncasecmp(a,b,n) \ - (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \ - "strings in multibyte locales - " \ - "use mbsncasecmp or mbspcasecmp if you care about " \ - "internationalization, or use c_strncasecmp (from " \ - "gnulib module c-strcase) if you want a locale " \ - "independent function"), \ - strncasecmp (a, b, n)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strchr() does not work with multibyte strings if the locale encoding is - GB18030 and the character to be searched is a digit. */ -# undef strchr -# define strchr(s,c) \ - (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ - "in some multibyte locales - " \ - "use mbschr if you care about internationalization"), \ - strchr (s, c)) -#endif - -/* Find the first occurrence of C in S or the final NUL byte. */ -#if @GNULIB_STRCHRNUL@ -# if ! @HAVE_STRCHRNUL@ -extern char *strchrnul (char const *__s, int __c_in); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strchrnul -# define strchrnul(a,b) \ - (GL_LINK_WARNING ("strchrnul is unportable - " \ - "use gnulib module strchrnul for portability"), \ - strchrnul (a, b)) -#endif - -/* Duplicate S, returning an identical malloc'd string. */ -#if @GNULIB_STRDUP@ -# if ! @HAVE_DECL_STRDUP@ && ! defined strdup -extern char *strdup (char const *__s); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strdup -# define strdup(a) \ - (GL_LINK_WARNING ("strdup is unportable - " \ - "use gnulib module strdup for portability"), \ - strdup (a)) -#endif - -/* Return a newly allocated copy of at most N bytes of STRING. */ -#if @GNULIB_STRNDUP@ -# if ! @HAVE_STRNDUP@ -# undef strndup -# define strndup rpl_strndup -# endif -# if ! @HAVE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@ -extern char *strndup (char const *__string, size_t __n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strndup -# define strndup(a,n) \ - (GL_LINK_WARNING ("strndup is unportable - " \ - "use gnulib module strndup for portability"), \ - strndup (a, n)) -#endif - -/* Find the length (number of bytes) of STRING, but scan at most - MAXLEN bytes. If no '\0' terminator is found in that many bytes, - return MAXLEN. */ -#if @GNULIB_STRNLEN@ -# if ! @HAVE_DECL_STRNLEN@ -extern size_t strnlen (char const *__string, size_t __maxlen); -# endif -#elif defined GNULIB_POSIXCHECK -# undef strnlen -# define strnlen(a,n) \ - (GL_LINK_WARNING ("strnlen is unportable - " \ - "use gnulib module strnlen for portability"), \ - strnlen (a, n)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strcspn() assumes the second argument is a list of single-byte characters. - Even in this simple case, it does not work with multibyte strings if the - locale encoding is GB18030 and one of the characters to be searched is a - digit. */ -# undef strcspn -# define strcspn(s,a) \ - (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscspn if you care about internationalization"), \ - strcspn (s, a)) -#endif - -/* Find the first occurrence in S of any character in ACCEPT. */ -#if @GNULIB_STRPBRK@ -# if ! @HAVE_STRPBRK@ -extern char *strpbrk (char const *__s, char const *__accept); -# endif -# if defined GNULIB_POSIXCHECK -/* strpbrk() assumes the second argument is a list of single-byte characters. - Even in this simple case, it does not work with multibyte strings if the - locale encoding is GB18030 and one of the characters to be searched is a - digit. */ -# undef strpbrk -# define strpbrk(s,a) \ - (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbspbrk if you care about internationalization"), \ - strpbrk (s, a)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strpbrk -# define strpbrk(s,a) \ - (GL_LINK_WARNING ("strpbrk is unportable - " \ - "use gnulib module strpbrk for portability"), \ - strpbrk (s, a)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strspn() assumes the second argument is a list of single-byte characters. - Even in this simple case, it cannot work with multibyte strings. */ -# undef strspn -# define strspn(s,a) \ - (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbsspn if you care about internationalization"), \ - strspn (s, a)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strrchr() does not work with multibyte strings if the locale encoding is - GB18030 and the character to be searched is a digit. */ -# undef strrchr -# define strrchr(s,c) \ - (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \ - "in some multibyte locales - " \ - "use mbsrchr if you care about internationalization"), \ - strrchr (s, c)) -#endif - -/* Search the next delimiter (char listed in DELIM) starting at *STRINGP. - If one is found, overwrite it with a NUL, and advance *STRINGP - to point to the next char after it. Otherwise, set *STRINGP to NULL. - If *STRINGP was already NULL, nothing happens. - Return the old value of *STRINGP. - - This is a variant of strtok() that is multithread-safe and supports - empty fields. - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - Caveat: It doesn't work with multibyte strings unless all of the delimiter - characters are ASCII characters < 0x30. - - See also strtok_r(). */ -#if @GNULIB_STRSEP@ -# if ! @HAVE_STRSEP@ -extern char *strsep (char **restrict __stringp, char const *restrict __delim); -# endif -# if defined GNULIB_POSIXCHECK -# undef strsep -# define strsep(s,d) \ - (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbssep if you care about internationalization"), \ - strsep (s, d)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strsep -# define strsep(s,d) \ - (GL_LINK_WARNING ("strsep is unportable - " \ - "use gnulib module strsep for portability"), \ - strsep (s, d)) -#endif - -#if defined GNULIB_POSIXCHECK -/* strstr() does not work with multibyte strings if the locale encoding is - different from UTF-8: - POSIX says that it operates on "strings", and "string" in POSIX is defined - as a sequence of bytes, not of characters. */ -# undef strstr -# define strstr(a,b) \ - (GL_LINK_WARNING ("strstr cannot work correctly on character strings " \ - "in most multibyte locales - " \ - "use mbsstr if you care about internationalization"), \ - strstr (a, b)) -#endif - -/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive - comparison. */ -#if ! @HAVE_STRCASESTR@ -extern char *strcasestr (const char *haystack, const char *needle); -#endif -#if defined GNULIB_POSIXCHECK -/* strcasestr() does not work with multibyte strings: - It is a glibc extension, and glibc implements it only for unibyte - locales. */ -# undef strcasestr -# define strcasestr(a,b) \ - (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \ - "in multibyte locales - " \ - "use mbscasestr if you care about " \ - "internationalization, or use c-strcasestr if you want " \ - "a locale independent function"), \ - strcasestr (a, b)) -#endif - -/* Parse S into tokens separated by characters in DELIM. - If S is NULL, the saved pointer in SAVE_PTR is used as - the next starting point. For example: - char s[] = "-abc-=-def"; - char *sp; - x = strtok_r(s, "-", &sp); // x = "abc", sp = "=-def" - x = strtok_r(NULL, "-=", &sp); // x = "def", sp = NULL - x = strtok_r(NULL, "=", &sp); // x = NULL - // s = "abc\0-def\0" - - This is a variant of strtok() that is multithread-safe. - - For the POSIX documentation for this function, see: - http://www.opengroup.org/susv3xsh/strtok.html - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - Caveat: It doesn't work with multibyte strings unless all of the delimiter - characters are ASCII characters < 0x30. - - See also strsep(). */ -#if @GNULIB_STRTOK_R@ -# if ! @HAVE_DECL_STRTOK_R@ -extern char *strtok_r (char *restrict s, char const *restrict delim, - char **restrict save_ptr); -# endif -# if defined GNULIB_POSIXCHECK -# undef strtok_r -# define strtok_r(s,d,p) \ - (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \ - "in multibyte locales - " \ - "use mbstok_r if you care about internationalization"), \ - strtok_r (s, d, p)) -# endif -#elif defined GNULIB_POSIXCHECK -# undef strtok_r -# define strtok_r(s,d,p) \ - (GL_LINK_WARNING ("strtok_r is unportable - " \ - "use gnulib module strtok_r for portability"), \ - strtok_r (s, d, p)) -#endif - - -/* The following functions are not specified by POSIX. They are gnulib - extensions. */ - -#if @GNULIB_MBSLEN@ -/* Return the number of multibyte characters in the character string STRING. - This considers multibyte characters, unlike strlen, which counts bytes. */ -extern size_t mbslen (const char *string); -#endif - -#if @GNULIB_MBSNLEN@ -/* Return the number of multibyte characters in the character string starting - at STRING and ending at STRING + LEN. */ -extern size_t mbsnlen (const char *string, size_t len); -#endif - -#if @GNULIB_MBSCHR@ -/* Locate the first single-byte character C in the character string STRING, - and return a pointer to it. Return NULL if C is not found in STRING. - Unlike strchr(), this function works correctly in multibyte locales with - encodings such as GB18030. */ -# define mbschr rpl_mbschr /* avoid collision with HP-UX function */ -extern char * mbschr (const char *string, int c); -#endif - -#if @GNULIB_MBSRCHR@ -/* Locate the last single-byte character C in the character string STRING, - and return a pointer to it. Return NULL if C is not found in STRING. - Unlike strrchr(), this function works correctly in multibyte locales with - encodings such as GB18030. */ -# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */ -extern char * mbsrchr (const char *string, int c); -#endif - -#if @GNULIB_MBSSTR@ -/* Find the first occurrence of the character string NEEDLE in the character - string HAYSTACK. Return NULL if NEEDLE is not found in HAYSTACK. - Unlike strstr(), this function works correctly in multibyte locales with - encodings different from UTF-8. */ -extern char * mbsstr (const char *haystack, const char *needle); -#endif - -#if @GNULIB_MBSCASECMP@ -/* Compare the character strings S1 and S2, ignoring case, returning less than, - equal to or greater than zero if S1 is lexicographically less than, equal to - or greater than S2. - Note: This function may, in multibyte locales, return 0 for strings of - different lengths! - Unlike strcasecmp(), this function works correctly in multibyte locales. */ -extern int mbscasecmp (const char *s1, const char *s2); -#endif - -#if @GNULIB_MBSNCASECMP@ -/* Compare the initial segment of the character string S1 consisting of at most - N characters with the initial segment of the character string S2 consisting - of at most N characters, ignoring case, returning less than, equal to or - greater than zero if the initial segment of S1 is lexicographically less - than, equal to or greater than the initial segment of S2. - Note: This function may, in multibyte locales, return 0 for initial segments - of different lengths! - Unlike strncasecmp(), this function works correctly in multibyte locales. - But beware that N is not a byte count but a character count! */ -extern int mbsncasecmp (const char *s1, const char *s2, size_t n); -#endif - -#if @GNULIB_MBSPCASECMP@ -/* Compare the initial segment of the character string STRING consisting of - at most mbslen (PREFIX) characters with the character string PREFIX, - ignoring case, returning less than, equal to or greater than zero if this - initial segment is lexicographically less than, equal to or greater than - PREFIX. - Note: This function may, in multibyte locales, return 0 if STRING is of - smaller length than PREFIX! - Unlike strncasecmp(), this function works correctly in multibyte - locales. */ -extern char * mbspcasecmp (const char *string, const char *prefix); -#endif - -#if @GNULIB_MBSCASESTR@ -/* Find the first occurrence of the character string NEEDLE in the character - string HAYSTACK, using case-insensitive comparison. - Note: This function may, in multibyte locales, return success even if - strlen (haystack) < strlen (needle) ! - Unlike strcasestr(), this function works correctly in multibyte locales. */ -extern char * mbscasestr (const char *haystack, const char *needle); -#endif - -#if @GNULIB_MBSCSPN@ -/* Find the first occurrence in the character string STRING of any character - in the character string ACCEPT. Return the number of bytes from the - beginning of the string to this occurrence, or to the end of the string - if none exists. - Unlike strcspn(), this function works correctly in multibyte locales. */ -extern size_t mbscspn (const char *string, const char *accept); -#endif - -#if @GNULIB_MBSPBRK@ -/* Find the first occurrence in the character string STRING of any character - in the character string ACCEPT. Return the pointer to it, or NULL if none - exists. - Unlike strpbrk(), this function works correctly in multibyte locales. */ -# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */ -extern char * mbspbrk (const char *string, const char *accept); -#endif - -#if @GNULIB_MBSSPN@ -/* Find the first occurrence in the character string STRING of any character - not in the character string REJECT. Return the number of bytes from the - beginning of the string to this occurrence, or to the end of the string - if none exists. - Unlike strspn(), this function works correctly in multibyte locales. */ -extern size_t mbsspn (const char *string, const char *reject); -#endif - -#if @GNULIB_MBSSEP@ -/* Search the next delimiter (multibyte character listed in the character - string DELIM) starting at the character string *STRINGP. - If one is found, overwrite it with a NUL, and advance *STRINGP to point - to the next multibyte character after it. Otherwise, set *STRINGP to NULL. - If *STRINGP was already NULL, nothing happens. - Return the old value of *STRINGP. - - This is a variant of mbstok_r() that supports empty fields. - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - - See also mbstok_r(). */ -extern char * mbssep (char **stringp, const char *delim); -#endif - -#if @GNULIB_MBSTOK_R@ -/* Parse the character string STRING into tokens separated by characters in - the character string DELIM. - If STRING is NULL, the saved pointer in SAVE_PTR is used as - the next starting point. For example: - char s[] = "-abc-=-def"; - char *sp; - x = mbstok_r(s, "-", &sp); // x = "abc", sp = "=-def" - x = mbstok_r(NULL, "-=", &sp); // x = "def", sp = NULL - x = mbstok_r(NULL, "=", &sp); // x = NULL - // s = "abc\0-def\0" - - Caveat: It modifies the original string. - Caveat: These functions cannot be used on constant strings. - Caveat: The identity of the delimiting character is lost. - - See also mbssep(). */ -extern char * mbstok_r (char *string, const char *delim, char **save_ptr); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_STRING_H */ -#endif /* _GL_STRING_H */ diff --git a/gnulib/sys_socket.in.h b/gnulib/sys_socket.in.h new file mode 100644 index 0000000..5e0b097 --- /dev/null +++ b/gnulib/sys_socket.in.h @@ -0,0 +1,91 @@ +/* Provide a sys/socket header file for systems lacking it (read: MinGW). + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Written by Simon Josefsson. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* This file is supposed to be used on platforms that lack + and on platforms where cannot be included standalone. + It is intended to provide definitions and prototypes needed by an + application. */ + +#ifndef _GL_SYS_SOCKET_H + +#if @HAVE_SYS_SOCKET_H@ + +/* On many platforms, assumes prior inclusion of + . */ +# include + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ + +#endif + +#ifndef _GL_SYS_SOCKET_H +#define _GL_SYS_SOCKET_H + +#if !@HAVE_SYS_SOCKET_H@ + +/* A platform that lacks . + + Currently only MinGW is supported. See the gnulib manual regarding + Windows sockets. MinGW has the header files winsock2.h and + ws2tcpip.h that declare the sys/socket.h definitions we need. Note + that you can influence which definitions you get by setting the + WINVER symbol before including these two files. For example, + getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that + symbol is set indiriectly through WINVER). You can set this by + adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your + code may not run on older Windows releases then. My Windows 2000 + box was not able to run the code, for example. The situation is + slightly confusing because: + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp + suggests that getaddrinfo should be available on all Windows + releases. */ + + +# if @HAVE_WINSOCK2_H@ +# include +# endif +# if @HAVE_WS2TCPIP_H@ +# include +# endif + +/* For shutdown(). */ +# if !defined SHUT_RD && defined SD_RECEIVE +# define SHUT_RD SD_RECEIVE +# endif +# if !defined SHUT_WR && defined SD_SEND +# define SHUT_WR SD_SEND +# endif +# if !defined SHUT_RDWR && defined SD_BOTH +# define SHUT_RDWR SD_BOTH +# endif + +# if defined _WIN32 || defined __WIN32__ +# define ENOTSOCK WSAENOTSOCK +# define EADDRINUSE WSAEADDRINUSE +# define ENETRESET WSAENETRESET +# define ECONNABORTED WSAECONNABORTED +# define ECONNRESET WSAECONNRESET +# define ENOTCONN WSAENOTCONN +# define ESHUTDOWN WSAESHUTDOWN +# endif + +#endif /* HAVE_SYS_SOCKET_H */ + +#endif /* _GL_SYS_SOCKET_H */ +#endif /* _GL_SYS_SOCKET_H */ diff --git a/gnulib/sys_socket_.h b/gnulib/sys_socket_.h deleted file mode 100644 index c25b6ab..0000000 --- a/gnulib/sys_socket_.h +++ /dev/null @@ -1,91 +0,0 @@ -/* Provide a sys/socket header file for systems lacking it (read: MinGW). - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. - Written by Simon Josefsson. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* This file is supposed to be used on platforms that lack - and on platforms where cannot be included standalone. - It is intended to provide definitions and prototypes needed by an - application. */ - -#ifndef _GL_SYS_SOCKET_H - -#if @HAVE_SYS_SOCKET_H@ - -/* On many platforms, assumes prior inclusion of - . */ -# include - -/* The include_next requires a split double-inclusion guard. */ -# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@ - -#endif - -#ifndef _GL_SYS_SOCKET_H -#define _GL_SYS_SOCKET_H - -#if !@HAVE_SYS_SOCKET_H@ - -/* A platform that lacks . - - Currently only MinGW is supported. See the gnulib manual regarding - Windows sockets. MinGW has the header files winsock2.h and - ws2tcpip.h that declare the sys/socket.h definitions we need. Note - that you can influence which definitions you get by setting the - WINVER symbol before including these two files. For example, - getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that - symbol is set indiriectly through WINVER). You can set this by - adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your - code may not run on older Windows releases then. My Windows 2000 - box was not able to run the code, for example. The situation is - slightly confusing because: - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp - suggests that getaddrinfo should be available on all Windows - releases. */ - - -# if @HAVE_WINSOCK2_H@ -# include -# endif -# if @HAVE_WS2TCPIP_H@ -# include -# endif - -/* For shutdown(). */ -# if !defined SHUT_RD && defined SD_RECEIVE -# define SHUT_RD SD_RECEIVE -# endif -# if !defined SHUT_WR && defined SD_SEND -# define SHUT_WR SD_SEND -# endif -# if !defined SHUT_RDWR && defined SD_BOTH -# define SHUT_RDWR SD_BOTH -# endif - -# if defined _WIN32 || defined __WIN32__ -# define ENOTSOCK WSAENOTSOCK -# define EADDRINUSE WSAEADDRINUSE -# define ENETRESET WSAENETRESET -# define ECONNABORTED WSAECONNABORTED -# define ECONNRESET WSAECONNRESET -# define ENOTCONN WSAENOTCONN -# define ESHUTDOWN WSAESHUTDOWN -# endif - -#endif /* HAVE_SYS_SOCKET_H */ - -#endif /* _GL_SYS_SOCKET_H */ -#endif /* _GL_SYS_SOCKET_H */ diff --git a/gnulib/sys_stat.in.h b/gnulib/sys_stat.in.h new file mode 100644 index 0000000..b60e322 --- /dev/null +++ b/gnulib/sys_stat.in.h @@ -0,0 +1,280 @@ +/* Provide a more complete sys/stat header file. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ + +/* This file is supposed to be used on platforms where is + incomplete. It is intended to provide definitions and prototypes + needed by an application. Start with what the system provides. */ + +#ifndef _GL_SYS_STAT_H + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ + +#ifndef _GL_SYS_STAT_H +#define _GL_SYS_STAT_H + +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif + +#if STAT_MACROS_BROKEN +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISNAM +# undef S_ISMPB +# undef S_ISMPC +# undef S_ISNWK +# undef S_ISREG +# undef S_ISSOCK +#endif + +#ifndef S_ISBLK +# ifdef S_IFBLK +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(m) 0 +# endif +#endif + +#ifndef S_ISCHR +# ifdef S_IFCHR +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +# else +# define S_ISCHR(m) 0 +# endif +#endif + +#ifndef S_ISDIR +# ifdef S_IFDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# else +# define S_ISDIR(m) 0 +# endif +#endif + +#ifndef S_ISDOOR /* Solaris 2.5 and up */ +# define S_ISDOOR(m) 0 +#endif + +#ifndef S_ISFIFO +# ifdef S_IFIFO +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(m) 0 +# endif +#endif + +#ifndef S_ISLNK +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) 0 +# endif +#endif + +#ifndef S_ISMPB /* V7 */ +# ifdef S_IFMPB +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +# else +# define S_ISMPB(m) 0 +# define S_ISMPC(m) 0 +# endif +#endif + +#ifndef S_ISNAM /* Xenix */ +# ifdef S_IFNAM +# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) +# else +# define S_ISNAM(m) 0 +# endif +#endif + +#ifndef S_ISNWK /* HP/UX */ +# ifdef S_IFNWK +# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +# else +# define S_ISNWK(m) 0 +# endif +#endif + +#ifndef S_ISPORT /* Solaris 10 and up */ +# define S_ISPORT(m) 0 +#endif + +#ifndef S_ISREG +# ifdef S_IFREG +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# else +# define S_ISREG(m) 0 +# endif +#endif + +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) 0 +# endif +#endif + + +#ifndef S_TYPEISMQ +# define S_TYPEISMQ(p) 0 +#endif + +#ifndef S_TYPEISTMO +# define S_TYPEISTMO(p) 0 +#endif + + +#ifndef S_TYPEISSEM +# ifdef S_INSEM +# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) +# else +# define S_TYPEISSEM(p) 0 +# endif +#endif + +#ifndef S_TYPEISSHM +# ifdef S_INSHD +# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) +# else +# define S_TYPEISSHM(p) 0 +# endif +#endif + +/* high performance ("contiguous data") */ +#ifndef S_ISCTG +# define S_ISCTG(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with data */ +#ifndef S_ISOFD +# define S_ISOFD(p) 0 +#endif + +/* Cray DMF (data migration facility): off line, with no data */ +#ifndef S_ISOFL +# define S_ISOFL(p) 0 +#endif + +/* 4.4BSD whiteout */ +#ifndef S_ISWHT +# define S_ISWHT(m) 0 +#endif + +/* If any of the following are undefined, + define them to their de facto standard values. */ +#if !S_ISUID +# define S_ISUID 04000 +#endif +#if !S_ISGID +# define S_ISGID 02000 +#endif + +/* S_ISVTX is a common extension to POSIX. */ +#ifndef S_ISVTX +# define S_ISVTX 01000 +#endif + +#if !S_IRUSR && S_IREAD +# define S_IRUSR S_IREAD +#endif +#if !S_IRUSR +# define S_IRUSR 00400 +#endif +#if !S_IRGRP +# define S_IRGRP (S_IRUSR >> 3) +#endif +#if !S_IROTH +# define S_IROTH (S_IRUSR >> 6) +#endif + +#if !S_IWUSR && S_IWRITE +# define S_IWUSR S_IWRITE +#endif +#if !S_IWUSR +# define S_IWUSR 00200 +#endif +#if !S_IWGRP +# define S_IWGRP (S_IWUSR >> 3) +#endif +#if !S_IWOTH +# define S_IWOTH (S_IWUSR >> 6) +#endif + +#if !S_IXUSR && S_IEXEC +# define S_IXUSR S_IEXEC +#endif +#if !S_IXUSR +# define S_IXUSR 00100 +#endif +#if !S_IXGRP +# define S_IXGRP (S_IXUSR >> 3) +#endif +#if !S_IXOTH +# define S_IXOTH (S_IXUSR >> 6) +#endif + +#if !S_IRWXU +# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) +#endif +#if !S_IRWXG +# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) +#endif +#if !S_IRWXO +# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) +#endif + +/* S_IXUGO is a common extension to POSIX. */ +#if !S_IXUGO +# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) +#endif + +#ifndef S_IRWXUGO +# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) +#endif + +/* mingw does not support symlinks, therefore it does not have lstat. But + without links, stat does just fine. */ +#if ! @HAVE_LSTAT@ +# define lstat stat +#endif + +/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. + Additionally, it declares _mkdir (and depending on compile flags, an + alias mkdir), only in the nonstandard io.h. */ +#if ! @HAVE_DECL_MKDIR@ && @HAVE_IO_H@ +# include + +static inline int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} + +# define mkdir rpl_mkdir +#endif + +#endif /* _GL_SYS_STAT_H */ +#endif /* _GL_SYS_STAT_H */ diff --git a/gnulib/sys_stat_.h b/gnulib/sys_stat_.h deleted file mode 100644 index 2e411cd..0000000 --- a/gnulib/sys_stat_.h +++ /dev/null @@ -1,280 +0,0 @@ -/* Provide a more complete sys/stat header file. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ - -/* This file is supposed to be used on platforms where is - incomplete. It is intended to provide definitions and prototypes - needed by an application. Start with what the system provides. */ - -#ifndef _GL_SYS_STAT_H - -/* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ - -#ifndef _GL_SYS_STAT_H -#define _GL_SYS_STAT_H - -#ifndef S_IFMT -# define S_IFMT 0170000 -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISBLK -# undef S_ISCHR -# undef S_ISDIR -# undef S_ISFIFO -# undef S_ISLNK -# undef S_ISNAM -# undef S_ISMPB -# undef S_ISMPC -# undef S_ISNWK -# undef S_ISREG -# undef S_ISSOCK -#endif - -#ifndef S_ISBLK -# ifdef S_IFBLK -# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -# else -# define S_ISBLK(m) 0 -# endif -#endif - -#ifndef S_ISCHR -# ifdef S_IFCHR -# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -# else -# define S_ISCHR(m) 0 -# endif -#endif - -#ifndef S_ISDIR -# ifdef S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# else -# define S_ISDIR(m) 0 -# endif -#endif - -#ifndef S_ISDOOR /* Solaris 2.5 and up */ -# define S_ISDOOR(m) 0 -#endif - -#ifndef S_ISFIFO -# ifdef S_IFIFO -# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -# else -# define S_ISFIFO(m) 0 -# endif -#endif - -#ifndef S_ISLNK -# ifdef S_IFLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -# else -# define S_ISLNK(m) 0 -# endif -#endif - -#ifndef S_ISMPB /* V7 */ -# ifdef S_IFMPB -# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -# else -# define S_ISMPB(m) 0 -# define S_ISMPC(m) 0 -# endif -#endif - -#ifndef S_ISNAM /* Xenix */ -# ifdef S_IFNAM -# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) -# else -# define S_ISNAM(m) 0 -# endif -#endif - -#ifndef S_ISNWK /* HP/UX */ -# ifdef S_IFNWK -# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -# else -# define S_ISNWK(m) 0 -# endif -#endif - -#ifndef S_ISPORT /* Solaris 10 and up */ -# define S_ISPORT(m) 0 -#endif - -#ifndef S_ISREG -# ifdef S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -# else -# define S_ISREG(m) 0 -# endif -#endif - -#ifndef S_ISSOCK -# ifdef S_IFSOCK -# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -# else -# define S_ISSOCK(m) 0 -# endif -#endif - - -#ifndef S_TYPEISMQ -# define S_TYPEISMQ(p) 0 -#endif - -#ifndef S_TYPEISTMO -# define S_TYPEISTMO(p) 0 -#endif - - -#ifndef S_TYPEISSEM -# ifdef S_INSEM -# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) -# else -# define S_TYPEISSEM(p) 0 -# endif -#endif - -#ifndef S_TYPEISSHM -# ifdef S_INSHD -# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) -# else -# define S_TYPEISSHM(p) 0 -# endif -#endif - -/* high performance ("contiguous data") */ -#ifndef S_ISCTG -# define S_ISCTG(p) 0 -#endif - -/* Cray DMF (data migration facility): off line, with data */ -#ifndef S_ISOFD -# define S_ISOFD(p) 0 -#endif - -/* Cray DMF (data migration facility): off line, with no data */ -#ifndef S_ISOFL -# define S_ISOFL(p) 0 -#endif - -/* 4.4BSD whiteout */ -#ifndef S_ISWHT -# define S_ISWHT(m) 0 -#endif - -/* If any of the following are undefined, - define them to their de facto standard values. */ -#if !S_ISUID -# define S_ISUID 04000 -#endif -#if !S_ISGID -# define S_ISGID 02000 -#endif - -/* S_ISVTX is a common extension to POSIX. */ -#ifndef S_ISVTX -# define S_ISVTX 01000 -#endif - -#if !S_IRUSR && S_IREAD -# define S_IRUSR S_IREAD -#endif -#if !S_IRUSR -# define S_IRUSR 00400 -#endif -#if !S_IRGRP -# define S_IRGRP (S_IRUSR >> 3) -#endif -#if !S_IROTH -# define S_IROTH (S_IRUSR >> 6) -#endif - -#if !S_IWUSR && S_IWRITE -# define S_IWUSR S_IWRITE -#endif -#if !S_IWUSR -# define S_IWUSR 00200 -#endif -#if !S_IWGRP -# define S_IWGRP (S_IWUSR >> 3) -#endif -#if !S_IWOTH -# define S_IWOTH (S_IWUSR >> 6) -#endif - -#if !S_IXUSR && S_IEXEC -# define S_IXUSR S_IEXEC -#endif -#if !S_IXUSR -# define S_IXUSR 00100 -#endif -#if !S_IXGRP -# define S_IXGRP (S_IXUSR >> 3) -#endif -#if !S_IXOTH -# define S_IXOTH (S_IXUSR >> 6) -#endif - -#if !S_IRWXU -# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -#endif -#if !S_IRWXG -# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) -#endif -#if !S_IRWXO -# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#endif - -/* S_IXUGO is a common extension to POSIX. */ -#if !S_IXUGO -# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) -#endif - -#ifndef S_IRWXUGO -# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) -#endif - -/* mingw does not support symlinks, therefore it does not have lstat. But - without links, stat does just fine. */ -#if ! @HAVE_LSTAT@ -# define lstat stat -#endif - -/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. - Additionally, it declares _mkdir (and depending on compile flags, an - alias mkdir), only in the nonstandard io.h. */ -#if ! @HAVE_DECL_MKDIR@ && @HAVE_IO_H@ -# include - -static inline int -rpl_mkdir (char const *name, mode_t mode) -{ - return _mkdir (name); -} - -# define mkdir rpl_mkdir -#endif - -#endif /* _GL_SYS_STAT_H */ -#endif /* _GL_SYS_STAT_H */ diff --git a/gnulib/sys_time.in.h b/gnulib/sys_time.in.h new file mode 100644 index 0000000..6b65cb6 --- /dev/null +++ b/gnulib/sys_time.in.h @@ -0,0 +1,52 @@ +/* Provide a more complete sys/time.h. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Paul Eggert. */ + +#if defined _GL_SYS_TIME_H + +/* Simply delegate to the system's header, without adding anything. */ +# if @HAVE_SYS_TIME_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +# endif + +#else + +# define _GL_SYS_TIME_H + +# if @HAVE_SYS_TIME_H@ +# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ +# else +# include +# endif + +# if ! @HAVE_STRUCT_TIMEVAL@ +struct timeval +{ + time_t tv_sec; + long int tv_usec; +}; +# endif + +# if @REPLACE_GETTIMEOFDAY@ +# undef gettimeofday +# define gettimeofday rpl_gettimeofday +int gettimeofday (struct timeval *, void *); +# endif + +#endif /* _GL_SYS_TIME_H */ diff --git a/gnulib/sys_time_.h b/gnulib/sys_time_.h deleted file mode 100644 index 296d20d..0000000 --- a/gnulib/sys_time_.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Provide a more complete sys/time.h. - - Copyright (C) 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Paul Eggert. */ - -#if defined _GL_SYS_TIME_H - -/* Simply delegate to the system's header, without adding anything. */ -# if @HAVE_SYS_TIME_H@ -# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ -# endif - -#else - -# define _GL_SYS_TIME_H - -# if @HAVE_SYS_TIME_H@ -# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ -# else -# include -# endif - -# if ! @HAVE_STRUCT_TIMEVAL@ -struct timeval -{ - time_t tv_sec; - long int tv_usec; -}; -# endif - -# if @REPLACE_GETTIMEOFDAY@ -# undef gettimeofday -# define gettimeofday rpl_gettimeofday -int gettimeofday (struct timeval *restrict, void *restrict); -# endif - -#endif /* _GL_SYS_TIME_H */ diff --git a/gnulib/tempname.c b/gnulib/tempname.c index e213600..5a3a326 100644 --- a/gnulib/tempname.c +++ b/gnulib/tempname.c @@ -4,19 +4,18 @@ 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */ diff --git a/gnulib/tempname.h b/gnulib/tempname.h index c51fa69..74da03b 100644 --- a/gnulib/tempname.h +++ b/gnulib/tempname.h @@ -2,10 +2,10 @@ Copyright (C) 2006 Free Software Foundation, Inc. - This program is free software; you can redistribute it and/or modify + This program 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, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -13,8 +13,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* header written by Eric Blake */ diff --git a/gnulib/unistd.in.h b/gnulib/unistd.in.h new file mode 100644 index 0000000..17b29af --- /dev/null +++ b/gnulib/unistd.in.h @@ -0,0 +1,340 @@ +/* Substitute for and wrapper around . + Copyright (C) 2004-2008 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GL_UNISTD_H + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_UNISTD_H@ +# @INCLUDE_NEXT@ @NEXT_UNISTD_H@ +#endif + +#ifndef _GL_UNISTD_H +#define _GL_UNISTD_H + +/* mingw doesn't define the SEEK_* macros in . */ +#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) +# include +#endif + +/* mingw fails to declare _exit in . */ +#include + +/* The definition of GL_LINK_WARNING is copied here. */ + + +/* Declare overridden functions. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +#if @GNULIB_CHOWN@ +# if @REPLACE_CHOWN@ +# ifndef REPLACE_CHOWN +# define REPLACE_CHOWN 1 +# endif +# if REPLACE_CHOWN +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define chown rpl_chown +extern int chown (const char *file, uid_t uid, gid_t gid); +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef chown +# define chown(f,u,g) \ + (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ + "doesn't treat a uid or gid of -1 on some systems - " \ + "use gnulib module chown for portability"), \ + chown (f, u, g)) +#endif + + +#if @GNULIB_DUP2@ +# if !@HAVE_DUP2@ +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if + NEWFD = OLDFD, otherwise close NEWFD first if it is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int dup2 (int oldfd, int newfd); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dup2 +# define dup2(o,n) \ + (GL_LINK_WARNING ("dup2 is unportable - " \ + "use gnulib module dup2 for portability"), \ + dup2 (o, n)) +#endif + + +#if @GNULIB_ENVIRON@ +# if !@HAVE_DECL_ENVIRON@ +/* Set of environment variables and values. An array of strings of the form + "VARIABLE=VALUE", terminated with a NULL. */ +# if defined __APPLE__ && defined __MACH__ +# include +# define environ (*_NSGetEnviron ()) +# else +extern char **environ; +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef environ +# define environ \ + (GL_LINK_WARNING ("environ is unportable - " \ + "use gnulib module environ for portability"), \ + environ) +#endif + + +#if @GNULIB_FCHDIR@ +# if @REPLACE_FCHDIR@ + +/* Change the process' current working directory to the directory on which + the given file descriptor is open. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int fchdir (int /*fd*/); + +# define close rpl_close +extern int close (int); +# define dup rpl_dup +extern int dup (int); +# define dup2 rpl_dup2 +extern int dup2 (int, int); + +# endif +#elif defined GNULIB_POSIXCHECK +# undef fchdir +# define fchdir(f) \ + (GL_LINK_WARNING ("fchdir is unportable - " \ + "use gnulib module fchdir for portability"), \ + fchdir (f)) +#endif + + +#if @GNULIB_FTRUNCATE@ +# if !@HAVE_FTRUNCATE@ +/* Change the size of the file to which FD is opened to become equal to LENGTH. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +extern int ftruncate (int fd, off_t length); +# endif +#elif defined GNULIB_POSIXCHECK +# undef ftruncate +# define ftruncate(f,l) \ + (GL_LINK_WARNING ("ftruncate is unportable - " \ + "use gnulib module ftruncate for portability"), \ + ftruncate (f, l)) +#endif + + +#if @GNULIB_GETCWD@ +/* Include the headers that might declare getcwd so that they will not + cause confusion if included after this file. */ +# include +# if @REPLACE_GETCWD@ +/* Get the name of the current working directory, and put it in SIZE bytes + of BUF. + Return BUF if successful, or NULL if the directory couldn't be determined + or SIZE was too small. + See the POSIX:2001 specification + . + Additionally, the gnulib module 'getcwd' guarantees the following GNU + extension: If BUF is NULL, an array is allocated with 'malloc'; the array + is SIZE bytes long, unless SIZE == 0, in which case it is as big as + necessary. */ +# define getcwd rpl_getcwd +extern char * getcwd (char *buf, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getcwd +# define getcwd(b,s) \ + (GL_LINK_WARNING ("getcwd is unportable - " \ + "use gnulib module getcwd for portability"), \ + getcwd (b, s)) +#endif + + +#if @GNULIB_GETLOGIN_R@ +/* Copies the user's login name to NAME. + The array pointed to by NAME has room for SIZE bytes. + + Returns 0 if successful. Upon error, an error number is returned, or -1 in + the case that the login name cannot be found but no specific error is + provided (this case is hopefully rare but is left open by the POSIX spec). + + See . + */ +# if !@HAVE_DECL_GETLOGIN_R@ +# include +extern int getlogin_r (char *name, size_t size); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getlogin_r +# define getlogin_r(n,s) \ + (GL_LINK_WARNING ("getlogin_r is unportable - " \ + "use gnulib module getlogin_r for portability"), \ + getlogin_r (n, s)) +#endif + + +#if @GNULIB_GETPAGESIZE@ +# if @REPLACE_GETPAGESIZE@ +# define getpagesize rpl_getpagesize +extern int getpagesize (void); +# elif !@HAVE_GETPAGESIZE@ +/* This is for POSIX systems. */ +# if !defined getpagesize && defined _SC_PAGESIZE +# if ! (defined __VMS && __VMS_VER < 70000000) +# define getpagesize() sysconf (_SC_PAGESIZE) +# endif +# endif +/* This is for older VMS. */ +# if !defined getpagesize && defined __VMS +# ifdef __ALPHA +# define getpagesize() 8192 +# else +# define getpagesize() 512 +# endif +# endif +/* This is for BeOS. */ +# if !defined getpagesize && @HAVE_OS_H@ +# include +# if defined B_PAGE_SIZE +# define getpagesize() B_PAGE_SIZE +# endif +# endif +/* This is for AmigaOS4.0. */ +# if !defined getpagesize && defined __amigaos4__ +# define getpagesize() 2048 +# endif +/* This is for older Unix systems. */ +# if !defined getpagesize && @HAVE_SYS_PARAM_H@ +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define getpagesize() NBPC +# endif +# endif +# endif +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef getpagesize +# define getpagesize() \ + (GL_LINK_WARNING ("getpagesize is unportable - " \ + "use gnulib module getpagesize for portability"), \ + getpagesize ()) +#endif + + +#if @GNULIB_LCHOWN@ +# if @REPLACE_LCHOWN@ +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE + to GID (if GID is not -1). Do not follow symbolic links. + Return 0 if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define lchown rpl_lchown +extern int lchown (char const *file, uid_t owner, gid_t group); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lchown +# define lchown(f,u,g) \ + (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \ + "systems - use gnulib module lchown for portability"), \ + lchown (f, u, g)) +#endif + + +#if @GNULIB_LSEEK@ +# if @REPLACE_LSEEK@ +/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. + Return the new offset if successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# define lseek rpl_lseek + extern off_t lseek (int fd, off_t offset, int whence); +# endif +#elif defined GNULIB_POSIXCHECK +# undef lseek +# define lseek(f,o,w) \ + (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \ + "systems - use gnulib module lseek for portability"), \ + lseek (f, o, w)) +#endif + + +#if @GNULIB_READLINK@ +/* Read the contents of the symbolic link FILE and place the first BUFSIZE + bytes of it into BUF. Return the number of bytes placed into BUF if + successful, otherwise -1 and errno set. + See the POSIX:2001 specification + . */ +# if !@HAVE_READLINK@ +# include +extern int readlink (const char *file, char *buf, size_t bufsize); +# endif +#elif defined GNULIB_POSIXCHECK +# undef readlink +# define readlink(f,b,s) \ + (GL_LINK_WARNING ("readlink is unportable - " \ + "use gnulib module readlink for portability"), \ + readlink (f, b, s)) +#endif + + +#if @GNULIB_SLEEP@ +/* Pause the execution of the current thread for N seconds. + Returns the number of seconds left to sleep. + See the POSIX:2001 specification + . */ +# if !@HAVE_SLEEP@ +extern unsigned int sleep (unsigned int n); +# endif +#elif defined GNULIB_POSIXCHECK +# undef sleep +# define sleep(n) \ + (GL_LINK_WARNING ("sleep is unportable - " \ + "use gnulib module sleep for portability"), \ + sleep (n)) +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif /* _GL_UNISTD_H */ +#endif /* _GL_UNISTD_H */ diff --git a/gnulib/unistd_.h b/gnulib/unistd_.h deleted file mode 100644 index 07c4877..0000000 --- a/gnulib/unistd_.h +++ /dev/null @@ -1,262 +0,0 @@ -/* Substitute for and wrapper around . - Copyright (C) 2004-2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -#ifndef _GL_UNISTD_H - -/* The include_next requires a split double-inclusion guard. */ -#if @HAVE_UNISTD_H@ -# @INCLUDE_NEXT@ @NEXT_UNISTD_H@ -#endif - -#ifndef _GL_UNISTD_H -#define _GL_UNISTD_H - -/* mingw doesn't define the SEEK_* macros in . */ -#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) -# include -#endif - -/* mingw fails to declare _exit in . */ -#include - -/* The definition of GL_LINK_WARNING is copied here. */ - - -/* Declare overridden functions. */ - -#ifdef __cplusplus -extern "C" { -#endif - - -#if @GNULIB_CHOWN@ -# if @REPLACE_CHOWN@ -# ifndef REPLACE_CHOWN -# define REPLACE_CHOWN 1 -# endif -# if REPLACE_CHOWN -/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE - to GID (if GID is not -1). Follow symbolic links. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# define chown rpl_chown -extern int chown (const char *file, uid_t uid, gid_t gid); -# endif -# endif -#elif defined GNULIB_POSIXCHECK -# undef chown -# define chown(f,u,g) \ - (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \ - "doesn't treat a uid or gid of -1 on some systems - " \ - "use gnulib module chown for portability"), \ - chown (f, u, g)) -#endif - - -#if @GNULIB_DUP2@ -# if !@HAVE_DUP2@ -/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if - NEWFD = OLDFD, otherwise close NEWFD first if it is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int dup2 (int oldfd, int newfd); -# endif -#elif defined GNULIB_POSIXCHECK -# undef dup2 -# define dup2(o,n) \ - (GL_LINK_WARNING ("dup2 is unportable - " \ - "use gnulib module dup2 for portability"), \ - dup2 (o, n)) -#endif - - -#if @GNULIB_FCHDIR@ -# if @REPLACE_FCHDIR@ - -/* Change the process' current working directory to the directory on which - the given file descriptor is open. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int fchdir (int /*fd*/); - -# define close rpl_close -extern int close (int); -# define dup rpl_dup -extern int dup (int); -# define dup2 rpl_dup2 -extern int dup2 (int, int); - -# endif -#elif defined GNULIB_POSIXCHECK -# undef fchdir -# define fchdir(f) \ - (GL_LINK_WARNING ("fchdir is unportable - " \ - "use gnulib module fchdir for portability"), \ - fchdir (f)) -#endif - - -#if @GNULIB_FTRUNCATE@ -# if !@HAVE_FTRUNCATE@ -/* Change the size of the file to which FD is opened to become equal to LENGTH. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -extern int ftruncate (int fd, off_t length); -# endif -#elif defined GNULIB_POSIXCHECK -# undef ftruncate -# define ftruncate(f,l) \ - (GL_LINK_WARNING ("ftruncate is unportable - " \ - "use gnulib module ftruncate for portability"), \ - ftruncate (f, l)) -#endif - - -#if @GNULIB_GETCWD@ -/* Include the headers that might declare getcwd so that they will not - cause confusion if included after this file. */ -# include -# if @REPLACE_GETCWD@ -/* Get the name of the current working directory, and put it in SIZE bytes - of BUF. - Return BUF if successful, or NULL if the directory couldn't be determined - or SIZE was too small. - See the POSIX:2001 specification - . - Additionally, the gnulib module 'getcwd' guarantees the following GNU - extension: If BUF is NULL, an array is allocated with 'malloc'; the array - is SIZE bytes long, unless SIZE == 0, in which case it is as big as - necessary. */ -# define getcwd rpl_getcwd -extern char * getcwd (char *buf, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getcwd -# define getcwd(b,s) \ - (GL_LINK_WARNING ("getcwd is unportable - " \ - "use gnulib module getcwd for portability"), \ - getcwd (b, s)) -#endif - - -#if @GNULIB_GETLOGIN_R@ -/* Copies the user's login name to NAME. - The array pointed to by NAME has room for SIZE bytes. - - Returns 0 if successful. Upon error, an error number is returned, or -1 in - the case that the login name cannot be found but no specific error is - provided (this case is hopefully rare but is left open by the POSIX spec). - - See . - */ -# if !@HAVE_DECL_GETLOGIN_R@ -# include -extern int getlogin_r (char *name, size_t size); -# endif -#elif defined GNULIB_POSIXCHECK -# undef getlogin_r -# define getlogin_r(n,s) \ - (GL_LINK_WARNING ("getlogin_r is unportable - " \ - "use gnulib module getlogin_r for portability"), \ - getlogin_r (n, s)) -#endif - - -#if @GNULIB_LCHOWN@ -# if @REPLACE_LCHOWN@ -/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE - to GID (if GID is not -1). Do not follow symbolic links. - Return 0 if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# define lchown rpl_lchown -extern int lchown (char const *file, uid_t owner, gid_t group); -# endif -#elif defined GNULIB_POSIXCHECK -# undef lchown -# define lchown(f,u,g) \ - (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \ - "systems - use gnulib module lchown for portability"), \ - lchown (f, u, g)) -#endif - - -#if @GNULIB_LSEEK@ -# if @REPLACE_LSEEK@ -/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. - Return the new offset if successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# define lseek rpl_lseek - extern off_t lseek (int fd, off_t offset, int whence); -# endif -#elif defined GNULIB_POSIXCHECK -# undef lseek -# define lseek(f,o,w) \ - (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \ - "systems - use gnulib module lseek for portability"), \ - lseek (f, o, w)) -#endif - - -#if @GNULIB_READLINK@ -/* Read the contents of the symbolic link FILE and place the first BUFSIZE - bytes of it into BUF. Return the number of bytes placed into BUF if - successful, otherwise -1 and errno set. - See the POSIX:2001 specification - . */ -# if !@HAVE_READLINK@ -# include -extern int readlink (const char *file, char *buf, size_t bufsize); -# endif -#elif defined GNULIB_POSIXCHECK -# undef readlink -# define readlink(f,b,s) \ - (GL_LINK_WARNING ("readlink is unportable - " \ - "use gnulib module readlink for portability"), \ - readlink (f, b, s)) -#endif - - -#if @GNULIB_SLEEP@ -/* Pause the execution of the current thread for N seconds. - Returns the number of seconds left to sleep. - See the POSIX:2001 specification - . */ -# if !@HAVE_SLEEP@ -extern unsigned int sleep (unsigned int n); -# endif -#elif defined GNULIB_POSIXCHECK -# undef sleep -# define sleep(n) \ - (GL_LINK_WARNING ("sleep is unportable - " \ - "use gnulib module sleep for portability"), \ - sleep (n)) -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* _GL_UNISTD_H */ -#endif /* _GL_UNISTD_H */ diff --git a/gnulib/vasnprintf.c b/gnulib/vasnprintf.c index f563823..d5b4028 100644 --- a/gnulib/vasnprintf.c +++ b/gnulib/vasnprintf.c @@ -1,9 +1,9 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -88,27 +88,30 @@ /* Checked size_t computations. */ #include "xsize.h" -#if NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL # include # include "float+.h" -# include "fpucw.h" #endif -#if NEED_PRINTF_INFINITE_DOUBLE && !defined IN_LIBINTL +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL # include -# include "isnan.h" +# include "isnand.h" #endif -#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL # include # include "isnanl-nolibm.h" # include "fpucw.h" #endif -#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL # include -# include "isnan.h" +# include "isnand.h" # include "printf-frexp.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include # include "isnanl-nolibm.h" # include "printf-frexpl.h" # include "fpucw.h" @@ -200,7 +203,7 @@ local_wcslen (const wchar_t *s) /* Here we need to call the native sprintf, not rpl_sprintf. */ #undef sprintf -#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL /* Determine the decimal-point character according to the current locale. */ # ifndef decimal_point_char_defined # define decimal_point_char_defined 1 @@ -227,18 +230,18 @@ decimal_point_char () # endif #endif -#if NEED_PRINTF_INFINITE_DOUBLE && !defined IN_LIBINTL +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL /* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ static int is_infinite_or_zero (double x) { - return isnan (x) || x + x == x; + return isnand (x) || x + x == x; } #endif -#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !defined IN_LIBINTL +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL /* Equivalent to !isfinite(x), but does not require libm. */ static int @@ -249,7 +252,7 @@ is_infinitel (long double x) #endif -#if NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL /* Converting 'long double' to decimal without rare rounding bugs requires real bignums. We use the naming conventions of GNU gmp, but vastly simpler @@ -795,6 +798,8 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes) return c_ptr; } +# if NEED_PRINTF_LONG_DOUBLE + /* Assuming x is finite and >= 0: write x as x = 2^e * m, where m is a bignum. Return the allocated memory in case of success, NULL in case of memory @@ -823,8 +828,8 @@ decode_long_double (long double x, int *ep, mpn_t *mp) 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', doesn't matter). */ -# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 -# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 { mp_limb_t hi, lo; y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2)); @@ -839,7 +844,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp) abort (); m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; } -# else +# else { mp_limb_t d; y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS); @@ -849,8 +854,8 @@ decode_long_double (long double x, int *ep, mpn_t *mp) abort (); m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d; } +# endif # endif -# endif for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) { mp_limb_t hi, lo; @@ -866,8 +871,11 @@ decode_long_double (long double x, int *ep, mpn_t *mp) abort (); m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; } +#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess + precision. */ if (!(y == 0.0L)) abort (); +#endif /* Normalise. */ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) m.nlimbs--; @@ -876,17 +884,101 @@ decode_long_double (long double x, int *ep, mpn_t *mp) return m.limbs; } -/* Assuming x is finite and >= 0, and n is an integer: +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_double (double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } + if (!(y == 0.0)) + abort (); + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - DBL_MANT_BIT; + return m.limbs; +} + +# endif + +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer: Returns the decimal representation of round (x * 10^n). Return the allocated memory - containing the decimal digits in low-to-high order, terminated with a NUL character - in case of success, NULL in case of memory allocation failure. */ static char * -scale10_round_decimal_long_double (long double x, int n) +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) { - int e; - mpn_t m; - void *memory = decode_long_double (x, &e, &m); int s; size_t extra_zeroes; unsigned int abs_n; @@ -1066,7 +1158,7 @@ scale10_round_decimal_long_double (long double x, int n) size_t count; for (count = m.nlimbs; count > 0; count--) { - accu += (mp_twolimb_t) *sourceptr++ << s; + accu += (mp_twolimb_t) *sourceptr++ << s_bits; *destptr++ = (mp_limb_t) accu; accu = accu >> GMP_LIMB_BITS; } @@ -1099,6 +1191,44 @@ scale10_round_decimal_long_double (long double x, int n) return digits; } +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_long_double (long double x, int n) +{ + int e; + mpn_t m; + void *memory = decode_long_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_double (double x, int n) +{ + int e; + mpn_t m; + void *memory = decode_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_LONG_DOUBLE + /* Assuming x is finite and > 0: Return an approximation for n with 10^n <= x < 10^(n+1). The approximation is usually the right n, but may be off by 1 sometimes. */ @@ -1186,6 +1316,99 @@ floorlog10l (long double x) return (int) l + (l < 0 ? -1 : 0); } +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10 (double x) +{ + int exp; + double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + if (y == 0.0) + return INT_MIN; + if (y < 0.5) + { + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0 / (1 << 16))) + { + y *= 1.0 * (1 << 16); + exp -= 16; + } + if (y < (1.0 / (1 << 8))) + { + y *= 1.0 * (1 << 8); + exp -= 8; + } + if (y < (1.0 / (1 << 4))) + { + y *= 1.0 * (1 << 4); + exp -= 4; + } + if (y < (1.0 / (1 << 2))) + { + y *= 1.0 * (1 << 2); + exp -= 2; + } + if (y < (1.0 / (1 << 1))) + { + y *= 1.0 * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5 && y < 1.0)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ... + Four terms are enough to get an approximation with error < 10^-7. */ + l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + #endif DCHAR_T * @@ -1196,10 +1419,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) - { - errno = EINVAL; - return NULL; - } + /* errno is already set. */ + return NULL; #define CLEANUP() \ free (d.dir); \ @@ -1819,8 +2040,19 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } #endif -#if NEED_PRINTF_DIRECTIVE_A && !defined IN_LIBINTL - else if (dp->conversion == 'a' || dp->conversion == 'A') +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'a' || dp->conversion == 'A') +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# endif + ) +# endif + ) { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; @@ -1938,6 +2170,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, p = tmp; if (type == TYPE_LONGDOUBLE) { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE long double arg = a.arg[dp->arg_index].a.a_longdouble; if (isnanl (arg)) @@ -2057,7 +2290,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } *p++ = dp->conversion - 'A' + 'P'; -# if WIDE_CHAR_VERSION +# if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', 'd', '\0' }; @@ -2065,7 +2298,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } while (*p != '\0') p++; -# else +# else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+d", exponent); @@ -2080,17 +2313,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } -# endif +# endif } END_LONG_DOUBLE_ROUNDING (); } +# else + abort (); +# endif } else { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE double arg = a.arg[dp->arg_index].a.a_double; - if (isnan (arg)) + if (isnand (arg)) { if (dp->conversion == 'A') { @@ -2204,7 +2441,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } *p++ = dp->conversion - 'A' + 'P'; -# if WIDE_CHAR_VERSION +# if WIDE_CHAR_VERSION { static const wchar_t decimal_format[] = { '%', '+', 'd', '\0' }; @@ -2212,7 +2449,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } while (*p != '\0') p++; -# else +# else if (sizeof (DCHAR_T) == 1) { sprintf ((char *) p, "%+d", exponent); @@ -2227,9 +2464,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, for (ep = expbuf; (*p = *ep) != '\0'; ep++) p++; } -# endif +# endif } } +# else + abort (); +# endif } /* The generated string now extends from tmp to p, with the zero padding insertion point being at pad_ptr. */ @@ -2292,13 +2532,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } #endif -#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL else if ((dp->conversion == 'f' || dp->conversion == 'F' || dp->conversion == 'e' || dp->conversion == 'E' || dp->conversion == 'g' || dp->conversion == 'G' || dp->conversion == 'a' || dp->conversion == 'A') && (0 -# if NEED_PRINTF_INFINITE_DOUBLE +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# elif NEED_PRINTF_INFINITE_DOUBLE || (a.arg[dp->arg_index].type == TYPE_DOUBLE /* The systems (mingw) which produce wrong output for Inf, -Inf, and NaN also do so for -0.0. @@ -2315,7 +2557,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif )) { -# if NEED_PRINTF_INFINITE_DOUBLE && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) arg_type type = a.arg[dp->arg_index].type; # endif int flags = dp->flags; @@ -2398,17 +2640,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, precision = 6; /* Allocate a temporary buffer of sufficient size. */ -# if NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0); # elif NEED_PRINTF_LONG_DOUBLE tmp_length = LDBL_DIG + 1; +# elif NEED_PRINTF_DOUBLE + tmp_length = DBL_DIG + 1; # else tmp_length = 0; # endif if (tmp_length < precision) tmp_length = precision; # if NEED_PRINTF_LONG_DOUBLE -# if NEED_PRINTF_INFINITE_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE if (type == TYPE_LONGDOUBLE) # endif if (dp->conversion == 'f' || dp->conversion == 'F') @@ -2422,6 +2668,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, tmp_length = exponent + precision; } } +# endif +# if NEED_PRINTF_DOUBLE +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE + if (type == TYPE_DOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + double arg = a.arg[dp->arg_index].a.a_double; + if (!(isnand (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10 (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } # endif /* Account for sign, decimal point etc. */ tmp_length = xsum (tmp_length, 12); @@ -2450,7 +2712,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, p = tmp; # if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE -# if NEED_PRINTF_INFINITE_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE if (type == TYPE_LONGDOUBLE) # endif { @@ -2810,16 +3072,15 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, END_LONG_DOUBLE_ROUNDING (); } } -# if NEED_PRINTF_INFINITE_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE else # endif # endif -# if NEED_PRINTF_INFINITE_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE { - /* Simpler than above: handle only NaN, Infinity, zero. */ double arg = a.arg[dp->arg_index].a.a_double; - if (isnan (arg)) + if (isnand (arg)) { if (dp->conversion >= 'A' && dp->conversion <= 'Z') { @@ -2834,7 +3095,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { int sign = 0; - if (signbit (arg)) /* arg < 0.0L or negative zero */ + if (signbit (arg)) /* arg < 0.0 or negative zero */ { sign = -1; arg = -arg; @@ -2860,25 +3121,351 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else { - if (!(arg == 0.0)) - abort (); - +# if NEED_PRINTF_DOUBLE pad_ptr = p; if (dp->conversion == 'f' || dp->conversion == 'F') { - *p++ = '0'; + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_double (arg, precision); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); - for (; precision > 0; precision--) + for (; precision > ndigits; precision--) *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } } + + free (digits); } else if (dp->conversion == 'e' || dp->conversion == 'E') { - *p++ = '0'; - if ((flags & FLAG_ALT) || precision > 0) + int exponent; + + if (arg == 0.0) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)precision - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + + /* Here ndigits = precision+1. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t count = exponent + 1; + /* Note: count <= precision = ndigits. */ + for (; count > 0; count--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t count = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; count > 0; count--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) { *p++ = decimal_point_char (); for (; precision > 0; precision--) @@ -2888,9 +3475,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, *p++ = '+'; /* Produce the same number of exponent digits as the native printf implementation. */ -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ *p++ = '0'; -# endif +# endif *p++ = '0'; *p++ = '0'; } @@ -2908,6 +3495,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } else abort (); +# endif } } } @@ -2978,11 +3566,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, { arg_type type = a.arg[dp->arg_index].type; int flags = dp->flags; -#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION int has_width; size_t width; #endif -#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; +#endif +#if NEED_PRINTF_UNBOUNDED_PRECISION + int prec_ourselves; +#else +# define prec_ourselves 0 +#endif +#if NEED_PRINTF_FLAG_LEFTADJUST +# define pad_ourselves 1 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION int pad_ourselves; #else # define pad_ourselves 0 @@ -2996,7 +3595,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, TCHAR_T *tmp; #endif -#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION has_width = 0; width = 0; if (dp->width_start != dp->width_end) @@ -3030,34 +3629,42 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #endif +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } +#endif + #if !USE_SNPRINTF /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { - size_t precision; - - precision = 6; - if (dp->precision_start != dp->precision_end) - { - if (dp->precision_arg_index != ARG_NONE) - { - int arg; - - if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) - abort (); - arg = a.arg[dp->precision_arg_index].a.a_int; - precision = (arg < 0 ? 0 : arg); - } - else - { - const FCHAR_T *digitp = dp->precision_start + 1; - - precision = 0; - while (digitp != dp->precision_end) - precision = xsum (xtimes (precision, 10), *digitp++ - '0'); - } - } - switch (dp->conversion) { @@ -3262,8 +3869,23 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #endif + /* Decide whether to handle the precision ourselves. */ +#if NEED_PRINTF_UNBOUNDED_PRECISION + switch (dp->conversion) + { + case 'd': case 'i': case 'u': + case 'o': + case 'x': case 'X': case 'p': + prec_ourselves = has_precision && (precision > 0); + break; + default: + prec_ourselves = 0; + break; + } +#endif + /* Decide whether to perform the padding ourselves. */ -#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION) switch (dp->conversion) { # if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO @@ -3280,7 +3902,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, pad_ourselves = 1; break; default: - pad_ourselves = 0; + pad_ourselves = prec_ourselves; break; } #endif @@ -3328,22 +3950,25 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } } } - if (dp->precision_start != dp->precision_end) + if (!prec_ourselves) { - size_t n = dp->precision_end - dp->precision_start; - /* The precision specification is known to consist only - of standard ASCII characters. */ - if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + if (dp->precision_start != dp->precision_end) { - memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); - fbp += n; - } - else - { - const FCHAR_T *mp = dp->precision_start; - do - *fbp++ = (unsigned char) *mp++; - while (--n > 0); + size_t n = dp->precision_end - dp->precision_start; + /* The precision specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->precision_start; + do + *fbp++ = (unsigned char) *mp++; + while (--n > 0); + } } } @@ -3385,9 +4010,36 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #endif *fbp = dp->conversion; #if USE_SNPRINTF +# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) fbp[1] = '%'; fbp[2] = 'n'; fbp[3] = '\0'; +# else + /* On glibc2 systems from glibc >= 2.3 - probably also older + ones - we know that snprintf's returns value conforms to + ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes. + Therefore we can avoid using %n in this situation. + On glibc2 systems from 2004-10-18 or newer, the use of %n + in format strings in writable memory may crash the program + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it + in this situation. */ + /* On native Win32 systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, + snprintf does not write more than the specified number + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes + '4', '5', '6' into buf, not '4', '5', '\0'.) + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf + allows us to recognize the case of an insufficient + buffer size: it returns -1 in this case. + On native Win32 systems (such as mingw) where the OS is + Windows Vista, the use of %n in format strings by default + crashes the program. See + and + + So we should avoid %n in this situation. */ + fbp[1] = '\0'; +# endif #else fbp[1] = '\0'; #endif @@ -3414,9 +4066,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, sizeof (TCHAR_T) divides sizeof (DCHAR_T) and alignof (TCHAR_T) <= alignof (DCHAR_T). */ # define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T)) + /* Ensure that maxlen below will be >= 2. Needed on BeOS, + where an snprintf() with maxlen==1 acts like sprintf(). */ + ENSURE_ALLOCATION (xsum (length, + (2 + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR)); /* Prepare checking whether snprintf returns the count via %n. */ - ENSURE_ALLOCATION (xsum (length, 1)); *(TCHAR_T *) (result + length) = '\0'; #endif @@ -3430,7 +4086,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* SNPRINTF can fail if its second argument is > INT_MAX. */ if (maxlen > INT_MAX / TCHARS_PER_DCHAR) - goto overflow; + maxlen = INT_MAX / TCHARS_PER_DCHAR; maxlen = maxlen * TCHARS_PER_DCHAR; # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ @@ -3648,20 +4304,102 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, } #if USE_SNPRINTF - /* Handle overflow of the allocated buffer. */ - if (count >= maxlen) + /* Handle overflow of the allocated buffer. + If such an overflow occurs, a C99 compliant snprintf() + returns a count >= maxlen. However, a non-compliant + snprintf() function returns only count = maxlen - 1. To + cover both cases, test whether count >= maxlen - 1. */ + if ((unsigned int) count + 1 >= maxlen) { - /* Need at least count * sizeof (TCHAR_T) bytes. But - allocate proportionally, to avoid looping eternally - if snprintf() reports a too small count. */ - size_t n = - xmax (xsum (length, - (count + TCHARS_PER_DCHAR - 1) - / TCHARS_PER_DCHAR), - xtimes (allocated, 2)); + /* If maxlen already has attained its allowed maximum, + allocating more memory will not increase maxlen. + Instead of looping, bail out. */ + if (maxlen == INT_MAX / TCHARS_PER_DCHAR) + goto overflow; + else + { + /* Need at least (count + 1) * sizeof (TCHAR_T) + bytes. (The +1 is for the trailing NUL.) + But ask for (count + 2) * sizeof (TCHAR_T) + bytes, so that in the next round, we likely get + maxlen > (unsigned int) count + 1 + and so we don't get here again. + And allocate proportionally, to avoid looping + eternally if snprintf() reports a too small + count. */ + size_t n = + xmax (xsum (length, + ((unsigned int) count + 2 + + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR), + xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + continue; + } + } +#endif - ENSURE_ALLOCATION (n); - continue; +#if NEED_PRINTF_UNBOUNDED_PRECISION + if (prec_ourselves) + { + /* Handle the precision. */ + TCHAR_T *prec_ptr = +# if USE_SNPRINTF + (TCHAR_T *) (result + length); +# else + tmp; +# endif + size_t prefix_count; + size_t move; + + prefix_count = 0; + /* Put the additional zeroes after the sign. */ + if (count >= 1 + && (*prec_ptr == '-' || *prec_ptr == '+' + || *prec_ptr == ' ')) + prefix_count = 1; + /* Put the additional zeroes after the 0x prefix if + (flags & FLAG_ALT) || (dp->conversion == 'p'). */ + else if (count >= 2 + && prec_ptr[0] == '0' + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X')) + prefix_count = 2; + + move = count - prefix_count; + if (precision > move) + { + /* Insert zeroes. */ + size_t insert = precision - move; + TCHAR_T *prec_end; + +# if USE_SNPRINTF + size_t n = + xsum (length, + (count + insert + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + ENSURE_ALLOCATION (n); + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + prec_ptr = (TCHAR_T *) (result + length); +# endif + + prec_end = prec_ptr + count; + prec_ptr += prefix_count; + + while (prec_end > prec_ptr) + { + prec_end--; + prec_end[insert] = prec_end[0]; + } + + prec_end += insert; + do + *--prec_end = '0'; + while (prec_end > prec_ptr); + + count += insert; + } } #endif @@ -3773,7 +4511,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Here count <= allocated - length. */ /* Perform padding. */ -#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION if (pad_ourselves && has_width) { size_t w; @@ -3814,15 +4552,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # endif DCHAR_T *p = rp + count; DCHAR_T *end = p + pad; -# if NEED_PRINTF_FLAG_ZERO DCHAR_T *pad_ptr; -# if !DCHAR_IS_TCHAR +# if !DCHAR_IS_TCHAR if (dp->conversion == 'c' || dp->conversion == 's') /* No zero-padding for string directives. */ pad_ptr = NULL; else -# endif +# endif { pad_ptr = (*rp == '-' ? rp + 1 : rp); /* No zero-padding of "inf" and "nan". */ @@ -3830,7 +4567,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, || (*pad_ptr >= 'a' && *pad_ptr <= 'z')) pad_ptr = NULL; } -# endif /* The generated string now extends from rp to p, with the zero padding insertion point being at pad_ptr. */ @@ -3843,7 +4579,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, for (; pad > 0; pad--) *p++ = ' '; } -# if NEED_PRINTF_FLAG_ZERO else if ((flags & FLAG_ZERO) && pad_ptr != NULL) { /* Pad with zeroes. */ @@ -3854,7 +4589,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, for (; pad > 0; pad--) *p++ = '0'; } -# endif else { /* Pad with spaces on the left. */ @@ -3933,6 +4667,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, not have this limitation. */ return result; +#if USE_SNPRINTF overflow: if (!(result == resultbuf || result == NULL)) free (result); @@ -3941,6 +4676,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, CLEANUP (); errno = EOVERFLOW; return NULL; +#endif out_of_memory: if (!(result == resultbuf || result == NULL)) @@ -3957,9 +4693,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #undef TCHARS_PER_DCHAR #undef SNPRINTF #undef USE_SNPRINTF +#undef DCHAR_CPY #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE +#undef DCHAR_IS_TCHAR #undef TCHAR_T #undef DCHAR_T #undef FCHAR_T diff --git a/gnulib/vasnprintf.h b/gnulib/vasnprintf.h index 7a0c01f..b9a3d6e 100644 --- a/gnulib/vasnprintf.h +++ b/gnulib/vasnprintf.h @@ -1,9 +1,9 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -26,7 +26,7 @@ #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes diff --git a/gnulib/wchar.in.h b/gnulib/wchar.in.h new file mode 100644 index 0000000..b721572 --- /dev/null +++ b/gnulib/wchar.in.h @@ -0,0 +1,82 @@ +/* A substitute for ISO C99 , for platforms that have issues. + + Copyright (C) 2007 Free Software Foundation, Inc. + + This program 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 3, or (at your option) + any later version. + + This program 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 program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Eric Blake. */ + +/* + * ISO C 99 for platforms that have issues. + * + * + * For now, this just ensures proper prerequisite inclusion order and + * the declaration of wcwidth(). + */ + +#ifndef _GL_WCHAR_H + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include + +/* Include the original if it exists. + Some builds of uClibc lack it. */ +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_WCHAR_H@ +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ +#endif + +#ifndef _GL_WCHAR_H +#define _GL_WCHAR_H + +/* The definition of GL_LINK_WARNING is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Return the number of screen columns needed for WC. */ +#if @GNULIB_WCWIDTH@ +# if @REPLACE_WCWIDTH@ +# undef wcwidth +# define wcwidth rpl_wcwidth +extern int wcwidth (wchar_t); +# else +# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ +/* wcwidth exists but is not declared. */ +extern int wcwidth (int /* actually wchar_t */); +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef wcwidth +# define wcwidth(w) \ + (GL_LINK_WARNING ("wcwidth is unportable - " \ + "use gnulib module wcwidth for portability"), \ + wcwidth (w)) +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_WCHAR_H */ +#endif /* _GL_WCHAR_H */ diff --git a/gnulib/wchar_.h b/gnulib/wchar_.h deleted file mode 100644 index 924a338..0000000 --- a/gnulib/wchar_.h +++ /dev/null @@ -1,82 +0,0 @@ -/* A substitute for ISO C99 , for platforms that have issues. - - Copyright (C) 2007 Free Software Foundation, Inc. - - This program 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, or (at your option) - any later version. - - This program 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 program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* Written by Eric Blake. */ - -/* - * ISO C 99 for platforms that have issues. - * - * - * For now, this just ensures proper prerequisite inclusion order and - * the declaration of wcwidth(). - */ - -#ifndef _GL_WCHAR_H - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include - -/* Include the original if it exists. - Some builds of uClibc lack it. */ -/* The include_next requires a split double-inclusion guard. */ -#if @HAVE_WCHAR_H@ -# @INCLUDE_NEXT@ @NEXT_WCHAR_H@ -#endif - -#ifndef _GL_WCHAR_H -#define _GL_WCHAR_H - -/* The definition of GL_LINK_WARNING is copied here. */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Return the number of screen columns needed for WC. */ -#if @GNULIB_WCWIDTH@ -# if @REPLACE_WCWIDTH@ -# undef wcwidth -# define wcwidth rpl_wcwidth -extern int wcwidth (wchar_t); -# else -# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@ -/* wcwidth exists but is not declared. */ -extern int wcwidth (int /* actually wchar_t */); -# endif -# endif -#elif defined GNULIB_POSIXCHECK -# undef wcwidth -# define wcwidth(w) \ - (GL_LINK_WARNING ("wcwidth is unportable - " \ - "use gnulib module wcwidth for portability"), \ - wcwidth (w)) -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _GL_WCHAR_H */ -#endif /* _GL_WCHAR_H */ diff --git a/gnulib/xsize.h b/gnulib/xsize.h index 341fb16..284cf7f 100644 --- a/gnulib/xsize.h +++ b/gnulib/xsize.h @@ -1,10 +1,10 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2008 Free Software Foundation, Inc. This program 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, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -94,7 +94,7 @@ xmax (size_t size1, size_t size2) /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even - when N is of a wider tupe and N > SIZE_MAX. */ + when N is of a wider type and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) diff --git a/installcheck/Amanda_Archive.pl b/installcheck/Amanda_Archive.pl new file mode 100644 index 0000000..560f548 --- /dev/null +++ b/installcheck/Amanda_Archive.pl @@ -0,0 +1,246 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 20; +use strict; +use warnings; + +# This test only puts the perl wrappers through their paces -- the underlying +# library is well-covered by amar-test. + +use lib "@amperldir@"; +use Amanda::Archive; +use Amanda::Paths; +use Data::Dumper; + +my $arch_filename = "$AMANDA_TMPDIR/amanda_archive.bin"; +my $data_filename = "$AMANDA_TMPDIR/some_data.bin"; +my ($fh, $dfh, $ar, $f1, $f2, $a1, $a2, @res, $posn); + +# some versions of Test::More will fail tests if the identity +# relationships of the two objects passed to is_deeply do not +# match, so we use the same object for $user_data throughout. +my $user_data = [ "x", "y", "z" ]; + +# set up a large file full of data + +open($dfh, ">", $data_filename); +my $onek = "abcd" x 256; +my $onemeg = $onek x 1024; +for (my $i = 0; $i < 5; $i++) { + print $dfh $onemeg; +} +$onek = $onemeg = undef; +close($dfh); + +# utility functions for creating a "fake" archive file + +sub make_header { + my ($fh, $version) = @_; + my $hdr = "AMANDA ARCHIVE FORMAT $version"; + $hdr .= "\0" x (28 - length $hdr); + print $fh $hdr; +} + +sub make_record { + my ($fh, $filenum, $attrid, $data, $eoa) = @_; + my $size = length($data); + if ($eoa) { + $size |= 0x80000000; + } + print $fh pack("nnN", $filenum, $attrid, $size); + print $fh $data; +} + +#### +## TEST WRITING + +open($fh, ">", $arch_filename) or die("opening $arch_filename: $!"); +$ar = Amanda::Archive->new(fileno($fh), ">"); +pass("Create a new archive"); + +$f1 = $ar->new_file("filename1"); +pass("Start an archive file"); + +$a1 = $f1->new_attr(18); +$a1->add_data("foo!", 0); +$a2 = $f1->new_attr(19); +$a2->add_data("BAR!", 0); +$a1->add_data("FOO.", 1); +$a2->add_data("bar.", 0); +pass("Write some interleaved data"); + +$a1->close(); +pass("Close an attribute with the close() method"); + +$a1 = Amanda::Archive::Attr->new($f1, 99); +pass("Create an attribute with its constructor"); + +open($dfh, "<", $data_filename); +$a1->add_data_fd(fileno($dfh), 1); +close($dfh); +pass("Add data from a file descriptor"); + +$a1 = undef; +pass("Close attribute when its refcount hits zero"); + +$f2 = Amanda::Archive::File->new($ar, "filename2"); +pass("Add a new file (filename2)"); + +$a1 = $f2->new_attr(82); +$a1->add_data("word", 1); +pass("Add data to it"); + +$a2->add_data("barrrrr?", 0); # note no EOA +pass("Add more data to first attribute"); + +($f1, $posn) = $ar->new_file("posititioned file", 1); +ok($posn > 0, "new_file returns a positive position"); + +$ar = undef; +pass("unref archive early"); + +($ar, $f1, $f2, $a1, $a2) = (); +pass("Close remaining objects"); + +close($fh); + +#### +## TEST READING + +open($fh, ">", $arch_filename); +make_header($fh, 1); +make_record($fh, 16, 0, "/etc/passwd", 1); +make_record($fh, 16, 20, "root:foo", 1); +make_record($fh, 16, 21, "boot:foot", 0); +make_record($fh, 16, 22, "dustin:snazzy", 1); +make_record($fh, 16, 21, "..more-boot:foot", 1); +make_record($fh, 16, 1, "", 1); +close($fh); + +open($fh, "<", $arch_filename); +$ar = Amanda::Archive->new(fileno($fh), "<"); +pass("Create a new archive for reading"); + +@res = (); +$ar->read( + file_start => sub { + push @res, [ "file_start", @_ ]; + return "cows"; + }, + file_finish => sub { + push @res, [ "file_finish", @_ ]; + }, + 0 => sub { + push @res, [ "frag", @_ ]; + return "ants"; + }, + user_data => $user_data, +); +is_deeply([@res], [ + [ 'file_start', $user_data, 16, '/etc/passwd' ], + [ 'frag', $user_data, 16, "cows", 20, undef, 'root:foo', 1, 0 ], + [ 'frag', $user_data, 16, "cows", 21, undef, 'boot:foot', 0, 0 ], + [ 'frag', $user_data, 16, "cows", 22, undef, 'dustin:snazzy', 1, 0 ], + [ 'frag', $user_data, 16, "cows", 21, "ants", '..more-boot:foot', 1, 0 ], + [ 'file_finish', $user_data, "cows", 16, 0 ] +], "simple read callbacks called in the right order") + or diag(Dumper(\@res)); +$ar->close(); +close($fh); + + +open($fh, "<", $arch_filename); +$ar = Amanda::Archive->new(fileno($fh), "<"); +pass("Create a new archive for reading"); + +@res = (); +$ar->read( + file_start => sub { + push @res, [ "file_start", @_ ]; + return "IGNORE"; + }, + file_finish => sub { + push @res, [ "file_finish", @_ ]; + }, + 0 => sub { + push @res, [ "frag", @_ ]; + return "ants"; + }, + user_data => $user_data, +); +is_deeply([@res], [ + [ 'file_start', $user_data, 16, '/etc/passwd' ], +], "'IGNORE' handled correctly") + or diag(Dumper(\@res)); +# TODO: check that file data gets dumped appropriately? + + +open($fh, "<", $arch_filename); +$ar = Amanda::Archive->new(fileno($fh), "<"); + +@res = (); +$ar->read( + file_start => sub { + push @res, [ "file_start", @_ ]; + return "dogs"; + }, + file_finish => sub { + push @res, [ "file_finish", @_ ]; + }, + 21 => [ 100, sub { + push @res, [ "fragbuf", @_ ]; + return "pants"; + } ], + 0 => sub { + push @res, [ "frag", @_ ]; + return "ants"; + }, + user_data => $user_data, +); +is_deeply([@res], [ + [ 'file_start', $user_data, 16, '/etc/passwd' ], + [ 'frag', $user_data, 16, "dogs", 20, undef, 'root:foo', 1, 0 ], + [ 'frag', $user_data, 16, "dogs", 22, undef, 'dustin:snazzy', 1, 0 ], + [ 'fragbuf', $user_data, 16, "dogs", 21, undef, 'boot:foot..more-boot:foot', 1, 0 ], + [ 'file_finish', $user_data, "dogs", 16, 0 ] +], "buffering parameters parsed correctly") + or diag(Dumper(\@res)); + + +open($fh, "<", $arch_filename); +$ar = Amanda::Archive->new(fileno($fh), "<"); + +@res = (); +eval { + $ar->read( + file_start => sub { + push @res, [ "file_start", @_ ]; + die "uh oh"; + }, + user_data => $user_data, + ); +}; +like($@, qr/uh oh at .*/, "exception propagated correctly"); +is_deeply([@res], [ + [ 'file_start', $user_data, 16, '/etc/passwd' ], +], "file_start called before exception was rasied") + or diag(Dumper(\@res)); +$ar->close(); + +unlink($data_filename); diff --git a/installcheck/Amanda_Changer.pl b/installcheck/Amanda_Changer.pl index d525fd6..d2ce81b 100644 --- a/installcheck/Amanda_Changer.pl +++ b/installcheck/Amanda_Changer.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,215 +13,473 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw(no_plan); -use Amconfig; +use Test::More tests => 35; use File::Path; use strict; use lib "@amperldir@"; +use Installcheck::Config; use Amanda::Paths; use Amanda::Device; use Amanda::Debug; +use Amanda::MainLoop; use Amanda::Config qw( :init :getconf config_dir_relative ); use Amanda::Changer; # set up debugging so debug output doesn't interfere with test results Amanda::Debug::dbopen("installcheck"); -my $changer_filename = "$AMANDA_TMPDIR/chg-test"; +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); -sub setup_changer { - my ($changer_script) = @_; +# -------- +# define a "test" changer for purposes of this installcheck - open my $chg_test, ">", $changer_filename or die("Could not create test changer"); - - $changer_script =~ s/\$AMANDA_TMPDIR/$AMANDA_TMPDIR/g; +package Amanda::Changer::test; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer ); - print $chg_test "#! /bin/sh\n"; - print $chg_test $changer_script; +# monkey-patch our test changer into Amanda::Changer, and indicate that +# the module has already been required by adding a key to %INC +$INC{'Amanda/Changer/test.pm'} = "Amanda_Changer"; - close $chg_test; - chmod 0755, $changer_filename; +sub new { + my $class = shift; + my ($cc, $tpchanger) = @_; + + my $self = { + curslot => 0, + slots => [ 'TAPE-00', 'TAPE-01', 'TAPE-02', 'TAPE-03' ], + reserved_slots => [], + clean => 0, + }; + bless ($self, $class); + return $self; +} + +sub load { + my $self = shift; + my %params = @_; + + my $cb = $params{'res_cb'}; + + if (exists $params{'label'}) { + # search by label + my $slot = -1; + my $label = $params{'label'}; + + for my $i (0 .. $#{$self->{'slots'}}) { + if ($self->{'slots'}->[$i] eq $label) { + $slot = $i; + last; + } + } + if ($slot == -1) { + $cb->("No such label '$label'", undef); + return; + } + + # check that it's not in use + for my $used_slot (@{$self->{'reserved_slots'}}) { + if ($used_slot == $slot) { + $cb->("Volume with label '$label' is already in use", undef); + return; + } + } + + # ok, let's use it. + push @{$self->{'reserved_slots'}}, $slot; + + if (exists $params{'set_current'} && $params{'set_current'}) { + $self->{'curslot'} = $slot; + } + + $cb->(undef, Amanda::Changer::test::Reservation->new($self, $slot, $label)); + } elsif (exists $params{'slot'}) { + my $slot = $params{'slot'}; + $slot = $self->{'curslot'} + if ($slot eq "current"); + + if (grep { $_ == $slot } @{$self->{'reserved_slots'}}) { + $cb->("Slot $slot is already in use", undef); + return; + } + my $label = $self->{'slots'}->[$slot]; + push @{$self->{'reserved_slots'}}, $slot; + + if (exists $params{'set_current'} && $params{'set_current'}) { + $self->{'curslot'} = $slot; + } + + $cb->(undef, Amanda::Changer::test::Reservation->new($self, $slot, $label)); + } else { + die "No label or slot parameter given"; + } +} + +sub reset { + my $self = shift; + my %params = @_; + + $self->{'curslot'} = 0; + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } +} + +sub clean { + my $self = shift; + my %params = @_; + + $self->{'clean'} = 1; + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } +} + + +package Amanda::Changer::test::Reservation; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer::Reservation ); + +sub new { + my $class = shift; + my ($chg, $slot, $label) = @_; + my $self = Amanda::Changer::Reservation::new($class); + + $self->{'chg'} = $chg; + $self->{'slot'} = $slot; + $self->{'label'} = $label; + + $self->{'device_name'} = "test:slot-$slot"; + $self->{'this_slot'} = $slot; + $self->{'next_slot'} = ($slot + 1) % (scalar @{$chg->{'slots'}}); + + return $self; +} + +sub release { + my $self = shift; + my %params = @_; + my $slot = $self->{'slot'}; + my $chg = $self->{'chg'}; + + $chg->{'reserved_slots'} = [ grep { $_ != $slot } @{$chg->{'reserved_slots'}} ]; + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } +} + +sub set_label { + my $self = shift; + my %params = @_; + my $slot = $self->{'slot'}; + my $chg = $self->{'chg'}; + + $self->{'chg'}->{'slots'}->[$self->{'slot'}] = $params{'label'}; + $self->{'label'} = $params{'label'}; + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } } -# set up and load a simple config with a tpchanger -my $testconf = Amconfig->new(); -$testconf->add_param('tpchanger', "\"$changer_filename\""); +# -------- +# back to the perl tests.. + +package main; + +# work against a config specifying our test changer, to work out the kinks +# when it opens devices to check their labels +my $testconf; +$testconf = Installcheck::Config->new(); +$testconf->add_changer("mychanger", [ + 'tpchanger' => '"chg-test:/foo"', +]); $testconf->write(); -config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF') or die("Could not load test config"); - -# some variables we'll need -my ($error, $slot, $device); - -# OK, let's get started with some simple stuff -setup_changer <<'EOC'; -case "${1}" in - -slot) - case "${2}" in - 1) echo "1 fake:1"; exit 0;; - 2) echo " slot 2 is empty"; exit 1;; - 3) echo " oh noes!"; exit 2;; - 4) echo "1"; exit 0;; # test missing 'device' portion - esac;; - -reset) echo "reset ignored";; - -eject) echo "eject ignored";; - -clean) echo "clean ignored";; - -label) - case "${2}" in - foo?bar) echo "1 ok"; exit 0;; - *) echo " bad label"; exit 1;; - esac;; - -info) echo "7 10 1 1"; exit 0;; - -search) - case "${2}" in - TAPE?01) echo "5 fakedev"; exit 0;; - *) echo " not found"; exit 2;; - esac;; -esac -EOC - -is_deeply([ Amanda::Changer::loadslot(1) ], [0, "1", "fake:1"], - "A successful loadslot() returns the right stuff"); - -($error, $slot, $device) = Amanda::Changer::loadslot(2); -is($error, "slot 2 is empty", "A loadslot() with a benign error returns the right stuff"); - -eval { Amanda::Changer::loadslot(3); }; -like($@, qr/.*oh noes!.*/, "A loadslot() with a serious error croaks"); - -is_deeply([ Amanda::Changer::loadslot(4) ], [0, "1", undef], - "a response without a device string returns undef"); - -is_deeply([ Amanda::Changer::reset() ], [ 0, "reset" ], - "reset() calls tapechanger -reset"); -is_deeply([ Amanda::Changer::eject() ], [ 0, "eject" ], - "eject() calls tapechanger -eject"); -is_deeply([ Amanda::Changer::clean() ], [ 0, "clean" ], - "clean() calls tapechanger -clean"); - -is_deeply([ Amanda::Changer::label("foo bar") ], [ 0 ], - "label('foo bar') calls tapechanger -label 'foo bar' (note spaces)"); - -is_deeply([ Amanda::Changer::query() ], [ 0, 7, 10, 1, 1 ], - "query() returns the correct values for a 4-value changer script"); - -is_deeply([ Amanda::Changer::find("TAPE 01") ], [ 0, "5", "fakedev" ], - "find on a searchable changer invokes -search"); - -eval { Amanda::Changer::find("TAPE 02") }; -ok($@, "A searchable changer croaks when the label can't be found"); - -# Now a simple changer that returns three values for -info -setup_changer <<'EOC'; -case "${1}" in - -info) echo "11 13 0"; exit 0;; -esac -EOC - -is_deeply([ Amanda::Changer::query() ], [ 0, 11, 13, 0, 0 ], - "query() returns the correct values for a 4-value changer script"); - -# set up 5 vtapes -for (my $i = 0; $i < 5; $i++) { - my $vtapedir = "$AMANDA_TMPDIR/chg-test-tapes/$i/data"; - if (-e $vtapedir) { - rmtree($vtapedir) - or die("Could not remove '$vtapedir'"); + +my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); +} + +# test loading by label + +my $chg = Amanda::Changer->new("mychanger"); +{ + my @labels = ( 'TAPE-02', 'TAPE-00', 'TAPE-03' ); + my @reservations = (); + my $getres; + + $getres = sub { + my $label = pop @labels; + + $chg->load(label => $label, + set_current => ($label eq "TAPE-02"), + res_cb => sub { + my ($err, $reservation) = @_; + ok(!$err, "no error loading $label") + or diag($err); + + # keep this reservation + if ($reservation) { + push @reservations, $reservation; + } + + # and start on the next + if (@labels) { + $getres->(); + return; + } else { + # try to load an already-reserved volume + $chg->load(label => 'TAPE-00', + res_cb => sub { + my ($err, $reservation) = @_; + ok($err, "error when requesting already-reserved volume"); + Amanda::MainLoop::quit(); + }); + } + }); + }; + + # start the loop + Amanda::MainLoop::call_later($getres); + Amanda::MainLoop::run(); + + # ditch the reservations and do it all again + @reservations = (); + @labels = ( 'TAPE-00', 'TAPE-01' ); + is_deeply($chg->{'reserved_slots'}, [], + "reservations are released when the Reservation object goes out of scope"); + Amanda::MainLoop::call_later($getres); + Amanda::MainLoop::run(); + + # explicitly release the reservations (without using the callback) + for my $res (@reservations) { + $res->release(); } - mkpath($vtapedir) - or die("Could not create '$vtapedir'"); } -# label three of them (slot 2 is empty; slot 4 is unlabeled) -for (my $i = 0; $i < 5; $i++) { - next if $i == 2 || $i == 4; - my $dev = Amanda::Device->new("file:$AMANDA_TMPDIR/chg-test-tapes/$i") - or die("Could not open device"); - $dev->start($Amanda::Device::ACCESS_WRITE, "TAPE$i", "19780615010203") - or die("Could not write label"); - $dev->finish(); +# test loading by slot +{ + my ($start, $first_cb, $second_cb); + + # reserves the current slot + $start = sub { + $chg->load(res_cb => $first_cb, slot => "current"); + }; + + # gets a reservation for the "current" slot + $first_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is($res->{'this_slot'}, 2, + "'current' slot loads slot 2"); + is($res->{'device_name'}, "test:slot-2", + "..device is correct"); + is($res->{'next_slot'}, 3, + "..and the next slot is slot 3"); + $chg->load(res_cb => $second_cb, slot => $res->{'next_slot'}, set_current => 1); + }; + + # gets a reservation for the "next" slot + $second_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is($res->{'this_slot'}, 3, + "next slot loads slot 3"); + is($chg->{'curslot'}, 3, + "..which is also now the current slot"); + is($res->{'next_slot'}, 0, + "..and the next slot is slot 0"); + + Amanda::MainLoop::quit(); + }; + + Amanda::MainLoop::call_later($start); + Amanda::MainLoop::run(); +} + +# test set_label +{ + my ($start, $load1_cb, $set_cb, $load2_cb, $load3_cb); + + # load TAPE-00 + $start = sub { + $chg->load(res_cb => $load1_cb, label => "TAPE-00"); + }; + + # rename it to TAPE-99 + $load1_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + pass("loaded TAPE-00"); + $res->set_label(label => "TAPE-99", finished_cb => $set_cb); + $res->release(); + }; + + # try to load TAPE-00 + $set_cb = sub { + my ($err) = @_; + die $err if $err; + + pass("relabeled TAPE-00 to TAPE-99"); + $chg->load(res_cb => $load2_cb, label => "TAPE-00"); + }; + + # try to load TAPE-99 + $load2_cb = sub { + my ($err, $res) = @_; + + ok($err, "loading TAPE-00 is now an error"); + $chg->load(res_cb => $load3_cb, label => "TAPE-99"); + }; + + # check result + $load3_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + pass("but loading TAPE-99 is ok"); + + Amanda::MainLoop::quit(); + }; + + Amanda::MainLoop::call_later($start); + Amanda::MainLoop::run(); +} + +# test reset and clean +{ + my ($do_reset, $do_clean); + + $do_reset = sub { + $chg->reset(finished_cb => sub { + is($chg->{'curslot'}, 0, + "reset() resets to slot 0"); + $do_clean->(); + }); + }; + + $do_clean = sub { + $chg->clean(finished_cb => sub { + ok($chg->{'clean'}, "clean 'cleaned' the changer"); + Amanda::MainLoop::quit(); + }); + }; + + Amanda::MainLoop::call_later($do_reset); + Amanda::MainLoop::run(); +} + +# Test the various permutations of configuration setup, with a patched +# _new_from_uri so we can monitor the result +sub my_new_from_uri { + my ($uri, $cc, $name) = @_; + return [ $uri, $cc? "cc" : undef ]; +} +*saved_new_from_uri = *Amanda::Changer::_new_from_uri; +*Amanda::Changer::_new_from_uri = *my_new_from_uri; + +sub loadconfig { + my ($global_tapedev, $global_tpchanger, $defn_tpchanger) = @_; + + $testconf = Installcheck::Config->new(); + + if (defined($global_tapedev)) { + $testconf->add_param('tapedev', "\"$global_tapedev\"") + } + + if (defined($global_tpchanger)) { + $testconf->add_param('tpchanger', "\"$global_tpchanger\"") + } + + if (defined($defn_tpchanger)) { + $testconf->add_changer("mychanger", [ + 'tpchanger' => "\"$defn_tpchanger\"", + ]); + } + + $testconf->write(); + + my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); + if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); + } } -# And finally a "stateful" changer that can support "scan" and "find" -setup_changer <<'EOC'; -STATEFILE="$AMANDA_TMPDIR/chg-test-state" -SLOT=0 -[ -f "$STATEFILE" ] && . "$STATEFILE" - -case "${1}" in - -slot) - case "${2}" in - current) ;; - 0|1|2|3|4|5) SLOT="${2}";; - next|advance) SLOT=`expr $SLOT + 1`;; - prev) SLOT=`expr $SLOT - 1`;; - first) SLOT=0;; - last) SLOT=4;; - esac - - # normalize 0 <= $SLOT < 5 - while [ "$SLOT" -ge 5 ]; do SLOT=`expr $SLOT - 5`; done - while [ "$SLOT" -lt 0 ]; do SLOT=`expr $SLOT + 5`; done - - # signal an empty slot for slot 2 - if [ "$SLOT" = 2 ]; then - echo "$SLOT slot $SLOT is empty" - EXIT=1 - else - echo "$SLOT" "file:$AMANDA_TMPDIR/chg-test-tapes/$SLOT" - fi - ;; - -info) echo "$SLOT 5 1 0";; -esac - -echo SLOT=$SLOT > $STATEFILE -exit $EXIT -EOC - -($error, $slot, $device) = Amanda::Changer::loadslot(0); -if ($error) { die("Error loading slot 0: $error"); } -is_deeply([ Amanda::Changer::find("TAPE3") ], [0, "3", "file:$AMANDA_TMPDIR/chg-test-tapes/3"], - "Finds a tape after skipping an empty slot"); - -($error, $slot, $device) = Amanda::Changer::loadslot(3); -if ($error) { die("Error loading slot 3: $error"); } -is_deeply([ Amanda::Changer::find("TAPE1") ], [0, "1", "file:$AMANDA_TMPDIR/chg-test-tapes/1"], - "Finds a tape after skipping an unlabeled but filled slot"); - -my @scanresults; -sub cb { - fail("called too many times") if (!@scanresults); - my $expected = shift @scanresults; - my $descr = pop @$expected; - my $done = pop @$expected; - is_deeply([ @_ ], $expected, $descr); - return 1; +sub assert_invalid { + my ($global_tapedev, $global_tpchanger, $defn_tpchanger, $name, $msg) = @_; + loadconfig($global_tapedev, $global_tpchanger, $defn_tpchanger); + eval { Amanda::Changer->new($name); }; + ok($@, $msg); } -# scan the whole changer -($error, $slot, $device) = Amanda::Changer::loadslot(0); -if ($error) { die("Error loading slot 0: $error"); } -@scanresults = ( - [ "0", "file:$AMANDA_TMPDIR/chg-test-tapes/0", 0, 0, "scan starts with slot 0" ], - [ "1", "file:$AMANDA_TMPDIR/chg-test-tapes/1", 0, 0, "next in slot 1" ], - [ undef, undef, "slot 2 is empty", 0, "slot 2 is empty" ], - [ "3", "file:$AMANDA_TMPDIR/chg-test-tapes/3", 0, 0, "next in slot 3" ], - [ "4", "file:$AMANDA_TMPDIR/chg-test-tapes/4", 0, 0, "next in slot 4" ], -); -Amanda::Changer::scan(\&cb); - -# make sure it stops when "done" -($error, $slot, $device) = Amanda::Changer::loadslot(0); -if ($error) { die("Error loading slot 0: $error"); } -@scanresults = ( - [ "0", "file:$AMANDA_TMPDIR/chg-test-tapes/0", 0, 1, "scan starts with slot 0" ], -); -Amanda::Changer::scan(\&cb); - -# cleanup -unlink("$AMANDA_TMPDIR/chg-test"); -unlink("$AMANDA_TMPDIR/chg-test-state"); -rmtree("$AMANDA_TMPDIR/chg-test-tapes"); +assert_invalid(undef, undef, undef, undef, + "supplying a nothing is invalid"); + +loadconfig(undef, "file:/foo", undef); +is_deeply( Amanda::Changer->new(), [ "chg-single:file:/foo", undef ], + "default changer with global tpchanger naming a device"); + +loadconfig(undef, "chg-disk:/foo", undef); +is_deeply( Amanda::Changer->new(), [ "chg-disk:/foo", undef ], + "default changer with global tpchanger naming a changer"); + +loadconfig(undef, "mychanger", "chg-disk:/bar"); +is_deeply( Amanda::Changer->new(), [ "chg-disk:/bar", "cc" ], + "default changer with global tpchanger naming a defined changer with a uri"); + +loadconfig(undef, "mychanger", "chg-zd-mtx"); +is_deeply( Amanda::Changer->new(), [ "chg-compat:chg-zd-mtx", "cc" ], + "default changer with global tpchanger naming a defined changer with a compat script"); + +loadconfig(undef, "chg-zd-mtx", undef); +is_deeply( Amanda::Changer->new(), [ "chg-compat:chg-zd-mtx", undef ], + "default changer with global tpchanger naming a compat script"); + +loadconfig("tape:/dev/foo", undef, undef); +is_deeply( Amanda::Changer->new(), [ "chg-single:tape:/dev/foo", undef ], + "default changer with global tapedev naming a device and no tpchanger"); + +assert_invalid("tape:/dev/foo", "tape:/dev/foo", undef, undef, + "supplying a device for both tpchanger and tapedev is invalid"); + +assert_invalid("tape:/dev/foo", "chg-disk:/foo", undef, undef, + "supplying a device for tapedev and a changer for tpchanger is invalid"); + +loadconfig("tape:/dev/foo", 'chg-zd-mtx', undef); +is_deeply( Amanda::Changer->new(), [ "chg-compat:chg-zd-mtx", undef ], + "default changer with global tapedev naming a device and a global tpchanger naming a compat script"); + +assert_invalid("chg-disk:/foo", "tape:/dev/foo", undef, undef, + "supplying a changer for tapedev and a device for tpchanger is invalid"); + +loadconfig("chg-disk:/foo", undef, undef); +is_deeply( Amanda::Changer->new(), [ "chg-disk:/foo", undef ], + "default changer with global tapedev naming a device"); + +loadconfig("mychanger", undef, "chg-disk:/bar"); +is_deeply( Amanda::Changer->new(), [ "chg-disk:/bar", "cc" ], + "default changer with global tapedev naming a defined changer with a uri"); + +loadconfig("mychanger", undef, "chg-zd-mtx"); +is_deeply( Amanda::Changer->new(), [ "chg-compat:chg-zd-mtx", "cc" ], + "default changer with global tapedev naming a defined changer with a compat script"); + +loadconfig(undef, undef, "chg-disk:/foo"); +is_deeply( Amanda::Changer->new("mychanger"), [ "chg-disk:/foo", "cc" ], + "named changer loads the proper definition"); + +*Amanda::Changer::_new_from_uri = *saved_new_from_uri; diff --git a/installcheck/Amanda_Changer_compat.pl b/installcheck/Amanda_Changer_compat.pl new file mode 100644 index 0000000..2480204 --- /dev/null +++ b/installcheck/Amanda_Changer_compat.pl @@ -0,0 +1,319 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 17; +use File::Path; +use strict; +use warnings; + +use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run; +use Amanda::Paths; +use Amanda::Device; +use Amanda::Debug; +use Amanda::MainLoop; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Changer; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +my $changer_filename = "$AMANDA_TMPDIR/chg-test"; + +# Set up a 'test' changer; several of these are defined below. +sub setup_changer { + my ($changer_script) = @_; + + open my $chg_test, ">", $changer_filename or die("Could not create test changer"); + + $changer_script =~ s/\$AMANDA_TMPDIR/$AMANDA_TMPDIR/g; + + print $chg_test "#! /bin/sh\n"; + print $chg_test $changer_script; + + close $chg_test; + chmod 0755, $changer_filename; +} + +# Functions to invoke the changer and later verify the result +{ + my $expected_err_re; + my $expected_dev; + my $msg; + + sub check_res_cb { + my ($err, $res) = @_; + Amanda::MainLoop::quit(); + + if ($err) { + if (defined($expected_err_re)) { + like($err, $expected_err_re, $msg); + } else { + fail($msg); + debug("Unexpected error: $err"); + } + } else { + if (defined($expected_dev)) { + is($res->{'device_name'}, $expected_dev, $msg); + } else { + fail($msg); + diag("Unexpected reservation"); + } + } + } + + sub check_finished_cb { + my ($err) = @_; + Amanda::MainLoop::quit(); + + if ($err) { + if (defined($expected_err_re)) { + like($err, $expected_err_re, $msg); + } else { + fail($msg); + diag("Unexpected error: $err"); + } + } else { + if (!defined($expected_err_re)) { + pass($msg); + } else { + fail($msg); + diag("Unexpected success"); + } + } + } + + sub try_run_changer { + my $sub; + ($sub, $expected_err_re, $expected_dev, $msg) = @_; + + Amanda::MainLoop::call_later($sub); + Amanda::MainLoop::run(); + } +} + +# OK, let's get started with some simple stuff +setup_changer <<'EOC'; +case "${1}" in + -slot) + case "${2}" in + 1) echo "1 fake:1"; exit 0;; + 2) echo " slot 2 is empty"; exit 1;; + 3) echo "1"; exit 0;; # test missing 'device' portion + esac;; + -reset) echo "reset ignored";; + -eject) echo "eject ignored";; + -clean) echo "clean ignored";; + -label) + case "${2}" in + foo?bar) echo "1 ok"; exit 0;; + *) echo " bad label"; exit 1;; + esac;; + -info) echo "7 10 1 1"; exit 0;; + -search) + case "${2}" in + TAPE?01) echo "5 fakedev"; exit 0;; + *) echo " not found"; exit 1;; + esac;; +esac +EOC + +# set up a config for this changer, implicitly using Amanda::Changer::Compat +my $testconf; +$testconf = Installcheck::Config->new(); +$testconf->add_param("tpchanger", "\"$changer_filename\""); +$testconf->write(); + +my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); +} + +my $chg = Amanda::Changer->new(); +try_run_changer( + sub { $chg->load(label => 'TAPE-01', res_cb => \&check_res_cb); }, + undef, "fakedev", "search by label"); + +try_run_changer( + sub { $chg->load(label => 'TAPE-99', res_cb => \&check_res_cb); }, + qr/^not found$/, undef, "search by label; nonexistent tape"); + +try_run_changer( + sub { $chg->load(slot => '1', res_cb => \&check_res_cb); }, + undef, "fake:1", "search by slot"); + +try_run_changer( + sub { $chg->load(slot => '2', res_cb => \&check_res_cb); }, + qr/^slot 2 is empty$/, undef, "search by slot; empty slot"); + +# TODO: what *should* happen here? +#try_run_changer( +# sub { $chg->load(slot => '3', res_cb => \&check_res_cb); }, +# undef, undef, "search by slot; invalid response"); + +try_run_changer( + sub { $chg->reset(finished_cb => \&check_finished_cb); }, + undef, undef, "reset doesn't fail"); + +try_run_changer( + sub { $chg->clean(finished_cb => \&check_finished_cb); }, + undef, undef, "clean doesn't fail"); + +# TODO test update() + +# make sure only one reservation can be held at once +{ + my $first_res; + + my ($load_1, $load_2, $check_load_2, $check_eject); + + $load_1 = sub { + $chg->load(slot => 1, res_cb => $load_2); + }; + + $load_2 = sub { + my ($err, $res) = @_; + die $err if ($err); + + # keep this in scope through the next load + $first_res = $res; + + $chg->load(slot => 2, res_cb => $check_load_2); + }; + + $check_load_2 = sub { + my ($err, $res) = @_; + + like($err, qr/Changer is already reserved/, + "mulitple simultaneous reservations not alowed"); + + $first_res->release(eject => 1, finished_cb => $check_eject); + }; + + $check_eject = sub { + my ($err) = @_; + + ok(!defined $err, "release with eject succeeds"); + + Amanda::MainLoop::quit(); + }; + + Amanda::MainLoop::call_later($load_1); + Amanda::MainLoop::run(); +} + +## check chg-disk + +# Installcheck::Run sets up the whole chg-disk thing for us +$testconf = Installcheck::Run->setup(); +$testconf->write(); + +$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); +} + +$chg = Amanda::Changer->new(); + +{ + my ($get_info, $load_current, $label_current, $load_next, + $release_next, $load_by_label, $check_by_label); + + $get_info = sub { + $chg->info(info_cb => $load_current, info => [ 'num_slots' ]); + }; + + $load_current = sub { + my $err = shift; + my %results = @_; + die($err) if defined($err); + + is($results{'num_slots'}, 15, "info() returns the correct num_slots"); + + $chg->load(slot => "1", res_cb => $label_current); + }; + + $label_current = sub { + my ($err, $res) = @_; + die $err if ($err); + + pass("seek to current slot succeeded"); + + my $dev = Amanda::Device->new($res->{'device_name'}); + $dev->start($Amanda::Device::ACCESS_WRITE, "TESTCONF18", undef) + or die $dev->error_or_status(); + $dev->finish() + or die $dev->error_or_status(); + + is($res->{'this_slot'}, "1", "this slot is '1'"); + is($res->{'next_slot'}, "next", "next slot is 'next'"); + $res->set_label(label => "TESTCONF18", finished_cb => $load_next); + }; + + $load_next = sub { + my ($err) = @_; + die $err if ($err); + + pass("set_label succeeded"); + + $chg->load(slot => "next", res_cb => $release_next); + }; + + $release_next = sub { + my ($err, $res) = @_; + die $err if ($err); + + pass("load 'next' succeeded"); + + $res->release(finished_cb => $load_by_label); + }; + + $load_by_label = sub { + my ($err) = @_; + die $err if ($err); + + pass("release loaded"); + + $chg->load(label => "TESTCONF18", res_cb => $check_by_label); + }; + + $check_by_label = sub { + my ($err, $res) = @_; + die $err if ($err); + + pass("load by label succeeded"); + + my $dev = Amanda::Device->new($res->{'device_name'}); + $dev->read_label() == 0 + or die $dev->error_or_status(); + + is($dev->volume_label(), "TESTCONF18", + "..and finds the right volume"); + + Amanda::MainLoop::quit(); + }; + + Amanda::MainLoop::call_later($get_info); + Amanda::MainLoop::run(); +} diff --git a/installcheck/Amanda_Changer_disk.pl b/installcheck/Amanda_Changer_disk.pl new file mode 100644 index 0000000..c8db6bf --- /dev/null +++ b/installcheck/Amanda_Changer_disk.pl @@ -0,0 +1,230 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 14; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Paths; +use Amanda::Device; +use Amanda::Debug; +use Amanda::MainLoop; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Changer; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +my $taperoot = "$AMANDA_TMPDIR/Amanda_Changer_Disk_test"; + +sub reset_taperoot { + my ($nslots) = @_; + + if (-d $taperoot) { + rmtree($taperoot); + } + mkpath($taperoot); + + for my $slot (1 .. $nslots) { + mkdir("$taperoot/slot$slot") + or die("Could not mkdir: $!"); + } +} + +sub is_pointing_to { + my ($res, $slot, $msg) = @_; + + my ($datalink) = ($res->{'device_name'} =~ /file:(.*)/); + $datalink .= "/data"; + is(readlink($datalink), "../slot$slot", $msg); +} + +# Build a configuration that specifies Amanda::Changer::Disk +my $testconf = Installcheck::Config->new(); +$testconf->write(); + +my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); +} + +reset_taperoot(5); +my $chg = Amanda::Changer->new("chg-disk:$taperoot"); + +{ + my @slots = ( 1, 3, 5 ); + my @reservations = (); + my $getres; + + $getres = sub { + my $slot = pop @slots; + + $chg->load(slot => $slot, + set_current => ($slot == 5), + res_cb => sub { + my ($err, $reservation) = @_; + ok(!$err, "no error loading slot $slot") + or diag($err); + + # keep this reservation + if ($reservation) { + push @reservations, $reservation; + } + + # and start on the next + if (@slots) { + $getres->(); + return; + } else { + # try to load an already-reserved slot + $chg->load(slot => 3, + res_cb => sub { + my ($err, $reservation) = @_; + ok($err, "error when requesting already-reserved slot"); + Amanda::MainLoop::quit(); + }); + } + }); + }; + + # start the loop + Amanda::MainLoop::call_later($getres); + Amanda::MainLoop::run(); + + # ditch the reservations and do it all again + @reservations = (); + @slots = ( 4, 2, 3 ); + Amanda::MainLoop::call_later($getres); + Amanda::MainLoop::run(); + + @reservations = (); +} + +# check "current" and "next" functionality +{ + # load the "current" slot, which should be 3 + my ($load_current, $check_current_cb, $check_next_cb, $reset_finished_cb, $check_reset_cb); + + $load_current = sub { + $chg->load(slot => "current", res_cb => $check_current_cb); + }; + + $check_current_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is_pointing_to($res, 5, "'current' is slot 5"); + + $chg->load(slot => $res->{'next_slot'}, res_cb => $check_next_cb); + }; + + $check_next_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is_pointing_to($res, 1, "'next' from there is slot 1"); + + $chg->reset(finished_cb => $reset_finished_cb); + }; + + $reset_finished_cb = sub { + my ($err) = @_; + die $err if $err; + + $chg->load(slot => "current", res_cb => $check_reset_cb); + }; + + $check_reset_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is_pointing_to($res, 1, "after reset, 'current' is slot 1"); + + Amanda::MainLoop::quit(); + }; + + Amanda::MainLoop::call_later($load_current); + Amanda::MainLoop::run(); +} + +# test loading slot "next" +{ + my $load_next = sub { + $chg->load(slot => "next", + res_cb => sub { + my ($err, $res) = @_; + die $err if $err; + + is_pointing_to($res, 2, "loading slot 'next' loads the correct slot"); + + Amanda::MainLoop::quit(); + } + ); + }; + + Amanda::MainLoop::call_later($load_next); + Amanda::MainLoop::run(); +} + +# check num_slots and loading by label +{ + my ($get_info, $load_label, $check_load_cb) = @_; + + $get_info = sub { + $chg->info(info_cb => $load_label, info => [ 'num_slots' ]); + }; + + $load_label = sub { + my $err = shift; + my %results = @_; + die($err) if defined($err); + + is($results{'num_slots'}, 5, "info() returns the correct num_slots"); + + # note use of a glob metacharacter in the label name + $chg->load(label => "FOO?BAR", res_cb => $check_load_cb); + }; + + $check_load_cb = sub { + my ($err, $res) = @_; + die $err if $err; + + is_pointing_to($res, 4, "labeled volume found in slot 4"); + + Amanda::MainLoop::quit(); + }; + + # label slot 4, using our own symlink + mkpath("$taperoot/tmp"); + symlink("../slot4", "$taperoot/tmp/data") or die "While symlinking: $!"; + my $dev = Amanda::Device->new("file:$taperoot/tmp"); + $dev->start($Amanda::Device::ACCESS_WRITE, "FOO?BAR", undef) + or die $dev->error_or_status(); + $dev->finish() + or die $dev->error_or_status(); + rmtree("$taperoot/tmp"); + + Amanda::MainLoop::call_later($get_info); + Amanda::MainLoop::run(); +} diff --git a/installcheck/Amanda_Changer_single.pl b/installcheck/Amanda_Changer_single.pl new file mode 100644 index 0000000..f4b8f83 --- /dev/null +++ b/installcheck/Amanda_Changer_single.pl @@ -0,0 +1,91 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 4; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Paths; +use Amanda::Device; +use Amanda::Debug; +use Amanda::MainLoop; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Changer; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +my $testconf = Installcheck::Config->new(); +$testconf->write(); + +my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +if ($cfg_result != $CFGERR_OK) { + my ($level, @errors) = Amanda::Config::config_errors(); + die(join "\n", @errors); +} + +my $chg = Amanda::Changer->new("chg-single:tape:/foo"); + +{ + my ($held_res); + my ($get_info, $get_res, $got_res, $got_second_res); + + $get_info = sub { + $chg->info(info_cb => $get_res, info => [ 'num_slots' ]); + }; + + $get_res = sub { + my $err = shift; + my %results = @_; + die($err) if defined($err); + + is($results{'num_slots'}, 1, "info() returns the correct num_slots"); + + $chg->load(slot => "current", + res_cb => $got_res); + }; + + $got_res = sub { + my ($err, $res) = @_; + ok(!$err, "no error loading slot 'current'") + or diag($err); + is($res->{'device_name'}, 'tape:/foo', + "returns correct device name"); + + $held_res = $res; # hang onto it while loading another slot + + $chg->load(label => "FOO!", + res_cb => $got_second_res); + }; + + $got_second_res = sub { + my ($err, $res) = @_; + ok($err, "second simultaneous reservation rejected"); + + Amanda::MainLoop::quit(); + }; + + # start the loop + Amanda::MainLoop::call_later($get_info); + Amanda::MainLoop::run(); +} diff --git a/installcheck/Amanda_Cmdline.pl b/installcheck/Amanda_Cmdline.pl index 399101a..0698813 100644 --- a/installcheck/Amanda_Cmdline.pl +++ b/installcheck/Amanda_Cmdline.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,10 +13,10 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw( no_plan ); +use Test::More tests => 24; use lib "@amperldir@"; use Amanda::Paths; diff --git a/installcheck/Amanda_Config.pl b/installcheck/Amanda_Config.pl index 5a0bb22..c0bdbd2 100644 --- a/installcheck/Amanda_Config.pl +++ b/installcheck/Amanda_Config.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,51 +13,136 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw(no_plan); -use Amconfig; +use Test::More tests => 113; use strict; use lib "@amperldir@"; +use Installcheck::Config; use Amanda::Paths; +use Amanda::Tests; use Amanda::Config qw( :init :getconf ); +use Amanda::Debug; my $testconf; +my $config_overwrites; + +Amanda::Debug::dbopen("installcheck"); + +# utility function + +sub diag_config_errors { + my ($level, @errors) = Amanda::Config::config_errors(); + for my $errmsg (@errors) { + diag $errmsg; + } +} ## # Try starting with no configuration at all -ok(config_init(0, ''), "Initialize with no configuration"); + +is(config_init(0, ''), $CFGERR_OK, + "Initialize with no configuration") + or diag_config_errors(); + +is(config_init(0, undef), $CFGERR_OK, + "Initialize with no configuration, passing a NULL config name") + or diag_config_errors(); + +$config_overwrites = new_config_overwrites(1); +add_config_overwrite($config_overwrites, "tapedev", "null:TEST"); +apply_config_overwrites($config_overwrites); + +is(getconf($CNF_TAPEDEV), "null:TEST", + "config overwrites work with null config"); + +## +# Check out error handling + +$testconf = Installcheck::Config->new(); +$testconf->add_param('rawtapedev', '"/dev/medium-rare-please"'); # a deprecated keyword -> warning +$testconf->write(); + +{ + is(config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"), $CFGERR_WARNINGS, + "Deprecated keyword generates a warning"); + my ($error_level, @errors) = Amanda::Config::config_errors(); + like($errors[0], qr/is deprecated/, + "config_get_errors returns the warning string"); + + Amanda::Config::config_clear_errors(); + ($error_level, @errors) = Amanda::Config::config_errors(); + is(scalar(@errors), 0, "config_clear_errors clears error list"); +} + +$testconf = Installcheck::Config->new(); +$testconf->add_param('invalid-param', 'random-value'); # a deprecated keyword -> warning +$testconf->write(); + +is(config_init($CONFIG_INIT_EXPLICIT_NAME, "NO-SUCH-CONFIGURATION"), $CFGERR_ERRORS, + "Non-existent config generates an error"); + +is(config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"), $CFGERR_ERRORS, + "Invalid keyword generates an error"); + +## +# try a client configuration + +$testconf = Installcheck::Config->new(); +$testconf->add_client_param('property', '"client-prop" "yep"'); +$testconf->add_client_param('property', 'priority "client-prop1" "foo"'); +$testconf->add_client_param('property', 'append "client-prop" "bar"'); +$testconf->write(); + +my $cfg_result = config_init($CONFIG_INIT_CLIENT, undef); +is($cfg_result, $CFGERR_OK, + "Load test client configuration") + or diag_config_errors(); + +is_deeply(getconf($CNF_PROPERTY), { "client-prop1" => { priority => 1, + append => 0, + values => [ "foo" ]}, + "client-prop" => { priority => 0, + append => 1, + values => [ "yep", "bar" ] }}, + "Client PROPERTY parameter parsed correctly"); ## # Parse up a basic configuration -# invent "large" values for CONFTYPE_AM64 and CONFTYPE_SIZE -my $am64_num = '171801575472'; # 0xA000B000C000 / 1024 -my $size_t_num = '2147483647'; # 0x7fffffff +# invent a "large" unsigned number, and make $size_t_num +# depend on the length of size_t +my $int64_num = '171801575472'; # 0xA000B000C000 / 1024 +my $size_t_num; +if (Amanda::Tests::sizeof_size_t() > 4) { + $size_t_num = $int64_num; +} else { + $size_t_num = '2147483647'; # 0x7fffffff +} -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_param('reserve', '75'); $testconf->add_param('autoflush', 'yes'); $testconf->add_param('tapedev', '"/dev/foo"'); -$testconf->add_param('bumpsize', $am64_num); +$testconf->add_param('bumpsize', $int64_num); $testconf->add_param('bumpmult', '1.4'); -$testconf->add_param('reserved-udp-port', '100,200'); +$testconf->add_param('reserved_udp-port', '100,200'); # note use of '-' and '_' $testconf->add_param('device_output_buffer_size', $size_t_num); $testconf->add_param('taperalgo', 'last'); $testconf->add_param('device_property', '"foo" "bar"'); -$testconf->add_param('device_property', '"blue" "car"'); +$testconf->add_param('device_property', '"blue" "car" "tar"'); $testconf->add_param('displayunit', '"m"'); $testconf->add_param('debug_auth', '1'); $testconf->add_tapetype('mytapetype', [ 'comment' => '"mine"', 'length' => '128 M', ]); -$testconf->add_dumptype('mydumptype', [ +$testconf->add_dumptype('mydump-type', [ # note dash 'comment' => '"mine"', 'priority' => 'high', # == 2 - 'bumpsize' => $am64_num, + 'bumpsize' => $int64_num, 'bumpmult' => 1.75, 'starttime' => 1829, 'holdingdisk' => 'required', @@ -71,12 +156,22 @@ $testconf->add_dumptype('mydumptype', [ 'include list' => '"bing" "ting"', 'include list append' => '"string" "fling"', 'include file optional' => '"rhyme"', + 'property' => '"prop" "erty"', + 'property' => '"drop" "qwerty" "asdfg"', +]); +$testconf->add_dumptype('second_dumptype', [ # note underscore + '' => 'mydump-type', + 'comment' => '"refers to mydump-type with a dash"', ]); -$testconf->add_interface('inyoface', [ +$testconf->add_dumptype('third_dumptype', [ + '' => 'second_dumptype', + 'comment' => '"refers to second_dumptype with an underscore"', +]); +$testconf->add_interface('ethernet', [ 'comment' => '"mine"', 'use' => '100', ]); -$testconf->add_interface('inherface', [ +$testconf->add_interface('nic', [ 'comment' => '"empty"', ]); $testconf->add_holdingdisk('hd1', [ @@ -88,13 +183,38 @@ $testconf->add_holdingdisk('hd1', [ $testconf->add_holdingdisk('hd2', [ 'comment' => '"empty"', ]); +$testconf->add_application('my_app', [ + 'comment' => '"my_app_comment"', + 'plugin' => '"amgtar"', +]); +$testconf->add_script('my_script', [ + 'comment' => '"my_script_comment"', + 'plugin' => '"script-email"', + 'execute-on' => 'pre-host-backup, post-host-backup', + 'execute-where' => 'client', + 'property' => '"mailto" "amandabackup" "amanda"', +]); +$testconf->add_device('my_device', [ + 'comment' => '"my device is mine, not yours"', + 'tapedev' => '"tape:/dev/nst0"', + 'device_property' => '"BLOCK_SIZE" "128k"', +]); +$testconf->add_changer('my_changer', [ + 'comment' => '"my changer is mine, not yours"', + 'tpchanger' => '"chg-foo"', + 'changerdev' => '"/dev/sg0"', + 'changerfile' => '"chg.state"', +]); + $testconf->write(); -my $cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); -ok($cfg_ok, "Load test configuration"); +$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF'); +is($cfg_result, $CFGERR_OK, + "Load test configuration") + or diag_config_errors(); SKIP: { - skip "error loading config", unless $cfg_ok; + skip "error loading config", 3 unless $cfg_result == $CFGERR_OK; is(Amanda::Config::get_config_name(), "TESTCONF", "config_name set"); @@ -106,12 +226,12 @@ SKIP: { } SKIP: { # global parameters - skip "error loading config", unless $cfg_ok; + skip "error loading config", 11 unless $cfg_result == $CFGERR_OK; is(getconf($CNF_RESERVE), 75, "integer global confparm"); - is(getconf($CNF_BUMPSIZE), $am64_num+0, - "am64 global confparm"); + is(getconf($CNF_BUMPSIZE), $int64_num+0, + "int64 global confparm"); is(getconf($CNF_TAPEDEV), "/dev/foo", "string global confparm"); is(getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE), $size_t_num+0, @@ -125,17 +245,18 @@ SKIP: { # global parameters is(getconf($CNF_DISPLAYUNIT), "M", "displayunit is correctly uppercased"); is_deeply(getconf($CNF_DEVICE_PROPERTY), - { "foo" => "bar", "blue" => "car" }, + { "foo" => { priority => 0, append => 0, values => ["bar"]}, + "blue" => { priority => 0, append => 0, + values => ["car", "tar"]} }, "proplist global confparm"); - ok(getconf_seen($CNF_TAPEDEV), "'tapedev' parm was seen"); - ok(!getconf_seen($CNF_NETUSAGE), - "'netusage' parm was not seen"); + ok(!getconf_seen($CNF_CHANGERFILE), + "'changerfile' parm was not seen"); } SKIP: { # derived values - skip "error loading config", unless $cfg_ok; + skip "error loading config", 3 unless $cfg_result == $CFGERR_OK; is(Amanda::Config::getconf_unit_divisor(), 1024, "correct unit divisor (from displayunit -> KB)"); @@ -146,7 +267,7 @@ SKIP: { # derived values } SKIP: { # tapetypes - skip "error loading config", unless $cfg_ok; + skip "error loading config", 6 unless $cfg_result == $CFGERR_OK; my $ttyp = lookup_tapetype("mytapetype"); ok($ttyp, "found mytapetype"); is(tapetype_getconf($ttyp, $TAPETYPE_COMMENT), 'mine', @@ -165,15 +286,15 @@ SKIP: { # tapetypes } SKIP: { # dumptypes - skip "error loading config", unless $cfg_ok; + skip "error loading config", 17 unless $cfg_result == $CFGERR_OK; - my $dtyp = lookup_dumptype("mydumptype"); - ok($dtyp, "found mydumptype"); + my $dtyp = lookup_dumptype("mydump-type"); + ok($dtyp, "found mydump-type"); is(dumptype_getconf($dtyp, $DUMPTYPE_COMMENT), 'mine', "dumptype string"); is(dumptype_getconf($dtyp, $DUMPTYPE_PRIORITY), 2, "dumptype priority"); - is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), $am64_num+0, + is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), $int64_num+0, "dumptype size"); is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPMULT), 1.75, "dumptype real"); @@ -199,6 +320,11 @@ SKIP: { # dumptypes 'list' => [ 'foo', 'bar', 'true', 'star' ], 'optional' => 0 }, "dumptype exclude list"); + is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_PROPERTY), + { "prop" => { priority => 0, append => 0, values => ["erty"]}, + "drop" => { priority => 0, append => 0, + values => ["qwerty", "asdfg"] }}, + "dumptype proplist"); ok(dumptype_seen($dtyp, $DUMPTYPE_EXCLUDE), "'exclude' parm was seen"); @@ -207,7 +333,7 @@ SKIP: { # dumptypes is_deeply([ sort(+getconf_list("dumptype")) ], [ sort(qw( - mydumptype + mydump-type second_dumptype third_dumptype NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST SRVCOMPRESS BSD-AUTH KRB4-AUTH NO-RECORD NO-HOLD NO-FULL @@ -216,30 +342,30 @@ SKIP: { # dumptypes } SKIP: { # interfaces - skip "error loading config" unless $cfg_ok; - my $iface = lookup_interface("inyoface"); - ok($iface, "found inyoface"); - is(interface_name($iface), "inyoface", + skip "error loading config", 8 unless $cfg_result == $CFGERR_OK; + my $iface = lookup_interface("ethernet"); + ok($iface, "found ethernet"); + is(interface_name($iface), "ethernet", "interface knows its name"); is(interface_getconf($iface, $INTER_COMMENT), 'mine', "interface comment"); is(interface_getconf($iface, $INTER_MAXUSAGE), 100, "interface maxusage"); - $iface = lookup_interface("inherface"); - ok($iface, "found inherface"); + $iface = lookup_interface("nic"); + ok($iface, "found nic"); ok(interface_seen($iface, $INTER_COMMENT), "seen set for parameters that appeared"); ok(!interface_seen($iface, $INTER_MAXUSAGE), "seen not set for parameters that did not appear"); is_deeply([ sort(+getconf_list("interface")) ], - [ sort('inyoface', 'inherface', 'default') ], + [ sort('ethernet', 'nic', 'default') ], "getconf_list lists all interfaces (in any order)"); } SKIP: { # holdingdisks - skip "error loading config" unless $cfg_ok; + skip "error loading config", 13 unless $cfg_result == $CFGERR_OK; my $hdisk = lookup_holdingdisk("hd1"); ok($hdisk, "found hd1"); is(holdingdisk_name($hdisk), "hd1", @@ -276,6 +402,101 @@ SKIP: { # holdingdisks "getconf_list lists all holdingdisks (in any order)"); } +SKIP: { # application + skip "error loading config", 5 unless $cfg_result == $CFGERR_OK; + my $app = lookup_application("my_app"); + ok($app, "found my_app"); + is(application_name($app), "my_app", + "my_app knows its name"); + is(application_getconf($app, $APPLICATION_COMMENT), 'my_app_comment', + "application comment"); + is(application_getconf($app, $APPLICATION_PLUGIN), 'amgtar', + "application plugin (amgtar)"); + + is_deeply([ sort(+getconf_list("application-tool")) ], + [ sort("my_app") ], + "getconf_list lists all application-tool"); +} + +SKIP: { # script + skip "error loading config", 7 unless $cfg_result == $CFGERR_OK; + my $sc = lookup_pp_script("my_script"); + ok($sc, "found my_script"); + is(pp_script_name($sc), "my_script", + "my_script knows its name"); + is(pp_script_getconf($sc, $PP_SCRIPT_COMMENT), 'my_script_comment', + "script comment"); + is(pp_script_getconf($sc, $PP_SCRIPT_PLUGIN), 'script-email', + "script plugin (script-email)"); + is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_WHERE), $ES_CLIENT, + "script execute_where (client)"); + is(pp_script_getconf($sc, $PP_SCRIPT_EXECUTE_ON), + $EXECUTE_ON_PRE_HOST_BACKUP|$EXECUTE_ON_POST_HOST_BACKUP, + "script execute_on"); + + is_deeply([ sort(+getconf_list("script-tool")) ], + [ sort("my_script") ], + "getconf_list lists all script-tool"); +} + +SKIP: { # device + skip "error loading config", 7 unless $cfg_result == $CFGERR_OK; + my $dc = lookup_device_config("my_device"); + ok($dc, "found my_device"); + is(device_config_name($dc), "my_device", + "my_device knows its name"); + is(device_config_getconf($dc, $DEVICE_CONFIG_COMMENT), 'my device is mine, not yours', + "device comment"); + is(device_config_getconf($dc, $DEVICE_CONFIG_TAPEDEV), 'tape:/dev/nst0', + "device tapedev"); + # TODO do we really need all of this equipment for device properties? + is_deeply(device_config_getconf($dc, $DEVICE_CONFIG_DEVICE_PROPERTY), + { "BLOCK_SIZE" => { 'priority' => 0, 'values' => ["128k"], 'append' => 0 }, }, + "device config proplist"); + + is_deeply([ sort(+getconf_list("device")) ], + [ sort("my_device") ], + "getconf_list lists all devices"); +} + +SKIP: { # changer + skip "error loading config", 7 unless $cfg_result == $CFGERR_OK; + my $dc = lookup_changer_config("my_changer"); + ok($dc, "found my_changer"); + is(changer_config_name($dc), "my_changer", + "my_changer knows its name"); + is(changer_config_getconf($dc, $CHANGER_CONFIG_COMMENT), 'my changer is mine, not yours', + "changer comment"); + is(changer_config_getconf($dc, $CHANGER_CONFIG_CHANGERDEV), '/dev/sg0', + "changer tapedev"); + + is_deeply([ sort(+getconf_list("changer")) ], + [ sort("my_changer") ], + "getconf_list lists all changers"); +} + +## +# Test config overwrites (using the config from above) + +$config_overwrites = new_config_overwrites(1); # note estimate is too small +add_config_overwrite($config_overwrites, "tapedev", "null:TEST"); +add_config_overwrite($config_overwrites, "tpchanger", "chg-test"); +add_config_overwrite_opt($config_overwrites, "org=KAOS"); +apply_config_overwrites($config_overwrites); + +is(getconf($CNF_TAPEDEV), "null:TEST", + "config overwrites work with real config"); +is(getconf($CNF_ORG), "KAOS", + "add_config_overwrite_opt parsed correctly"); + +# introduce an error +$config_overwrites = new_config_overwrites(1); +add_config_overwrite($config_overwrites, "bogusparam", "foo"); +apply_config_overwrites($config_overwrites); + +my ($error_level, @errors) = Amanda::Config::config_errors(); +is($error_level, $CFGERR_ERRORS, "bogus config overwrite flagged as an error"); + ## # Test configuration dumping @@ -288,11 +509,17 @@ if (!$pid) { Amanda::Config::dump_configuration(); exit 1; } -my $dump = join'', <$kid>; +my $dump_first_line = <$kid>; +my $dump = join'', $dump_first_line, <$kid>; close $kid; +waitpid $pid, 0; my $fn = Amanda::Config::get_config_filename(); -like($dump, qr/AMANDA CONFIGURATION FROM FILE "$fn"/, +my $dump_filename = $dump_first_line; +chomp $dump_filename; +$dump_filename =~ s/^# AMANDA CONFIGURATION FROM FILE "//g; +$dump_filename =~ s/":$//g; +is($dump_filename, $fn, "config filename is included correctly"); like($dump, qr/DEVICE_PROPERTY\s+"foo" "bar"\n/i, @@ -319,43 +546,63 @@ like($dump, qr/INCLUDE\s+FILE OPTIONAL "rhyme"/i, # We may want to change this, but we should do so intentionally. # This is also tested by the 'amgetconf' installcheck. -$testconf = Amconfig->new(); -$testconf->add_dumptype('mydumptype', [ +$testconf = Installcheck::Config->new(); +$testconf->add_dumptype('mydump-type', [ 'exclude list' => '"foo" "bar"', 'exclude list optional append' => '"true" "star"', 'exclude list append' => '"true" "star"', ]); $testconf->write(); -$cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"); +$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"); +is($cfg_result, $CFGERR_OK, + "first exinclude parsing config loaded") + or diag_config_errors(); SKIP: { - skip "error loading config", unless $cfg_ok; + skip "error loading config", 2 unless $cfg_result == $CFGERR_OK; - my $dtyp = lookup_dumptype("mydumptype"); - ok($dtyp, "found mydumptype"); + my $dtyp = lookup_dumptype("mydump-type"); + ok($dtyp, "found mydump-type"); is(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE)->{'optional'}, 0, "'optional' has no effect when not on the last occurrence"); } -$testconf = Amconfig->new(); -$testconf->add_dumptype('mydumptype', [ - 'exclude file' => '"foo" "bar"', - 'exclude file optional append' => '"true" "star"', - 'exclude list append' => '"true" "star"', +## +# Check out where quoting is and is not required. + +$testconf = Installcheck::Config->new(); + +# make sure an unquoted tapetype is OK +$testconf->add_param('tapetype', 'TEST-TAPE'); # unquoted (Installcheck::Config uses quoted) + +# strings can optionally be quoted +$testconf->add_param('org', '"MyOrg"'); + +# enumerations (e.g., taperalgo) must not be quoted; implicitly tested above + +# definitions +$testconf->add_dumptype('"parent"', [ # note quotes + 'bumpsize' => '10240', +]); +$testconf->add_dumptype('child', [ + '' => '"parent"', # note quotes +]); +$testconf->add_dumptype('child2', [ + '' => 'parent', ]); $testconf->write(); -$cfg_ok = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"); +$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"); +is($cfg_result, $CFGERR_OK, + "parsed config to test strings vs. identifiers") + or diag_config_errors(); SKIP: { - skip "error loading config", unless $cfg_ok; - - my $dtyp = lookup_dumptype("mydumptype"); - ok($dtyp, "found mydumptype"); - is(dumptype_getconf($dtyp, $DUMPTYPE_EXCLUDE)->{'optional'}, 0, - "'optional' has no effect when not on the last occurrence of 'file'"); + skip "error loading config", 3 unless $cfg_result == $CFGERR_OK; + + my $dtyp = lookup_dumptype("parent"); + ok($dtyp, "found parent"); + $dtyp = lookup_dumptype("child"); + ok($dtyp, "found child"); + is(dumptype_getconf($dtyp, $DUMPTYPE_BUMPSIZE), 10240, + "child dumptype correctly inherited bumpsize"); } - -# TODO: -# overwrites -# inheritance -# more init diff --git a/installcheck/Amanda_DB_Catalog.pl b/installcheck/Amanda_DB_Catalog.pl new file mode 100644 index 0000000..a93c48f --- /dev/null +++ b/installcheck/Amanda_DB_Catalog.pl @@ -0,0 +1,474 @@ +# Copyright (c) 2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# TODO: check large values of 'kb' + +use Test::More tests => 35; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::DB::Catalog; + +# set up and load a simple config +my $testconf = Installcheck::Config->new(); +$testconf->write(); +config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF') == $CFGERR_OK + or die("Could not load test config"); + +# test functions against an empty set of logfiles + +is_deeply([ Amanda::DB::Catalog::get_write_timestamps() ], [], + "No write_timestamps in an empty catalog"); + +is_deeply(Amanda::DB::Catalog::get_latest_write_timestamp(), undef, + "No latest write_timestamp in an empty catalog"); + +is_deeply([ Amanda::DB::Catalog::get_dumps() ], [], + "No dumpfiles in an empty catalog"); + +# and add some logfiles to query, and a corresponding tapelist, while also gathering +# a list of dumpfiles for comparison with the results from Amanda::DB::Catalog +my $logdir = config_dir_relative(getconf($CNF_LOGDIR)); +my $tapelist_fn = config_dir_relative(getconf($CNF_TAPELIST)); +my $output; +my $write_timestamp; +my %dumpfiles; +open (my $tapelist, ">", $tapelist_fn); +while () { + # skip comments + next if (/^#/ or /^\S*$/); + + # add to tapelist + if (/^:tapelist (\d+) (\S+)\s*$/) { + print $tapelist "$1 $2 reuse\n"; + next; + } + + # new logfile + if (/^::: (.*)/) { + open $output, ">", "$logdir/$1" or die("Could not open $1 for writing: $!"); + next; + } + + # write_timestamp + if (/^:timestamp (\d+)/) { + $write_timestamp = $1; + next; + } + + # new dumpfile + if (/^:dumpfile (\S+) (\S+) (\S+) (\S+) (\d+) (\S+) (\d+) (\d+) (\d+) (\S+) (\S+) (\d+)/) { + $dumpfiles{$1} = { + 'dump_timestamp' => $2, 'hostname' => $3, 'diskname' => $4, + 'level' => $5+0, 'label' => $6, 'filenum' => $7+0, + 'partnum' => $8+0, 'nparts' => $9+0, 'status' => $10, + 'sec' => $11+0.0, 'kb' => $12+0, + 'write_timestamp' => $write_timestamp, + }; + next; + } + + die("syntax error") if (/^:/); + + print $output $_; +} +close($output); +close($tapelist); +Amanda::DB::Catalog::_clear_cache(); + +## +# Test the timestamps + +is_deeply([ Amanda::DB::Catalog::get_write_timestamps(), ], + [ '20080111000000', '20080222222222', '20080313133333', '20080414144444' ], + "get_write_timestamps returns all logfile datestamps in proper order, with zero-padding"); + +is(Amanda::DB::Catalog::get_latest_write_timestamp(), '20080414144444', + "get_latest_write_timestamp correctly returns the latest write timestamp"); + +## +# test get_dumps and sort_dumps + +# get dumps filtered by a regexp on the key +sub dump_names($) { + my ($expr) = @_; + my @selected_keys = grep { $_ =~ $expr } keys %dumpfiles; + return map { $dumpfiles{$_} } @selected_keys; +} + +# get dumps filtered by an expression on the dumpfile itself +sub dumps(&) { + my ($block) = @_; + return grep { &$block } values %dumpfiles; +} + +# put @_ in a canonical order +sub sortdumps { + map { + # convert bigints to strings so is_deeply doesn't get confused + $_->{'level'} = "$_->{level}"; + $_->{'filenum'} = "$_->{filenum}"; + $_->{'kb'} = "$_->{kb}"; + $_; + } sort { + $a->{'label'} cmp $b->{'label'} + or $a->{'filenum'} cmp $b->{'filenum'} + } + @_; +} + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps() ], + [ sortdumps dump_names qr/.*/ ], + "get_dumps returns all dumps when given no parameters"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(write_timestamp => '20080111000000') ], + [ sortdumps dump_names qr/somebox_lib_20080111/ ], + "get_dumps parameter write_timestamp"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(write_timestamp => '20080111') ], + [ sortdumps dump_names qr/somebox_lib_20080111/ ], + "get_dumps accepts a short write_timestamp and zero-pads it"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(write_timestamps => ['20080111000000','20080222222222']) ], + [ sortdumps dump_names qr/(20080111|20080222222222)$/ ], + "get_dumps parameter write_timestamps"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(dump_timestamp => '20080111000000') ], + [ sortdumps dump_names qr/somebox_lib_20080111/ ], + "get_dumps parameter dump_timestamp"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(dump_timestamp => '20080111') ], + [ sortdumps dump_names qr/somebox_lib_20080111/ ], + "get_dumps accepts a short dump_timestamp and zero-pads it"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(dump_timestamps => ['20080111000000','20080222222222']) ], + [ sortdumps dump_names qr/(20080111|20080222222222)$/ ], + "get_dumps parameter dump_timestamps"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(dump_timestamp_match => '200801-2') ], + [ sortdumps dump_names qr/20080[12]/ ], + "get_dumps parameter dump_timestamp_match"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostname => 'otherbox') ], + [ sortdumps dump_names qr/^otherbox_/ ], + "get_dumps parameter hostname"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostnames => ['otherbox','somebox']) ], + [ sortdumps dump_names qr/^(otherbox_|somebox_)/ ], + "get_dumps parameter hostnames"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostname_match => '*box') ], + [ sortdumps dump_names qr/box/ ], + "get_dumps parameter hostname_match"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(diskname => '/lib') ], + [ sortdumps dump_names qr/_lib_/ ], + "get_dumps parameter diskname"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(disknames => ['/lib','/usr/bin']) ], + [ sortdumps dump_names qr/(_lib_|_usr_bin_)/ ], + "get_dumps parameter disknames"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(diskname_match => '/usr') ], + [ sortdumps dump_names qr/_usr_/ ], + "get_dumps parameter diskname_match"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(label => 'Conf-001') ], + [ sortdumps dumps { $_->{'label'} eq 'Conf-001' } ], + "get_dumps parameter label"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(labels => ['Conf-002','Conf-003']) ], + [ sortdumps dumps { $_->{'label'} eq 'Conf-002' or $_->{'label'} eq 'Conf-003' } ], + "get_dumps parameter labels"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(level => 0) ], + [ sortdumps dumps { $_->{'level'} == 0 } ], + "get_dumps parameter level"); +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(levels => [ 1 ]) ], + [ sortdumps dumps { $_->{'level'} == 1 } ], + "get_dumps parameter levels"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(status => "OK") ], + [ sortdumps dumps { $_->{'status'} eq "OK" } ], + "get_dumps parameter status = OK"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(status => "PARTIAL") ], + [ sortdumps dumps { $_->{'status'} eq "PARTIAL" } ], + "get_dumps parameter status = PARTIAL"); + +## more complex, multi-parameter queries + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostname => 'somebox', + diskname_match => '/lib') ], + [ sortdumps dump_names qr/^somebox_lib_/ ], + "get_dumps parameters hostname and diskname_match"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(write_timestamp => '20080313133333', + dump_timestamp => '20080311131133') ], + [ sortdumps dumps { $_->{'dump_timestamp'} eq '20080311131133' + and $_->{'write_timestamp'} eq '20080313133333' } ], + "get_dumps parameters write_timestamp and dump_timestamp"); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(write_timestamp => '20080414144444', + status => 'OK') ], + [ ], # there were no OK dumps on that date + "get_dumps parameters write_timestamp status"); + +## test sorting +# (this is not exhaustive, as that would make the tests more complex than the +# code being tested) + +is_deeply([ Amanda::DB::Catalog::sort_dumps(['write_timestamp'], + @dumpfiles{'somebox_lib_20080222222222','somebox_lib_20080111'}) ], + [ @dumpfiles{'somebox_lib_20080111','somebox_lib_20080222222222'} ], + "sort by write_timestamps"); +is_deeply([ Amanda::DB::Catalog::sort_dumps(['-write_timestamp'], + @dumpfiles{'somebox_lib_20080111','somebox_lib_20080222222222'}) ], + [ @dumpfiles{'somebox_lib_20080222222222','somebox_lib_20080111'} ], + "sort by write_timestamps, reverse"); + +is_deeply([ Amanda::DB::Catalog::sort_dumps(['hostname', '-diskname', 'write_timestamp'], + @dumpfiles{ + 'somebox_lib_20080222222222', + 'somebox_usr_bin_20080313133333', + 'somebox_lib_20080313133333_p4', + 'otherbox_lib_20080313133333', + 'somebox_lib_20080111', + }) ], + [ @dumpfiles{ + 'otherbox_lib_20080313133333', + 'somebox_usr_bin_20080313133333', + 'somebox_lib_20080111', + 'somebox_lib_20080222222222', + 'somebox_lib_20080313133333_p4', + } ], + "multi-key sort"); + +## add log entries + +# one to an existing logfile, same tape +Amanda::DB::Catalog::add_dump({ + 'write_timestamp' => '20080111', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newbox', + 'diskname' => '/newdisk', + 'level' => 3, + 'label' => 'Conf-001', + 'filenum' => 2, + 'partnum' => 1, + 'nparts' => 1, + 'status' => 'OK', + 'sec' => 13.0, + 'kb' => 12380, +}); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostname => 'newbox') ], + [ sortdumps { + 'write_timestamp' => '20080111000000', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newbox', + 'diskname' => '/newdisk', + 'level' => 3, + 'label' => 'Conf-001', + 'filenum' => 2, + 'partnum' => 1, + 'nparts' => 1, + 'status' => 'OK', + 'sec' => 13.0, + 'kb' => 12380, + } ], + "successfully re-read an added dump in an existing logfile"); + +# and again, to test the last-logfile cache in Amanda::DB::Catalog +Amanda::DB::Catalog::add_dump({ + 'write_timestamp' => '20080111', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newbox', + 'diskname' => '/newdisk2', + 'level' => 0, + 'label' => 'Conf-001', + 'filenum' => 3, + 'partnum' => 1, + 'nparts' => 1, + 'status' => 'OK', + 'sec' => 27.0, + 'kb' => 32380, +}); + +is(scalar Amanda::DB::Catalog::get_dumps(hostname => 'newbox'), 2, + "adding another dump to that logfile and re-reading gives 2 dumps"); + +# and another in a new file, as well as a tapelist entry +Amanda::DB::Catalog::add_dump({ + 'write_timestamp' => '20080707070707', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newlog', + 'diskname' => '/newdisk', + 'level' => 3, + 'label' => 'Conf-009', + 'filenum' => 1, + 'partnum' => 1, + 'nparts' => 1, + 'status' => 'OK', + 'sec' => 13.0, + 'kb' => 12380, +}); + +is_deeply([ sortdumps Amanda::DB::Catalog::get_dumps(hostname => 'newlog') ], + [ sortdumps { + 'write_timestamp' => '20080707070707', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newlog', + 'diskname' => '/newdisk', + 'level' => 3, + 'label' => 'Conf-009', + 'filenum' => 1, + 'partnum' => 1, + 'nparts' => 1, + 'status' => 'OK', + 'sec' => 13.0, + 'kb' => 12380, + } ], + "successfully re-read an added dump in a new logfile"); + +# and add a multipart dump to that same logfile +for (my $i = 1; $i <= 5; $i++) { + Amanda::DB::Catalog::add_dump({ + 'write_timestamp' => '20080707070707', + 'dump_timestamp' => '20080707070707', + 'hostname' => 'newlog', + 'diskname' => '/bigdisk', + 'level' => 1, + 'label' => 'Conf-009', + 'filenum' => $i+1, + 'partnum' => $i, + 'nparts' => 5, + 'status' => 'OK', + 'sec' => 13.0, + 'kb' => 12380, + }); +} + +is(scalar Amanda::DB::Catalog::get_dumps(diskname => '/bigdisk'), 5, + "multi-part dump added and re-read successfully"); + +__DATA__ +# a short-datestamp logfile with only a single, single-part file in it +::: log.20080111.0 +:tapelist 20080111 Conf-001 +:timestamp 20080111000000 +DISK planner somebox /lib +START planner date 20080111 +START driver date 20080111 +STATS driver hostname somebox +STATS driver startup time 0.051 +FINISH planner date 20080111 time 82.721 +START taper datestamp 20080111 label Conf-001 tape 1 +SUCCESS dumper somebox /lib 20080111 0 [sec 0.209 kb 1970 kps 9382.2 orig-kb 1970] +SUCCESS chunker somebox /lib 20080111 0 [sec 0.305 kb 420 kps 1478.7] +STATS driver estimate somebox /lib 20080111 0 [sec 1 nkb 2002 ckb 480 kps 385] +:dumpfile somebox_lib_20080111 20080111000000 somebox /lib 0 Conf-001 1 1 1 OK 4.813543 419 +PART taper Conf-001 1 somebox /lib 20080111 1/1 0 [sec 4.813543 kb 419 kps 87.133307] +DONE taper somebox /lib 20080111 1 0 [sec 4.813543 kb 419 kps 87.133307] +FINISH driver date 20080111 time 2167.581 + +# a long-datestamp logfile, also fairly simple +::: log.20080222222222.0 +:tapelist 20080222222222 Conf-002 +:timestamp 20080222222222 +DISK planner somebox /lib +START planner date 20080222222222 +START driver date 20080222222222 +STATS driver hostname somebox +STATS driver startup time 0.051 +FINISH planner date 20080222222222 time 0.102 +SUCCESS dumper somebox /lib 20080222222222 0 [sec 0.012 kb 100 kps 8115.6 orig-kb 100] +SUCCESS chunker somebox /lib 20080222222222 0 [sec 5.075 kb 100 kps 26.0] +STATS driver estimate somebox /lib 20080222222222 0 [sec 0 nkb 132 ckb 160 kps 1024] +START taper datestamp 20080222222222 label Conf-002 tape 1 +:dumpfile somebox_lib_20080222222222 20080222222222 somebox /lib 0 Conf-002 1 1 1 OK 0.000733 100 +PART taper Conf-002 1 somebox /lib 20080222222222 1/1 0 [sec 0.000733 kb 100 kps 136425.648022] +DONE taper somebox /lib 20080222222222 1 0 [sec 0.000733 kb 100 kps 136425.648022] +FINISH driver date 20080222222222 time 6.206 + +# a logfile with several dumps in it, one of which comes in many parts, and one of which is +# from a previous run +::: log.20080313133333.0 +:tapelist 20080313133333 Conf-003 +:timestamp 20080313133333 +DISK planner somebox /usr/bin +DISK planner somebox /lib +DISK planner otherbox /lib +DISK planner otherbox /usr/bin +START planner date 20080313133333 +START driver date 20080313133333 +STATS driver hostname somebox +STATS driver startup time 0.059 +INFO planner Full dump of somebox:/lib promoted from 2 days ahead. +FINISH planner date 20080313133333 time 0.286 +SUCCESS dumper somebox /usr/bin 20080313133333 1 [sec 0.001 kb 20 kps 10352.0 orig-kb 20] +SUCCESS chunker somebox /usr/bin 20080313133333 1 [sec 1.023 kb 20 kps 50.8] +STATS driver estimate somebox /usr/bin 20080313133333 1 [sec 0 nkb 52 ckb 64 kps 1024] +START taper datestamp 20080313133333 label Conf-003 tape 1 +:dumpfile somebox_usr_bin_20080313133333 20080313133333 somebox /usr/bin 1 Conf-003 1 1 1 OK 0.000370 20 +PART taper Conf-003 1 somebox /usr/bin 20080313133333 1/1 1 [sec 0.000370 kb 20 kps 54054.054054] +DONE taper somebox /usr/bin 20080313133333 1 1 [sec 0.000370 kb 20 kps 54054.054054] +# a multi-part dump +SUCCESS dumper somebox /lib 20080313133333 0 [sec 0.189 kb 3156 kps 50253.1 orig-kb 3156] +SUCCESS chunker somebox /lib 20080313133333 0 [sec 5.250 kb 3156 kps 1815.5] +STATS driver estimate somebox /lib 20080313133333 0 [sec 1 nkb 3156 ckb 3156 kps 9500] +:dumpfile somebox_lib_20080313133333_p1 20080313133333 somebox /lib 0 Conf-003 2 1 4 OK 0.005621 1024 +PART taper Conf-003 2 somebox /lib 20080313133333 1/4 0 [sec 0.005621 kb 1024 kps 182173.990393] +:dumpfile somebox_lib_20080313133333_p2 20080313133333 somebox /lib 0 Conf-003 3 2 4 OK 0.006527 1024 +PART taper Conf-003 3 somebox /lib 20080313133333 2/4 0 [sec 0.006527 kb 1024 kps 156886.777999] +:dumpfile somebox_lib_20080313133333_p3 20080313133333 somebox /lib 0 Conf-003 4 3 4 OK 0.005854 1024 +PART taper Conf-003 4 somebox /lib 20080313133333 3/4 0 [sec 0.005854 kb 1024 kps 174923.129484] +:dumpfile somebox_lib_20080313133333_p4 20080313133333 somebox /lib 0 Conf-003 5 4 4 OK 0.001919 284 +PART taper Conf-003 5 somebox /lib 20080313133333 4/4 0 [sec 0.001919 kb 284 kps 147993.746743] +DONE taper somebox /lib 20080313133333 10 0 [sec 0.051436 kb 3156 kps 184695.543977] +SUCCESS dumper otherbox /lib 20080313133333 0 [sec 0.001 kb 190 kps 10352.0 orig-kb 20] +SUCCESS chunker otherbox /lib 20080313133333 0 [sec 1.023 kb 190 kps 50.8] +STATS driver estimate otherbox /lib 20080313133333 0 [sec 0 nkb 190 ckb 190 kps 1024] +# this dump is from a previous run, with an older dump_timestamp +:dumpfile otherbox_usr_bin_20080313133333 20080311131133 otherbox /usr/bin 0 Conf-003 6 1 1 OK 0.002733 240 +PART taper Conf-003 6 otherbox /usr/bin 20080311131133 1/1 0 [sec 0.002733 kb 240 kps 136425.648022] +:dumpfile otherbox_lib_20080313133333 20080313133333 otherbox /lib 0 Conf-003 7 1 1 OK 0.001733 190 +PART taper Conf-003 7 otherbox /lib 20080313133333 1/1 0 [sec 0.001733 kb 190 kps 136425.648022] +DONE taper otherbox /lib 20080313133333 1 0 [sec 0.001733 kb 190 kps 136425.648022] +FINISH driver date 20080313133333 time 24.777 + +# A logfile with some partial parts (PARTPARTIAL) in it +::: log.20080414144444.0 +:tapelist 20080414144444 Conf-004 +:tapelist 20080414144444 Conf-005 +:timestamp 20080414144444 +DISK planner otherbox /lib +START planner date 20080414144444 +START driver date 20080414144444 +STATS driver hostname otherbox +STATS driver startup time 0.075 +INFO taper Will write new label `Conf-004' to new (previously non-amanda) tape +FINISH planner date 20080414144444 time 2.139 +SUCCESS dumper otherbox /lib 20080414144444 1 [sec 0.003 kb 60 kps 16304.3 orig-kb 60] +SUCCESS chunker otherbox /lib 20080414144444 1 [sec 1.038 kb 60 kps 88.5] +STATS driver estimate otherbox /lib 20080414144444 1 [sec 0 nkb 92 ckb 96 kps 1024] +START taper datestamp 20080414144444 label Conf-004 tape 1 +:dumpfile otherbox_lib_20080414144444_try1 20080414144444 otherbox /lib 1 Conf-004 1 1 1 PARTIAL 0.000707 32 +PARTPARTIAL taper Conf-004 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000707 kb 32 kps 45261.669024] "" +INFO taper Will request retry of failed split part. +INFO taper Will write new label `Conf-005' to new (previously non-amanda) tape +START taper datestamp 20080414144444 label Conf-005 tape 2 +:dumpfile otherbox_lib_20080414144444_try2 20080414144444 otherbox /lib 1 Conf-005 1 1 1 PARTIAL 0.000540 32 +PARTPARTIAL taper Conf-005 1 otherbox /lib 20080414144444 1/1 1 [sec 0.000540 kb 32 kps 59259.259259] "" +INFO taper Will request retry of failed split part. +WARNING driver Out of tapes; going into degraded mode. +PARTIAL taper otherbox /lib 20080414144444 1 1 [sec 0.000540 kb 32 kps 59259.259259] "" +FINISH driver date 20080414144444 time 6.959 diff --git a/installcheck/Amanda_Debug.pl b/installcheck/Amanda_Debug.pl new file mode 100644 index 0000000..8737290 --- /dev/null +++ b/installcheck/Amanda_Debug.pl @@ -0,0 +1,94 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 9; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Amanda::Debug; + +## most failures of the debug module will just kill the process, so +## the main goal of this test script is just to make it to the end :) + +my $fh; +my $debug_text; +my $pid; +my $kid; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); +Amanda::Debug::dbrename("TESTCONF", "installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +my $debug_fd = Amanda::Debug::dbfd(); +ok($debug_fd, "dbfd() returns something nonzero"); + +my $debug_file = Amanda::Debug::dbfn(); +ok(-f $debug_file, "dbfn() returns a filename that exists"); + +Amanda::Debug::debug('debug message'); +Amanda::Debug::info('info message'); +Amanda::Debug::message('message message'); +Amanda::Debug::warning('warning message'); + +Amanda::Debug::dbclose(); + +open ($fh, "<", $debug_file); +$debug_text = do { local $/; <$fh> }; +close($fh); + +like($debug_text, qr/debug message/, "debug message is in debug log file"); +like($debug_text, qr/info message/, "info message is in debug log file"); +like($debug_text, qr/message message/, "message message is in debug log file"); +like($debug_text, qr/warning message/, "warning message is in debug log file"); + +Amanda::Debug::dbreopen($debug_file, "oops, one more thing"); +Amanda::Debug::dbclose(); + +open ($fh, "<", $debug_file); +$debug_text = do { local $/; <$fh> }; +close($fh); + +like($debug_text, qr/warning message/, "dbreopen doesn't erase existing contents"); +like($debug_text, qr/oops, one more thing/, "dbreopen adds 'notation' to the debug log"); + +Amanda::Debug::dbreopen($debug_file, "I've still got more stuff to test"); + +# fork a child to call error() +$pid = open($kid, "-|"); +die "Can't fork: $!" unless defined($pid); +if (!$pid) { + $Amanda::Debug::erroutput_type = 0; # don't spew to stderr, too, please + Amanda::Debug::critical("morituri te salutamus"); + exit 1; # just in case +} +close $kid; +waitpid $pid, 0; + +# just hope this works -- Perl makes it very difficult to write to fd 2! +Amanda::Debug::debug_dup_stderr_to_debug(); +Amanda::Debug::dbclose(); + +open ($fh, "<", $debug_file); +$debug_text = do { local $/; <$fh> }; +close($fh); + +like($debug_text, qr/morituri te salutamus/, "critical() writes its message to the debug log"); diff --git a/installcheck/Amanda_Device.pl b/installcheck/Amanda_Device.pl new file mode 100644 index 0000000..d4c8454 --- /dev/null +++ b/installcheck/Amanda_Device.pl @@ -0,0 +1,733 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 301; +use File::Path qw( mkpath rmtree ); +use Sys::Hostname; +use Carp; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Debug; +use Amanda::Device qw( :constants ); +use Amanda::Config qw( :getconf :init ); +use Amanda::Types; +use Amanda::Paths; +use Amanda::Tests; + +my $dev; +my $dev_name; +my ($vtape1, $vtape2); +my ($input_filename, $output_filename) = + ( "$AMANDA_TMPDIR/input.tmp", "$AMANDA_TMPDIR/output.tmp" ); +my $taperoot = "$AMANDA_TMPDIR/Amanda_Device_test_tapes"; +my $testconf; +my $queue_fd; + +# we'll need some vtapes.. +sub mkvtape { + my ($num) = @_; + + my $mytape = "$taperoot/$num"; + if (-d $mytape) { rmtree($mytape); } + mkpath("$mytape/data"); + return $mytape; +} + + +# make up a fake dumpfile_t to write with +my $dumpfile = Amanda::Types::dumpfile_t->new(); +$dumpfile->{type} = $Amanda::Types::F_DUMPFILE; +$dumpfile->{datestamp} = "20070102030405"; +$dumpfile->{dumplevel} = 0; +$dumpfile->{compressed} = 1; +$dumpfile->{name} = "localhost"; +$dumpfile->{disk} = "/home"; +$dumpfile->{program} = "INSTALLCHECK"; + +# function to set up a queue_fd for a filename +sub make_queue_fd { + my ($filename, $mode) = @_; + + open(my $fd, $mode, $filename) or die("Could not open $filename: $!"); + return $fd, Amanda::Device::queue_fd_t->new(fileno($fd)); +} + +my $write_file_count = 5; +sub write_file { + my ($seed, $length, $filenum) = @_; + + croak ("selected file size $length is *way* too big") + unless ($length < 1024*1024*10); + Amanda::Tests::write_random_file($seed, $length, $input_filename); + + ok($dev->start_file($dumpfile), + "start file $filenum") + or diag($dev->error_or_status()); + + is($dev->file(), $filenum, + "Device has correct filenum"); + + my ($input, $queue_fd) = make_queue_fd($input_filename, "<"); + ok($dev->write_from_fd($queue_fd), + "write some data") + or diag($dev->error_or_status()); + close($input) or die("Error closing $input_filename"); + + if(ok($dev->in_file(), + "still in_file")) { + ok($dev->finish_file(), + "finish_file") + or diag($dev->error_or_status()); + } else { + pass("not in file, so not calling finish_file"); + } +} + +my $verify_file_count = 5; +sub verify_file { + my ($seed, $length, $filenum) = @_; + + ok(my $read_dumpfile = $dev->seek_file($filenum), + "seek to file $filenum") + or diag($dev->error_or_status()); + is($dev->file(), $filenum, + "device is really at file $filenum"); + is($read_dumpfile->{name}, "localhost", + "header looks vaguely familiar") + or diag($dev->error_or_status()); + + my ($output, $queue_fd) = make_queue_fd($output_filename, ">"); + ok($dev->read_to_fd($queue_fd), + "read data from file $filenum") + or diag($dev->error_or_status()); + close($output) or die("Error closing $output_filename"); + + ok(Amanda::Tests::verify_random_file($seed, $length, $output_filename, 0), + "verified file contents"); +} + +# properties test + +my @common_properties = ( + 'appendable', + 'block_size', + 'canonical_name', + 'concurrency', + 'max_block_size', + 'medium_access_type', + 'min_block_size', + 'partial_deletion', + 'streaming', +); + +sub properties_include { + my ($got, $should_include, $msg) = @_; + my %got = map { $_->{'name'}, 1 } @$got; + my @missing = grep { !defined($got{$_}) } @$should_include; + if (@missing) { + fail($msg); + diag(" Expected properties: " . join(", ", @$should_include)); + diag(" Got properties: " . join(", ", @$got)); + diag(" Missing properties: " . join(", ", @missing)); + } else { + pass($msg); + } +} + +#### +## get stuff set up + +$testconf = Installcheck::Config->new(); +$testconf->write(); +config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF') == $CFGERR_OK + or die("Could not load configuration"); + +# put the debug messages somewhere +Amanda::Debug::dbopen("installcheck"); + +#### +## Test errors a little bit + +$dev = Amanda::Device->new("foobar:"); +isnt($dev->status(), $DEVICE_STATUS_SUCCESS, + "creation of a bogus 'foobar:' device fails"); + +$dev = Amanda::Device->new("rait:{{"); +isnt($dev->status(), $DEVICE_STATUS_SUCCESS, + "creation of a bogus 'rait:{{' device fails"); + +$dev = Amanda::Device->new("rait:{a,b"); +isnt($dev->status(), $DEVICE_STATUS_SUCCESS, + "creation of a bogus 'rait:{a,b' device fails"); + +#### +## first, test out the 'null' device. + +$dev_name = "null:"; + +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "create null device") + or diag $dev->error_or_status(); +ok($dev->start($ACCESS_WRITE, "NULL1", "19780615010203"), + "start null device in write mode") + or diag $dev->error_or_status(); + +# try properties +properties_include([ $dev->property_list() ], [ @common_properties ], + "necessary properties listed on null device"); +is($dev->property_get("canonical_name"), "null:", + "property_get(canonical_name) on null device"); +is($dev->property_get("caNONical-name"), "null:", + "property_get(caNONical-name) on null device (case, dash-insensitivity)"); +is_deeply([ $dev->property_get("canonical_name") ], + [ "null:", $PROPERTY_SURETY_GOOD, $PROPERTY_SOURCE_DEFAULT ], + "extended property_get returns correct surety/source"); +for my $prop ($dev->property_list()) { + next unless $prop->{'name'} eq 'canonical_name'; + is($prop->{'description'}, + "The most reliable device name to use to refer to this device.", + "property info for canonical name is correct"); +} + +# and write a file to it +write_file(0xabcde, 1024*256, 1); + +# (don't finish the device, testing the finalize method's cleanup) + +#### +## Now some full device tests + +## VFS device + +$vtape1 = mkvtape(1); +$dev_name = "file:$vtape1"; + +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: create successful") + or diag($dev->error_or_status()); + +properties_include([ $dev->property_list() ], + [ @common_properties, 'max_volume_usage' ], + "necessary properties listed on vfs device"); + +$dev->read_label(); +ok($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED, + "initially unlabeled") + or diag($dev->error_or_status()); + +ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), + "start in write mode") + or diag($dev->error_or_status()); + +ok(!($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED), + "not unlabeled anymore") + or diag($dev->error_or_status()); + +for (my $i = 1; $i <= 3; $i++) { + write_file(0x2FACE, $dev->block_size()*10+17, $i); +} + +ok($dev->finish(), + "finish device after write") + or diag($dev->error_or_status()); + +$dev->read_label(); +ok(!($dev->status()), + "no error, at all, from read_label") + or diag($dev->error_or_status()); + +# append one more copy, to test ACCESS_APPEND + +ok($dev->start($ACCESS_APPEND, undef, undef), + "start in append mode") + or diag($dev->error_or_status()); + +write_file(0xD0ED0E, $dev->block_size()*4, 4); + +ok($dev->finish(), + "finish device after append") + or diag($dev->error_or_status()); + +# try reading the third file back, creating a new device +# object first, and skipping the read-label step. + +$dev = undef; +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: re-create successful") + or diag($dev->error_or_status()); + +ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode") + or diag($dev->error_or_status()); + +verify_file(0x2FACE, $dev->block_size()*10+17, 3); + +ok($dev->finish(), + "finish device after read") + or diag($dev->error_or_status()); + +#### +## Test a RAIT device of two vfs devices. + +($vtape1, $vtape2) = (mkvtape(1), mkvtape(2)); +$dev_name = "rait:file:{$vtape1,$vtape2}"; + +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: create successful") + or diag($dev->error_or_status()); + +ok($dev->configure(1), "configure device"); + +properties_include([ $dev->property_list() ], [ @common_properties ], + "necessary properties listed on rait device"); + +is($dev->property_get("block_size"), 32768, # (RAIT default) + "rait device calculates a default block size correctly"); + +ok($dev->property_set("block_size", 32768*16), + "rait device accepts an explicit block size"); + +is($dev->property_get("block_size"), 32768*16, + "..and remembers it"); + +$dev->read_label(); +ok($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED, + "initially unlabeled") + or diag($dev->error_or_status()); + +ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), + "start in write mode") + or diag($dev->error_or_status()); + +ok(!($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED), + "not unlabeled anymore") + or diag($dev->error_or_status()); + +for (my $i = 1; $i <= 3; $i++) { + write_file(0x2FACE, $dev->block_size()*10+17, $i); +} + +ok($dev->finish(), + "finish device after write") + or diag($dev->error_or_status()); + +$dev->read_label(); +ok(!($dev->status()), + "no error, at all, from read_label") + or diag($dev->error_or_status()); + +# append one more copy, to test ACCESS_APPEND + +ok($dev->start($ACCESS_APPEND, undef, undef), + "start in append mode") + or diag($dev->error_or_status()); + +write_file(0xD0ED0E, $dev->block_size()*4, 4); + +ok($dev->finish(), + "finish device after append") + or diag($dev->error_or_status()); + +# try reading the third file back, creating a new device +# object first, and skipping the read-label step. + +$dev = undef; +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: re-create successful") + or diag($dev->error_or_status()); + +ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode") + or diag($dev->error_or_status()); + +verify_file(0x2FACE, $dev->block_size()*10+17, 3); + +ok($dev->finish(), + "finish device after read") + or diag($dev->error_or_status()); + +ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode after missing volume") + or diag($dev->error_or_status()); + +# corrupt the device somehow and hope it keeps working +rmtree("$taperoot/1"); + +verify_file(0x2FACE, $dev->block_size()*10+17, 3); +verify_file(0xD0ED0E, $dev->block_size()*4, 4); +verify_file(0x2FACE, $dev->block_size()*10+17, 2); + +ok($dev->finish(), + "finish device read after missing volume") + or diag($dev->error_or_status()); + +ok(!($dev->start($ACCESS_WRITE, "TESTCONF29", undef)), + "start in write mode fails with missing volume") + or diag($dev->error_or_status()); + +undef $dev; + +$dev_name = "rait:{MISSING,file:$vtape2}"; +$dev = Amanda::Device->new($dev_name); + +ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode with MISSING") + or diag($dev->error_or_status()); + +verify_file(0x2FACE, $dev->block_size()*10+17, 3); +verify_file(0xD0ED0E, $dev->block_size()*4, 4); +verify_file(0x2FACE, $dev->block_size()*10+17, 2); + +ok($dev->finish(), + "finish device read with MISSING") + or diag($dev->error_or_status()); + +ok(!($dev->start($ACCESS_WRITE, "TESTCONF29", undef)), + "start in write mode fails with MISSING") + or diag($dev->error_or_status()); + +undef $dev; + +# Make two devices with different labels, should get a +# message accordingly. +($vtape1, $vtape2) = (mkvtape(1), mkvtape(2)); + +my $n = 13; +for $dev_name ("file:$vtape1", "file:$vtape2") { + my $dev = Amanda::Device->new($dev_name); + is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: Open successful") + or diag($dev->error_or_status()); + ok($dev->start($ACCESS_WRITE, "TESTCONF$n", undef), + "wrote label 'TESTCONF$n'"); + ok($dev->finish(), "finished device"); + $n++; +} + +$dev_name = "rait:{file:$vtape1,file:$vtape2}"; +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: Open successful") + or diag($dev->error_or_status()); + +$dev->read_label(); +ok($dev->status() & $DEVICE_STATUS_VOLUME_ERROR, + "Label mismatch error handled correctly") + or diag($dev->error_or_status()); + +# Use some config to set a block size on a child device +($vtape1, $vtape2) = (mkvtape(1), mkvtape(2)); +$dev_name = "rait:{file:$vtape1,mytape2}"; + +$testconf = Installcheck::Config->new(); +$testconf->add_device("mytape2", [ + "tapedev" => "\"file:$vtape2\"", + "device_property" => "\"BLOCK_SIZE\" \"64k\"" +]); +$testconf->write(); +config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF') == $CFGERR_OK + or die("Could not load configuration"); + +$dev = Amanda::Device->new($dev_name); +is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: create successful") + or diag($dev->error_or_status()); + +ok($dev->configure(1), "configure device"); + +is($dev->property_get("block_size"), 65536, + "rait device calculates a block size from its children correctly"); + +# Test an S3 device if the proper environment variables are set +my $S3_SECRET_KEY = $ENV{'INSTALLCHECK_S3_SECRET_KEY'}; +my $S3_ACCESS_KEY = $ENV{'INSTALLCHECK_S3_ACCESS_KEY'}; +my $DEVPAY_SECRET_KEY = $ENV{'INSTALLCHECK_DEVPAY_SECRET_KEY'}; +my $DEVPAY_ACCESS_KEY = $ENV{'INSTALLCHECK_DEVPAY_ACCESS_KEY'}; +my $DEVPAY_USER_TOKEN = $ENV{'INSTALLCHECK_DEVPAY_USER_TOKEN'}; + +my $run_s3_tests = defined $S3_SECRET_KEY && defined $S3_ACCESS_KEY; +my $run_devpay_tests = defined $DEVPAY_SECRET_KEY && + defined $DEVPAY_ACCESS_KEY && $DEVPAY_USER_TOKEN; + +my $dev_base_name; +my $hostname = hostname(); + +my $s3_make_device_count = 6; +sub s3_make_device($) { + my $dev_name = shift @_; + $dev = Amanda::Device->new($dev_name); + is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: create successful") + or diag($dev->error_or_status()); + + my @s3_props = ( 's3_access_key', 's3_secret_key' ); + push @s3_props, 's3_user_token' if ($dev_name =~ /^s3zmanda:/); + properties_include([ $dev->property_list() ], [ @common_properties, @s3_props ], + "necessary properties listed on s3 device"); + + ok($dev->property_set('BLOCK_SIZE', 32768*2), + "set block size") + or diag($dev->error_or_status()); + + if ($dev_name =~ /^s3:/) { + # use regular S3 credentials + ok($dev->property_set('S3_ACCESS_KEY', $S3_ACCESS_KEY), + "set S3 access key") + or diag($dev->error_or_status()); + + ok($dev->property_set('S3_SECRET_KEY', $S3_SECRET_KEY), + "set S3 secret key") + or diag($dev->error_or_status()); + + pass("(placeholder)"); + } elsif ($dev_name =~ /^s3zmanda:/) { + # use s3zmanda credentials + ok($dev->property_set('S3_ACCESS_KEY', $DEVPAY_ACCESS_KEY), + "set s3zmanda access key") + or diag($dev->error_or_status()); + + ok($dev->property_set('S3_SECRET_KEY', $DEVPAY_SECRET_KEY), + "set s3zmanda secret key") + or diag($dev->error_or_status()); + + ok($dev->property_set('S3_USER_TOKEN', $DEVPAY_USER_TOKEN), + "set s3zmanda user token") + or diag($dev->error_or_status()); + } else { + croak("didn't recognize the device scheme, so no credentials were set"); + } + return $dev; +} + +my $s3_run_main_tests_count = 12 + + 4 * $write_file_count + + 1 * $verify_file_count + + 3 * $s3_make_device_count; +sub s3_run_main_tests($$) { + my ($dev_scheme, $base_name) = @_; + $dev_name = "$dev_scheme:$base_name-$dev_scheme"; + $dev = s3_make_device($dev_name); + $dev->read_label(); + my $status = $dev->status(); + # this test appears very liberal, but catches the case where setup_handle fails without + # giving false positives + ok(($status == $DEVICE_STATUS_SUCCESS) || (($status & $DEVICE_STATUS_VOLUME_UNLABELED) != 0), + "status is either OK or possibly unlabeled") + or diag($dev->error_or_status()); + + ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), + "start in write mode") + or diag($dev->error_or_status()); + + ok(!($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED), + "it's labeled now") + or diag($dev->error_or_status()); + + for (my $i = 1; $i <= 3; $i++) { + write_file(0x2FACE, $dev->block_size()*10, $i); + } + + ok($dev->finish(), + "finish device after write") + or diag($dev->error_or_status()); + + $dev->read_label(); + ok(!($dev->status()), + "no error, at all, from read_label") + or diag($dev->error_or_status()); + + # append one more copy, to test ACCESS_APPEND + + ok($dev->start($ACCESS_APPEND, undef, undef), + "start in append mode") + or diag($dev->error_or_status()); + + write_file(0xD0ED0E, $dev->block_size()*10, 4); + + ok($dev->finish(), + "finish device after append") + or diag($dev->error_or_status()); + + # try reading the third file back + + ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode") + or diag($dev->error_or_status()); + + verify_file(0x2FACE, $dev->block_size()*10, 3); + + ok($dev->finish(), + "finish device after read") + or diag($dev->error_or_status()); # (note: we don't use write_max_size here, as the maximum for S3 is very large) + + # try a constrained bucket + $dev_name = lc("$dev_scheme:$base_name-$dev_scheme-eu"); + $dev = s3_make_device($dev_name); + ok($dev->property_set('S3_BUCKET_LOCATION', 'EU'), + "set S3 bucket location") + or diag($dev->error_or_status()); + + $dev->read_label(); + $status = $dev->status(); + ok(($status == $DEVICE_STATUS_SUCCESS) || (($status & $DEVICE_STATUS_VOLUME_UNLABELED) != 0), + "status is either OK or possibly unlabeled") + or diag($dev->error_or_status()); + + # bucket name incompatible with location constraint + $dev_name = "$dev_scheme:-$base_name-$dev_scheme-eu"; + $dev = s3_make_device($dev_name); + + ok(!$dev->property_set('S3_BUCKET_LOCATION', 'EU'), + "should not be able to set S3 bucket location with an incompatible name") + or diag($dev->error_or_status()); +} + +SKIP: { + skip "define \$INSTALLCHECK_S3_{SECRET,ACCESS}_KEY to run S3 tests", + 1 + $s3_run_main_tests_count + $s3_make_device_count + unless $run_s3_tests; + + # XXX for best results, the bucket should already exist (Amazon doesn't create + # buckets quickly enough to pass subsequent tests), but should be empty (so that + # the device appears unlabeled) + $dev_base_name = "$S3_ACCESS_KEY-installcheck-$hostname"; + + s3_run_main_tests('s3', $dev_base_name); + + # can't set user token without devpay + $dev_name = "s3:$dev_base_name"; + $dev = s3_make_device($dev_name); + ok(!$dev->property_set('S3_USER_TOKEN', '123'), + "set user token, but that shouldn't be possible (not using DevPay)") + or diag($dev->error_or_status()); + +} + +SKIP: { + # in this case, most of our code has already been exercised + # just make sure that authentication works as a basic sanity check + skip "skipping abbreviated s3zmanda tests", $s3_make_device_count + 1 + unless ($run_s3_tests and $run_devpay_tests); + $dev_name = "s3zmanda:$dev_base_name"; + $dev = s3_make_device($dev_name); + $dev->read_label(); + my $status = $dev->status(); + # this test appears very liberal, but catches the case where setup_handle fails without + # giving false positives + ok(($status == 0) || (($status & $DEVICE_STATUS_VOLUME_UNLABELED) != 0), + "status is either OK or possibly unlabeled") + or diag($dev->error_or_status()); +} + +SKIP: { + # if we're running devpay tests and not S3 tests, then we do the whole suite with devpay + skip "define \$INSTALLCHECK_DEVPAY_{SECRET_KEY,ACCESS_KEY,USER_TOKEN} to run full s3zmanda tests", $s3_run_main_tests_count + unless (!$run_s3_tests and $run_devpay_tests); + s3_run_main_tests('s3zmanda', $dev_base_name); +} + +# Test a tape device if the proper environment variables are set +my $TAPE_DEVICE = $ENV{'INSTALLCHECK_TAPE_DEVICE'}; +my $run_tape_tests = defined $TAPE_DEVICE; +SKIP: { + skip "define \$INSTALLCHECK_TAPE_DEVICE to run tape tests", 37 + unless $run_tape_tests; + + $dev_name = "tape:$TAPE_DEVICE"; + $dev = Amanda::Device->new($dev_name); + is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: create successful") + or diag($dev->error_or_status()); + + my $status = $dev->read_label(); + ok(($status == $DEVICE_STATUS_SUCCESS) || (($status & $DEVICE_STATUS_VOLUME_UNLABELED) != 0), + "status is either OK or possibly unlabeled") + or diag($dev->error_or_status()); + + ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), + "start in write mode") + or diag($dev->error_or_status()); + + ok(!($dev->status() & $DEVICE_STATUS_VOLUME_UNLABELED), + "not unlabeled anymore") + or diag($dev->error_or_status()); + + for (my $i = 1; $i <= 3; $i++) { + write_file(0x2FACE, $dev->block_size()*10+17, $i); + } + + ok($dev->finish(), + "finish device after write") + or diag($dev->error_or_status()); + + $dev->read_label(); + ok(!($dev->status()), + "no error, at all, from read_label") + or diag($dev->error_or_status()); + + is($dev->volume_label(), "TESTCONF13", + "read_label reads the correct label") + or diag($dev->error_or_status()); + + # append one more copy, to test ACCESS_APPEND + + SKIP: { + skip "APPEND not supported", $write_file_count + 2 + unless $dev->property_get("APPENDABLE"); + ok($dev->start($ACCESS_APPEND, undef, undef), + "start in append mode") + or diag($dev->error_or_status()); + + write_file(0xD0ED0E, $dev->block_size()*4, 4); + + ok($dev->finish(), + "finish device after append") + or diag($dev->error_or_status()); + } + + # try reading the third file back, creating a new device + # object first, and skipping the read-label step. + + $dev = undef; + $dev = Amanda::Device->new($dev_name); + is($dev->status(), $DEVICE_STATUS_SUCCESS, + "$dev_name: re-create successful") + or diag($dev->error_or_status()); + + ok($dev->start($ACCESS_READ, undef, undef), + "start in read mode") + or diag($dev->error_or_status()); + + verify_file(0x2FACE, $dev->block_size()*10+17, 3); + + ok($dev->finish(), + "finish device after read") + or diag($dev->error_or_status()); + +} + +unlink($input_filename); +unlink($output_filename); +rmtree($taperoot); diff --git a/installcheck/Amanda_Logfile.pl b/installcheck/Amanda_Logfile.pl index b6c6acd..3460b56 100644 --- a/installcheck/Amanda_Logfile.pl +++ b/installcheck/Amanda_Logfile.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,34 +13,40 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw(no_plan); +use Test::More tests => 30; use File::Path; -use Amconfig; use strict; use lib "@amperldir@"; +use Installcheck::Config; use Amanda::Paths; -use Amanda::Tapefile; +use Amanda::Tapelist; +use Amanda::Cmdline; use Amanda::Logfile qw(:logtype_t :program_t open_logfile get_logline close_logfile); use Amanda::Config qw( :init :getconf config_dir_relative ); +my $log_filename = "$AMANDA_TMPDIR/Amanda_Logfile_test.log"; + # write a logfile and return the filename sub write_logfile { my ($contents) = @_; - my $filename = "$AMANDA_TMPDIR/Amanda_Logfile_test.log"; if (!-e $AMANDA_TMPDIR) { mkpath($AMANDA_TMPDIR); } - open my $logfile, ">", $filename or die("Could not create temporary log file"); + open my $logfile, ">", $log_filename or die("Could not create temporary log file '$log_filename': $!"); print $logfile $contents; close $logfile; - return $filename; + return $log_filename; +} + +sub unlink_logfile { + unlink($log_filename); } #### @@ -142,31 +148,35 @@ sub res2arr { $res->{'timestamp'}, $res->{'hostname'}, $res->{'diskname'}, - $res->{'level'}, + "$res->{'level'}", $res->{'label'}, - $res->{'filenum'}, + "$res->{'filenum'}", $res->{'status'}, $res->{'partnum'} ]; } # set up a basic config -my $testconf = Amconfig->new(); +my $testconf = Installcheck::Config->new(); $testconf->add_param("tapecycle", "20"); $testconf->write(); # load the config -ok(config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"), "config_init is OK"); +config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF") == $CFGERR_OK + or die("Could not load config"); my $tapelist = config_dir_relative("tapelist"); -# set up and read the tapelist +# set up and read the tapelist (we don't use Amanda::Tapelist to write this, +# in case it's broken) open my $tlf, ">", $tapelist or die("Could not write tapelist"); -print $tlf "20071111010002 TESTCONF004 reuse\n"; -print $tlf "20071110010002 TESTCONF003 reuse\n"; +print $tlf "20071111010002 TESTCONF006 reuse\n"; +print $tlf "20071110010002 TESTCONF005 reuse\n"; +print $tlf "20071109010002 TESTCONF004 reuse\n"; +print $tlf "20071109010002 TESTCONF003 reuse\n"; print $tlf "20071109010002 TESTCONF002 reuse\n"; print $tlf "20071108010001 TESTCONF001 reuse\n"; close $tlf; -Amanda::Tapefile::read_tapelist($tapelist) == 0 or die("Could not read tapelist"); +Amanda::Tapelist::read_tapelist($tapelist); # set up a number of logfiles in logdir. my $logf; @@ -205,20 +215,28 @@ PART taper TESTCONF002 8 clihost /home 20071109010002 5/5 0 [multi-part dump] DONE taper clihost /home 20071109010002 5 0 [multi-part dump] PART taper TESTCONF002 9 thatbox /u_lose 20071109010002 1/4 2 [multi-part failure] PART taper TESTCONF002 10 thatbox /u_lose 20071109010002 2/4 2 [multi-part failure] -PART taper TESTCONF002 11 thatbox /u_lose 20071109010002 3/4 2 [multi-part failure] +PARTPARTIAL taper TESTCONF002 11 thatbox /u_lose 20071109010002 3/4 2 [multi-part retry] +START taper datestamp 20071109010002 label TESTCONF003 tape 1 +PART taper TESTCONF003 1 thatbox /u_lose 20071109010002 3/4 2 [multi-part failure] FAIL taper thatbox /u_lose 20071109010002 2 "Oh no!" -DONE taper thatbox /u_lose 20071109010002 4 2 [multi-part failure] +PART taper TESTCONF003 2 thatbox /u_win 20071109010002 1/4 3 [multi-part retry] +PART taper TESTCONF003 3 thatbox /u_win 20071109010002 2/4 3 [multi-part retry] +PARTPARTIAL taper TESTCONF003 4 thatbox /u_win 20071109010002 3/4 3 [multi-part retry] +START taper datestamp 20071109010002 label TESTCONF004 tape 1 +PART taper TESTCONF004 1 thatbox /u_win 20071109010002 3/4 3 [multi-part retry] +PART taper TESTCONF004 2 thatbox /u_win 20071109010002 4/4 3 [multi-part retry] +DONE taper thatbox /u_win 20071109010002 4 3 [multi-part retry] EOF close $logf; # "old-style amflush log" open $logf, ">", "$logdir/log.20071110010002.amflush" or die("Could not write logfile"); -print $logf "START taper datestamp 20071110010002 label TESTCONF003 tape 1\n"; +print $logf "START taper datestamp 20071110010002 label TESTCONF005 tape 1\n"; close $logf; # "old-style main log" open $logf, ">", "$logdir/log.20071111010002" or die("Could not write logfile"); -print $logf "START taper datestamp 20071111010002 label TESTCONF004 tape 1\n"; +print $logf "START taper datestamp 20071111010002 label TESTCONF006 tape 1\n"; close $logf; is_deeply([ Amanda::Logfile::find_log() ], @@ -227,20 +245,31 @@ is_deeply([ Amanda::Logfile::find_log() ], "find_log returns correct logfiles in the correct order"); my @results; +my @results2; +my @results3; +my @results4; my @results_arr; -@results = Amanda::Logfile::search_logfile("TESTCONF002", "20071109010002", +@results2 = Amanda::Logfile::search_logfile("TESTCONF002", "20071109010002", + "$logdir/log.20071109010002.0", 1); +@results3 = Amanda::Logfile::search_logfile("TESTCONF003", "20071109010002", "$logdir/log.20071109010002.0", 1); -is($#results+1, 11, "search_logfile returned 11 results"); +@results4 = Amanda::Logfile::search_logfile("TESTCONF004", "20071109010002", + "$logdir/log.20071109010002.0", 1); +@results = (); +push @results, @results2, @results3, @results4; +is($#results+1, 17, "search_logfile returned 15 results"); # sort by filenum so we can compare each to what it should be -@results = sort { $a->{'filenum'} <=> $b->{'filenum'} } @results; +@results = sort { $a->{'label'} cmp $b->{'label'} || + $a->{'filenum'} <=> $b->{'filenum'} } @results; # and convert the hashes to arrays for easy comparison @results_arr = map { res2arr($_) } @results; is_deeply(\@results_arr, - [ [ '20071109010002', 'clihost', '/usr', 0, 'TESTCONF002', 1, 'OK', '1' ], + [ + [ '20071109010002', 'clihost', '/usr', 0, 'TESTCONF002', 1, 'OK', '1' ], [ '20071109010002', 'clihost', '/my documents', 0, 'TESTCONF002', 2, 'OK', '1' ], [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 4, 'OK', '1/5' ], @@ -248,35 +277,97 @@ is_deeply(\@results_arr, [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 6, 'OK', '3/5' ], [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 7, 'OK', '4/5' ], [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 8, 'OK', '5/5' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 9, '"Oh no!"', '1/4' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 10, '"Oh no!"', '2/4' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 11, '"Oh no!"', '3/4' ] ], - "results are correct"); + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 9, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 10, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 11, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF003', 1, '"Oh no!"', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 2, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 3, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 4, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 1, 'OK', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 2, 'OK', '4/4' ], + ], "results are correct"); my @filtered; my @filtered_arr; @filtered = Amanda::Logfile::dumps_match([@results], "thatbox", undef, undef, undef, 0); -is($#filtered+1, 4, "four results match 'thatbox'"); -@filtered = sort { $a->{'filenum'} <=> $b->{'filenum'} } @filtered; +is($#filtered+1, 10, "ten results match 'thatbox'"); +@filtered = sort { $a->{'label'} cmp $b->{'label'} || + $a->{'filenum'} <=> $b->{'filenum'} } @filtered; @filtered_arr = map { res2arr($_) } @filtered; is_deeply(\@filtered_arr, - [ [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 9, '"Oh no!"', '1/4' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 10, '"Oh no!"', '2/4' ], - [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 11, '"Oh no!"', '3/4' ] ], - "results are correct"); + [ + [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 9, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 10, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 11, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF003', 1, '"Oh no!"', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 2, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 3, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 4, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 1, 'OK', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 2, 'OK', '4/4' ], + ], "results are correct"); @filtered = Amanda::Logfile::dumps_match([@results], "thatbox", "/var", undef, undef, 0); is($#filtered+1, 1, "only one result matches 'thatbox:/var'"); @filtered = Amanda::Logfile::dumps_match([@results], undef, undef, "20071109010002", undef, 0); -is($#filtered+1, 11, "all 11 results match '20071109010002'"); +is($#filtered+1, 17, "all 17 results match '20071109010002'"); @filtered = Amanda::Logfile::dumps_match([@results], undef, undef, "20071109010002", undef, 1); -is($#filtered+1, 8, "of those, 8 results are 'OK'"); +is($#filtered+1, 14, "of those, 14 results are 'OK'"); @filtered = Amanda::Logfile::dumps_match([@results], undef, undef, undef, "2", 0); -is($#filtered+1, 3, "3 results are at level 2"); +is($#filtered+1, 4, "4 results are at level 2"); + +# test dumps_match_dumpspecs + +my @dumpspecs; + +@dumpspecs = Amanda::Cmdline::parse_dumpspecs(["thatbox", "/var"], 0); +@filtered = Amanda::Logfile::dumps_match_dumpspecs([@results], [@dumpspecs], 0); +is_deeply([ map { res2arr($_) } @filtered ], + [ + [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], + ], "filter with dumpspecs 'thatbox /var'"); + +@dumpspecs = Amanda::Cmdline::parse_dumpspecs(["thatbox", "/var", "clihost"], 0); +@filtered = Amanda::Logfile::dumps_match_dumpspecs([@results], [@dumpspecs], 0); +@filtered = sort { $a->{'label'} cmp $b->{'label'} || + $a->{'filenum'} <=> $b->{'filenum'} } @filtered; +is_deeply([ map { res2arr($_) } @filtered ], + [ + [ '20071109010002', 'clihost', '/usr', 0, 'TESTCONF002', 1, 'OK', '1' ], + [ '20071109010002', 'clihost', '/my documents', 0, 'TESTCONF002', 2, 'OK', '1' ], + [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], + [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 4, 'OK', '1/5' ], + [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 5, 'OK', '2/5' ], + [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 6, 'OK', '3/5' ], + [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 7, 'OK', '4/5' ], + [ '20071109010002', 'clihost', '/home', 0, 'TESTCONF002', 8, 'OK', '5/5' ], + ], "filter with dumpspecs 'thatbox /var clihost' (union of two disjoint sets)"); + +# if multiple dumpspecs specify the same dump, it will be included in the output multiple times +@dumpspecs = Amanda::Cmdline::parse_dumpspecs([".*", "/var", "thatbox"], 0); +@filtered = Amanda::Logfile::dumps_match_dumpspecs([@results], [@dumpspecs], 0); +@filtered = sort { $a->{'label'} cmp $b->{'label'} || + $a->{'filenum'} <=> $b->{'filenum'} } @filtered; +is_deeply([ map { res2arr($_) } @filtered ], + [ + [ '20071109010002', 'thatbox', '/var', 1, 'TESTCONF002', 3, 'OK', '--' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 9, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 10, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF002', 11, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_lose', 2, 'TESTCONF003', 1, '"Oh no!"', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 2, 'OK', '1/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 3, 'OK', '2/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF003', 4, 'PARTIAL', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 1, 'OK', '3/4' ], + [ '20071109010002', 'thatbox', '/u_win', 3, 'TESTCONF004', 2, 'OK', '4/4' ], + ], "filter with dumpspecs '.* /var thatbox' (union of two overlapping sets includes dupes)"); + +unlink_logfile(); diff --git a/installcheck/Amanda_MainLoop.pl b/installcheck/Amanda_MainLoop.pl new file mode 100644 index 0000000..c85e980 --- /dev/null +++ b/installcheck/Amanda_MainLoop.pl @@ -0,0 +1,395 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 17; +use strict; +use warnings; +use POSIX qw(WIFEXITED WEXITSTATUS EINTR); + +use lib "@amperldir@"; +use Amanda::MainLoop qw( :GIOCondition ); + +{ + my $global = 0; + + my $to = Amanda::MainLoop::timeout_source(200); + $to->set_callback(sub { + # ignore $src argument + if (++$global >= 3) { + $to->remove(); + Amanda::MainLoop::quit(); + } + }); + + Amanda::MainLoop::run(); + is($global, 3, "Timeout source works, calls back repeatedly (using a closure)"); +} + +{ + my $global = 0; + + my $to = Amanda::MainLoop::timeout_source(200); + $to->set_callback(sub { + my ($src) = @_; + if (++$global >= 3) { + $src->remove(); + Amanda::MainLoop::quit(); + } + }); + $to = undef; # remove the lexical reference to the source + + Amanda::MainLoop::run(); + is($global, 3, "Timeout source works, calls back repeatedly (no external reference to the source)"); +} + +{ + my $global = 0; + + my $id = Amanda::MainLoop::idle_source(5); + $id->set_callback(sub { + my ($src) = @_; + if (++$global >= 30) { + $src->remove(); + Amanda::MainLoop::quit(); + } + }); + + Amanda::MainLoop::run(); + is($global, 30, "Idle source works, calls back repeatedly"); + $id->remove(); +} + +{ + my $global = 0; + + # to1 is removed before it runs, so it should never + # execute its callback + my $to1 = Amanda::MainLoop::timeout_source(10); + $to1->set_callback(sub { ++$global; }); + $to1->remove(); + + my $to2 = Amanda::MainLoop::timeout_source(300); + $to2->set_callback(sub { Amanda::MainLoop::quit(); }); + + Amanda::MainLoop::run(); + is($global, 0, "A remove()d source doesn't call back"); + + $to2->remove(); +} + +{ + my $global = 0; + + my $pid = fork(); + if ($pid == 0) { + ## child + sleep(1); + exit(9); + } + + ## parent + + my $cw = Amanda::MainLoop::child_watch_source($pid); + $cw->set_callback(sub { + my ($src, $got_pid, $got_status) = @_; + Amanda::MainLoop::quit(); + $src->remove(); + + if ($got_pid != $pid) { + diag("Got pid $got_pid, but expected $pid"); + return; + } + if (!WIFEXITED($got_status)) { + diag("Didn't get an 'exited' status"); + return; + } + if (WEXITSTATUS($got_status) != 9) { + diag("Didn't get exit status 9"); + return; + } + $global = 1; + }); + + my $to = Amanda::MainLoop::timeout_source(3000); + $to->set_callback(sub { + my ($src) = @_; + $global = 7; + + $src->remove(); + Amanda::MainLoop::quit(); + }); + + Amanda::MainLoop::run(); + is($global, 1, "Child watch detects a dead child"); + + $cw->remove(); + $to->remove(); +} + +{ + my $global = 0; + + my $pid = fork(); + if ($pid == 0) { + ## child + exit(11); + } + + ## parent + + sleep(1); + my $cw = Amanda::MainLoop::child_watch_source($pid); + $cw->set_callback(sub { + my ($src, $got_pid, $got_status) = @_; + Amanda::MainLoop::quit(); + $src->remove(); + + if ($got_pid != $pid) { + diag("Got pid $got_pid, but expected $pid"); + return; + } + if (!WIFEXITED($got_status)) { + diag("Didn't get an 'exited' status"); + return; + } + if (WEXITSTATUS($got_status) != 11) { + diag("Didn't get exit status 11"); + return; + } + $global = 1; + }); + + my $to = Amanda::MainLoop::timeout_source(3000); + $to->set_callback(sub { $global = 7; Amanda::MainLoop::quit(); }); + + Amanda::MainLoop::run(); + is($global, 1, "Child watch detects a dead child that dies before the callback is set"); + + $cw->remove(); + $to->remove(); +} + +{ + my $global = 0; + my ($readinfd, $writeinfd) = POSIX::pipe(); + my ($readoutfd, $writeoutfd) = POSIX::pipe(); + + my $pid = fork(); + if ($pid == 0) { + ## child + + my $data; + + POSIX::close($readinfd); + POSIX::close($writeoutfd); + + # the read()s here are to synchronize with our parent; the + # results are ignored. + POSIX::read($readoutfd, $data, 1024); + POSIX::write($writeinfd, "HELLO\n", 6); + POSIX::read($readoutfd, $data, 1024); + POSIX::write($writeinfd, "WORLD\n", 6); + POSIX::read($readoutfd, $data, 1024); + exit(33); + } + + ## parent + + POSIX::close($writeinfd); + POSIX::close($readoutfd); + + my @events; + + my $to = Amanda::MainLoop::timeout_source(200); + my $times = 3; + $to->set_callback(sub { + push @events, "time"; + POSIX::write($writeoutfd, "A", 1); # wake up the child + if (--$times == 0) { + $to->remove(); + } + }); + + my $cw = Amanda::MainLoop::child_watch_source($pid); + $cw->set_callback(sub { + my ($src, $got_pid, $got_status) = @_; + $cw->remove(); + Amanda::MainLoop::quit(); + + push @events, "died"; + }); + + my $fd = Amanda::MainLoop::fd_source($readinfd, $G_IO_IN | $G_IO_HUP); + $fd->set_callback(sub { + my $str; + if (POSIX::read($readinfd, $str, 1024) == 0) { + # EOF + POSIX::close($readinfd); + POSIX::close($writeoutfd); + $fd->remove(); + return; + } + chomp $str; + push @events, "read $str"; + }); + + Amanda::MainLoop::run(); + $to->remove(); + $cw->remove(); + $fd->remove(); + + is_deeply([ @events ], + [ "time", "read HELLO", "time", "read WORLD", "time", "died" ], + "fd source works for reading from a file descriptor"); +} + +# see if a "looping" callback with some closure values works. This test teased +# out some memory corruption bugs once upon a time. + +{ + my $completed = 0; + sub loop { + my ($finished_cb) = @_; + my $time = 700; + my $to; + + my $cb; + $cb = sub { + $time -= 300; + $to->remove(); + if ($time <= 0) { + $finished_cb->(); + } else { + $to = Amanda::MainLoop::timeout_source($time); + $to->set_callback($cb); + } + }; + $to = Amanda::MainLoop::timeout_source($time); + $to->set_callback($cb); + }; + loop(sub { + $completed = 1; + Amanda::MainLoop::quit(); + }); + Amanda::MainLoop::run(); + is($completed, 1, "looping construct terminates with a callback"); +} + +# Make sure that a die() in a callback correctly kills the process. Such +# a die() skips the usual Perl handling, so an eval { } won't do -- we have +# to fork a child. +{ + my $global = 0; + my ($readfd, $writefd) = POSIX::pipe(); + + my $pid = fork(); + if ($pid == 0) { + ## child + + my $data; + + # fix up the file descriptors to hook fd 2 (stderr) to + # the pipe + POSIX::close($readfd); + POSIX::dup2($writefd, 2); + POSIX::close($writefd); + + # and now die in a callback, using an eval {} in case the + # exception propagates out of the MainLoop run() + my $src = Amanda::MainLoop::timeout_source(10); + $src->set_callback(sub { die("Oh, the humanity"); }); + eval { Amanda::MainLoop::run(); }; + exit(33); + } + + ## parent + + POSIX::close($writefd); + + # read from the child and wait for it to die. There's no + # need to use MainLoop here. + my $str; + while (!defined(POSIX::read($readfd, $str, 1024))) { + # we may be interrupted by a SIGCHLD; keep going + next if ($! == EINTR); + die ("POSIX::read failed: $!"); + } + POSIX::close($readfd); + waitpid($pid, 0); + + ok($? != 33 && $? != 0, "die() in a callback exits with an error condition"); + like($str, qr/Oh, the humanity/, "..and displays die message on stderr"); +} + +# test misc. management of sources. Ideally it won't crash :) + +my $src = Amanda::MainLoop::idle_source(1); +$src->set_callback(sub { 1; }); +$src->set_callback(sub { 1; }); +$src->set_callback(sub { 1; }); +pass("Can call set_callback a few times on the same source"); + +$src->remove(); +$src->remove(); +pass("Calling remove twice is ok"); + +{ + my ($cb1, $cb2); + my $gothere = 0; + + $cb1 = sub { + my ($a, $b) = @_; + ok(Amanda::MainLoop::is_running(), + "call_later waits until mainloop runs"); + is($a+$b, 10, + "call_later passes arguments correctly"); + Amanda::MainLoop::call_later($cb2); + Amanda::MainLoop::quit(); + }; + + $cb2 = sub { + $gothere = 1; + }; + + ok(!Amanda::MainLoop::is_running(), "main loop is correctly recognized as not running"); + Amanda::MainLoop::call_later($cb1, 7, 3); + Amanda::MainLoop::run(); + ok($gothere, "call_later while already running calls immediately"); + + my @actions = (); + + $cb1 = sub { + push @actions, "cb1 start"; + Amanda::MainLoop::call_later($cb2, "hello"); + push @actions, "cb1 end"; + }; + + $cb2 = sub { + my ($greeting) = @_; + + push @actions, "cb2 start $greeting"; + Amanda::MainLoop::quit(); + push @actions, "cb2 end"; + }; + + Amanda::MainLoop::call_later($cb1); + Amanda::MainLoop::run(); + is_deeply([ @actions ], + [ "cb1 start", "cb1 end", "cb2 start hello", "cb2 end" ], + "call_later doesn't call its argument immediately"); +} diff --git a/installcheck/Amanda_Process.pl b/installcheck/Amanda_Process.pl new file mode 100644 index 0000000..7895509 --- /dev/null +++ b/installcheck/Amanda_Process.pl @@ -0,0 +1,142 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 11; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Paths; +use Amanda::Debug; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Process; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +my $Amanda_process = Amanda::Process->new(0); + +$Amanda_process->load_ps_table(); + +like($Amanda_process->{pstable}->{$$}, qr/perl/, + "installcheck is a perl program"); +is($Amanda_process->{ppid}->{$$}, getppid, + "load_ps_table get correct ppid for installcheck"); + +#override works done by load_ps_table, override pstable +$Amanda_process->{pstable} = { + 1 => "init", + 1001 => "bash", + 30072 => "amdump", + 30093 => "driver", + 30099 => "taper", + 30100 => "dumper", + 30101 => "dumper", + 30102 => "foobar", + 30103 => "dumper", + 30104 => "dumper", + 30527 => "chunker", + 30538 => "gzip", + 30539 => "gzip", +}; + +#override works done by load_ps_table, override ppid +$Amanda_process->{ppid} = { + 1 => 1, + 1001 => 1, + 30072 => 1001, + 30093 => 30072, + 30099 => 30093, + 30100 => 30093, + 30101 => 30093, + 30102 => 1, + 30103 => 30093, + 30104 => 30093, + 30527 => 30093, + 30538 => 30100, + 30539 => 30100, +}; + +#create a log file +my $log_filename = "$AMANDA_TMPDIR/Amanda_Logfile_test.log"; +open my $logfile, ">", $log_filename or die("Could not create temporary log file '$log_filename': $!"); +print $logfile <scan_log($log_filename); +is_deeply($Amanda_process->{pids}, + {30072 => "amdump", + 30093 => "driver", + 30099 => "taper", + 30100 => "dumper", + 30101 => "dumper", + 30103 => "dumper", + 30104 => "dumper", + 30527 => "chunker"}, + "scan_log works"); +is($Amanda_process->{master_pname}, "amdump", + "master_name is set to 'amdump'"); +is($Amanda_process->{master_pid}, "30072", + "master_pid is set to '30072'"); + +$Amanda_process->add_child(); +is_deeply($Amanda_process->{amprocess}, + {30072 => 30072, + 30093 => 30093, + 30099 => 30099, + 30100 => 30100, + 30101 => 30101, + 30103 => 30103, + 30104 => 30104, + 30527 => 30527, + 30538 => 30538, + 30539 => 30539}, + "add_child add the 2 gzip process"); + +is($Amanda_process->process_alive(30100, "dumper"), 1, + "process_alive return if pname match"); +is($Amanda_process->process_alive(30100, "driver"), '', + "process_alive return '' if pname doesn't match"); +is($Amanda_process->process_alive(30100), 1, + "process_alive return 1 without pname for amanda process"); +is($Amanda_process->process_alive(30102), 1, + "process_alive return 1 without pname for any process"); +is($Amanda_process->process_alive(30105), '', + "process_alive return '' if the process is dead"); diff --git a/installcheck/Amanda_Tapelist.pl b/installcheck/Amanda_Tapelist.pl new file mode 100644 index 0000000..89bf270 --- /dev/null +++ b/installcheck/Amanda_Tapelist.pl @@ -0,0 +1,165 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 18; +use strict; + +use lib "@amperldir@"; +use Installcheck::Config; +use Amanda::Tapelist; +use Amanda::Config qw( :init :getconf config_dir_relative ); + +my $tl; +my $tl_ok; +my $line; +my @lines; + +# First try reading a tapelist + +my $testconf = Installcheck::Config->new(); +$testconf->write(); + +config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF") == $CFGERR_OK + or die("config_init failed"); +my $tapelist = config_dir_relative("tapelist"); + +sub mktapelist { + my ($filename, @lines) = @_; + open(my $fh, ">", $filename) or die("Could not make tapelist '$filename'"); + for my $line (@lines) { + print $fh $line; + } + close($fh); +} + +sub readtapelist { + my ($filename) = @_; + open(my $fh, "<", $filename) or die("Could not read tapelist '$filename'"); + my @reread_lines = <$fh>; + close($fh); + return @reread_lines; +} + +@lines = ( + "20071111010002 TESTCONF004 reuse\n", + "20071110010002 TESTCONF003 reuse\n", + "20071109010002 TESTCONF002 reuse #comment 2\n", + "20071108010001 TESTCONF001 no-reuse #comment 1\n", +); +mktapelist($tapelist, @lines); + +$tl = Amanda::Tapelist::read_tapelist($tapelist); +$tl_ok = is_deeply($tl, [ + { 'datestamp' => '20071111010002', 'label' => 'TESTCONF004', + 'reuse' => 1, 'position' => 1, 'comment' => undef }, + { 'datestamp' => '20071110010002', 'label' => 'TESTCONF003', + 'reuse' => 1, 'position' => 2, 'comment' => undef }, + { 'datestamp' => '20071109010002', 'label' => 'TESTCONF002', + 'reuse' => 1, 'position' => 3, 'comment' => 'comment 2' }, + { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001', + 'reuse' => '', 'position' => 4, 'comment' => 'comment 1' }, +], "A simple tapelist is parsed correctly"); + +SKIP: { + skip "Tapelist is parsed incorrectly, so these tests are unlikely to work", 15, + unless $tl_ok; + + # now try writing it out and check that the results are the same + $tl->write("$tapelist-new"); + my @reread_lines = readtapelist("$tapelist-new"); + is_deeply(\@reread_lines, \@lines, "Lines of freshly written tapelist match the original"); + + is_deeply($tl->lookup_tapelabel('TESTCONF002'), + { 'datestamp' => '20071109010002', 'label' => 'TESTCONF002', + 'reuse' => 1, 'position' => 3, 'comment' => 'comment 2' }, + "lookup_tapelabel works"); + + is_deeply($tl->lookup_tapelabel('TESTCONF009'), undef, + "lookup_tapelabel returns undef on an unknown label"); + + is_deeply($tl->lookup_tapepos(4), + { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001', + 'reuse' => '', 'position' => 4, 'comment' => 'comment 1' }, + "lookup_tapepos works"); + + is_deeply($tl->lookup_tapepos(9), undef, + "lookup_tapepos returns undef on an unknown position"); + + is_deeply($tl->lookup_tapedate('20071110010002'), + { 'datestamp' => '20071110010002', 'label' => 'TESTCONF003', + 'reuse' => 1, 'position' => 2, 'comment' => undef }, + "lookup_tapedate works"); + + is_deeply($tl->lookup_tapedate('12345678'), undef, + "lookup_tapedate returns undef on an unknown datestamp"); + + # try some edits + $tl->add_tapelabel("20080112010203", "TESTCONF007", "seven"); + is(scalar @$tl, 5, "add_tapelabel adds a new element to the tapelist"); + + is_deeply($tl->lookup_tapepos(5), + { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007', + 'reuse' => 1, 'position' => 5, 'comment' => 'seven' }, + ".. lookup_tapepos finds it"); + + is_deeply($tl->lookup_tapelabel("TESTCONF007"), + { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007', + 'reuse' => 1, 'position' => 5, 'comment' => 'seven' }, + ".. lookup_tapelabel finds it"); + + is_deeply($tl->lookup_tapedate("20080112010203"), + { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007', + 'reuse' => 1, 'position' => 5, 'comment' => 'seven' }, + ".. lookup_tapedate finds it"); + + $tl->remove_tapelabel("TESTCONF002"); + is(scalar @$tl, 4, "remove_tapelabel removes an element from the tapelist"); + + is_deeply($tl->lookup_tapepos(4), # used to be in position 5 + { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007', + 'reuse' => 1, 'position' => 4, 'comment' => 'seven' }, + ".. tape positions are adjusted correctly"); + + is_deeply($tl->lookup_tapelabel("TESTCONF002"), undef, + ".. lookup_tapelabel no longer finds it"); + + is_deeply($tl->lookup_tapedate("20071109010002"), undef, + ".. lookup_tapedate no longer finds it"); + +} + +# try parsing various invalid lines +@lines = ( + "2006123456 FOO reuse\n", # valid + "TESTCONF003 290385098 reuse\n", # invalid + "20071109010002 TESTCONF002 re-use\n", # invalid + "20071108010001 TESTCONF001\n", # invalid + "20071108010001 TESTCONF001 #comment\n", # invalid + "#comment\n", # invalid +); +mktapelist($tapelist, @lines); + +$tl = Amanda::Tapelist::read_tapelist($tapelist); +is_deeply($tl, [ + { 'datestamp' => '2006123456', 'label' => 'FOO', + 'reuse' => 1, 'position' => 1, 'comment' => undef }, +], "Invalid lines are ignored"); + +# make sure clear_tapelist is empty +$tl = Amanda::Tapelist::clear_tapelist(); +is_deeply($tl, [ ], "clear_tapelist returns an empty tapelist"); diff --git a/installcheck/Amanda_Types.pl b/installcheck/Amanda_Types.pl index a301f80..59308ee 100644 --- a/installcheck/Amanda_Types.pl +++ b/installcheck/Amanda_Types.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,11 +13,10 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw(no_plan); -use Amconfig; +use Test::More tests => 4; use strict; use lib "@amperldir@"; diff --git a/installcheck/Amanda_Util.pl b/installcheck/Amanda_Util.pl new file mode 100644 index 0000000..44f08da --- /dev/null +++ b/installcheck/Amanda_Util.pl @@ -0,0 +1,78 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 28; + +use lib "@amperldir@"; +use Data::Dumper; +use Amanda::Util; + +# Data::Dumper is used to output strings with control characters +# in them, below +$Data::Dumper::Useqq = 1; # quote strings +$Data::Dumper::Terse = 1; # no $VAR1 = .. +$Data::Dumper::Indent = 0; # no newlines + +# most of Amanda::Util is tested via running applications that use it + +# Tests for quote_string and unquote string. First, some fuzzing of the +# quote + unquote round-trip. +my @fuzzstrs = ( + '', + 'abcd', + '"', + '""', + '\\', + "\t", "\r", "\n", "\f", + '\\\\\\\\', # memory overflow? + 'backslash\nletter', + 'backslash\tletter', + '"quoted"', + "line\nanother", # real newline + "ends with slash\\", + '"starts with quote', + 'ends with quote"', + "single'quote", +); + +for my $fuzzstr (@fuzzstrs) { + is(Amanda::Util::unquote_string(Amanda::Util::quote_string($fuzzstr)), $fuzzstr, + "fuzz " . Dumper($fuzzstr)); +} + +# since users often provide quoted strings (e.g., in config files), test that chosen +# quoted strings are correctly unquoted. The need to quote the quoted strings for perl +# makes this a little hard to read.. +my %unquote_checks = ( + '""' => '', + 'abcd' => 'abcd', + '"abcd"' => 'abcd', + '"\t"' => "\t", + '"\r"' => "\r", + '"\n"' => "\n", + '"\f"' => "\f", + '"\t"' => "\t", + '"\\\\n"' => '\n', # literal \ + '"\\\\"' => "\\", + '"\""' => "\"", +); + +while (my ($qstr, $uqstr) = each %unquote_checks) { + is(Amanda::Util::unquote_string($qstr), $uqstr, + "unquote " . Dumper($qstr)); +} diff --git a/installcheck/Amanda_Xfer.pl b/installcheck/Amanda_Xfer.pl new file mode 100644 index 0000000..86a33a2 --- /dev/null +++ b/installcheck/Amanda_Xfer.pl @@ -0,0 +1,334 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 12; +use File::Path; +use strict; + +use lib "@amperldir@"; +use Installcheck::Run; +use Amanda::Xfer qw( :constants ); +use Amanda::Device qw( :constants ); +use Amanda::Types; +use Amanda::Debug; +use Amanda::MainLoop; +use Amanda::Paths; +use Amanda::Config; + +# set up debugging so debug output doesn't interfere with test results +Amanda::Debug::dbopen("installcheck"); + +# and disable Debug's die() and warn() overrides +Amanda::Debug::disable_die_override(); + +# initialize configuration for the device API +Amanda::Config::config_init(0, undef); + +{ + my $RANDOM_SEED = 0xD00D; + + my $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED), + Amanda::Xfer::Filter::Xor->new(0), # key of 0 -> no change, so random seeds match + Amanda::Xfer::Dest::Null->new($RANDOM_SEED), + ]); + + pass("Creating a transfer doesn't crash"); # hey, it's a start.. + + my $got_msg = "(not received)"; + $xfer->get_source()->set_callback(sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($msg->{type} == $XMSG_INFO) { + $got_msg = $msg->{message}; + } + elsif ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $src->remove(); + Amanda::MainLoop::quit(); + } + }); + $xfer->start(); + Amanda::MainLoop::run(); + pass("A simple transfer runs to completion"); + is($got_msg, "Is this thing on?", + "XMSG_INFO from Amanda::Xfer::Dest::Null has correct message"); +} + +{ + my $RANDOM_SEED = 0xDEADBEEF; + + my $xfer1 = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED), + Amanda::Xfer::Dest::Null->new($RANDOM_SEED), + ]); + my $xfer2 = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(1024*1024*3, $RANDOM_SEED), + Amanda::Xfer::Filter::Xor->new(0xf0), + Amanda::Xfer::Filter::Xor->new(0xf0), + Amanda::Xfer::Dest::Null->new($RANDOM_SEED), + ]); + + my $cb = sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($xfer1->get_status() == $Amanda::Xfer::XFER_DONE + and $xfer2->get_status() == $Amanda::Xfer::XFER_DONE) { + $xfer1->get_source()->remove(); + $xfer2->get_source()->remove(); + Amanda::MainLoop::quit(); + } + }; + + $xfer1->get_source()->set_callback($cb); + $xfer2->get_source()->set_callback($cb); + + $xfer1->start(); + $xfer2->start(); +} +# let the already-started transfers go out of scope before they +# complete, as a memory management test.. +Amanda::MainLoop::run(); +pass("Two simultaneous transfers run to completion"); + +{ + my $RANDOM_SEED = 0xD0DEEDAA; + my @elts; + + # note that, because the Xor filter is flexible, assembling + # long pipelines can take an exponentially long time. A 10-elt + # pipeline exercises the linking algorithm without wasting + # too many CPU cycles + + push @elts, Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED); + for my $i (1 .. 4) { + push @elts, Amanda::Xfer::Filter::Xor->new($i); + push @elts, Amanda::Xfer::Filter::Xor->new($i); + } + push @elts, Amanda::Xfer::Dest::Null->new($RANDOM_SEED); + my $xfer = Amanda::Xfer->new(\@elts); + + my $cb = sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $xfer->get_source()->remove(); + Amanda::MainLoop::quit(); + } + }; + + $xfer->get_source()->set_callback($cb); + $xfer->start(); + + Amanda::MainLoop::run(); + pass("One 10-element transfer runs to completion"); +} + + +{ + my $read_filename = "$Amanda::Paths::AMANDA_TMPDIR/xfer-junk-src.tmp"; + my $write_filename = "$Amanda::Paths::AMANDA_TMPDIR/xfer-junk-dest.tmp"; + my ($rfh, $wfh); + + mkdir($Amanda::Paths::AMANDA_TMPDIR) unless (-e $Amanda::Paths::AMANDA_TMPDIR); + + # fill the file with some stuff + open($wfh, ">", $read_filename) or die("Could not open '$read_filename' for writing"); + for my $i (1 .. 100) { print $wfh "line $i\n"; } + close($wfh); + + open($rfh, "<", $read_filename) or die("Could not open '$read_filename' for reading"); + open($wfh, ">", "$write_filename") or die("Could not open '$write_filename' for writing"); + + # now run a transfer out of it + my $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Fd->new(fileno($rfh)), + Amanda::Xfer::Filter::Xor->new(0xde), + Amanda::Xfer::Filter::Xor->new(0xde), + Amanda::Xfer::Dest::Fd->new(fileno($wfh)), + ]); + + my $cb = sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $xfer->get_source()->remove(); + Amanda::MainLoop::quit(); + } + }; + + $xfer->get_source()->set_callback($cb); + $xfer->start(); + + Amanda::MainLoop::run(); + + close($wfh); + close($rfh); + + # now verify the file contents are identical + open($rfh, "<", $read_filename); + my $src = do { local $/; <$rfh> }; + + open($rfh, "<", $write_filename); + my $dest = do { local $/; <$rfh> }; + + is($src, $dest, "Source::Fd and Dest::Fd read and write files"); + + unlink($read_filename); + unlink($write_filename); +} + +# exercise device source and destination +{ + my $RANDOM_SEED = 0xFACADE; + my $xfer; + + my $quit_cb = sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $xfer->get_source()->remove(); + Amanda::MainLoop::quit(); + } + }; + + # set up vtapes + my $testconf = Installcheck::Run::setup(); + $testconf->write(); + + # set up a device for slot 1 + my $device = Amanda::Device->new("file:" . Installcheck::Run::load_vtape(1)); + die("Could not open VFS device: " . $device->error()) + unless ($device->status() == $DEVICE_STATUS_SUCCESS); + + # write to it + my $hdr = Amanda::Types::dumpfile_t->new(); + $hdr->{type} = $Amanda::Types::F_DUMPFILE; + $hdr->{name} = "installcheck"; + $hdr->{disk} = "/"; + $hdr->{datestamp} = "20080102030405"; + + $device->finish(); + $device->start($ACCESS_WRITE, "TESTCONF01", "20080102030405"); + $device->start_file($hdr); + + $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED), + Amanda::Xfer::Dest::Device->new($device, $device->block_size() * 10), + ]); + + $xfer->get_source()->set_callback($quit_cb); + $xfer->start(); + + Amanda::MainLoop::run(); + pass("write to a device (completed succesfully; data may not be correct)"); + + # finish up the file and device + ok(!$device->in_file(), "not in_file"); + ok($device->finish(), "finish"); + + # now turn around and read from it + $device->start($ACCESS_READ, undef, undef); + $device->seek_file(1); + + $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Device->new($device), + Amanda::Xfer::Dest::Null->new($RANDOM_SEED), + ]); + + $xfer->get_source()->set_callback($quit_cb); + $xfer->start(); + + Amanda::MainLoop::run(); + pass("read from a device succeeded, too, and data was correct"); +} + +{ + my $RANDOM_SEED = 0x5EAF00D; + + # build a transfer that will keep going forever + my $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(0, $RANDOM_SEED), + Amanda::Xfer::Filter::Xor->new(14), + Amanda::Xfer::Filter::Xor->new(14), + Amanda::Xfer::Dest::Null->new($RANDOM_SEED), + ]); + + my $got_timeout = 0; + Amanda::MainLoop::timeout_source(200)->set_callback(sub { + my ($src) = @_; + $got_timeout = 1; + $src->remove(); + $xfer->cancel(); + }); + $xfer->get_source()->set_callback(sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + die $msg->{elt} . " failed: " . $msg->{message}; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $src->remove(); + Amanda::MainLoop::quit(); + } + }); + $xfer->start(); + Amanda::MainLoop::run(); + ok($got_timeout, "A neverending transfer finishes after being cancelled"); + # (note that this does not test all of the cancellation possibilities) +} + +{ + # build a transfer that will write to a read-only fd + my $read_filename = "$Amanda::Paths::AMANDA_TMPDIR/xfer-junk-src.tmp"; + my $rfh; + + # create the file + open($rfh, ">", $read_filename) or die("Could not open '$read_filename' for writing"); + + # open it for reading + open($rfh, "<", $read_filename) or die("Could not open '$read_filename' for reading");; + + my $xfer = Amanda::Xfer->new([ + Amanda::Xfer::Source::Random->new(0, 1), + Amanda::Xfer::Dest::Fd->new(fileno($rfh)), + ]); + + my $got_error = 0; + $xfer->get_source()->set_callback(sub { + my ($src, $msg, $xfer) = @_; + if ($msg->{type} == $XMSG_ERROR) { + $got_error = 1; + } + if ($xfer->get_status() == $Amanda::Xfer::XFER_DONE) { + $src->remove(); + Amanda::MainLoop::quit(); + } + }); + $xfer->start(); + Amanda::MainLoop::run(); + ok($got_error, "A transfer with an error cancels itself after sending an error"); +} diff --git a/installcheck/Amconfig.pm.in b/installcheck/Amconfig.pm.in deleted file mode 100644 index c2b78fd..0000000 --- a/installcheck/Amconfig.pm.in +++ /dev/null @@ -1,302 +0,0 @@ -# vim:ft=perl -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. -# -# This program 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 program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com - -package Amconfig; -use File::Path; -use Carp; - -=head1 NAME - -Amconfig - set up amanda configurations for installcheck testing - -=head1 SYNOPSIS - - use Amconfig; - - my $testconf = Amconfig->new(); - $testconf->add_param("runtapes", "5"); - $testconf->add_subsec("tapetype", "DUCKTAPE", { length => "10G", filemark => "4096k" }); - # ... - $testconf->write(); - -The resulting configuration is always named "TESTCONF". The basic -configuration contains only a few parameters that are necessary just -to run Amanda applications in the test environment. It also contains -a tapetype, C. - -Note that it's quite possible to produce an invalid configuration with this -package (and, in fact, some of the tests do just that). - -=head2 VTAPES - -This module can set up a vtape configuration, replete with the proper -vtape directories, using C. The vtapes are created under -the "TESTCONF" configuration directory, for ease of later deletion. Do -not store anything large in these vtapes! - -=head1 WARNING - -Using this module I destroy any existing configuration named -TESTDIR. I do not use this on a production machine! - -=head1 FUNCTIONS - -=over - -=item C - -Create a new configuration object - -=cut - -sub new { - my $class = shift; - - # An instance is a blessed hash containing parameters. Start with - # some defaults to make sure things run. - my $infofile = '@CONFIG_DIR@/TESTCONF/curinfo'; - my $logdir = '@CONFIG_DIR@/TESTCONF/log'; - my $indexdir = '@CONFIG_DIR@/TESTCONF/index'; - - my $self = { - 'infofile' => $infofile, - 'logdir' => $logdir, - 'indexdir' => $indexdir, - - 'vtapes' => [], - - # Global params are stored as an arrayref, so that the same declaration - # can appear multiple times - 'params' => [ - 'mailto' => '"nobody@invalidomain"', - 'dumpuser' => '"' . (getpwuid($<))[0] . '"', # current username - - # These dirs are under CONFIG_DIR just for ease of destruction. - # This is not a recommended layout! - 'infofile' => "\"$infofile\"", - 'logdir' => "\"$logdir\"", - 'indexdir' => "\"$indexdir\"", - - 'tapetype' => '"TEST-TAPE"', - ], - - # Subsections are stored as a hashref of arrayrefs, keyed by - # subsection name - - 'tapetypes' => { - 'TEST-TAPE' => [ - 'length' => '50 mbytes', - 'filemark' => '4 kbytes' - ], - }, - - 'dumptypes' => { }, - - 'interfaces' => { }, - - 'holdingdisks' => { }, - - 'dles' => [ ], - }; - bless($self, $class); - return $self; -} - -=item C - -Add the given parameter to the configuration file, overriding any -previous value. Note that strings which should be quoted in the configuration -file itself must be double-quoted here, e.g., - - $testconf->add_param('org' => '"MyOrganization"'); - -=cut - -sub add_param { - my $self = shift; - my ($param, $value) = @_; - - push @{$self->{'params'}}, $param, $value; -} - -=item C -=item C -=item C -=item C - -Add the given subsection to the configuration file, including all -values in the arrayref. The values should be specified as alternating -key/value pairs. - -=cut - -sub add_tapetype { - my $self = shift; - my ($name, $values_arrayref) = @_; - $self->{'tapetypes'}{$name} = $values_arrayref; -} - -sub add_dumptype { - my $self = shift; - my ($name, $values_arrayref) = @_; - $self->{'dumptypes'}{$name} = $values_arrayref; -} - -sub add_holdingdisk { - my $self = shift; - my ($name, $values_arrayref) = @_; - $self->{'holdingdisks'}{$name} = $values_arrayref; -} - -sub add_interface { - my $self = shift; - my ($name, $values_arrayref) = @_; - $self->{'interfaces'}{$name} = $values_arrayref; -} - -=item C - -Add a disklist entry; C<$line> is inserted verbatim into the disklist. - -=cut - -sub add_dle { - my $self = shift; - my ($line) = @_; - push @{$self->{'dles'}}, $line; -} - -=item C - -Set up to use a single vtape (no changer). This creates the proper -directory hierarchy and sets C to the relevant path. - -=cut - -sub setup_vtape { - my $self = shift; - my $tapepath = "@CONFIG_DIR@/TESTCONF/vtapes/tape1"; - push @{$self->{'vtapes'}}, $tapepath; - - $self->add_param("tapedev", "\"file:$tapepath\""); -} - -=item C - -Write out the accumulated configuration file, along with any other -files necessary to run Amanda. - -=cut - -sub write { - my $self = shift; - - my $testconf_dir = '@CONFIG_DIR@/TESTCONF'; - if (-e $testconf_dir) { - rmtree($testconf_dir) or die("Could not remove '$testconf_dir'"); - } - mkpath($testconf_dir); - - # set up curinfo dir, etc. - mkpath($self->{'infofile'}) or die("Could not create infofile directory"); - mkpath($self->{'logdir'}) or die("Could not create logdir directory"); - mkpath($self->{'indexdir'}) or die("Could not create indexdir directory"); - - # create any vtapes - for my $vtape (@{$self->{'vtapes'}}) { - mkpath("$vtape/data") or die("Could not create vtape directory '$vtape/data'"); - } - - $self->_write_tapelist("$testconf_dir/tapelist"); - $self->_write_disklist("$testconf_dir/disklist"); - $self->_write_amanda_conf("$testconf_dir/amanda.conf"); -} - -sub _write_tapelist { - my $self = shift; - my ($filename) = @_; - - # create an empty tapelist - open(my $tapelist, ">", $filename); - close($tapelist); -} - -sub _write_disklist { - my $self = shift; - my ($filename) = @_; - - # don't bother writing a disklist if there are no dle's - return unless $self->{'dles'}; - - open(my $disklist, ">", $filename); - - for my $dle_line (@{$self->{'dles'}}) { - print $disklist "$dle_line\n"; - } - - close($disklist); -} - -sub _write_amanda_conf { - my $self = shift; - my ($filename) = @_; - - open my $amanda_conf, ">", $filename - or croak("Could not open '$filename'"); - - # write key/value pairs - my @params = @{$self->{'params'}}; - while (@params) { - $param = shift @params; - $value = shift @params; - print $amanda_conf "$param $value\n"; - } - - # write out subsections - $self->_write_amanda_conf_subsection($amanda_conf, "tapetype", $self->{"tapetypes"}); - $self->_write_amanda_conf_subsection($amanda_conf, "dumptype", $self->{"dumptypes"}); - $self->_write_amanda_conf_subsection($amanda_conf, "interface", $self->{"interfaces"}); - $self->_write_amanda_conf_subsection($amanda_conf, "holdingdisk", $self->{"holdingdisks"}); - - close($amanda_conf); -} - -sub _write_amanda_conf_subsection { - my $self = shift; - my ($amanda_conf, $subsec_type, $subsec_ref) = @_; - - for my $subsec_name (keys %$subsec_ref) { - my @values = @{$subsec_ref->{$subsec_name}}; - - if ($subsec_type eq "holdingdisk") { - print $amanda_conf "\nholdingdisk $subsec_name {\n"; - } else { - print $amanda_conf "\ndefine $subsec_type $subsec_name {\n"; - } - - while (@values) { - $param = shift @values; - $value = shift @values; - print $amanda_conf "$param $value\n"; - } - print $amanda_conf "}\n"; - } -} - -1; diff --git a/installcheck/Installcheck/Config.pm b/installcheck/Installcheck/Config.pm new file mode 100644 index 0000000..f6b2f23 --- /dev/null +++ b/installcheck/Installcheck/Config.pm @@ -0,0 +1,416 @@ +# vim:ft=perl +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Installcheck::Config; +use Amanda::Paths; +use Amanda::Constants; +use File::Path; +use Carp; + +=head1 NAME + +Installcheck::Config - set up amanda configurations for installcheck testing + +=head1 SYNOPSIS + + use Installcheck::Config; + + my $testconf = Installcheck::Config->new(); + $testconf->add_param("runtapes", "5"); + $testconf->add_subsec("tapetype", "DUCKTAPE", { length => "10G", filemark => "4096k" }); + # ... + $testconf->write(); + +The resulting configuration is always named "TESTCONF". The basic +configuration contains only a few parameters that are necessary +just to run Amanda applications in the test environment. It also +contains a tapetype, C. To change tapetype parameters, +call C<$cf->add_tapetype> with a new definition of C. + +Note that it's quite possible to produce an invalid configuration with this +package (and, in fact, some of the tests do just that). + +=head1 WARNING + +Using this module I destroy any existing configuration named +TESTDIR. I do not use this on a production machine! + +=head1 FUNCTIONS + +=over + +=item C + +Create a new configuration object + +=cut + +sub new { + my $class = shift; + + # An instance is a blessed hash containing parameters. Start with + # some defaults to make sure things run. + my $infofile = "$CONFIG_DIR/TESTCONF/curinfo"; + my $logdir = "$CONFIG_DIR/TESTCONF/log"; + my $indexdir = "$CONFIG_DIR/TESTCONF/index"; + + my $self = { + 'infofile' => $infofile, + 'logdir' => $logdir, + 'indexdir' => $indexdir, + + # Global params are stored as an arrayref, so that the same declaration + # can appear multiple times + 'params' => [ + 'dumpuser' => '"' . (getpwuid($<))[0] . '"', # current username + + # These dirs are under CONFIG_DIR just for ease of destruction. + # This is not a recommended layout! + 'infofile' => "\"$infofile\"", + 'logdir' => "\"$logdir\"", + 'indexdir' => "\"$indexdir\"", + + # (this is actually added while writing the config file, if not + # overridden by the caller) + # 'tapetype' => '"TEST-TAPE"', + ], + + # global client config + 'client_params' => [ + 'amandates' => "\"$AMANDA_TMPDIR/TESTCONF/amandates\"", + 'gnutar_list_dir' => "\"$AMANDA_TMPDIR/TESTCONF/gnutar_listdir\"", + ], + + # config-specific client config + 'client_config_params' => [ + ], + + # Subsections are stored as a hashref of arrayrefs, keyed by + # subsection name + + 'tapetypes' => [ ], + 'dumptypes' => [ ], + 'interfaces' => [ ], + 'holdingdisks' => [ ], + 'application-tool' => [ ], + 'script-tool' => [ ], + 'devices' => [ ], + 'changers' => [ ], + + 'dles' => [ ], + }; + bless($self, $class); + + $self->add_tapetype('TEST-TAPE', [ + 'length' => '50 mbytes', + 'filemark' => '4 kbytes' + ]); + return $self; +} + +=item C + +Add the given parameter to the configuration file, overriding any +previous value. Note that strings which should be quoted in the configuration +file itself must be double-quoted here, e.g., + + $testconf->add_param('org' => '"MyOrganization"'); + +=cut + +sub add_param { + my $self = shift; + my ($param, $value) = @_; + + push @{$self->{'params'}}, $param, $value; +} + +=item C, C + +Add the given parameter to the client configuration file, overriding any +previous value, as C does for the server configuration file. +C addresses the global client configuration file, while +C inserts parmeters into +C. + + $testconf->add_client_param('auth' => '"krb2"'); + $testconf->add_client_config_param('client_username' => '"freddy"'); + +=cut + +sub add_client_param { + my $self = shift; + my ($param, $value) = @_; + + push @{$self->{'client_params'}}, $param, $value; +} + +sub add_client_config_param { + my $self = shift; + my ($param, $value) = @_; + + push @{$self->{'client_config_params'}}, $param, $value; +} + +=item C +=item C +=item C +=item C +=item C +=item C +=item C +=item C + +Add the given subsection to the configuration file, including all +values in the arrayref. The values should be specified as alternating +key/value pairs. + +=cut + +sub _add_subsec { + my $self = shift; + my ($subsec, $name, $values_arrayref) = @_; + + # first delete any existing subsections with that name + @{$self->{$subsec}} = grep { $_->[0] ne $name } @{$self->{$subsec}}; + + # and now push the new subsection definition on the end + push @{$self->{$subsec}}, [$name, @$values_arrayref]; +} + +sub add_tapetype { + my $self = shift; + $self->_add_subsec("tapetypes", @_); +} + +sub add_dumptype { + my $self = shift; + $self->_add_subsec("dumptypes", @_); +} + +sub add_holdingdisk { + my $self = shift; + $self->_add_subsec("holdingdisks", @_); +} + +sub add_interface { + my $self = shift; + $self->_add_subsec("interfaces", @_); +} + +sub add_application { + my $self = shift; + $self->_add_subsec("application-tool", @_); +} + +sub add_script { + my $self = shift; + $self->_add_subsec("script-tool", @_); +} + +sub add_device { + my $self = shift; + $self->_add_subsec("devices", @_); +} + +sub add_changer { + my $self = shift; + $self->_add_subsec("changers", @_); +} + +=item C + +Add a disklist entry; C<$line> is inserted verbatim into the disklist. + +=cut + +sub add_dle { + my $self = shift; + my ($line) = @_; + push @{$self->{'dles'}}, $line; +} + +=item C + +Write out the accumulated configuration file, along with any other +files necessary to run Amanda. + +=cut + +sub write { + my $self = shift; + + my $testconf_dir = "$CONFIG_DIR/TESTCONF"; + if (-e $testconf_dir) { + rmtree($testconf_dir) or die("Could not remove '$testconf_dir'"); + } + mkpath($testconf_dir); + + # set up curinfo dir, etc. + mkpath($self->{'infofile'}) or die("Could not create infofile directory"); + mkpath($self->{'logdir'}) or die("Could not create logdir directory"); + mkpath($self->{'indexdir'}) or die("Could not create indexdir directory"); + my $amandates = $AMANDA_TMPDIR . "/TESTCONF/amandates"; + my $gnutar_listdir = $AMANDA_TMPDIR . "/TESTCONF/gnutar_listdir"; + if (! -d $gnutar_listdir) { + mkpath($gnutar_listdir) + or die("Could not create '$gnutar_listdir'"); + } + + $self->_write_tapelist("$testconf_dir/tapelist"); + $self->_write_disklist("$testconf_dir/disklist"); + $self->_write_amanda_conf("$testconf_dir/amanda.conf"); + $self->_write_amandates($amandates); + $self->_write_amanda_client_conf("$CONFIG_DIR/amanda-client.conf"); + $self->_write_amanda_client_config_conf("$testconf_dir/amanda-client.conf"); +} + +sub _write_tapelist { + my $self = shift; + my ($filename) = @_; + + # create an empty tapelist + open(my $tapelist, ">", $filename); + close($tapelist); +} + +sub _write_disklist { + my $self = shift; + my ($filename) = @_; + + # don't bother writing a disklist if there are no dle's + return unless $self->{'dles'}; + + open(my $disklist, ">", $filename); + + for my $dle_line (@{$self->{'dles'}}) { + print $disklist "$dle_line\n"; + } + + close($disklist); +} + +sub _write_amanda_conf { + my $self = shift; + my ($filename) = @_; + + open my $amanda_conf, ">", $filename + or croak("Could not open '$filename'"); + + # write key/value pairs + my @params = @{$self->{'params'}}; + my $saw_tapetype = 0; + while (@params) { + $param = shift @params; + $value = shift @params; + print $amanda_conf "$param $value\n"; + $saw_tapetype = 1 if ($param eq "tapetype"); + } + + # tapetype is special-cased: if the user has not specified a tapetype, use "TEST-TAPE". + if (!$saw_tapetype) { + print $amanda_conf "tapetype \"TEST-TAPE\"\n"; + } + + # write out subsections + $self->_write_amanda_conf_subsection($amanda_conf, "tapetype", $self->{"tapetypes"}); + $self->_write_amanda_conf_subsection($amanda_conf, "application-tool", $self->{"application-tool"}); + $self->_write_amanda_conf_subsection($amanda_conf, "script-tool", $self->{"script-tool"}); + $self->_write_amanda_conf_subsection($amanda_conf, "dumptype", $self->{"dumptypes"}); + $self->_write_amanda_conf_subsection($amanda_conf, "interface", $self->{"interfaces"}); + $self->_write_amanda_conf_subsection($amanda_conf, "holdingdisk", $self->{"holdingdisks"}); + $self->_write_amanda_conf_subsection($amanda_conf, "device", $self->{"devices"}); + $self->_write_amanda_conf_subsection($amanda_conf, "changer", $self->{"changers"}); + + close($amanda_conf); +} + +sub _write_amanda_conf_subsection { + my $self = shift; + my ($amanda_conf, $subsec_type, $subsec_ref) = @_; + + for my $subsec_info (@$subsec_ref) { + my ($subsec_name, @values) = @$subsec_info; + + if ($subsec_type eq "holdingdisk") { + print $amanda_conf "\nholdingdisk $subsec_name {\n"; + } else { + print $amanda_conf "\ndefine $subsec_type $subsec_name {\n"; + } + + while (@values) { + $param = shift @values; + $value = shift @values; + print $amanda_conf "$param $value\n"; + } + print $amanda_conf "}\n"; + } +} + +sub _write_amandates { + my $self = shift; + my ($filename) = @_; + + # make sure the containing directory exists + mkpath($filename =~ /(^.*)\/amandates/); + + # truncate the file to eliminate any interference from previous runs + open(my $amandates, ">", $filename) or die("Could not write to '$filename'"); + close($amandates); +} + +sub _write_amanda_client_conf { + my $self = shift; + my ($filename, $amandates, $gnutar_listdir) = @_; + + # just an empty file for now + open(my $amanda_client_conf, ">", $filename) + or croak("Could not write to '$filename'"); + + # write key/value pairs + my @params = @{$self->{'client_params'}}; + while (@params) { + $param = shift @params; + $value = shift @params; + print $amanda_client_conf "$param $value\n"; + } + + close($amanda_client_conf); +} + +sub _write_amanda_client_config_conf { + my $self = shift; + my ($filename, $amandates, $gnutar_listdir) = @_; + + # just an empty file for now + open(my $amanda_client_conf, ">", $filename) + or croak("Could not write to '$filename'"); + + # write key/value pairs + my @params = @{$self->{'client_config_params'}}; + while (@params) { + $param = shift @params; + $value = shift @params; + print $amanda_client_conf "$param $value\n"; + } + + close($amanda_client_conf); +} + +1; diff --git a/installcheck/Installcheck/Run.pm b/installcheck/Installcheck/Run.pm new file mode 100644 index 0000000..117cf01 --- /dev/null +++ b/installcheck/Installcheck/Run.pm @@ -0,0 +1,388 @@ +# vim:ft=perl +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Installcheck::Run; + +=head1 NAME + +Installcheck::Run - utilities to set up and run amanda dumps and restores + +=head1 SYNOPSIS + + use Installcheck::Run; + + my $testconf = Installcheck::Run::setup(); + # make any modifications you'd like to the configuration + $testconf->write(); + + ok(Installcheck::Run::run('amdump', 'TESTCONF'), "amdump completes successfully"); + + # It's generally polite to clean up your mess, although the test + # framework will clean up if your tests crash + Installcheck::Run::cleanup(); + + SKIP: { + skip "Expect.pm not installed", 7 + unless $Installcheck::Run::have_expect; + + my $exp = Installcheck::Run::run_expect('amflush', 'TESTCONF'); + $exp->expect(..); + # .. + } + +=head1 USAGE + +High-level tests generally depend on a full-scale run of Amanda -- +a fairly messy project. This module simplifies that process by +abstracting away the mess. It takes care of: + +=over +=item Setting up a holding disk; +=item Setting up several vtapes; and +=item Setting up a DLE pointing to a reasonably-sized subdirectory of the build directory. +=back + +Most of this magic is in C, which returns a configuration +object from C, allowing the test to +modify that configuration before writing it out. The hostname +for the DLE is "localhost", and the disk name is available in +C. + +This module also provides a convenient Perlish interface for running +Amanda commands: C. This function uses the +appropriate path to get to $app, and returns true if the application +exited with a status of zero. The stdout and stderr of the application +are left in C and C, respectively. + +To check that a run is successful, and return its stdout (chomped), use +C. This function returns C<''> if the application +returns a nonzero exit status. Similarly, C checks that a run returns +a nonzero exit status, and then returns its stderr, chomped. If you need a +different output file, use a bare C followed by C or +C as needed. + +C and friends can be used whether or not this module's C +was invoked. + +Finally, C cleans up from a run, deleting all backed-up +data, holding disks, and configuration. It's just good-neighborly +to call this before your test script exits. + +=head2 VTAPES + +This module sets up a configuration with three 10M vtapes, replete with +the proper vtape directories. These are controlled by C. +The tapes are not labeled, and C is not set by +default, although C is set to C. + +The vtapes are created in a subdirectory of C for ease of later +deletion. The subdirectory is available from C. +C will "load" the indicated slot just like chg-disk would, +and return the resulting path. + +=head2 HOLDING + +The holding disk is also stored under C. It is a 15M +holding disk, with a chunksize of 1M (to help exercise the chunker). + +=head2 DISKLIST + +The disklist is empty by default. Use something like the following +to add an entry: + + $testconf->add_dle("localhost $diskname installcheck-test"); + +The C dumptype specifies + auth "local" + compress none + program "GNUTAR" + +but of course, it can be modified by the test module. + +=head2 INTERACTIVE APPLICATIONS + +This package provides a rudimentary wrapper around C, which is not +typically included in a perl installation. Consult C<$have_expect> to see if +this module is installed, and skip any Expect-based tests if it is not. + +Otherwise, C takes arguments just like C, but returns an Expect +object which you can use as you would like. + +=head2 DIAGNOSTICS + +If your test runs 'amdump', a nonzero exit status may not be very helpful. The +function C will attempt to figure out what went wrong and display +useful information for the user via diag(). If it is given an argument, then +it will C with that message, causing L to stop running +tests. Otherwise, it will simply die(), which will only terminate this +particular test script. + +=cut + +use Installcheck::Config; +use Amanda::Paths; +use File::Path; +use IPC::Open3; +use Cwd qw(abs_path getcwd); +use Carp; +use Test::More; +use Amanda::Config qw( :init ); + +require Exporter; + +@ISA = qw(Exporter); +@EXPORT_OK = qw(setup + run run_get run_err + cleanup + $diskname $stdout $stderr + amdump_diag); +@EXPORT = qw(exp_continue exp_continue_timeout); + +# global variables +our $stdout = ''; +our $stderr = ''; + +our $have_expect; + +BEGIN { + eval "use Expect;"; + if ($@) { + $have_expect = 0; + sub ignore() { }; + *exp_continue = *ignore; + *exp_continue_timeout = *ignore; + } else { + $have_expect = 1; + } +}; + +# diskname is device-src, which, when full of object files, is about 4M in +# my environment. Consider creating a directory full of a configurable amount +# of junk and pointing to that, to eliminate a potential point of variation in +# tests. +our $diskname = abs_path(getcwd() . "/../device-src"); + +# common paths +my $taperoot = "$AMANDA_TMPDIR/installcheck-vtapes"; +my $holdingdir ="$AMANDA_TMPDIR/installcheck-holding"; + +sub setup { + my $testconf = Installcheck::Config->new(); + + setup_vtapes($testconf, 3); + setup_holding($testconf, 25); + setup_disklist($testconf); + + return $testconf; +} + +sub setup_vtapes { + my ($testconf, $ntapes) = @_; + if (-d $taperoot) { + rmtree($taperoot); + } + + # make each of the tape directories + for (my $i = 1; $i < $ntapes+1; $i++) { + my $tapepath = "$taperoot/slot$i"; + mkpath("$tapepath"); + } + + load_vtape(1); + + # set up the appropriate configuration + $testconf->add_param("tapedev", "\"file:$taperoot\""); + $testconf->add_param("tpchanger", "\"chg-disk\""); + $testconf->add_param("changerfile", "\"$CONFIG_DIR/TESTCONF/ignored-filename\""); + $testconf->add_param("labelstr", "\"TESTCONF[0-9][0-9]\""); + + # this overwrites the existing TEST-TAPE tapetype + $testconf->add_tapetype('TEST-TAPE', [ + 'length' => '20 mbytes', + 'filemark' => '4 kbytes', + ]); +} + +sub setup_holding { + my ($testconf, $mbytes) = @_; + + if (-d $holdingdir) { + rmtree($holdingdir); + } + mkpath($holdingdir); + + $testconf->add_holdingdisk("hd1", [ + 'directory' => "\"$holdingdir\"", + 'use' => "$mbytes mbytes", + 'chunksize' => "1 mbyte", + ]); +} + +sub setup_disklist { + my ($testconf) = @_; + + $testconf->add_dumptype("installcheck-test", [ + 'auth' => '"local"', + 'compress' => 'none', + 'program' => '"GNUTAR"', + ]); +} + +sub vtape_dir { + my ($slot) = @_; + my $tapepath = "$taperoot/slot$slot"; +} + +sub load_vtape { + my ($slot) = @_; + + # make the data/ symlink from our taperoot + unlink("$taperoot/data"); + symlink(vtape_dir($slot), "$taperoot/data") + or die("Could not create 'data' symlink: $!"); + + return $taperoot; +} + +sub run { + my $app = shift; + my @args = @_; + my $errtempfile = "$AMANDA_TMPDIR/stderr$$.out"; + + # use a temporary file for error output -- this eliminates synchronization + # problems between reading stderr and stdout + local (*INFH, *OUTFH, *ERRFH); + open(ERRFH, ">", $errtempfile); + + my $pid = IPC::Open3::open3("INFH", "OUTFH", ">&ERRFH", + "$sbindir/$app", @args); + + # immediately close the child's stdin + close(INFH); + + # read from stdout until it's closed + $stdout = do { local $/; }; + close(OUTFH); + + # and wait for the kid to die + waitpid $pid, 0 or croak("Error waiting for child process to die: $@"); + my $status = $?; + close(ERRFH); + + # fetch stderr from the temporary file + open(ERRFH, "<", "$errtempfile") or croak("Could not open '$errtempfile'"); + $stderr = do { local $/; }; + close(ERRFH); + unlink($errtempfile); + + # and return true if the exit status was zero + return ($status >> 8) == 0; +} + +sub run_get { + if (!run @_) { + Test::More::diag("run unexpectedly failed; no output to compare"); + return ''; + } + + chomp $stdout; + return $stdout; +} + +sub run_err { + if (run @_) { + Test::More::diag("run unexpectedly succeeded; no output to compare"); + return ''; + } + + chomp $stderr; + return $stderr; +} + +sub get_stdout { + chomp $stdout; + return $stdout; +} + +sub get_stderr { + chomp $stderr; + return $stderr; +} + +sub cleanup { + if (-d $taperoot) { + rmtree($taperoot); + } + if (-d $holdingdir) { + rmtree($holdingdir); + } +} + +sub run_expect { + my $app = shift; + my @args = @_; + + die "Expect.pm not found" unless $have_expect; + + my $exp = Expect->new("$sbindir/$app", @args); + + return $exp; +} + +sub amdump_diag { + my ($msg) = @_; + + # try running amreport + my $report = "failure-report.txt"; + unlink($report); + my @logfiles = <$CONFIG_DIR/TESTCONF/log/log.*>; + if (@logfiles > 0) { + run('amreport', 'TESTCONF', '-f', $report, '-l', $logfiles[$#logfiles]); + if (-f $report) { + open(my $fh, "<", $report) or return; + for my $line (<$fh>) { + Test::More::diag($line); + } + unlink($report); + goto bail; + } + } + + # maybe there was a config error + config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF"); + my ($cfgerr_level, @cfgerr_errors) = config_errors(); + if ($cfgerr_level >= $CFGERR_WARNINGS) { + foreach (@cfgerr_errors) { + Test::More::diag($_); + } + goto bail; + } + + # huh. + Test::More::diag("no amreport available, and no config errors"); + +bail: + if ($msg) { + Test::More::BAIL_OUT($msg); + } else { + die("amdump failed; cannot continue"); + } +} + +1; diff --git a/installcheck/Makefile.am b/installcheck/Makefile.am index bb3e938..705d215 100644 --- a/installcheck/Makefile.am +++ b/installcheck/Makefile.am @@ -7,53 +7,103 @@ include $(top_srcdir)/config/automake/scripts.am # Add your tests here. common_tests = \ + Amanda_Archive \ Amanda_Config \ - Amanda_Types + Amanda_Debug \ + Amanda_MainLoop \ + Amanda_Types \ + Amanda_Util \ + amarchiver server_tests = \ Amanda_Changer \ + Amanda_Changer_compat \ + Amanda_Changer_disk \ + Amanda_Changer_single \ Amanda_Cmdline \ + Amanda_DB_Catalog \ + Amanda_Device \ Amanda_Logfile \ - amcheckdump \ + Amanda_Tapelist \ + Amanda_Process \ + Amanda_Xfer \ + bigint \ + amgetconf \ + amtapetype + +full_tests = \ amdevcheck \ - amgetconf + amcheckdump \ + amdump \ + amservice \ + amstatus \ + pp-scripts + +restore_tests = \ + amfetchdump +# tests requiring neither client nor server tests = $(common_tests) + +# tests requiring server if WANT_SERVER tests += $(server_tests) endif -# Add any common files (that should not be run as tests) here: -test_utils = Amconfig.pm +# tests requiring a client and a server (any tests that run amdump) +if WANT_SERVER +if WANT_CLIENT +tests += $(full_tests) +endif +endif + +# tests requiring a client and a server AND restore facilities (any tests that run amdump) +if WANT_SERVER +if WANT_CLIENT +if WANT_RESTORE +tests += $(restore_tests) +endif +endif +endif + +# Add any common files (that should not be run as tests, and that do not +# require configure-variable substitution) here: +test_utils = Installcheck/Config.pm Installcheck/Run.pm +EXTRA_DIST += $(test_utils) -SCRIPTS_PERL = $(common_tests) $(server_tests) $(test_utils) +CHECK_PERL_FLAGS=-I$(top_srcdir)/installcheck + +SCRIPTS_PERL = $(tests) # we don't need to syntax check the test scripts.. CHECK_PERL = .PHONY: clobber_my_config_is_ok clobber_my_config_is_ok: - @if test "$(CLOBBER_MY_CONFIG)" != "OK"; then \ + @if test "$(CONFIG_CLOBBER_MY_CONFIG)" != "OK" -a \ + "$(CLOBBER_MY_CONFIG)" != "OK"; then \ echo ""; \ echo "'make installcheck' is a dangerous tool. It will overwrite your"; \ - echo "amanda-client.conf and amandates, and (if it"; \ - echo "triggers an as-yet undetected bug) may do other unexpected things. You are"; \ - echo "strongly encouraged"; \ + echo "amanda-client.conf and amandates, and (if it triggers an as-yet undetected"; \ + echo "bug) may do other unexpected things. You are strongly encouraged"; \ echo " - not to run installchecks on a production install"; \ echo " - not to run installchecks as root"; \ echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \ - echo "test environment in which"; \ - echo "potential damage is limited by your filesystem's permissions. To actually run"; \ - echo "the installchecks, invoke make"; \ - echo "as follows:"; \ + echo "test environment in which potential damage is limited by your filesystem's"; \ + echo "permissions. To actually run the installchecks, invoke make as follows:"; \ echo " $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \ exit 1; \ fi installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL) - $(mkdir_p) $(AMANDA_TMPDIR) - $(PERL) -I$(srcdir) -I$(builddir) -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests) + @$(mkdir_p) $(AMANDA_TMPDIR) + @if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \ + cp "$(CONFIG_DIR)/amanda-client.conf" "$(CONFIG_DIR)/amanda-client.conf.install-backup"; \ + fi + $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests) rm -rf "$(CONFIG_DIR)/TESTCONF" - rm -rf "$(CONFIG_DIR)/amanda-client.conf" - rm -rf "$(DEFAULT_AMANDATES_FILE)" - rm -rf "$(GNUTAR_LISTED_INCREMENTAL_DIR)" + @if test -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \ + mv -f "$(CONFIG_DIR)/amanda-client.conf.install-backup" "$(CONFIG_DIR)/amanda-client.conf"; \ + fi + rm -rf "$(AMANDA_TMPDIR)/TESTCONF/amandates" + rm -rf "$(AMANDA_TMPDIR)/TESTCONF/gnutar_listdir" diff --git a/installcheck/Makefile.in b/installcheck/Makefile.in index afbc373..f492a48 100644 --- a/installcheck/Makefile.in +++ b/installcheck/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,7 +18,7 @@ # or just client. Neither is sufficiently test-able on its own. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -33,14 +33,14 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # simple include file to pre-define variables which are then +='d by other # scripts in this directory. # vim:ft=automake -# Copyright (c) 2005 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 2.1 as @@ -55,8 +55,8 @@ # along with this library; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. # -# Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # SYNOPSIS: # @@ -67,7 +67,11 @@ # Files which support it are syntax-checked when the user invokes 'make check'. # # All *target* filenames must be listed in SCRIPTS_SHELL, SCRIPTS_PERL, and -# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. +# SCRIPTS_AWK to support 'make check', 'make dist', and 'make distclean'. No +# files which are not substituted by config.status should be included in +# SCRIPTS_PERL, SCRIPTS_SHELL, or SCRIPTS_AWK. If non-generated files are listed +# for installation, then Automake will figure out that they should be distributed; +# otherwise, include them in EXTRA_DIST. # # USAGE: # @@ -77,12 +81,15 @@ # SCRIPTS_PERL = fooscript barscript perl-lib.pl perlmod.pm # SCRIPTS_SHELL = shell1 shell2 sh-lib.sh # SCRIPTS_AWK = talk balk chalk awk-lib.awk +# sbin_SCRIPTS = not-subbed +# EXTRA_DIST = util-script.pl # # with the corresponding files in the repository: # # fooscript.pl barscript.pl perl-lib.pl.in perlmod.pm.in # shell1.sh shell2.sh sh-lib.sh.in # talk.awk balk.awk chalk.awk awk-lib.awk.in +# not-subbed util-script.pl # # by default, all shell and perl scripts are syntax checked. If this is # a problem (for example, perl scripts depending on Amanda extension @@ -120,11 +127,20 @@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/scripts.am \ $(top_srcdir)/config/automake/vars.am + +# tests requiring server @WANT_SERVER_TRUE@am__append_1 = $(server_tests) + +# tests requiring a client and a server (any tests that run amdump) +@WANT_CLIENT_TRUE@@WANT_SERVER_TRUE@am__append_2 = $(full_tests) + +# tests requiring a client and a server AND restore facilities (any tests that run amdump) +@WANT_CLIENT_TRUE@@WANT_RESTORE_TRUE@@WANT_SERVER_TRUE@am__append_3 = $(restore_tests) subdir = installcheck ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -158,6 +174,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -180,7 +197,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -208,7 +227,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -219,7 +237,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -238,6 +255,7 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -252,8 +270,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -265,16 +285,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -288,6 +320,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -295,7 +328,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -308,6 +341,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -318,9 +352,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -330,6 +367,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -354,8 +392,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -364,11 +404,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -382,6 +426,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -390,9 +435,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -400,7 +446,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -409,8 +457,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -418,7 +468,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -427,10 +476,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -446,6 +497,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -462,6 +515,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -470,7 +525,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -506,26 +560,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -533,7 +598,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -543,6 +612,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -552,7 +622,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -561,6 +638,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -589,6 +667,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -607,6 +686,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -636,10 +717,11 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUFFIXES = -EXTRA_DIST = +EXTRA_DIST = $(test_utils) BUILT_SOURCES = MOSTLYCLEANFILES = @@ -647,7 +729,8 @@ MOSTLYCLEANFILES = CLEANFILES = config.log # and we'll need to clean up our generated files for distclean -DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) +DISTCLEANFILES = $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) \ + $(SCRIPTS_INCLUDE) MAINTAINERCLEANFILES = # syntax-check shell scripts on 'make check' @@ -655,22 +738,51 @@ CHECK_SHELL = $(SCRIPTS_SHELL) # Add your tests here. common_tests = \ + Amanda_Archive \ Amanda_Config \ - Amanda_Types + Amanda_Debug \ + Amanda_MainLoop \ + Amanda_Types \ + Amanda_Util \ + amarchiver server_tests = \ Amanda_Changer \ + Amanda_Changer_compat \ + Amanda_Changer_disk \ + Amanda_Changer_single \ Amanda_Cmdline \ + Amanda_DB_Catalog \ + Amanda_Device \ Amanda_Logfile \ - amcheckdump \ + Amanda_Tapelist \ + Amanda_Process \ + Amanda_Xfer \ + bigint \ + amgetconf \ + amtapetype + +full_tests = \ amdevcheck \ - amgetconf + amcheckdump \ + amdump \ + amservice \ + amstatus \ + pp-scripts + +restore_tests = \ + amfetchdump -tests = $(common_tests) $(am__append_1) -# Add any common files (that should not be run as tests) here: -test_utils = Amconfig.pm -SCRIPTS_PERL = $(common_tests) $(server_tests) $(test_utils) +# tests requiring neither client nor server +tests = $(common_tests) $(am__append_1) $(am__append_2) \ + $(am__append_3) + +# Add any common files (that should not be run as tests, and that do not +# require configure-variable substitution) here: +test_utils = Installcheck/Config.pm Installcheck/Run.pm +CHECK_PERL_FLAGS = -I$(top_srcdir)/installcheck +SCRIPTS_PERL = $(tests) # we don't need to syntax check the test scripts.. CHECK_PERL = @@ -859,6 +971,11 @@ uninstall-am: %: %.pl $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< chmod a+x $@ + @if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + grep -v '^use lib' $@ > $@.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $@.nouselib || exit 1; \ + rm $@.nouselib; \ + fi %.pl: %.pl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< @@ -884,13 +1001,27 @@ uninstall-am: # syntax-check perl scripts on 'make check' check-perl: $(CHECK_PERL) + @CHECK_PERL="$(CHECK_PERL)"; \ + if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \ + if test -n "$(PERL)"; then \ + for perlobj in $$CHECK_PERL; do \ + grep -v '^use lib' $$perlobj > $$perlobj.nouselib; \ + $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w -T $$perlobj.nouselib || exit 1; \ + rm $$perlobj.nouselib; \ + done; \ + fi \ + fi +check-local: check-perl + +# syntax-check perl scripts on 'make installcheck' +installcheck-perl: $(CHECK_PERL) @CHECK_PERL="$(CHECK_PERL)"; \ if test -n "$(PERL)"; then \ for perlobj in $$CHECK_PERL; do \ $(PERL) $(CHECK_PERL_FLAGS) -c -w -T $$perlobj || exit 1; \ done; \ fi -check-local: check-perl +installcheck-local: installcheck-perl check-shell: $(CHECK_SHELL) @CHECK_SHELL="$(CHECK_SHELL)"; \ if test -n "$$CHECK_SHELL"; then \ @@ -930,30 +1061,33 @@ dist-hook: dist-scripts .PHONY: clobber_my_config_is_ok clobber_my_config_is_ok: - @if test "$(CLOBBER_MY_CONFIG)" != "OK"; then \ + @if test "$(CONFIG_CLOBBER_MY_CONFIG)" != "OK" -a \ + "$(CLOBBER_MY_CONFIG)" != "OK"; then \ echo ""; \ echo "'make installcheck' is a dangerous tool. It will overwrite your"; \ - echo "amanda-client.conf and amandates, and (if it"; \ - echo "triggers an as-yet undetected bug) may do other unexpected things. You are"; \ - echo "strongly encouraged"; \ + echo "amanda-client.conf and amandates, and (if it triggers an as-yet undetected"; \ + echo "bug) may do other unexpected things. You are strongly encouraged"; \ echo " - not to run installchecks on a production install"; \ echo " - not to run installchecks as root"; \ echo "See http://wiki.zmanda.com/index.php/Testing for instructions on setting up a"; \ - echo "test environment in which"; \ - echo "potential damage is limited by your filesystem's permissions. To actually run"; \ - echo "the installchecks, invoke make"; \ - echo "as follows:"; \ + echo "test environment in which potential damage is limited by your filesystem's"; \ + echo "permissions. To actually run the installchecks, invoke make as follows:"; \ echo " $(MAKE) CLOBBER_MY_CONFIG=OK installcheck"; \ exit 1; \ fi installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL) - $(mkdir_p) $(AMANDA_TMPDIR) - $(PERL) -I$(srcdir) -I$(builddir) -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests) + @$(mkdir_p) $(AMANDA_TMPDIR) + @if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \ + cp "$(CONFIG_DIR)/amanda-client.conf" "$(CONFIG_DIR)/amanda-client.conf.install-backup"; \ + fi + $(PERL) -I$(srcdir) -I. -e 'use Test::Harness qw(&runtests); runtests(@ARGV);' $(tests) rm -rf "$(CONFIG_DIR)/TESTCONF" - rm -rf "$(CONFIG_DIR)/amanda-client.conf" - rm -rf "$(DEFAULT_AMANDATES_FILE)" - rm -rf "$(GNUTAR_LISTED_INCREMENTAL_DIR)" + @if test -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \ + mv -f "$(CONFIG_DIR)/amanda-client.conf.install-backup" "$(CONFIG_DIR)/amanda-client.conf"; \ + fi + rm -rf "$(AMANDA_TMPDIR)/TESTCONF/amandates" + rm -rf "$(AMANDA_TMPDIR)/TESTCONF/gnutar_listdir" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/installcheck/amarchiver.pl b/installcheck/amarchiver.pl new file mode 100644 index 0000000..15e3cad --- /dev/null +++ b/installcheck/amarchiver.pl @@ -0,0 +1,114 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 18; + +use lib "@amperldir@"; +use Installcheck::Run qw( run run_get ); +use Amanda::Paths; +use Amanda::Constants; +use File::Path qw( mkpath rmtree ); + +my $tmpdir = "$AMANDA_TMPDIR/amarchiver-installcheck"; +my $archfile = "$tmpdir/test.amar"; +my $data = "abcd" x 500; +my $fh; + +rmtree($tmpdir); +mkpath($tmpdir); +chdir($tmpdir); + +open($fh, ">", "test.tmp-1"); +print $fh $data; +close($fh); + +open($fh, ">", "test.tmp-2"); +print $fh $data; +close($fh); + +ok(run('amarchiver', '--version'), + "amarchiver --version OK"); +like($Installcheck::Run::stdout, + qr{^amarchiver }, + "..and output is reasonable"); + +# test creating archives + +ok(run('amarchiver', '--create', "test.tmp-1"), + "archive creation without --file succeeds"); +like($Installcheck::Run::stdout, qr{^AMANDA ARCHIVE FORMAT }, + "..and produces something that looks like an archive"); + +unlink($archfile); +ok(run('amarchiver', '--create', '--file', $archfile, + "$sbindir/amarchiver", "$sbindir/amgetconf"), + "archive creation succeeds"); +ok(-f $archfile, "..and target file exists"); + +unlink($archfile); +ok(run('amarchiver', '--create', '--verbose', '--file', $archfile, + "$sbindir/amarchiver", "$sbindir/amgetconf"), + "archive creation with --verbose succeeds"); +like($Installcheck::Run::stdout, + qr{^\Q$sbindir\E/amarchiver\n\Q$sbindir\E/amgetconf$}, + "..and output is correct"); + +ok(run('amarchiver', '--create', '--verbose', $archfile), + "archive creation with --verbose and without --file succeeds"); +like($Installcheck::Run::stderr, + qr{$archfile}, + "..and output goes to stderr"); + +unlink($archfile); +ok(run('amarchiver', '--create', '--verbose', '--verbose', '--file', $archfile, + "$sbindir/amarchiver", "$sbindir/amgetconf", "test.tmp-1"), + "archive creation with two --verbose args succeeds"); +like($Installcheck::Run::stdout, + qr{^[[:digit:]]+ \Q$sbindir\E/amarchiver\n[[:digit:]]+ \Q$sbindir\E/amgetconf\n2000 test.tmp-1$}, + "..and output is correct"); + +# test listing archives + +run('amarchiver', '--create', '--file', $archfile, "test.tmp-1", "test.tmp-2") + or BAIL_OUT("could not create an archive to test listing/extracting"); + +ok(run('amarchiver', '--list', '--file', $archfile), + "archive listing succeeds"); +is($Installcheck::Run::stdout, "test.tmp-1\ntest.tmp-2\n", + "..and output is correct"); + +# test extracting archives + +unlink("test.tmp-1.16"); +unlink("test.tmp-2.16"); +ok(run('amarchiver', '--extract', '--file', $archfile), + "archive extraction succeeds"); +ok((-f "test.tmp-1.16" && -f "test.tmp-2.16"), "..and the files reappear") + or diag(`find .`); + +unlink("test.tmp-1.16"); +unlink("test.tmp-2.16"); +ok(run('amarchiver', '--extract', '--file', $archfile, "test.tmp-2"), + "archive extraction of only one file succeeds"); +ok((! -f "test.tmp-1.16" && -f "test.tmp-2.16"), "..and the file reappears") + or diag(`find .`); + +END { + chdir("$tmpdir/.."); + rmtree($tmpdir); +} diff --git a/installcheck/amcheckdump.pl b/installcheck/amcheckdump.pl index ff6a150..6591911 100644 --- a/installcheck/amcheckdump.pl +++ b/installcheck/amcheckdump.pl @@ -1,34 +1,98 @@ -use Test::More qw( no_plan ); +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Amconfig; +use Test::More tests => 9; use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_get run_err $diskname); use Amanda::Paths; -sub amcheckdump { - my $cmd = "$sbindir/amcheckdump " . join(" ", @_) . " 2>&1"; - my $result = `$cmd`; - chomp $result; - return $result; -} - my $testconf; ## # First, try amgetconf out without a config -like(amcheckdump(), qr/\AUSAGE:/i, - "bare 'amcheckdump' gives usage message"); -like(amcheckdump("this-probably-doesnt-exist"), qr(could not open conf file)i, - "error message when configuration parameter doesn't exist"); +ok(!run('amcheckdump'), + "amcheckdump with no arguments returns an error exit status"); +like($Installcheck::Run::stdout, qr/\AUSAGE:/i, + ".. and gives usage message"); + +like(run_err('amcheckdump', 'this-probably-doesnt-exist'), qr(could not open conf file)i, + "run with non-existent config fails with an appropriate error message."); ## -# Now use a config with a vtape +# Now use a config with a vtape and without usetimestamps -# this is re-created for each test -$testconf = Amconfig->new(); -$testconf->setup_vtape(); +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_param('usetimestamps', 'no'); +$testconf->add_dle("localhost $diskname installcheck-test"); $testconf->write(); -like(amcheckdump("TESTCONF"), qr(could not find)i, - "'amcheckdump' on a brand-new config finds no dumps."); +ok(run('amcheckdump', 'TESTCONF'), + "amcheckdump with a new config succeeds"); +like($Installcheck::Run::stdout, qr(could not find)i, + "..but finds no dumps."); + +BAIL_OUT("amdump failed") + unless run('amdump', 'TESTCONF'); + +like(run_get('amcheckdump', 'TESTCONF'), qr(Validating), + "amcheckdump succeeds, claims to validate something (usetimestamps=no)"); + +## +# and check command-line handling + +like(run_get('amcheckdump', 'TESTCONF', '-oorg=installcheck'), qr(Validating), + "amcheckdump accepts '-o' options on the command line"); + +## +# And a config with usetimestamps enabled + +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_param('usetimestamps', 'yes'); +$testconf->add_dle("localhost $diskname installcheck-test"); +$testconf->write(); + +BAIL_OUT("amdump failed") + unless run('amdump', 'TESTCONF'); + +like(run_get('amcheckdump', 'TESTCONF'), qr(Validating), + "amcheckdump succeeds, claims to validate something (usetimestamps=yes)"); + +## +# now try zeroing out the dumps + +my $vtape1 = Installcheck::Run::vtape_dir(1); +opendir(my $vtape_dir, $vtape1) || die "can't opendir $vtape1: $!"; +@dump1 = grep { /^0+1/ } readdir($vtape_dir); +closedir $vtape_dir; + +for my $dumpfile (@dump1) { + open(my $dumpfh, "+<", "$vtape1/$dumpfile"); + sysseek($dumpfh, 32768, 0); # jump past the header + syswrite($dumpfh, "\0" x 100); # and write some zeroes + close($dumpfh); +} + +ok(!run('amcheckdump', 'TESTCONF'), + "amcheckdump detects a failure from a zeroed-out dumpfile"); + +Installcheck::Run::cleanup(); diff --git a/installcheck/amdevcheck.pl b/installcheck/amdevcheck.pl index 895f73a..f82e37d 100644 --- a/installcheck/amdevcheck.pl +++ b/installcheck/amdevcheck.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,55 +13,68 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw( no_plan ); +use Test::More tests => 10; -use Amconfig; use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_get run_err $diskname); use Amanda::Paths; -sub amdevcheck { - my $cmd = "$sbindir/amdevcheck " . join(" ", @_) . " 2>&1"; - my $result = `$cmd`; - chomp $result; - return $result; -} - my $testconf; ## # First, try amgetconf out without a config -like(amdevcheck(), qr(\AUsage: )i, - "bare 'amdevcheck' gives usage message"); -like(amdevcheck("this-probably-doesnt-exist"), qr(could not open conf file)i, - "error message when configuration parameter doesn't exist"); +ok(!run('amdevcheck'), + "'amdevcheck' with no arguments returns an error exit status"); +like($Installcheck::Run::stdout, qr(\AUsage: )i, + ".. and gives usage message on stdout"); + +like(run_err('amdevcheck', 'this-probably-doesnt-exist'), qr(could not open conf file)i, + "if the configuration doesn't exist, fail with the correct message"); ## # Next, work against a basically empty config # this is re-created for each test -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_param("tapedev", '"/dev/null"'); $testconf->write(); # test some defaults -like(amdevcheck('TESTCONF'), qr{File /dev/null is not a tape device}, - "uses tapedev by default"); +ok(run('amdevcheck', 'TESTCONF'), "run succeeds with a /dev/null tapedev"); +is_deeply([ sort split "\n", $Installcheck::Run::stdout], + [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"], + "Fail with correct message for a /dev/null tapedev"); ## # Now use a config with a vtape # this is re-created for each test -$testconf = Amconfig->new(); -$testconf->setup_vtape(); +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_dle("localhost $diskname installcheck-test"); $testconf->write(); -is_deeply([ sort split "\n", amdevcheck('TESTCONF') ], - [ sort "VOLUME_UNLABELED", "VOLUME_ERROR", "DEVICE_ERROR" ], - "empty vtape described as VOLUME_UNLABELED, VOLUME_ERROR, DEVICE_ERROR"); +ok(run('amdevcheck', 'TESTCONF'), "run succeeds with an unlabeled tape"); +is_deeply([ sort split "\n", $Installcheck::Run::stdout], + [ sort "MESSAGE Error loading device header -- unlabeled volume?", "VOLUME_UNLABELED", "DEVICE_ERROR", "VOLUME_ERROR"], + "..and output is correct"); -like(amdevcheck('TESTCONF', "/dev/null"), qr{File /dev/null is not a tape device}, +ok(run('amdevcheck', 'TESTCONF', "/dev/null"), "can override device on the command line"); +is_deeply([ sort split "\n", $Installcheck::Run::stdout], + [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"], + ".. and produce a corresponding error message"); + +BAIL_OUT("amdump failed") + unless run('amdump', 'TESTCONF'); + +is_deeply([ sort split "\n", run_get('amdevcheck', 'TESTCONF') ], + [ sort "SUCCESS" ], + "used vtape described as SUCCESS"); + +Installcheck::Run::cleanup(); diff --git a/installcheck/amdump.pl b/installcheck/amdump.pl new file mode 100644 index 0000000..508e6e9 --- /dev/null +++ b/installcheck/amdump.pl @@ -0,0 +1,65 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 2; + +use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_err $diskname amdump_diag); +use Amanda::Config qw( :init ); +use Amanda::Paths; + +my $testconf; + +# Just run amdump. + +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); + +# one program "GNUTAR" +$testconf->add_dle(<add_dle(<write(); + +ok(run('amdump', 'TESTCONF'), "amdump runs successfully") + or amdump_diag(); + +# Dump a nonexistant client, and see amdump fail. +$testconf = Installcheck::Run::setup(); +$testconf->add_dle('does-not-exist.example.com / installcheck-test'); +$testconf->write(); + +ok(!run('amdump', 'TESTCONF'), "amdump fails with nonexistent client"); + +Installcheck::Run::cleanup(); diff --git a/installcheck/amfetchdump.pl b/installcheck/amfetchdump.pl new file mode 100644 index 0000000..05aea85 --- /dev/null +++ b/installcheck/amfetchdump.pl @@ -0,0 +1,152 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 7; + +use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_get run_err $diskname); +use File::Path qw(rmtree mkpath); +use Amanda::Paths; +use Cwd; + +my $testconf; +my $dumpok; + +my $testdir = "$AMANDA_TMPDIR/amfetchdump-installcheck"; +rmtree($testdir); +mkpath($testdir); + +my $origdir = getcwd; +chdir($testdir); + +sub cleandir { + for my $filename (<$testdir/*>) { + unlink($filename); + } +} + +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_dle("localhost $diskname installcheck-test"); +$testconf->write(); + +run('amdump', 'TESTCONF') + or BAIL_OUT("amdump run failed"); + +like(run_err('amfetchdump', 'TESTCONF'), + qr{^Usage:}, + "'amfetchdump TESTCONF' gives usage message on stderr"); + +SKIP: { + skip "Expect.pm not installed", 2 + unless $Installcheck::Run::have_expect; + + cleandir(); + + my $exp = Installcheck::Run::run_expect('amfetchdump', 'TESTCONF', 'localhost'); + $exp->log_stdout(0); + + my @results; + $exp->expect(60, + [ qr{1 tape\(s\) needed for restoration}, sub { + push @results, "tapes-needed"; + exp_continue; + } ], + [ qr{amfetchdump: 1: restoring FILE: date [[:digit:]]+ host localhost disk .*}, + sub { + push @results, "restoring"; + exp_continue; + } ], + [ 'Press enter when ready', sub { + push @results, "press-enter"; + $exp->send("\n"); + exp_continue; + }, ], + [ 'eof', sub { + push @results, "eof"; + }, ], + ); + is_deeply([ @results ], [ "tapes-needed", "press-enter", "restoring", "eof" ], + "simple restore follows the correct steps"); + + my @filenames = ; + is(scalar @filenames, 1, "..and restored file is present in testdir") + or diag(join("\n", @filenames)); +} + +{ + cleandir(); + + ok(run('amfetchdump', '-a', 'TESTCONF', 'localhost'), + "run with -a successful"); + + my @filenames = ; + is(scalar @filenames, 1, "..and restored file is present in testdir") + or diag(join("\n", @filenames)); +} + +SKIP: { + skip "Expect.pm not installed", 2 + unless $Installcheck::Run::have_expect; + + cleandir(); + chdir($AMANDA_TMPDIR); + + my $exp = Installcheck::Run::run_expect('amfetchdump', '-O', $testdir, 'TESTCONF', 'localhost'); + $exp->log_stdout(0); + + my @results; + $exp->expect(60, + [ qr{1 tape\(s\) needed for restoration}, sub { + push @results, "tapes-needed"; + exp_continue; + } ], + [ qr{amfetchdump: 1: restoring FILE: date [[:digit:]]+ host localhost disk .*}, + sub { + push @results, "restoring"; + exp_continue; + } ], + [ 'Press enter when ready', sub { + push @results, "press-enter"; + $exp->send("\n"); + exp_continue; + }, ], + [ 'eof', sub { + push @results, "eof"; + }, ], + ); + is_deeply([ @results ], [ "tapes-needed", "press-enter", "restoring", "eof" ], + "restore with -O follows the correct steps"); + + chdir($testdir); + my @filenames = ; + is(scalar @filenames, 1, "..and restored file is present in testdir") + or diag(join("\n", @filenames)); +} + +# TODO: +# - test piping (-p), +# - test compression (-c and -C) +# - test a specified device (-d) +# - test splits (regular, -w, -n) + +END { + chdir("$testdir/.."); + rmtree($testdir); +} diff --git a/installcheck/amgetconf.pl b/installcheck/amgetconf.pl index 31ea204..1916a22 100644 --- a/installcheck/amgetconf.pl +++ b/installcheck/amgetconf.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,23 +13,16 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More qw(no_plan); +use Test::More tests => 78; -use Amconfig; use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_get run_err); use Amanda::Paths; - -# wrapper to call amgetconf and return the results -sub amgetconf { - # open amgetconf and read from it - my $cmd = "$sbindir/amgetconf " . join(" ", @_) . " 2>&1"; - my $result = `$cmd`; - chomp $result; - return $result; -} +use Cwd; # this is re-created for each test my $testconf; @@ -37,136 +30,275 @@ my $testconf; ## # First, try amgetconf out without a config -like(amgetconf(), qr(\AUsage: )i, - "bare 'amgetconf' gives usage message"); -like(amgetconf("this-probably-doesnt-exist"), qr(could not open conf file)i, +ok(!run('amgetconf'), "bare amgetconf fails"); +like($Installcheck::Run::stdout, qr(\AUsage: )i, + ".. and gives usage message on stdout"); +like(run_err('amgetconf', 'this-probably-doesnt-exist', 'tapedev'), + qr(could not open conf file)i, "error message when configuration parameter doesn't exist"); ## # Next, work against a basically empty config -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->write(); # test some defaults -is(amgetconf('TESTCONF', "reserve"), "100", +is(run_get('amgetconf', 'TESTCONF', "reserve"), "100", "reserve defaults to 100"); -is(amgetconf('TESTCONF', "tapelist"), "tapelist", +is(run_get('amgetconf', 'TESTCONF', "tapelist"), "tapelist", "tapelist defaults to 'tapelist'"); -is(amgetconf('TESTCONF', "usetimestamps"), "yes", +is(run_get('amgetconf', 'TESTCONF', "usetimestamps"), "yes", "usetimestamps defaults to 'yes'"); +is(run_get('amgetconf', 'TESTCONF', "send_amreport_on"), "ALL", + "send_amreport_on defaults to 'ALL'"); # (enum value is 0) +is(run_get('amgetconf', 'TESTCONF', "taperalgo"), "FIRST", + "taperalgo defaults to 'ALL'"); # (enum value is 0) +is(run_get('amgetconf', 'TESTCONF', "printer"), "", + "printer defaults to empty string, which is not an error"); + +# test command-line parsing +is(run_get('amgetconf', 'TESTCONF', '--execute-where', 'client', 'amandates'), + $Amanda::Constants::DEFAULT_AMANDATES_FILE, + "--execute-where client"); +is(run_get('amgetconf', 'TESTCONF', '--execute-where=client', 'amandates'), + $Amanda::Constants::DEFAULT_AMANDATES_FILE, + "--execute-where=client"); +is(run_get('amgetconf', 'TESTCONF', '--client', 'amandates'), + $Amanda::Constants::DEFAULT_AMANDATES_FILE, + "--client"); + +is(run_get('amgetconf', 'TESTCONF', '--execute-where', 'server', 'reserve'), "100", + "--execute-where server"); +is(run_get('amgetconf', 'TESTCONF', '--execute-where=server', 'reserve'), "100", + "--execute-where=server"); +is(run_get('amgetconf', 'TESTCONF', '--execute-where=server', '--execute-where=server', 'reserve'), "100", + "--execute-where=server --execute-where=server"); +is(run_get('amgetconf', 'TESTCONF', '--execute-where=client', '--execute-where=client', 'amandates'), + $Amanda::Constants::DEFAULT_AMANDATES_FILE, + "--execute-where=client --execute-where=client"); + +like(run_err('amgetconf', 'TESTCONF', '--execute-where=server', '--execute-where=client'), + qr/conflicts with/, + "handles conflict --execute-where=server --execute-where=client"); +like(run_err('amgetconf', 'TESTCONF', '--execute-where=client', '--execute-where=server'), + qr/conflicts with/, + "handles conflict --execute-where=client --execute-where=server"); +like(run_err('amgetconf', 'TESTCONF', '--execute-where=server', '--client'), + qr/conflicts with/, + "handles conflict --execute-where=server --client"); +like(run_err('amgetconf', 'TESTCONF', '--client', '--execute-where=server'), + qr/conflicts with/, + "handles conflict --client --execute-where=server"); + +is(run_get('amgetconf', 'TESTCONF', '-o', 'reserve=50', 'reserve'), "50", + "-o reserve=50"); +is(run_get('amgetconf', 'TESTCONF', '-oreserve=50', 'reserve'), "50", + "-oreserve=50"); +is(run_get('amgetconf', '-o', 'reserve=50', 'TESTCONF', 'reserve'), "50", + "-oreserve=50 before config name"); +is(run_get('amgetconf', 'TESTCONF', 'reserve', 'a', 'table', 'for', 'two', '-o', 'reserve=50'), "50", + "extra command-line arguments are ignored"); # test a nonexistent parameter -like(amgetconf('TESTCONF', "foos_per_bar"), qr/no such parameter/, - "handles nonexistent parameters"); - -# test build parameters (just the most common) -is(amgetconf('TESTCONF', "build.bindir"), $bindir, "build.bindir is correct"); -is(amgetconf('TESTCONF', "build.sbindir"), $sbindir, "build.sbindir is correct"); -is(amgetconf('TESTCONF', "build.amlibexecdir"), $amlibexecdir, "build.amlibexecdir is correct"); -is(amgetconf('TESTCONF', "build.mandir"), $mandir, "build.mandir is correct"); -is(amgetconf('TESTCONF', "build.AMANDA_DBGDIR"), $AMANDA_DBGDIR, "build.AMANDA_DBGDIR is correct"); -is(amgetconf('TESTCONF', "build.AMANDA_TMPDIR"), $AMANDA_TMPDIR, "build.AMANDA_TMPDIR is correct"); -is(amgetconf('TESTCONF', "build.CONFIG_DIR"), $CONFIG_DIR, "build.CONFIG_DIR is correct"); +like(run_err('amgetconf', 'TESTCONF', "foos_per_bar"), qr/no such parameter/, + "handles nonexistent parameters as an error"); +like(run_err('amgetconf', 'TESTCONF', "build.foos_per_bar"), qr/no such parameter/, + "handles nonexistent build parameters as an error"); + +# Test build parameters that we can determine easily. Testing all parameters +# would be more of a maintenance bother than a help. +is(run_get('amgetconf', 'TESTCONF', "build.bindir"), $bindir, + "build.bindir is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.sbindir"), $sbindir, + "build.sbindir is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.libexecdir"), $libexecdir, + "build.libexecdir is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.amlibexecdir"), $amlibexecdir, + "build.amlibexecdir is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.mandir"), $mandir, + "build.mandir is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.AMANDA_DBGDIR"), $AMANDA_DBGDIR, + "build.AMANDA_DBGDIR is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.AMANDA_TMPDIR"), $AMANDA_TMPDIR, + "build.AMANDA_TMPDIR is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.CONFIG_DIR"), $CONFIG_DIR, + "build.CONFIG_DIR is correct"); +is(run_get('amgetconf', 'TESTCONF', "build.__empty"), "", + "empty build variables handled correctly"); + +like(run_err('amgetconf', 'TESTCONF', "build.bogus-param"), qr(no such parameter), + "bogus build parameters result in an error"); + +is(run_get('amgetconf', 'TESTCONF', "build.config_dir"), $CONFIG_DIR, + "build parameters are case-insensitive"); + +is(run_get('amgetconf', "build.bindir"), $bindir, "build variables are available without a config"); + +# empty --list should return nothing +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'holdingdisk')))], [ ], + "--list returns an empty list when there's nothing to return"); # dbopen, dbclose -my $dbfile = amgetconf('TESTCONF', "dbopen.foo"); -like($dbfile, qr(^$AMANDA_DBGDIR/server/foo.[0-9]*.debug$), +my $dbfile = run_get('amgetconf', 'TESTCONF', "dbopen.foo"); +chomp $dbfile; +like($dbfile, qr(^\Q$AMANDA_DBGDIR\E/server/foo.[0-9]*.debug$), "'amgetconf dbopen.foo' returns a proper debug filename"); -ok(-f $dbfile, - "'amgetconf dbopen.foo' creates the debug file"); -like(amgetconf('TESTCONF', "dbclose.foo"), qr/cannot parse/, - "dbclose without filename fails"); -is(amgetconf('TESTCONF', "dbclose.foo:$dbfile"), $dbfile, - "'amgetconf dbclose.foo:' returns the debug filename"); +SKIP: { + skip "dbopen didn't work, so I'll skip the rest", 3 + unless (-f $dbfile); + ok(!run('amgetconf', 'TESTCONF', "dbclose.foo"), + "dbclose without filename fails"); + is(run_get('amgetconf', 'TESTCONF', "dbclose.foo:$dbfile"), $dbfile, + "'amgetconf dbclose.foo:' returns the debug filename"); + + # sometimes shell scripts pass a full path as appname.. + $dbfile = run_get('amgetconf', 'TESTCONF', 'dbopen./sbin/foo'); + like($dbfile, qr(^\Q$AMANDA_DBGDIR\E/server/_sbin_foo.[0-9]*.debug$), + "'amgetconf dbopen./sbin/foo' doesn't get confused by the slashes"); +} ## # Test an invalid config file -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_param("foos_per_bar", "10"); $testconf->write(); -like(amgetconf('TESTCONF', "foos_per_bar"), qr/errors processing config file/, +like(run_err('amgetconf', 'TESTCONF', "foos_per_bar"), qr/errors processing config file/, "gives error on invalid configuration"); ## # Now let's fill in some interesting values -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_param("reserved-udp-port", '100,200'); $testconf->add_param("printer", '"/dev/lp"'); $testconf->add_param("reserve", '27'); $testconf->write(); -is(amgetconf('TESTCONF', "reserved-udp-port"), "100,200", +is(run_get('amgetconf', 'TESTCONF', "reserved-udp-port"), "100,200", "correctly returns intrange parameters from the file"); -is(amgetconf('TESTCONF', "printer"), "/dev/lp", +is(run_get('amgetconf', 'TESTCONF', "printer"), "/dev/lp", "correctly returns string parameters from the file"); -is(amgetconf('TESTCONF', "reserve"), "27", +is(run_get('amgetconf', 'TESTCONF', "reserve"), "27", "correctly returns integer parameters from the file"); -is(amgetconf('TESTCONF', "rEsErVe"), "27", +is(run_get('amgetconf', 'TESTCONF', "rEsErVe"), "27", "is case-insensitive"); +is(run_get('amgetconf', 'TESTCONF', "reserved_udp_port"), "100,200", + "treats _ and - identically"); + +# check runs without a config +my $olddir = getcwd(); +chdir("$CONFIG_DIR/TESTCONF") or die("Could not 'cd' to TESTCONF directory"); +is(run_get('amgetconf', "printer"), "/dev/lp", + "uses current directory when no configuration name is given"); +chdir($olddir) or die("Could not 'cd' back to my original directory"); ## # device_property can appear multiple times -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_param("device_property", '"power" "on"'); $testconf->add_param("device_property", '"turbo" "engaged"'); $testconf->write(); -is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'device_property')))], +is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'device_property')))], [sort('"power" "on"', '"turbo" "engaged"')], "device_property can have multiple values"); ## # Subsections -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_tapetype("cassette", [ length => "32 k" ]); $testconf->add_tapetype("reel2reel", [ length => "1 M" ]); $testconf->add_tapetype("scotch", [ length => "500 bytes" ]); # (use a sharpie) $testconf->add_dumptype("testdump", [ comment => '"testdump-dumptype"' ]); $testconf->add_interface("testiface", [ use => '10' ]); $testconf->add_holdingdisk("hd17", [ chunksize => '128' ]); +$testconf->add_application('app_amgtar', [ plugin => '"amgtar"' ]); +$testconf->add_application('app_amstar', [ plugin => '"amstar"' ]); +$testconf->add_script('my_script', [ "execute-on" => 'pre-dle-amcheck', 'plugin' => '"foo"' ]); +$testconf->add_device('my_device', [ "tapedev" => '"foo:/bar"' ]); $testconf->write(); -is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'tapetype')))], +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'tapetype')))], [sort("cassette", "reel2reel", "scotch", "TEST-TAPE")], "--list returns correct set of tapetypes"); -is(amgetconf('TESTCONF', 'tapetype:scotch:length'), '500', +is(run_get('amgetconf', 'TESTCONF', 'tapetype:scotch:length'), '500', "returns tapetype parameter correctly"); -ok(grep { $_ eq 'testdump' } split(/\n/, amgetconf('TESTCONF', '--list', 'dumptype')), +ok(scalar(grep { $_ eq 'testdump' } + split(/\n/, + run_get('amgetconf', 'TESTCONF', '--list', 'dumptype'))), "--list returns a test dumptype among the default dumptypes"); -is(amgetconf('TESTCONF', 'dumptype:testdump:comment'), 'testdump-dumptype', +is(run_get('amgetconf', 'TESTCONF', 'dumptype:testdump:comment'), 'testdump-dumptype', "returns dumptype parameter correctly"); -is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'interface')))], +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'interface')))], [sort("testiface", "default")], "--list returns correct set of interfaces"); -is(amgetconf('TESTCONF', 'interface:testiface:use'), '10', +is(run_get('amgetconf', 'TESTCONF', 'interface:testiface:use'), '10', "returns interface parameter correctly"); -is_deeply([sort(+split(/\n/, amgetconf('TESTCONF', '--list', 'holdingdisk')))], - [sort("hd17")], +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'holdingdisk')))], + [sort("hd17")], "--list returns correct set of holdingdisks"); -is(amgetconf('TESTCONF', 'holdingdisk:hd17:chunksize'), '128', +is(run_get('amgetconf', 'TESTCONF', 'holdingdisk:hd17:chunksize'), '128', "returns holdingdisk parameter correctly"); +like(run_get('amgetconf', 'TESTCONF', '--list', 'build'), qr(.*version.*), + "'--list build' lists build variables"); + +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'application-tool')))], + [sort("app_amgtar", "app_amstar")], + "--list returns correct set of application-tool"); + +is(run_get('amgetconf', 'TESTCONF', 'application-tool:app_amgtar:plugin'), 'amgtar', + "returns application-tool parameter correctly"); + +is_deeply([sort(+split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'script-tool')))], + [sort("my_script")], + "--list returns correct set of script-tool"); + +is(run_get('amgetconf', 'TESTCONF', 'script-tool:my_script:execute-on'), 'PRE-DLE-AMCHECK', + "returns script-tool parameter correctly"); +is(run_get('amgetconf', 'TESTCONF', 'script_tOOl:my_script:execute-on'), 'PRE-DLE-AMCHECK', + "insensitive to case in subsec_type"); +is(run_get('amgetconf', 'TESTCONF', 'script-tool:my_script:execute-on'), 'PRE-DLE-AMCHECK', + "insensitive to -/_ in subsec_type"); +is(run_get('amgetconf', 'TESTCONF', 'script_tOOl:my_script:eXECute-on'), 'PRE-DLE-AMCHECK', + "insensitive to case in subsec_key"); +is(run_get('amgetconf', 'TESTCONF', 'script-tool:my_script:execute_on'), 'PRE-DLE-AMCHECK', + "insensitive to -/_ in subsec_key"); + +is_deeply([sort(split(/\n/, run_get('amgetconf', 'TESTCONF', '--list', 'device')))], + [sort("my_device")], + "--list returns correct set of devices"); + +is(run_get('amgetconf', 'TESTCONF', 'device:my_device:tapedev'), 'foo:/bar', + "returns device parameter correctly"); + # non-existent subsection types, names, and parameters -like(amgetconf('TESTCONF', 'NOSUCHTYPE:testiface:comment'), qr/no such parameter/, +like(run_err('amgetconf', 'TESTCONF', 'NOSUCHTYPE:testiface:comment'), qr/no such parameter/, "handles bad subsection type"); -like(amgetconf('TESTCONF', 'dumptype:NOSUCHDUMP:comment'), qr/no such parameter/, +like(run_err('amgetconf', 'TESTCONF', 'dumptype:NOSUCHDUMP:comment'), qr/no such parameter/, "handles bad dumptype namek"); -like(amgetconf('TESTCONF', 'dumptype:testdump:NOSUCHPARAM'), qr/no such parameter/, +like(run_err('amgetconf', 'TESTCONF', 'dumptype:testdump:NOSUCHPARAM'), qr/no such parameter/, "handles bad dumptype parameter name"); +like(run_err('amgetconf', 'TESTCONF', 'application-tool:app_amgtar:NOSUCHPARAM'), qr/no such parameter/, + "handles bad application-tool parameter name"); +like(run_err('amgetconf', 'TESTCONF', 'script-tool:my-script:NOSUCHPARAM'), qr/no such parameter/, + "handles bad script-tool parameter name"); + +like(run_err('amgetconf', 'TESTCONF', '--list', 'frogs'), qr/no such parameter/, + "--list fails given an invalid subsection name"); ## # exclude lists are a bit funny, too -$testconf = Amconfig->new(); +$testconf = Installcheck::Config->new(); $testconf->add_dumptype("testdump", [ "exclude file optional" => '"f1"', # this optional will have no effect "exclude file append" => '"f2"', @@ -177,13 +309,14 @@ $testconf->add_dumptype("testdump", [ ]); $testconf->write(); -is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:exclude')))], +is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'dumptype:testdump:exclude')))], [sort('FILE "f1" "f2"', 'LIST "l1" "l2"')], "exclude files and lists displayed correctly; a non-final optional is ignored"); -is_deeply([sort(+split(qr/\n/, amgetconf('TESTCONF', 'dumptype:testdump:include')))], +is_deeply([sort(+split(qr/\n/, run_get('amgetconf', 'TESTCONF', 'dumptype:testdump:include')))], [sort('FILE OPTIONAL "ifo"', 'LIST OPTIONAL "ilo"')], "a final 'OPTIONAL' makes the whole include/exclude optional") + diff --git a/installcheck/amservice.pl b/installcheck/amservice.pl new file mode 100644 index 0000000..27d1df2 --- /dev/null +++ b/installcheck/amservice.pl @@ -0,0 +1,105 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 3; + +use lib "@amperldir@"; +use Installcheck::Run qw( run run_get ); +use Amanda::Paths; +use Amanda::Constants; + +my $input_filename = "$AMANDA_TMPDIR/amservice_input.txt"; +my $testconf = Installcheck::Run::setup(); +my $input; + +sub write_input_file { + my ($contents) = @_; + open my $fh, ">", $input_filename + or die("Could not write to $input_filename"); + print $fh $contents; + close $fh; +} + +sub all_lines_ok { + my ($output) = @_; + my $ok = 1; + + return 0 if not $output; + + for (split /\n/, $output) { + next if /^OPTIONS /; + next if /^OK /; + diag "Got unexpected line: $_"; + $ok = 0; + } + + return $ok; +} + +# a simple run of amservice to begin with +like(run_get('amservice', '-f', '/dev/null', 'localhost', 'local', 'noop'), + qr/^OPTIONS features=/, + "amservice runs noop successfully"); + +$input = < + GNUTAR + $AMANDA_TMPDIR + +EOF + +SKIP: { + skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR; + write_input_file($input); + ok(all_lines_ok( + run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')), + "GNUTAR program selfchecks successfully"); +} + +# (can't test DUMP, since we don't have a device) + +$input = < + APPLICATION + + amgtar + + $AMANDA_TMPDIR + +EOF + +SKIP: { + skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR; + write_input_file($input); + ok(all_lines_ok( + run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')), + "amgtar application selfchecks successfully"); +} + +$input = < + APPLICATION + + amstar + + $AMANDA_TMPDIR + +EOF + +Installcheck::Run::cleanup(); +unlink($input_filename); diff --git a/installcheck/amstatus.pl b/installcheck/amstatus.pl new file mode 100644 index 0000000..bd165f8 --- /dev/null +++ b/installcheck/amstatus.pl @@ -0,0 +1,314 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 7; + +use lib "@amperldir@"; +use Installcheck::Run qw( run run_get ); +use Amanda::Paths; +use Amanda::Constants; + +my $filename="$AMANDA_TMPDIR/installcheck-amdump.1"; +my $testconf = Installcheck::Run::setup(); +$testconf->write(); + +# read __DATA__ to a hash, keyed by the names following '%%%%' +my %logfiles; +my $key = undef; +while () { + if (/^%%%% (.*)/) { + $key = $1; + } else { + $logfiles{$key} .= $_; + } +} + +sub write_logfile { + my ($data) = @_; + open(my $fh, ">", $filename) or die("Could not open '$filename' for writing"); + print $fh $data; + close($fh); +}; + +## try a few various options with a pretty normal logfile + +write_logfile($logfiles{'normal'}); + +ok(run('amstatus', 'TESTCONF', '--file', $filename), + "plain amstatus runs without error"); +like($Installcheck::Run::stdout, + qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)}, + "output is reasonable"); + +ok(run('amstatus', 'TESTCONF', '--file', $filename, '--summary'), + "amstatus --summary runs without error"); +unlike($Installcheck::Run::stdout, + qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)}, + "output does not contain the finished dump"); +like($Installcheck::Run::stdout, + qr{taped\s+:\s+1\s+}, + "output contains summary info"); + +## now test a file with spaces and other funny characters in filenames + +write_logfile($logfiles{'quoted'}); + +ok(run('amstatus', 'TESTCONF', '--file', $filename), + "amstatus runs without error with quoted disknames"); +like($Installcheck::Run::stdout, + # note that amstatus' output is quoted, so backslashes are doubled + qr{clienthost:"C:\\\\Some Dir\\\\"\s*0\s*100k\s*finished\s*\(13:01:53\)}, + "output is correct"); + +unlink($filename); + +__DATA__ +%%%% normal +amdump: start at Wed Jun 18 13:01:47 EDT 2008 +amdump: datestamp 20080618 +amdump: starttime 20080618130147 +amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT +planner: pid 4079 executable /path/to/planner version 9.8.7 +READING CONF INFO... +planner: timestamp 20080618130147 +planner: time 0.000: startup took 0.000 secs + +SENDING FLUSHES... +ENDFLUSH + +SETTING UP FOR ESTIMATES... +planner: time 0.000: setting up estimates for clienthost:/some/dir +clienthost:/some/dir overdue 14049 days for level 0 +setup_estimate: clienthost:/some/dir: command 0, options: none last_level -1 next_level0 -14049 level_days 0 getting estimates 0 (-2) -1 (-2) -1 (-2) +planner: time 0.000: setting up estimates took 0.000 secs + +GETTING ESTIMATES... +driver: pid 4080 executable /path/to/driver version 9.8.7 +driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576 +reserving 0 out of 868352 for degraded-mode dumps +driver: send-cmd time 0.015 to taper: START-TAPER 20080618130147 +taper: pid 4084 executable taper version 9.8.7 +driver: started dumper0 pid 4086 +driver: send-cmd time 0.031 to dumper0: START 20080618130147 +planner: time 0.050: got partial result for host clienthost disk /some/dir: 0 -> -2K, -1 -> -2K, -1 -> -2K +dumper: pid 4090 executable dumper1 version 9.8.7 +driver: started dumper1 pid 4090 +driver: send-cmd time 0.046 to dumper1: START 20080618130147 +driver: started dumper2 pid 4094 +driver: send-cmd time 0.048 to dumper2: START 20080618130147 +driver: started dumper3 pid 4095 +driver: send-cmd time 0.059 to dumper3: START 20080618130147 +driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352 dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS +dumper: pid 4094 executable dumper2 version 9.8.7 +planner: time 0.088: got partial result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K +planner: time 0.091: got result for host clienthost disk /some/dir: 0 -> 100K, -1 -> -2K, -1 -> -2K +planner: time 0.091: getting estimates took 0.090 secs +FAILED QUEUE: empty +DONE QUEUE: + 0: clienthost /some/dir + +ANALYZING ESTIMATES... +pondering clienthost:/some/dir... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode) + curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50 +INITIAL SCHEDULE (size 208): + clienthost /some/dir pri 14050 lev 0 nsize 100 csize 100 + +DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4 + delay: Total size now 208. + +PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50... +planner: time 0.091: analysis took 0.000 secs + +GENERATING SCHEDULE: +-------- +DUMP clienthost ffffffff9ffeffffffff1f /some/dir 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024 +-------- +dumper: pid 4086 executable dumper0 version 9.8.7 +dumper: pid 4095 executable dumper3 version 9.8.7 +taper: using label `Conf-001' date `20080618130147' +driver: result time 1.312 from taper: TAPER-OK +driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle +driver: interface-state time 1.312 if default: free 600 +driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0 +driver: flush size 0 +driver: started chunker0 pid 4129 +driver: send-cmd time 1.314 to chunker0: START 20080618130147 +driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f /some/dir 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index; +chunker: pid 4129 executable chunker0 version 9.8.7 +driver: result time 1.330 from chunker0: PORT 1487 +driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f /some/dir NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |" local\n YES\n YES\n" +driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.408 if default: free 0 +driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1 +driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]" +driver: finished-cmd time 6.408 dumper0 dumped clienthost:/some/dir +driver: send-cmd time 6.408 to chunker0: DONE 00-00001 +driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.408 if default: free 0 +driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1 +driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]" +driver: finished-cmd time 6.408 chunker0 chunked clienthost:/some/dir +driver: send-cmd time 6.410 to taper: FILE-WRITE 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost /some/dir 0 20080618130147 0 +driver: startaflush: FIRST clienthost /some/dir 132 102400 +driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.410 if default: free 600 +driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0 +driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002 +driver: send-cmd time 6.411 to taper: NEW-TAPE +driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.412 if default: free 600 +driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0 +driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001 +driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.414 if default: free 600 +driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0 +driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]" +driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.415 if default: free 600 +driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0 +driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" "" +driver: finished-cmd time 6.415 taper wrote clienthost:/some/dir +driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.415 if default: free 600 +driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0 +driver: QUITTING time 6.415 telling children to quit +driver: send-cmd time 6.415 to dumper0: QUIT +driver: send-cmd time 6.415 to dumper1: QUIT +driver: send-cmd time 6.417 to dumper2: QUIT +driver: send-cmd time 6.417 to dumper3: QUIT +driver: send-cmd time 6.418 to taper: QUIT +taper: DONE +driver: FINISHED time 7.426 +amdump: end at Wed Jun 18 13:01:55 EDT 2008 +%%%% quoted +amdump: start at Wed Jun 18 13:01:47 EDT 2008 +amdump: datestamp 20080618 +amdump: starttime 20080618130147 +amdump: starttime-locale-independent 2008-06-18 13:01:47 EDT +planner: pid 4079 executable /path/to/planner version 9.8.7 +READING CONF INFO... +planner: timestamp 20080618130147 +planner: time 0.000: startup took 0.000 secs + +SENDING FLUSHES... +ENDFLUSH + +SETTING UP FOR ESTIMATES... +planner: time 0.000: setting up estimates for clienthost:"C:\\Some Dir\\" +clienthost:"C:\\Some Dir\\" overdue 14049 days for level 0 +setup_estimate: clienthost:"C:\\Some Dir\\": command 0, options: none last_level -1 next_level0 -14049 level_days 0 getting estimates 0 (-2) -1 (-2) -1 (-2) +planner: time 0.000: setting up estimates took 0.000 secs + +GETTING ESTIMATES... +driver: pid 4080 executable /path/to/driver version 9.8.7 +driver: adding holding disk 0 dir /holding size 868352 chunksize 1048576 +reserving 0 out of 868352 for degraded-mode dumps +driver: send-cmd time 0.015 to taper: START-TAPER 20080618130147 +taper: pid 4084 executable taper version 9.8.7 +driver: started dumper0 pid 4086 +driver: send-cmd time 0.031 to dumper0: START 20080618130147 +planner: time 0.050: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> -2K, -1 -> -2K, -1 -> -2K +dumper: pid 4090 executable dumper1 version 9.8.7 +driver: started dumper1 pid 4090 +driver: send-cmd time 0.046 to dumper1: START 20080618130147 +driver: started dumper2 pid 4094 +driver: send-cmd time 0.048 to dumper2: START 20080618130147 +driver: started dumper3 pid 4095 +driver: send-cmd time 0.059 to dumper3: START 20080618130147 +driver: start time 0.059 inparallel 4 bandwidth 600 diskspace 868352 dir OBSOLETE datestamp 20080618130147 driver: drain-ends tapeq FIRST big-dumpers sssS +dumper: pid 4094 executable dumper2 version 9.8.7 +planner: time 0.088: got partial result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K +planner: time 0.091: got result for host clienthost disk "C:\\Some Dir\\": 0 -> 100K, -1 -> -2K, -1 -> -2K +planner: time 0.091: getting estimates took 0.090 secs +FAILED QUEUE: empty +DONE QUEUE: + 0: clienthost "C:\\Some Dir\\" + +ANALYZING ESTIMATES... +pondering clienthost:"C:\\Some Dir\\"... next_level0 -14049 last_level -1 (due for level 0) (new disk, can't switch to degraded mode) + curr level 0 nsize 100 csize 100 total size 208 total_lev0 100 balanced-lev0size 50 +INITIAL SCHEDULE (size 208): + clienthost "C:\\Some Dir\\" pri 14050 lev 0 nsize 100 csize 100 + +DELAYING DUMPS IF NEEDED, total_size 208, tape length 102400 mark 4 + delay: Total size now 208. + +PROMOTING DUMPS IF NEEDED, total_lev0 100, balanced_size 50... +planner: time 0.091: analysis took 0.000 secs + +GENERATING SCHEDULE: +-------- +DUMP clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 20080618130147 14050 0 1970:1:1:0:0:0 100 100 0 1024 +-------- +dumper: pid 4086 executable dumper0 version 9.8.7 +dumper: pid 4095 executable dumper3 version 9.8.7 +taper: using label `Conf-001' date `20080618130147' +driver: result time 1.312 from taper: TAPER-OK +driver: state time 1.312 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: not-idle +driver: interface-state time 1.312 if default: free 600 +driver: hdisk-state time 1.312 hdisk 0: free 868352 dumpers 0 +driver: flush size 0 +driver: started chunker0 pid 4129 +driver: send-cmd time 1.314 to chunker0: START 20080618130147 +driver: send-cmd time 1.314 to chunker0: PORT-WRITE 00-00001 /holding/20080618130147/clienthost._some_dir.0 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" 0 1970:1:1:0:0:0 1048576 GNUTAR 192 |;auth=local;index; +chunker: pid 4129 executable chunker0 version 9.8.7 +driver: result time 1.330 from chunker0: PORT 1487 +driver: send-cmd time 1.330 to dumper0: PORT-DUMP 00-00001 1487 clienthost ffffffff9ffeffffffff1f "C:\\Some Dir\\" NODEVICE 0 1970:1:1:0:0:0 GNUTAR X amanda X local |" local\n YES\n YES\n" +driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.408 if default: free 0 +driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1 +driver: result time 6.408 from dumper0: DONE 00-00001 100 100 0 "[sec 0.012 kb 100 kps 7915.1 orig-kb 100]" +driver: finished-cmd time 6.408 dumper0 dumped clienthost:"C:\\Some Dir\\" +driver: send-cmd time 6.408 to chunker0: DONE 00-00001 +driver: state time 6.408 free kps: 0 space: 868160 taper: idle idle-dumpers: 3 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.408 if default: free 0 +driver: hdisk-state time 6.408 hdisk 0: free 868160 dumpers 1 +driver: result time 6.408 from chunker0: DONE 00-00001 100 "[sec 5.075 kb 100 kps 26.0]" +driver: finished-cmd time 6.408 chunker0 chunked clienthost:"C:\\Some Dir\\" +driver: send-cmd time 6.410 to taper: FILE-WRITE 00-00002 /holding/20080618130147/clienthost._some_dir.0 clienthost "C:\\Some Dir\\" 0 20080618130147 0 +driver: startaflush: FIRST clienthost "C:\\Some Dir\\" 132 102400 +driver: state time 6.410 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.410 if default: free 600 +driver: hdisk-state time 6.410 hdisk 0: free 868220 dumpers 0 +driver: result time 6.411 from taper: REQUEST-NEW-TAPE 00-00002 +driver: send-cmd time 6.411 to taper: NEW-TAPE +driver: state time 6.412 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.412 if default: free 600 +driver: hdisk-state time 6.412 hdisk 0: free 868220 dumpers 0 +driver: result time 6.412 from taper: NEW-TAPE 00-00002 Conf-001 +driver: state time 6.414 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.414 if default: free 600 +driver: hdisk-state time 6.414 hdisk 0: free 868220 dumpers 0 +driver: result time 6.415 from taper: PARTDONE 00-00002 Conf-001 1 100 "[sec 0.001177 kb 100 kps 84961.767205]" +driver: state time 6.415 free kps: 600 space: 868220 taper: writing idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.415 if default: free 600 +driver: hdisk-state time 6.415 hdisk 0: free 868220 dumpers 0 +driver: result time 6.415 from taper: DONE 00-00002 INPUT-GOOD TAPE-GOOD "[sec 0.001177 kb 100 kps 84961.767205]" "" "" +driver: finished-cmd time 6.415 taper wrote clienthost:"C:\\Some Dir\\" +driver: state time 6.415 free kps: 600 space: 868352 taper: idle idle-dumpers: 4 qlen tapeq: 0 runq: 0 roomq: 0 wakeup: 0 driver-idle: no-dumpers +driver: interface-state time 6.415 if default: free 600 +driver: hdisk-state time 6.415 hdisk 0: free 868352 dumpers 0 +driver: QUITTING time 6.415 telling children to quit +driver: send-cmd time 6.415 to dumper0: QUIT +driver: send-cmd time 6.415 to dumper1: QUIT +driver: send-cmd time 6.417 to dumper2: QUIT +driver: send-cmd time 6.417 to dumper3: QUIT +driver: send-cmd time 6.418 to taper: QUIT +taper: DONE +driver: FINISHED time 7.426 +amdump: end at Wed Jun 18 13:01:55 EDT 2008 diff --git a/installcheck/amtapetype.pl b/installcheck/amtapetype.pl new file mode 100644 index 0000000..23d93d7 --- /dev/null +++ b/installcheck/amtapetype.pl @@ -0,0 +1,34 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 2; + +use lib "@amperldir@"; +use Installcheck::Run qw(run run_get run_err); + +## +# First, check that the script runs -- this is essentially a syntax/strict +# check of the script. + +ok(!run('amtapetype'), + "'amtapetype' with no arguments returns an error exit status"); +like($Installcheck::Run::stderr, qr(\AUsage: )i, + ".. and gives usage message on stderr"); + +# amtapetype demands far more resources than we can allow it to use in a +# test situation, so for now this is the best we can do. diff --git a/installcheck/bigint.pl b/installcheck/bigint.pl new file mode 100644 index 0000000..4472f75 --- /dev/null +++ b/installcheck/bigint.pl @@ -0,0 +1,223 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 74; + +use lib "@amperldir@"; +use Amanda::Tests; +use Math::BigInt; +use Amanda::BigIntCompat; + +# define some constants; Perl doesn't have native 64-bit numbers, so +# none are tested +$G_MAXUINT64_bigint = Math::BigInt->new('18446744073709551615'); +$G_MAXINT64_bigint = Math::BigInt->new('9223372036854775807'); +$G_MININT64_bigint = Math::BigInt->new('-9223372036854775808'); + +$G_MAXUINT32_native = 2 ** 32 - 1; +$G_MAXUINT32_double = 2.0 ** 32 - 1; +$G_MAXUINT32_bigint = Math::BigInt->new('4294967295'); +$G_MAXINT32_native = 2 ** 31 - 1; +$G_MAXINT32_double = 2.0 ** 31 - 1; +$G_MAXINT32_bigint = Math::BigInt->new('2147483647'); +$G_MININT32_native = - 2 ** 31; +$G_MININT32_double = - 2.0 ** 31; +$G_MININT32_bigint = Math::BigInt->new('-2147483648'); + +$G_MAXUINT16_native = 2 ** 16 - 1; +$G_MAXUINT16_double = 2.0 ** 16 - 1; +$G_MAXUINT16_bigint = Math::BigInt->new('65535'); +$G_MAXINT16_native = 2 ** 15 - 1; +$G_MAXINT16_double = 2.0 ** 15 - 1; +$G_MAXINT16_bigint = Math::BigInt->new('32767'); +$G_MININT16_native = - 2 ** 15; +$G_MININT16_double = - 2.0 ** 15; +$G_MININT16_bigint = Math::BigInt->new('-32768'); + +$G_MAXUINT8_native = 2 ** 8 - 1; +$G_MAXUINT8_double = 2.0 ** 8 - 1; +$G_MAXUINT8_bigint = Math::BigInt->new('255'); +$G_MAXINT8_native = 2 ** 7 - 1; +$G_MAXINT8_double = 2.0 ** 7 - 1; +$G_MAXINT8_bigint = Math::BigInt->new('127'); +$G_MININT8_native = - 2 ** 7; +$G_MININT8_double = - 2.0 ** 7; +$G_MININT8_bigint = Math::BigInt->new('-128'); + +# first test "taking" integers -- Perl -> C + +is(Amanda::Tests::take_guint64(0), "ZERO", + "Perl->C guint64 0"); +is(Amanda::Tests::take_guint64($G_MAXUINT64_bigint), "MAX", + "Perl->C guint64 bigint MAX ($G_MAXUINT64_bigint)"); +is(Amanda::Tests::take_gint64(0), "ZERO", + "Perl->C gint64 0"); +is(Amanda::Tests::take_gint64($G_MAXINT64_bigint), "MAX", + "Perl->C gint64 bigint MAX ($G_MAXINT64_bigint)"); +is(Amanda::Tests::take_gint64($G_MININT64_bigint), "MIN", + "Perl->C gint64 bigint MIN ($G_MININT64_bigint)"); + +is(Amanda::Tests::take_guint32(0), "ZERO", + "Perl->C guint32 0"); +is(Amanda::Tests::take_guint32($G_MAXUINT32_bigint), "MAX", + "Perl->C guint32 bigint MAX ($G_MAXUINT32_bigint)"); +is(Amanda::Tests::take_guint32($G_MAXUINT32_native), "MAX", + "Perl->C guint32 native MAX ($G_MAXUINT32_native)"); +is(Amanda::Tests::take_guint32($G_MAXUINT32_double), "MAX", + "Perl->C guint32 double MAX ($G_MAXUINT32_double)"); +is(Amanda::Tests::take_gint32(0), "ZERO", + "Perl->C gint32 0"); +is(Amanda::Tests::take_gint32($G_MAXINT32_bigint), "MAX", + "Perl->C gint32 bigint MAX ($G_MAXINT32_bigint)"); +is(Amanda::Tests::take_gint32($G_MAXINT32_native), "MAX", + "Perl->C gint32 native MAX ($G_MAXINT32_native)"); +is(Amanda::Tests::take_gint32($G_MAXINT32_double), "MAX", + "Perl->C gint32 double MAX ($G_MAXINT32_double)"); +is(Amanda::Tests::take_gint32($G_MININT32_bigint), "MIN", + "Perl->C gint32 bigint MIN ($G_MININT32_bigint)"); +is(Amanda::Tests::take_gint32($G_MININT32_native), "MIN", + "Perl->C gint32 native MIN ($G_MININT32_native)"); +is(Amanda::Tests::take_gint32($G_MININT32_double), "MIN", + "Perl->C gint32 double MIN ($G_MININT32_double)"); + +is(Amanda::Tests::take_guint16(0), "ZERO", + "Perl->C guint16 0"); +is(Amanda::Tests::take_guint16($G_MAXUINT16_bigint), "MAX", + "Perl->C guint16 bigint MAX ($G_MAXUINT16_bigint)"); +is(Amanda::Tests::take_guint16($G_MAXUINT16_native), "MAX", + "Perl->C guint16 native MAX ($G_MAXUINT16_native)"); +is(Amanda::Tests::take_guint16($G_MAXUINT16_double), "MAX", + "Perl->C guint16 double MAX ($G_MAXUINT16_double)"); +is(Amanda::Tests::take_gint16(0), "ZERO", + "Perl->C gint16 0"); +is(Amanda::Tests::take_gint16($G_MAXINT16_bigint), "MAX", + "Perl->C gint16 bigint MAX ($G_MAXINT16_bigint)"); +is(Amanda::Tests::take_gint16($G_MAXINT16_native), "MAX", + "Perl->C gint16 native MAX ($G_MAXINT16_native)"); +is(Amanda::Tests::take_gint16($G_MAXINT16_double), "MAX", + "Perl->C gint16 double MAX ($G_MAXINT16_double)"); +is(Amanda::Tests::take_gint16($G_MININT16_bigint), "MIN", + "Perl->C gint16 bigint MIN ($G_MININT16_bigint)"); +is(Amanda::Tests::take_gint16($G_MININT16_native), "MIN", + "Perl->C gint16 native MIN ($G_MININT16_native)"); +is(Amanda::Tests::take_gint16($G_MININT16_double), "MIN", + "Perl->C gint16 double MIN ($G_MININT16_double)"); + +is(Amanda::Tests::take_guint8(0), "ZERO", + "Perl->C guint8 0"); +is(Amanda::Tests::take_guint8($G_MAXUINT8_bigint), "MAX", + "Perl->C guint8 bigint MAX ($G_MAXUINT8_bigint)"); +is(Amanda::Tests::take_guint8($G_MAXUINT8_native), "MAX", + "Perl->C guint8 native MAX ($G_MAXUINT8_native)"); +is(Amanda::Tests::take_guint8($G_MAXUINT8_double), "MAX", + "Perl->C guint8 double MAX ($G_MAXUINT8_double)"); +is(Amanda::Tests::take_gint8(0), "ZERO", + "Perl->C gint8 0"); +is(Amanda::Tests::take_gint8($G_MAXINT8_bigint), "MAX", + "Perl->C gint8 bigint MAX ($G_MAXINT8_bigint)"); +is(Amanda::Tests::take_gint8($G_MAXINT8_native), "MAX", + "Perl->C gint8 native MAX ($G_MAXINT8_native)"); +is(Amanda::Tests::take_gint8($G_MAXINT8_double), "MAX", + "Perl->C gint8 double MAX ($G_MAXINT8_double)"); +is(Amanda::Tests::take_gint8($G_MININT8_bigint), "MIN", + "Perl->C gint8 bigint MIN ($G_MININT8_bigint)"); +is(Amanda::Tests::take_gint8($G_MININT8_native), "MIN", + "Perl->C gint8 native MIN ($G_MININT8_native)"); +is(Amanda::Tests::take_gint8($G_MININT8_double), "MIN", + "Perl->C gint8 double MIN ($G_MININT8_double)"); + +# now test giving integers -- C -> Perl + +is(Amanda::Tests::give_guint64("0"), 0, "C -> Perl guint64 0"); +is(Amanda::Tests::give_guint64("+"), $G_MAXUINT64_bigint, "C -> Perl guint64 MAX (always bigint)"); +is(Amanda::Tests::give_gint64("0"), 0, "C -> Perl gint64 0"); +is(Amanda::Tests::give_gint64("+"), $G_MAXINT64_bigint, "C -> Perl gint64 MAX (always bigint)"); +is(Amanda::Tests::give_gint64("-"), $G_MININT64_bigint, "C -> Perl gint64 MIN (always bigint)"); + +is(Amanda::Tests::give_guint32("0"), 0, "C -> Perl guint32 0"); +is(Amanda::Tests::give_guint32("+"), $G_MAXUINT32_bigint, "C -> Perl guint32 MAX (always bigint)"); +is(Amanda::Tests::give_gint32("0"), 0, "C -> Perl gint32 0"); +is(Amanda::Tests::give_gint32("+"), $G_MAXINT32_bigint, "C -> Perl gint32 MAX (always bigint)"); +is(Amanda::Tests::give_gint32("-"), $G_MININT32_bigint, "C -> Perl gint32 MIN (always bigint)"); + +is(Amanda::Tests::give_guint16("0"), 0, "C -> Perl guint16 0"); +is(Amanda::Tests::give_guint16("+"), $G_MAXUINT16_bigint, "C -> Perl guint16 MAX (always bigint)"); +is(Amanda::Tests::give_gint16("0"), 0, "C -> Perl gint16 0"); +is(Amanda::Tests::give_gint16("+"), $G_MAXINT16_bigint, "C -> Perl gint16 MAX (always bigint)"); +is(Amanda::Tests::give_gint16("-"), $G_MININT16_bigint, "C -> Perl gint16 MIN (always bigint)"); + +is(Amanda::Tests::give_guint8("0"), 0, "C -> Perl guint8 0"); +is(Amanda::Tests::give_guint8("+"), $G_MAXUINT8_bigint, "C -> Perl guint8 MAX (always bigint)"); +is(Amanda::Tests::give_gint8("0"), 0, "C -> Perl gint8 0"); +is(Amanda::Tests::give_gint8("+"), $G_MAXINT8_bigint, "C -> Perl gint8 MAX (always bigint)"); +is(Amanda::Tests::give_gint8("-"), $G_MININT8_bigint, "C -> Perl gint8 MIN (always bigint)"); + +# finally, test overflows in Perl -> C conversions; these all croak(), so we capture the errors +# with an eval {} + +eval { Amanda::Tests::take_gint64($G_MAXINT64_bigint+1); }; +like($@, qr/Expected a signed 64-bit value or smaller/, + "gint64 rejects numbers greater than max"); +eval { Amanda::Tests::take_gint64($G_MININT64_bigint-1); }; +like($@, qr/Expected a signed 64-bit value or smaller/, + "gint64 rejects numbers less than min"); +eval { Amanda::Tests::take_guint64($G_MAXUINT64_bigint+1); }; +like($@, qr/Expected an unsigned 64-bit value or smaller/, + "guint64 rejects numbers greater than max"); +eval { Amanda::Tests::take_guint64(-1); }; +like($@, qr/Expected an unsigned value, got a negative integer/, + "guint64 rejects numbers less than zero"); + +eval { Amanda::Tests::take_gint32($G_MAXINT32_native+1); }; +like($@, qr/Expected a 32-bit integer; value out of range/, + "gint32 rejects numbers greater than max"); +eval { Amanda::Tests::take_gint32($G_MININT32_native-1); }; +like($@, qr/Expected a 32-bit integer; value out of range/, + "gint32 rejects numbers less than min"); +eval { Amanda::Tests::take_guint32($G_MAXUINT32_native+1); }; +like($@, qr/Expected a 32-bit unsigned integer/, + "guint32 rejects numbers greater than max"); +eval { Amanda::Tests::take_guint32(-1); }; +like($@, qr/Expected an unsigned value, got a negative integer/, + "guint32 rejects numbers less than zero"); + +eval { Amanda::Tests::take_gint16($G_MAXINT16_native+1); }; +like($@, qr/Expected a 16-bit integer; value out of range/, + "gint16 rejects numbers greater than max"); +eval { Amanda::Tests::take_gint16($G_MININT16_native-1); }; +like($@, qr/Expected a 16-bit integer; value out of range/, + "gint16 rejects numbers less than min"); +eval { Amanda::Tests::take_guint16($G_MAXUINT16_native+1); }; +like($@, qr/Expected a 16-bit unsigned integer/, + "guint16 rejects numbers greater than max"); +eval { Amanda::Tests::take_guint16(-1); }; +like($@, qr/Expected an unsigned value, got a negative integer/, + "guint16 rejects numbers less than zero"); + +eval { Amanda::Tests::take_gint8($G_MAXINT8_native+1); }; +like($@, qr/Expected a 8-bit integer; value out of range/, + "gint8 rejects numbers greater than max"); +eval { Amanda::Tests::take_gint8($G_MININT8_native-1); }; +like($@, qr/Expected a 8-bit integer; value out of range/, + "gint8 rejects numbers less than min"); +eval { Amanda::Tests::take_guint8($G_MAXUINT8_native+1); }; +like($@, qr/Expected a 8-bit unsigned integer/, + "guint8 rejects numbers greater than max"); +eval { Amanda::Tests::take_guint8(-1); }; +like($@, qr/Expected an unsigned value, got a negative integer/, + "guint8 rejects numbers less than zero"); diff --git a/installcheck/pp-scripts.pl b/installcheck/pp-scripts.pl new file mode 100644 index 0000000..c38550a --- /dev/null +++ b/installcheck/pp-scripts.pl @@ -0,0 +1,167 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 8; + +use lib "@amperldir@"; +use Cwd qw(abs_path getcwd); +use Installcheck::Config; +use Installcheck::Run qw(run run_err $diskname amdump_diag); +use Amanda::Config qw( :init ); +use Amanda::Paths; +use warnings; +use strict; + +my $testconf; + +# Run amdump with client- and server-side scripts + +my $templog = $Amanda::Paths::AMANDA_TMPDIR . "/check-script." . $$; + +sub verify_log { + my $msg = shift; + my @exp = @_; + my ($exp, $got); + my $logfile; + + if (!open($logfile, "<", $templog)) { + fail($msg); + diag("Logfile '$templog' does not exist."); + return; + } + + my $linenum = 1; + foreach $exp (@exp) { + $got = <$logfile>; + if (!$got) { + fail($msg); + diag(" Line: $linenum"); + diag("Expected: '$exp'"); + diag(" Got: EOF"); + diag($exp); + return; + } + chomp $got; + if ($got ne $exp) { + fail($msg); + diag(" Line: $linenum"); + diag("Expected: '$exp'"); + diag(" Got: '$got'"); + return; + } + $linenum++; + } + $got = <$logfile>; + if ($got) { + fail($msg); + diag(" Line: $linenum"); + diag("Expected: EOF"); + diag(" Got: '$got'"); + diag($got); + return; + } + pass($msg); +}; + +# check script on client + +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); + +$testconf->add_dle(<write(); + +unlink $templog; +ok(run('amcheck', '-c', 'TESTCONF'), "amcheck runs successfully for client scripts."); + +verify_log("amcheck invokes correct script commands", + "TESTCONF pre-dle-amcheck client localhost diskname1 $diskname ", + "TESTCONF post-dle-amcheck client localhost diskname1 $diskname ", +); + +unlink $templog; +ok(run('amdump', 'TESTCONF'), "amdump runs successfully for client scripts.") + or amdump_diag(); + +verify_log("amdump invokes correct script commands", + "TESTCONF pre-dle-estimate client localhost diskname1 $diskname 0", + "TESTCONF post-dle-estimate client localhost diskname1 $diskname 0", + "TESTCONF pre-dle-backup client localhost diskname1 $diskname 0", + "TESTCONF post-dle-backup client localhost diskname1 $diskname 0", +); + +Installcheck::Run::cleanup(); + +#check script on server +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); + +$testconf->add_dle(<write(); + +unlink $templog; +ok(run('amcheck', '-c', 'TESTCONF'), "amcheck runs successfully for server scripts."); + +verify_log("amcheck invokes correct script commands", + "TESTCONF pre-host-amcheck server localhost diskname2 $diskname ", + "TESTCONF post-host-amcheck server localhost diskname2 $diskname ", +); + +unlink $templog; +ok(run('amdump', 'TESTCONF'), "amdump runs successfully for server scripts.") + or amdump_diag(); + +verify_log("amdump invokes correct script commands", + "TESTCONF pre-host-estimate server localhost diskname2 $diskname 0", + "TESTCONF post-host-estimate server localhost diskname2 $diskname 0", + "TESTCONF pre-host-backup server localhost diskname2 $diskname ", + "TESTCONF post-host-backup server localhost diskname2 $diskname ", +); + +unlink $templog; +Installcheck::Run::cleanup(); diff --git a/man/Makefile.am b/man/Makefile.am index c060341..2525dee 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -6,38 +6,53 @@ AMPLOT_MAN_PAGES = amplot.8 COMMON_MAN_PAGES = amanda.8 \ amanda.conf.5 \ - amanda-client.conf.5 - -SERVER_MAN_PAGES = amadmin.8 \ - amcheck.8 \ - amcheckdb.8 \ - amcheckdump.8 \ - amcleanup.8 \ - amdd.8 \ - amdevcheck.8 \ - amdump.8 \ - amflush.8 \ - amgetconf.8 \ - amlabel.8 \ - ammt.8 \ - amoverview.8 \ - amreport.8 \ - amrmtape.8 \ - amstatus.8 \ - amtape.8 \ - amtapetype.8 \ - amtoc.8 \ - amverify.8 \ - amverifyrun.8 \ - amserverconfig.8 \ - amaddclient.8 \ - amcheckdump.8 \ - amcrypt.8 \ - amaespipe.8 \ - amgpgcrypt.8 \ - amcryptsimple.8 \ - amcrypt-ossl.8 \ - amcrypt-ossl-asym.8 + amanda-client.conf.5 \ + amanda-scripts.7 \ + amanda-archive-format.5 \ + amanda-auth.7 \ + amarchiver.8 \ + script-email.8 + +CLIENT_MAN_PAGES = \ + amanda-applications.7 \ + amgtar.8 \ + amsamba.8 \ + amstar.8 \ + amzfs-snapshot.8 \ + amzfs-sendrecv.8 + +SERVER_MAN_PAGES = \ + amanda-devices.7 \ + amanda-changers.7 \ + amaddclient.8 \ + amadmin.8 \ + amaespipe.8 \ + amcheck.8 \ + amcheckdb.8 \ + amcheckdump.8 \ + amcleanup.8 \ + amcrypt-ossl-asym.8 \ + amcrypt-ossl.8 \ + amcrypt.8 \ + amcryptsimple.8 \ + amdevcheck.8 \ + amdump.8 \ + amflush.8 \ + amgetconf.8 \ + amgpgcrypt.8 \ + amlabel.8 \ + amoverview.8 \ + amreport.8 \ + amrmtape.8 \ + amserverconfig.8 \ + amservice.8 \ + amstatus.8 \ + amtape.8 \ + amtapetype.8 \ + amtoc.8 \ + amvault.8 \ + disklist.5 \ + tapelist.5 RECOVER_MAN_PAGES = amrecover.8 @@ -45,7 +60,7 @@ RESTORE_MAN_PAGES = amrestore.8 \ amfetchdump.8 ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \ - $(COMMON_MAN_PAGES) \ + $(CLIENT_MAN_PAGES) \ $(COMMON_MAN_PAGES) \ $(SERVER_MAN_PAGES) \ $(RECOVER_MAN_PAGES) \ @@ -55,6 +70,9 @@ WANTED_MAN_PAGES = $(COMMON_MAN_PAGES) if WANT_AMPLOT WANTED_MAN_PAGES += $(AMPLOT_MAN_PAGES) endif +if WANT_CLIENT + WANTED_MAN_PAGES += $(CLIENT_MAN_PAGES) +endif if WANT_SERVER WANTED_MAN_PAGES += $(SERVER_MAN_PAGES) endif @@ -73,7 +91,7 @@ EXTRA_XML = xslt/expand-sambadoc.xsl \ xslt/man.xsl.in \ xslt/html.xsl.in \ xslt/settings.xsl \ - entities/global.entities \ + entities/global.entities.in \ entities/xinclude.dtd EXTRA_DIST = $(ALL_MAN_PAGES) $(MAN_XML) $(EXTRA_HTML) $(EXTRA_XML) @@ -86,17 +104,22 @@ MAINTAINERCLEANFILES = $(ALL_MAN_PAGES) # some of the XSL needs to know what docbook-xsl version we've selected %.xsl: %.xsl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< + rm -f config.log + +entities/global.entities: entities/global.entities.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + rm -f config.log if ENABLE_MANPAGE_BUILD # phase one of the documentation build expands some macros. -xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl +xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl entities/global.entities $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $< # phase two generates a manpage from the resulting "expanded" docbook XML -%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl +%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl entities/global.entities $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/man.xsl $< -%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl +%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl entities/global.entities $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/html.xsl $< else !ENABLE_MANPAGE_BUILD diff --git a/man/Makefile.in b/man/Makefile.in index 80f0d8f..fca1f53 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -34,14 +34,16 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ @WANT_AMPLOT_TRUE@am__append_1 = $(AMPLOT_MAN_PAGES) -@WANT_SERVER_TRUE@am__append_2 = $(SERVER_MAN_PAGES) -@WANT_RECOVER_TRUE@am__append_3 = $(RECOVER_MAN_PAGES) -@WANT_RESTORE_TRUE@am__append_4 = $(RESTORE_MAN_PAGES) +@WANT_CLIENT_TRUE@am__append_2 = $(CLIENT_MAN_PAGES) +@WANT_SERVER_TRUE@am__append_3 = $(SERVER_MAN_PAGES) +@WANT_RECOVER_TRUE@am__append_4 = $(RECOVER_MAN_PAGES) +@WANT_RESTORE_TRUE@am__append_5 = $(RESTORE_MAN_PAGES) subdir = man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -75,6 +77,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -97,7 +100,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -125,7 +130,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -136,7 +140,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -154,13 +157,16 @@ CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = man5dir = $(mandir)/man5 -am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" +am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ + "$(DESTDIR)$(man8dir)" +man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) transform = s,x,x,; ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -175,8 +181,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -188,16 +196,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -211,6 +231,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -218,7 +239,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -231,6 +252,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -241,9 +263,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -253,6 +278,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -277,8 +303,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -287,11 +315,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -305,6 +337,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -313,9 +346,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -323,7 +357,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -332,8 +368,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -341,7 +379,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -350,10 +387,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -369,6 +408,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -385,6 +426,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -393,7 +436,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -429,26 +471,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -456,7 +509,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -466,6 +523,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -475,7 +533,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -484,6 +549,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -512,6 +578,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -530,6 +597,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -559,64 +628,80 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AMPLOT_MAN_PAGES = amplot.8 COMMON_MAN_PAGES = amanda.8 \ amanda.conf.5 \ - amanda-client.conf.5 - -SERVER_MAN_PAGES = amadmin.8 \ - amcheck.8 \ - amcheckdb.8 \ - amcheckdump.8 \ - amcleanup.8 \ - amdd.8 \ - amdevcheck.8 \ - amdump.8 \ - amflush.8 \ - amgetconf.8 \ - amlabel.8 \ - ammt.8 \ - amoverview.8 \ - amreport.8 \ - amrmtape.8 \ - amstatus.8 \ - amtape.8 \ - amtapetype.8 \ - amtoc.8 \ - amverify.8 \ - amverifyrun.8 \ - amserverconfig.8 \ - amaddclient.8 \ - amcheckdump.8 \ - amcrypt.8 \ - amaespipe.8 \ - amgpgcrypt.8 \ - amcryptsimple.8 \ - amcrypt-ossl.8 \ - amcrypt-ossl-asym.8 + amanda-client.conf.5 \ + amanda-scripts.7 \ + amanda-archive-format.5 \ + amanda-auth.7 \ + amarchiver.8 \ + script-email.8 + +CLIENT_MAN_PAGES = \ + amanda-applications.7 \ + amgtar.8 \ + amsamba.8 \ + amstar.8 \ + amzfs-snapshot.8 \ + amzfs-sendrecv.8 + +SERVER_MAN_PAGES = \ + amanda-devices.7 \ + amanda-changers.7 \ + amaddclient.8 \ + amadmin.8 \ + amaespipe.8 \ + amcheck.8 \ + amcheckdb.8 \ + amcheckdump.8 \ + amcleanup.8 \ + amcrypt-ossl-asym.8 \ + amcrypt-ossl.8 \ + amcrypt.8 \ + amcryptsimple.8 \ + amdevcheck.8 \ + amdump.8 \ + amflush.8 \ + amgetconf.8 \ + amgpgcrypt.8 \ + amlabel.8 \ + amoverview.8 \ + amreport.8 \ + amrmtape.8 \ + amserverconfig.8 \ + amservice.8 \ + amstatus.8 \ + amtape.8 \ + amtapetype.8 \ + amtoc.8 \ + amvault.8 \ + disklist.5 \ + tapelist.5 RECOVER_MAN_PAGES = amrecover.8 RESTORE_MAN_PAGES = amrestore.8 \ amfetchdump.8 ALL_MAN_PAGES = $(AMPLOT_MAN_PAGES) \ - $(COMMON_MAN_PAGES) \ + $(CLIENT_MAN_PAGES) \ $(COMMON_MAN_PAGES) \ $(SERVER_MAN_PAGES) \ $(RECOVER_MAN_PAGES) \ $(RESTORE_MAN_PAGES) WANTED_MAN_PAGES = $(COMMON_MAN_PAGES) $(am__append_1) $(am__append_2) \ - $(am__append_3) $(am__append_4) + $(am__append_3) $(am__append_4) $(am__append_5) SRCMANPAGEDIR = $(srcdir)/xml-source MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml) EXTRA_XML = xslt/expand-sambadoc.xsl \ xslt/man.xsl.in \ xslt/html.xsl.in \ xslt/settings.xsl \ - entities/global.entities \ + entities/global.entities.in \ entities/xinclude.dtd @@ -711,6 +796,51 @@ uninstall-man5: echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done +install-man7: $(man7_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man7dir)" || $(MKDIR_P) "$(DESTDIR)$(man7dir)" + @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.7*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 7*) ;; \ + *) ext='7' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst"; \ + done +uninstall-man7: + @$(NORMAL_UNINSTALL) + @list='$(man7_MANS) $(dist_man7_MANS) $(nodist_man7_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.7*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 7*) ;; \ + *) ext='7' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man7dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man7dir)/$$inst"; \ + done install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" @@ -796,7 +926,7 @@ check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: - for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ + for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -851,7 +981,7 @@ install-html: install-html-am install-info: install-info-am -install-man: install-man5 install-man8 +install-man: install-man5 install-man7 install-man8 install-pdf: install-pdf-am @@ -877,7 +1007,7 @@ ps-am: uninstall-am: uninstall-man -uninstall-man: uninstall-man5 uninstall-man8 +uninstall-man: uninstall-man5 uninstall-man7 uninstall-man8 .MAKE: install-am install-strip @@ -887,27 +1017,32 @@ uninstall-man: uninstall-man5 uninstall-man8 install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-man5 install-man8 install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-man5 install-man7 install-man8 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-man uninstall-man5 uninstall-man8 + uninstall-man uninstall-man5 uninstall-man7 uninstall-man8 # some of the XSL needs to know what docbook-xsl version we've selected %.xsl: %.xsl.in $(top_builddir)/config.status $(top_builddir)/config.status --file=$@:$< + rm -f config.log + +entities/global.entities: entities/global.entities.in $(top_builddir)/config.status + $(top_builddir)/config.status --file=$@:$< + rm -f config.log # phase one of the documentation build expands some macros. -@ENABLE_MANPAGE_BUILD_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl +@ENABLE_MANPAGE_BUILD_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl entities/global.entities @ENABLE_MANPAGE_BUILD_TRUE@ $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $< # phase two generates a manpage from the resulting "expanded" docbook XML -@ENABLE_MANPAGE_BUILD_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl +@ENABLE_MANPAGE_BUILD_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl entities/global.entities @ENABLE_MANPAGE_BUILD_TRUE@ $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/man.xsl $< -@ENABLE_MANPAGE_BUILD_TRUE@%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl +@ENABLE_MANPAGE_BUILD_TRUE@%.html: xml-source/%.proc.xml $(srcdir)/xslt/html.xsl entities/global.entities @ENABLE_MANPAGE_BUILD_TRUE@ $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ xslt/html.xsl $< @ENABLE_MANPAGE_BUILD_FALSE@%: $(SRCMANPAGEDIR)/%.xml diff --git a/man/amaddclient.8 b/man/amaddclient.8 index 0857293..35d1cf7 100644 --- a/man/amaddclient.8 +++ b/man/amaddclient.8 @@ -1,22 +1,180 @@ .\" Title: amaddclient -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMADDCLIENT" "8" "08/22/2008" "" "" +.TH "AMADDCLIENT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amaddclient - program to add client to an existing Amanda configuration -.SH "SYNOPSIS" -.HP 12 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amaddclient \- program to add client to an existing \fIAmanda\fR configuration +.SH "Synopsis" +.fam C +.HP \w'\fBamaddclient\fR\ 'u \fBamaddclient\fR \-\-config \fIconfig\fR || \-\-client \fIclient\ name\fR || \-\-diskdev \fIdirectory\ to\ backup\fR [\-\-m] [\-\-dumptype\ \fIstring\fR] [\-\-includefile\ \fIstring\fR] [\-\-includelist\ \fIstring\fR] [\-\-excludefile\ \fIstring\fR] [\-\-excludelist\ \fIstring\fR] [\-\-user\ \fIstring\fR] [\-\-auth\ \fIstring\fR] [\-\-gnutar_list_dir\ \fIstring\fR] [\-\-amandates\ \fIstring\fR] [\-\-no\-client\-update] [\-\-batch] [\-\-help] +.fam .SH "DESCRIPTION" .PP After Amanda rpms are successfully installed and @@ -25,85 +183,90 @@ is run, \fBamaddclient\fR will add client to the \fIAmanda\fR -configuration\. +configuration\&. \fBamaddclient\fR create or update \fIAmanda\fR -disklist file and create or update /var/lib/amanda/\.amandahosts file on the server\. +\fBdisklist\fR(5) +file and create or update /var/lib/amanda/\&.amandahosts file on the server\&. .PP If \-\-no\-client\-update is not specified, \fBamaddclient\fR -will attempt to update or create /var/lib/amanda/\.amandahost, amanda\-client\.conf and gnutar\-lists on the client\. (See +will attempt to update or create /var/lib/amanda/\&.amandahost, amanda\-client\&.conf and gnutar\-lists on the client\&. (See ssh\-keygen(1) and ssh\-add(1) -for detail\.) +for detail\&.) .PP \fBamaddclient\fR -must be run by user amandabackup\. +must be run by user amandabackup\&. .PP -\-\-config, \-\-client and \-\-diskdev must be specified\. -.SH "OPTIONS" +\-\-config, \-\-client and \-\-diskdev must be specified\&. +.SH "Options" .PP .RS 4 -Options may be abbreviated, as long as the abbreviation is not ambiguous\. Option argument can either separated by \'=\' or a space\. -Example: \-\-conf=v253, \-\-client client8\.zmanda\.com +Options may be abbreviated, as long as the abbreviation is not ambiguous\&. Option argument can either separated by \'=\' or a space\&. +Example: \-\-conf=v253, \-\-client client8\&.zmanda\&.com .RE .PP \fB\-\-config config\fR .RS 4 \fIAmanda\fR -configuration which this program will add the client to\. +configuration which this program will add the client to\&. .RE .PP \fB\-\-client client\fR .RS 4 -The name of the client machine to add\. FQDN name recommended\. +The name of the client machine to add\&. FQDN name recommended\&. .RE .PP \fB\-\-diskdev diskdev\fR .RS 4 Directory for this \fIAmanda\fR -configuration to backup\. +configuration to backup\&. .RE .PP \fB\-\-m\fR .RS 4 -Modify existing entry in the disklist file\. +Modify existing entry in the +\fBdisklist\fR(5) +file\&. .sp -Note: if disklist file has been modified manually, this option might not work\. +Note: if +\fBdisklist\fR(5) +file has been modified manually, this option might not work\&. .RE .PP \fB\-\-dumptype dumptype\fR .RS 4 -dumptype to use\. Dumptype must be defined in /etc/amanda/template\.d/dumptypes or /etc/amanda/$config/amanda\.conf file\. Default: [user\-tar] +dumptype to use\&. Dumptype must be defined in /etc/amanda/template\&.d/dumptypes or /etc/amanda/$config/amanda\&.conf file\&. Default: [user\-tar] .RE .PP \fB\-\-user string\fR .RS 4 name of user using \fBamrecover\fR -on the client, default is root\. +on the client, default is root\&. .RE .PP \fB\-\-auth string\fR .RS 4 authentication method to use when running \fBamrecover\fR -from the client , default is bsdtcp\. +from the client , default is bsdtcp\&. .RE .PP \fB\-\-gnutar_list_dir string\fR .RS 4 -directory where gnutar keep its state file on the client\. Absolute path required\. Default is /var/lib/amanda/gnutar\-lists\. If \-\-no\-client\-update is not set, this program will attempt to create the directory on the client\. +directory where gnutar keep its state file on the client\&. Absolute path required\&. Default is /var/lib/amanda/gnutar\-lists\&. If \-\-no\-client\-update is not set, this program will attempt to create the directory on the client\&. .RE .PP \fB\-\-amandates string\fR .RS 4 -file where amanda keep the date of each dumplevel on the client, default is /etc/amandates\. +file where amanda keep the date of each dumplevel on the client, default is /etc/amandates\&. .RE .PP \fB\-\-batch\fR @@ -115,17 +278,17 @@ Turn on batch mode when copying files to the client, default is off .RS 4 If this option is set, \fBamaddclient\fR -will not attempt to update/create \.amandahosts, amanda\-client\.conf and gnutar\-lists file on the client\. +will not attempt to update/create \&.amandahosts, amanda\-client\&.conf and gnutar\-lists file on the client\&. .RE .PP \fB\-\-help\fR .RS 4 -Display usage\. +Display usage\&. .RE .PP .RS 4 -If any of the following four options are used, \fBamaddclient\fR will extend the dumptype definition to an in\-line definition in the disklist file\. See \fBamanda\fR(8) DISKLIST FILE section for detail\. +If any of the following four options are used, \fBamaddclient\fR will extend the dumptype definition to an in\-line definition in the \fBdisklist\fR(5) file\&. .RE .PP \fB\-\-includefile string\fR @@ -135,7 +298,7 @@ string is a glob expression .PP \fB\-\-includelist string\fR .RS 4 -string is a file name on the client containing glob expressions\. Specify either \-\-includefile or \-\-includelist\. +string is a file name on the client containing glob expressions\&. Specify either \-\-includefile or \-\-includelist\&. .RE .PP \fB\-\-excludefile string\fR @@ -145,11 +308,11 @@ string is a glob expression .PP \fB\-\-excludelist string\fR .RS 4 -string is a file name on the client containing glob expressions\. Specify either \-\-excludefile or \-\-excludelist\. +string is a file name on the client containing glob expressions\&. Specify either \-\-excludefile or \-\-excludelist\&. .RE -.SH "FILES" +.SH "Files" .PP -\fB/var/lib/amanda/template\.d\fR +\fB/var/lib/amanda/template\&.d\fR .RS 4 Amanda configuration template files install location .RE @@ -159,48 +322,45 @@ Amanda configuration template files install location amandabackup home directory .RE .PP -\fB/var/lib/amanda/\.amandahosts\fR +\fB/var/lib/amanda/\&.amandahosts\fR .RS 4 \fIAmanda\fR -authentication file\. +authentication file\&. .RE .PP \fB/var/lib/amanda/gnutar\-lists\fR .RS 4 -A directory which contains backup timestamp and list of files backed up\. +A directory which contains backup timestamp and list of files backed up\&. .RE .PP \fB/etc/amanda/$config\fR .RS 4 \fIAmanda\fR -configuration files location for $config(e\.g: DailySet1)\. +configuration files location for $config(e\&.g: DailySet1)\&. .RE .PP -\fB/etc/amanda/template\.d\fR +\fB/etc/amanda/template\&.d\fR .RS 4 A directory contains dumptypes and tapetypes files used by all \fIAmanda\fR -configurations\. +configurations\&. .RE .PP \fB/etc/amandates\fR .RS 4 \fIAmanda\fR -file on the client\. It keeps track of structures of previous dumps\. +file on the client\&. It keeps track of structures of previous dumps\&. .RE .PP \fB/tmp/amanda\fR .RS 4 directory contains \fIAmanda\fR -debug log files\. +debug log files\&. .RE .SH "RETURN VALUE" -On success, zero is returned\. On error, 1 is returned\. -.SH "AUTHOR" -.PP -The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\. +On success, zero is returned\&. On error, 1 is returned\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -210,3 +370,9 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBssh-add\fR(1) \fBscp\fR(1) : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amadmin.8 b/man/amadmin.8 index 871d679..c4455b3 100644 --- a/man/amadmin.8 +++ b/man/amadmin.8 @@ -1,32 +1,190 @@ .\" Title: amadmin -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMADMIN" "8" "08/22/2008" "" "" +.TH "AMADMIN" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amadmin - administrative interface to control Amanda backups -.SH "SYNOPSIS" -.HP 8 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amadmin \- administrative interface to control \fIAmanda\fR backups +.SH "Synopsis" +.fam C +.HP \w'\fBamadmin\fR\ 'u \fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [\fB\-o\ \fR\fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmadmin\fR performs various administrative tasks on the \fIconfig\fR \fIAmanda\fR -configuration\. +configuration\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "COMMANDS" .PP Commands that take a @@ -34,31 +192,31 @@ Commands that take a [ \fIdisks\fR ] parameter pair operate on all disks in the -\fIdisklist\fR +\fBdisklist\fR(5) for that \fIhostname\fR -if no disks are specified\. Where +if no disks are specified\&. Where \fIhostname\fR is also marked as being optional, the command operates on all hosts and disks in the -\fIdisklist\fR\. Both +\fBdisklist\fR(5)\&. Both \fIhostname\fR and \fIdisks\fR are special expressions; see the "HOST & DISK EXPRESSION" section of \fBamanda\fR(8) -for a description\. +for a description\&. .PP Commands that take one or more \fIdumpspec\fR -parameters operate on the set of dumps specified by all of the expressions\. See the "DUMP SPECIFICATIONS" section of +parameters operate on the set of dumps specified by all of the expressions\&. See the "DUMP SPECIFICATIONS" section of \fBamanda\fR(8) -for a description\. +for a description\&. .PP \fBversion\fR .RS 4 -Show the current version and some compile time and runtime parameters\. The +Show the current version and some compile time and runtime parameters\&. The \fIconfig\fR -parameter must be present but is ignored\. +parameter must be present but is ignored\&. .RE .PP \fBforce\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ @@ -69,7 +227,7 @@ on \fIhostname\fR to bump to a new incremental level during the next \fIAmanda\fR -run\. +run\&. .RE .PP \fBforce\-no\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ @@ -80,7 +238,7 @@ on \fIhostname\fR to not bump to a new incremental level during the next \fIAmanda\fR -run\. +run\&. .RE .PP \fBunforce\-bump\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ @@ -89,7 +247,7 @@ Undo a previous \fBforce\-bump\fR or \fBforce\-no\-bump\fR -command\. +command\&. .RE .PP \fBforce\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ @@ -100,45 +258,45 @@ on \fIhostname\fR to do a full (level 0) backup during the next \fIAmanda\fR -run\. +run\&. .RE .PP \fBunforce\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ .RS 4 Undo a previous \fBforce\fR -command\. +command\&. .RE .PP -\fBreuse\fR \fItapelabel\fR [ \.\.\. ] +\fBreuse\fR \fItapelabel\fR [ \&.\&.\&. ] .RS 4 -The tapes listed will be available for reuse at their point in the tape cycle\. +The tapes listed will be available for reuse at their point in the tape cycle\&. .RE .PP -\fBno\-reuse\fR \fItapelabel\fR [ \.\.\. ] +\fBno\-reuse\fR \fItapelabel\fR [ \&.\&.\&. ] .RS 4 -The tapes listed will not be reused when their turn comes up again in the tape cycle\. Note that if this causes the number of reusable tapes to drop below the -\fBamanda\.conf\fR +The tapes listed will not be reused when their turn comes up again in the tape cycle\&. Note that if this causes the number of reusable tapes to drop below the +\fBamanda\&.conf\fR \fItapecycle\fR value, \fIAmanda\fR -will request new tapes until the count is satisfied again\. +will request new tapes until the count is satisfied again\&. .sp Tape marked \fIno\-reuse\fR are available for recovery, marking them \fIno\-reuse\fR -is a security to be sure amanda will not overwrite them\. +is a security to be sure amanda will not overwrite them\&. .RE .PP \fBdue\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]* .RS 4 -Show when the next full dump is due\. +Show when the next full dump is due\&. .RE .PP -\fBfind\fR [ \fB\-\-sort\fR \fIhkdlpb\fR ] [ \fIhostname\fR [ \fIdisks\fR ]* ]* +\fBfind\fR [ \fB\-\-sort\fR \fIhkdlpbfw\fR ] [ \fIhostname\fR [ \fIdisks\fR ]* ]* .RS 4 -Display all backups currently on tape or in the holding disk\. The tape label or holding disk filename, file number, and status are displayed\. +Display all backups currently on tape or in the holding disk\&. The tape label or holding disk filename, file number, and status are displayed\&. .sp The \fB\-\-sort\fR @@ -147,28 +305,30 @@ option changes the sort order using the following flags: .nf \fIh\fR: host name \fIk\fR: disk name -\fId\fR: dump date +\fId\fR: dump timestamp \fIl\fR: backup level \fIp\fR: dump part \fIb\fR: tape label +\fIf\fR: filenum on tape +\fIw\fR: write timestamp .fi .sp -An uppercase letter reverses the sort order for that key\. The default sort order is -\fBhkdlpb\fR\. +An uppercase letter reverses the sort order for that key\&. The default sort order is +\fBhkdlpbfw\fR\&. .RE .PP -\fBholding delete\fR \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \.\. ] ] ] +\fBholding delete\fR \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \&.\&. ] ] ] .RS 4 -Delete holding files matching the given specification\. At least a hostname must be provided\. +Delete holding files matching the given specification\&. At least a hostname must be provided\&. .RE .PP -\fBholding list\fR [\-l] [\-d] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \.\. ] ] ] ] +\fBholding list\fR [\-l] [\-d] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ \&.\&. ] ] ] ] .RS 4 -List holding files matching the given specification, or all holding files if no specification is provided\. With \'\-l\', additional information (size, level, and whether the dump is outdated) is provided\. With \'\-d\', only outdated dumps are shown\. +List holding files matching the given specification, or all holding files if no specification is provided\&. With \'\-l\', additional information (size, level, and whether the dump is outdated) is provided\&. With \'\-d\', only outdated dumps are shown\&. .sp An outdated holding file is one which is not required for a restore of the \fImost recent\fR -dump\. Note that outdated dumps may still be required for restores at earlier dates\. For example, assume that a DLE had a level 0 on Monday, level 1\'s Tuesday through Thursday, and a level 2 on Friday\. Then the files required for a restore of Fridays (the most recent) dump are those from Monday (level 0), Thursday (level 1), and Friday (level 2)\. Tuesday and Wednesday\'s files are outdated\. +dump\&. Note that outdated dumps may still be required for restores at earlier dates\&. For example, assume that a DLE had a level 0 on Monday, level 1\'s Tuesday through Thursday, and a level 2 on Friday\&. Then the files required for a restore of Fridays (the most recent) dump are those from Monday (level 0), Thursday (level 1), and Friday (level 2)\&. Tuesday and Wednesday\'s files are outdated\&. .RE .PP \fBdelete\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+ @@ -179,36 +339,46 @@ on \fIhostname\fR from the \fIAmanda\fR -database\. +database\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br If you do not also remove the disk from the -\fIdisklist\fR +\fBdisklist\fR(5) file, \fIAmanda\fR -will treat it as a new disk during the next run\. +will treat it as a new disk during the next run\&. +.sp .5v +.EM yellow +.RE .RE .PP \fBtape\fR .RS 4 Display the tape(s) \fIAmanda\fR -expects to write to during the next run\. See also -\fBamcheck\fR(8)\. +expects to write to during the next run\&. See also +\fBamcheck\fR(8)\&. .RE .PP \fBbumpsize\fR .RS 4 -Display the current bump threshold parameters, calculated for all backup levels\. +Display the current bump threshold parameters, calculated for all backup levels\&. .RE .PP \fBbalance\fR [ \fB\-\-days\fR \fI\fR ] .RS 4 -Display the distribution of full backups throughout the dump schedule\. +Display the distribution of full backups throughout the dump schedule\&. .RE .PP \fBexport\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]* @@ -218,7 +388,7 @@ Convert records from the database to a text format that may be transmitted to another \fIAmanda\fR machine and -\fBimport\fRed\. +\fBimport\fRed\&. .RE .PP \fBimport\fR @@ -226,18 +396,18 @@ machine and Convert \fBexport\fRed records read from standard input to a form \fIAmanda\fR -uses and insert them into the database on this machine\. +uses and insert them into the database on this machine\&. .RE .PP \fBdisklist\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]* .RS 4 Display the -\fIdisklist\fR +\fBdisklist\fR(5) information for each of the \fIdisks\fR on \fIhostname\fR -(or all hosts)\. Mostly used for debugging\. +(or all hosts)\&. Mostly used for debugging\&. .RE .PP \fBinfo\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]* @@ -246,13 +416,13 @@ Display the database record for each of the \fIdisks\fR on \fIhostname\fR -(or all hosts)\. Mostly used for debugging\. +(or all hosts)\&. Mostly used for debugging\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "EXAMPLES" .PP @@ -260,54 +430,54 @@ Request three specific file systems on \fImachine\-a\fR get a full level 0 backup during the next \fIAmanda\fR -run\. +run\&. .nf $ amadmin daily force machine\-a / /var /usr -amadmin: machine\-a:/ is set to a forced level 0 tonight\. -amadmin: machine\-a:/var is set to a forced level 0 tonight\. -amadmin: machine\-a:/usr is set to a forced level 0 tonight\. +amadmin: machine\-a:/ is set to a forced level 0 tonight\&. +amadmin: machine\-a:/var is set to a forced level 0 tonight\&. +amadmin: machine\-a:/usr is set to a forced level 0 tonight\&. .fi .PP Request all file systems on \fImachine\-b\fR get a full level 0 backup during the next \fIAmanda\fR -run\. +run\&. .nf $ amadmin daily force machine\-b -amadmin: machine\-b:/ is set to a forced level 0 tonight\. -amadmin: machine\-b:/var is set to a forced level 0 tonight\. -amadmin: machine\-b:/usr is set to a forced level 0 tonight\. -amadmin: machine\-b:/home is set to a forced level 0 tonight\. +amadmin: machine\-b:/ is set to a forced level 0 tonight\&. +amadmin: machine\-b:/var is set to a forced level 0 tonight\&. +amadmin: machine\-b:/usr is set to a forced level 0 tonight\&. +amadmin: machine\-b:/home is set to a forced level 0 tonight\&. .fi .PP Undo the previous \fBforce\fR request for -\fI/home\fR +\FC/home\F[] on -\fImachine\-b\fR\. The other file systems will still get a full level 0 backup\. +\fImachine\-b\fR\&. The other file systems will still get a full level 0 backup\&. .nf $ amadmin daily unforce machine\-b /home -amadmin: force command for machine\-b:/home cleared\. +amadmin: force command for machine\-b:/home cleared\&. .fi .PP Locate backup images of -\fI/var\fR +\FC/var\F[] from -\fImachine\-c\fR\. The +\fImachine\-c\fR\&. The \fItape or file\fR -column displays either a tape label or a filename depending on whether the image is on tape or is still in the holding disk\. If the image is on tape, the +column displays either a tape label or a filename depending on whether the image is on tape or is still in the holding disk\&. If the image is on tape, the \fIfile\fR -column tells you which file on the tape has the image (file number zero is a tape label)\. This column shows zero and is not meaningful if the image is still in the holding disk\. The +column tells you which file on the tape has the image (file number zero is a tape label)\&. This column shows zero and is not meaningful if the image is still in the holding disk\&. The \fIstatus\fR -column tells you whether the backup was successful or had some type of error\. +column tells you whether the backup was successful or had some type of error\&. .nf $ amadmin daily find machine\-c /var date host disk lv tape or file file part status 2000\-11\-09 machine\-c /var 0 000110 9 \-\- OK 2000\-11\-08 machine\-c /var 2 000109 2 \-\- OK -2000\-11\-07 machine\-c /var 2 /amanda/20001107/machine\-c\._var\.2 0 OK +2000\-11\-07 machine\-c /var 2 /amanda/20001107/machine\-c\&._var\&.2 0 OK 2000\-11\-06 machine\-c /var 2 000107 2 \-\- OK 2000\-11\-05 machine\-c /var 2 000106 3 \-\- OK 2000\-11\-04 machine\-c /var 2 000105 2 \-\- OK @@ -318,80 +488,71 @@ date host disk lv tape or file file part status .fi .PP Forget about the -\fI/workspace\fR +\FC/workspace\F[] disk on -\fImachine\-d\fR\. If you do not also remove the disk from the -\fIdisklist\fR +\fImachine\-d\fR\&. If you do not also remove the disk from the +\fBdisklist\fR(5) file, \fIAmanda\fR -will treat it as a new disk during the next run\. +will treat it as a new disk during the next run\&. .nf $ amadmin daily delete machine\-d /workspace -amadmin: machine\-d:/workspace deleted from database\. -amadmin: NOTE: you\'ll have to remove these from the disklist yourself\. +amadmin: machine\-d:/workspace deleted from database\&. +amadmin: NOTE: you\'ll have to remove these from the \fBdisklist\fR(5) yourself\&. .fi .PP Find the next tape \fIAmanda\fR will use (in this case, -123456)\. +\FC123456\F[])\&. .nf $ amadmin daily tape -The next \fIAmanda\fR run should go onto tape 123456 or a new tape\. +The next \fIAmanda\fR run should go onto tape 123456 or a new tape\&. .fi .PP -Show how well full backups are balanced across the dump cycle\. The +Show how well full backups are balanced across the dump cycle\&. The \fIdue\-date\fR -column is the day the backups are due for a full backup\. +column is the day the backups are due for a full backup\&. \fI#fs\fR shows the number of filesystems doing full backups that night, and \fIorig KB\fR and \fIout KB\fR -show the estimated total size of the backups before and after any compression, respectively\. +show the estimated total size of the backups before and after any compression, respectively\&. .PP The \fIbalance\fR -column shows how far off that night\'s backups are from the average size (shown at the bottom of the balance column)\. +column shows how far off that night\'s backups are from the average size (shown at the bottom of the balance column)\&. \fIAmanda\fR tries to keep the backups within +/\- 5%, but since the amount of data on each filesystem is always changing, and \fIAmanda\fR -will never delay backups just to rebalance the schedule, it is common for the schedule to fluctuate by larger percentages\. In particular, in the case of a tape or backup failure, a bump will occur the following night, which will not be smoothed out until the next pass through the schedule\. +will never delay backups just to rebalance the schedule, it is common for the schedule to fluctuate by larger percentages\&. In particular, in the case of a tape or backup failure, a bump will occur the following night, which will not be smoothed out until the next pass through the schedule\&. .PP The last line also shows an estimate of how many \fIAmanda\fR -runs will be made between full backups for a file system\. In the example, a file system will probably have a full backup done every eight times +runs will be made between full backups for a file system\&. In the example, a file system will probably have a full backup done every eight times \fIAmanda\fR -is run (e\.g\. every eight days)\. +is run (e\&.g\&. every eight days)\&. .nf $ amadmin daily balance due\-date #fs orig KB out KB balance \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -11/10 Mon 21 930389 768753 +5\.1% -11/11 Tue 29 1236272 733211 +0\.2% -11/12 Wed 31 1552381 735796 +0\.6% -11/13 Thu 23 1368447 684552 \-6\.4% -11/14 Fri 32 1065603 758155 +3\.6% -11/15 Sat 14 1300535 738430 +0\.9% -11/16 Sun 31 1362696 740365 +1\.2% -11/17 Mon 30 1427936 773397 +5\.7% -11/18 Tue 11 1059191 721786 \-1\.3% -11/19 Wed 19 1108737 661867 \-9\.5% +11/10 Mon 21 930389 768753 +5\&.1% +11/11 Tue 29 1236272 733211 +0\&.2% +11/12 Wed 31 1552381 735796 +0\&.6% +11/13 Thu 23 1368447 684552 \-6\&.4% +11/14 Fri 32 1065603 758155 +3\&.6% +11/15 Sat 14 1300535 738430 +0\&.9% +11/16 Sun 31 1362696 740365 +1\&.2% +11/17 Mon 30 1427936 773397 +5\&.7% +11/18 Tue 11 1059191 721786 \-1\&.3% +11/19 Wed 19 1108737 661867 \-9\&.5% \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- TOTAL 241 12412187 7316312 731631 (estimated 8 runs per dumpcycle) .fi .SH "FILES" .PP -/usr/local/etc/amanda/\fIconfig\fR/amanda\.conf -.SH "AUTHOR" -.PP -James da Silva, - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +/usr/local/etc/amanda/\fIconfig\fR/amanda\&.conf .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -400,3 +561,8 @@ Stefan G\. Weichinger, \fBamrestore\fR(8), \fBamfetchdump\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amaespipe.8 b/man/amaespipe.8 index 5bf7451..383192e 100644 --- a/man/amaespipe.8 +++ b/man/amaespipe.8 @@ -1,20 +1,178 @@ .\" Title: amaespipe -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMAESPIPE" "8" "08/22/2008" "" "" +.TH "AMAESPIPE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amaespipe - wrapper program for aespipe -.SH "SYNOPSIS" -.HP 10 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amaespipe \- wrapper program for aespipe +.SH "Synopsis" +.fam C +.HP \w'\fBamaespipe\fR\ 'u \fBamaespipe\fR +.fam .SH "DESCRIPTION" .PP @@ -24,12 +182,12 @@ requires \fBuuencode\fR and \fBgpg\fR -to work\. Aespipe is available from +to work\&. Aespipe is available from : http://loop-aes.sourceforge.net .PP \fBamaespipe\fR -will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\. +will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\&. .PP \fBamaespipe\fR @@ -37,15 +195,15 @@ is called by \fBamcrypt\fR for \fIAmanda\fR -data encryption\. +data encryption\&. .PP \fBamaespipe\fR -is based on aespipe\'s bzaespipe program\. It calls aespipe to encrypt data using AES256 as the encryption and SHA256 as the hash function\. GPG key should be stored in $AMANDA_HOME/\.gnupg/am_key\.gpg\. +is based on aespipe\'s bzaespipe program\&. It calls aespipe to encrypt data using AES256 as the encryption and SHA256 as the hash function\&. GPG key should be stored in $AMANDA_HOME/\&.gnupg/am_key\&.gpg\&. \fBamaespipe\fR -reads passphrase from file descriptor 3\. During decryption, +reads passphrase from file descriptor 3\&. During decryption, \fBamaespipe\fR -autodects encryption type and hash function from the encrypted image\. +autodects encryption type and hash function from the encrypted image\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -54,3 +212,9 @@ autodects encryption type and hash function from the encrypted image\. \fBamcrypt\fR(8), \fBgpg\fR(1), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-applications.7 b/man/amanda-applications.7 new file mode 100644 index 0000000..9c9e9e0 --- /dev/null +++ b/man/amanda-applications.7 @@ -0,0 +1,241 @@ +.\" Title: amanda-applications +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: Miscellanea +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-APPLICATIONS" "7" "01/22/2009" "Amanda 2\&.6\&.1" "Miscellanea" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-applications \- Application\-api for amanda +.SH "DESCRIPTION" +.PP +Describe how to use application with +\fIAmanda\fR +.SH "APPLICATIONS" +.PP +This section lists the applications included with +\fIAmanda\fR\&. See the individual man pages for instructions on using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamgtar\fR(8), +\- use GNU Tar to backup and restore data\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamsamba\fR(8), +\- use smbclient to backup and restore data\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamstar\fR(8), +\- use star to backup and restore data\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamzfs-sendrecv\fR(8), +\- use zfs to create a snapshot and use \'zfs send\' to generate the backup\&. +.RE +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-archive-format.5 b/man/amanda-archive-format.5 new file mode 100644 index 0000000..46bbb50 --- /dev/null +++ b/man/amanda-archive-format.5 @@ -0,0 +1,224 @@ +.\" Title: amanda-archive-format +.\" Author: Dustin J. Mitchell +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: File formats and conventions +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-ARCHIVE\-FOR" "5" "01/22/2009" "Amanda 2\&.6\&.1" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-archive-format \- Format of amanda archive streams +.SH "DESCRIPTION" +.PP +The +\fIAmanda\fR +archive format is designed to be a simple, efficient means of interleaving multiple simultaneous files, allowing an arbitrary number of data streams for a file\&. It is a streaming format in the sense that the writer need not know the size of files until they are completely written to the archive, and the reader can process the archive in constant space\&. +.SH "DATA MODEL" +.PP +The data stored in an archive consists of an unlimited number of files\&. Each file consists of a number of "attributes", each identified by a 16\-bit ID\&. Each attribute can contain an unlimited amount of data\&. +.PP +Attribute IDs less than 16 (AMAR_ATTR_APP_START) are reserved for special purposes, but the remaining IDs are available for application\-specific uses\&. +.SH "STRUCTURE" +.SS "RECORDS" +.PP +A record can be either a header record or a data record\&. A header record serves as a "checkpoint" in the file, with a magic value that can be used to recognize archive files\&. +.PP +A header record has a fixed size of 28 bytes, as follows: +.sp +.nf + 28 bytes: magic string +.fi +The magic string is the ASCII text "AMANDA ARCHIVE FORMAT " followed by a decimal representation of the format version number (currently \'1\'), padded to 28 bytes with NUL bytes\&. +.PP +A data record has a variable size, as follows: +.sp +.nf + 2 bytes: file number + 2 bytes: attribute ID + 4 bytes: data size (N) + N bytes: data +.fi +The file number and attribute ID serve to identify the data stream to which this data belongs\&. The low 31 bits of the data size give the number of data bytes following, while the high bit (the EOA bit) indicates the end of the attribute, as described below\&. Because records are generally read into memory in their entirety, the data size must not exceed 4MB (4194304 bytes)\&. All integers are in network byte order\&. +.PP +A header record is distinguished from a data record by the magic string\&. The file number 0x414d, corresponding to the characters "AM", is forbidden and must be skipped on writing\&. +.PP +Attribute ID 0 (AMAR_ATTR_FILENAME) gives the filename of a file\&. This attribute is mandatory for each file, must be nonempty, must fit in a single record, and must precede any other attributes for the same file in the archive\&. The filename should be a printable string (ASCII or UTF\-8), to facilitate use of generic archive\-display utilities, but the format permits any nonempty bytestring\&. The filename cannot span multiple records\&. +.PP +Attribute ID 1 (AMAR_ATTR_EOF) signals the end of a file\&. This attribute must contain no data, but should have the EOA bit set\&. +.SS "CONNECTION TO DATA MODEL" +.PP +Each file in an archive is assigned a file number distinct from any other active file in the archive\&. The first record for a file must have attribute ID 0 (AMAR_ATTR_FILENAME), indicating a filename\&. A file ends with an empty record with ID 1 (AMAR_ATTR_EOF)\&. For every file at which a reader might want to begin reading, the filename record should be preceded by a header record\&. How often to write header records is left to the discretion of the application\&. +.PP +All data records with the same file number and attribute ID are considered a part of the same attribute\&. The boundaries between such records are not significant to the contents of the attribute, and both readers and writers are free to alter such boundaries as necessary\&. +.PP +The final data record for each attribute has the high bit (the EOA bit) of its data size field set\&. A writer must not reuse an attribute ID within a file\&. An attribute may be terminated by a record containing both data and an EOA bit, or by a zero\-length record with its EOA bit set\&. +.SH "SEE ALSO" +.PP + +\fBamanda\fR(8), +.SH "Author" +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-auth.7 b/man/amanda-auth.7 new file mode 100644 index 0000000..966a3d3 --- /dev/null +++ b/man/amanda-auth.7 @@ -0,0 +1,835 @@ +.\" Title: amanda-auth +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: Miscellanea +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-AUTH" "7" "01/22/2009" "Amanda 2\&.6\&.1" "Miscellanea" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-auth \- Communication/Authentication methods between \fIAmanda\fR server and client +.SH "DESCRIPTION" +.PP +\fIAmanda\fR +offers 7 methods of communication between Amanda server (sometimes also called the tape server) and clients, each with its own authentication method\&. The desired communication method is specified by the +\fIauth\fR +parameter in the amanda\&.conf file (\fBamanda.conf\fR(5)) commonly as a dumptype\&. Valid values to the +\fIauth\fR +parameter are +\fBbsd\fR, +\fBbsdudp\fR, +\fBbsdtcp\fR, +\fBkrb4\fR, +\fBkrb5\fR, +\fBlocal\fR, +\fBrsh\fR, and +\fBssh\fR\&. Please note that +\fBkrb4\fR +will be removed in the next release\&. The authentication and communication method is used during the backup process +\fBamdump\fR +(amdump(8)) as well as the recovery process +\fBamrecover\fR +(amrecover(8))\&. For detailed information, please see http://wiki\&.zmanda\&.com/index\&.php/Server/Client_authentication\&. +.SH "COMPILATION AND GENERAL INFORMATION" +.PP +The communication method and thus type of authentication that will be used by the Amanda server is specified by the +\fIauth\fR +parameter in the dumptype for each disklist entry (DLE)\&. The +\fIauth\fR +parameter thus may be easily and globally specified in the "global" dumptype\&. If +\fIauth\fR +is not specified, the +\fBbsd\fR +communication method is used\&. See +\fBamanda.conf\fR(5) +for more information on Amanda configuration and dumptypes, and +\fBdisklist\fR(5) +for more information on disklists\&. +.PP +On the client side, the Amanda daemon +\fBamandad\fR +validates the connection depending on the value of the +\fBauth\fR +argument passed to it (see +\fIAmanda\fR(8))\&. Also, when it comes to recovery, the +\fBauth\fR +parameter can be specified in the +\fBamanda-client.conf\fR(5) +file to specify the communication method to be used by the client to the server\&. +.PP +When +\fIAmanda\fR +is being built from source code, desired communication and thus authentication methods (shown as "Authentication") must be specified as configure options at compilation time\&. +.sp +.nf +Authentication Configure option(s) + bsd \-\-with\-bsd\-security \-\-with\-amandahosts (pre\-2\&.6) + bsdtcp \-\-with\-bsdtcp\-security \-\-with\-amandahosts (pre\-2\&.6) + bsdudp \-\-with\-bsdudp\-security \-\-with\-amandahosts (pre\-2\&.6) + krb5 \-\-with\-krb5\-security + local (always included) + rsh \-\-with\-rsh\-security + ssh \-\-with\-ssh\-security +.fi +.PP +There are additional configure options for +\fBbsd\fR, +\fBbsdudp\fR, and +\fBbsdtcp\fR +to allow for specifying explicit UDP and TCP port ranges\&. +.sp +.nf + \-\-with\-udpportrange + \-\-with\-tcpportrange + \-\-with\-low\-tcpportrange +.fi +.PP +See +\fBPORT USAGE\fR +below for more information\&. +.PP +There are additional configure options for Kerberos if you so desire\&. All but the last option are for Kerberos 4\&. Defaults shown in square brackets\&. +.sp +.nf + \-\-with\-server\-principal=ARG server host principal [amanda] + \-\-with\-server\-instance=ARG server host instance [] + \-\-with\-server\-keyfile=ARG server host key file [/\&.amanda] + \-\-with\-client\-principal=ARG client host principal [rcmd] + \-\-with\-client\-instance=ARG client host instance [HOSTNAME_INSTANCE] + \-\-with\-client\-keyfile=ARG client host key file [KEYFILE] + \-\-with\-ticket\-lifetime=ARG ticket lifetime [128] + \-\-with\-krb4\-security=DIR where libkrb\&.a lives [see below] + \-\-with\-krb5\-security=DIR where libkrb\&.a lives [see below] +.fi +.PP +If configuring with \-\-with\-krb4\-security and/or \-\-with\-krb5\-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb\&.a, in this order\&. Kerberos support will not be added if it does not find them\&. If the kerberos bits are found under some other hierarchy, you can specify this via \-\-with\-krb5\-security=DIR and/or \-\-with\-krb4\-security=DIR, where DIR is where the kerberos bits live\&. The configure script will then look in the \'lib\' directory under this hierarchy for libkrb\&.a\&. +.PP +The +\fBauth\fR +parameter selects a communication/authentication method to use between the client and the backup server\&. These methods are described each in their own section below\&. +.SH "BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION" +.PP +For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_bsd/bsdudp/bsdtcp_authentication\&. +.PP +The +\fBbsd\fR, +\fBbsdudp\fR, and +\fBbsdtcp\fR +communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients\&. +.PP +In addition to compilation and general configuration (see +\fBCOMPILATION AND GENERAL INFORMATION\fR +above), the authentication method that the client is configured to receive is specified by the +\fBauth\fR +parameter in the network service configuration for +\fIAmanda\fR\&. The authentication method used by an Amanda client to reach the server during recovery is the authentication method specified by the +\fIauth\fR +parameter in the client\'s Amanda network service configuration or in its amanda\-client\&.conf file (see amanda\-client\&.conf(5))\&. +.SS "\&.amandahosts file" +.PP +Servers and clients using the bsd, bsdudp, and bsdtcp authentication methods refer to the \&.amandahosts file to control access\&. Amanda should be compiled for this access control if one of these methods will be used and is the default compilation option for Amanda 2\&.6 (use \-\-with\-amandahosts when compiling pre\-2\&.6 versions of Amanda)\&. +.PP +Amanda looks for the \&.amandahosts file in the Amanda user\'s home directory, commonly /var/lib/amanda\&. +.PP +Each authorization is on its own line in the following format +.PP +\fIhostname\fR +[ +\fIusername\fR +[ +\fIservice\&.\&.\&.\fR +] ] +.PP +If +\fIusername\fR +is ommitted, it defaults to the user running +\fBamandad\fR, i\&.e\&. the user listed in the +\fBinetd\fR +or +\fBxinetd\fR +configuration file\&. +.PP +\fIservice\&.\&.\&.\fR +is a space\-delimited list of services the client is authorized to execute: +\fBnoop\fR, +\fBselfcheck\fR, +\fBsendsize\fR, +\fBsendbackup\fR, +\fBamdump\fR +(a shortcut for the previous four services which are required on clients), +\fBamindexd\fR, and +\fBamidxtaped\fR\&. The last two services are required on a server for clients to connect to it using +\fBamrecover\fR\&. +.PP +Example of the \&.amandahosts file on an Amanda client +.sp +.nf + \fBamandaserver\&.example\&.com amandabackup amdump\fR +.fi +.PP +Example of the \&.amandahosts file on an Amanda server +.sp +.nf + \fBamandaclient1\&.example\&.com root amindexd amidxtaped\fR +.fi +.SS "bsd communication and authentication" +.PP +The authentication is done using \&.amandahosts file in the Amanda user\'s home directory\&. The protocol between Amanda server and client is UDP\&. The number of disk list entries (DLEs)\-\-number of Amanda clients\-\-is limited by the UDP packet size\&. This authentication protocol will use a different port for each data stream (see PORT USAGE below) +.SS "bsdudp communication and authentication" +.PP +The authentication is done using \&.amandahosts files in the Amanda user\'s home directory\&. It uses UDP protocol between Amanda server and client for data and hence the number of DLEs is limited by the UDP packet size\&. It uses one TCP port to establish the connection and multiplexes all data streams using one port on the server (see PORT USAGE below)\&. +.SS "bsdtcp communication and authentication" +.PP +The authentication is done using \&.amandahosts files in the backup user\'s (for example: amandabackup) home directory\&. It uses TCP protocol between Amanda server and client\&. On the client, two reserved ports are used\&. On the server, all data streams are multiplexed to one port (see PORT USAGE below)\&. +.SS "USING INETD SERVER" +.PP +Template for Amanda client inetd service entry +.sp +.nf +\fI service_name\fR \fIsocket_type\fR \fIprotocol\fR \fIwait/nowait\fR \fIamanda_backup_user\fR \fIabsolute_path_to_amandad\fR amandad \fIserver_args\fR +.fi +.PP +Client example of using +\fBbsd\fR +authorization for inetd server given Amanda user is "amandabackup": +.sp +.nf +\fB amanda dgram udp wait amandabackup /path/to/amandad amandad \-auth=bsd amdump\fR +.fi +.PP +The same could be used for +\fBbsdudp\fR +if specifying \-auth=bsdudp instead of \-auth=bsd\&. +.PP +Client example of using +\fBbsdtcp\fR +authorization for inetd server given Amanda user is "amandabackup": +.sp +.nf +\fB amanda stream tcp nowait amanda /path/to/amandad amandad \-auth=bsdtcp amdump\fR +.fi +.PP +\fBamindexd\fR +and +\fBamidxtaped\fR +would typically be added at the end of the line as +\fBamandad\fR +server arguments for an Amanda server\&. +.PP +Server example of using +\fBbsdtcp\fR +authorization for inetd server given Amanda user is "amandabackup": +.sp +.nf +\fB amanda stream tcp nowait amanda /path/to/amandad amandad \-auth=bsdtcp amdump amindexd amidxtaped\fR +.fi +.PP +For Amanda version 2\&.5\&.0 and earlier, remember that neither +\fBbsdudp\fR +nor +\fBbsdtcp\fR +are supported and the Amanda daemon +\fBamandad\fR +accepts no arguments\&. Because of the latter, +\fBamrecover\fR +as of Amanda version 2\&.5\&.1 is not compatible with 2\&.5\&.0 and earlier servers\&. Thus, servers that are 2\&.5\&.0 or earlier must, in addition to the +\fIamanda\fR +service, run +\fIamindexd\fR +and +\fIamidxtaped\fR +Amanda services as their own network services, amandaidx and amidxtape, respectively (see below)\&. +.PP +There are no compatibility issues if server and clients are all 2\&.5\&.0 or earlier\&. If your server is 2\&.5\&.1 or later, you can still have clients that are 2\&.5\&.0 and earlier although you must then use +\fBbsd\fR +communication/authentication with these clients and must also run +\fIamindexd\fR +and +\fIamidxtaped\fR +Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below)\&. If you have a server that is 2\&.5\&.0 and earlier, clients of a later version on which you wish to run +\fBamrecover\fR +must use +\fBamoldrecover\fR +instead and, again, the server must be running the amandaidx and amidxtape network services\&. +.PP +Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2\&.5\&.0 or earlier server or a newer server having 2\&.5\&.0 or earlier clients +.sp +.nf +\fB amandaidx stream tcp nowait amanda /usr/local/libexec/amanda/current/amindexd amindexd\fR +\fB amidxtape stream tcp nowait amanda /usr/local/libexec/amanda/current/amidxtaped amidxtaped\fR +.fi +.SS "USING XINETD SERVER" +.PP +Template for Amanda client xinetd service file +.sp +.nf +service amanda +{ + only_from = \fIAmanda server\fR + socket_type = \fIsocket type\fR + protocol = \fIprotocol\fR + wait = \fIyes/no\fR + user = \fIamanda backup user\fR + group = \fIamanda backup user group id\fR + groups = yes + server = \fIabsolute path to amandad\fR + server_args = \fIamandad server arguments\fR + disable = no +} +.fi +.PP +The +\fIonly_from\fR +parameter can be used with xinetd but is usually in addition to the primary form of access control via the \&.amandahosts file\&. +.PP +Client example of using +\fBbsd\fR +authorization for xinetd server and for Amanda user "amandabackup": +.sp +.nf +service amanda +{ + only_from = amandaserver\&.example\&.com + socket_type = dgram + protocol = udp + wait = yes + user = amandabackup + group = disk + groups = yes + server = /path/to/amandad + server_args = \-auth=bsd amdump + disable = no +} +.fi +.PP +The same could be used for +\fBbsdudp\fR +if specifying \-auth=bsdudp instead of \-auth=bsd\&. +.PP +Client example of using +\fBbsdtcp\fR +authorization for xinetd server and for Amanda user "amandabackup": +.sp +.nf +service amanda +{ + only_from = amandaserver\&.example\&.com amandaclient\&.example\&.com + socket_type = stream + protocol = tcp + wait = no + user = amandabackup + group = disk + groups = yes + server = /path/to/amandad + server_args = \-auth=bsdtcp amdump + disable = no +} +.fi +.PP +\fBamindexd\fR +and +\fBamidxtaped\fR +would typically be added as additional +\fBamandad\fR +\fIserver_args\fR +for an Amanda server\&. +.PP +For Amanda version 2\&.5\&.0 and earlier, remember that neither +\fBbsdudp\fR +nor +\fBbsdtcp\fR +are supported and the Amanda daemon +\fBamandad\fR +accepts no arguments\&. Because of the latter, +\fBamrecover\fR +as of Amanda version 2\&.5\&.1 is not compatible with 2\&.5\&.0 and earlier servers\&. Thus, servers that are 2\&.5\&.0 or earlier must, in addition to the +\fIamanda\fR +service, run +\fIamindexd\fR +and +\fIamidxtaped\fR +Amanda services as their own network services, amandaidx and amidxtape, respectively (see below)\&. +.PP +There are no compatibility issues if server and clients are all 2\&.5\&.0 or earlier\&. If your server is 2\&.5\&.1 or later, you can still have clients that are 2\&.5\&.0 and earlier although you must then use +\fBbsd\fR +communication/authentication with these clients and must also run +\fIamindexd\fR +and +\fIamidxtaped\fR +Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below)\&. If you have a server that is 2\&.5\&.0 and earlier, clients of a later version on which you wish to run +\fBamrecover\fR +must use +\fBamoldrecover\fR +instead and, again, the server must be running the amandaidx and amidxtape network services\&. +.PP +Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2\&.5\&.0 or earlier server or a newer server having 2\&.5\&.0 or earlier clients +.sp +.nf +service amandaidx +{ + socket_type = stream + protocol = tcp + wait = no + user = amanda + group = disk + server = /usr/local/libexec/amanda/amindexd + disable = no +} + +service amidxtape +{ + socket_type = stream + protocol = tcp + wait = no + user = amanda + group = disk + server = /usr/local/libexec/amanda/amidxtaped + disable = no +} +.fi +.SS "PORT USAGE" +.PP +List of TCP/UDP ports used by network service communication methods for Amanda server and client\&. +.sp +.nf + Key: + UP = Unreserved Port + RPpAP = Reserved Port per Amanda Process + UPpDLE = Unreserved Port per DLE + [\&.\&.] = Configure options that can be used at compile time to define port ranges + +Authentication Protocol Amanda server Amanda client +bsd udp 1 RPpAP [\-\-with\-udpportrange] 10080 + tcp 1 UP [\-\-with\-tcpportrange] 3 UPpDLE [\-\-with\-tcpportrange] +bsdudp udp 1 RPpAP [\-\-with\-udpportrange] 10080 + tcp 1 UP [\-with\-tcpportrange] 1 UPpDLE [\-\-with\-tcpportrange] +bsdtcp tcp 1 RPpAP [\-\-with\-low\-tcpportrange] 10080 +.fi +.PP +Amanda server also uses two ports (dumper process) to communicate with the chunker/taper processes\&. These ports are in the range set by \-\-with\-tcpportrange\&. +.PP +You can override the default port ranges that Amanda was compiled with in each configuration using the +\fIreserved\-udp\-port\fR, +\fIreserved\-tcp\-port\fR, and +\fIunreserved\-tcp\-port\fR +parameters in amanda\&.conf and amanda\-client\&.conf configuration files (see +\fBamanda.conf\fR(5) +and +\fBamanda-client.conf\fR(5))\&. +.SH "KERBEROS COMMUNICATION AND AUTHENTICATION" + +For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Kerberos_authentication\&. +.PP +Amanda supports Kerberos 4 and 5 communication methods between Amanda server and client\&. Please note, however, that support for Kerberos 4 will be removed in the next release\&. +.PP +General information including compilation are given above (see +\fBCOMPILATION AND GENERAL INFORMATION\fR +above)\&. Below sections give specific Kerberos 4 and 5 information\&. +.SS "KERBEROS v4" + +Please note that support for Kerberos 4 will be removed in the next release\&. + +Kerberos 4 uses UDP protocol and the number of DLEs is limited by UDP packet size\&. + +The kerberized AMANDA service uses a different port on the client hosts\&. The /etc/services line is: + + kamanda 10081/udp +.PP +And the /etc/inetd\&.conf line is: +.sp +.nf + kamanda dgram udp wait root /usr/local/libexec/amanda/amandad amandad \-auth=krb4 +.fi +.PP +Note that you\'re running this as root, rather than as your dump user\&. AMANDA will set its uid down to the dump user at times it doesn\'t need to read the srvtab file, and give up root permissions entirely before it goes off and runs dump\&. Alternately you can change your srvtab files to be readable by user amanda\&. +.PP +The following dumptype options apply to krb4: +.sp +.nf +auth "krb4" # use krb4 auth for this host + # (you can mingle krb hosts and bsd \&.rhosts in one conf) +kencrypt # encrypt this filesystem over the net using the krb4 + # session key\&. About 2x slower\&. Good for those root + # partitions containing your keyfiles\&. Don\'t want to + # give away the keys to an ethernet sniffer! + # This is currently always enabled\&. There is no + # way to disable it\&. This is a bug\&. +.fi +.SS "KERBEROS v5" +.PP +Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port\&. + + +The \fBkrb5\fR driver script defaults to: + +/* + * The lifetime of our tickets in minutes\&. + */ +#define AMANDA_TKT_LIFETIME (12*60) + +/* + * The name of the service in /etc/services\&. + */ +#define AMANDA_KRB5_SERVICE_NAME "k5amanda" + +You can currently only override these by editing the source code\&. + +The kerberized AMANDA service uses a different port on the client hosts\&. The /etc/services line is: + + k5amanda 10082/tcp +.PP +And the /etc/inetd\&.conf line is: +.sp +.nf + k5amanda stream tcp nowait root /usr/local/libexec/amanda/amandad amandad \-auth=krb5 +.fi +.PP +Note that you\'re running this as root, rather than as your dump user\&. AMANDA will set its UID down to the dump user at times it doesn\'t need to read the keytab file, and give up root permissions entirely before it goes off and runs dump\&. Alternately you can change your keytab files to be readable by user amanda\&. You should understand the security implications of this before changing the permissions on the keytab\&. +.PP +The following dumptype options apply to +\fBkrb5\fR: +.sp +.nf + auth "krb5" # use krb5 auth for this host + # (you can mingle krb hosts and bsd \&.rhosts in one conf) +.fi +.PP +The principal and keytab files that Amanda uses must be set in the amanda\&.conf file for kerberos 5 dumps to work\&. You can hardcode this in the source code if you really want to (common\-src/krb5\-security\&.c) +.sp +.nf + krb5keytab + krb5principal +.fi +.PP +For example: +.sp +.nf + krb5keytab "/etc/krb5\&.keytab\-amanda" + krb5principal "amanda/saidin\&.omniscient\&.com" +.fi +.PP +The principal in the second option must be contained in the first\&. The keytab should be readable by the amanda user (and definitely not world readable!) and is (obviously) on the server\&. In MIT\'s kadmin, the following: +.sp +.nf + addprinc \-randkey amanda/saidin\&.omniscient\&.com + ktadd \-k /etc/krb5\&.keytab\-amanda amanda/saidin\&.omniscient\&.com +.fi +.PP +will do the trick\&. You will obviously want to change the principal name to reflect something appropriate for the conventions at your site\&. +.PP +You must also configure each client to allow the amanda principal in for dumps\&. +.PP +There are several ways to go about authorizing a server to connect to a client\&. +.PP +The normal way is via a \&.k5amandausers file or a \&.k5login file in the client user\'s home directory\&. The determination of which file to use is based on the way you ran configure on AMANDA\&. By default, AMANDA will use \&.k5amandahosts, but if you configured with \-\-without\-amandahosts, AMANDA will use \&.k5login\&. (similar to the default for \&.rhosts/\&.amandahosts\-style security)\&. The \&.k5login file syntax is a superset of the default +\fBkrb5\fR +\&.k5login\&. The routines to check it are implemented in amanda rather than using krb5_kuserok because the connections are actually gssapi based\&. +.PP +This \&.k5amandahosts/\&.k5login is a hybrid of the \&.amandahosts and a \&.k5login file\&. You can just list principal names, as in a \&.k5login file and the principal will be permitted in from any host\&. If you do NOT specify a realm, then there is no attempt to validate the realm (this is only really a concern if you have cross\-realm authentication set up with another realm or something else that allows you multiple realms in your kdc\&. If you do specify a realm, only that principal@realm will be permitted to connect\&. +.PP +You may prepend this with a hostname and whitespace, and only that principal (with optional realm as above) will be permitted to access from that hostname\&. +.PP +Here are examples of valid entries in the \&.k5amandahosts: +.sp +.nf + service/amanda + service/amanda@TEST\&.COM + dumpmaster\&.test\&.com service/amanda + dumpmaster\&.test\&.com service/amanda@TEST\&.COM +.fi +.PP +Rather than using a \&.k5amandahosts or \&.k5login file, the easiest way is to use a principal named after the destination user, (such as amanda@TEST\&.COM in our example) and not have either a \&.k5amandahosts or \&.k5login file in the destination user\'s home directory\&. +.PP +There is no attempt to verify the realm in this case (only a concern if you have cross\-realm authentication setup)\&. +.SH "LOCAL COMMUNICATION" +.PP +The Amanda server communicates with the client internally versus over the network, ie\&. the client is also the server\&. +.PP +This is the only method that requires no authentication as it is clearly not needed\&. +.SH "RSH COMMUNICATION AND AUTHENTICATION" + +For more detail, see http://wiki\&.zmanda\&.com/index\&.php/Configuring_rsh_authentication\&. +.PP +The Amanda server communicates with its client as the Amanda user via the RSH protocol\&. +.PP +Please note that RSH protocol itself is insecure and should be used with caution especially on any servers and clients with public IPs\&. +.PP +Each Amanda client communicates with the server using one TCP port and all data streams from the client are multiplexed over one port\&. The number of Amanda clients is limited by the number of reserved ports available on the Amanda server\&. Some versions of RSH do not use reserved ports and, thus, this restriction is not valid\&. +.PP +General information including compilation is given above (see +\fBCOMPILATION AND GENERAL INFORMATION\fR +above)\&. +.PP +In addition to specifying the +\fIauth\fR +field in dumptype definition, it might be required to specify +\fIclient_username\fR +and +\fBamandad\fR +fields\&. If the backup user name is different on the Amanda client, the user name is specified as +\fBclient_username\fR\&. If the location of the Amanda daemon +\fBamandad\fR +is different on the Amanda client, the location is specified as +\fIamandad_path\fR +field value\&. +.sp +.nf +For example: +define dumptype rsh_example { + \&.\&.\&. + auth "rsh" + client_username "amandabackup" + amandad_path "/usr/lib/exec/amandad" + \&.\&.\&. +} +.fi +.SH "SSH COMMUNICATION AND AUTHENTICATION" + +For more detail, see http://wiki\&.zmanda\&.com/index\&.php/How_To:Set_up_transport_encryption_with_SSH\&. + +Amanda client sends data to the server using SSH\&. SSH keys have to be set up so that Amanda server can communicate with its clients using SSH\&. + +General information including compilation is given above (see \fBCOMPILATION AND GENERAL INFORMATION\fR above)\&. + +SSH provides transport encryption and authentication\&. To set up an SSH authentication session, Amanda will run the equivalent of the following to start the backup process\&. + +\fB /path/to/ssh \-l \fR\fB\fIuser_name\fR\fR\fB client\&.zmanda\&.com $libexecdir/amandad\fR + +To use SSH, you need to set up SSH keys either by storing the passphrase in cleartext, using ssh\-agent, or using no passphrase at all\&. All of these options have security implications which should be carefully considered before adoption\&. + +When you use a public key on the client to do data encryption (see http://wiki\&.zmanda\&.com/index\&.php/How_To:Set_up_data_encryption), you can lock away the private key in a secure place\&. Both, transport and storage will be encrypted with such a setup\&. See http://wiki\&.zmanda\&.com/index\&.php/Encryption for an overview of encryption options\&. + +Enable SSH authentication and set the ssh_keys option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda\&.conf: + + auth "ssh" + ssh_keys "/home/amandabackup/\&.ssh/id_rsa_amdump" + +\fIssh_keys\fR is the path to the private key on the client\&. If the username to which Amanda should connect is different from the default, then you should also add + + client_username "otherusername" + +If your server \fBamandad\fR path and client \fBamandad\fR path are different, you should also add + + amandad_path "/client/amandad/path" +.PP +For a marginal increase in security, prepend the keys used for AMANDA in the clients\' authorized_keys file with the following: +.sp +.nf + from="amanda_server\&.your\&.domain\&.com",no\-port\-forwarding,no\-X11\-forwarding,no\-agent\-forwarding,command="/absolute/path/to/amandad \-auth=ssh amdump" +.fi +.PP +This will limit that key to connect only from Amanda server and only be able to execute +\fBamandad\fR(8)\&. +.PP +In the same way, prepend the key used for AMANDA in the server\'s authorized_keys file with: +.sp +.nf + from="amanda_client\&.your\&.domain\&.com",no\-port\-forwarding,no\-X11\-forwarding,no\-agent\-forwarding,command="/absolute/path/to/amandad \-auth=ssh amindexd amidxtaped" +.fi +.PP +You can omit the from=\&.\&. option if you have too many clients to list, although this has obvious security implications\&. +.PP +Set ssh_keys and any other necessary options in /etc/amanda/amanda_client\&.conf: +.sp +.nf + auth "ssh" + ssh_keys "/root/\&.ssh/id_rsa_amrecover" + client_username "amanda" + amandad_path "/server/amandad/path" +.fi +.PP +Besides user keys, SSH uses host keys to uniquely identify each host, to prevent one host from impersonating another\&. Unfortunately, the only easy way to set up these host keys is to make a connection and tell SSH that you trust the identity: +.sp +.nf + $ ssh client1\&.zmanda\&.com + The authenticity of host \'client1\&.zmanda\&.com (192\&.168\&.10\&.1)\' can\'t be established\&. + RSA key fingerprint is 26:4e:df:a2:be:c8:cb:20:1c:68:8b:cc:c0:3b:8e:9d\&. + Are you sure you want to continue connecting (yes/no)?yes +.fi +.PP +As Amanda will not answer this question itself, you must manually make every connection (server to client and client to server) that you expect Amanda to make\&. Note that you must use the same username that Amanda will use (that is, ssh client and ssh client\&.domain\&.com are distinct)\&. +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-client.conf\fR(5), +\fBdisklist\fR(5), +\fBamdump\fR(8), +\fBamrecover\fR(8) +: http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBPaul Yeatman\fR <\&pyeatman@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-changers.7 b/man/amanda-changers.7 new file mode 100644 index 0000000..7eaafd6 --- /dev/null +++ b/man/amanda-changers.7 @@ -0,0 +1,330 @@ +.\" Title: amanda-changers +.\" Author: Dustin J. Mitchell +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: Miscellanea +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-CHANGERS" "7" "01/22/2009" "Amanda 2\&.6\&.1" "Miscellanea" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-changers \- Configuring and Using Amanda Changers +.SH "DESCRIPTION" +.PP +Amanda uses changers to arbitrate access to devices (\fBamanda-devices\fR(7)) and data volumes\&. Changers provide an abstraction of tape robots, but are used to manage non\-tape media, too\&. Amanda communicates with changers through the Changer API\&. This manpage contains a +\fIuser\-level\fR +overview of the API, and does not address details that are only of concern to developers\&. For that purpose, consult the Amanda source code and http://wiki\&.zmanda\&.com\&. +.SH "TRANSITION" +.PP +The Amanda Changer API is in transition from version 1\&.0 \- driven by shell scripts invoked for each changer operation \- to version 2\&.0, composed of perl objects that can manage parallel access to multiple devices and other complexity\&. When this transition is complete, Amanda devices will, in general, be specified via a changer, which will provide the necessary device specifier to access a requested volume\&. In the interim, support for the "new" changer syntax is limited to the experimental +\fBamvault\fR(8)\&. +.SH "SPECIFYING CHANGERS" +.PP +Changer specifications are strings like +\FCchg\-disk:/my/vtapes\F[]\&. The +\FCchg\-\F[] +prefix serves to differentiate changers from devices (see +\fBamanda-devices\fR(7))\&. The next portion (\FCdisk\F[], in this case) identifies the particular changer driver to use, and everything that follows the +\FC:\F[] +is interpreted by the driver\&. +.PP +A name which does not match this pattern, but which matches an old changer script (e\&.g\&., +\FCchg\-zd\-mtx\F[]), invokes the backward\-compatibility changer driver as +\FCchg\-compat:chg\-zd\-mtx\F[]\&. If the name does not match an old changer, then it is treated as an Amanda device, and is wrapped by the single\-device changer, e\&.g\&., +\FCchg\-single:tape:/dev/rmt/0\F[]\&. +.PP +Changers which require additional parameters can also be described in +\fBamanda.conf\fR(5) +with "changer" sections, for example, +.sp +.nf +define changer hp\-robot { + tapedev "chg\-robot:/dev/sg1" + property "drives" "0=/dev/nst0;1=/dev/nst0" + property "slots" "1\-10" +} +.fi +(note that "chg\-robot" is not yet implemented, so this is hypothetical)\&. A changer defininition creates a changer "alias", in this case named +\fIhp\-robot\fR, which can then be named where an application expects a changer \- for example, the target of the +\fBamvault\fR +command\&. +.SH "CHANGER DRIVERS" +.PP +This section lists the changer drivers included with Amanda, and basic instructions for using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&. +.SS "chg\-disk (new)" +.nf +tpchanger "chg\-disk:/u01/vtapes" +.fi +.PP +This changer driver replaces the old +\fBchg\-disk\fR, supporting parallel access to vtapes stored in directories named +\FCslotN\F[] +in the directory specified after +\FCchg\-disk:\F[]\&. It does so by creating numbered "drives" so that simultaneous processes can access distinct slots\&. +.SS "chg\-disk (old)" +.nf +tapedev "file:/u01/vtapes" +tpchanger "chg\-disk" +.fi +.PP +This changer script supports sequential access to vtapes stored in directories named +\FCslotN\F[] +in the directory specified by the +\fItapedev\fR +parameter\&. +.SS "chg\-multi" +.nf +tpchanger "chg\-multi" +changerfile "chg\-multi\-state" +.fi +.PP +This script simply round\-robins a number of distinct device names, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The +\fIchangerfile\fR +need not exist; it is used as a prefix for filenames of state files\&. +.SS "chg\-manual" +.nf +tpchanger "chg\-manual" +changerfile "chg\-manual\&.conf" +.fi +.PP +This script simply provides distinct device names in a round\-robin fashion, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The configuration file parameters are (as listed in the script): +.sp +.nf +resend_mail=900 # resend mail every __ seconds +timeout_mail=604800 # time out after this many seconds (default 7 days) +request="[type]" # How to request a new tape (default "tty_email") + request="tty" # Use the tty to ask the user to change tape\&. + # Can\'t be use by cron + request="email" # Send an email to ask the user to change tape\&. + request="tty_email" # Use the tty if it exist or send an email\&. +.fi +.SS "chg\-zd\-mtx" +.nf +tpchanger "chg\-zd\-mtx" +changerdev "/dev/sg0" # used with \'mtx \-f\' +changerfile "chg\-zd\-mtx\&.conf" +tapedev "tape:/dev/nst0" +.fi +.PP +This script interfaces with a tape drive using the Zubkoff/Dandelion version of mtx\&. That\'s the version that takes a device specifier with the +\fB\-f\fR +option and has subcommands like +\fBstatus\fR\&. The configuration file parameters are (as listed in the script itself): +.sp +.nf +firstslot=? #### First storage slot (element) +lastslot=? #### Last storage slot (element) +cleanslot=\-1 #### Slot with cleaner tape \-\- default is "\-1" + #### Set negative to indicate no cleaner available +driveslot=0 #### Drive slot number\&. Defaults to 0 + #### Use the \'Data Transfer Element\' you want +autoclean=0 #### Set to \'1\' or greater to enable +autocleancount=99 #### Number of access before a clean\&. +havereader=0 #### If you have a barcode reader, set to 1\&. +offline_before_unload=0 #### Does your robot require an + #### \'mt offline\' before mtx unload? +poll_drive_ready=NN #### Time (seconds) between tests to see if + #### the tape drive has gone ready (default: 3)\&. +max_drive_wait=NN #### Maximum time (seconds) to wait for the + #### tape drive to become ready (default: 120)\&. +initial_poll_delay=NN #### initial delay after load before polling for + #### readiness +slotinfofile=FILENAME #### record slot information to this file, in + #### the line\-based format "SLOT LABEL\en" +.fi +.SS "chg\-rait" +.nf +tpchanger "chg\-rait" +changerfile "chg\-rait\&.conf" +.fi +.PP +This changer script constructs RAIT devices out of the devices provided by several "sub\-changers"\&. The configuration file specifies +\FCnchangers\F[], the number of subchangers, and then provides +\FCtpchanger\F[], +\FCchangerdev_N\F[], +\FCchangerfile_N\F[], and +\FCtpchanger_N\F[] +for each sub\-changer, 1 through N\&. +.SS "chg\-null" +.nf +tpchanger "chg\-null" +.fi +.PP +This changer always provides the device "null:"\&. It is sometimes useful in conjunction with +\fBchg\-rait\fR\&. +.SS "Unmaintained Changers" +.PP +Amanda has many other changer scripts and programs beyond those described here (see the +\FCchanger\-src/\F[] +in the source directory), but most of these scripts are unmaintained and undocumented, and will be removed when the new changer API is fully implemented\&. +.SH "SEE ALSO" +.PP + +\fBamanda\fR(8), +\fBamanda.conf\fR(5), +\fBamanda-devices\fR(7), +.SH "Author" +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-client.conf.5 b/man/amanda-client.conf.5 index fb15d22..86b7a51 100644 --- a/man/amanda-client.conf.5 +++ b/man/amanda-client.conf.5 @@ -1,296 +1,556 @@ .\" Title: amanda-client.conf -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: File formats and conventions +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMANDA\-CLIENT\.CONF" "5" "08/22/2008" "" "" +.TH "AMANDA\-CLIENT\&.CON" "5" "01/22/2009" "Amanda 2\&.6\&.1" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amanda-client.conf - Client configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-client.conf \- Client configuration file for \fIAmanda\fR, the Advanced Maryland Automatic Network Disk Archiver .SH "DESCRIPTION" .PP -\fIamanda\-client\.conf\fR +\fBamanda-client.conf\fR(5) is the client configuration file for -\fIAmanda\fR\. This manpage lists the relevant sections and parameters of this file for quick reference\. +\fIAmanda\fR\&. This manpage lists the relevant sections and parameters of this file for quick reference\&. .PP The files -\fB/amanda\-client\.conf\fR -and -\fB//amanda\-client\.conf\fR -are loaded\. -.SH "PARAMETERS" -.PP -There are a number of configuration parameters that control the behavior of the -\fIAmanda\fR -programs\. All have default values, so you need not specify the parameter in -\fBamanda\-client\.conf\fR -if the default is suitable\. -.PP -Lines starting with # are ignored, as are blank lines\. Comments may be placed on a line with a directive by starting the comment with a #\. The remainder of the line is ignored\. -.PP -Keywords are case insensitive, i\.e\. -\fBauth\fR +\fB/amanda\-client\&.conf\fR and -\fBAuth\fR -are treated the same\. -.PP -Integer arguments may have one of the following (case insensitive) suffixes, some of which have a multiplier effect: -.SS "POSSIBLE SUFFIXES" -.PP -\fBb byte bytes\fR -.RS 4 -Some number of bytes\. -.RE -.PP -\fBbps\fR -.RS 4 -Some number of bytes per second\. -.RE -.PP -\fBk kb kbyte kbytes kilobyte kilobytes\fR -.RS 4 -Some number of kilobytes (bytes*1024)\. -.RE -.PP -\fBkps kbps\fR -.RS 4 -Some number of kilobytes per second (bytes*1024)\. -.RE -.PP -\fBm mb meg mbyte mbytes megabyte megabytes\fR -.RS 4 -Some number of megabytes (bytes*1024*1024)\. -.RE -.PP -\fBmps mbps\fR -.RS 4 -Some number of megabytes per second (bytes*1024*1024)\. -.RE -.PP -\fBg gb gbyte gbytes gigabyte gigabytes\fR -.RS 4 -Some number of gigabytes (bytes*1024*1024*1024)\. -.RE -.PP -\fBtape tapes\fR -.RS 4 -Some number of tapes\. -.RE +\fB//amanda\-client\&.conf\fR +are loaded\&. +.SH "SYNTAX" + + +The syntax of \fBamanda-client.conf\fR(5) is identical to that for +\fBamanda.conf\fR(5)\&. +.SH "GLOBAL PARAMETERS" .PP -\fBday days\fR +\fBconf\fR \fI string\fR .RS 4 -Some number of days\. +Default: +\fISet by configure\fR\&. The conf use by amrecover\&. .RE .PP -\fBweek weeks\fR -.RS 4 -Some number of weeks (days*7)\. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -Note -The value -\fBinf\fR -may be used in most places where an integer is expected to mean an infinite amount\. -.sp -Boolean arguments may have any of the values -\fBy\fR, -\fByes\fR, -\fBt\fR, -\fBtrue\fR -or -\fBon\fR -to indicate a true state, or -\fBn\fR, -\fBno\fR, -\fBf\fR, -\fBfalse\fR -or -\fBoff\fR -to indicate a false state\. If no argument is given, -\fBtrue\fR -is assumed\. -.RE -.SS "PARAMETERS" -.PP -\fBconf\fR \fI string\fR +\fBclient_username\fR \fI string\fR .RS 4 Default: -\fISet by configure\fR\. The conf use by amrecover\. +\fICLIENT_LOGIN\fR\&. Similar to the parameter of the same name in +\fBamanda.conf\fR(5), this specifies the username that +\fBamrecover\fR +should send when connecting to the server\&. It should match the username specified in +\FC\&.amandahosts\F[] +on the server\&. .RE .PP \fBindex_server\fR \fI string\fR .RS 4 Default: -\fISet by configure\fR\. The amindexd server amrecover will connect to\. +\fISet by configure\fR\&. The amindexd server amrecover will connect to\&. .RE .PP \fBtape_server\fR \fI string\fR .RS 4 Default: -\fISet by configure\fR\. The amidxtaped server amrecover will connect to\. +\fISet by configure\fR\&. The amidxtaped server amrecover will connect to\&. .RE .PP \fBtapedev\fR \fI string\fR .RS 4 Default: -\fISet by configure\fR\. The tapedev amrecover will use\. +\fISet by configure\fR\&. The tapedev amrecover will use\&. .RE .PP \fBauth\fR \fI string\fR .RS 4 Default: -\fIbsd\fR\. Type of authorization to perform between tape server and backup client hosts\. +\fIbsd\fR\&. Type of authorization to perform between tape server and backup client hosts\&. .sp -\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream\. +\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream\&. .sp -\fBbsdtcp\fR, bsd authorization but use only one tcp connection\. +\fBbsdtcp\fR, bsd authorization but use only one tcp connection\&. .sp -\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream\. +\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream\&. .sp \fBkrb4\fR -to use Kerberos\-IV authorization\. +to use Kerberos\-IV authorization\&. .sp \fBkrb5\fR -to use Kerberos\-V authorization\. +to use Kerberos\-V authorization\&. .sp -\fBlocal\fR, if the client is the server, it doesn\'t require authencation setup\. +\fBlocal\fR, if the client is the server, it doesn\'t require authencation setup\&. .sp \fBrsh\fR -to use rsh authorization\. +to use rsh authorization\&. .sp \fBssh\fR -to use OpenSSH authorization\. +to use OpenSSH authorization\&. .RE .PP \fBssh_keys\fR \fI string\fR .RS 4 Default: -\fINo default\fR\. The key file the ssh auth will use, it must be the private key\. If this parameter is not specified, then the deafult ssh key will be used\. +\fINo default\fR\&. The key file the ssh auth will use, it must be the private key\&. If this parameter is not specified, then the deafult ssh key will be used\&. .RE .PP \fBgnutar_list_dir\fR \fI string\fR .RS 4 Default from configure -\fI\-\-with\-gnutar\-listdir=DIR\fR\. The directory where gnutar keep its state file\. +\fI\-\-with\-gnutar\-listdir=DIR\fR\&. The directory where gnutar keep its state file\&. +.RE +.PP +\fBmailer\fR \fI string\fR +.RS 4 +Default found by configure\&. A mail program that can send mail with \'\fIMAILER \-s "subject" user < message_file\fR\'\&. .RE .PP \fBamandates\fR \fI string\fR .RS 4 Default: -\fI/etc/amandates\fR\. The file where amanda keep the last date of each dumplevel\. +\fI/etc/amandates\fR\&. The file where amanda keep the last date of each dumplevel\&. .RE .PP \fBconnect_tries\fR int .RS 4 Default: -\fI3\fR\. How many times the server will try a connection\. +\fI3\fR\&. How many times the server will try a connection\&. .RE .PP \fBrep_tries\fR int .RS 4 Default: -\fI5\fR\. How many times amandad will resend a REP packet if it doesn\'t get the ACK packet\. +\fI5\fR\&. How many times amandad will resend a REP packet if it doesn\'t get the ACK packet\&. .RE .PP \fBdebug_amandad\fR int .RS 4 Default: -\fI0\fR\. Debug level of the amandad process +\fI0\fR\&. Debug level of the amandad process .RE .PP \fBdebug_amidxtaped\fR int .RS 4 Default: -\fI0\fR\. Debug level of the amidxtaped process +\fI0\fR\&. Debug level of the amidxtaped process .RE .PP \fBdebug_amindexd\fR int .RS 4 Default: -\fI0\fR\. Debug level of the amindexd process +\fI0\fR\&. Debug level of the amindexd process .RE .PP \fBdebug_amrecover\fR int .RS 4 Default: -\fI0\fR\. Debug level of the amrecover process +\fI0\fR\&. Debug level of the amrecover process .RE .PP \fBdebug_auth\fR int .RS 4 Default: -\fI0\fR\. Debug level of the auth module +\fI0\fR\&. Debug level of the auth module .RE .PP \fBdebug_event\fR int .RS 4 Default: -\fI0\fR\. Debug level of the event module +\fI0\fR\&. Debug level of the event module .RE .PP \fBdebug_holding\fR int .RS 4 Default: -\fI0\fR\. Debug level of the holdingdisk module +\fI0\fR\&. Debug level of the holdingdisk module .RE .PP \fBdebug_protocol\fR int .RS 4 Default: -\fI0\fR\. Debug level of the protocol module +\fI0\fR\&. Debug level of the protocol module .RE .PP \fBdebug_selfcheck\fR int .RS 4 Default: -\fI0\fR\. Debug level of the selfcheck process +\fI0\fR\&. Debug level of the selfcheck process .RE .PP \fBdebug_sendsize\fR int .RS 4 Default: -\fI0\fR\. Debug level of the sendsize process +\fI0\fR\&. Debug level of the sendsize process .RE .PP \fBdebug_sendbackup\fR int .RS 4 Default: -\fI0\fR\. Debug level of the sendbackup process +\fI0\fR\&. Debug level of the sendbackup process .RE .PP \fBreserved\-udp\-port\fR int,int .RS 4 Default: \-\-with\-udpportrange or -\fI512,1023\fR\. Reserved udp port that will be used (amrecover with bsd or bsdudp) +\fI512,1023\fR\&. Reserved udp port that will be used (amrecover with bsd or bsdudp) .RE .PP \fBreserved\-tcp\-port\fR int,int .RS 4 Default: \-\-with\-low\-tcpportrange or -\fI512,1023\fR\. Reserved tcp port that will be used (amrecover with bsdtcp) +\fI512,1023\fR\&. Reserved tcp port that will be used (amrecover with bsdtcp) .RE .PP \fBunreserved\-tcp\-port\fR int,int .RS 4 Default: \-\-with\-tcpportrange or -\fI1025,65536\fR\. Unreserved tcp port that will be used (bsd, bsdudp) +\fI1025,65536\fR\&. Unreserved tcp port that will be used (bsd, bsdudp) +.RE +.PP +\fBproperty\fR "name" "value" +.RS 4 +Adds a global property for this client host, useful for e\&.g\&., Application API plugins\&. +.RE +.SH "APPLICATION SECTION" +.PP +The +\fBamanda\&.conf\fR +file may define multiple types of application\&. The information is entered in a +\fBapplication\-tool\fR +section, which looks like this: +.nf +define application\-tool "\fIname\fR" { + \fIapplication\-option\fR \fIappli +cation\-value\fR + \FC\&.\&.\&.\F[] +} +.fi +.PP +\fIname\fR +is the name of this type of application\&. It is referenced from the +\fIdumptype\fR +.PP +The application\-tool options and values are: +.PP +\fBcomment\fR \fIstring\fR +.RS 4 +Default: +\fInone\fR\&. A comment string describing this application\&. +.RE +.PP +\fBplugin\fR \fIstring\fR +.RS 4 +No default\&. Must be set to the name of the program\&. This program must be in the +\fI$libexecdir/amanda/application\fR +directory on the client\&. +.RE +.PP +\fBproperty\fR [append] [priority] \fIstring\fR \fIstring\fR+ +.RS 4 +No default\&. You can set property for the application, each application have a different set of property\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. +\fBpriority\fR +keyword disallow the setting of that property on the server\&. .RE -.SH "AUTHOR" +.SH "SCRIPT SECTION" .PP -James da Silva, -: Original text +The +\fBamanda\&.conf\fR +file may define multiple types of script\&. The information is entered in a +\fBscript\-tool\fR +section, which looks like this: +.nf +define script\-tool "\fIname\fR" { + \fIscript\-option\fR \fIscript\-value\fR + \FC\&.\&.\&.\F[] +} +.fi .PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion, major update, splitting +\fIname\fR +is the name of this type of script\&. It is referenced from the +\fIdumptype\fR +.PP +The script\-tool options and values are: +.PP +\fBcomment\fR \fIstring\fR +.RS 4 +Default: +\fInone\fR\&. A comment string describing this script\&. +.RE +.PP +\fBplugin\fR \fIstring\fR +.RS 4 +No default\&. Must be set to the name of the program\&. This program must be in the +\fI$libdir/amanda/application\fR +directory on the client and/or server\&. +.RE +.PP +\fBexecute_where\fR [client|server] +.RS 4 +Default: +\fIclient\fR\&. Where the script must be executed, on the client or server\&. Only +\fIclient\fR +is valid\&. +.RE +.PP +\fBexecute_on\fR \fIexecute_on\fR[,\fIexecute_on\fR]* +.RS 4 +No default\&. When the script must be executed, you can specify many of them: +.PP +\fBpre\-dle\-amcheck\fR +.RS 4 +Execute before the amcheck command for the dle\&. +.RE +.PP +\fBpre\-host\-amcheck\fR +.RS 4 +Execute before the amcheck command for all dle for the client\&. +.RE +.PP +\fBpost\-dle\-amcheck\fR +.RS 4 +Execute after the amcheck command for the dle\&. +.RE +.PP +\fBpost\-host\-amcheck\fR +.RS 4 +Execute after the amcheck command for all dle for the client\&. +.RE +.PP +\fBpre\-dle\-estimate\fR +.RS 4 +Execute before the estimate command for the dle\&. +.RE +.PP +\fBpre\-host\-estimate\fR +.RS 4 +Execute before the estimate command for all dle for the client\&. +.RE +.PP +\fBpost\-dle\-estimate\fR +.RS 4 +Execute after the estimate command for the dle\&. +.RE +.PP +\fBpost\-host\-estimate\fR +.RS 4 +Execute after the estimate command for all dle for the client\&. +.RE +.PP +\fBpre\-dle\-backup\fR +.RS 4 +Execute before the backup command for the dle\&. +.RE +.PP +\fBpre\-host\-backup\fR +.RS 4 +Execute before the backup command for all dle for the client\&. +.RE +.PP +\fBpost\-dle\-backup\fR +.RS 4 +Execute after the backup command for the dle\&. +.RE +.PP +\fBpost\-host\-backup\fR +.RS 4 +Execute after the backup command for all dle for the client\&. +.RE +.PP +\fBpre\-recover\fR +.RS 4 +Execute before any level is recovered\&. +.RE +.PP +\fBpost\-recover\fR +.RS 4 +Execute after all levels are recovered\&. +.RE +.PP +\fBpre\-level\-recover\fR +.RS 4 +Execute before each level recovery\&. +.RE +.PP +\fBpost\-level\-recover\fR +.RS 4 +Execute after each level recovery\&. +.RE +.PP +\fBinter\-level\-recover\fR +.RS 4 +Execute between two levels of recovery\&. +.RE +.RE +.PP +\fBproperty\fR [append] [priority] \fIstring\fR \fIstring\fR+ +.RS 4 +No default\&. You can set property for the script, each script have a different set of property\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. +\fBpriority\fR +keyword disallow the setting of that property on the server\&. +.RE .SH "SEE ALSO" .PP @@ -299,3 +559,8 @@ Stefan G\. Weichinger, \fBamcrypt\fR(8), \fBaespipe\fR(1), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amanda-devices.7 b/man/amanda-devices.7 new file mode 100644 index 0000000..d566d88 --- /dev/null +++ b/man/amanda-devices.7 @@ -0,0 +1,570 @@ +.\" Title: amanda-devices +.\" Author: Ian Turner +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: Miscellanea +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-DEVICES" "7" "01/22/2009" "Amanda 2\&.6\&.1" "Miscellanea" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-devices \- Configuring and Using Amanda Devices +.SH "DESCRIPTION" +.PP +The Device API specifies a generic interface between Amanda and storage devices such as tapes or disks\&. This manual page describes the device drivers included with Amanda\&. +.PP +This is a +\fIuser\-level\fR +description of the API, and does not address details that are only of concern to developers\&. For that purpose, consult the Amanda source code and http://wiki\&.zmanda\&.com\&. +.PP +The term "device driver" describes the software that can communicate with some kind of backend storage, e\&.g\&., a tape driver\&. A "device" is the storage element itself, usually a piece of hardware\&. When discussing a device and its driver as a unit, the term "device" is sometimes also used to refer to the combination of device and driver\&. +.SH "SPECIFYING DEVICES" +.PP +Device names take the form +\fITYPE:NODE\fR, where +\fITYPE\fR +selects a device driver, and +\fINODE\fR +provides further information to that driver\&. The syntax for each device driver is given in the corresponding section below\&. +.PP +Devices are described in +\fBamanda.conf\fR(5) +with "device" sections, e\&.g\&., +.sp +.nf +define device top_drive { + tapedev "tape:/dev/nst0" + device_property "BLOCK_SIZE" "131072" +} +.fi +A device defininition creates a device "alias", in this case named +\fItop_drive\fR, which can then be named in the global +\fItapedev\fR +parameter: +.sp +.nf +tapedev "top_drive" +.fi +.PP +The global +\fItapedev\fR +parameter can also specify a literal device name\&. For example, +.sp +.nf +tapedev "file:/amdisks" +.fi +is equivalent to +.sp +.nf +tapedev "default" +define device default { + tapedev "file:/amdisks" +} +.fi +Device properties specified outside of any device definition apply to all devices\&. This syntax is provided mainly for backward compatibility, and for simple Amanda configurations\&. Note that there is no way to provide properties specific to a device without defining a device alias\&. +.PP +See +\fBamanda.conf\fR(5) +for more information on Amanda configuration\&. +.SH "DEVICES" +.PP +This section lists the device drivers included with Amanda, and basic instructions for using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&. +.SS "Null Device" +.nf +tapedev "null:" +.fi +.PP +The null device driver only supports writing, and discards all data\&. It is generally only useful for testing purposes\&. +.SS "RAIT Device" +.nf +tapedev "rait:tape:/dev/rmt/tps0d{4,5,6}n" +.fi +.PP +The RAIT device driver mirrors or stripes data over multiple "child" devices\&. The child devices are specified using a shell\-like syntax, where alternatives are enclosed in braces and separated by commas\&. +.PP +With two child devices, the RAIT device driver mirrors data such that the two devices contain identical data and can be used singly for recovery\&. With more than two devices, the RAIT device "stripes" data across all but one device and writes a parity block to the final device, usable for data recovery in the event of a device or volume failure\&. The RAIT device scales its blocksize as necessary to match the number of children that will be used to store data\&. +.PP +When a child device is known to have failed, the RAIT device should be reconfigured to replace that device with the text "ERROR", e\&.g\&., +.sp +.nf +tapedev "rait:{tape:/dev/st0,ERROR,tape:/dev/st2}" +.fi +This will cause the RAIT device to start up in degraded mode, reconstructing the data from the missing device\&. +.PP +Like ordinary RAID drivers, the RAIT device driver can automatically enter degraded mode when one of its child devices fails\&. However, the RAIT device cannot automatically recover from any write error nor write any data in degraded mode\&. When reading, certain errors may be fatal (rather than causing degraded mode)\&. And in any case, labels on all volumes must initially match (labeled or otherwise)\&. If you have lost one volume from a set, explicitly start the device in degraded mode as described above\&. +.SS "Child Device Block Sizes" +.PP +The RAIT device driver requires that all of its child devices use the same block size\&. If no block sizes are specified, the driver selects the block size closest to 32k that is within the MIN_BLOCK_SIZE \- MAX_BLOCK_SIZE range of all child devices, and calculates its own blocksize according to the formula +\fIrait_blocksize = child_blocksize * (num_children \- 1)\fR\&. If a block size is specified for the RAIT device, then it calculates its child block sizes according to the formula +\fIchild_blocksize = rait_blocksize / (num_children \- 1)\fR\&. Either way, it sets the BLOCK_SIZE property of each child device accordingly\&. +.SS "S3 Device" +.nf +tapedev "s3:foocorp\-backups/DailySet1\-" +device_property "S3_ACCESS_KEY" "MYACCESSKEY" +device_property "S3_SECRET_KEY" "MYSECRETKEY" +.fi +.PP +The S3 device driver uploads data to the Amazon S3 "storage cloud"\&. Its device name is a slash\-sparated combination of bucket name and prefix: "s3:BUCKET/PREFIX"\&. Since buckets must be unique across all Amazon S3 users, and since the number of buckets allowed to each user is limited, the driver can store multiple Amanda volumes in a single S3 bucket, distinguished by prefix\&. The prefix and slash can be omitted if they are not needed: "s3:BUCKET"\&. +.PP +The access and secret keys used to authenticate to Amazon S3 are provided as properties\&. +.PP +The S3 device driver stores each block in a distinct S3 object\&. Due to high HTTP overhead for each request, use of larger than normal block sizes (> 1 megabyte) is reccomended with the S3 device\&. +.PP +You can control where your data is physically stored by Amazon S3 using a location constraint\&. Setting this affects can affect both billing and legal concerns, so you are encouraged to consult Amazon\'s documentation for details\&. +.PP +To control location constraints, set the S3_BUCKET_LOCATION property\&. Currently, there are two valid settings: "" (any location) and "EU" (Europe)\&. If the S3_BUCKET_LOCATION is set, Amanda will check to make sure that the setting agrees with the constraint currently on the bucket\&. +.SS "Tape Device" +.nf +tapedev "tape:/dev/nst0" +.fi +.PP +The tape device driver interacts with a tape drive\&. The device uses the operating system\'s built\-in tape support, which is generally similar to that available via the command\-line utilities dd(1) and mt(1)\&. +.PP +The tape device name should specify a path to the operating system\'s device file\&. +.SS "VFS Device" +.nf +tapedev "file:/path/to/vtape" +.fi +.PP +The VFS device driver stores data on a UNIX filesystem\&. Note that although one typically uses the VFS device driver to store data on hard disks, the driver does not interface with any hardware on a block level\&. +.PP +The device name specifies a path to a directory which must exist and contain a "data/" subdirectory\&. Each tape file is stored as a distinct file in this directory, the name of which reflects the Amanda header in the tape file\&. Block boundaries are not maintained: the driver supports reads of arbitrary size, regardless of the blocksize used to write the data\&. +.SH "PROPERTIES" +.PP +Device drivers use +\fIproperties\fR +as a generic means to interact with other parts of Amanda\&. Some properties are set by the device driver and used by Amanda to determine how its devices should be used\&. Other properties can be set by Amanda or by the user to influence the driver\'s behavior\&. Properties are set for a particular device, so that if you have two tape devices, they will not share property values\&. +.PP +Properties are specified in +\fIamanda\&.conf\fR +with the +\fIdevice\-property\fR +parameter\&. The syntax looks like this: +.sp +.nf +device_property "FROBNICATOR_PATH" "/var/frobd/state" +device_property "BYTES_PER_FORTNIGHT" "128k" +device_property "USE_QUBITS" "no" +.fi +.PP +Both the property name and the property value are always quoted\&. String values are given as simple strings, like FROBNICATOR_PATH in the example above\&. Integer values can be specified with any of the suffixes given in the "VALUE SUFFIXES" section of +\fBamanda.conf\fR(5), like BYTES_PER_FORTNIGHT, above\&. Boolean values can be specified as any of "true", "yes", "1", "0", "no", "false", like USE_QUBITS, above\&. Some properties have special formats, as described below\&. +.PP +Some properties are set based on other configuration values, such as tapetype parameters\&. These special cases are detailed under the appropriate property, below\&. +.PP +The order in which device properties are set is as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +Tapetype parameters (including length, blocksize, and readblocksize) are translated into device properties and set accordingly\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +Device properties from any device_property configuration parameters are set, in the order they appear in the configuration file\&. +.RE +.PP +Properties described as read\-only are not accessible to users\&. They are listed here for completeness\&. +.SS "COMMON PROPERTIES" +.PP +Note that some of these properties are currently unused, and present only for future expansion\&. Not all devices implement all of these properties\&. +.PP +APPENDABLE +.RS 4 + + (read\-only) This boolean property indicates whether this device supports appending data to volumes\&. +.RE +.PP +BLOCK_SIZE +.RS 4 + + (read\-write) This property gives the block size, in bytes, that will be used to write to the device\&. The usual suffixes ("kbytes", etc\&.) are allowed\&. The tapetype parameter \fIblocksize\fR sets this property\&. +.RE +.PP +CANONICAL_NAME +.RS 4 + + (read\-only) This property contains the full canonical name for this device\&. This name may not be the same as the user\-supplied name, but is a valid name by which to access this device\&. +.RE +.PP +COMPRESSION +.RS 4 + + (read\-write) This boolean property represents the compression status of the device, and can be used to enable and disable such compression\&. This applies mostly to tape devices, although many tape devices do not support setting compression from software\&. +.RE +.PP +COMPRESSION_RATE +.RS 4 + + (read\-only) This property gives the compression rate, as a decimal ratio\&. It may be a measured value over some unspecified period or a simple estimate\&. +.RE +.PP +CONCURRENCY +.RS 4 + + (read\-only) This property indicates the level of concurrent access that this device supports\&. +.RE +.PP +FREE_SPACE +.RS 4 + + (read\-only) This property gives the amount of free space available on the current volume, if known\&. This is often an estimate; for example, tape devices can only estimate the amount of tape left on a spool\&. +.RE +.PP +MAX_BLOCK_SIZE +.RS 4 + + (read\-only) This property gives the maximum block size this device can support\&. See BLOCK SIZES, below\&. +.RE +.PP +MEDIUM_ACCESS_TYPE +.RS 4 + + (read\-only) This property gives the type of the media in the device: read only, WORM (Write Once, Read Many), read/write, or write only\&. Write\-only devices do not support recovery, but the data are not necessarily thrown out\&. +.RE +.PP +MIN_BLOCK_SIZE +.RS 4 + + (read\-write) This property gives the minimum block size this device can support\&. See BLOCK SIZES, below\&. +.RE +.PP +MAX_VOLUME_USAGE +.RS 4 + + (read\-write) On devices that support it, this property will limit the total amount of data written to a volume; attempts to write beyond this point will cause the device to simulate "out of space\&." Zero means no limit\&. The tapetype parameter \fIlength\fR sets this property\&. +.RE +.PP +PARTIAL_DELETION +.RS 4 + + (read\-only) This property indicates whether the device supports deletion of specific files\&. Aside from linear tapes, most devices can support this feature\&. It is currently unused by Amanda\&. +.RE +.PP +STREAMING +.RS 4 + + (read\-only) This property gives the streaming requirement for this device\&. For example, tape drives often require a steady supply of data to avoid shoe\-shining, while disk devices have no such requirement\&. +.RE +.PP +VERBOSE +.RS 4 + + (read\-write) If this boolean property is set, then the device will produce verbose debugging output\&. This property is not recognized by all devices\&. +.RE +.SS "BLOCK SIZES" +.PP +Amanda writes device data in blocks\&. On most devices the block boundaries are embedded in the media along with the data itself, so subsequent reads must use the same block sizes\&. On tape devices, the block size is dictated by the capabilities of the hardware \-\- buffer sizes, physical format, and so on\&. +.PP +Amanda has historically supported a single, fixed block size \-\- usually 32k\&. The Device API adds the ability to specify a block size at runtime, using the BLOCK_SIZE property\&. Devices provide MIN_BLOCK_SIZE and MAX_BLOCK_SIZE as a guide to the range of acceptable block sizes\&. Note that this does not imply that all sizes in the range MIN_BLOCK_SIZE \- MAX_BLOCK_SIZE are available \-\- the device may require that block sizes are even multiples of some power of two, for example\&. Consult the documentation for your hardware and operating system for more information\&. +.PP +Most devices are flexible enough to read a volume using a different block size than that with which it was written\&. This can be useful when handling old volumes written with a smaller blocksize, or volumes of unknown blocksize\&. Unfortunately, some tape devices do not detect oversized blocks correctly, and may lose data if the configured block size is smaller than the volume\'s block size\&. The tape device driver has a READ_BUFFER_SIZE property which specifies the minimum buffer size that will be allocated for reads from tape\&. If the hardware supports it, setting this property allows Amanda to correctly read from tapes written with any blocksize less than or equal to READ_BUFFER SIZE\&. +.if n \{\ +.sp +.\} +.RS 4 +.BM yellow +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +The RAIT device does not support flexible block sizes, as its parity algorithm requires that all child devices have the same, fixed block size\&. +.sp .5v +.EM yellow +.RE +.SS "DRIVER\-SPECIFIC PROPERTIES" +.SS "S3 Device" +.PP +S3_ACCESS_KEY +.RS 4 + + (read\-write) This property gives the Amazon S3 access key used to access the service\&. +.RE +.PP +S3_BUCKET_LOCATION +.RS 4 + + (read\-write) Location constraint for buckets on Amazon S3\&. +Currently, it can be set to "", for no constraint (i\&.e\&. store data in the US), +or "EU" (i\&.e\&. store data in the EU)\&. +See Amazon\'s documentation for details and latest information +.RE +.PP +S3_SECRET_KEY +.RS 4 + + (read\-write) This property gives the Amazon S3 secret key used to access the service\&. +.RE +.PP +S3_SSL +.RS 4 + + (read\-write) Whether or not to use SSL/TLS to secure communications with Amazon S3\&. +.RE +.PP +S3_USER_TOKEN +.RS 4 + + (read\-write) This property specifies the user token for Amanda Enterprise Edition customers\&. +.RE +.PP +Most Amanda devices work just fine without any properties, but not the S3 device\&. A typical S3 configuration will have an access key and secret key specified: +.sp +.nf +device_property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8" +device_property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr" +.fi + +.SS "Tape Device" +.PP +Most of these properties are automatically detected, but can be overridden in the configuration file if the autodetection fails\&. Note that tape drives are required to at least support the MTREW (rewind) operation; all other operations can be emulated with the MTREW and read data operations\&. +.PP +BROKEN_GMT_ONLINE +.RS 4 + + (read\-write) Set this boolean property if the system\'s GMT_ONLINE macro gives incorrect results\&. This is currently true for the Linux IDE\-TAPE driver\&. +.RE +.PP +BSF +.RS 4 + + (read\-write) This boolean property specifies whether the device + driver may execute the MTBSF operation (backward seek file)\&. +.RE +.PP +BSF_AFTER_EOM +.RS 4 + + (read\-write) This boolean property specifies whether the device + driver should execute an MTBSF (backward seek file) operation after + MTEOM (seek to end of recorded data) in order to append\&. +.RE +.PP +BSR +.RS 4 + + (read\-write) This boolean property specifies whether the device + driver may use the MTBSR operation (backward seek record)\&. +.RE +.PP +EOM +.RS 4 + + (read\-write) This boolean property specifies whether the device + driver may use the MTEOM command (seek to end of recorded data)\&. +.RE +.PP +FINAL_FILEMARKS +.RS 4 + + (read\-write) This integer property gives the number of filemarks that should be written at EOD\&. It is usually 1 or 2\&. +.RE +.PP +FSF +.RS 4 + + (read\-write) This boolean property specifies whether the device driver may use the MTFSF operation (forward seek file)\&. +.RE +.PP +FSR +.RS 4 + + (read\-write) This boolean property specifies whether the device driver may use the MTFSR operation (forward seek record)\&. +.RE +.PP +READ_BUFFER_SIZE +.RS 4 + + (read\-write) This property specifies the minimum buffer size that will be used for reads; this should be large enough to contain any block that may be read from the device, and must be larger than BLOCK_SIZE\&. This property exists for tape devices which cannot determine the size of on\-tape blocks, or which may discard data which overflows a small buffer\&. The tapetype parameter \fIREADBLOCKSIZE\fR sets this property\&. See BLOCK SIZES, above\&. +.RE +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +.SH "Authors" +.PP +\fBIan Turner\fR <\&ian@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda-scripts.7 b/man/amanda-scripts.7 new file mode 100644 index 0000000..28a9320 --- /dev/null +++ b/man/amanda-scripts.7 @@ -0,0 +1,216 @@ +.\" Title: amanda-scripts +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: Miscellanea +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMANDA\-SCRIPTS" "7" "01/22/2009" "Amanda 2\&.6\&.1" "Miscellanea" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda-scripts \- Configuring and using the Script API +.SH "DESCRIPTION" +.PP +The Script API is a flexible system for invoking user\-supplied scripts at various points in the execution of Amanda\&. This manual page describes the operation and configuration of the API\&. For help writing Script API scripts, see http://wiki\&.zmanda\&.com/index\&.php/Script_API\&. +.SH "SCRIPTS" +.PP +This section lists the scripts included with +\fIAmanda\fR, see the individual man page for instructions on using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamzfs-snapshot\fR(8), +\- create/destroy zfs snapshot\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBscript-email\fR(8), +\- send email\&. +.RE +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amanda.8 b/man/amanda.8 index ef16e72..be00f84 100644 --- a/man/amanda.8 +++ b/man/amanda.8 @@ -1,1101 +1,1044 @@ .\" Title: amanda -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMANDA" "8" "08/22/2008" "" "" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -amanda - Advanced Maryland Automatic Network Disk Archiver -.SH "SYNOPSIS" -.HP 8 -\fBamadmin\fR \fIconfig\fR \fIcommand\fR [\fIoptions\fR] -.br - -.HP 8 -\fBamcheck\fR [\fIoptions\fR] \fIconfig\fR -.br - -.HP 10 -\fBamcheckdb\fR \fIconfig\fR -.br - -.HP 10 -\fBamcleanup\fR \fIconfig\fR -.br - -.HP 8 -\fBamcrypt\fR -.br - -.HP 5 -\fBamdd\fR [\fIoptions\fR] -.HP 7 -\fBamdump\fR \fIconfig\fR -.br - -.HP 10 -\fBamaespipe\fR -.br - -.HP 8 -\fBamflush\fR [\-f] \fIconfig\fR -.br - -.HP 10 -\fBamgetconf\fR [\fIconfig\fR] \fIparameter\fR -.br - -.HP 8 -\fBamlabel\fR \fIconfig\fR \fIlabel\fR [\fIslot\fR\ \fIslot\fR] -.br - -.HP 5 -\fBammt\fR [\fIoptions\fR] -.HP 11 -\fBamoverview\fR \fIconfig\fR [\fIoptions\fR] -.br - -.HP 7 -\fBamplot\fR [\fIoptions\fR] \fIamdump\-files\fR -.br - -.HP 10 -\fBamrecover\fR [\fIconfig\fR] [\fIoptions\fR] -.br - -.HP 9 -\fBamreport\fR [\fIconfig\fR] [\fIoptions\fR] -.br - -.HP 10 -\fBamrestore\fR [\fIoptions\fR] \fItapedevice\fR [\fIhostname\fR\ [\fIdiskname\fR]] -.br - -.HP 12 -\fBamfetchdump\fR [\fIoptions\fR] \fIconfig\fR [\fIhostname\fR\ [\fIdiskname\fR\ [\fIdate\fR\ [level]]]] -.HP 9 -\fBamrmtape\fR [\fIoptions\fR] \fIconfig\fR \fIlabel\fR -.br - -.HP 9 -\fBamstatus\fR \fIconfig\fR [\fIoptions\fR] -.br - -.HP 7 -\fBamtape\fR \fIconfig\fR \fIcommand\fR [\fIoptions\fR] -.br - -.HP 11 -\fBamtapetype\fR [\fIoptions\fR] -.HP 6 -\fBamtoc\fR [\fIoptions\fR] \fIlogfile\fR +.TH "AMANDA" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 .br - -.HP 12 -\fBamcheckdump\fR [\fIoptions\fR] \fIconfig\fR +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} .br - -.HP 15 -\fBamserverconfig\fR [\fIoptions\fR] \fIconfig\fR +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ .br - -.HP 12 -\fBamaddclient\fR \fIconfig\fR [\fIoptions\fR] +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ .br - +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda \- The Open Source Backup Platform .SH "DESCRIPTION" .PP +This manual page gives an overview of the \fIAmanda\fR -is the "Advanced Maryland Automatic Network Disk Archiver"\. This manual page gives an overview of the -\fIAmanda\fR -commands and configuration files for quick reference\. +commands and configuration files for quick reference\&. +.SS "COMMANDS" .PP Here are all the \fIAmanda\fR -commands\. Each one has its own manual page\. See them for all the gory details\. -.PP -\fBamdump\fR +commands\&. Each one has its own manual page\&. See them for all the gory details\&. +.sp .RS 4 -Take care of automatic -\fIAmanda\fR -backups\. This is normally executed by -\fBcron\fR -on a computer called the -\fItape server host\fR -and requests backups of file systems located on -\fIbackup\fR -\fIclients\fR\. -\fBAmdump\fR -backs up all disks in the -\fIdisklist\fR -file (discussed below) to tape or, if there is a problem, to a special -\fIholding\fR -\fIdisk\fR\. After all backups are done, -\fBamdump\fR -sends mail reporting failures and successes\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamaddclient\fR(8), .RE -.PP -\fBamflush\fR +.sp .RS 4 -Flush backups from the holding disk to tape\. -\fBAmflush\fR -is used after -\fBamdump\fR -has reported it could not write backups to tape for some reason\. When this happens, backups stay in the holding disk\. Run -\fBamflush\fR -after the tape problem is corrected to write backups from the holding disk to tape\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamadmin\fR(8), .RE -.PP -\fBamcleanup\fR +.sp .RS 4 -Clean up after an interrupted -\fBamdump\fR\. This command is only needed if -\fBamdump\fR -was unable to complete for some reason, usually because the tape server host crashed while -\fBamdump\fR -was running\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamaespipe\fR(8), .RE -.PP -\fBamrecover\fR +.sp .RS 4 -Provides an interactive interface to browse the -\fIAmanda\fR -index files (backup image catalogues) and select which tapes to recover files from\. It can also run -\fBamrestore\fR -and a restore program (e\.g\. -\fBtar\fR) to actually recover the files\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcheck\fR(8), .RE -.PP -\fBamrestore\fR +.sp .RS 4 -Read an -\fIAmanda\fR -tape, searching for requested backups\. -\fBAmrestore\fR -is suitable for everything from interactive restores of single files to a full restore of all partitions on a failed disk\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcheckdb\fR(8), .RE -.PP -\fBamfetchdump\fR +.sp .RS 4 -Performs -\fIAmanda\fR -tape restoration, similar to -\fBamrestore\fR\. Additional capabilities include "hands\-off" searching of multiple tapes, automatic retrieval of specific dump files based on dump logs, and assembly of tape\-spanning split dump files\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcheckdump\fR(8), .RE -.PP -\fBamlabel\fR +.sp .RS 4 -Write an -\fIAmanda\fR -format label onto a tape\. All -\fIAmanda\fR -tapes must be labeled with -\fBamlabel\fR\. -\fBAmdump\fR -and -\fBamflush\fR -will not write to an unlabeled tape (see TAPE MANAGEMENT below)\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcleanup\fR(8), .RE -.PP -\fBamcheck\fR +.sp .RS 4 -Verify the correct tape is mounted and all file systems on all backup client systems are ready to be backed up\. Often run by -\fBcron\fR -before -\fBamdump\fR -to generate a mail warning that backups might fail unless corrective action is taken\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcrypt-ossl-asym\fR(8), .RE -.PP -\fBamadmin\fR +.sp .RS 4 -Take care of administrative tasks like finding out which tapes are needed to restore a filesystem, forcing hosts to do full backups of selected disks and looking at schedule balance information\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcrypt-ossl\fR(8), .RE -.PP -\fBamtape\fR +.sp .RS 4 -Take care of tape changer control operations like loading particular tapes, ejecting tapes and scanning the tape storage slots\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcrypt\fR(8), .RE -.PP -\fBamcheckdump\fR +.sp .RS 4 -Check the results of an -\fIAmanda\fR -dump\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamcryptsimple\fR(8), .RE -.PP -\fBamserverconfig\fR +.sp .RS 4 -Program to setup initial -\fIAmanda\fR -configuration\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamdd\fR(8), .RE -.PP -\fBamaddclient\fR +.sp .RS 4 -Program to add client to an existing -\fIAmanda\fR -configuration\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamdevcheck\fR(8), .RE -.PP -\fBamrmtape\fR +.sp .RS 4 -Delete a tape from the -\fIAmanda\fR -databases\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamdump\fR(8), .RE -.PP -\fBamstatus\fR +.sp .RS 4 -Report the status of a running or completed -\fBamdump\fR\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamfetchdump\fR(8), .RE -.PP -\fBamoverview\fR +.sp .RS 4 -Display a chart of hosts and file systems backed up every run\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamflush\fR(8), .RE -.PP -\fBamplot\fR +.sp .RS 4 -Generate utilization plots of -\fIAmanda\fR -runs for performance tuning\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamgetconf\fR(8), .RE -.PP -\fBamreport\fR +.sp .RS 4 -Generate an -\fIAmanda\fR -summary E\-mail report\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamgpgcrypt\fR(8), .RE -.PP -\fBamtoc\fR +.sp .RS 4 -Generate table of content files for -\fIAmanda\fR -tapes\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamgtar\fR(8), .RE -.PP -\fBamcheckdb\fR +.sp .RS 4 -Verify every tape -\fIAmanda\fR -knows about is consistent in the database\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamlabel\fR(8), .RE -.PP -\fBamgetconf\fR +.sp .RS 4 -Look up parameters in the -\fIAmanda\fR -configuration file\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBammt\fR(8), .RE -.PP -\fBamtapetype\fR +.sp .RS 4 -Generate a tapetype definition\. +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamoverview\fR(8), .RE -.PP -\fBamaespipe\fR +.sp .RS 4 -Wrapper program from aespipe (data encryption utility) +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamplot\fR(8), .RE -.PP -\fBamcrypt\fR +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamrecover\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamreport\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamrestore\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamrmtape\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamsamba\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamserverconfig\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamservice\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamstar\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamstatus\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamtape\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamtapetype\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamtoc\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamvault\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamzfs-sendrecv\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamzfs-snapshot\fR(8), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBscript-email\fR(8), +.RE +.SS "CONFIGURATION FILES" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda.conf\fR(5), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-client.conf\fR(5), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBdisklist\fR(5), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBtapelist\fR(5), +.RE +.SS "DATA FORMATS" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-archive-format\fR(5), +.RE +.SS "CONCEPTS" +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-applications\fR(7), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-auth\fR(7), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-changers\fR(7), +.RE +.sp .RS 4 -Reference encryption program for Amanda symmetric data encryption +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-devices\fR(7), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBamanda-scripts\fR(7), .RE .SH "CONFIGURATION" .PP -There are three user\-editable files that control the behavior of -\fIAmanda\fR\. +There are four user\-editable files that control the behavior of +\fIAmanda\fR\&. .PP -The first is -\fBamanda\.conf\fR, the main configuration file\. It contains parameters to customize -\fIAmanda\fR -for the site\. Refer to the -\fBamanda.conf\fR(5), manpage for details on +The first two are +\fBamanda.conf\fR(5) +and +\fBamanda-client.conf\fR(5), the main configuration files for the server and client, respectively\&. They contain parameters to customize \fIAmanda\fR -configuration parameters\. +for the site\&. .PP -Second is the -\fIdisklist\fR -file, which lists hosts and disk partitions to back up\. +Next is the +\fBdisklist\fR(5) +file, which lists hosts and disk partitions to back up\&. .PP -Third is the -\fItapelist\fR -file, which lists tapes that are currently active\. These files are described in more detail in the following sections\. +Last is the seldom\-edited +\fBtapelist\fR(5) +file, which lists tapes that are currently active\&. These files are described in more detail in the following sections\&. .PP -All files are stored in individual configuration directories under -\fI/usr/local/etc/amanda/\fR\. A site will often have more than one configuration\. For example, it might have a +All files are stored in individual configuration directories, usually under +\FC/etc/amanda/\F[]\&. A site will often have more than one configuration\&. For example, it might have a \fInormal\fR configuration for everyday backups and an \fIarchive\fR -configuration for infrequent full archival backups\. The configuration files would be stored under directories -\fI/usr/local/etc/amanda/normal/\fR +configuration for infrequent full archival backups\&. The configuration files would be stored under directories +\FC/etc/amanda/normal/\F[] and -\fI/usr/local/etc/amanda/archive/\fR, respectively\. Part of the job of an +\FC/etc/amanda/archive/\F[], respectively\&. Part of the job of an \fIAmanda\fR -administrator is to create, populate and maintain these directories\. +administrator is to create, populate and maintain these directories\&. +.SH "LOG FILES" .PP All log and database files generated by \fIAmanda\fR -go in corresponding directories somewhere\. The exact location is controlled by entries in -\fBamanda\.conf\fR\. A typical location would be under -\fI/var/adm/amanda\fR\. For the above example, the files might go in -\fI/var/adm/amanda/normal/\fR +go in corresponding directories somewhere\&. The exact location is controlled by entries in +\fBamanda.conf\fR(5)\&. A typical location would be under +\FC/var/adm/amanda\F[]\&. For the above example, the files might go in +\FC/var/adm/amanda/normal/\F[] and -\fI/var/adm/amanda/archive/\fR\. +\FC/var/adm/amanda/archive/\F[]\&. .PP As log files are no longer needed (no longer contain relevant information), \fIAmanda\fR -cycles them out in various ways, depending on the type of file\. +cycles them out in various ways, depending on the type of file\&. .PP Detailed information about \fBamdump\fR -runs are stored in files named -\fBamdump\.\fR\fINN\fR +runs are stored in dump logs \-\- files named +\fBamdump\&.\fR\fINN\fR where \fINN\fR -is a sequence number, with 1 being the most recent file\. +is a sequence number, with 1 being the most recent file\&. \fBAmdump\fR rotates these files each run, keeping roughly the last \fBtapecycle\fR -(see below) worth of them\. +(see below) worth of them\&. .PP The file used by \fBamreport\fR -to generate the mail summary is named -\fBlog\.\fR\fIYYYYMMDD\.NN\fR +to generate the mail summary is the trace log\&. This file constitutes the "catalog" describing the data on the tapes written in a run\&. It is named +\fBlog\&.\fR\fIYYYYMMDDHHMMSS\&.NN\fR where -\fIYYYYMMDD\fR +\fIYYYYMMDDHHMMSS\fR is the datestamp of the start of the \fBamdump\fR +or +\fBamflush\fR run and \fINN\fR -is a sequence number started at 0\. At the end of each +is a sequence number started at 0\&. At the end of each \fBamdump\fR run, log files for runs whose tapes have been reused are renamed into a subdirectory of the main log directory (see the \fBlogdir\fR parameter below) named -\fBoldlog\fR\. It is up to the +\fBoldlog\fR\&. It is up to the \fIAmanda\fR -administrator to remove them from this directory when desired\. +administrator to remove them from this directory when desired\&. .PP Index (backup image catalogue) files older than the full dump matching the oldest backup image for a given client and disk are removed by \fBamdump\fR -at the end of each run\. -.SH "DISKLIST FILE" +at the end of each run\&. +.SH "Using Samba" .PP -The -\fIdisklist\fR -file determines which disks will be backed up by -\fIAmanda\fR\. The file usually contains one line per disk: +For Samba access, +\fIAmanda\fR +needs a file on the Samba server (which may or may not also be the tape server) named +\FC/etc/amandapass\F[] +with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated\&. By default, the user used to connect to the PC is the same for all PC\'s and is compiled into +\fIAmanda\fR\&. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password\&. For instance: .nf -\fIhostname diskname\fR [\fIdiskdevice\fR] \fIdumptype\fR [\fIspindle\fR [\fIinterface\fR] ] + //some\-pc/home normalpw + //another\-pc/disk otheruser%otherpw .fi .PP -All pairs [ -\fIhostname diskname\fR -] must be unique\. +With clear text passwords, this file should obviously be tightly protected\&. It only needs to be readable by the +\fIAmanda\fR\-user on the Samba server\&. +.SH "HOST & DISK EXPRESSION" +.PP +All host and disk arguments to programs are special expressions\&. The command applies to all disks that match your arguments\&. This section describes the matcher\&. .PP -Lines starting with # are ignored, as are blank lines\. The fields have the following meanings: +The matcher matches by word, each word is a glob expression, words are separated by the separator \'\&.\' for host and \'/\' for disk\&. You can anchor the expression at left with a \'^\'\&. You can anchor the expression at right with a \'$\'\&. The matcher is case insensitive for host but is case sensitive for disk\&. A match succeeds if all words in your expression match contiguous words in the host or disk\&. .PP -\fIhostname\fR +dot (\&.) .RS 4 -The name of the host to be backed up\. If -\fBdiskdevice\fR -refers to a PC share, this is the host -\fIAmanda\fR -will run the Samba -\fBsmbclient\fR -program on to back up the share\. +word separator for a host .RE .PP -\fIdiskname\fR -.RS 4 -The name of the disk (a label)\. In most case, you set your -\fBdiskname\fR -to the -\fBdiskdevice\fR -and you don\'t set the -\fBdiskdevice\.\fR -If you want multiple entries with the same -\fBdiskdevice\fR, you must set a different -\fBdiskname\fR -for each entry\. It\'s the -\fBdiskname\fR -that you use on the commandline for any -\fIAmanda\fR -command\. Look at the example/disklist file for example\. +/ +.RS 4 +word separator for a disk .RE .PP -\fIdiskdevice\fR +^ .RS 4 -Default: same as diskname\. The name of the disk device to be backed up\. It may be a full device name, a device name without the -\fI/dev/\fR -prefix, e\.g\. -\fIsd0a\fR, or a mount point such as -\fI/usr\fR\. -.sp -It may also refer to a PC share by starting the name with two (forward) slashes, e\.g\. -\fI//some\-pc/home\fR\. In this case, the -\fBprogram\fR -option in the associated -\fBdumptype\fR -must be entered as -\fBGNUTAR\fR\. It is the combination of the double slash disk name and -\fBprogram GNUTAR\fR -in the -\fBdumptype\fR -that triggers the use of Samba\. +anchor at left .RE .PP -\fIdumptype\fR +$ .RS 4 -Refers to a -\fBdumptype\fR -defined in the -\fBamanda\.conf\fR -file\. -\fIDumptype\fRs specify backup related parameters, such as whether to compress the backups, whether to record backup results in -\fI/etc/dumpdates\fR, the disk\'s relative priority, etc\. +anchor at right .RE .PP -\fIspindle\fR +? .RS 4 -Default: -\fB\-1\fR\. A number used to balance backup load on a host\. -\fIAmanda\fR -will not run multiple backups at the same time on the same spindle, unless the spindle number is \-1, which means there is no spindle restriction\. +match exactly one character except the separator .RE .PP -\fIinterface\fR +* .RS 4 -Default: -\fIlocal\fR\. The name of a network interface definition in the -\fBamanda\.conf\fR -file, used to balance network load\. +match zero or more characters except the separator .RE .PP -Instead of naming a -\fBdumptype\fR, it is possible to define one in\-line, enclosing -\fBdumptype\fR -options within curly braces, one per line, just like a -\fBdumptype\fR -definition in -\fBamanda\.conf\fR\. Since pre\-existing -\fBdumptype\fRs are valid option names, this syntax may be used to customize -\fBdumptype\fRs for particular disks\. -.PP -A line break -\fBmust\fR -follow the left curly bracket\. -.PP -For instance, if a -\fBdumptype\fR -named -\fInormal\fR -is used for most disks, but use of the holding disk needs to be disabled for the file system that holds it, this would work instead of defining a new dumptype: -.nf -\fIhostname diskname\fR [ \fIdiskdevice\fR ] { - normal - holdingdisk never -} [ \fIspindle\fR [ \fIinterface\fR ] ] -.fi -.SH "TAPE MANAGEMENT" -.PP -The -\fItapelist\fR -file contains the list of tapes in active use\. This file is maintained entirely by -\fIAmanda\fR -and should not be created or edited during normal operation\. It contains lines of the form: -.PP -.nf -YYYYMMDD label flags -.fi -.PP -Where -\fIYYYYMMDD\fR -is the date the tape was written, -\fIlabel\fR -is a label for the tape as written by -\fBamlabel\fR -and -\fIflags\fR -tell -\fIAmanda\fR -whether the tape may be reused, etc (see the -\fBreuse\fR -options of -\fBamadmin\fR)\. -.PP -\fBAmdump\fR -and -\fBamflush\fR -will refuse to write to an unlabeled tape, or to a labeled tape that is considered active\. There must be more tapes in active rotation (see the -\fBtapecycle\fR -option) than there are runs in the backup cycle (see the -\fBdumpcycle\fR -option) to prevent overwriting a backup image that would be needed to do a full recovery\. -.SH "OUTPUT DRIVERS" -.PP -The normal value for the -\fBtapedev\fR -parameter, or for what a tape changer returns, is a full path name to a non\-rewinding tape device, such as -\fI/dev/nst0\fR -or -\fI/dev/rmt/0mn\fR -or -\fI/dev/nst0\.1\fR -or whatever conventions the operating system uses\. -\fIAmanda\fR -provides additional application level drivers that support non\-traditional tape\-simulations or features\. To access a specific output driver, set -\fBtapedev\fR -(or configure your changer to return) a string of the form -\fIdriver\fR:\fIdriver\-info\fR -where -\fIdriver\fR -is one of the supported drivers and -\fIdriver\-info\fR -is optional additional information needed by the driver\. +** +.RS 4 +match zero or more characters including the separator +.RE .PP -The supported drivers are: +Some examples: .PP -\fItape\fR +hosta .RS 4 -This is the default driver\. The -\fIdriver\-info\fR -is the tape device name\. Entering -.sp -.nf -tapedev /dev/rmt/0mn -.fi -is really a short hand for -.sp -.nf -tapedev tape:/dev/rmt/0mn -.fi +Will match +\FChosta\F[], +\FCfoo\&.hosta\&.org\F[], and +\FChoSTA\&.dOMAIna\&.ORG\F[] +but not +\FChostb\F[]\&. .RE .PP -\fInull\fR +host .RS 4 -This driver throws away anything written to it and returns EOF for any reads except a special case is made for reading a label, in which case a "fake" value is returned that -\fIAmanda\fR -checks for and allows through regardless of what you have set in -\fBlabelstr\fR\. The -\fIdriver\-info\fR -field is not used and may be left blank: -.sp -.sp -.nf -tapedev null: -.fi -.sp -The -\fIlength\fR -value from the associated -\fBtapetype\fR -is used to limit the amount of data written\. When the limit is reached, the driver will simulate end of tape\. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -Note -This driver should only be used for debugging and testing, and probably only with the -\fBrecord\fR -option set to -\fIno\fR\. +Will match +\FChost\F[] +but not +\FChosta\F[]\&. .RE .PP -\fIrait\fR +host? .RS 4 -\fIR\fRedundant -\fIA\fRrray of -\fII\fRnexpensive (?) -\fIT\fRapes\. Reads and writes tapes mounted on multiple drives by spreading the data across N\-1 drives and using the last drive for a checksum\. See docs/RAIT for more information\. -.sp -The -\fIdriver\-info\fR -field describes the devices to use\. Curly braces indicate multiple replacements in the string\. For instance: -.sp -.sp -.nf -tapedev rait:/dev/rmt/tps0d{4,5,6}n -.fi -.sp -would use the following devices: -.sp -\fI/dev/rmt/tps0d4n\fR -\fI/dev/rmt/tps0d5n\fR -\fI/dev/rmt/tps0d6n\fR +Will match +\FChosta\F[] +and +\FChostb\F[], but not +\FChost\F[]\&. .RE .PP -\fIfile\fR -.RS 4 -This driver emulates a tape device with a set of files in a directory\. The -\fIdriver\-info\fR -field must be the name of an existing directory\. The driver will test for a subdirectory of that named -\fIdata\fR -and return -\fBoffline\fR -until it is present\. When present, the driver uses two files in the -\fIdata\fR -subdirectory for each tape file\. One contains the actual data\. The other contains record length information\. -.sp -The driver uses a file named -\fIstatus\fR -in the -\fBfile\fR -device directory to hold driver status information, such as tape position\. If not present, the driver will create it as though the device is rewound\. -.sp -The -\fIlength\fR -value from the associated -\fBtapetype\fR -is used to limit the amount of data written\. When the limit is reached, the driver will simulate end of tape\. -.sp -One way to use this driver with a real device such as a CD\-writer is to create a directory for the -\fBfile\fR -device and one or more other directories for the actual data\. Create a symlink named -\fIdata\fR -in the -\fBfile\fR -directory to one of the data directories\. Set the -\fBtapetype\fR -length to whatever the medium will hold\. -.sp -When -\fIAmanda\fR -fills the -\fBfile\fR -device, remove the symlink and (optionally) create a new symlink to another data area\. Use a CD writer software package to burn the image from the first data area\. -.sp -To read the CD, mount it and create the -\fIdata\fR -symlink in the -\fBfile\fR -device directory\. +ho*na +.RS 4 +Will match +\FChoina\F[] +but not +\FCho\&.aina\&.org\F[]\&. .RE -.SH "AUTHORIZATION" -.PP -\fIAmanda\fR -processes on the tape server host run as the -\fBdumpuser\fR -user listed in -\fBamanda\.conf\fR\. When they connect to a backup client, they do so with an -\fIAmanda\fR\-specific protocol\. They do not, for instance, use -\fBrsh\fR -or -\fBssh\fR -directly\. .PP -On the client side, the -\fBamandad\fR -daemon validates the connection using one of several methods, depending on how it was compiled and on options it is passed: +ho**na +.RS 4 +Will match +\FChoina\F[] +and +\FCho\&.aina\&.org\F[]\&. +.RE .PP -\.rhosts +^hosta .RS 4 -Even though -\fIAmanda\fR -does not use -\fBrsh\fR, it can use -\fB\.rhosts\fR\-style authentication and a -\fB\.rhosts\fR -file\. +Will match +\FChosta\F[] +but not +\FCfoo\&.hosta\&.org\F[]\&. .RE .PP -\.amandahosts +sda* .RS 4 -This is essentially the same as -\fB\.rhosts\fR -authentication except a different file, with almost the same format, is used\. This is the default mechanism built into -\fIAmanda\fR\. -.sp -The format of the -\fI\.amandahosts\fR -file is: -.sp -\fIhostname\fR -[ -\fIusername\fR -[ -\fIservice\fR -]*] -.sp -If -\fIusername\fR -is ommitted, it defaults to the user running -\fBamandad\fR, i\.e\. the user listed in the -\fBinetd\fR -or -\fBxinetd\fR -configuration file\. -.sp -The -\fIservice\fR -is a list of the service the client is authorized to execute: -\fBamdump\fR, -\fBnoop\fR, -\fBselfcheck\fR, -\fBsendsize\fR, -\fBsendbackup\fR, -\fBamindexd\fR, -\fBamidxtaped\fR\. -\fBamdump\fR -is a shortcut for "noop selfcheck sendsize sendbackup" +Will match +\FC/dev/sda1\F[] +and +\FC/dev/sda12\F[]\&. .RE .PP -Kerberos +/opt .RS 4 -\fIAmanda\fR -may use the Kerberos authentication system\. Further information is in the -\fBdocs/KERBEROS\fR -file that comes with an -\fIAmanda\fR -distribution\. -.sp -For Samba access, -\fIAmanda\fR -needs a file on the Samba server (which may or may not also be the tape server) named -\fI/etc/amandapass\fR -with share names, (clear text) passwords and (optional) domain names, in that order, one per line, whitespace separated\. By default, the user used to connect to the PC is the same for all PC\'s and is compiled into -\fIAmanda\fR\. It may be changed on a host by host basis by listing it first in the password field followed by a percent sign and then the password\. For instance: -.nf - //some\-pc/home normalpw - //another\-pc/disk otheruser%otherpw -.fi -With clear text passwords, this file should obviously be tightly protected\. It only needs to be readable by the -\fIAmanda\fR\-user on the Samba server\. -.sp -You can find further information in the -\fBdocs/SAMBA\fR -file that comes with an -\fIAmanda\fR -distribution\. +Will match the disk +\FCopt\F[] +but not the host +\FCopt\F[]\&. .RE -.SH "HOST & DISK EXPRESSION" .PP -All host and disk arguments to programs are special expressions\. The command applies to all disks that match your arguments\. This section describes the matcher\. +(note dots:) \&.opt\&. +.RS 4 +Will match the host +\FCopt\F[] +but not the disk +\FCopt\F[]\&. +.RE .PP -The matcher matches by word, each word is a glob expression, words are separated by the separator \'\.\' for host and \'/\' for disk\. You can anchor the expression at left with a \'^\'\. You can anchor the expression at right with a \'$\'\. The matcher is case insensitive for host but is case sensitive for disk\. A match succeeds if all words in your expression match contiguous words in the host or disk\. -.TS -tab(:); -l l -l l -l l -l l -l l -l l -l l. -T{ -\. -T}:T{ -word separator for a host -T} -T{ / -T}:T{ -word separator for a disk -T} -T{ -^ -T}:T{ -anchor at left -T} -T{ -$ -T}:T{ -anchor at right -T} -T{ -? -T}:T{ -match exactly one character except the separator -T} -T{ -* -T}:T{ -match zero or more characters except the separator -T} -T{ -** -T}:T{ -match zero or more characters including the separator -T} -.TE +.RS 4 +Will match the disk +\FC/\F[] +but no other disk\&. +.RE .PP -Some examples: -.TS -tab(:); -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -EXPRESSION -T}:T{ -WILL MATCH -T}:T{ -WILL NOT MATCH -T} -T{ -hosta -T}:T{ -hosta -T}:T{ -hostb -T} -T{ -\ -T}:T{ -hoSTA\.dOMAIna\.ORG -T}:T{ -\ -T} -T{ -\ -T}:T{ -foo\.hosta\.org -T}:T{ -\ -T} -T{ -host -T}:T{ -host -T}:T{ -hosta -T} -T{ -host? -T}:T{ -hosta -T}:T{ -host -T} -T{ -\ -T}:T{ -hostb -T}:T{ -\ -T} -T{ -ho*na -T}:T{ -hoina -T}:T{ -ho\.aina\.org -T} -T{ -ho**na -T}:T{ -hoina -T}:T{ -\ -T} -T{ -\ -T}:T{ -ho\.aina\.org -T}:T{ -\ -T} -T{ -^hosta -T}:T{ -hosta -T}:T{ -foo\.hosta\.org -T} -T{ -sda* -T}:T{ -/dev/sda1 -T}:T{ -\ -T} -T{ -\ -T}:T{ -/dev/sda12 -T}:T{ -\ -T} -T{ -/opt -T}:T{ -opt (disk) -T}:T{ -opt (host) -T} -T{ -\.opt\. -T}:T{ -opt (host) -T}:T{ -opt (disk) -T} -T{ -/ -T}:T{ -/ -T}:T{ -any other disk -T} -T{ -/usr -T}:T{ /usr -T}:T{ -\ -T} -T{ -\ -T}:T{ -/usr/opt -T}:T{ -\ -T} -T{ +.RS 4 +Will match the disks +\FC/usr\F[] +and +\FC/usr/local\F[]\&. +.RE +.PP /usr$ -T}:T{ -/usr -T}:T{ -/usr/opt -T} -.TE -.sp +.RS 4 +Will match the disks +\FC/usr\F[] +but not +\FC/usr/local\F[]\&. +.RE .SH "DATESTAMP EXPRESSION" .PP A \fIdatestamp\fR -expression is a range expression where we only match the prefix\. Leading ^ is removed\. Trailing $ forces an exact match\. -.TS -allbox tab(:); -l l -l l -l l -l l -l l -l l -l l. -T{ +expression is a range expression where we only match the prefix\&. Leading ^ is removed\&. Trailing $ forces an exact match\&. +.PP 20001212\-14 -T}:T{ +.RS 4 match all dates beginning with 20001212, 20001213 or 20001214 -T} -T{ +.RE +.PP 20001212\-4 -T}:T{ +.RS 4 same as previous -T} -T{ +.RE +.PP 20001212\-24 -T}:T{ +.RS 4 match all dates between 20001212 and 20001224 -T} -T{ +.RE +.PP 2000121 -T}:T{ +.RS 4 match all dates that start with 2000121 (20001210\-20001219) -T} -T{ +.RE +.PP 2 -T}:T{ +.RS 4 match all dates that start with 2 (20000101\-29991231) -T} -T{ +.RE +.PP 2000\-10 -T}:T{ +.RS 4 match all dates between 20000101\-20101231 -T} -T{ +.RE +.PP 200010$ -T}:T{ +.RS 4 match only 200010 -T} -.TE -.PP +.RE .SH "DUMP SPECIFICATIONS" .PP -A dump specification selects one or more dumps\. It has the form -\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above\. If a component is missing, it is treated as a wildcard\. The characters \':\', \'@\', and \'\e\' may be escaped within any component by preceding them with a \'\e\'\. +A dump specification selects one or more dumps\&. It has the form +\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above\&. If a component is missing, it is treated as a wildcard\&. The characters \':\', \'@\', and \'\e\' may be escaped within any component by preceding them with a \'\e\'\&. .PP Some examples: -.TS -tab(:); -l l -l l -l l -l l -l l -l l. -T{ -DUMPSPEC -T}:T{ -DESCRIPTION -T} -T{ +.PP client17 -T}:T{ +.RS 4 all dumps of client17 -T} -T{ +.RE +.PP @20080615 -T}:T{ +.RS 4 All dumps on with datestamps matching 20080615 -T} -T{ +.RE +.PP webserver:/var/www -T}:T{ +.RS 4 All dumps of /var/www on host webserver -T} -T{ +.RE +.PP webserver:/var/www@200806150317 -T}:T{ +.RS 4 The dump of webserver with datestamp 200806150317 -T} -T{ +.RE +.PP :/var/www -T}:T{ +.RS 4 All dumps of /var/www on any host -T} -.TE -.sp +.RE .SH "CONFIGURATION OVERRIDE" .PP Most commands allow the override of specific configuration options on the command line, using the \-o -option\. This option has the form -\-o\fIname\fR=\fIvalue\fR\. An optional space is allowed after the -\-o\. Each configuration option should be specified in a separate command\-line option\. +option\&. This option has the form +\-o\fIname\fR=\fIvalue\fR\&. An optional space is allowed after the +\-o\&. Each configuration option should be specified in a separate command\-line option\&. .PP For global options, \fIname\fR -is simply the name of the option, e\.g\., +is simply the name of the option, e\&.g\&., .sp .nf amdump \-oruntapes=2 @@ -1107,7 +1050,7 @@ has the form \fISECTION\fR is one of TAPETYPE, DUMPTYPE, HOLDINGDISK, or INTERFACE, and \fIsection_name\fR -is the name of the tapetype, dumptype, holdingdisk, or interface\. Examples: +is the name of the tapetype, dumptype, holdingdisk, or interface\&. Examples: .sp .nf amdump \-o TAPETYPE:HP\-DAT:length=2000m @@ -1116,48 +1059,20 @@ amdump \-o HOLDINGDISK:hd1:use="\-100 mb" amdump \-o INTERFACE:local:use="2000 kbps" .fi .PP -Note that configuration overrides are not effective for tape changers, which supply a tapedev based on their own configuration\. In order to override +When overriding device properties, one must carefully quote the command line to simulate the syntax of real configuration files\&. The following example should serve as a guide: +.sp +.nf +amdump \-o \'device\-property="PROPERTY_MAX_VOLUME_USAGE" "100000"\' +.fi +.PP +Note that configuration overrides are not effective for tape changers, which supply a tapedev based on their own configuration\&. In order to override \fItapedev\fR, you must also disable any changer: .sp .nf amdump \-otapedev=/dev/nst1 \-otpchanger=\'\' .fi -.SH "AUTHOR" -.PP -James da Silva, - -: Original text +.SH "Authors" .PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion, major update -.SH "SEE ALSO" +\fBJames da Silva\fR <\&jds@amanda\&.org\&> .PP - -\fBamadmin\fR(8), -\fBamanda.conf\fR(5), -\fBamanda-client.conf\fR(5), -\fBamcheck\fR(8), -\fBamcheckdb\fR(8), -\fBamcleanup\fR(8), -\fBamdd\fR(8), -\fBamdump\fR(8), -\fBamfetchdump\fR(8) -\fBamflush\fR(8), -\fBamgetconf\fR(8), -\fBamlabel\fR(8), -\fBammt\fR(8), -\fBamoverview\fR(8), -\fBamplot\fR(8), -\fBamrecover\fR(8), -\fBamreport\fR(8), -\fBamrestore\fR(8), -\fBamrmtape\fR(8), -\fBamstatus\fR(8), -\fBamtape\fR(8), -\fBamtapetype\fR(8), -\fBamtoc\fR(8), -\fBamcheckdump\fR(8), -\fBamserverconfig\fR(8), -\fBamaddclient\fR(8), -: http://wiki.zmanda.com +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amanda.conf.5 b/man/amanda.conf.5 index 31e7d46..c0299af 100644 --- a/man/amanda.conf.5 +++ b/man/amanda.conf.5 @@ -1,102 +1,305 @@ .\" Title: amanda.conf -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: File formats and conventions +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMANDA\.CONF" "5" "08/22/2008" "" "" +.TH "AMANDA\&.CONF" "5" "01/22/2009" "Amanda 2\&.6\&.1" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amanda.conf - Main configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amanda.conf \- Main configuration file for \fIAmanda\fR, the Advanced Maryland Automatic Network Disk Archiver .SH "DESCRIPTION" .PP -\fIamanda\.conf\fR +\fBamanda.conf\fR(5) is the main configuration file for -\fIAmanda\fR\. This manpage lists the relevant sections and parameters of this file for quick reference\. +\fIAmanda\fR\&. This manpage lists the relevant sections and parameters of this file for quick reference\&. .PP The file -\fB//amanda\.conf\fR -is loaded\. -.SH "PARAMETERS" +\fB//amanda\&.conf\fR +is loaded\&. +.SH "SYNTAX" .PP There are a number of configuration parameters that control the behavior of the \fIAmanda\fR -programs\. All have default values, so you need not specify the parameter in -\fBamanda\.conf\fR -if the default is suitable\. +programs\&. All have default values, so you need not specify the parameter in +\fBamanda\&.conf\fR +if the default is suitable\&. +.SS "COMMENTS" .PP -Lines starting with # are ignored, as are blank lines\. Comments may be placed on a line with a directive by starting the comment with a #\. The remainder of the line is ignored\. +Lines starting with # are ignored, as are blank lines\&. Comments may be placed on a line with a directive by starting the comment with a #\&. The remainder of the line is ignored\&. +.SS "KEYWORDS AND IDENTIFIERS" .PP -Keywords are case insensitive, i\.e\. +Keywords are case insensitive, i\&.e\&. \fBmailto\fR and \fBMailTo\fR -are treated the same\. +are treated the same\&. Also, the characters +\fB\'\-\'\fR +and +\fB\'_\'\fR +are interchangeable in all predefined +\fIAmanda\fR +keywords: +\fBdevice_property\fR +and +\fBdevice\-property\fR +have the same meaning\&. +.PP +Identifiers are names which are defined in the configuration itself, such as dumptypes or interfaces\&. Identifiers are are case\-insensitive, but sensitive to +\fB\'\-\'\fR +vs\&. +\fB\'_\'\fR\&. Identifiers should be quoted in the configuration file, although For historical reasons, the quotes are optional\&. +.PP +Strings are always quoted with double quotes ("), and any double quotes or backslashes within the string are escaped with a backslash: +.sp +.nf +tapelist "/path/to/tapelist" +property "escaped\-string" "escaping: \e\e (backslash) and \e" (double\-quote)" +.fi +.PP +To summarize, then: +.sp +.nf + # QUOTES CASE \-/_ +logdir "logs" # required sensitive sensitive +send\-amreport\-on strange # prohibited insensitive insensitive +tapetype "EXABYTE" # optional insensitive sensitive + +define dumptype "dt" { # optional insensitive sensitive + "dumptype\-common" # optional insensitive sensitive + strategy noincr # prohibited insensitive insensitive +} +.fi +.SS "VALUE SUFFIXES" .PP Integer arguments may have one of the following (case insensitive) suffixes, some of which have a multiplier effect: -.SS "POSSIBLE SUFFIXES" .PP \fBb byte bytes\fR .RS 4 -Some number of bytes\. +Some number of bytes\&. .RE .PP \fBbps\fR .RS 4 -Some number of bytes per second\. +Some number of bytes per second\&. .RE .PP \fBk kb kbyte kbytes kilobyte kilobytes\fR .RS 4 -Some number of kilobytes (bytes*1024)\. +Some number of kilobytes (bytes*1024)\&. .RE .PP \fBkps kbps\fR .RS 4 -Some number of kilobytes per second (bytes*1024)\. +Some number of kilobytes per second (bytes*1024)\&. +.sp +It is the default multiplier for all size options\&. .RE .PP \fBm mb meg mbyte mbytes megabyte megabytes\fR .RS 4 -Some number of megabytes (bytes*1024*1024)\. +Some number of megabytes (bytes*1024*1024)\&. .RE .PP \fBmps mbps\fR .RS 4 -Some number of megabytes per second (bytes*1024*1024)\. +Some number of megabytes per second (bytes*1024*1024)\&. .RE .PP \fBg gb gbyte gbytes gigabyte gigabytes\fR .RS 4 -Some number of gigabytes (bytes*1024*1024*1024)\. +Some number of gigabytes (bytes*1024*1024*1024)\&. .RE .PP \fBtape tapes\fR .RS 4 -Some number of tapes\. +Some number of tapes\&. .RE .PP \fBday days\fR .RS 4 -Some number of days\. +Some number of days\&. .RE .PP \fBweek weeks\fR .RS 4 -Some number of weeks (days*7)\. +Some number of weeks (days*7)\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br The value \fBinf\fR -may be used in most places where an integer is expected to mean an infinite amount\. +may be used in most places where an integer is expected to mean an infinite amount\&. .sp Boolean arguments may have any of the values \fBy\fR, @@ -112,351 +315,419 @@ to indicate a true state, or \fBfalse\fR or \fBoff\fR -to indicate a false state\. If no argument is given, +to indicate a false state\&. If no argument is given, \fBtrue\fR -is assumed\. +is assumed\&. +.sp .5v +.EM yellow .RE -.SS "PARAMETERS" +.RE +.SS "PARAMETER ORDER" +.PP +In general, the order in which parameters occur in the configuration file does not matter, with the exception of subsection inheritance\&. For example, if dumptype "normal\-encrypt" which inherits from dumptype "normal", then "normal" must appear first in the configuration file\&. +.SS "STRINGS" +.PP +Quoted strings in Amanda follow a common, C\-like syntax\&. Printable characters and whitespace are kept as\-is, except that the backslash character (\e) is used as an escape character, and a double\-quote ends the string\&. The allowed escape sequences are +.sp +.nf + ESCAPE SEQUENCE BECOMES + \e\e \e + \e" " + \en (newline) + \et (tab) + \er (carriage return) + \ef (form\-feed) + \e1 \- \e7 + \e01 \- \e77 + \e001 \- \e377 (character specified in octal) +.fi +Illegally quoted strings are handled on a "best\-effort" basis, which may lead to unexpected results\&. +.PP +Examples: +.sp +.nf +finserver "/data/finance/XYZ Corp\'s \e"real\e" finances" finance\-high eth0 \-1 +property "syspath" "C:\e\eWINDOWS\e\eSYSTEM" +.fi +.SH "GLOBAL PARAMETERS" .PP \fBorg\fR \fI string\fR .RS 4 Default: -\fIdaily\fR\. A descriptive name for the configuration\. This string appears in the Subject line of mail reports\. Each +\fIdaily\fR\&. A descriptive name for the configuration\&. This string appears in the Subject line of mail reports\&. Each \fIAmanda\fR -configuration should have a different string to keep mail reports distinct\. +configuration should have a different string to keep mail reports distinct\&. +.RE +.PP +\fBmailer\fR \fI string\fR +.RS 4 +Default found by configure\&. A mail program that can send mail with \'\fIMAILER \-s "subject" user < message_file\fR\'\&. .RE .PP \fBmailto\fR \fI string\fR .RS 4 Default: -\fIoperators\fR\. A space separated list of recipients for mail reports\. +\fIoperators\fR\&. A space separated list of recipients for mail reports\&. +.RE +.PP +\fBsend\-amreport\-on\fR [all|strange|error|never] +.RS 4 +Default: +\fBall\fR\&. Specify which types of messages will trigger an email from amreport\&. amreport is used by amdump and amflush\&. +.PP +\fBall\fR +.RS 4 +Send an email on any message\&. +.RE +.PP +\fBstrange\fR +.RS 4 +Send an email on strange or error message\&. A strange message occurs when the dump succeeded, but returned one or more errors unknown to +\fIAmanda\fR\&. +.RE +.PP +\fBerror\fR +.RS 4 +Send an email only on error messages\&. +.RE +.PP +\fBnever\fR +.RS 4 +Never send an email\&. +.RE .RE .PP \fBdumpcycle\fR \fI int\fR .RS 4 Default: -\fI10 days\fR\. The number of days in the backup cycle\. Each disk will get a full backup at least this often\. Setting this to zero tries to do a full backup each run\. +\fI10 days\fR\&. The number of days in the backup cycle\&. Each disk will get a full backup at least this often\&. Setting this to zero tries to do a full backup each run\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br This parameter may also be set in a specific \fBdumptype\fR -(see below)\. This value sets the default for all +(see below)\&. This value sets the default for all \fBdumptype\fRs so must appear in -\fBamanda\.conf\fR +\fBamanda\&.conf\fR before any -\fBdumptype\fRs are defined\. +\fBdumptype\fRs are defined\&. +.sp .5v +.EM yellow +.RE .RE .PP \fBrunspercycle\fR \fI int\fR .RS 4 Default: -\fIsame as dumpcycle\fR\. The number of amdump runs in +\fIsame as dumpcycle\fR\&. The number of amdump runs in \fBdumpcycle\fR -days\. A value of 0 means the same value as -\fBdumpcycle\fR\. A value of \-1 means guess the number of runs from the -\fItapelist\fR +days\&. A value of 0 means the same value as +\fBdumpcycle\fR\&. A value of \-1 means guess the number of runs from the +\fBtapelist\fR(5) file, which is the number of tapes used in the last \fBdumpcycle\fR days / -\fBruntapes\fR\. +\fBruntapes\fR\&. .RE .PP \fBtapecycle\fR \fI int\fR .RS 4 Default: -\fI15 tapes\fR\. Typically tapes are used by +\fI15 tapes\fR\&. Typically tapes are used by \fIAmanda\fR -in an ordered rotation\. The +in an ordered rotation\&. The \fBtapecycle\fR -parameter defines the size of that rotation\. The number of tapes in rotation must be larger than the number of tapes required for a complete dump cycle (see the +parameter defines the size of that rotation\&. The number of tapes in rotation must be larger than the number of tapes required for a complete dump cycle (see the \fBdumpcycle\fR -parameter)\. +parameter)\&. .sp This is calculated by multiplying the number of \fBamdump\fR runs per dump cycle (\fBrunspercycle\fR parameter) times the number of tapes used per run (\fBruntapes\fR -parameter)\. Typically two to four times this calculated number of tapes are in rotation\. While +parameter)\&. Typically two to four times this calculated number of tapes are in rotation\&. While \fIAmanda\fR is always willing to use a new tape in its rotation, it refuses to reuse a tape until at least \'\fBtapecycle\fR -\-1\' number of other tapes have been used\. +\-1\' number of other tapes have been used\&. .sp It is considered good administrative practice to set the \fBtapecycle\fR -parameter slightly lower than the actual number of tapes in rotation\. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order\. +parameter slightly lower than the actual number of tapes in rotation\&. This allows the administrator to more easily cope with damaged or misplaced tapes or schedule adjustments that call for slight adjustments in the rotation order\&. .RE .PP \fBusetimestamps\fR \fI bool\fR .RS 4 Default: -\fBYes\fR\. This option allows Amanda to track multiple runs per calendar day\. The only reason one might disable it is that Amanda versions before 2\.5\.1 can\'t read logfiles written when this option was enabled\. +\fBYes\fR\&. This option allows Amanda to track multiple runs per calendar day\&. The only reason one might disable it is that Amanda versions before 2\&.5\&.1 can\'t read logfiles written when this option was enabled\&. .RE .PP \fBlabel_new_tapes\fR \fI string\fR .RS 4 -Default: not set\. When set, this directive will cause +Default: not set\&. When set, this directive will cause \fIAmanda\fR to automatically write an \fIAmanda\fR -tape label to any blank tape she encounters\. This option is DANGEROUS because when set, +tape label to any blank tape she encounters\&. This option is DANGEROUS because when set, \fIAmanda\fR will ERASE any non\-\fIAmanda\fR -tapes you may have, and may also ERASE any near\-failing tapes\. Use with caution\. +tapes you may have, and may also ERASE any near\-failing tapes\&. Use with caution\&. .sp -When using this directive, specify the template for new tape labels\. The template should contain some number of contiguous \'%\' characters, which will be replaced with a generated number\. Be sure to specify enough \'%\' characters that you do not run out of tape labels\. Example: +When using this directive, specify the template for new tape labels\&. The template should contain some number of contiguous \'%\' characters, which will be replaced with a generated number\&. Be sure to specify enough \'%\' characters that you do not run out of tape labels\&. Example: \fBlabel_new_tapes "DailySet1\-%%%"\fR .RE .PP \fBdumpuser\fR \fI string\fR .RS 4 Default: -\fIamanda\fR\. The login name +\fIamanda\fR\&. The login name \fIAmanda\fR -uses to run the backups\. The backup client hosts must allow access from the tape server host as this user via -\fB\.rhosts\fR +uses to run the backups\&. The backup client hosts must allow access from the tape server host as this user via +\fB\&.rhosts\fR or -\fB\.amandahosts\fR, depending on how the +\fB\&.amandahosts\fR, depending on how the \fIAmanda\fR -software was built\. +software was built\&. .RE .PP \fBprinter\fR string .RS 4 -Printer to use when doing tape labels\. See the +Printer to use when doing tape labels\&. See the \fBlbl\-templ\fR \fBtapetype\fR -option\. +option\&. .RE .PP \fBtapedev\fR string .RS 4 Default: -\fInull:\fR\. The path name of the non\-rewinding tape device\. Non\-rewinding tape device names often have an \'n\' in the name, e\.g\. -\fI/dev/rmt/0mn\fR, however this is operating system specific and you should consult that documentation for detailed naming information\. +\FCnull:\F[]\&. The device name, referencing the name of a "device" section in the configuration file\&. See +\fBamanda-devices\fR(7) +for more information on device names\&. .sp If a tape changer is configured (see the \fBtpchanger\fR -option), this option might not be used\. +option), this option might not be used\&. .sp -If the -\fBnull\fR -output driver is selected (see the section OUTPUT DRIVERS in the -\fBamanda\fR(8) -manpage for more information), programs such as +If +\fBtapedev\fR +is +\fBnull:\fR, programs such as \fBamdump\fR -will run normally but all images will be thrown away\. This should only be used for debugging and testing, and probably only with the +will run normally but all images will be thrown away\&. This should only be used for debugging and testing, and probably only with the \fBrecord\fR option set to -\fIno\fR\. +\fIno\fR\&. .RE .PP \fBdevice_property\fR string string .RS 4 -These options can set various device properties, including block size, maximum volume usage, authentication information, hardware feature support, and more\.Specifics of how properties are used are device\-dependent, though some common properties are supported across multiple device drivers\. -.sp -Both strings are quoted; the first string contains the name of the property to set, and the second contains its value\. For example, to set a fixed block size of 128k, do: +These options can set various device properties\&. See +\fBamanda-devices\fR(7) +for more information on device properties and their syntax\&. Both strings are always quoted; the first string contains the name of the property to set, and the second contains its value\&. For example, to set a fixed block size of 128k, write: .nf -device_property "BLOCK_SIZE" "131072".fi -.sp -The order in which device properties are set is as follows: -.sp -.RS 4 -\h'-04' 1.\h'+02'Tapetype parameters, including length, blocksize, readblocksize, file\-pad, are translated into device properties and set accordingly\. +device_property "BLOCK_SIZE" "128k" +.fi .RE -.sp +.PP +\fBproperty\fR [append] string string+ .RS 4 -\h'-04' 2.\h'+02'Device properties from any device_property configuration directives are set, in the order they appear in the configuration file\. -.RE +These options can set various properties, they can be used by third party software to store information in the configuration file\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. .RE .PP \fBtpchanger\fR string .RS 4 Default: -\fInone\fR\. The name of the tape changer\. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\. +\fInone\fR\&. The name of the tape changer\&. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\&. .sp -If a tape changer is configured, choose one of the changer scripts (e\.g\. -\fBchg\-scsi\fR) and enter that here\. +If a tape changer is configured, choose one of the changer scripts (e\&.g\&. +\fBchg\-scsi\fR) and enter that here\&. .RE .PP \fBchangerdev\fR string .RS 4 Default: -\fI/dev/null\fR\. A tape changer configuration parameter\. Usage depends on the particular changer defined with the +\FC/dev/null\F[]\&. A tape changer configuration parameter\&. Usage depends on the particular changer defined with the \fBtpchanger\fR -option\. +option\&. .RE .PP \fBchangerfile\fR string .RS 4 Default: -\fI/usr/adm/amanda/log/changer\-status\fR\. A tape changer configuration parameter\. Usage depends on the particular changer defined with the +\FC/usr/adm/amanda/log/changer\-status\F[]\&. A tape changer configuration parameter\&. Usage depends on the particular changer defined with the \fBtpchanger\fR -option\. +option\&. .RE .PP \fBruntapes\fR int .RS 4 Default: -1\. The maximum number of tapes used in a single run\. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\. +\FC1\F[]\&. The maximum number of tapes used in a single run\&. If a tape changer is not configured, this option is not used and should be commented out of the configuration file\&. .sp If a tape changer is configured, this may be set larger than one to let \fIAmanda\fR -write to more than one tape\. +write to more than one tape\&. .sp Note that this is an upper bound on the number of tapes, and \fIAmanda\fR -may use less\. +may use less\&. .sp Also note that as of this release, \fIAmanda\fR -does not support true tape overflow\. When it reaches the end of one tape, the backup image +does not support true tape overflow\&. When it reaches the end of one tape, the backup image \fIAmanda\fR -was processing starts over again on the next tape\. +was processing starts over again on the next tape\&. .RE .PP \fBmaxdumpsize\fR int .RS 4 Default: -\fIruntapes\fR*\fItape_length\fR\. Maximum number of bytes the planner will schedule for a run\. +\fIruntapes\fR*\fItape_length\fR\&. Maximum number of bytes the planner will schedule for a run\&. +.sp +The default unit is Kbytes if it is not specified\&. .RE .PP \fBtaperalgo\fR [first|firstfit|largest|largestfit|smallest|last] .RS 4 Default: -\fIfirst\fR\. The algorithm used to choose which dump image to send to the taper\. +\fIfirst\fR\&. The algorithm used to choose which dump image to send to the taper\&. .PP \fBfirst\fR .RS 4 -First in, first out\. +First in, first out\&. .RE .PP \fBfirstfit\fR .RS 4 -The first dump image that will fit on the current tape\. +The first dump image that will fit on the current tape\&. .RE .PP \fBlargest\fR .RS 4 -The largest dump image\. +The largest dump image\&. .RE .PP \fBlargestfit\fR .RS 4 -The largest dump image that will fit on the current tape\. +The largest dump image that will fit on the current tape\&. .RE .PP \fBsmallest\fR .RS 4 -The smallest dump image\. +The smallest dump image\&. .RE .PP \fBlast\fR .RS 4 -Last in, first out\. +Last in, first out\&. .RE .RE .PP \fBlabelstr\fR \fI string\fR .RS 4 Default: -\fI\.*\fR\. The tape label constraint regular expression\. All tape labels generated (see -\fBamlabel\fR(8)) and used by this configuration must match the regular expression\. If multiple configurations are run from the same tape server host, it is helpful to set their labels to different strings (for example, "DAILY[0\-9][0\-9]*" vs\. "ARCHIVE[0\-9][0\-9]*") to avoid overwriting each other\'s tapes\. +\fI\&.*\fR\&. The tape label constraint regular expression\&. All tape labels generated (see +\fBamlabel\fR(8)) and used by this configuration must match the regular expression\&. If multiple configurations are run from the same tape server host, it is helpful to set their labels to different strings (for example, "DAILY[0\-9][0\-9]*" vs\&. "ARCHIVE[0\-9][0\-9]*") to avoid overwriting each other\'s tapes\&. .RE .PP -\fBtapetype\fR \fI string\fR +\fBtapetype\fR \fI identifier\fR .RS 4 Default: -\fIEXABYTE\fR\. The type of tape drive associated with +\fI"EXABYTE"\fR\&. The type of tape drive associated with \fBtapedev\fR or -\fBtpchanger\fR\. This refers to one of the defined +\fBtpchanger\fR\&. This refers to one of the defined \fBtapetype\fRs in the config file (see below), which specify various tape parameters, like the \fBlength\fR, \fBfilemark\fR size, and \fBspeed\fR -of the tape media and device\. -.sp -First character of a -\fBtapetype\fR -string must be an alphabetic character +of the tape media and device\&. .RE .PP \fBctimeout\fR int .RS 4 Default: -\fI30 seconds\fR\. Maximum amount of time that +\fI30 seconds\fR\&. Maximum amount of time that \fBamcheck\fR -will wait for each client host\. +will wait for each client host\&. .RE .PP \fBdtimeout\fR int .RS 4 Default: -\fI1800 seconds\fR\. Amount of idle time per disk on a given client that a +\fI1800 seconds\fR\&. Amount of idle time per disk on a given client that a \fBdumper\fR running from within \fBamdump\fR -will wait before it fails with a data timeout error\. +will wait before it fails with a data timeout error\&. .RE .PP \fBetimeout\fR int .RS 4 Default: -\fI300 seconds\fR\. Amount of time per estimate on a given client that the +\fI300 seconds\fR\&. Amount of time per estimate on a given client that the \fBplanner\fR step of \fBamdump\fR -will wait to get the dump size estimates (note: Amanda runs up to 3 estimates for each DLE)\. For instance, with the default of 300 seconds and four DLE\'s, each estimating level 0 and level 1 on client A, +will wait to get the dump size estimates (note: Amanda runs up to 3 estimates for each DLE)\&. For instance, with the default of 300 seconds and four DLE\'s, each estimating level 0 and level 1 on client A, \fBplanner\fR -will wait up to 40 minutes for that machine\. A negative value will be interpreted as a total amount of time to wait per client instead of per disk\. +will wait up to 40 minutes for that machine\&. A negative value will be interpreted as a total amount of time to wait per client instead of per disk\&. .RE .PP \fBconnect_tries\fR int .RS 4 Default: -\fI3\fR\. How many times the server will try a connection\. +\fI3\fR\&. How many times the server will try a connection\&. .RE .PP \fBreq_tries\fR int .RS 4 Default: -\fI3\fR\. How many times the server will resend a REQ packet if it doesn\'t get the ACK packet\. +\fI3\fR\&. How many times the server will resend a REQ packet if it doesn\'t get the ACK packet\&. .RE .PP \fBnetusage\fR int .RS 4 Default: -\fI8000 Kbps\fR\. The maximum network bandwidth allocated to -\fIAmanda\fR, in Kbytes per second\. See also the +\fI8000 Kbps\fR\&. The maximum network bandwidth allocated to +\fIAmanda\fR, in Kbytes per second\&. See also the \fBinterface\fR -section\. +section\&. .RE .PP \fBinparallel\fR int .RS 4 Default: -10\. The maximum number of backups that +\FC10\F[]\&. The maximum number of backups that \fIAmanda\fR -will attempt to run in parallel\. +will attempt to run in parallel\&. \fIAmanda\fR -will stay within the constraints of network bandwidth and holding disk space available, so it doesn\'t hurt to set this number a bit high\. Some contention can occur with larger numbers of backups, but this effect is relatively small on most systems\. +will stay within the constraints of network bandwidth and holding disk space available, so it doesn\'t hurt to set this number a bit high\&. Some contention can occur with larger numbers of backups, but this effect is relatively small on most systems\&. .RE .PP \fBdisplayunit\fR "k|m|g|t" .RS 4 Default: -"k"\. The unit used to print many numbers, k=kilo, m=mega, g=giga, t=tera\. +\FC"k"\F[]\&. The unit used to print many numbers, k=kilo, m=mega, g=giga, t=tera\&. .RE .PP \fBdumporder\fR string .RS 4 Default: -\fItttTTTTTTT\fR\. The priority order of each dumper: +\fItttTTTTTTT\fR\&. The priority order of each dumper: .sp .nf s: smallest size @@ -471,190 +742,200 @@ B: largest bandwidth \fBmaxdumps\fR int .RS 4 Default: -1\. The maximum number of backups from a single host that +\FC1\F[]\&. The maximum number of backups from a single host that \fIAmanda\fR -will attempt to run in parallel\. See also the +will attempt to run in parallel\&. See also the \fBinparallel\fR -option\. +option\&. .sp Note that this parameter may also be set in a specific \fBdumptype\fR -(see below)\. This value sets the default for all +(see below)\&. This value sets the default for all \fBdumptype\fRs so must appear in -\fBamanda\.conf\fR +\fBamanda\&.conf\fR before any -\fBdumptype\fRs are defined\. +\fBdumptype\fRs are defined\&. .RE .PP \fBbumpsize\fR int .RS 4 Default: -\fI10 Mbytes\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\. If +\fI10 Mbytes\fR\&. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\&. If \fIAmanda\fR -determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. The value of this parameter is used only if the parameter +determines that the next higher backup level will be this much smaller than the current level, it will do the next level\&. The value of this parameter is used only if the parameter \fIbumppercent\fR -is set to 0\. +is set to 0\&. +.sp +The default unit is Kbytes if it is not specified\&. .sp -The global setting of this parameter can be overwritten inside of a dumptype\-definition\. +The global setting of this parameter can be overwritten inside of a dumptype\-definition\&. .sp See also the options \fBbumppercent\fR, \fBbumpmult\fR and -\fBbumpdays\fR\. +\fBbumpdays\fR\&. .RE .PP \fBbumppercent\fR int .RS 4 Default: -\fI0 percent\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\. If +\fI0 percent\fR\&. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\&. If \fIAmanda\fR -determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. +determines that the next higher backup level will be this much smaller than the current level, it will do the next level\&. .sp If this parameter is set to 0, the value of the parameter \fIbumpsize\fR -is used to trigger bumping\. +is used to trigger bumping\&. .sp -The global setting of this parameter can be overwritten inside of a dumptype\-definition\. +The global setting of this parameter can be overwritten inside of a dumptype\-definition\&. .sp See also the options \fBbumpsize\fR, \fBbumpmult\fR and -\fBbumpdays\fR\. +\fBbumpdays\fR\&. .RE .PP \fBbumpmult\fR \fI float\fR .RS 4 Default: -1\.5\. The bump size multiplier\. +\FC1\&.5\F[]\&. The bump size multiplier\&. \fIAmanda\fR multiplies \fBbumpsize\fR -by this factor for each level\. This prevents active filesystems from bumping too much by making it harder to bump to the next level\. For example, with the default +by this factor for each level\&. This prevents active filesystems from bumping too much by making it harder to bump to the next level\&. For example, with the default \fBbumpsize\fR and \fBbumpmult\fR -set to 2\.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\. +set to 2\&.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\&. .sp -The global setting of this parameter can be overwritten inside of a dumptype\-definition\. +The global setting of this parameter can be overwritten inside of a dumptype\-definition\&. .RE .PP \fBbumpdays\fR \fI int\fR .RS 4 Default: -\fI2 days\fR\. To insure redundancy in the dumps, +\fI2 days\fR\&. To insure redundancy in the dumps, \fIAmanda\fR keeps filesystems at the same incremental level for at least \fBbumpdays\fR -days, even if the other bump threshold criteria are met\. +days, even if the other bump threshold criteria are met\&. .sp -The global setting of this parameter can be overwritten inside of a dumptype\-definition\. +The global setting of this parameter can be overwritten inside of a dumptype\-definition\&. .RE .PP \fBdiskfile\fR \fI string\fR .RS 4 Default: -\fIdisklist\fR\. The file name for the +\fIdisklist\fR\&. The file name for the \fIdisklist\fR -file holding client hosts, disks and other client dumping information\. +file holding client hosts, disks and other client dumping information\&. .RE .PP \fBinfofile\fR \fI string\fR .RS 4 Default: -\fI/usr/adm/amanda/curinfo\fR\. The file or directory name for the historical information database\. If +\FC/usr/adm/amanda/curinfo\F[]\&. The file or directory name for the historical information database\&. If \fIAmanda\fR -was configured to use DBM databases, this is the base file name for them\. If it was configured to use text formated databases (the default), this is the base directory and within here will be a directory per client, then a directory per disk, then a text file of data\. +was configured to use DBM databases, this is the base file name for them\&. If it was configured to use text formated databases (the default), this is the base directory and within here will be a directory per client, then a directory per disk, then a text file of data\&. .RE .PP \fBlogdir\fR \fI string\fR .RS 4 Default: -\fI/usr/adm/amanda\fR\. The directory for the +\FC/usr/adm/amanda\F[]\&. The directory for the \fBamdump\fR and \fBlog\fR -files\. +files\&. .RE .PP \fBindexdir\fR \fI string\fR .RS 4 Default -\fI/usr/adm/amanda/index\fR\. The directory where index files (backup image catalogues) are stored\. Index files are only generated for filesystems whose +\FC/usr/adm/amanda/index\F[]\&. The directory where index files (backup image catalogues) are stored\&. Index files are only generated for filesystems whose \fBdumptype\fR has the \fBindex\fR -option enabled\. +option enabled\&. .RE .PP \fBtapelist\fR \fI string\fR .RS 4 Default: -\fItapelist\fR\. The file name for the active -\fItapelist\fR -file\. +\fItapelist\fR\&. The file name for the active +\fBtapelist\fR(5)\&. \fIAmanda\fR -maintains this file with information about the active set of tapes\. +maintains this file with information about the active set of tapes\&. .RE .PP \fBdevice_output_buffer_size\fR \fI int\fR .RS 4 Default: -640k\. Controls the amount of memory used by +\FC1280k\F[]\&. Controls the amount of memory used by \fIAmanda\fR -to hold data as it is read from the network or disk before it is written to the output device\. Higher values may be useful on fast tape drives and optical media\. +to hold data as it is read from the network or disk before it is written to the output device\&. Higher values may be useful on fast tape drives and optical media\&. +.sp +The default unit is bytes if it is not specified\&. .RE .PP \fBtapebufs\fR \fI int\fR .RS 4 Default: -20\. This option is deprecated; use the +\FC20\F[]\&. This option is deprecated; use the \fBdevice_output_buffer_size\fR -directive instead\. +directive instead\&. \fBtapebufs\fR -works the same way, but the number specified is multiplied by the device blocksize prior to use\. +works the same way, but the number specified is multiplied by the device blocksize prior to use\&. .RE .PP \fBreserve\fR \fI number\fR .RS 4 Default: -100\. The part of holding\-disk space that should be reserved for incremental backups if no tape is available, expressed as a percentage of the available holding\-disk space (0\-100)\. By default, when there is no tape to write to, degraded mode (incremental) backups will be performed to the holding disk\. If full backups should also be allowed in this case, the amount of holding disk space reserved for incrementals should be lowered\. +\FC100\F[]\&. The part of holding\-disk space that should be reserved for incremental backups if no tape is available, expressed as a percentage of the available holding\-disk space (0\-100)\&. By default, when there is no tape to write to, degraded mode (incremental) backups will be performed to the holding disk\&. If full backups should also be allowed in this case, the amount of holding disk space reserved for incrementals should be lowered\&. .RE .PP \fBautoflush\fR \fI bool\fR .RS 4 Default: -\fIoff\fR\. Whether an amdump run will flush the dumps from holding disk to tape\. +\fIoff\fR\&. Whether an amdump run will flush the dumps from holding disk to tape\&. .RE .PP \fBamrecover_do_fsf\fR \fI bool\fR .RS 4 Default: -\fIon\fR\. Amrecover will call amrestore with the \-f flag for faster positioning of the tape\. +\fIon\fR\&. Amrecover will call amrestore with the \-f flag for faster positioning of the tape\&. .RE .PP \fBamrecover_check_label\fR \fI bool\fR .RS 4 Default: -\fIon\fR\. Amrecover will call amrestore with the \-l flag to check the label\. +\fIon\fR\&. Amrecover will call amrestore with the \-l flag to check the label\&. .RE .PP \fBamrecover_changer\fR \fI string\fR .RS 4 -Default: \'\'\. Amrecover will use the changer if you use \'settape \' and that string is the same as the amrecover_changer setting\. +Default: \'\'\&. Amrecover will use the changer if you use \'settape \' and that string is the same as the amrecover_changer setting\&. .RE .PP \fBcolumnspec\fR \fI string\fR .RS 4 Defines the width of columns \fBamreport\fR -should use\. +should use\&. \fIString\fR -is a comma (\',\') separated list of triples\. Each triple consists of three parts which are separated by a equal sign (\'=\') and a colon (\':\') (see the example)\. These three parts specify: +is a comma (\',\') separated list of triples\&. Each triple consists of three parts which are separated by a equal sign (\'=\') and a colon (\':\') (see the example)\&. These three parts specify: .sp .RS 4 -\h'-04' 1.\h'+02'the name of the column, which may be: +.ie n \{\ +\h'-04' 1.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 1." 4.2 +.\} +the name of the column, which may be: .nf Compress (compression ratio) Disk (client disk name) @@ -666,124 +947,138 @@ is a comma (\',\') separated list of triples\. Each triple consists of three par OutKB (output image size in KBytes) TapeRate (tape writing rate in KBytes/sec) TapeTime (total tape time in hours:minutes) - .fi +.fi .RE .sp .RS 4 -\h'-04' 2.\h'+02'the amount of space to display before the column (used to get whitespace between columns)\. +.ie n \{\ +\h'-04' 2.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 2." 4.2 +.\} +the amount of space to display before the column (used to get whitespace between columns)\&. .sp .RE .sp .RS 4 -\h'-04' 3.\h'+02'the width of the column itself\. If set to a negative value, the width will be calculated on demand to fit the largest entry in this column\. +.ie n \{\ +\h'-04' 3.\h'+01'\c +.\} +.el \{\ +.sp -1 +.IP " 3." 4.2 +.\} +the width of the column itself\&. If set to a negative value, the width will be calculated on demand to fit the largest entry in this column\&. .RE -.IP "" 4 +.RS 4 Here is an example: .sp .nf columnspec "Disk=1:18,HostName=0:10,OutKB=1:7" .fi .sp -The above will display the disk information in 18 characters and put one space before it\. The hostname column will be 10 characters wide with no space to the left\. The output KBytes column is seven characters wide with one space before it\. +The above will display the disk information in 18 characters and put one space before it\&. The hostname column will be 10 characters wide with no space to the left\&. The output KBytes column is seven characters wide with one space before it\&. .RE .PP \fBincludefile\fR \fI string\fR .RS 4 Default: -\fInone\fR\. The name of an +\fInone\fR\&. The name of an \fIAmanda\fR -configuration file to include within the current file\. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations\. Relative pathnames are relative to the configuration directory\. +configuration file to include within the current file\&. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations\&. Relative pathnames are relative to the configuration directory\&. .RE .PP \fBdebug_auth\fR int .RS 4 Default: -\fI0\fR\. Debug level of the auth module +\fI0\fR\&. Debug level of the auth module .RE .PP \fBdebug_event\fR int .RS 4 Default: -\fI0\fR\. Debug level of the event module +\fI0\fR\&. Debug level of the event module .RE .PP \fBdebug_holding\fR int .RS 4 Default: -\fI0\fR\. Debug level of the holdingdisk module +\fI0\fR\&. Debug level of the holdingdisk module .RE .PP \fBdebug_protocol\fR int .RS 4 Default: -\fI0\fR\. Debug level of the protocol module +\fI0\fR\&. Debug level of the protocol module .RE .PP \fBdebug_planner\fR int .RS 4 Default: -\fI0\fR\. Debug level of the planner process +\fI0\fR\&. Debug level of the planner process .RE .PP \fBdebug_driver\fR int .RS 4 Default: -\fI0\fR\. Debug level of the driver process +\fI0\fR\&. Debug level of the driver process .RE .PP \fBdebug_dumper\fR int .RS 4 Default: -\fI0\fR\. Debug level of the dumper process +\fI0\fR\&. Debug level of the dumper process .RE .PP \fBdebug_chunker\fR int .RS 4 Default: -\fI0\fR\. Debug level of the chunker process +\fI0\fR\&. Debug level of the chunker process .RE .PP \fBdebug_taper\fR int .RS 4 Default: -\fI0\fR\. Debug level of the taper process +\fI0\fR\&. Debug level of the taper process .RE .PP \fBflush\-threshold\-dumped\fR int .RS 4 Default: -\fI0\fR\. +\fI0\fR\&. \fIAmanda\fR -will not begin writing data to a new volume until the amount of data on the holding disk is at least this percentage of the volume size\. In other words, +will not begin writing data to a new volume until the amount of data on the holding disk is at least this percentage of the volume size\&. In other words, \fIAmanda\fR will not begin until the inequality -h < t \(mu d +h > t \(mu d is satisfied, where h is the amount of data on the holding disk, t is the capacity of a volume, and d -is this parameter, expressed as a percentage\. +is this parameter, expressed as a percentage\&. This parameter may be larger than 100%, for example to keep more recent dumps on the holding disk for faster recovery\&. .sp -Needless to say, your holding disk must be big enough that this criterion could be satisfied\. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then +Needless to say, your holding disk must be big enough that this criterion could be satisfied\&. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then \fIAmanda\fR -will disregard the constraint specified by this setting and start a new volume anyway\. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\. +will disregard the constraint specified by this setting and start a new volume anyway\&. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\&. .sp The value of this parameter may not exceed than that of the \fBflush\-threshold\-scheduled\fR -parameter\. +parameter\&. .RE .PP \fBflush\-threshold\-scheduled\fR int .RS 4 Default: -\fI0\fR\. +\fI0\fR\&. \fIAmanda\fR -will not begin writing data to a new volume until the sum of the amount of data on the holding disk and the estimated amount of data remaining to be dumped during this run is at least this percentage of the volume size\. In other words, +will not begin writing data to a new volume until the sum of the amount of data on the holding disk and the estimated amount of data remaining to be dumped during this run is at least this percentage of the volume size\&. In other words, \fIAmanda\fR will not begin until the inequality -h + s < t \(mu d +h + s > t \(mu d is satisfied, where h is the amount of data on the holding disk, @@ -792,279 +1087,265 @@ is the total amount of data scheduled for this run but not dumped yet, t is the capacity of a volume, and d -is this parameter, expressed as a percentage\. +is this parameter, expressed as a percentage\&. This parameter may be larger than 100%\&. .sp -Needless to say, your holding disk must be big enough that this criterion could be satisfied\. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then +Needless to say, your holding disk must be big enough that this criterion could be satisfied\&. If the holding disk cannot be used for a particular dump (because, for example, there is no remaining holding space) then \fIAmanda\fR -will disregard the constraint specified by this setting and start a new volume anyway\. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\. +will disregard the constraint specified by this setting and start a new volume anyway\&. Once writing to a volume has begun, this constraint is not applied unless and until a new volume is needed\&. .sp The value of this parameter may not be less than that of the \fBflush\-threshold\-dumped\fR or \fBtaperflush\fR -parameters\. +parameters\&. .RE .PP \fBtaperflush\fR int .RS 4 Default: -\fI0\fR\. At the end of a run, +\fI0\fR\&. At the end of a run, \fIAmanda\fR -will start a new tape to flush remaining data if there is more data on the holding disk at the end of a run than this setting allows; the amount is specified as a percentage of the capacity of a single volume\. In other words, at the end of a run, +will start a new tape to flush remaining data if there is more data on the holding disk at the end of a run than this setting allows; the amount is specified as a percentage of the capacity of a single volume\&. In other words, at the end of a run, \fIAmanda\fR will begin a new tape if the inequality -h < t \(mu f +h > t \(mu f is satisfied, where h is the amount of data remaining on the holding disk from this or previous runs, t is the capacity of a volume, and f -is this parameter, expressed as a percentage\. +is this parameter, expressed as a percentage\&. This parameter may be greater than 100%\&. .sp The value of this parameter may not exceed that of the \fBflush\-threshold\-scheduled\fR -parameter\.; +parameter\&.; \fBautoflush\fR must be set to \'yes\' if \fBtaperflush\fR -is greater than 0\. +is greater than 0\&. .RE .PP \fBreserved\-udp\-port\fR int,int .RS 4 Default: \-\-with\-udpportrange or -\fI512,1023\fR\. Reserved udp port that will be used (bsd, bsdudp)\. Range is inclusive\. +\fI512,1023\fR\&. Reserved udp port that will be used (bsd, bsdudp)\&. Range is inclusive\&. .RE .PP \fBreserved\-tcp\-port\fR int,int .RS 4 Default: \-\-with\-low\-tcpportrange or -\fI512,1023\fR\. Reserved tcp port that will be used (bsdtcp)\. Range is inclusive\. +\fI512,1023\fR\&. Reserved tcp port that will be used (bsdtcp)\&. Range is inclusive\&. .RE .PP \fBunreserved\-tcp\-port\fR int,int .RS 4 Default: \-\-with\-tcpportrange or -\fI1024,65535\fR\. Unreserved tcp port that will be used (bsd, bsdudp)\. Range is inclusive\. +\fI1024,65535\fR\&. Unreserved tcp port that will be used (bsd, bsdudp)\&. Range is inclusive\&. .RE .SH "HOLDINGDISK SECTION" .PP The -\fBamanda\.conf\fR -file may define one or more holding disks used as buffers to hold backup images before they are written to tape\. The syntax is: +\fBamanda\&.conf\fR +file may define one or more holding disks used as buffers to hold backup images before they are written to tape\&. The syntax is: .nf holdingdisk \fIname\fR { \fIholdingdisk\-option\fR \fIholdingdisk\-value\fR - \.\.\. + \FC\&.\&.\&.\F[] } .fi .PP \fIName\fR -is a logical name for this holding disk\. +is a logical name for this holding disk\&. .PP The options and values are: .PP \fBcomment\fR \fI string\fR .RS 4 Default: -\fInone\fR\. A comment string describing this holding disk\. +\fInone\fR\&. A comment string describing this holding disk\&. .RE .PP \fBdirectory\fR \fI disk\fR .RS 4 Default: -\fI/dumps/amanda\fR\. The path to this holding area\. +\FC/dumps/amanda\F[]\&. The path to this holding area\&. .RE .PP \fBuse\fR \fI int\fR .RS 4 Default: -\fI0 Gb\fR\. Amount of space that can be used in this holding disk area\. If the value is zero, all available space on the file system is used\. If the value is negative, +\fI0 Gb\fR\&. Amount of space that can be used in this holding disk area\&. If the value is zero, all available space on the file system is used\&. If the value is negative, \fIAmanda\fR -will use all available space minus that value\. +will use all available space minus that value\&. .RE .PP \fBchunksize\fR \fI int\fR .RS 4 Default: -\fI1 Gb\fR\. Holding disk chunk size\. Dumps larger than the specified size will be stored in multiple holding disk files\. The size of each chunk will not exceed the specified value\. However, even though dump images are split in the holding disk, they are concatenated as they are written to tape, so each dump image still corresponds to a single continuous tape section\. +\fI1 Gb\fR\&. Holding disk chunk size\&. Dumps larger than the specified size will be stored in multiple holding disk files\&. The size of each chunk will not exceed the specified value\&. However, even though dump images are split in the holding disk, they are concatenated as they are written to tape, so each dump image still corresponds to a single continuous tape section\&. +.sp +The default unit is Kbytes if it is not specified\&. .sp If 0 is specified, \fIAmanda\fR -will create holding disk chunks as large as ((INT_MAX/1024)\-64) Kbytes\. +will create holding disk chunks as large as ((INT_MAX/1024)\-64) Kbytes\&. .sp -Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk size is 64 Kbytes (but that would be really silly)\. +Each holding disk chunk includes a 32 Kbyte header, so the minimum chunk size is 64 Kbytes (but that would be really silly)\&. .sp -Operating systems that are limited to a maximum file size of 2 Gbytes actually cannot handle files that large\. They must be at least one byte less than 2 Gbytes\. Since +Operating systems that are limited to a maximum file size of 2 Gbytes actually cannot handle files that large\&. They must be at least one byte less than 2 Gbytes\&. Since \fIAmanda\fR -works with 32 Kbyte blocks, and to handle the final read at the end of the chunk, the chunk size should be at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size, e\.g\. 2047 Mbytes\. +works with 32 Kbyte blocks, and to handle the final read at the end of the chunk, the chunk size should be at least 64 Kbytes (2 * 32 Kbytes) smaller than the maximum file size, e\&.g\&. 2047 Mbytes\&. .RE .SH "DUMPTYPE SECTION" .PP The -\fIamanda\.conf\fR +\fBamanda.conf\fR(5) file may define multiple sets of backup options and refer to them by name from the -\fIdisklist\fR -file\. For instance, one set of options might be defined for file systems that can benefit from high compression, another set that does not compress well, another set for file systems that should always get a full backup and so on\. +\fBdisklist\fR(5) +file\&. For instance, one set of options might be defined for file systems that can benefit from high compression, another set that does not compress well, another set for file systems that should always get a full backup and so on\&. .PP A set of backup options are entered in a \fBdumptype\fR section, which looks like this: .nf -define dumptype \fIname\fR { +define dumptype "\fIname\fR" { \fIdumptype\-option\fR \fIdumptype\-value\fR - \.\.\. + \FC\&.\&.\&.\F[] } .fi .PP \fIName\fR -is the name of this set of backup options\. It is referenced from the -\fIdisklist\fR -file\. +is the name of this set of backup options\&. It is referenced from the +\fBdisklist\fR(5) +file\&. .PP Some of the options in a \fBdumptype\fR section are the same as those in the main part of -\fIamanda\.conf\fR\. The main option value is used to set the default for all +\fBamanda.conf\fR(5)\&. The main option value is used to set the default for all \fBdumptype\fR -sections\. For instance, setting +sections\&. For instance, setting \fBdumpcycle\fR to 50 in the main part of the config file causes all following \fBdumptype\fR -sections to start with that value, but the value may be changed on a section by section basis\. Changes to variables in the main part of the config file must be done before (earlier in the file) any -\fBdumptype\fRs are defined\. +sections to start with that value, but the value may be changed on a section by section basis\&. Changes to variables in the main part of the config file must be done before (earlier in the file) any +\fBdumptype\fRs are defined\&. .PP The dumptype options and values are: .PP \fBauth\fR \fI string\fR .RS 4 Default: -\fIbsd\fR\. Type of authorization to perform between tape server and backup client hosts\. -.sp -\fBbsd\fR, bsd authorization with udp initial connection and one tcp connection by data stream\. -.sp -\fBbsdtcp\fR, bsd authorization but use only one tcp connection\. -.sp -\fBbsdudp\fR, like bsd, but will use only one tcp connection for all data stream\. -.sp -\fBkrb4\fR -to use Kerberos\-IV authorization\. -.sp -\fBkrb5\fR -to use Kerberos\-V authorization\. -.sp -\fBlocal\fR, if the client is the server, it doesn\'t require authencation setup\. -.sp -\fBrsh\fR -to use rsh authorization\. -.sp -\fBssh\fR -to use OpenSSH authorization\. +\fIbsd\fR\&. Type of authorization to perform between tape server and backup client hosts\&. See +\fBamanda-auth\fR(7) +for more detail\&. .RE .PP \fBamandad_path\fR \fI string\fR .RS 4 Default: -\fI$libexec/amandad\fR\. Specify the amandad path of the client, only use with rsh/ssh authentification\. +\fI$libexec/amandad\fR\&. Specify the amandad path of the client, only use with rsh/ssh authentification\&. .RE .PP \fBclient_username\fR \fI string\fR .RS 4 Default: -\fICLIENT_LOGIN\fR\. Specify the username to connect on the client, only use with rsh/ssh authentification\. +\fICLIENT_LOGIN\fR\&. Specify the username to connect on the client, only use with rsh/ssh authentification\&. .RE .PP \fBbumpsize\fR int .RS 4 Default: -\fI10 Mbytes\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\. If +\fI10 Mbytes\fR\&. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as size\&. If \fIAmanda\fR -determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. The value of this parameter is used only if the parameter +determines that the next higher backup level will be this much smaller than the current level, it will do the next level\&. The value of this parameter is used only if the parameter \fIbumppercent\fR -is set to 0\. +is set to 0\&. +.sp +The default unit is Kbytes if it is not specified\&. .sp See also the options \fBbumppercent\fR, \fBbumpmult\fR and -\fBbumpdays\fR\. +\fBbumpdays\fR\&. .RE .PP \fBbumppercent\fR int .RS 4 Default: -\fI0 percent\fR\. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\. If +\fI0 percent\fR\&. The minimum savings required to trigger an automatic bump from one incremental level to the next, expressed as percentage of the current size of the DLE (size of current level 0)\&. If \fIAmanda\fR -determines that the next higher backup level will be this much smaller than the current level, it will do the next level\. +determines that the next higher backup level will be this much smaller than the current level, it will do the next level\&. .sp If this parameter is set to 0, the value of the parameter \fIbumpsize\fR -is used to trigger bumping\. +is used to trigger bumping\&. .sp See also the options \fBbumpsize\fR, \fBbumpmult\fR and -\fBbumpdays\fR\. +\fBbumpdays\fR\&. .RE .PP \fBbumpmult\fR \fI float\fR .RS 4 Default: -1\.5\. The bump size multiplier\. +\FC1\&.5\F[]\&. The bump size multiplier\&. \fIAmanda\fR multiplies \fBbumpsize\fR -by this factor for each level\. This prevents active filesystems from bumping too much by making it harder to bump to the next level\. For example, with the default +by this factor for each level\&. This prevents active filesystems from bumping too much by making it harder to bump to the next level\&. For example, with the default \fBbumpsize\fR and \fBbumpmult\fR -set to 2\.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\. +set to 2\&.0, the bump threshold will be 10 Mbytes for level one, 20 Mbytes for level two, 40 Mbytes for level three, and so on\&. .RE .PP \fBbumpdays\fR \fI int\fR .RS 4 Default: -\fI2 days\fR\. To insure redundancy in the dumps, +\fI2 days\fR\&. To insure redundancy in the dumps, \fIAmanda\fR keeps filesystems at the same incremental level for at least \fBbumpdays\fR -days, even if the other bump threshold criteria are met\. +days, even if the other bump threshold criteria are met\&. .RE .PP \fBcomment\fR \fI string\fR .RS 4 Default: -\fInone\fR\. A comment string describing this set of backup options\. +\fInone\fR\&. A comment string describing this set of backup options\&. .RE .PP \fBcomprate\fR \fIfloat\fR [, \fIfloat\fR ] .RS 4 Default: -0\.50, -0\.50\. The expected full and incremental compression factor for dumps\. It is only used if +\FC0\&.50\F[], +\FC0\&.50\F[]\&. The expected full and incremental compression factor for dumps\&. It is only used if \fIAmanda\fR -does not have any history information on compression rates for a filesystem, so should not usually need to be set\. However, it may be useful for the first time a very large filesystem that compresses very little is backed up\. +does not have any history information on compression rates for a filesystem, so should not usually need to be set\&. However, it may be useful for the first time a very large filesystem that compresses very little is backed up\&. .RE .PP \fBcompress [client|server]\fR \fI string\fR .RS 4 Default: -\fIclient fast\fR\. If +\fIclient fast\fR\&. If \fIAmanda\fR -does compression of the backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\. Which place to do compression (if at all) depends on how well the dump image usually compresses, the speed and load on the client or server, network capacity, holding disk capacity, availability of tape hardware compression, etc\. +does compression of the backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\&. Which place to do compression (if at all) depends on how well the dump image usually compresses, the speed and load on the client or server, network capacity, holding disk capacity, availability of tape hardware compression, etc\&. .sp For either type of compression, \fIAmanda\fR -also allows the selection of three styles of compression\. +also allows the selection of three styles of compression\&. \fBBest\fR -is the best compression available, often at the expense of CPU overhead\. +is the best compression available, often at the expense of CPU overhead\&. \fBFast\fR is often not as good a compression as -\fBbest\fR, but usually less CPU overhead\. Or to specify +\fBbest\fR, but usually less CPU overhead\&. Or to specify \fBCustom\fR -to use your own compression method\. (See dumptype custom\-compress in example/amanda\.conf for reference) +to use your own compression method\&. (See dumptype custom\-compress in example/amanda\&.conf for reference) .sp So the \fBcompress\fR @@ -1088,7 +1369,7 @@ Specify \fIclient_custom_compress\fR "PROG" .sp -PROG must not contain white space and it must accept \-d for uncompress\. +PROG must not contain white space and it must accept \-d for uncompress\&. .RE .PP compress server fast @@ -1105,26 +1386,26 @@ Specify \fIserver_custom_compress\fR "PROG" .sp -PROG must not contain white space and it must accept \-d for uncompress\. +PROG must not contain white space and it must accept \-d for uncompress\&. .RE .sp -Note that some tape devices do compression and this option has nothing to do with whether that is used\. If hardware compression is used (usually via a particular tape device name or +Note that some tape devices do compression and this option has nothing to do with whether that is used\&. If hardware compression is used (usually via a particular tape device name or \fBmt\fR option), \fIAmanda\fR -(software) compression should be disabled\. +(software) compression should be disabled\&. .RE .PP \fBdumpcycle\fR \fI int\fR .RS 4 Default: -\fI10 days\fR\. The number of days in the backup cycle\. Each disk using this set of options will get a full backup at least this of ten\. Setting this to zero tries to do a full backup each run\. +\fI10 days\fR\&. The number of days in the backup cycle\&. Each disk using this set of options will get a full backup at least this of ten\&. Setting this to zero tries to do a full backup each run\&. .RE .PP \fBencrypt [none|client|server]\fR .RS 4 Default: -\fInone\fR\. To encrypt backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\. +\fInone\fR\&. To encrypt backup images, it can do so either on the backup client host before it crosses the network or on the tape server host as it goes from the network into the holding disk or to tape\&. .sp So the \fBencrypt\fR @@ -1138,88 +1419,88 @@ encrypt client .RS 4 Specify client_encrypt "PROG" .sp -PROG must not contain white space\. +PROG must not contain white space\&. .sp Specify client_decrypt_option "decryption\-parameter" Default: "\-d" .sp -decryption\-parameter must not contain white space\. +decryption\-parameter must not contain white space\&. .sp -(See dumptype server\-encrypt\-fast in example/amanda\.conf for reference) +(See dumptype client\-encrypt\-nocomp in example/amanda\&.conf for reference) .RE .PP encrypt server .RS 4 Specify server_encrypt "PROG" .sp -PROG must not contain white space\. +PROG must not contain white space\&. .sp Specify server_decrypt_option "decryption\-parameter" Default: "\-d" .sp -decryption\-parameter must not contain white space\. +decryption\-parameter must not contain white space\&. .sp -(See dumptype client\-encrypt\-nocomp in example/amanda\.conf for reference) +(See dumptype server\-encrypt\-fast in example/amanda\&.conf for reference) .RE .sp -Note that current logic assumes compression then encryption during backup(thus decrypt then uncompress during restore)\. So specifying client\-encryption AND server\-compression is not supported\. +Note that current logic assumes compression then encryption during backup(thus decrypt then uncompress during restore)\&. So specifying client\-encryption AND server\-compression is not supported\&. \fIamcrypt\fR which is a wrapper of \fIaespipe\fR -is provided as a reference symmetric encryption program\. +is provided as a reference symmetric encryption program\&. .RE .PP \fBestimate\fR \fIclient|calcsize|server\fR .RS 4 Default: -\fIclient\fR\. Determine the way +\fIclient\fR\&. Determine the way \fIAmanda\fR -does it\'s estimate\. +does it\'s estimate\&. .PP client .RS 4 -Use the same program as the dumping program, this is the most accurate way to do estimates, but it can take a long time\. +Use the same program as the dumping program, this is the most accurate way to do estimates, but it can take a long time\&. .RE .PP calcsize .RS 4 -Use a faster program to do estimates, but the result is less accurate\. +Use a faster program to do estimates, but the result is less accurate\&. .RE .PP server .RS 4 -Use only statistics from the previous run to give an estimate, it takes only a few seconds but the result is not accurate if your disk usage changes from day to day\. +Use only statistics from the previous run to give an estimate, it takes only a few seconds but the result is not accurate if your disk usage changes from day to day\&. .RE .RE .PP \fBexclude\fR [ list|file ][[optional][ append ][ \fIstring\fR ]+] .RS 4 Default: -\fIfile\fR\. There are two exclude lists, +\fIfile\fR\&. There are two exclude lists, \fBexclude file\fR and -\fBexclude list\.\fR +\fBexclude list\&.\fR With \fBexclude file\fR , the \fIstring\fR is a \fBGNU\-tar\fR -exclude expression\. With +exclude expression\&. With \fBexclude list\fR , the \fIstring\fR is a file name on the client containing \fBGNU\-tar\fR -exclude expressions\. The path to the specified exclude list file, if present (see description of \'optional\' below), must be readable by the +exclude expressions\&. The path to the specified exclude list file, if present (see description of \'optional\' below), must be readable by the \fIAmanda\fR -user\. +user\&. .sp All exclude expressions are concatenated in one file and passed to \fBGNU\-tar\fR as an \fB\-\-exclude\-from\fR -argument\. +argument\&. .sp -Exclude expressions must always be specified as relative to the head directory of the DLE\. +Exclude expressions must always be specified as relative to the head directory of the DLE\&. .sp With the \fBappend\fR @@ -1227,260 +1508,304 @@ keyword, the \fIstring\fR is appended to the current list, without it, the \fIstring\fR -overwrites the list\. +overwrites the list\&. .sp If \fBoptional\fR is specified for -\fBexclude list\fR, then amcheck will not complain if the file doesn\'t exist or is not readable\. +\fBexclude list\fR, then amcheck will not complain if the file doesn\'t exist or is not readable\&. .sp For -\fBexclude list\fR, if the file name is relative, the disk name being backed up is prepended\. So if this is entered: +\fBexclude list\fR, if the file name is relative, the disk name being backed up is prepended\&. So if this is entered: .nf - exclude list "\.amanda\.excludes" + exclude list "\&.amanda\&.excludes" .fi the actual file used would be -\fI/var/\.amanda\.excludes\fR +\FC/var/\&.amanda\&.excludes\F[] for a backup of -\fI/var\fR, -\fI/usr/local/\.amanda\.excludes\fR +\FC/var\F[], +\FC/usr/local/\&.amanda\&.excludes\F[] for a backup of -\fI/usr/local\fR, and so on\. +\FC/usr/local\F[], and so on\&. .RE .PP \fBholdingdisk\fR [ never|auto|required ] .RS 4 Default: -\fIauto\fR\. Whether a holding disk should be used for these backups or whether they should go directly to tape\. If the holding disk is a portion of another file system that +\fIauto\fR\&. Whether a holding disk should be used for these backups or whether they should go directly to tape\&. If the holding disk is a portion of another file system that \fIAmanda\fR is backing up, that file system should refer to a dumptype with \fBholdingdisk\fR set to \fInever\fR -to avoid backing up the holding disk into itself\. +to avoid backing up the holding disk into itself\&. .PP \fBnever\fR|no|false|off .RS 4 -Never use a holdingdisk, the dump will always go directly to tape\. There will be no dump if you have a tape error\. +Never use a holdingdisk, the dump will always go directly to tape\&. There will be no dump if you have a tape error\&. .RE .PP \fBauto\fR|yes|true|on .RS 4 -Use the holding disk, unless there is a problem with the holding disk, the dump won\'t fit there or the medium doesn\'t require spooling (e\.g\., VFS device) +Use the holding disk, unless there is a problem with the holding disk, the dump won\'t fit there or the medium doesn\'t require spooling (e\&.g\&., VFS device) .RE .PP \fBrequired\fR .RS 4 -Always dump to holdingdisk, never directly to tape\. There will be no dump if it doesn\'t fit on holdingdisk +Always dump to holdingdisk, never directly to tape\&. There will be no dump if it doesn\'t fit on holdingdisk .RE .RE .PP \fBignore\fR \fI boolean\fR .RS 4 Default: -\fIno\fR\. Whether disks associated with this backup type should be backed up or not\. This option is useful when the +\fIno\fR\&. Whether disks associated with this backup type should be backed up or not\&. This option is useful when the \fIdisklist\fR -file is shared among several configurations, some of which should not back up all the listed file systems\. +file is shared among several configurations, some of which should not back up all the listed file systems\&. .RE .PP \fBinclude\fR [ list|file ][[optional][ append ][ \fIstring\fR ]+] .RS 4 Default: \fIfile\fR -"\."\. There are two include lists, +"\&."\&. There are two include lists, \fBinclude file\fR and -\fBinclude list\.\fR +\fBinclude list\&.\fR With \fBinclude file\fR , the \fIstring\fR -is a glob expression\. With +is a glob expression\&. With \fBinclude list\fR , the \fIstring\fR -is a file name on the client containing glob expressions\. +is a file name on the client containing glob expressions\&. .sp All include expressions are expanded by \fIAmanda\fR, concatenated in one file and passed to \fBGNU\-tar\fR as a \fB\-\-files\-from\fR -argument\. They must start with "\./" and contain no other "/"\. +argument\&. They must start with "\&./" and contain no other "/"\&. .sp -Include expressions must always be specified as relative to the head directory of the DLE\. +Include expressions must always be specified as relative to the head directory of the DLE\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br For globbing to work at all, even the limited single level, the top level directory of the DLE must be readable by the \fIAmanda\fR -user\. - +user\&. +.sp .5v +.EM yellow +.RE With the \fBappend\fR keyword, the \fIstring\fR is appended to the current list, without it, the \fIstring\fR -overwrites the list\. +overwrites the list\&. .sp If \fBoptional\fR is specified for \fBinclude list,\fR -then amcheck will not complain if the file doesn\'t exist or is not readable\. +then amcheck will not complain if the file doesn\'t exist or is not readable\&. .sp For -\fBinclude list\fR, If the file name is relative, the disk name being backed up is prepended\. +\fBinclude list\fR, If the file name is relative, the disk name being backed up is prepended\&. .RE .PP \fBindex\fR \fI boolean\fR .RS 4 Default: -\fIno\fR\. Whether an index (catalogue) of the backup should be generated and saved in -\fBindexdir\fR\. These catalogues are used by the +\fIno\fR\&. Whether an index (catalogue) of the backup should be generated and saved in +\fBindexdir\fR\&. These catalogues are used by the \fBamrecover\fR -utility\. +utility\&. .RE .PP \fBkencrypt\fR \fI boolean\fR .RS 4 Default: -\fIno\fR\. Whether the backup image should be encrypted by Kerberos as it is sent across the network from the backup client host to the tape server host\. +\fIno\fR\&. Whether the backup image should be encrypted by Kerberos as it is sent across the network from the backup client host to the tape server host\&. .RE .PP \fBmaxdumps\fR \fI int\fR .RS 4 Default: -1\. The maximum number of backups from a single host that +\FC1\F[]\&. The maximum number of backups from a single host that \fIAmanda\fR -will attempt to run in parallel\. See also the main section parameter -\fBinparallel\fR\. +will attempt to run in parallel\&. See also the main section parameter +\fBinparallel\fR\&. .RE .PP \fBmaxpromoteday\fR \fI int\fR .RS 4 Default: -10000\. The maximum number of day for a promotion, set it 0 if you don\'t want promotion, set it to 1 or 2 if your disks get overpromoted\. +\FC10000\F[]\&. The maximum number of day for a promotion, set it 0 if you don\'t want promotion, set it to 1 or 2 if your disks get overpromoted\&. .RE .PP \fBpriority\fR \fI string\fR .RS 4 Default: -\fImedium\fR\. When there is no tape to write to, +\fImedium\fR\&. When there is no tape to write to, \fIAmanda\fR -will do incremental backups in priority order to the holding disk\. The priority may be high (2), medium (1), low (0) or a number of your choice\. +will do incremental backups in priority order to the holding disk\&. The priority may be high (2), medium (1), low (0) or a number of your choice\&. .RE .PP -\fBprogram\fR \fI string\fR +\fBprogram\fR [DUMP|GNUTAR|APPLICATION] .RS 4 Default: -\fIDUMP\fR\. The type of backup to perform\. Valid values are +\fIDUMP\fR\&. The type of backup to perform\&. Valid values are: +.PP \fBDUMP\fR -for the native operating system backup program, and +.RS 4 +The native operating system backup program\&. +.RE +.PP \fBGNUTAR\fR -to use -\fBGNU\-tar\fR -or to do PC backups using Samba\. +.RS 4 +To use GNU\-tar or to do PC backups using Samba\&. +.RE +.PP +\fBAPPLICATION\fR +.RS 4 +To use an application\-tool, see the +\fIapplication\fR +option\&. +.RE +.RE +.PP +\fBapplication\fR \fI string\fR +.RS 4 +No default\&. Must be the name of an application\-tool if +\fIprogram\fR +is set to +\fIAPPLICATION\fR\&. See APPLICATION SECTION below\&. +.RE +.PP +\fBscript\fR \fI string\fR +.RS 4 +No default\&. Must be the name of a script\-tool\&. You can have many script\&. See SCRIPT SECTION below\&. +.RE +.PP +\fBproperty\fR [append] \fIstring\fR \fIstring\fR+ +.RS 4 +These options can set various properties, they can be used by third party software to store information in the configuration file\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. .RE .PP \fBrecord\fR \fI boolean\fR .RS 4 Default: -\fIyes\fR\. Whether to ask the backup program to update its database (e\.g\. -\fI/etc/dumpdates\fR +\fIyes\fR\&. Whether to ask the backup program to update its database (e\&.g\&. +\FC/etc/dumpdates\F[] for DUMP or -\fI/usr/local/var/amanda/gnutar\-lists\fR -for GNUTAR) of time stamps\. This is normally enabled for daily backups and turned off for periodic archival runs\. +\FC/usr/local/var/amanda/gnutar\-lists\F[] +for GNUTAR) of time stamps\&. This is normally enabled for daily backups and turned off for periodic archival runs\&. .RE .PP \fBskip\-full\fR \fI boolean\fR .RS 4 Default: -\fIno\fR\. If +\fIno\fR\&. If \fItrue\fR and \fBplanner\fR -has scheduled a full backup, these disks will be skipped, and full backups should be run off\-line on these days\. It was reported that +has scheduled a full backup, these disks will be skipped, and full backups should be run off\-line on these days\&. It was reported that \fIAmanda\fR -only schedules level 1 incrementals in this configuration; this is probably a bug\. +only schedules level 1 incrementals in this configuration; this is probably a bug\&. .RE .PP \fBskip\-incr\fR \fI boolean\fR .RS 4 Default: -\fIno\fR\. If +\fIno\fR\&. If \fItrue\fR and \fBplanner\fR -has scheduled an incremental backup, these disks will be skipped\. +has scheduled an incremental backup, these disks will be skipped\&. .RE .PP \fBstarttime\fR \fI int\fR .RS 4 Default: -\fInone\fR\. Backups will not start until after this time of day\. The value should be hh*100+mm, e\.g\. 6:30PM (18:30) would be entered as -1830\. +\fInone\fR\&. Backups will not start until after this time of day\&. The value should be hh*100+mm, e\&.g\&. 6:30PM (18:30) would be entered as +\FC1830\F[]\&. .RE .PP \fBstrategy\fR \fI string\fR .RS 4 Default: -\fIstandard\fR\. Strategy to use when planning what level of backup to run next\. Values are: +\fIstandard\fR\&. Strategy to use when planning what level of backup to run next\&. Values are: .PP \fBstandard\fR .RS 4 The standard \fIAmanda\fR -schedule\. +schedule\&. .RE .PP \fBnofull\fR .RS 4 -Never do full backups, only level 1 incrementals\. +Never do full backups, only level 1 incrementals\&. .RE .PP \fBnoinc\fR .RS 4 -Never do incremental backups, only full dumps\. +Never do incremental backups, only full dumps\&. .RE .PP \fBskip\fR .RS 4 Never do backups (useful when sharing the \fIdisklist\fR -file)\. +file)\&. .RE .PP \fBincronly\fR .RS 4 -Only do incremental dumps\. +Only do incremental dumps\&. \fBamadmin force\fR should be used to tell \fIAmanda\fR -that a full dump has been performed off\-line, so that it resets to level 1\. +that a full dump has been performed off\-line, so that it resets to level 1\&. .RE .RE .PP \fBtape_splitsize\fR \fI int\fR .RS 4 Default: -\fInone\fR\. Split dump file on tape into pieces of a specified size\. This allows dumps to be spread across multiple tapes, and can potentially make more efficient use of tape space\. Note that if this value is too large (more than half the size of the average dump being split), substantial tape space can be wasted\. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity\. A good rule of thumb, usually, is 1/10 of the size of your tape\. +\fInone\fR\&. Split dump file on tape into pieces of a specified size\&. This allows dumps to be spread across multiple tapes, and can potentially make more efficient use of tape space\&. Note that if this value is too large (more than half the size of the average dump being split), substantial tape space can be wasted\&. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity\&. A good rule of thumb, usually, is 1/10 of the size of your tape\&. +.sp +The default unit is Kbytes if it is not specified\&. .RE .PP \fBsplit_diskbuffer\fR \fI string\fR .RS 4 Default: -\fInone\fR\. When dumping a split dump in PORT\-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option\. +\fInone\fR\&. When dumping a split dump in PORT\-WRITE mode (usually meaning "no holding disk"), buffer the split chunks to a file in the directory specified by this option\&. .RE .PP \fBfallback_splitsize\fR \fI int\fR .RS 4 Default: -\fI10M\fR\. When dumping a split dump in PORT\-WRITE mode, if no split_diskbuffer is specified (or if we somehow fail to use our split_diskbuffer), we must buffer split chunks in memory\. This specifies the maximum size split chunks can be in this scenario, and thus the maximum amount of memory consumed for in\-memory splitting\. The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume\. +\fI10M\fR\&. When dumping a split dump in PORT\-WRITE mode, if no split_diskbuffer is specified (or if we somehow fail to use our split_diskbuffer), we must buffer split chunks in memory\&. This specifies the maximum size split chunks can be in this scenario, and thus the maximum amount of memory consumed for in\-memory splitting\&. The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume\&. +.sp +The default unit is Kbytes if it is not specified\&. .RE .PP The following @@ -1488,31 +1813,31 @@ The following entries are predefined by \fIAmanda\fR: .nf -define dumptype no\-compress { +define dumptype "no\-compress" { compress none } -define dumptype compress\-fast { +define dumptype "compress\-fast" { compress client fast } -define dumptype compress\-best { +define dumptype "compress\-best" { compress client best } -define dumptype srvcompress { +define dumptype "srvcompress" { compress server fast } -define dumptype bsd\-auth { +define dumptype "bsd\-auth" { auth bsd } -define dumptype krb4\-auth { +define dumptype "krb4\-auth" { auth krb4 } -define dumptype no\-record { +define dumptype "no\-record" { record no } -define dumptype no\-hold { +define dumptype "no\-hold" { holdingdisk no } -define dumptype no\-full { +define dumptype "no\-full" { skip\-full yes } .fi @@ -1521,22 +1846,22 @@ In addition to options in a \fBdumptype\fR section, one or more other \fBdumptype\fR -names may be entered, which make this +names may be supplied as identifiers, which make this \fBdumptype\fR inherit options from other previously defined -\fBdumptype\fRs\. For instance, two sections might be the same except for the +\fBdumptype\fRs\&. For instance, two sections might be the same except for the \fBrecord\fR option: .nf -define dumptype normal { +define dumptype "normal" { comment "Normal backup, no compression, do indexing" no\-compress index yes maxdumps 2 } -define dumptype testing { +define dumptype "testing" { comment "Test backup, no compression, do indexing, no recording" - normal + "normal" record no } .fi @@ -1547,123 +1872,115 @@ provides a named \fIglobal\fR in the sample -\fBamanda\.conf\fR +\fBamanda\&.conf\fR file that all -\fBdumptype\fRs should reference\. This provides an easy place to make changes that will affect every -\fBdumptype\fR\. +\fBdumptype\fRs should reference\&. This provides an easy place to make changes that will affect every +\fBdumptype\fR\&. .SH "TAPETYPE SECTION" .PP The -\fBamanda\.conf\fR -file may define multiple types of tape media and devices\. The information is entered in a +\fBamanda\&.conf\fR +file may define multiple types of tape media and devices\&. The information is entered in a \fBtapetype\fR section, which looks like this in the config file: .nf -define tapetype \fIname\fR { +define tapetype "\fIname\fR" { \fItapetype\-option\fR \fItapetype\-value\fR - \.\.\. + \FC\&.\&.\&.\F[] } .fi .PP \fIName\fR -is the name of this type of tape medium/device\. It is referenced from the +is the name of this type of tape medium/device\&. It is referenced from the \fBtapetype\fR -option in the main part of the config file\. +option in the main part of the config file\&. .PP The tapetype options and values are: .PP \fBcomment\fR \fI string\fR .RS 4 Default: -\fInone\fR\. A comment string describing this set of tape information\. +\fInone\fR\&. A comment string describing this set of tape information\&. .RE .PP \fBfilemark\fR \fI int\fR .RS 4 Default: -\fI1 kbytes\fR\. How large a file mark (tape mark) is, measured in kbytes\. If the size is only known in some linear measurement (e\.g\. inches), convert it to kbytes using the device density\. +\fI1 kbytes\fR\&. How large a file mark (tape mark) is, measured in kbytes\&. If the size is only known in some linear measurement (e\&.g\&. inches), convert it to kbytes using the device density\&. .RE .PP \fBlength\fR \fI int\fR .RS 4 Default: -\fI2000 kbytes\fR\. How much data will fit on a tape\. +\fI2000 kbytes\fR\&. How much data will fit on a tape\&. .sp Note that this value is only used by \fIAmanda\fR -to schedule which backups will be run\. Once the backups start, +to schedule which backups will be run\&. Once the backups start, \fIAmanda\fR will continue to write to a tape until it gets an error, regardless of what value is entered for \fBlength\fR (but see the section OUTPUT DRIVERS in the \fBamanda\fR(8) -manpage for exceptions)\. +manpage for exceptions)\&. +.sp +The default unit is bytes if it is not specified\&. .RE .PP \fBblocksize\fR \fI int\fR .RS 4 Default: -\fI32 kbytes\fR\. How much data will be written in each tape record expressed in KiloBytes\. The tape record size (= blocksize) can not be reduced below the default 32 KBytes\. The parameter blocksize can only be raised if -\fIAmanda\fR -was compiled with the configure option \-\-with\-maxtapeblocksize=N set with "N" greater than 32 during -\fBconfigure\fR\. +\fI32 kbytes\fR\&. How much data will be written in each tape record\&. This is equivalent to the +\fIBLOCK_SIZE\fR +device property\&. +.sp +The default unit is Kbytes if it is not specified\&. .RE .PP \fBreadblocksize\fR \fI int\fR .RS 4 -Default: (\fIfrom configure \-\-with\-maxtapeblocksize\fR)\. How much data will be read in each tape record expressed in KiloBytes\. Some hardware require a value not too large, and some require it to be equal to the blocksize\. It is useful if you configured amanda with a big \-\-with\-maxtapeblocksize and your hardware don\'t work with a value that big\. -.RE -.PP -\fBfile\-pad\fR \fI boolean\fR -.RS 4 Default: -\fItrue\fR\. If true, every record, including the last one in the file, will have the same length\. This matches the way -\fIAmanda\fR -wrote tapes prior to the availability of this parameter\. It may also be useful on devices that only support a fixed blocksize\. -.sp -Note that the last record on the tape probably includes trailing null byte padding, which will be passed back to -\fBgzip\fR, -\fBcompress\fR -or the restore program\. Most programs just ignore this (although possibly with a warning)\. +\fI32 kytes\fR +How much data will be read in each tape record\&. This can be used to override a device\'s block size for reads only\&. This may be useful, for example, in reading a tape written with a 256k block size when Amanda is configured to use 128k blocks\&. This unusual feature is not supported by all operating systems and tape devices\&. .sp -If this parameter is false, the last record in a file may be shorter than the block size\. The file will contain the same amount of data the dump program generated, without trailing null byte padding\. When read, the same amount of data that was written will be returned\. +The default unit is Kbytes if it is not specified\&. .RE .PP \fBspeed\fR \fI int\fR .RS 4 Default: -\fI200 bps\fR\. How fast the drive will accept data, in bytes per second\. This parameter is NOT currently used by -\fIAmanda\fR\. +\fI200 bps\fR\&. How fast the drive will accept data, in bytes per second\&. This parameter is NOT currently used by +\fIAmanda\fR\&. .RE .PP \fBlbl\-templ\fR \fI string\fR .RS 4 A PostScript template file used by \fBamreport\fR -to generate labels\. Several sample files are provided with the +to generate labels\&. Several sample files are provided with the \fIAmanda\fR sources in the \fIexample\fR -directory\. See the +directory\&. See the \fBamreport\fR(8) -man page for more information\. +man page for more information\&. .RE .PP In addition to options, another \fBtapetype\fR -name may be entered, which makes this +name may be supplie as an identifier, which makes this \fBtapetype\fR inherit options from another -\fBtapetype\fR\. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape\. So they could be entered as: +\fBtapetype\fR\&. For instance, the only difference between a DLT4000 tape drive using Compact\-III tapes and one using Compact\-IV tapes is the length of the tape\&. So they could be entered as: .nf -define tapetype DLT4000\-III { +define tapetype "DLT4000\-III" { comment "DLT4000 tape drives with Compact\-III tapes" length 12500 mbytes # 10 Gig tapes with some compression filemark 2000 kbytes speed 1536 kps } -define tapetype DLT4000\-IV { - DLT4000\-III +define tapetype "DLT4000\-IV" { + "DLT4000\-III" comment "DLT4000 tape drives with Compact\-IV tapes" length 25000 mbytes # 20 Gig tapes with some compression } @@ -1671,57 +1988,289 @@ define tapetype DLT4000\-IV { .SH "INTERFACE SECTION" .PP The -\fBamanda\.conf\fR -file may define multiple types of network interfaces\. The information is entered in an +\fBamanda\&.conf\fR +file may define multiple types of network interfaces\&. The information is entered in an \fBinterface\fR section, which looks like this: .nf -define interface \fIname\fR { +define interface "\fIname\fR" { \fIinterface\-option\fR \fIinterface\-value\fR - \.\.\. + \FC\&.\&.\&.\F[] } .fi .PP \fIname\fR -is the name of this type of network interface\. It is referenced from the +is the name of this type of network interface\&. It is referenced from the \fIdisklist\fR -file\. +file\&. .PP -Note that these sections define network interface characteristics, not the actual interface that will be used\. Nor do they impose limits on the bandwidth that will actually be taken up by -\fIAmanda\fR\. +Note that these sections define network interface characteristics, not the actual interface that will be used\&. Nor do they impose limits on the bandwidth that will actually be taken up by +\fIAmanda\fR\&. \fIAmanda\fR -computes the estimated bandwidth each file system backup will take based on the estimated size and time, then compares that plus any other running backups with the limit as another of the criteria when deciding whether to start the backup\. Once a backup starts, +computes the estimated bandwidth each file system backup will take based on the estimated size and time, then compares that plus any other running backups with the limit as another of the criteria when deciding whether to start the backup\&. Once a backup starts, \fIAmanda\fR -will use as much of the network as it can leaving throttling up to the operating system and network hardware\. +will use as much of the network as it can leaving throttling up to the operating system and network hardware\&. .PP The interface options and values are: .PP \fBcomment\fR \fI string\fR .RS 4 Default: -\fInone\fR\. A comment string describing this set of network information\. +\fInone\fR\&. A comment string describing this set of network information\&. .RE .PP \fBuse\fR \fI int\fR .RS 4 Default: -\fI8000 Kbps\fR\. The speed of the interface in Kbytes per second\. +\fI8000 Kbps\fR\&. The speed of the interface in Kbytes per second\&. .RE .PP In addition to options, another \fBinterface\fR -name may be entered, which makes this +name may be supplied as an identifier, which makes this \fBinterface\fR inherit options from another -\fBinterface\fR\. At the moment, this is of little use\. -.SH "AUTHOR" +\fBinterface\fR\&. At the moment, this is of little use\&. +.SH "APPLICATION SECTION" +.PP +The +\fBamanda\&.conf\fR +file may define multiple types of application\&. The information is entered in a +\fBapplication\-tool\fR +section, which looks like this: +.nf +define application\-tool "\fIname\fR" { + \fIapplication\-option\fR \fIapplication\-value\fR + \FC\&.\&.\&.\F[] +} +.fi +.PP +\fIname\fR +is the name of this type of application\&. It is referenced from the +\fIdumptype\fR +.PP +The application\-tool options and values are: +.PP +\fBcomment\fR \fIstring\fR +.RS 4 +Default: +\fInone\fR\&. A comment string describing this application\&. +.RE +.PP +\fBplugin\fR \fIstring\fR +.RS 4 +No default\&. Must be set to the name of the program\&. This program must be in the +\fI$libexecdir/amanda/application\fR +directory on the client\&. +.RE +.PP +\fBproperty\fR [append] [priority] \fIstring\fR \fIstring\fR+ +.RS 4 +No default\&. You can set property for the application, each application have a different set of property\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. +\fBpriority\fR +keyword disallow the setting of that property on the client\&. +.RE +.SH "SCRIPT SECTION" +.PP +The +\fBamanda\&.conf\fR +file may define multiple types of script\&. The information is entered in a +\fBscript\-tool\fR +section, which looks like this: +.nf +define script\-tool "\fIname\fR" { + \fIscript\-option\fR \fIscript\-value\fR + \FC\&.\&.\&.\F[] +} +.fi +.PP +\fIname\fR +is the name of this type of script\&. It is referenced from the +\fIdumptype\fR +.PP +The script\-tool options and values are: +.PP +\fBcomment\fR \fIstring\fR +.RS 4 +Default: +\fInone\fR\&. A comment string describing this script\&. +.RE +.PP +\fBplugin\fR \fIstring\fR +.RS 4 +No default\&. Must be set to the name of the program\&. This program must be in the +\fI$libexecdir/amanda/application\fR +directory on the client and/or server\&. +.RE +.PP +\fBexecute_where\fR [client|server] +.RS 4 +Default: +\fIclient\fR\&. Where the script must be executed, on the client or server\&. +.RE +.PP +\fBexecute_on\fR \fIexecute_on\fR[,\fIexecute_on\fR]* +.RS 4 +No default\&. When the script must be executed, you can specify many of them: +.PP +\fBpre\-dle\-amcheck\fR +.RS 4 +Execute before the amcheck command for the dle\&. +.RE +.PP +\fBpre\-host\-amcheck\fR +.RS 4 +Execute before the amcheck command for all dle for the client\&. +.RE +.PP +\fBpost\-dle\-amcheck\fR +.RS 4 +Execute after the amcheck command for the dle\&. +.RE +.PP +\fBpost\-host\-amcheck\fR +.RS 4 +Execute after the amcheck command for all dle for the client\&. +.RE +.PP +\fBpre\-dle\-estimate\fR +.RS 4 +Execute before the estimate command for the dle\&. +.RE +.PP +\fBpre\-host\-estimate\fR +.RS 4 +Execute before the estimate command for all dle for the client\&. +.RE .PP -James da Silva, -: Original text +\fBpost\-dle\-estimate\fR +.RS 4 +Execute after the estimate command for the dle\&. +.RE +.PP +\fBpost\-host\-estimate\fR +.RS 4 +Execute after the estimate command for all dle for the client\&. +.RE +.PP +\fBpre\-dle\-backup\fR +.RS 4 +Execute before the backup command for the dle\&. +.RE +.PP +\fBpre\-host\-backup\fR +.RS 4 +Execute before the backup command for all dle for the client\&. +.RE +.PP +\fBpost\-dle\-backup\fR +.RS 4 +Execute after the backup command for the dle\&. +.RE +.PP +\fBpost\-host\-backup\fR +.RS 4 +Execute after the backup command for all dle for the client\&. +.RE +.PP +\fBpre\-recover\fR +.RS 4 +Execute before any level is recovered\&. +.RE +.PP +\fBpost\-recover\fR +.RS 4 +Execute after all levels are recovered\&. +.RE .PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion, major update, splitting +\fBpre\-level\-recover\fR +.RS 4 +Execute before each level recovery\&. +.RE +.PP +\fBpost\-level\-recover\fR +.RS 4 +Execute after each level recovery\&. +.RE +.PP +\fBinter\-level\-recover\fR +.RS 4 +Execute between two levels of recovery\&. +.RE +.sp +If you recover level 0 and 2 of the disk /usr with amrecover, it will execute: +.nf +script \-\-pre\-recover +script \-\-pre\-level\-recover \-\-level 0 +#recovering level 0 +script \-\-post\-level\-recover \-\-level 0 +script \-\-inter\-level\-recover \-\-level 0 \-\-level 2 +script \-\-pre\-level\-recover \-\-level 2 +#recovering level 2 +script \-\-post\-level\-recover \-\-level 2 +script \-\-post\-recover +.fi +.RE +.PP +\fBproperty\fR [append] [priority] \fIstring\fR \fIstring\fR+ +.RS 4 +No default\&. You can set property for the script, each script have a different set of property\&. Both strings are quoted; the first string contains the name of the property to set, and the others contains its values\&. +\fBappend\fR +keyword append the values to the list of values for that property\&. +\fBpriority\fR +keyword disallow the setting of that property on the client\&. +.RE +.SH "DEVICE SECTION" +.PP +Backend storage devices are specified in +\fBamanda\&.conf\fR +in the form of "device" sections, which look like this: +.nf +define device \fIname\fR { + commend "\fIcomment (optional)\fR" + tapedev "\fIdevice\-specifier\fR" + device_property "\fIprop\-name\fR" "\fIprop\-value\fR" + \FC\&.\&.\&.\F[] +} +.fi +.PP +\fIname\fR +is the user\-specified name of this device\&. It is referenced from the global +\fItapedev\fR +parameter\&. The +\fIdevice\-specifier\fR +specifies the device name to use; see +\fBamanda-devices\fR(7)\&. As with most sections, the +\fIcomment\fR +parmeter is optional and only for the user\'s convenience\&. +.PP +An arbitrary number of +\fIdevice_property\fR +parameters can be specified\&. Again, see +\fBamanda-devices\fR(7) +for information on device properties\&. +.SH "CHANGER SECTION" +.PP +Changers are described in +\fBamanda\&.conf\fR +in the form of "changer" sections, which look like this: +.nf +define changer \fIname\fR { + comment "\fIcomment (optional)\fR" + tapedev "\fItape\-device\fR" + tpchanger "\fIchanger\-type\fR" + changerdev "\fIdevice\-name\fR" + changerfile "\fIstate\-file\fR" + \FC\&.\&.\&.\F[] +} +.fi +.PP +\fIname\fR +is the user\-specified name of this device\&. The remaining parameters are specific to the changer type selected\&. +.PP +TODO: more detail here once it\'s known .SH "SEE ALSO" .PP @@ -1730,3 +2279,8 @@ Stefan G\. Weichinger, \fBamcrypt\fR(8), \fBaespipe\fR(1), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amarchiver.8 b/man/amarchiver.8 new file mode 100644 index 0000000..36cf6da --- /dev/null +++ b/man/amarchiver.8 @@ -0,0 +1,229 @@ +.\" Title: amarchiver +.\" Author: Dustin J. Mitchell +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMARCHIVER" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amarchiver \- Create, extract or list amanda archive +.SH "Synopsis" +.fam C +.HP \w'\fBamarchiver\fR\ 'u +\fBamarchiver\fR \-\-version|\-\-create|\-\-extract|\-\-list [\-\-verbose] [\-\-file\ \fIfile\fR] [\fIfilename\fR]... +.fam +.SH "DESCRIPTION" +.PP +\fBAmarchiver\fR +manipulates amanda archive file\&. On creation, amarchiver doesn\'t recurse into directories\&. If a filename specifies a directory, it will be ignored\&. If it specifies a character device, amarchiver reads the device and archives the data\&. If a filename specifies a named pipe, amarchiver reads the named pipe and archives the data\&. +.PP +Note that this tool is more limited than the Amanda archive library, and may not be appropriate for some archive files \-\- particularly those which use non\-strings in their filenames\&. +.SH "OPTIONS" +.PP +\fB\-\-version\fR +.RS 4 +print the amarchiver version +.RE +.PP +\fB\-\-create\fR +.RS 4 +Create an amanda archive\&. Only the supplied filenames are included\&. With one +\fB\-\-verbose\fR, lists the filenames\&. With two, lists the filenames and sizes\&. +.RE +.PP +\fB\-\-list\fR +.RS 4 +List the filenames in an amanda archive\&. No additional filenames are allowed on the command line\&. +.RE +.PP +\fB\-\-extract\fR +.RS 4 +Extract an amanda archive\&. If filenames are supplied, only those files are extracted\&. Files are created in the current directory, suffixed with a dot (\'\&.\') and the attribute ID\&. +.RE +.PP +\fB\-\-verbose\fR +.RS 4 +Give more information\&. +.RE +.PP +\fB\-\-file\fR file +.RS 4 +Create, list or extract from the given file instead of stdin/stdout\&. +.RE +.SH "SEE ALSO" +.PP +\fBamanda\fR(8) +.PP +\fBamanda-archive-format\fR(5) +.SH "Authors" +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amcheck.8 b/man/amcheck.8 index e4d7f6f..be35fcf 100644 --- a/man/amcheck.8 +++ b/man/amcheck.8 @@ -1,20 +1,178 @@ .\" Title: amcheck -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCHECK" "8" "08/22/2008" "" "" +.TH "AMCHECK" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcheck - run Amanda self-checks -.SH "SYNOPSIS" -.HP 8 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcheck \- run \fIAmanda\fR self\-checks +.SH "Synopsis" +.fam C +.HP \w'\fBamcheck\fR\ 'u \fBamcheck\fR [\-am] [\-w] [\-sclt] [\-M\ \fIaddress\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmcheck\fR @@ -22,71 +180,71 @@ runs a number of self\-checks on both the \fIAmanda\fR tape server host and the \fIAmanda\fR -client hosts\. +client hosts\&. .PP On the tape server host, \fBamcheck\fR can go through the same tape checking used at the start of the nightly \fBamdump\fR -run to verify the correct tape for the next run is mounted\. +run to verify the correct tape for the next run is mounted\&. .PP \fBAmcheck\fR -can also do a self\-check on all client hosts to make sure each host is running and that permissions on filesystems to be backed up are correct\. +can also do a self\-check on all client hosts to make sure each host is running and that permissions on filesystems to be backed up are correct\&. .PP -You can specify many host/disk expressions, only disks that match an expression will be checked\. All disks are checked if no expressions are given\. +You can specify many host/disk expressions, only disks that match an expression will be checked\&. All disks are checked if no expressions are given\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-s\fR .RS 4 Run the tape server local and tape checks (same as -\fB\-lt\fR)\. +\fB\-lt\fR)\&. .RE .PP \fB\-c\fR .RS 4 -Run the client host checks\. Multiple specific clients can be checked by specifying the client name\. +Run the client host checks\&. Multiple specific clients can be checked by specifying the client name\&. .RE .PP \fB\-l\fR .RS 4 -Run the local tests (e\.g\. permissions) on the server host\. +Run the local tests (e\&.g\&. permissions) on the server host\&. .RE .PP \fB\-t\fR .RS 4 -Run the tape tests on the server host\. +Run the tape tests on the server host\&. .RE .PP \fB\-w\fR .RS 4 Enables a DESTRUCTIVE check for write\-protection on the tape (which would otherwise cause the subsequent \fBamdump\fR -to fail)\. If the tape is writable, this check causes all data after the tape label to be erased\. If the label_new_tapes option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer\. The check enable the tape tests on the server host and is only made if the tape is otherwise correct\. +to fail)\&. If the tape is writable, this check causes all data after the tape label to be erased\&. If the label_new_tapes option is enabled, this check may ERASE any non\-Amanda tape in the drive or changer\&. The check enable the tape tests on the server host and is only made if the tape is otherwise correct\&. .RE .PP \fB\-m\fR .RS 4 -Nothing is printed, but mail is sent if any errors are detected\. The mail goes to the +Nothing is printed, but mail is sent if any errors are detected\&. The mail goes to the \fBmailto\fR address specified in the -\fIamanda\.conf\fR +\fIamanda\&.conf\fR file or the \fIaddress\fR value if \fB\-M\fR -is set\. +is set\&. .RE .PP \fB\-a\fR .RS 4 Like \fB\-m\fR -but the mail is always sent\. +but the mail is always sent\&. .RE .PP \fB\-M\fR \fIaddress\fR @@ -96,51 +254,51 @@ Mail the report to instead of the \fBmailto\fR value from -\fIamanda\.conf\fR\. Implies -\fB\-m\fR\. +\fIamanda\&.conf\fR\&. Implies +\fB\-m\fR\&. .RE .PP \fIhost\fR [\fIdisk\fR]* .RS 4 -Specify the host and disk on which the command will work\. +Specify the host and disk on which the command will work\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .PP The default is -\fB\-cs\fR\. +\fB\-cs\fR\&. .SH "EXAMPLES" .PP -In this example, both the tape server and client tests are run\. The results are displayed on standard output\. +In this example, both the tape server and client tests are run\&. The results are displayed on standard output\&. .nf % amcheck daily \fIAmanda\fR Tape Server Host Check \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -/amanda2/amanda/work: 911475 KB disk space available, that\'s plenty\. -NOTE: skipping tape\-writable test\. -Tape VOL10 label ok\. -Server check took 34\.966 seconds\. +/amanda2/amanda/work: 911475 KB disk space available, that\'s plenty\&. +NOTE: skipping tape\-writable test\&. +Tape VOL10 label ok\&. +Server check took 34\&.966 seconds\&. \fIAmanda\fR Backup Client Hosts Check \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -WARNING: northstar: selfcheck request timed out\. Host down? -WARNING: drinkme: selfcheck request timed out\. Host down? -WARNING: scruffy: selfcheck request timed out\. Host down? -Client check: 136 hosts checked in 51\.945 seconds, 3 problems found\. +WARNING: northstar: selfcheck request timed out\&. Host down? +WARNING: drinkme: selfcheck request timed out\&. Host down? +WARNING: scruffy: selfcheck request timed out\&. Host down? +Client check: 136 hosts checked in 51\&.945 seconds, 3 problems found\&. -(brought to you by \fIAmanda\fR 2\.5\.0) +(brought to you by \fIAmanda\fR 2\&.5\&.0) .fi .PP In this example, if the line \fBmailto csd\-amanda\fR is in -\fIamanda\.conf\fR, mail will be sent to +\fIamanda\&.conf\fR, mail will be sent to \fBcsd\-amanda\fR -if the server check returns an error\. +if the server check returns an error\&. .nf % amcheck \-s \-m daily .fi @@ -149,13 +307,13 @@ if the server check returns an error\. fatal slot \fIslot\fR: \fIerror message\fR .RS 4 (error) The tape changer detected some kind of fatal error while trying to load slot -\fIslot\fR\. +\fIslot\fR\&. .RE .PP slot \fIslot\fR: \fIerror message\fR .RS 4 -(warning) The tape changer detected some kind of non\-fatal error (e\.g\. an empty slot was detected) while trying to load slot -\fIslot\fR, or an error was detected trying to read the tape label\. +(warning) The tape changer detected some kind of non\-fatal error (e\&.g\&. an empty slot was detected) while trying to load slot +\fIslot\fR, or an error was detected trying to read the tape label\&. .RE .PP slot \fIslot\fR: date \fIYYYYMMDD\fR label \fIlabel\fR (\fIresult\fR) @@ -165,14 +323,14 @@ slot \fIslot\fR: date \fIYYYYMMDD\fR label \fIlabel\fR (\fIresult\fR) in slot \fIslot\fR was loaded and found to have been last written on -\fIYYYYMMDD\fR\. If the tape is new, the date field will be an -\fIX\fR\. The +\fIYYYYMMDD\fR\&. If the tape is new, the date field will be an +\fIX\fR\&. The \fIresult\fR may be one of: .PP exact label match .RS 4 -This is the expected tape\. +This is the expected tape\&. .RE .PP no match @@ -180,12 +338,12 @@ no match This label does not match the \fBlabelstr\fR pattern in -\fIamanda\.conf\fR\. Tape scanning will continue\. +\fIamanda\&.conf\fR\&. Tape scanning will continue\&. .RE .PP active tape .RS 4 -This tape is still active and cannot be overwritten\. Tape scanning will continue\. +This tape is still active and cannot be overwritten\&. Tape scanning will continue\&. .RE .PP first labelstr match @@ -193,7 +351,7 @@ first labelstr match This tape is the first one that matches the \fBlabelstr\fR pattern in -\fIamanda\.conf\fR\. Tape scanning will continue if necessary\. +\fIamanda\&.conf\fR\&. Tape scanning will continue if necessary\&. .RE .PP labelstr match @@ -201,7 +359,7 @@ labelstr match This tape is the next one that matches the \fBlabelstr\fR pattern in -\fIamanda\.conf\fR\. Tape scanning will continue\. +\fIamanda\&.conf\fR\&. Tape scanning will continue\&. .RE .sp .RE @@ -211,8 +369,8 @@ ERROR: cannot look up dump user \fIuser\fR (error) Dump user \fIuser\fR from -\fIamanda\.conf\fR -could not be found in the system password information\. +\fIamanda\&.conf\fR +could not be found in the system password information\&. .RE .PP ERROR: cannot look up my own uid (\fIuid\fR) @@ -221,7 +379,7 @@ ERROR: cannot look up my own uid (\fIuid\fR) \fIuid\fR running \fBamcheck\fR -could not be found in the system password information\. +could not be found in the system password information\&. .RE .PP ERROR: running as user \fIrunuser\fR instead of \fIdumpuser\fR @@ -231,9 +389,9 @@ ERROR: running as user \fIrunuser\fR instead of \fIdumpuser\fR should be run as the dump user \fIdumpuser\fR from -\fIamanda\.conf\fR +\fIamanda\&.conf\fR instead of -\fIrunuser\fR\. +\fIrunuser\fR\&. .RE .PP ERROR: program dir \fIdirectory\fR: not accessible @@ -241,42 +399,42 @@ ERROR: program dir \fIdirectory\fR: not accessible (error) The directory \fIAmanda\fR expects to find its auxiliary programs in, -\fIdirectory\fR, is not accessible\. +\fIdirectory\fR, is not accessible\&. .RE .PP ERROR: program \fIprogram\fR: does not exist .RS 4 (error) Program \fIprogram\fR -needed on the tape server could not be found\. +needed on the tape server could not be found\&. .RE .PP ERROR: program \fIprogram\fR: not a file .RS 4 (error) Program \fIprogram\fR -needed on the tape server exists but is not a file\. +needed on the tape server exists but is not a file\&. .RE .PP ERROR: program \fIprogram\fR: not executable .RS 4 (error) Program \fIprogram\fR -needed on the tape server exists but is not executable\. +needed on the tape server exists but is not executable\&. .RE .PP WARNING: program \fIprogram\fR: not setuid\-root .RS 4 (warning) Program \fIprogram\fR -needed on the tape server exists but should be owned by user "root" and setuid\. +needed on the tape server exists but should be owned by user "root" and setuid\&. .RE .PP ERROR: \fIXXX\fR dir \fIdirectory\fR: not writable .RS 4 (error) Directory \fIdirectory\fR -is either not writable, i\.e\. the dump user will not be able to create or remove files, or cannot be accessed, perhaps because a parent directory does not allow search permission\. The +is either not writable, i\&.e\&. the dump user will not be able to create or remove files, or cannot be accessed, perhaps because a parent directory does not allow search permission\&. The \fIXXX\fR may be: .PP @@ -287,7 +445,7 @@ for the log directory (see \fBlogdir\fR in -\fBamanda\.conf\fR) +\fBamanda\&.conf\fR) .RE .PP oldlog @@ -295,7 +453,7 @@ oldlog for the directory that holds the old log files (see \fBlogdir\fR in -\fBamanda\.conf\fR) +\fBamanda\&.conf\fR) .RE .PP info @@ -305,7 +463,7 @@ for an database information directory (see \fBcurinfo\fR in -\fBamanda\.conf\fR) or +\fBamanda\&.conf\fR) or .RE .PP index @@ -315,29 +473,25 @@ for an index directory (see \fBindexdir\fR in -\fBamanda\.conf\fR) +\fBamanda\&.conf\fR) .RE .PP tapelist .RS 4 for the -\fIAmanda\fR -tapelist directory (see -\fBtapelist\fR -in -\fBamanda\.conf\fR) +\fBtapelist\fR(5) .RE .sp .RE .PP NOTE: \fIXXX\fR dir \fIdirectory\fR: does not exist .RS 4 -(info) A database (info) or index directory does not exist or cannot be accessed\. This might just mean this is a new client or disk, but if that is not the case, this should be treated as an error\. +(info) A database (info) or index directory does not exist or cannot be accessed\&. This might just mean this is a new client or disk, but if that is not the case, this should be treated as an error\&. .RE .PP NOTE: it will be created on the next run .RS 4 -(info) This indicates the info directory listed in the previous message will be created on the next run\. +(info) This indicates the info directory listed in the previous message will be created on the next run\&. .RE .PP ERROR: \fIXXX\fR dir \fIname\fR: not a directory @@ -346,33 +500,33 @@ ERROR: \fIXXX\fR dir \fIname\fR: not a directory \fBAmcheck\fR expected \fIname\fR -to be a directory, but it is something else (e\.g\. file)\. +to be a directory, but it is something else (e\&.g\&. file)\&. .RE .PP -WARNING: info file \fIfile\fR: does not exist +WARNING: info file \FCfile\F[]: does not exist .RS 4 (warning) File \fIfile\fR -does not exist in the text format database\. Since the parent directories do exist, the file should already have been created\. +does not exist in the text format database\&. Since the parent directories do exist, the file should already have been created\&. .RE .PP -ERROR: info file \fIname\fR: not a file +ERROR: info file \FCname\F[]: not a file .RS 4 (error) \fBAmcheck\fR expected \fIname\fR -to be a file, but it is something else (e\.g\. file)\. +to be a file, but it is something else (e\&.g\&. file)\&. .RE .PP -ERROR: info file \fIfile\fR: not readable +ERROR: info file \FCfile\F[]: not readable .RS 4 (error) The text format database file \fIfile\fR -is not readable\. +is not readable\&. .RE .PP -ERROR: log file \fIfile\fR: not writable +ERROR: log file \FCfile\F[]: not writable .RS 4 (error) Log file \fIfile\fR @@ -381,31 +535,21 @@ ERROR: log file \fIfile\fR: not writable in \fBlogdir\fR from -\fBamanda\.conf\fR) is either not writable, or cannot be accessed, perhaps because a parent directory does not allow search permission\. +\fBamanda\&.conf\fR) is either not writable, or cannot be accessed, perhaps because a parent directory does not allow search permission\&. .RE .PP ERROR: tape list \fItapelist\fR: not writable .RS 4 (error) -\fIAmanda\fR -tape list file -\fItapelist\fR -(see -\fBtapelist\fR -in -\fBamanda\.conf\fR) is not writable or was not found\. +\fBtapelist\fR(5) +is not writable or was not found\&. .RE .PP ERROR: tape list \fItapelist\fR: parse error .RS 4 (error) -\fIAmanda\fR -tape list file -\fItapelist\fR -(see -\fBtapelist\fR -in -\fBamanda\.conf\fR) could not be read or parsed\. +\fBtapelist\fR(5) +could not be read or parsed\&. .RE .PP WARNING: tapedev is /dev/null, dumps will be thrown away @@ -413,21 +557,21 @@ WARNING: tapedev is /dev/null, dumps will be thrown away (warning) The \fBtapedev\fR parameter in -\fBamanda\.conf\fR +\fBamanda\&.conf\fR is set to -\fI/dev/null\fR +\FC/dev/null\F[] and \fIAmanda\fR -uses that when debugging to throw all the dump images away\. +uses that when debugging to throw all the dump images away\&. .RE .PP -WARNING: hold file \fIfile\fR exists +WARNING: hold file \FCfile\F[] exists .RS 4 (info) Hold file \fIfile\fR exists and will cause \fBamdump\fR -to pause at the beginning until it is removed\. +to pause at the beginning until it is removed\&. .RE .PP ERROR: holding disk \fIdisk\fR: statfs: \fIerror message\fR @@ -436,16 +580,16 @@ ERROR: holding disk \fIdisk\fR: statfs: \fIerror message\fR \fIstatfs\fR system call on holding disk \fIdisk\fR -(maybe because it does not exist)\. +(maybe because it does not exist)\&. .RE .PP ERROR: holding disk \fIdisk\fR: not writable .RS 4 (error) Holding disk -\fIdisk\fR, is not writable, probably because the caller does not have write permission or a parent directory does not allow search permission\. +\fIdisk\fR, is not writable, probably because the caller does not have write permission or a parent directory does not allow search permission\&. .RE .PP -WARNING: holding disk \fIdisk\fR: available space unknown \fIN\fR KB requested\. +WARNING: holding disk \fIdisk\fR: available space unknown \fIN\fR KB requested\&. .RS 4 (warning) \fBAmcheck\fR @@ -453,37 +597,47 @@ could not determine the amount of available space on holding disk \fIdisk\fR to see if there were at least \fIN\fR -KBytes available\. +KBytes available\&. .RE .PP -WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free (\fIR\fR KB requested)\. +WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free (\fIR\fR KB requested)\&. .RS 4 (warning) -\fIamanda\.conf\fR +\fIamanda\&.conf\fR requested \fIR\fR KBytes of free space on holding disk \fIdisk\fR, but only \fIF\fR -KBytes were available\. 10 MBytes is subtracted for each backup process (see the +KBytes were available\&. 10 MBytes is subtracted for each backup process (see the \fBinparallel\fR -\fIamanda\.conf\fR -option) to allow for unexpected overruns\. +\fIamanda\&.conf\fR +option) to allow for unexpected overruns\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br Even though this message is listed as a warning, it causes \fBamcheck\fR -to exit with a non\-zero status\. +to exit with a non\-zero status\&. +.sp .5v +.EM yellow +.RE .RE .PP -Holding disk \fIdisk\fR: \fIN\fR KB disk space available, that\'s plenty\. +Holding disk \fIdisk\fR: \fIN\fR KB disk space available, that\'s plenty\&. .RS 4 (info) There was sufficient free space on holding disk -\fIdisk\fR\. +\fIdisk\fR\&. .RE .PP WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free, using nothing @@ -493,7 +647,7 @@ WARNING: holding disk \fIdisk\fR: only \fIF\fR KB free, using nothing has \fIF\fR KBytes of free space, but that is not enough for what is requested in -\fIamanda\.conf\fR\. +\fIamanda\&.conf\fR\&. .RE .PP Holding disk \fIdisk\fR: \fIF\fR KB disk space available, using \fIU\fR KB @@ -506,78 +660,78 @@ KBytes of free space and \fIAmanda\fR will be using up to \fIU\fR -Kbytes\. +Kbytes\&. .RE .PP -WARNING: if a tape changer is not available, runtapes must be set to 1\. +WARNING: if a tape changer is not available, runtapes must be set to 1\&. .RS 4 (warning) The \fBruntapes\fR -\fIamanda\.conf\fR +\fIamanda\&.conf\fR option must be set to 1 if the \fBtpchanger\fR -\fIamanda\.conf\fR -option is not set\. +\fIamanda\&.conf\fR +option is not set\&. .RE .PP -ERROR: \fIerror message\fR\. +ERROR: \fIerror message\fR\&. .RS 4 -(error) An error was detected while initializing the tape changer\. +(error) An error was detected while initializing the tape changer\&. .RE .PP -ERROR: \fItape device\fR: \fIerror message\fR\. +ERROR: \fItape device\fR: \fIerror message\fR\&. .RS 4 -(error) An error was detected while processing the tape label\. +(error) An error was detected while processing the tape label\&. .RE .PP -ERROR: cannot overwrite active tape \fIlabel\fR\. +ERROR: cannot overwrite active tape \fIlabel\fR\&. .RS 4 (error) Tape \fIlabel\fR -is still active and cannot be used\. +is still active and cannot be used\&. .RE .PP -ERROR: label \fIlabel\fR doesn\'t match labelstr \fIpattern\fR \. +ERROR: label \fIlabel\fR doesn\'t match labelstr \fIpattern\fR \&. .RS 4 (error) The label on tape \fIlabel\fR does not match the \fBlabelstr\fR -\fIamanda\.conf\fR -option\. +\fIamanda\&.conf\fR +option\&. .RE .PP (expecting a new tape) .RS 4 -(info) The tape is not OK and a new tape was expected\. +(info) The tape is not OK and a new tape was expected\&. .RE .PP (expecting tape \fIlabel\fR or a new tape) .RS 4 (info) The tape is not OK and either tape \fIlabel\fR -or a new tape was expected\. +or a new tape was expected\&. .RE .PP -ERROR: tape \fIlabel\fR label ok, but is not writable\. +ERROR: tape \fIlabel\fR label ok, but is not writable\&. .RS 4 (error) Tape \fIlabel\fR -is OK, but the write enable test failed\. +is OK, but the write enable test failed\&. .RE .PP -Tape \fIlabel\fR is writable\. +Tape \fIlabel\fR is writable\&. .RS 4 (info) Tape \fIlabel\fR -is OK and the write enable test succeeded\. +is OK and the write enable test succeeded\&. .RE .PP -NOTE: skipping tape\-writable test\. +NOTE: skipping tape\-writable test\&. .RS 4 (info) The tape write test (see the \fB\-w\fR -option) was not enabled\. +option) was not enabled\&. .RE .PP WARNING: skipping tape test because amdump or amflush seem to be running, WARNING: if they are not, you must run amcleanup @@ -588,54 +742,54 @@ like either \fBamdump\fR or \fBamflush\fR -were running because a log file or amdump file exists\. If they are not running, you probably need to run +were running because a log file or amdump file exists\&. If they are not running, you probably need to run \fBamcleanup\fR -to clear up a previous failure\. Otherwise, you need to wait until they complete before running -\fBamcheck\fR\. +to clear up a previous failure\&. Otherwise, you need to wait until they complete before running +\fBamcheck\fR\FC\&.\F[] .RE .PP NOTE: skipping tape checks .RS 4 (info) The tape tests are being skipped because you used the \fB\-t\fR -command line option\. +command line option\&. .RE .PP WARNING: \fIcompress\fR is not executable, server\-compression and indexing will not work .RS 4 (warning) Compression program \fIcompress\fR -is not executable, so compression on the tape server host and creating index files will not work\. +is not executable, so compression on the tape server host and creating index files will not work\&. .RE .PP -Tape \fIlabel\fR label ok\. +Tape \fIlabel\fR label ok\&. .RS 4 (info) Tape \fIlabel\fR -is OK for the next run\. +is OK for the next run\&. .RE .PP -Server check took \fIS\fR seconds\. +Server check took \fIS\fR seconds\&. .RS 4 -(info) Reports how long the tape server host checks took\. +(info) Reports how long the tape server host checks took\&. .RE .PP ERROR: \fIhost\fR: could not resolve hostname .RS 4 (error) Could not look up client hostname -\fIhost\fR\. +\fIhost\fR\&. .RE .PP -Client check: \fIH\fR hosts checked in \fIS\fR seconds, \fIN\fR problems found\. +Client check: \fIH\fR hosts checked in \fIS\fR seconds, \fIN\fR problems found\&. .RS 4 -(info) Reports the number of client hosts checked, how long it took and the number of errors detected\. +(info) Reports the number of client hosts checked, how long it took and the number of errors detected\&. .RE .PP -WARNING: \fIhost\fR: selfcheck request timed out\. Host down? +WARNING: \fIhost\fR: selfcheck request timed out\&. Host down? .RS 4 (warning) There was no response from \fIhost\fR -when trying to do the client checks\. The host might really be down or it might not be configured properly\. +when trying to do the client checks\&. The host might really be down or it might not be configured properly\&. .RE .PP ERROR: \fIhost\fR NAK: \fImessage\fR @@ -644,7 +798,7 @@ ERROR: \fIhost\fR NAK: \fImessage\fR \fIHost\fR reported a negative acknowledgment error of \fImessage\fR -to the status check request\. +to the status check request\&. .RE .PP ERROR: \fIhost\fR NAK: [NAK parse failed] @@ -652,18 +806,18 @@ ERROR: \fIhost\fR NAK: [NAK parse failed] (error) \fBAmcheck\fR could not parse the negative acknowledgment error from -\fIhost\fR\. There might be an +\fIhost\fR\&. There might be an \fIAmanda\fR version mismatch between the host running \fBamcheck\fR and -\fIhost\fR\. +\fIhost\fR\&. .RE .PP ERROR: \fIhost\fR [mutual\-authentication failed] .RS 4 (error) Kerberos authentication failed while contacting -\fIhost\fR\. +\fIhost\fR\&. .RE .PP ERROR: \fIhost\fR: \fImessage\fR @@ -671,7 +825,7 @@ ERROR: \fIhost\fR: \fImessage\fR (error) Error \fImessage\fR was reported by the status check on -\fIhost\fR\. +\fIhost\fR\&. .RE .SH "EXIT CODE" @@ -680,17 +834,13 @@ The exit code of \fBamcheck\fR is one of: 0 = success 1 = error .fi -.SH "AUTHOR" -.PP -James da Silva, - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBamdump\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amcheckdb.8 b/man/amcheckdb.8 index 754c312..eb8bc42 100644 --- a/man/amcheckdb.8 +++ b/man/amcheckdb.8 @@ -1,61 +1,215 @@ .\" Title: amcheckdb -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Adrian T. Filipi-Martin +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCHECKDB" "8" "08/22/2008" "" "" +.TH "AMCHECKDB" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcheckdb - check Amanda database for tape consistency -.SH "SYNOPSIS" -.HP 10 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcheckdb \- check \fIAmanda\fR database for tape consistency +.SH "Synopsis" +.fam C +.HP \w'\fBamcheckdb\fR\ 'u \fBamcheckdb\fR \fIconfig\fR +.fam .SH "DESCRIPTION" .PP \fBAmcheckdb\fR verifies that every tape mentioned in the \fIAmanda\fR database is still valid in the -\fItapelist\fR -file\. +\fBtapelist\fR(5)\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "EXAMPLE" .PP This shows a normal response: .nf # amcheckdb daily -Ready\. +Ready\&. .fi .PP This shows tape \fIDMP014\fR is still listed in the database but is no longer listed in the -\fItapelist\fR -file: +\fBtapelist\fR(5): .nf # amcheckdb daily Tape DMP014 missing in /usr/local/etc/amanda//daily/tapelist -Ready\. +Ready\&. .fi -.SH "AUTHOR" -.PP -Adrian T\. Filipi\-Martin : Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamadmin\fR(8), \fBamrmtape\fR(8), \fBamanda\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBAdrian T\&. Filipi\-Martin\fR <\&atf3r@cs\&.virginia\&.edu\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amcheckdump.8 b/man/amcheckdump.8 index 4371b83..c3140e6 100644 --- a/man/amcheckdump.8 +++ b/man/amcheckdump.8 @@ -1,44 +1,198 @@ .\" Title: amcheckdump -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Ian Turner +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCHECKDUMP" "8" "08/22/2008" "" "" +.TH "AMCHECKDUMP" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcheckdump - check the results of an Amanda dump -.SH "SYNOPSIS" -.HP 12 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcheckdump \- check the results of an \fIAmanda\fR dump +.SH "Synopsis" +.fam C +.HP \w'\fBamcheckdump\fR\ 'u \fBamcheckdump\fR \fIconfig\fR [\-\-timestamp|\-t\ \fItimestamp\fR] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmcheckdump\fR verifies \fIAmanda\fR -dump images by reading them from storage volume(s) and verifying that the images can be parsed by the appropriate application (if available)\. For example, a GNUTAR image is passed to GNU Tar for parsing, and any errors (e\.g\., corrupt or missing data) are noted\. +dump images by reading them from storage volume(s) and verifying that the images can be parsed by the appropriate application (if available)\&. For example, a GNUTAR image is passed to GNU Tar for parsing, and any errors (e\&.g\&., corrupt or missing data) are noted\&. .PP The application runs on the most recent dump or, if \fI\-\-timestamp\fR -is specified, on the most recent dump with that timestamp\. Note that the verification is local to the +is specified, on the most recent dump with that timestamp\&. Note that the verification is local to the \fIAmanda\fR -server; if the dump application is not available, or is configured differently on the server than on the client, then the verification will most likely fail\. +server; if the dump application is not available, or is configured differently on the server than on the client, then the verification will most likely fail\&. .PP -If a changer is available, it is used to load the required tapes\. Otherwise, the application interactively requests the tapes\. +If a changer is available, it is used to load the required tapes\&. Otherwise, the application interactively requests the tapes\&. .PP See the "\fBCONFIGURATION OVERRIDE\fR" section in \fBamanda\fR(8) for information on the -\-o -option\. -.SH "SEE ALSO" -.PP -\fBamanda\fR(8), -: http://wiki.zmanda.com +\FC\-o\F[] +option\&. .SH "EXAMPLE" .PP .nf @@ -51,4 +205,10 @@ amcheckdump MYCONFIG \-\-timestamp 19780615 .SH "SEE ALSO" .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +: http://wiki.zmanda.com +.SH "Author" +.PP +\fBIan Turner\fR <\&ian@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amcleanup.8 b/man/amcleanup.8 index 04dc0f8..9148da2 100644 --- a/man/amcleanup.8 +++ b/man/amcleanup.8 @@ -1,20 +1,178 @@ .\" Title: amcleanup -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCLEANUP" "8" "08/22/2008" "" "" +.TH "AMCLEANUP" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcleanup - run the Amanda cleanup process after a failure -.SH "SYNOPSIS" -.HP 10 -\fBamcleanup\fR [\fB\-k\fR] [\fB\-v\fR] \fIconfig\fR +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcleanup \- run the \fIAmanda\fR cleanup process after a failure +.SH "Synopsis" +.fam C +.HP \w'\fBamcleanup\fR\ 'u +\fBamcleanup\fR [\fB\-k\fR] [\fB\-p\fR] [\fB\-v\fR] \fIconfig\fR +.fam .SH "DESCRIPTION" .PP \fBAmcleanup\fR @@ -22,42 +180,47 @@ generates the \fI\fIAmanda\fR\fR\fI Mail Report\fR and updates the \fIAmanda\fR -databases after a system failure on a tape server host\. This cleanup process is normally done automatically as part of the +databases after a system failure on a tape server host\&. This cleanup process is normally done automatically as part of the \fBamdump\fR program, but if \fBamdump\fR cannot complete for some reason (usually because of a tape server host crash), \fBamcleanup\fR -must be run some time later (usually during system boot)\. +must be run some time later (usually during system boot)\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-k\fR .RS 4 -Kill all Amanda processes\. +Kill all process listed in the log file are their child\&. if there is no log file, then kill all amdump and amflush process and their child\&. +.RE +.PP +\fB\-p\fR +.RS 4 +Do the cleanup only if all process listed in the log file are already terminated\&. .RE .PP \fB\-v\fR .RS 4 -Generate verbose output\. +Generate verbose output\&. .RE .SH "EXAMPLES" .PP This example runs the \fIAmanda\fR -cleanup process by hand after a failure\. +cleanup process by hand after a failure\&. .nf % amcleanup daily .fi .PP -Putting the following line in a system boot script (e\.g\. -\fI/etc/rc\.local\fR) runs the +Putting the following line in a system boot script (e\&.g\&. +\FC/etc/rc\&.local\F[]) runs the \fIAmanda\fR -cleanup process as part of the reboot, eliminating the need to run it by hand\. +cleanup process as part of the reboot, eliminating the need to run it by hand\&. .nf /usr/local/sbin/amcleanup daily .fi @@ -66,18 +229,15 @@ If nothing needs to be done, \fBamcleanup\fR exits normally with the message: .nf -amcleanup: no unprocessed logfile to clean up\. +amcleanup: no unprocessed logfile to clean up\&. .fi -.SH "AUTHOR" -.PP -James da Silva, -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBamdump\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amcrypt-ossl-asym.8 b/man/amcrypt-ossl-asym.8 index 6971d8d..e9da0bb 100644 --- a/man/amcrypt-ossl-asym.8 +++ b/man/amcrypt-ossl-asym.8 @@ -1,90 +1,248 @@ .\" Title: amcrypt-ossl-asym -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCRYPT\-OSSL\-ASYM" "8" "08/22/2008" "" "" +.TH "AMCRYPT\-OSSL\-ASYM" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcrypt-ossl-asym - crypt program for Amanda asymmetric data encryption using OpenSSL -.SH "SYNOPSIS" -.HP 18 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcrypt-ossl-asym \- crypt program for \fIAmanda\fR asymmetric data encryption using OpenSSL +.SH "Synopsis" +.fam C +.HP \w'\fBamcrypt\-ossl\-asym\fR\ 'u \fBamcrypt\-ossl\-asym\fR [\-d] +.fam .SH "DESCRIPTION" .PP \fBamcrypt\-ossl\-asym\fR uses \fBOpenSSL\fR -to encrypt and decrypt data\. OpenSSL is available from -www\.openssl\.org\. OpenSSL offers a wide variety of cipher choices ( +to encrypt and decrypt data\&. OpenSSL is available from +www\&.openssl\&.org\&. OpenSSL offers a wide variety of cipher choices ( \fBamcrypt\-ossl\-asym\fR -defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\. +defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\&. .PP \fBamcrypt\-ossl\-asym\fR -will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\. +will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\&. .SH "GENERATING PUBLIC AND PRIVATE KEYS" .PP -RSA keys can be generated with the standard OpenSSL commands, e\.g\.: +RSA keys can be generated with the standard OpenSSL commands, e\&.g\&.: .nf $ cd /var/lib/amanda -$ openssl genrsa \-aes128 \-out backup\-privkey\.pem 1024 +$ openssl genrsa \-aes128 \-out backup\-privkey\&.pem 1024 Generating RSA private key, 1024 bit long modulus -[\.\.\.] -Enter pass phrase for backup\-privkey\.pem: \fIENTER YOUR PASS PHRASE\fR -Verifying \- Enter pass phrase for backup\-key\.pem: \fIENTER YOUR PASS PHRASE\fR +[\&.\&.\&.] +Enter pass phrase for backup\-privkey\&.pem: \fIENTER YOUR PASS PHRASE\fR +Verifying \- Enter pass phrase for backup\-key\&.pem: \fIENTER YOUR PASS PHRASE\fR -$ openssl rsa \-in backup\-privkey\.pem \-pubout \-out backup\-pubkey\.pem -Enter pass phrase for backup\-privkey\.pem: \fIENTER YOUR PASS PHRASE\fR +$ openssl rsa \-in backup\-privkey\&.pem \-pubout \-out backup\-pubkey\&.pem +Enter pass phrase for backup\-privkey\&.pem: \fIENTER YOUR PASS PHRASE\fR Writing RSA key .fi .PP To generate a private key without a passphrase, omit the \fB\-aes128\fR -option\. See +option\&. See \fBopenssl_genrsa\fR(1) -for more key generation options\. +for more key generation options\&. .PP -Note that it is always possible to generate the public key from the private key\. +Note that it is always possible to generate the public key from the private key\&. .SH "KEY AND PASSPHRASE MANAGEMENT" .PP \fBamcrypt\-ossl\-asym\fR uses the \fIpublic key\fR -to encrypt data\. The security of the data does not depend on the confidentiality of the public key\. The +to encrypt data\&. The security of the data does not depend on the confidentiality of the public key\&. The \fIprivate key\fR -is used to decrypt data, and must be protected\. Encrypted backup data cannot be recovered without the private key\. The private key may optionally be encrypted with a passphrase\. +is used to decrypt data, and must be protected\&. Encrypted backup data cannot be recovered without the private key\&. The private key may optionally be encrypted with a passphrase\&. .PP -While the public key must be online at all times to perorm backups, the private key and optional passphrase are only needed to restore data\. It is recommended that the latter be stored offline all other times\. For example, you could keep the private key on removable media, and copy it into place for a restore; or you could keep the private key online, encrypted with a passphrase that is present only for a restore\. +While the public key must be online at all times to perorm backups, the private key and optional passphrase are only needed to restore data\&. It is recommended that the latter be stored offline all other times\&. For example, you could keep the private key on removable media, and copy it into place for a restore; or you could keep the private key online, encrypted with a passphrase that is present only for a restore\&. .PP -OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see -www\.diceware\.com) can be used to create passphrases that are difficult to guess and easy to remember\. +OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\&. The Diceware method (see +www\&.diceware\&.com) can be used to create passphrases that are difficult to guess and easy to remember\&. .SH "FILES" .PP -/var/lib/amanda/backup\-privkey\.pem +/var/lib/amanda/backup\-privkey\&.pem .RS 4 -File containing the RSA private key\. It should not be readable by any user other than the +File containing the RSA private key\&. It should not be readable by any user other than the \fIAmanda\fR -user\. +user\&. .RE .PP -/var/lib/amanda/backup\-pubkey\.pem +/var/lib/amanda/backup\-pubkey\&.pem .RS 4 -File containing the RSA public key\. +File containing the RSA public key\&. .RE .PP -/var/lib/amanda/\.am_passphrase +/var/lib/amanda/\&.am_passphrase .RS 4 -File containing the passphrase\. It should not be readable by any user other than the +File containing the passphrase\&. It should not be readable by any user other than the \fIAmanda\fR -user\. +user\&. .RE .SH "SEE ALSO" .PP @@ -94,7 +252,13 @@ user\. \fBopenssl\fR(1), \fBamcrypt-ossl\fR(8), : http://wiki.zmanda.com -.SH "NOTES" +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.SH "Notes" .IP " 1." 4 www.openssl.org .RS 4 diff --git a/man/amcrypt-ossl.8 b/man/amcrypt-ossl.8 index 9e4903c..9e508d1 100644 --- a/man/amcrypt-ossl.8 +++ b/man/amcrypt-ossl.8 @@ -1,51 +1,209 @@ .\" Title: amcrypt-ossl -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCRYPT\-OSSL" "8" "08/22/2008" "" "" +.TH "AMCRYPT\-OSSL" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcrypt-ossl - crypt program for Amanda symmetric data encryption using OpenSSL -.SH "SYNOPSIS" -.HP 13 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcrypt-ossl \- crypt program for \fIAmanda\fR symmetric data encryption using OpenSSL +.SH "Synopsis" +.fam C +.HP \w'\fBamcrypt\-ossl\fR\ 'u \fBamcrypt\-ossl\fR [\-d] +.fam .SH "DESCRIPTION" .PP \fBamcrypt\-ossl\fR uses \fBOpenSSL\fR -to encrypt and decrypt data\. OpenSSL is available from -www\.openssl\.org\. OpenSSL offers a wide variety of cipher choices ( +to encrypt and decrypt data\&. OpenSSL is available from +www\&.openssl\&.org\&. OpenSSL offers a wide variety of cipher choices ( \fBamcrypt\-ossl\fR -defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\. +defaults to 256\-bit AES) and can use hardware cryptographic accelerators on several platforms\&. .PP \fBamcrypt\-ossl\fR -will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\. +will search for the OpenSSL program in the following directories: /bin:/usr/bin:/usr/local/bin:/usr/ssl/bin:/usr/local/ssl/bin\&. .SH "PASSPHRASE MANAGEMENT" .PP \fBamcrypt\-ossl\fR -uses the same pass phrase to encrypt and decrypt data\. It is very important to store and protect the pass phrase properly\. Encrypted backup data can +uses the same pass phrase to encrypt and decrypt data\&. It is very important to store and protect the pass phrase properly\&. Encrypted backup data can \fBonly\fR -be recovered with the correct passphrase\. +be recovered with the correct passphrase\&. .PP -OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\. The Diceware method (see -www\.diceware\.com) can be used to create passphrases that are difficult to guess and easy to remember\. +OpenSSL\'s key derivation routines use a salt to guard against dictionary attacks on the pass phrase; still it is important to pick a pass phrase that is hard to guess\&. The Diceware method (see +www\&.diceware\&.com) can be used to create passphrases that are difficult to guess and easy to remember\&. .SH "FILES" .PP -/var/lib/amanda/\.am_passphrase +/var/lib/amanda/\&.am_passphrase .RS 4 -File containing the pass phrase\. It should not be readable by any user other than the +File containing the pass phrase\&. It should not be readable by any user other than the \fIAmanda\fR -user\. +user\&. .RE .SH "SEE ALSO" .PP @@ -55,7 +213,13 @@ user\. \fBopenssl\fR(1), \fBamcrypt-ossl-asym\fR(8), : http://wiki.zmanda.com -.SH "NOTES" +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.SH "Notes" .IP " 1." 4 www.openssl.org .RS 4 diff --git a/man/amcrypt.8 b/man/amcrypt.8 index 9b3276f..90d205c 100644 --- a/man/amcrypt.8 +++ b/man/amcrypt.8 @@ -1,20 +1,178 @@ .\" Title: amcrypt -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCRYPT" "8" "08/22/2008" "" "" +.TH "AMCRYPT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcrypt - reference crypt program for Amanda symmetric data encryption -.SH "SYNOPSIS" -.HP 8 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcrypt \- reference crypt program for \fIAmanda\fR symmetric data encryption +.SH "Synopsis" +.fam C +.HP \w'\fBamcrypt\fR\ 'u \fBamcrypt\fR +.fam .SH "DESCRIPTION" .PP @@ -24,12 +182,12 @@ requires \fBuuencode\fR and \fBgpg\fR -to work\. Aespipe is available from +to work\&. Aespipe is available from : http://loop-aes.sourceforge.net .PP \fBamcrypt\fR -will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\. +will search for the aespipe program in the following directories: /usr/bin:/usr/local/bin:/sbin:/usr/sbin\&. .PP \fBamcrypt\fR @@ -37,30 +195,30 @@ calls \fBamaespipe\fR and pass the \fBpassphrase\fR -through file descriptor 3\. The passphrase should be stored in ~amanda/\.am_passphrase\. -.SH "HOW TO CREATE ENCRYPTION KEYS FOR AMCRYPT" +through file descriptor 3\&. The passphrase should be stored in ~amanda/\&.am_passphrase\&. +.SH "How to create encryption keys for amcrypt" .PP -1\. Create 65 random encryption keys and encrypt those keys using gpg\. Reading from /dev/random may take indefinitely long if kernel\'s random entropy pool is empty\. If that happens, do some other work on some other console (use keyboard, mouse and disks)\. +1\&. Create 65 random encryption keys and encrypt those keys using gpg\&. Reading from /dev/random may take indefinitely long if kernel\'s random entropy pool is empty\&. If that happens, do some other work on some other console (use keyboard, mouse and disks)\&. .PP -head \-c 2925 /dev/random | uuencode \-m \- | head \-n 66 | tail \-n 65 \e | gpg \-\-symmetric \-a > ~amanda/\.gnupg/am_key\.gpg +head \-c 2925 /dev/random | uuencode \-m \- | head \-n 66 | tail \-n 65 \e | gpg \-\-symmetric \-a > ~amanda/\&.gnupg/am_key\&.gpg .PP -This will ask for a passphrase\. Remember this passphrase as you will need it in the next step\. +This will ask for a passphrase\&. Remember this passphrase as you will need it in the next step\&. .PP -2\. Store the passphrase inside the home\-directory of the AMANDA\-user and protect it with proper permissions: +2\&. Store the passphrase inside the home\-directory of the AMANDA\-user and protect it with proper permissions: .nf -echo my_secret_passphrase > ~amanda/\.am_passphrase -chown amanda:disk ~amanda/\.am_passphrase -chmod 700 ~amanda/\.am_passphrase +echo my_secret_passphrase > ~amanda/\&.am_passphrase +chown amanda:disk ~amanda/\&.am_passphrase +chmod 700 ~amanda/\&.am_passphrase .fi -.SH "KEY AND PASSPHRASE" +.SH "Key and Passphrase" .PP \fBamcrypt\fR -uses the same key to encrypt and decrypt data\. +uses the same key to encrypt and decrypt data\&. .PP -It is very important to store and protect the key and the passphrase properly\. Encrypted backup data can +It is very important to store and protect the key and the passphrase properly\&. Encrypted backup data can \fBonly\fR -be recovered with the correct key and passphrase\. +be recovered with the correct key and passphrase\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -69,3 +227,9 @@ be recovered with the correct key and passphrase\. \fBamaespipe\fR(8), \fBgpg\fR(1), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amcryptsimple.8 b/man/amcryptsimple.8 index cecbd1f..4e3728f 100644 --- a/man/amcryptsimple.8 +++ b/man/amcryptsimple.8 @@ -1,20 +1,178 @@ .\" Title: amcryptsimple -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMCRYPTSIMPLE" "8" "08/22/2008" "" "" +.TH "AMCRYPTSIMPLE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amcryptsimple - reference simple crypt program for Amanda symmetric data encryption -.SH "SYNOPSIS" -.HP 14 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amcryptsimple \- reference simple crypt program for \fIAmanda\fR symmetric data encryption +.SH "Synopsis" +.fam C +.HP \w'\fBamcryptsimple\fR\ 'u \fBamcryptsimple\fR to be called by \fIAmanda\fR only +.fam .SH "DESCRIPTION" .PP @@ -23,7 +181,7 @@ calls \fBgpg\fR to perform symmetric data encryption on \fIAmanda\fR -backup\. +backup\&. \fBamcryptsimple\fR will search for the gpg program in the following directories: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin .PP @@ -33,28 +191,25 @@ uses one passphrase to encrypt the \fIAmanda\fR data and uses the same passphrase to decrypt the \fIAmanda\fR -backup data\. +backup data\&. \fBamcryptsimple\fR -uses AES256 as the symmetric cipher\. -.SH "HOW TO CREATE PASSPHRASE" +uses AES256 as the symmetric cipher\&. +.SH "How to Create Passphrase" Store the passphrase inside the home\-directory of the AMANDA\-user($amanda_user) and protect it with proper permissions: - echo my_secret_passphrase > ~$amanda_user/\.am_passphrase - chown $amanda_user:disk ~$amanda_user/\.am_passphrase - chmod 700 ~$amanda_user/\.am_passphrase + echo my_secret_passphrase > ~$amanda_user/\&.am_passphrase + chown $amanda_user:disk ~$amanda_user/\&.am_passphrase + chmod 700 ~$amanda_user/\&.am_passphrase .SH "NOTES" .PP -Choose a good passphrase and protect it properly\. Backup data can only be restored with the passphrase\. There is no backdoor\. +Choose a good passphrase and protect it properly\&. Backup data can only be restored with the passphrase\&. There is no backdoor\&. .PP If storing and securing passphrase in your environment presents challenges, \fIAmanda\fR provide public\-key data encryption through -\fBamgpgcrypt\fR\. Public\-key encryption uses the public key to encrypt and uses the private key to decrypt\. -.SH "AUTHOR" -.PP -The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\. +\fBamgpgcrypt\fR\&. Public\-key encryption uses the public key to encrypt and uses the private key to decrypt\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -64,3 +219,9 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBamrestore\fR(8), \fBgpg\fR(1), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amdd.8 b/man/amdd.8 deleted file mode 100644 index 55382d4..0000000 --- a/man/amdd.8 +++ /dev/null @@ -1,121 +0,0 @@ -.\" Title: amdd -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: -.\" -.TH "AMDD" "8" "08/22/2008" "" "" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -amdd - Amanda version of dd -.SH "SYNOPSIS" -.HP 5 -\fBamdd\fR [\-d] [\fIif=input\fR] [\fIof=output\fR] [\fIbs=blocksize\fR] [\fIskip=count\fR] [\fIcount=count\fR] -.SH "DESCRIPTION" -.PP -\fBAmdd\fR -provides just enough of the standard UNIX -\fBdd\fR -command for the needs of -\fIAmanda\fR\. This is handy when doing a full restore and the standard -\fBdd\fR -program has not yet been found\. -.PP -\fBAmdd\fR -also provides access to the -\fIAmanda\fR -output drivers that support various tape simulations\. This may be used for debugging or to convert from one format to another\. -.PP -See the -\fBamanda\fR(8) -man page for more details about -\fIAmanda\fR\. See the -\fBOUTPUT DRIVERS\fR -section of -\fIamanda(8)\fR -for more information on the -\fIAmanda\fR -output drivers\. -.SH "OPTIONS" -.PP -\fB\-d\fR -.RS 4 -Turn on debugging output\. -.RE -.PP -\fB\-l\fR\fIlength\fR -.RS 4 -Set the output length\. If the output driver limits the output size, this controls when end of tape will be simulated\. -.sp -\fILength\fR -may have a multiplier suffix: -.sp -.RS 4 -.nf -k \-> 1024 (Kilobytes) -b \-> 512 (Blocks) -M \-> 1024*1024 (Megabytes) -.fi -.RE -The default is no multiplier (bytes)\. -.RE -.PP -\fBif=\fR\fIinput\fR -.RS 4 -Input to -\fBdd\fR\. Default is stdin\. -.RE -.PP -\fBof=\fR\fIoutput\fR -.RS 4 -Where to send the output of -\fBdd\fR\. Default is stdout\. -.RE -.PP -\fBbs=\fR\fIblocksize\fR -.RS 4 -Size of each record\. Input records smaller than this will -\fInot\fR -be padded\. Output records will be the same size as the corresponding input record\. Default is 512 bytes\. -.sp -\fIBlocksize\fR -may have a multiplier suffix: -.sp -.RS 4 -.nf -k \-> 1024 (Kilobytes) -b \-> 512 (Blocks) -M \-> 1024*1024 (Megabytes) -.fi -.RE -The default is no multiplier (bytes)\. -.RE -.PP -\fBcount=\fR\fIcount\fR -.RS 4 -Number of records to copy\. Default is all records until end of file\. -.RE -.PP -\fBskip=\fR\fIcount\fR -.RS 4 -Number of records to skip before copying input to output\. Default is zero\. -.RE -.SH "AUTHOR" -.PP -Marc Mengel -, John R\. Jackson - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion -.SH "SEE ALSO" -.PP - -\fBamanda\fR(8), -: http://wiki.zmanda.com diff --git a/man/amdevcheck.8 b/man/amdevcheck.8 index a9b403e..452c445 100644 --- a/man/amdevcheck.8 +++ b/man/amdevcheck.8 @@ -1,69 +1,264 @@ .\" Title: amdevcheck -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Ian Turner +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMDEVCHECK" "8" "08/22/2008" "" "" +.TH "AMDEVCHECK" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amdevcheck - Validate an Amanda device and volume. -.SH "SYNOPSIS" -.HP 11 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amdevcheck \- Validate an \fIAmanda\fR device and volume\&. +.SH "Synopsis" +.fam C +.HP \w'\fBamdevcheck\fR\ 'u \fBamdevcheck\fR \fIconfig\fR [\fIdevice\ name\fR] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmdevcheck\fR provides a way to check that a particular \fIAmanda\fR -device is accessible, whether or not it contains a volume, and whether or not that volume is labeled\. Some devices can\'t distinguish between all of these cases; a missing volume and an unlabeled volume might generate the same error code, for example\. In those cases, this tool reports all possible causes of the error\. +device is accessible, whether or not it contains a volume, and whether or not that volume is labeled\&. Some devices can\'t distinguish between all of these cases; a missing volume and an unlabeled volume might generate the same error code, for example\&. In those cases, this tool reports all possible causes of the error\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. See the -\fBOUTPUT DRIVERS\fR -section of -\fIamanda(8)\fR -for more information on the -\fIAmanda\fR -output drivers\. +\fIAmanda\fR\&. See +\fBamanda-devices\fR(7) +for more information on devices\&. .SH "OPTIONS" .PP \fIconfig\fR .RS 4 \fIAmanda\fR -configuration to use\. Note that +configuration to use\&. Note that \fBamdevcheck\fR -ignores any tape changer configuration\. +ignores any tape changer configuration\&. .RE .PP \fI device\fR .RS 4 \fIAmanda\fR -device to use\. This option overrides any tapedev configuration specified in the configuration file\. +device to use\&. This option overrides any tapedev configuration specified in the configuration file\&. .RE .PP \fB\-o\fR \fIclientconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. +.RE +.SH "OUTPUT" +\fBAmdevcheck\fR returns one or more of the following lines\&. If multiple lines appear, then at least one, but not necessarily all of +the messages apply\&. This situation can occur when working with hardware or +operating systems which cannot distinguish, for example, between a +malfunctioning drive and a functional but unloaded drive\&. +.PP +\fBSUCCESS\fR +.RS 4 +A tape is ready\&. +.RE +.PP +\fBDEVICE_ERROR\fR +.RS 4 +A device error has occurred\&. +.RE +.PP +\fBDEVICE_BUSY\fR +.RS 4 +The device is busy\&. +.RE +.PP +\fBVOLUME_MISSING\fR +.RS 4 +No tape is loaded in the drive\&. +.RE +.PP +\fBVOLUME_UNLABELED\fR +.RS 4 +The tape in the drive is unlabeled\&. +.RE +.PP +\fBVOLUME_ERROR\fR +.RS 4 +A volume error has occurred\&. .RE -.SH "AUTHOR" .PP -Ian Turner - -and others\. Authorship of this tool and its documentation was funded by Zmanda, Inc\. +\fBMESSAGE\fR \fItext\fR +.RS 4 +Where text provides a human\-readable description of the problem\&. +.RE .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBammt\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBIan Turner\fR <\&ian@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amdump.8 b/man/amdump.8 index 90b963c..0889853 100644 --- a/man/amdump.8 +++ b/man/amdump.8 @@ -1,61 +1,219 @@ .\" Title: amdump -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMDUMP" "8" "08/22/2008" "" "" +.TH "AMDUMP" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amdump - back up all disks in an Amanda configuration -.SH "SYNOPSIS" -.HP 7 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amdump \- back up all disks in an \fIAmanda\fR configuration +.SH "Synopsis" +.fam C +.HP \w'\fBamdump\fR\ 'u \fBamdump\fR \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmdump\fR switches to the appropriate \fIAmanda\fR -configuration directory, e\.g\. /usr/local/etc/amanda/\fIconfig\fR, then attempts to back up every disk specified by the -\fIamanda\.conf\fR -file\. +configuration directory, e\&.g\&. /usr/local/etc/amanda/\fIconfig\fR, then attempts to back up every disk specified by the +\fIamanda\&.conf\fR +file\&. \fBAmdump\fR is normally run by -\fBcron\fR\. +\fBcron\fR\&. .PP -You can specify many host/disk expressions, only disks that match an expression will be dumped\. All disks are dumped if no expressions are given\. +You can specify many host/disk expressions, only disks that match an expression will be dumped\&. All disks are dumped if no expressions are given\&. .PP If the file /usr/local/etc/amanda/\fIconfig\fR/hold exists, \fBamdump\fR -will wait until it is removed before starting the backups\. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose\. While waiting, +will wait until it is removed before starting the backups\&. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose\&. While waiting, \fBamdump\fR -checks for the hold file every minute\. +checks for the hold file every minute\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fIhost\fR [\fIdisk\fR]* .RS 4 -Specify the host and disk on which the command will work\. +Specify the host and disk on which the command will work\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "EXAMPLE" .PP -Here is a typical crontab entry\. It runs +Here is a typical crontab entry\&. It runs \fBamdump\fR -every weeknight at 1 a\.m\. as user +every weeknight at 1 a\&.m\&. as user \fBbin\fR: .nf 0 1 * * 1\-5 bin /usr/local/sbin/amdump daily @@ -65,14 +223,14 @@ Please see the \fBcrontab\fR(5) or \fBcrontab\fR(1) -manual page for the correct crontab format for your system\. +manual page for the correct crontab format for your system\&. .SH "MESSAGES" .PP amdump: waiting for hold file to be removed .RS 4 The "hold" file exists and \fBamdump\fR -is waiting for it to be removed before starting backups\. +is waiting for it to be removed before starting backups\&. .RE .PP amdump: amdump or amflush is already running, or you must run amcleanup @@ -85,10 +243,10 @@ running, or the remains of a previous incomplete \fBamdump\fR or \fBamflush\fR -run\. This run is terminated\. If the problem is caused by the remains of a previous run, you must execute +run\&. This run is terminated\&. If the problem is caused by the remains of a previous run, you must execute \fBamcleanup\fR(8) and then rerun -\fBamdump\fR\. +\fBamdump\fR\&. .RE .SH "EXIT CODE" @@ -101,15 +259,6 @@ The exit code of \fBamdump\fR is the ORed value of: 8 = Don\'t know the status of a dle (RESULT_MISSING in the report) 16 = tape error or no more tape .fi -.SH "AUTHOR" -.PP -James da Silva, - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP @@ -120,3 +269,8 @@ Stefan G\. Weichinger, \fBamflush\fR(8), \fBcron\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amfetchdump.8 b/man/amfetchdump.8 index 9035990..af28b2e 100644 --- a/man/amfetchdump.8 +++ b/man/amfetchdump.8 @@ -1,24 +1,182 @@ .\" Title: amfetchdump -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: John Stange +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMFETCHDUMP" "8" "08/22/2008" "" "" +.TH "AMFETCHDUMP" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amfetchdump - extract backup images from multiple Amanda tapes. -.SH "SYNOPSIS" -.HP 12 -\fBamfetchdump\fR [\-pcClawns] [\-d\ \fIdevice\fR] [\-O\ \fIdirectory\fR] [\-b\ \fIblocksize\fR] \fIconfig\fR \fIhostname\fR [\fIdisk\fR\ [\ \fIdate\fR\ [\ \fIlevel\fR\ [\ \fIhostname\fR\ [\.\.\.]\ ]\ ]\ ]] [\-o\ \fIconfigoption\fR]... +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amfetchdump \- extract backup images from multiple \fIAmanda\fR tapes\&. +.SH "Synopsis" +.fam C +.HP \w'\fBamfetchdump\fR\ 'u +\fBamfetchdump\fR [\-pcClawns] [\-d\ \fIdevice\fR] [\-O\ \fIdirectory\fR] [\-b\ \fIblocksize\fR] \fIconfig\fR \fIhostname\fR [\fIdisk\fR\ [\ \fIdate\fR\ [\ \fIlevel\fR\ [\ \fIhostname\fR\ [\&.\&.\&.]\ ]\ ]\ ]] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmfetchdump\fR -pulls one or more matching dumps from tape or from the holding disk, handling the reassembly of multi\-tape split dump files as well as any tape autochanger operations\. +pulls one or more matching dumps from tape or from the holding disk, handling the reassembly of multi\-tape split dump files as well as any tape autochanger operations\&. .PP It will automatically use the logs created by \fBamdump\fR(8) @@ -26,7 +184,7 @@ to locate available dumps on tape, in the same way that the \fBfind\fR feature of \fBamadmin\fR(8) -lists available dumps\. If these logs are unavailable, it can search tape\-by\-tape to find what it needs, and can generate new logs to serve as an emergency tape inventory\. +lists available dumps\&. If these logs are unavailable, it can search tape\-by\-tape to find what it needs, and can generate new logs to serve as an emergency tape inventory\&. .PP The \fIhostname\fR, @@ -36,127 +194,122 @@ The dump pattern\-matching works as in \fBamrestore\fR(8), with the added requirement that at minimum a \fIhostname\fR -must be specified when not in inventory mode\. +must be specified when not in inventory mode\&. .PP Unless \fB\-p\fR is used, backup images are extracted to files in the current directory named: .PP -\fIhostname\.diskname\.datestamp\.dumplevel\fR +\fIhostname\&.diskname\&.datestamp\&.dumplevel\fR .SH "OPTIONS" .PP \fB\-p\fR .RS 4 Pipe exactly one complete dump file to -\fIstdout\fR, instead of writing the file to disk\. This will restore only the first matching dumpfile (where "first" is determined by the dump log search facility)\. +\fIstdout\fR, instead of writing the file to disk\&. This will restore only the first matching dumpfile (where "first" is determined by the dump log search facility)\&. .RE .PP \fB\-d\fR \fIdevice\fR .RS 4 -Restore from this tape device instead of the default\. +Restore from this tape device instead of the default\&. .RE .PP \fB\-O\fR \fIdirectory\fR .RS 4 -Output restored files to this directory, instead of to the current working directory\. +Output restored files to this directory, instead of to the current working directory\&. .RE .PP \fB\-c\fR .RS 4 -Compress output, fastest method available\. +Compress output, fastest method available\&. .RE .PP \fB\-C\fR .RS 4 -Compress output, smallest file size method available\. +Compress output, smallest file size method available\&. .RE .PP \fB\-l\fR .RS 4 -Leave dumps in the compressed/uncompressed state in which they were found on tape\. By default, +Leave dumps in the compressed/uncompressed state in which they were found on tape\&. By default, \fBamfetchdump\fR -will automatically uncompress when restoring\. +will automatically uncompress when restoring\&. .RE .PP \fB\-a\fR .RS 4 -Assume that all tapes are already available, via tape changer or otherwise, instead of prompting the operator to ensure that all tapes are loaded\. +Assume that all tapes are already available, via tape changer or otherwise, instead of prompting the operator to ensure that all tapes are loaded\&. .RE .PP \fB\-w\fR .RS 4 -Wait to put split dumps together until all chunks have been restored\. Normally, +Wait to put split dumps together until all chunks have been restored\&. Normally, \fBamfetchdump\fR -will attempt to read pieces of a split file from tape in order, so that it can assemble them simply by appending each file to the first\. This option disables the appending behavior, and instead restores each piece as an individual file and reassembles them only after all have been restored\. +will attempt to read pieces of a split file from tape in order, so that it can assemble them simply by appending each file to the first\&. This option disables the appending behavior, and instead restores each piece as an individual file and reassembles them only after all have been restored\&. +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note -This requires at least double the size of your dump in free disk space, in order to build the final assembled dumpfile\. - -This behavior is implicitly invoked in circumstances where knowing the location of all dumps on tape in advance is not possible, such as when you are restoring without log files\. +.ps +1 +\fBNote\fR +.ps -1 +.br +This requires at least double the size of your dump in free disk space, in order to build the final assembled dumpfile\&. +.sp .5v +.EM yellow +.RE +This behavior is implicitly invoked in circumstances where knowing the location of all dumps on tape in advance is not possible, such as when you are restoring without log files\&. .RE .PP \fB\-n\fR .RS 4 -Do not reassemble split dump files at all, just restore each piece as an individual file\. +Do not reassemble split dump files at all, just restore each piece as an individual file\&. .RE .PP \fB\-s\fR .RS 4 -Do not fast\-forward straight to needed files on tape\. This will slow down most restores substantially\. Only use this option if your tape drive does not properly support the fast\-forward operation\. +Do not fast\-forward straight to needed files on tape\&. This will slow down most restores substantially\&. Only use this option if your tape drive does not properly support the fast\-forward operation\&. .RE .PP \fB\-b\fR \fIblocksize\fR .RS 4 -Force a particular block size when reading from tapes\. This value will usually be autodetected, and should not normally need to be set\. +Force a particular block size when reading from tapes\&. This value will usually be autodetected, and should not normally need to be set\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "EXAMPLES" .PP All the examples here assume your configuration is called -\fISetA\fR\. +\fISetA\fR\&. .PP -Here\'s a simple case, restoring all known dumps of the host vanya to the current working directory\. -.sp -.RS 4 +Here\'s a simple case, restoring all known dumps of the host vanya to the current working directory\&. .nf $ amfetchdump SetA vanya .fi -.RE .PP -A more likely scenario involves restoring a particular dump from a particular date\. We\'ll pipe this one to +A more likely scenario involves restoring a particular dump from a particular date\&. We\'ll pipe this one to \fBGNU\-tar\fR -as well, to automatically extract the dump\. -.sp -.RS 4 +as well, to automatically extract the dump\&. .nf $ amfetchdump \-p SetA vanya /home 20051020 | gtar \-xvpf \- .fi -.RE -.sp .SH "CAVEATS" .PP \fBAmfetchdump\fR -is dependent on accessing your server\'s config, tape changer, and (normally) dump logs\. As such, it\'s not necessarily the most useful tool when those have all been wiped out and you desperately need to pull things from your tape\. Pains have been taken to make it as capable as possible, but for seriously minimialist restores, look to +is dependent on accessing your server\'s config, tape changer, and (normally) dump logs\&. As such, it\'s not necessarily the most useful tool when those have all been wiped out and you desperately need to pull things from your tape\&. Pains have been taken to make it as capable as possible, but for seriously minimialist restores, look to \fBamrestore\fR(8) or \fBdd\fR(8) -instead\. -.SH "AUTHOR" -.PP -John Stange, -, National Academies Press -.PP -Ian Turner, -: XML\-conversion +instead\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -165,3 +318,14 @@ Ian Turner, \fBtar\fR(1), \fBrestore\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJohn Stange\fR <\&building@nap\&.edu\&> +.RS 4 +National Academies Press +.RE +.PP +\fBIan Turner\fR <\&ian@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amflush.8 b/man/amflush.8 index 7568e40..26a50ee 100644 --- a/man/amflush.8 +++ b/man/amflush.8 @@ -1,20 +1,178 @@ .\" Title: amflush -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMFLUSH" "8" "08/22/2008" "" "" +.TH "AMFLUSH" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amflush - flush Amanda backup files from holding disk to tape -.SH "SYNOPSIS" -.HP 8 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amflush \- flush \fIAmanda\fR backup files from holding disk to tape +.SH "Synopsis" +.fam C +.HP \w'\fBamflush\fR\ 'u \fBamflush\fR [\-b] [\-f] [\-s] [\-D\ \fIdatestamp\fR] \fIconfig\fR [\fIhost\fR\ [\fIdisk\fR...]...] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmflush\fR @@ -22,108 +180,115 @@ writes \fIAmanda\fR backups from the holding disks to tape, and updates the \fIAmanda\fR -info database and tapelist accordingly\. Backups may stay in a holding disk when something is wrong with the tape at the time +info database and +\fBtapelist\fR(5) +accordingly\&. Backups may stay in a holding disk when something is wrong with the tape at the time \fBamdump\fR -is run\. When this happens, the problem must be corrected and +is run\&. When this happens, the problem must be corrected and \fBamflush\fR -run by hand\. +run by hand\&. .SH "OPTIONS" .PP \fB\-b\fR .RS 4 Run \fBamflush\fR -in batch mode\. All datestamps are selected unless specified\. The flush is started without confirmation\. +in batch mode\&. All datestamps are selected unless specified\&. The flush is started without confirmation\&. .RE .PP \fB\-f\fR .RS 4 Run \fBamflush\fR -in foreground\. +in foreground\&. \fBAmflush\fR -normally detaches itself from the tty and runs as a background process\. With the +normally detaches itself from the tty and runs as a background process\&. With the \fB\-f\fR option, \fBamflush\fR -stays in the foreground\. This is useful if +stays in the foreground\&. This is useful if \fBamflush\fR -is run as part of another script that, for example, advances the tape after the flush is completed\. +is run as part of another script that, for example, advances the tape after the flush is completed\&. .RE .PP \fB\-s\fR .RS 4 -Write log to stdout/stderr instead of the amflush log file\. Requires the +Write log to stdout/stderr instead of the amflush log file\&. Requires the \fB\-f\fR -option\. +option\&. .RE .PP \fB\-D datestamp\fR .RS 4 specify a datestamp expression you want to flush, see the "DATESTAMP EXPRESSION" section of \fBamanda\fR(8) -for a description\. +for a description\&. \fB\-D 20001225\-7\fR -will flush all dumps from 25 december 2000 to 27 december 2000\. +will flush all dumps from 25 december 2000 to 27 december 2000\&. .RE .PP \fIhost\fR [\fIdisk\fR]* .RS 4 -Specify the host and disk on which the command will work\. +Specify the host and disk on which the command will work\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .PP -You can specify many host/disk expressions, only disks that match an expression will be flushed\. All disks are flushed if no expressions are given\. see the "HOST & DISK EXPRESSION" section of +You can specify many host/disk expressions, only disks that match an expression will be flushed\&. All disks are flushed if no expressions are given\&. see the "HOST & DISK EXPRESSION" section of \fBamanda\fR(8) -for a description\. +for a description\&. .PP \fBAmflush\fR will look in the holding disks specified by the -\fIamanda\.conf\fR +\fIamanda\&.conf\fR file in /usr/local/etc/amanda/\fIconfig\fR for any non\-empty \fIAmanda\fR -work directories\. It then prompts you to select a directory or to process all of the directories\. The work directories in the holding disks are named by the date at the time +work directories\&. It then prompts you to select a directory or to process all of the directories\&. The work directories in the holding disks are named by the date at the time \fBamdump\fR -was run, e\.g\. -19910215\. +was run, e\&.g\&. +\FC19910215\F[]\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "EXAMPLE" .PP \fBAmflush\fR will search for holding areas associated with the \fIdaily\fR -configuration\. After you select which holding area to flush, +configuration\&. After you select which holding area to flush, \fBamflush\fR writes the data to tape, updates the databases and sends a mail report similar to -\fBamdump\fR(8)\. +\fBamdump\fR(8)\&. .nf -% amflush daily -Scanning /amanda\-hold\.\.\. - 20001113: found \fIAmanda\fR directory\. - 20001114: found \fIAmanda\fR directory\. +% amflush MyConfig +Scanning /amanda\-hold\&.\&.\&. + 20001113: found \fIAmanda\fR directory\&. + 20001114: found \fIAmanda\fR directory\&. Multiple \fIAmanda\fR directories, please pick one by letter: - A\. 20001113 - B\. 20001114 -Select directories to flush [A\.\.B]: [ALL] all + A\&. 20001113 + B\&. 20001114 +Select directories to flush [A\&.\&.B]: [ALL] all Flushing dumps in 20001113, 20001114, today: 20001117 -to tape drive /dev/rmt/0mn\. -Expecting tape DMP014 or a new tape\. (The last dumps were to tape DMP013) +to tape drive /dev/rmt/0mn\&. +Expecting tape DMP014 or a new tape\&. (The last dumps were to tape DMP013) Are you sure you want to do this? yes -Running in background, you can log off now\. -You\'ll get mail when amflush is finished\. +Running in background, you can log off now\&. +You\'ll get mail when amflush is finished\&. +.fi +.PP +The following example causes amflush to flush everything to tape, then ejects tape, using \'at\' to run the task in the background\&. +.nf +% echo \'amflush \-b \-f MyConfig && mt offline\' | at now .fi .SH "EXIT CODE" @@ -135,18 +300,14 @@ The exit code of \fBamflush\fR is the ORed value of: 8 = Don\'t know the status of a dle (RESULT_MISSING in the report) 16 = tape error or no more tape .fi -.SH "AUTHOR" -.PP -James da Silva, - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBamdump\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amgetconf.8 b/man/amgetconf.8 index 753a845..07e7524 100644 --- a/man/amgetconf.8 +++ b/man/amgetconf.8 @@ -1,171 +1,450 @@ .\" Title: amgetconf -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMGETCONF" "8" "08/22/2008" "" "" +.TH "AMGETCONF" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amgetconf - look up amanda.conf variables -.SH "SYNOPSIS" -.HP 10 -\fBamgetconf\fR [\fIconfig\fR] [\fI\-\-list\fR] \fIparameter\fR [\-o\ \fIconfigoption\fR]... +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amgetconf \- look up configuration parameters and manipulate debug logs +.SH "Synopsis" +.fam C +.HP \w'\fBamgetconf\fR\ 'u +\fBamgetconf\fR [\fI\-l|\-\-list\fR] [\-o\ \fIconfigoption\fR]... [\fI\-\-client\fR] [\fI\-\-execute\-where\ client|server\fR] [\fIconfig\fR] \fIparameter\fR +.fam .SH "DESCRIPTION" .PP \fBAmgetconf\fR -looks up parameters in -\fIamanda\.conf\fR, the -\fIAmanda\fR -configuration file, or from the build and runtime environment, and returns their corresponding value\. +has three main jobs: +to fetch configuration information from the Amanda configuration; to fetch build\-time configuration values; and to open and close debug logs for shell scripts\&. Each is treated in its own subsection, below\&. .PP If \fIconfig\fR is not specified, \fBamgetconf\fR assumes it is being run from the configuration directory and that -\fIamanda\.conf\fR -is present\. -.PP -If +\fIamanda\&.conf\fR +is present\&. The order of options and arguments does not matter\&. \fIparameter\fR -begins with -\fIbuild\.\fR, the (case insensitive) string following the period is a build environment variable\. Variables without a value (e\.g\. -\fIXFSDUMP\fR -on a system that does not support that type of file system) will not report an error and will return an empty string as the value\. Flag variables (e\.g\. -\fIUSE_AMANDAHOSTS\fR) will return -1 -if the flag is set or an empty string if it is not\. +is always case\-insensitive, and \'\-\' and \'_\' are treated as identical, just as in +\fBamanda.conf\fR(5)\&. +.PP +See the "\fBCONFIGURATION OVERRIDE\fR" section in +\fBamanda\fR(8) +for information on the +\FC\-o\F[] +option\&. +.SS "AMANDA CONFIGURATION" .PP If \fIparameter\fR -begins with -\fIdbopen\.\fR, the string following the period is a program name and an -\fIAmanda\fR -debug file will be created for the caller\. The name of the file is returned\. +is a configuration keyword (from +\fBamanda.conf\fR(5)), then amgetconf will return the corresponding value\&. For keywords which can take multiple values, amgetconf will return all values, one on each line\&. +.PP +Values in configuration subsections are specified with parameters of the form +\FCTYPE:NAME:PARAMETER\F[], where +\FCTYPE\F[] +is the subsection type (one of +\FCdumptype\F[], +\FCtapetype\F[], +\FCinterface\F[], +\FCholdingdisk\F[], +\FCapplication\-tool\F[], or +\FCscript\-tool\F[]; +\FCNAME\F[] +is the name of the subsection (e\&.g\&., +\FCuser\-tar\F[]), and +\FCPARAMETER\F[] +is the name of the disired parameter within that subsection\&. +.PP +The +\FC\-\-list\F[] +option lists the subsections of a certain type, where the type is givein as the parameter\&. +.PP +The +\FC\-\-client\F[] +option is equivalent to +\FC\-\-execute\-where server\F[] +(below)\&. +.PP +The +\FC\-\-execute\-where\F[] +option tells amgetconf whether to operate on the client or the server; the server is the default\&. +.SS "BUILD CONFIGURATION" .PP If \fIparameter\fR begins with -\fIdbclose\.\fR, the string following the period is a program name previously used with -\fIdbopen\.\fR, followed by a colon (:) and the previously opened file name\. +\FCbuild\&.\F[], then the following name is a build environment variable\&. Variables without a value (e\&.g\&. +\FCXFSDUMP\F[] +on a system that does not support that type of file system) will not report an error and will return an empty string as the value\&. Some boolean variables (e\&.g\&. +\fIUSE_AMANDAHOSTS\fR) will return +\FC1\F[] +if the flag is set or an empty string if it is not, while others return +\FCyes\F[] +or +\FCno\F[], as indicated below (the difference is historical)\&. .PP -See the -\fBamanda\fR(8) -man page for more details about -\fIAmanda\fR\. -.SH "OPTIONS" +Combining the +\FC\-\-list\F[] +option with the parameter +\FCbuild\F[] +will enumerate all available build parameters\&. +.PP +\fBBuild Parameters\fR .PP -\fB\-\-list\fR +\FCbindir\F[], \FCsbindir\F[], \FClibexecdir\F[], \FCmandir\F[] .RS 4 -The parameter must be \'tapetype\', \'dumptype, \'holdingdisk\' or \'interface\'\. It will output, one by line, the list of identifier for the parameter\. +Install directories +.RE +.PP +\FCAMANDA_TMPDIR\F[], \FCCONFIG_DIR\F[], \FCAMANDA_DBGDIR\F[], \FCGNUTAR_LISTED_INCREMENTAL_DIR\F[] +.RS 4 +Runtime directories +.RE .PP -\-\-list tapetype +\FClisted_inc_dir\F[] .RS 4 -Output the list of tapetype, one by line\. +Same as +\FCGNUTAR_LISTED_INCREMENTAL_DIR\F[] .RE .PP -\-\-list dumptype +\FCCC\F[], \FCVERSION\F[], \FCASSERTIONS\F[], \FCLOCKING\F[], \FCUSE_VERSION_SUFFIXES\F[] .RS 4 -Output the list of dumptype, one by line\. +Build information\&. +\FCASSERTIONS\F[] +is 1 or empty, while +\FCUSE_VERSION_SUFFIXES\F[] +is yes/no\&. .RE .PP -\-\-list holdingdisk +\FCDUMP\F[], \FCRESTORE\F[], \FCVDUMP\F[], \FCVRESTORE\F[], \FCXFSDUMP\F[], \FCXFSRESTORE\F[], \FCVXDUMP\F[], \FCVXRESTORE\F[], \FCSAMBA_CLIENT\F[], \FCGNUTAR\F[], \FCSTAR\F[], \FCCOMPRESS_PATH\F[], \FCUNCOMPRESS_PATH\F[] .RS 4 -Output the list of holdingdisk, one by line\. +Paths to various utility progarms (empty if they are not found or not used) .RE .PP -\-\-list interface +\FCAIX_BACKUP\F[] .RS 4 -Output the list of interface, one by line\. +Is +\FCDUMP\F[] +the AIX backup program? (empty or 1) .RE +.PP +\FCDUMP_RETURNS_1\F[] +.RS 4 +Does +\FCDUMP\F[] +return 1 on success? (empty or 1) .RE .PP -\fBparameter\fR +\FCBSD_SECURITY\F[], \FCBSDUDP_SECURITY\F[], \FCBSDTCP_SECURITY\F[], \FCKRB4_SECURITY\F[], \FCKRB5_SECURITY\F[], \FCSSH_SECURITY\F[], \FCRSH_SECURITY\F[] .RS 4 -It could be one of the below format: +Indicate which authentication mechanisms are available (yes or no)\&. +.RE .PP -runtapes +\FCUSE_AMANDAHOSTS\F[] .RS 4 +Should the "bsd" authentication mechanism use +\FCamandahosts\F[]? (yes or no)\&. .RE .PP -DUMPTYPE:no\-compress:compress +\FCAMANDA_DEBUG_DAYS\F[] .RS 4 +Number of days after which debug logs are deleted\&. .RE .PP -TAPETYPE:HP\-DAT:length +\FCDEFAULT_SERVER\F[], \FCDEFAULT_CONFIG\F[], \FCDEFAULT_TAPE_SERVER\F[], \FCDEFAULT_TAPE_DEVICE\F[] .RS 4 +Default values for configuration parameters .RE .PP -INTERFACE:local:use +\FCCLIENT_LOGIN\F[] .RS 4 +Userid under which the client runs (from +\FC\-\-with\-user\F[])\&. .RE .PP -HOLDINGDISK:hd1:use +\FCUSE_RUNDUMP\F[] .RS 4 +Should Amanda use the +\FCrundump\F[] +wrapper? (empty or 1) .RE +.PP +\FCCHECK_USERID\F[] +.RS 4 +Does Amanda check that userids are correct? (empty or 1) .RE .PP -\fB\-o\fR \fIconfigoption\fR +\FCCOMPRESS_SUFFIX\F[], \FCCOMPRESS_FAST_OPT\F[], \FCCOMPRESS_BEST_OPT\F[], \FCUNCOMPRESS_OPT\F[] .RS 4 -See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +Command\-line options for the compression program\&. .RE -.SH "EXAMPLE" .PP -Find out the path to the log file directory: +\FCTICKET_LIFETIME\F[], \FCSERVER_HOST_PRINCIPAL\F[], \FCSERVER_HOST_INSTANCE\F[], \FCSERVER_HOST_KEY_FILE\F[], \FCCLIENT_HOST_PRINCIPAL\F[], \FCCLIENT_HOST_INSTANCE\F[], \FCCLIENT_HOST_KEY_FILE\F[] +.RS 4 +Kerberos parameters\&. +.RE +.SS "DEBUG LOG MANAGEMENT" +.if n \{\ .sp +.\} .RS 4 +.BM yellow +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +That this application is responsible for debug logs is a +historical quirk, but the functionality is widely used\&..sp .5v +.EM yellow +.RE +.PP +If +\fIparameter\fR +begins with +\fIdbopen\&.\fR, the string following the period is a program name and an +\fIAmanda\fR +debug file will be created for the caller\&. The name of the logfile is returned\&. +.PP +If +\fIparameter\fR +begins with +\fIdbclose\&.\fR, the string following the period is a program name previously used with +\fIdbopen\&.\fR, followed by a colon (:) and the previously opened file name\&. The name of the logfile is returned\&. +.SH "EXAMPLES" +.PP +Find out the path to the log file directory: .nf % amgetconf daily logdir -/usr/local/etc/amanda//daily +/usr/local/etc/amanda/daily/logs .fi -.RE .PP Find out the current tape type: -.sp -.RS 4 .nf % amgetconf daily tapetype DLT4000\-IV .fi -.RE .PP -Find out the default configuration directory: -.sp -.RS 4 +Find out that tape type\'s length: .nf -% amgetconf daily build\.CONFIG_DIR +% amgetconf daily tapetype:DLT4000\-IV:length +1024000 +.fi +.PP +List the other available tapetype: +.nf +% amgetconf daily \-\-list tapetype +DISK +QIC\-60 +DEC\-DLT2000 +\&.\&.\&. +.fi +.PP +Find out the configuration directory: +.nf +% amgetconf build\&.CONFIG_DIR /usr/local/etc/amanda/ .fi -.RE +.PP +List all build\-time parameters +.nf +% amgetconf \-\-list build +AIX_BACKUP +AMANDA_DBGDIR +AMANDA_DEBUG_DAYS +\&.\&.\&. +.fi .PP Create, use and close a debug file in a script: -.sp -.RS 4 .nf -% set debug_file = `amgetconf daily dbopen\.myscript` +% debug_file=`amgetconf daily dbopen\&.myscript` % echo debug information >> $debug_file -% amgetconf daily dbclose\.myscript:$debug_file +% amgetconf daily dbclose\&.myscript:$debug_file .fi -.RE -.sp .SH "MESSAGES" .PP amgetconf: no such parameter \fIparam\fR .RS 4 Parameter \fIparam\fR -is not a known keyword (e\.g\. not a valid -\fIamanda\.conf\fR -keyword)\. +is not a known keyword (e\&.g\&. not a valid +\fIamanda\&.conf\fR +keyword)\&. .RE .SH "SEE ALSO" .PP \fBamanda\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amgpgcrypt.8 b/man/amgpgcrypt.8 index ad36e69..94c993c 100644 --- a/man/amgpgcrypt.8 +++ b/man/amgpgcrypt.8 @@ -1,20 +1,178 @@ .\" Title: amgpgcrypt -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMGPGCRYPT" "8" "08/22/2008" "" "" +.TH "AMGPGCRYPT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amgpgcrypt - reference crypt program for Amanda public-key data encryption -.SH "SYNOPSIS" -.HP 11 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amgpgcrypt \- reference crypt program for \fIAmanda\fR public\-key data encryption +.SH "Synopsis" +.fam C +.HP \w'\fBamgpgcrypt\fR\ 'u \fBamgpgcrypt\fR to be called by \fIAmanda\fR only +.fam .SH "DESCRIPTION" .PP @@ -23,59 +181,59 @@ calls \fBgpg\fR to perform public\-key data encryption on \fIAmanda\fR -backup\. +backup\&. \fBamgpgcrypt\fR will search for the gpg program in the following directories: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin .PP \fBamgpgcrypt\fR -sets GNUPGHOME to $AMANDA_HOME/\.gnupg where gpg will look for the gpg keys\. +sets GNUPGHOME to $AMANDA_HOME/\&.gnupg where gpg will look for the gpg keys\&. \fBamgpgcrypt\fR uses the public key to encrypt the \fIAmanda\fR data and uses the private key to decrypt the \fIAmanda\fR -backup data\. Thus, passphrase is only required at the time of data restore\. -.SH "KEY AND PASSPHRASE" +backup data\&. Thus, passphrase is only required at the time of data restore\&. +.SH "Key and Passphrase" .PP \fBamgpgcrypt\fR uses the private key to decrypt \fIAmanda\fR -backup data\. +backup data\&. It is very important to store, manage and protect the key and the passphrase -properly\. Encrypted backup data can \fBonly\fR be recovered with the correct key and -passphrase\. -.SH "HOW TO CREATE ENCRYPTION KEYS AND PASSPHRASE FOR AMGPGCRYPT" +properly\&. Encrypted backup data can \fBonly\fR be recovered with the correct key and +passphrase\&. +.SH "How to create encryption keys and Passphrase for amgpgcrypt" .PP Store the passphrase that you used in following "gpg \-\-gen\-key" command inside the home\-directory of the AMANDA\-user($amanda_user) and protect it with proper permissions: - echo my_secret_passphrase > ~$amanda_user/\.am_passphrase - chown $amanda_user:disk ~$amanda_user/\.am_passphrase - chmod 700 ~$amanda_user/\.am_passphrase + echo my_secret_passphrase > ~$amanda_user/\&.am_passphrase + chown $amanda_user:disk ~$amanda_user/\&.am_passphrase + chmod 700 ~$amanda_user/\&.am_passphrase .PP -Run "gpg \-\-gen\-key"\. Below is an example: +Run "gpg \-\-gen\-key"\&. Below is an example: .nf $ gpg \-\-gen\-key -gpg (GnuPG) 1\.2\.6; Copyright (C) 2004 Free Software Foundation, Inc\. -This program comes with ABSOLUTELY NO WARRANTY\. +gpg (GnuPG) 1\&.2\&.6; Copyright (C) 2004 Free Software Foundation, Inc\&. +This program comes with ABSOLUTELY NO WARRANTY\&. This is free software, and you are welcome to redistribute it -under certain conditions\. See the file COPYING for details\. +under certain conditions\&. See the file COPYING for details\&. Please select what kind of key you want: (1) DSA and ElGamal (default) (2) DSA (sign only) (4) RSA (sign only) Your selection? 1 -DSA keypair will have 1024 bits\. -About to generate a new ELG\-E keypair\. +DSA keypair will have 1024 bits\&. +About to generate a new ELG\-E keypair\&. minimum keysize is 768 bits default keysize is 1024 bits highest suggested keysize is 2048 bits What keysize do you want? (1024) Requested keysize is 1024 bits -Please specify how long the key should be valid\. +Please specify how long the key should be valid\&. 0 = key does not expire (n) = key expires in n days (n)w = key expires in n weeks @@ -87,7 +245,7 @@ Is this correct (y/n)? y You need a User\-ID to identify your key; the software constructs the user id from Real Name, Comment and Email Address in this form: - "Heinrich Heine (Der Dichter) (heinrichh@duesseldorf\.de)" + "Heinrich Heine (Der Dichter) (heinrichh@duesseldorf\&.de)" Real name: amandabackup Email address: @@ -96,52 +254,49 @@ You selected this USER\-ID: "amandabackup (gpg keys for amandabackup)" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o -You need a Passphrase to protect your secret key\. +You need a Passphrase to protect your secret key\&. -We need to generate a lot of random bytes\. It is a good idea to perform +We need to generate a lot of random bytes\&. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number -generator a better chance to gain enough entropy\. +generator a better chance to gain enough entropy\&. -We need to generate a lot of random bytes\. It is a good idea to perform +We need to generate a lot of random bytes\&. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number -generator a better chance to gain enough entropy\. +generator a better chance to gain enough entropy\&. -public and secret key created and signed\. -key marked as ultimately trusted\. +public and secret key created and signed\&. +key marked as ultimately trusted\&. pub 1024D/4417A8CB 2006\-02\-07 amandabackup (gpg keys for amandabackup) Key fingerprint = 139C 6369 44FC 7F1A 655C E5E9 7EAA 515A 4417 A8CB sub 1024g/8C3A6A78 2006\-02\-07 [expires: 2006\-08\-06] .fi -.SH "FILES" +.SH "Files" .PP -\fB$AMANDA_HOME/\.gnupg/pubring\.gpg\fR +\fB$AMANDA_HOME/\&.gnupg/pubring\&.gpg\fR .RS 4 -The public key\. +The public key\&. \fBamgpgcrypt\fR -encrypt data with this public key along with the cipher algorithm\. +encrypt data with this public key along with the cipher algorithm\&. .RE .PP -\fB$AMANDA_HOME/\.gnupg/secring\.gpg\fR +\fB$AMANDA_HOME/\&.gnupg/secring\&.gpg\fR .RS 4 -The private/secret key\. It\'s only needed during amrecover/amrestore\. Store and protect it properly during other time\. +The private/secret key\&. It\'s only needed during amrecover/amrestore\&. Store and protect it properly during other time\&. .RE .PP -\fB$AMANDA_HOME/\.am_passphrase\fR +\fB$AMANDA_HOME/\&.am_passphrase\fR .RS 4 -The passphrase\. It\'s only needed during amrecover/amrestore\. Store and protect it properly during other time\. +The passphrase\&. It\'s only needed during amrecover/amrestore\&. Store and protect it properly during other time\&. .RE .SH "BUGS" .PP \fIAmanda\fR -has problem with gpg mdc(modification detection code) in the binary mode\. +has problem with gpg mdc(modification detection code) in the binary mode\&. \fBamgpgcrypt\fR calls gpg with mdc disabled -.SH "AUTHOR" -.PP -The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\. .SH "SEE ALSO" .PP @@ -151,3 +306,9 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBamrestore\fR(8), \fBgpg\fR(1), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amgtar.8 b/man/amgtar.8 new file mode 100644 index 0000000..1a03bcd --- /dev/null +++ b/man/amgtar.8 @@ -0,0 +1,302 @@ +.\" Title: amgtar +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMGTAR" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amgtar \- Amanda Application to interface with GNU Tar +.SH "DESCRIPTION" +.PP +Amgtar is an +\fIAmanda\fR +Application API script\&. It should not be run by users directly\&. It uses GNU Tar to backup and restore data\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control amgtar\'s functionality\&. See +\fBamanda-applications\fR(7) +for information on application properties and how they are configured\&. +.PP +ATIME\-PRESERVE +.RS 4 + +If "YES" (the default), amgtar use the \fI\-\-atime\-preserve=system\fR option of gnutar to not update the atime of all files accessed; if "NO", gnutar will updates the atime for all files accessed\&. This property works only if you have gnutar 1\&.15\&.90 or newer, if not, you must set ATIME_PRESERVE to "NO"\&. +.RE +.PP +CHECK\-DEVICE +.RS 4 + +If "YES" (the default), amgtar checks that the device number doesn\'t change for each file\&. If "NO", changes in device number are ignored\&. To ignore device numbers, tar must support the \fI\-\-no\-check\-device\fR option (gnutar 1\&.19\&.90 and newer)\&. This option is needed for some filesystems and devices on which device numbers change frequently, such as LVM or FiberChannel\&. +.RE +.PP +DIRECTORY +.RS 4 + +If set, gnutar will backup from that directory instead of the \fIdiskdevice\fR set by the DLE\&. +.RE +.PP +GNUTAR\-LISTDIR +.RS 4 + +The directory where gnutar stores the database it uses to generate incremental dumps\&. The default is set when \fIAmanda\fR is built\&. +.RE +.PP +GNUTAR\-PATH +.RS 4 + +The path to the gnutar binary\&. The default is set when \fIAmanda\fR is built\&. +.RE +.PP +ONE\-FILE\-SYSTEM +.RS 4 + +If "YES" (the default), do not allow gnutar to cross filesystem boundaries\&. If "NO", gnutar will cross filesystem boundaries\&. This corresponds to the \fI\-\-one\-filesystem\fR option of gnutar\&. +.RE +.PP +TAR\-BLOCKSIZE +.RS 4 + +Block size of Nx512 bytes (default N=20)\&. This corresponds to the \fI\-\-blocking\-factor\fR option of gnutar\&. +.RE +.PP +SPARSE +.RS 4 + +If "YES" (the default), gnutar will store sparse files efficiently\&. If "NO", then the \fI\-\-sparse\fR option is not given to gnutar, and it will not try to detect sparse files\&. +.RE +.PP +EXIT\-HANDLING +.RS 4 + +List which exit status of gtar are good or bad\&. eg\&. "1=GOOD 2=BAD", exit status of 1 will produce a good backup, exit status of 2 will give an error\&. +.RE +.PP +NORMAL +.RS 4 + +List all regex (POSIX Extended Regular Expression syntax) that are normal output from gtar\&. These output are in the "FAILED DUMP DETAILS" section of the email report if the dump result is STRANGE or FAILED\&. Default values: +.nf + "^could not open conf file" + "^Elapsed time:" + "^Throughput" + ": socket ignored$" + ": File \&.* shrunk by [0\-9][0\-9]* bytes, padding with zeros" + ": Cannot add file \&.*: No such file or directory$" + ": Error exit delayed from previous errors" +.fi +To treat one of these default patterns differently, specify it explicitly in a different property\&. +.RE +.PP +IGNORE +.RS 4 + +List all regex (POSIX Extended Regular Expression syntax) that amanda ignore\&. These output are never in the email report\&. Default values: +.nf + ": Directory is new$" + ": Directory has been renamed" +.fi +To treat one of these default patterns differently, specify it explicitly in a different property\&. +.RE +.PP +STRANGE +.RS 4 + +List all regex (POSIX Extended Regular Expression syntax) that are strange output from gtar\&. All gtar output that doesn\'t match a normal or ignore regex are strange by default\&. The result of the dump is STRANGE if gtar produce a strange output\&. These output are in the "FAILED DUMP DETAILS" section of the email report\&. +.RE +.SH "EXAMPLE" +.nf + define application\-tool app_amgtar { + property "ATIME\-PRESERVE" "NO" + property "CHECK\-DEVICE" "YES" + property "GNUTAR\-LISTDIR" " + property "GNUTAR\-PATH" "/bin/tar" + property "ONE\-FILE\-SYSTEM" "YES" + property "TAR_BLOCKSIZE" "20" + property "SPARSE" "YES" + property "EXIT\-HANDLING" "1=GOOD 2=BAD" + # change a default NORMAL regex to a STRANGE regex\&. + property "STRANGE" ": socket ignored$" + # add three new IGNORE regex + property "IGNORE" ": Directory is new$" + property append "IGNORE" ": Directory has been renamed" + property append "IGNORE" "file changed as we read it$" + } +.fi +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-applications\fR(7) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amlabel.8 b/man/amlabel.8 index f57e013..918f270 100644 --- a/man/amlabel.8 +++ b/man/amlabel.8 @@ -1,78 +1,236 @@ .\" Title: amlabel -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMLABEL" "8" "08/22/2008" "" "" +.TH "AMLABEL" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amlabel - label an Amanda tape -.SH "SYNOPSIS" -.HP 8 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amlabel \- label an \fIAmanda\fR tape +.SH "Synopsis" +.fam C +.HP \w'\fBamlabel\fR\ 'u \fBamlabel\fR [\-f] \fIconfig\fR \fIlabel\fR [slot\ \fIslot\fR] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP All \fIAmanda\fR -tapes must be pre\-labeled before they are used\. +tapes must be pre\-labeled before they are used\&. \fIAmanda\fR verifies the label in \fBamdump\fR and \fBamflush\fR -before writing to make sure the proper tape is loaded\. +before writing to make sure the proper tape is loaded\&. .PP \fBAmlabel\fR writes an \fIAmanda\fR label on the tape in the device specified by the -\fIamanda\.conf\fR -file in /usr/local/etc/amanda/\fIconfig\fR\. +\fIamanda\&.conf\fR +file in /usr/local/etc/amanda/\fIconfig\fR\&. \fILabel\fR may be any string that does not contain whitespace and that matches the -\fIamanda\.conf\fR +\fIamanda\&.conf\fR \fBlabelstr\fR -regular expression option\. It is up to the system administrator to define a naming convention\. +regular expression option\&. It is up to the system administrator to define a naming convention\&. .PP \fBAmlabel\fR appends the new tape to the -\fItapelist\fR +\fBtapelist\fR(5) file so it will be used by \fIAmanda\fR -before it reuses any other tapes\. When you +before it reuses any other tapes\&. When you \fBamlabel\fR multiple tapes, they will be used in the order you \fBamlabel\fR -them\. +them\&. .PP \fBAmlabel\fR will not write the label if the tape contains an active \fIAmanda\fR -tape or if the label specified is on an active tape\. The +tape or if the label specified is on an active tape\&. The \fB\-f\fR -(force) flag bypasses these verifications\. +(force) flag bypasses these verifications\&. .PP An optional \fIslot\fR -may be specified after the tape label\. If a tape changer is in use, +may be specified after the tape label\&. If a tape changer is in use, \fBamlabel\fR -will label the tape in the specified slot instead of the currently loaded tape\. +will label the tape in the specified slot instead of the currently loaded tape\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "EXAMPLE" .PP @@ -80,7 +238,7 @@ Write an \fIAmanda\fR label with the string "DMP000" on the tape loaded in the device named in the \fBtapedev\fR -option in /usr/local/etc/amanda/daily/amanda\.conf: +option in /usr/local/etc/amanda/daily/amanda\&.conf: .nf % amlabel daily DMP000 .fi @@ -100,7 +258,7 @@ on the command line does not match the regular expression \fIstr\fR from -\fIamanda\.conf\fR\. +\fIamanda\&.conf\fR\&. .RE .PP label \fIlabel\fR already on a tape @@ -109,7 +267,7 @@ Label \fIlabel\fR is already listed as an active \fIAmanda\fR -tape\. +tape\&. .RE .PP no tpchanger specified in \fIpath\fR , so slot command invalid @@ -117,10 +275,10 @@ no tpchanger specified in \fIpath\fR , so slot command invalid The command line has the \fBslot\fR parameter but the -\fIamanda\.conf\fR +\fIamanda\&.conf\fR file in \fIpath\fR -does not have a tape changer configured\. +does not have a tape changer configured\&. .RE .PP reading label \fIlabel\fR, tape is in another amanda configuration @@ -131,7 +289,7 @@ tape, but label does not match \fBlabelstr\fR for this configuration so it is probably part of a different \fIAmanda\fR -configuration\. +configuration\&. .RE .PP reading label \fIlabel\fR, tape is active @@ -140,7 +298,7 @@ Tape \fIlabel\fR appears to already be part of this \fIAmanda\fR -configuration and active, i\.e\. has valid data on it\. +configuration and active, i\&.e\&. has valid data on it\&. .RE .PP no label found, are you sure \fItape\fR is non\-rewinding? @@ -150,19 +308,16 @@ While checking that the label was written correctly, got an error that might be caused by mis\-configuring \fIAmanda\fR with a rewinding tape device name instead of a non\-rewinding device name for -\fItape\.\fR +\fItape\&.\fR .RE -.SH "AUTHOR" -.PP -James da Silva, -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBamdump\fR(8), \fBamflush\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/ammt.8 b/man/ammt.8 deleted file mode 100644 index 1283e23..0000000 --- a/man/ammt.8 +++ /dev/null @@ -1,183 +0,0 @@ -.\" Title: ammt -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: -.\" -.TH "AMMT" "8" "08/22/2008" "" "" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -ammt - Amanda version of mt -.SH "SYNOPSIS" -.HP 5 -\fBammt\fR [\-d] [\-f | \-t | \fIdevice\fR] \fIcommand\fR [\fIcount\fR] -.SH "DESCRIPTION" -.PP -\fBAmmt\fR -provides just enough of the standard UNIX -\fBmt\fR -command for the needs of -\fIAmanda\fR\. This is handy when doing a full restore and the standard -\fBmt\fR -program has not yet been found\. -.PP -\fBAmmt\fR -also provides access to the -\fIAmanda\fR -output drivers that support various tape simulations\. -.PP -See the -\fBamanda\fR(8) -man page for more details about -\fIAmanda\fR\. See the -\fBOUTPUT DRIVERS\fR -section of -\fIamanda(8)\fR -for more information on the -\fIAmanda\fR -output drivers\. -.SH "OPTIONS" -.PP -\fB\-d\fR -.RS 4 -Turn on debugging output\. -.RE -.PP -\fB\-f\fR\fI device\fR -.RS 4 -Access tape device -\fIdevice\fR\. If not specified, the -\fBTAPE\fR -environment variable is used\. -.RE -.PP -\fB\-t\fR\fI device\fR -.RS 4 -Same as -\fB\-f\fR\. -.RE -.PP -\fBcommand\fR\fI count\fR -.RS 4 -Which command to issue, and an optional count of operations\. -.RE -.SH "COMMANDS" -.PP -Each command may be abbreviated to whatever length makes it unique\. -.PP -\fBeof|weof\fR\fI count\fR -.RS 4 -Write -\fIcount\fR -(default: 1) end of file marks (tapemarks)\. -.RE -.PP -\fBfsf\fR\fI count\fR -.RS 4 -Skip forward -\fIcount\fR -(default: 1) files\. -.RE -.PP -\fBbsf\fR\fI count\fR -.RS 4 -Skip backward -\fIcount\fR -(default: 1) files\. -.RE -.PP -\fBasf\fR\fI count\fR -.RS 4 -Position to file number -\fIcount\fR -(default: 0) where zero is beginning of tape\. This is the same as a -\fBrewind\fR -followed by a -\fBfsf\fR -\fIcount\fR\. -.RE -.PP -\fBrewind\fR -.RS 4 -Rewind to beginning of tape\. -.RE -.PP -\fBoffline|rewoffl\fR -.RS 4 -Rewind to beginning of tape and unload the tape from the drive\. -.RE -.PP -\fBstatus\fR -.RS 4 -Report status information about the drive\. Which data reported, and what it means, depends on the underlying operating system, and may include: -.PP -ONLINE -.RS 4 -Indicates the drive is online and ready\. -.RE -.PP -OFFLINE -.RS 4 -Indicates the drive is offline or not ready\. -.RE -.PP -BOT -.RS 4 -Indicates the drive is at beginning of tape\. -.RE -.PP -EOT -.RS 4 -Indicates the drive is at end of tape\. -.RE -.PP -PROTECTED -.RS 4 -Indicates the tape is write protected\. -.RE -.PP -ds -.RS 4 -Device status\. -.RE -.PP -er -.RS 4 -Error register\. -.RE -.PP -fileno -.RS 4 -Current tape file number\. -.RE -.PP -blkno -.RS 4 -Current tape block number file\. -.RE -.RE -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -Note -.PP -Many systems only report good data when a tape is in the drive and ready\. -.SH "AUTHOR" -.PP -Marc Mengel -, John R\. Jackson -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion -.SH "SEE ALSO" -.PP -\fBamanda\fR(8), -: http://wiki.zmanda.com diff --git a/man/amoverview.8 b/man/amoverview.8 index 4ba2aaa..f6296c6 100644 --- a/man/amoverview.8 +++ b/man/amoverview.8 @@ -1,38 +1,196 @@ .\" Title: amoverview -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Stefan G. Weichinger +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMOVERVIEW" "8" "08/22/2008" "" "" +.TH "AMOVERVIEW" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amoverview - display file systems processed by Amanda over time -.SH "SYNOPSIS" -.HP 11 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amoverview \- display file systems processed by \fIAmanda\fR over time +.SH "Synopsis" +.fam C +.HP \w'\fBamoverview\fR\ 'u \fBamoverview\fR [[\-config\ ]\ \fIconfig\fR] [\-hostwidth\ \fIwidth\fR] [\-diskwidth\ \fIwidth\fR] [\-skipmissed] [\-last] [\-num0] [\-togo0] [\-verbose] +.fam .SH "DESCRIPTION" .PP \fBAmoverview\fR displays a chart showing hosts and file systems processed by \fIAmanda\fR -along with the backup level performed each day\. +along with the backup level performed each day\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-config\fR \fIconfig\fR .RS 4 Use configuration \fIconfig\fR -instead of configuration daily\. +instead of configuration daily\&. .RE .PP \fB\-hostwidth\fR \fIwidth\fR @@ -41,7 +199,7 @@ Set \fBhost\fR field column width to \fIwidth\fR -characters instead of 8\. +characters instead of 8\&. .RE .PP \fB\-diskwidth\fR \fIwidth\fR @@ -50,59 +208,59 @@ Set \fBdisk\fR field column width to \fIwidth\fR -characters instead of 20\. +characters instead of 20\&. .RE .PP \fB\-skipmissed\fR .RS 4 Compacts the output by only printing stats for the days \fIAmanda\fR -actually ran\. +actually ran\&. .RE .PP \fB\-last\fR .RS 4 -Outputs the last status of each disk at the start\. Useful for long tapecycles and/or sparse reports\. +Outputs the last status of each disk at the start\&. Useful for long tapecycles and/or sparse reports\&. .RE .PP \fB\-num0\fR .RS 4 -Outputs the number of level 0 dumps for each disk\. +Outputs the number of level 0 dumps for each disk\&. .RE .PP \fB\-togo0\fR .RS 4 -Outputs the number of runs until the last level 0 dump is overwritten\. +Outputs the number of runs until the last level 0 dump is overwritten\&. .RE .PP \fB\-verbose\fR .RS 4 \fBAmoverview\fR -can take a long while on large systems\. This option reports intermediate steps while it is working\. +can take a long while on large systems\&. This option reports intermediate steps while it is working\&. .RE .SH "RESULTS" .PP \fBamoverview\fR is a summary of the output of " \fBamadmin find\fR -"\. When the last column of +"\&. When the last column of \fBamadmin find\fR -contains anything other than "OK", amoverview translates this into "E" for that day\. +contains anything other than "OK", amoverview translates this into "E" for that day\&. .PP -A number indicates the level of backup and it succeeded\. An "E" indicates an error for that day\. You get an "E" for all errors, like failed to connect, datatimeout, computer crashed, etc, but also for failing to write to tape\. +A number indicates the level of backup and it succeeded\&. An "E" indicates an error for that day\&. You get an "E" for all errors, like failed to connect, datatimeout, computer crashed, etc, but also for failing to write to tape\&. .PP -You can have an "E" followed by a number if a filesystem ran into end\-of\-tape once (gives an "E", and later that day, you flush it to a second tape (a number: the level, indicating success)\. If the flush failed too, you get a double "EE" for that day\. +You can have an "E" followed by a number if a filesystem ran into end\-of\-tape once (gives an "E", and later that day, you flush it to a second tape (a number: the level, indicating success)\&. If the flush failed too, you get a double "EE" for that day\&. .PP You can also have a double code if you have two tapes in the changer and \fIAmanda\fR -failed to write to tape the first time because it hit end of tape (resulting in "E0", for a full, "E1" for an incremental etc\.) or twice with error ("EE"), and may a successful flush afterwards giving maybe "EE0"\. (Only the latest 2 characters are printed)\. +failed to write to tape the first time because it hit end of tape (resulting in "E0", for a full, "E1" for an incremental etc\&.) or twice with error ("EE"), and may a successful flush afterwards giving maybe "EE0"\&. (Only the latest 2 characters are printed)\&. .SH "EXAMPLE" .PP This shows the -\fI/home\fR +\FC/home\F[] file system on \fIhost2\fR -was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th\. +was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th\&. .nf # amoverview date 12 12 12 12 12 12 @@ -120,3 +278,6 @@ host2 /var 1 1 0 1 1 1 \fBamadmin\fR(8), \fBamanda\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amplot.8 b/man/amplot.8 index 6da1ecf..54f8434 100644 --- a/man/amplot.8 +++ b/man/amplot.8 @@ -1,22 +1,180 @@ .\" Title: amplot -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Olafur Gudmundsson +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMPLOT" "8" "08/22/2008" "" "" +.TH "AMPLOT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amplot - visualize the behavior of Amanda -.SH "SYNOPSIS" -.HP 7 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amplot \- visualize the behavior of \fIAmanda\fR +.SH "Synopsis" +.fam C +.HP \w'\fBamplot\fR\ 'u \fBamplot\fR [\-b] [\-c] [\-e] [\-g] [\-l] [\-p] [\-t\ \fIT\fR] \fIamdump_files\fR .br +.fam .SH "DESCRIPTION" .PP \fBAmplot\fR @@ -24,85 +182,85 @@ reads an \fBamdump\fR output file that \fIAmanda\fR -generates each run (e\.g\. -\fIamdump\.1\fR) and translates the information into a picture format that may be used to determine how your installation is doing and if any parameters need to be changed\. +generates each run (e\&.g\&. +\fIamdump\&.1\fR) and translates the information into a picture format that may be used to determine how your installation is doing and if any parameters need to be changed\&. \fBAmplot\fR also prints out \fBamdump\fR -lines that it either does not understand or knows to be warning or error lines and a summary of the start, end and total time for each backup image\. +lines that it either does not understand or knows to be warning or error lines and a summary of the start, end and total time for each backup image\&. .PP \fBAmplot\fR is a shell script that executes an \fBawk\fR program -(\fIamplot\.awk\fR) to scan the +(\fIamplot\&.awk\fR) to scan the \fBamdump\fR -output file\. It then executes a +output file\&. It then executes a \fBgnuplot\fR program -(\fIamplot\.g\fR) to generate the graph\. The +(\fIamplot\&.g\fR) to generate the graph\&. The \fBawk\fR program is written in an enhanced version of awk, such as GNU awk (\fIgawk\fR -version 2\.15 or later) or -\fBnawk\fR\. +version 2\&.15 or later) or +\fBnawk\fR\&. .PP During execution, \fBamplot\fR generates a few temporary files that \fBgnuplot\fR -uses\. These files are deleted at the end of execution\. +uses\&. These files are deleted at the end of execution\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-b\fR .RS 4 Generate b/w postscript file (need -\fB\-p\fR)\. +\fB\-p\fR)\&. .RE .PP \fB\-c\fR .RS 4 Compress \fIamdump_files\fR -after plotting\. +after plotting\&. .RE .PP \fB\-e\fR .RS 4 -Extend the X (time) axis if needed\. +Extend the X (time) axis if needed\&. .RE .PP \fB\-g\fR .RS 4 Direct \fIgnuplot\fR -output directly to the X11 display (default)\. +output directly to the X11 display (default)\&. .RE .PP \fB\-p\fR .RS 4 Direct postscript output to file -\fIYYYYMMDD\fR\fI\.ps\fR +\fIYYYYMMDD\fR\fI\&.ps\fR (opposite of -\fB\-g\fR)\. +\fB\-g\fR)\&. .RE .PP \fB\-l\fR .RS 4 Generate landscape oriented output (needs -\fB\-p\fR)\. +\fB\-p\fR)\&. .RE .PP \fB\-t \fR\fIT\fR .RS 4 Set the right edge of the plot to be \fIT\fR -hours\. +hours\&. .RE .PP The @@ -111,43 +269,35 @@ may be in various compressed formats (\fIcompress\fR, \fBgzip\fR, \fBpact\fR, -\fBcompact\fR)\. +\fBcompact\fR)\&. .SH "INTERPRETATION" .PP -The figure is divided into a number of regions\. There are titles on the top that show important statistical information about the configuration and from this execution of -\fBamdump\fR\. In the figure, the X axis is time, with 0 being the moment +The figure is divided into a number of regions\&. There are titles on the top that show important statistical information about the configuration and from this execution of +\fBamdump\fR\&. In the figure, the X axis is time, with 0 being the moment \fBamdump\fR -was started\. The Y axis is divided into 5 regions: +was started\&. The Y axis is divided into 5 regions: .PP \fIQUEUES:\fR -How many backups have not been started, how many are waiting on space in the holding disk and how many have been transferred successfully to tape\. +How many backups have not been started, how many are waiting on space in the holding disk and how many have been transferred successfully to tape\&. .PP \fI%BANDWIDTH:\fR -Percentage of allowed network bandwidth in use\. +Percentage of allowed network bandwidth in use\&. .PP \fIHOLDING DISK:\fR -The higher line depicts space allocated on the holding disk to backups in progress and completed backups waiting to be written to tape\. The lower line depicts the fraction of the holding disk containing completed backups waiting to be written to tape including the file currently being written to tape\. The scale is percentage of the holding disk\. +The higher line depicts space allocated on the holding disk to backups in progress and completed backups waiting to be written to tape\&. The lower line depicts the fraction of the holding disk containing completed backups waiting to be written to tape including the file currently being written to tape\&. The scale is percentage of the holding disk\&. .PP \fITAPE:\fR -Tape drive usage\. +Tape drive usage\&. .PP \fI%DUMPERS:\fR -Percentage of active dumpers\. +Percentage of active dumpers\&. .PP The idle period at the left of the graph is time \fBamdump\fR -is asking the machines how much data they are going to dump\. This process can take a while if hosts are down or it takes them a long time to generate estimates\. -.SH "AUTHOR" -.PP -Olafur Gudmundsson -, Trusted Information Systems, formerly at University of Maryland, College Park: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +is asking the machines how much data they are going to dump\&. This process can take a while if hosts are down or it takes them a long time to generate estimates\&. .SH "BUGS" .PP -Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about\. +Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -160,3 +310,11 @@ Reports lines it does not recognize, mainly error cases but some are legitimate \fBcompress\fR(1), \fBgzip\fR(1), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBOlafur Gudmundsson\fR <\&ogud@tis\&.com\&> +.RS 4 +Trusted Information Systems +.RE +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amrecover.8 b/man/amrecover.8 index 01608fb..4a11392 100644 --- a/man/amrecover.8 +++ b/man/amrecover.8 @@ -1,123 +1,328 @@ .\" Title: amrecover -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Alan M. McIvor +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMRECOVER" "8" "08/22/2008" "" "" +.TH "AMRECOVER" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amrecover - Amanda index database browser -.SH "SYNOPSIS" -.HP 10 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amrecover \- \fIAmanda\fR index database browser +.SH "Synopsis" +.fam C +.HP \w'\fBamrecover\fR\ 'u \fBamrecover\fR [\-C\ \fIconfig\fR] [\-s\ \fIindex\-server\fR] [\-t\ \fItape\-server\fR] [\-d\ \fItape\-device\fR] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmrecover\fR browses the database of \fIAmanda\fR -index files to determine which tapes contain files to recover\. Furthermore, it is able to recover files\. +index files to determine which tapes contain files to recover\&. Furthermore, it is able to recover files\&. .PP In order to restore files in place, you must invoke \fBamrecover\fR from the root of the backed up filesystem, or use \fBlcd\fR -to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory\. See the examples below for details\. +to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory\&. See the examples below for details\&. .PP Amrecover will read the -\fBamanda\-client\.conf\fR +\fBamanda\-client\&.conf\fR file and the -\fIconfig\fR\fB/amanda\-client\.conf\fR -file\. +\fIconfig\fR\fB/amanda\-client\&.conf\fR +file\&. If no configuration name is supplied on the command line, Amrecover will try the compiled\-in default configuration ,usually +\fBDailySet1\fR\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" +.if n \{\ .sp +.\} +.RS 4 +.BM yellow .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br -Note +.ps +1 +\fBNote\fR +.ps -1 +.br .PP -The Default values are those set at compile\-time\. Use +The Default values are those set at compile\-time\&. Use \fBamrestore\fR -to recover client\-encrypted or client\-custom\-compressed tapes\. +to recover client\-encrypted or client\-custom\-compressed tapes\&. +.sp .5v +.EM yellow +.RE .PP \fB[ \-C ] config\fR .RS 4 \fIAmanda\fR -configuration\. +configuration\&. .RE .PP \fB\-s index\-server\fR .RS 4 -Host that runs the index daemon\. +Host that runs the index daemon\&. .RE .PP \fB\-t tape\-server\fR .RS 4 -Host that runs the tape server daemon\. +Host that runs the tape server daemon\&. .RE .PP \fB\-d tape\-device\fR .RS 4 -Tape device to use on the tape server host\. +Tape device to use on the tape server host\&. .RE .PP \fB\-o\fR \fIclientconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "COMMANDS" .PP \fBAmrecover\fR -connects to the index server and then presents a command line prompt\. Usage is similar to an ftp client\. The GNU readline library is used to provide command line history and editing if it was built in to -\fBamrecover\fR\. +connects to the index server and then presents a command line prompt\&. Usage is similar to an ftp client\&. The GNU readline library is used to provide command line history and editing if it was built in to +\fBamrecover\fR\&. .PP The purpose of browsing the database is to build up a \fIrestore list\fR -of files to be extracted from the backup system\. The following commands are available: +of files to be extracted from the backup system\&. The following commands are available: .PP \fBsethost hostname\fR .RS 4 -Specifies which host to look at backup files for (default: the local host)\. +Specifies which host to look at backup files for (default: the local host)\&. .RE .PP \fBsetdate YYYY\-MM\-DD\-HH\-MM[\-SS] | YYYY\-MM\-DD\fR .RS 4 -Set the restore time (default: now)\. File listing commands only return information on backup images for this day, for the day before with the next lower dump level, and so on, until the most recent level 0 backup on or before the specified date is encountered\. +Set the restore time (default: now)\&. File listing commands only return information on backup images for this day, for the day before with the next lower dump level, and so on, until the most recent level 0 backup on or before the specified date is encountered\&. .sp For example, if: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + 1996\-07\-01 was a level 0 backup 1996\-07\-02 through 1996\-07\-05 were level 1 backups 1996\-07\-06 through 1997\-07\-08 were level 2 backups +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .sp then the command \fBsetdate 1997\-07\-08\-00\fR would yield files from the following days: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + 1997\-07\-08 (the latest level 2 backup) 1997\-07\-05 (the latest level 1 backup) 1997\-07\-01 (the latest level 0 backup) +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .sp -Only the most recent version of a file will be presented\. +Only the most recent version of a file will be presented\&. .sp The following abbreviated date specifications are accepted: .PP @@ -136,16 +341,15 @@ dates in the current month of the current year .RS 4 Specifies which disk to consider (default: the disk holding the working directory where \fBamrecover\fR -is started)\. It can only be set after the host is set with -\fBsethost\fR\. +is started)\&. It can only be set after the host is set with +\fBsethost\fR\&. \fIDiskname\fR is the device name specified in the -\fIamanda\.conf\fR +\fIamanda\&.conf\fR or -\fIdisklist\fR -configuration file\. The disk must be local to the host\. If +\fBdisklist\fR(5)\&. The disk must be local to the host\&. If \fImountpoint\fR -is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames\. +is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames\&. .RE .PP \fBlisthost\fR [\fIdiskdevice\fR] @@ -162,15 +366,15 @@ List all .PP \fBsetdevice\fR [[\-h \fItape\-server\fR] \fItapedev\fR] .RS 4 -Specifies the host to use as the tape server, and which of its tape devices to use\. If the server is omitted, the server name reverts to the configure\-time default\. If the tape device is omitted, the default is used\. +Specifies the host to use as the tape server, and which of its tape devices to use\&. If the server is omitted, the server name reverts to the configure\-time default\&. If the tape device is omitted, the default is used\&. .sp If you want amrecover to use your changer, the \fItapedev\fR -must be equal to the amrecover_changer setting on the server\. +must be equal to the amrecover_changer setting on the server\&. .sp -If you need to change the protocol (tape:, rait:, file:, null:) then you must specify the hostname\. +Since device names contain colons, you must always specify the hostname\&. .nf -settape 192\.168\.0\.10:file:/file1 +settape 192\&.168\&.0\&.10:file:/file1 .fi You can change the tape device when amrecover ask you to load the tape: .nf @@ -178,58 +382,58 @@ Load tape DMP014 now Continue? [Y/n/t]: t Tape device: server2:/dev/nst2 Continue? [Y/n/t]: Y -Using tape /dev/nst2 from server server2\. +Using tape /dev/nst2 from server server2\&. .fi .RE .PP \fBsetmode\fR \fImode\fR .RS 4 -Set the extraction mode for Samba shares\. If +Set the extraction mode for Samba shares\&. If \fImode\fR is -\fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC\. If +\fBsmb\fR, shares are sent to the Samba server to be restored back onto the PC\&. If \fImode\fR is -\fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted\. +\fBtar\fR, they are extracted on the local machine the same way tar volumes are extracted\&. .RE .PP \fBmode\fR .RS 4 -Displays the extracting mode for Samba shares\. +Displays the extracting mode for Samba shares\&. .RE .PP \fBhistory\fR .RS 4 -Show the backup history of the current host and disk\. Dates, levels, tapes and file position on tape of each backup are displayed\. +Show the backup history of the current host and disk\&. Dates, levels, tapes and file position on tape of each backup are displayed\&. .RE .PP \fBpwd\fR .RS 4 -Display the name of the current backup working directory\. +Display the name of the current backup working directory\&. .RE .PP \fBcd\fR \fIdir\fR .RS 4 Change the backup working directory to -\fIdir\.\fR +\fIdir\&.\fR If the mount point was specified with -\fBsetdisk\fR, this can be a full pathname or it can be relative to the current backup working directory\. If the mount point was not specified, paths are relative to the mount point if they start with "/", otherwise they are relative to the current backup working directory\. The +\fBsetdisk\fR, this can be a full pathname or it can be relative to the current backup working directory\&. If the mount point was not specified, paths are relative to the mount point if they start with "/", otherwise they are relative to the current backup working directory\&. The \fIdir\fR -can be a shell style wildcards\. +can be a shell style wildcards\&. .RE .PP \fBcdx\fR \fIdir\fR .RS 4 Like the \fBcd\fR -command but allow regular expression\. +command but allow regular expression\&. .RE .PP \fBlpwd\fR .RS 4 Display the \fBamrecover\fR -working directory\. Files will be restored under this directory, relative to the backed up filesystem\. +working directory\&. Files will be restored under this directory, relative to the backed up filesystem\&. .RE .PP \fBlcd\fR \fIpath\fR @@ -237,114 +441,114 @@ working directory\. Files will be restored under this directory, relative to the Change the \fBamrecover\fR working directory to -\fIpath\fR\. +\fIpath\fR\&. .RE .PP \fBls\fR .RS 4 -List the contents of the current backup working directory\. See the description of the +List the contents of the current backup working directory\&. See the description of the \fBsetdate\fR -command for how the view of the directory is built up\. The backup date is shown for each file\. +command for how the view of the directory is built up\&. The backup date is shown for each file\&. .RE .PP -\fBadd\fR \fIitem1 item2 \.\.\.\fR +\fBadd\fR \fIitem1 item2 \&.\&.\&.\fR .RS 4 -Add the specified files or directories to the restore list\. Each item may have shell style wildcards\. +Add the specified files or directories to the restore list\&. Each item may have shell style wildcards\&. .RE .PP -\fBaddx\fR \fIitem1 item2 \.\.\.\fR +\fBaddx\fR \fIitem1 item2 \&.\&.\&.\fR .RS 4 -Add the specified files or directories to the restore list\. Each item may be a regular expression\. +Add the specified files or directories to the restore list\&. Each item may be a regular expression\&. .RE .PP -\fBdelete\fR \fIitem1 item2 \.\.\.\fR +\fBdelete\fR \fIitem1 item2 \&.\&.\&.\fR .RS 4 -Delete the specified files or directories from the restore list\. Each item may have shell style wildcards\. +Delete the specified files or directories from the restore list\&. Each item may have shell style wildcards\&. .RE .PP -\fBdeletex\fR \fIitem1 item2 \.\.\.\fR +\fBdeletex\fR \fIitem1 item2 \&.\&.\&.\fR .RS 4 -Delete the specified files or directories from the restore list\. Each item may be a regular expression\. +Delete the specified files or directories from the restore list\&. Each item may be a regular expression\&. .RE .PP \fBlist\fR \fIfile\fR .RS 4 -Display the contents of the restore list\. If a file name is specified, the restore list is written to that file\. This can be used to manually extract the files from the +Display the contents of the restore list\&. If a file name is specified, the restore list is written to that file\&. This can be used to manually extract the files from the \fIAmanda\fR tapes with -\fBamrestore\fR\. +\fBamrestore\fR\&. .RE .PP \fBclear\fR .RS 4 -Clear the restore list\. +Clear the restore list\&. .RE .PP \fBquit\fR .RS 4 -Close the connection to the index server and exit\. +Close the connection to the index server and exit\&. .RE .PP \fBexit\fR .RS 4 -Close the connection to the index server and exit\. +Close the connection to the index server and exit\&. .RE .PP \fBextract\fR .RS 4 -Start the extract sequence (see the examples below)\. Make sure the local working directory is the root of the backed up filesystem, or another directory that will behave like that\. Use +Start the extract sequence (see the examples below)\&. Make sure the local working directory is the root of the backed up filesystem, or another directory that will behave like that\&. Use \fBlpwd\fR to display the local working directory, and \fBlcd\fR -to change it\. +to change it\&. .RE .PP \fBhelp\fR .RS 4 -Display a brief list of these commands\. +Display a brief list of these commands\&. .RE .SH "EXAMPLES" .PP The following shows the recovery of an old \fIsyslog\fR -file\. +file\&. .nf # cd /var/log -# ls \-l syslog\.7 -syslog\.7: No such file or directory -# amrecover -AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\. -220 oops \fIAmanda\fR index server (2\.4\.2) ready\. +# ls \-l syslog\&.7 +syslog\&.7: No such file or directory +# amrecover MyConfig +AMRECOVER Version 2\&.4\&.2\&. Contacting server on oops \&.\&.\&. +220 oops \fIAmanda\fR index server (2\&.4\&.2) ready\&. Setting restore date to today (1997\-12\-09) -200 Working date set to 1997\-12\-09\. -200 Config set to daily\. -200 Dump host set to this\-host\.some\.org\. -$CWD \'/var/log\' is on disk \'/var\' mounted at \'/var\'\. -200 Disk set to /var\. +200 Working date set to 1997\-12\-09\&. +200 Config set to MyConfig\&. +200 Dump host set to this\-host\&.some\&.org\&. +$CWD \'/var/log\' is on disk \'/var\' mounted at \'/var\'\&. +200 Disk set to /var\&. /var/log WARNING: not on root of selected filesystem, check man\-page! amrecover> ls -1997\-12\-09 daemon\.log +1997\-12\-09 daemon\&.log 1997\-12\-09 syslog 1997\-12\-08 authlog -1997\-12\-08 sysidconfig\.log -1997\-12\-08 syslog\.0 -1997\-12\-08 syslog\.1 -1997\-12\-08 syslog\.2 -1997\-12\-08 syslog\.3 -1997\-12\-08 syslog\.4 -1997\-12\-08 syslog\.5 -1997\-12\-08 syslog\.6 -1997\-12\-08 syslog\.7 -amrecover> add syslog\.7 -Added /log/syslog\.7 +1997\-12\-08 sysidconfig\&.log +1997\-12\-08 syslog\&.0 +1997\-12\-08 syslog\&.1 +1997\-12\-08 syslog\&.2 +1997\-12\-08 syslog\&.3 +1997\-12\-08 syslog\&.4 +1997\-12\-08 syslog\&.5 +1997\-12\-08 syslog\&.6 +1997\-12\-08 syslog\&.7 +amrecover> add syslog\&.7 +Added /log/syslog\&.7 amrecover> lpwd /var/log -amrecover> lcd \.\. +amrecover> lcd \&.\&. /var amrecover> extract -Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10 +Extracting files using tape drive /dev/nst0 on host 192\&.168\&.0\&.10 The following tapes are needed: DMP014 @@ -353,41 +557,41 @@ Continue? [Y/n]: y Load tape DMP014 now Continue? [Y/n/t]: y -set owner/mode for \'\.\'? [yn] n +set owner/mode for \'\&.\'? [yn] n amrecover> quit -200 Good bye\. -# ls \-l syslog\.7 +200 Good bye\&. +# ls \-l syslog\&.7 total 26 -\-rw\-r\-\-r\-\- 1 root other 12678 Oct 14 16:36 syslog\.7 +\-rw\-r\-\-r\-\- 1 root other 12678 Oct 14 16:36 syslog\&.7 .fi .PP If you do not want to overwrite existing files, create a subdirectory to run \fBamrecover\fR -from and then move the restored files afterward\. +from and then move the restored files afterward\&. .nf # cd /var -# (umask 077 ; mkdir \.restore) -# cd \.restore +# (umask 077 ; mkdir \&.restore) +# cd \&.restore # amrecover -AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\. -\.\.\. +AMRECOVER Version 2\&.4\&.2\&. Contacting server on oops \&.\&.\&. +\&.\&.\&. amrecover> cd log /var/log amrecover> ls -\.\.\. -amrecover> add syslog\.7 -Added /log/syslog\.7 +\&.\&.\&. +amrecover> add syslog\&.7 +Added /log/syslog\&.7 amrecover> lpwd -/var/\.restore +/var/\&.restore amrecover> extract -Extracting files using tape drive /dev/nst0 on host 192\.168\.0\.10 -\.\.\. +Extracting files using tape drive /dev/nst0 on host 192\&.168\&.0\&.10 +\&.\&.\&. amrecover> quit -200 Good bye\. -# mv \-i log/syslog\.7 \.\./log/syslog\.7\-restored -# cd \.\. -# rm \-fr \.restore +200 Good bye\&. +# mv \-i log/syslog\&.7 \&.\&./log/syslog\&.7\-restored +# cd \&.\&. +# rm \-fr \&.restore .fi .PP If you need to run @@ -396,22 +600,22 @@ by hand instead of letting \fBamrecover\fR control it, use the \fBlist\fR -command after browsing to display the needed tapes\. +command after browsing to display the needed tapes\&. .nf # cd /var/log # amrecover -AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\. -\.\.\. +AMRECOVER Version 2\&.4\&.2\&. Contacting server on oops \&.\&.\&. +\&.\&.\&. amrecover> ls -\.\.\. -amrecover> add syslog syslog\.6 syslog\.7 +\&.\&.\&. +amrecover> add syslog syslog\&.6 syslog\&.7 Added /log/syslog -Added /log/syslog\.6 -Added /log/syslog\.7 +Added /log/syslog\&.6 +Added /log/syslog\&.7 amrecover> list TAPE DMP014 LEVEL 0 DATE 1997\-12\-08 - /log/syslog\.7 - /log/syslog\.6 + /log/syslog\&.7 + /log/syslog\&.6 TAPE DMP015 LEVEL 1 DATE 1997\-12\-09 /log/syslog amrecover> quit @@ -419,16 +623,16 @@ amrecover> quit .PP The \fBhistory\fR -command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape\. All active tapes are listed, not just back to the most recent full dump\. +command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape\&. All active tapes are listed, not just back to the most recent full dump\&. .PP -Tape file position zero is a label\. The first backup image is in file position one\. +Tape file position zero is a label\&. The first backup image is in file position one\&. .nf # cd /var/log # amrecover -AMRECOVER Version 2\.4\.2\. Contacting server on oops \.\.\. -\.\.\. +AMRECOVER Version 2\&.4\&.2\&. Contacting server on oops \&.\&.\&. +\&.\&.\&. amrecover> history -200\- Dump history for config "daily" host "this\-host\.some\.org" disk "/var" +200\- Dump history for config "MyConfig" host "this\-host\&.some\&.org" disk "/var" 201\- 1997\-12\-09 1 DMP015 9 201\- 1997\-12\-08 1 DMP014 11 201\- 1997\-12\-07 0 DMP013 22 @@ -439,7 +643,7 @@ amrecover> history 201\- 1997\-12\-02 1 DMP008 7 201\- 1997\-12\-01 1 DMP007 9 201\- 1997\-11\-30 1 DMP006 6 -\.\.\. +\&.\&.\&. amrecover> quit .fi .SH "ENVIRONMENT" @@ -449,24 +653,15 @@ The \fBls\fR and \fBlist\fR -commands will use $PAGER to display the file lists\. Defaults to +commands will use $PAGER to display the file lists\&. Defaults to \fImore\fR -if PAGER is not set\. +if PAGER is not set\&. .PP \fBAMANDA_SERVER\fR -If set, $AMANDA_SERVER will be used as index\-server\. The value will take precedence over the compiled default, but will be overridden by the \-s switch\. +If set, $AMANDA_SERVER will be used as index\-server\&. The value will take precedence over the compiled default, but will be overridden by the \-s switch\&. .PP \fBAMANDA_TAPE_SERVER\fR -If set, $AMANDA_TAPE_SERVER will be used as tape\-server\. The value will take precedence over the compiled default, but will be overridden by the \-t switch\. -.SH "AUTHOR" -.PP -Alan M\. McIvor - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +If set, $AMANDA_TAPE_SERVER will be used as tape\-server\&. The value will take precedence over the compiled default, but will be overridden by the \-t switch\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -475,3 +670,8 @@ Stefan G\. Weichinger, \fBamfetchdump\fR(8), \fBreadline\fR(3), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBAlan M\&. McIvor\fR <\&alan@kauri\&.auck\&.irl\&.cri\&.nz\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amreport.8 b/man/amreport.8 index d8feabb..d994828 100644 --- a/man/amreport.8 +++ b/man/amreport.8 @@ -1,41 +1,199 @@ .\" Title: amreport -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Stefan G. Weichinger +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMREPORT" "8" "08/22/2008" "" "" +.TH "AMREPORT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amreport - generate a formatted output of statistics for an Amanda run -.SH "SYNOPSIS" -.HP 9 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amreport \- generate a formatted output of statistics for an \fIAmanda\fR run +.SH "Synopsis" +.fam C +.HP \w'\fBamreport\fR\ 'u \fBamreport\fR [\fIconfig\fR] [\-i] [\-M\ \fIaddress\fR] [\-l\ \fIlogfile\fR] [\-f\ \fIoutputfile\fR] [\-p\ \fIpostscriptfile\fR] [\-o\ \fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmreport\fR generates a summary report of an \fBamanda\fR(8) -backup run\. If no configuration name is specified, amanda\.conf is read from the current directory\. +backup run\&. If no configuration name is specified, amanda\&.conf is read from the current directory\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fIconfig\fR .RS 4 -Name of the configuration to process\. +Name of the configuration to process\&. .RE .PP \fB\-i\fR .RS 4 -Don\'t email the report\. +Don\'t email the report\&. .RE .PP \fB\-M\fR \fIaddress\fR @@ -45,19 +203,19 @@ Mail the report to instead of the \fBmailto\fR value from -\fIamanda\.conf\fR\. +\fIamanda\&.conf\fR\&. .RE .PP \fB\-l\fR \fIlogfile\fR .RS 4 -Name of the log file to parse to generate the report\. If a log file is not specified, it defaults to the file: +Name of the log file to parse to generate the report\&. If a log file is not specified, it defaults to the file: .RE .PP \fIlogdir\fR/log .PP where \fIlogdir\fR -is the log directory defined in amanda\.conf\. +is the log directory defined in amanda\&.conf\&. .PP \fB\-f\fR \fIoutputfile\fR .RS 4 @@ -65,10 +223,10 @@ Normally, \fBamreport\fR sends the report via e\-mail to the \fImailto\fR -user as defined in the amanda\.conf file\. If +user as defined in the amanda\&.conf file\&. If \fIoutputfile\fR is specified, then the report is put in -\fIoutputfile\fR\. +\fIoutputfile\fR\&. .RE .PP \fB\-p\fR \fIpostscriptfile\fR @@ -77,47 +235,65 @@ Send the postscript output to the file \fIpostscriptfile\fR instead of to the \fBlpr\fR(1) -command\. This option has an effect only if the +command\&. This option has an effect only if the \fIlbl\-templ\fR -directive is specified in amanda\.conf\. +directive is specified in amanda\&.conf\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "LABEL PRINTING" .PP \fIAmanda\fR -can print postscript labels describing the contents of tape(s) written in a run\. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3\-ring binder\. Various label templates are provided to format data for different tape sizes\. +can print postscript labels describing the contents of tape(s) written in a run\&. The labels are designed to be folded and inserted into the tape case along with the tape or hole punched and put in a 3\-ring binder\&. Various label templates are provided to format data for different tape sizes\&. .PP -The information printed varies slightly between label templates due to size constraints\. Labels contain one line for each host/file\-system pair and may also contain the file number on the tape, the level of the dump, the original size of the dump and the size of the (possibly compressed) tape file\. +The information printed varies slightly between label templates due to size constraints\&. Labels contain one line for each host/file\-system pair and may also contain the file number on the tape, the level of the dump, the original size of the dump and the size of the (possibly compressed) tape file\&. .PP Add the \fIlbl\-templ\fR -parameter to the tapetype definition in amanda\.conf to enable labels\. If you don\'t add this line to your tapetype definition, +parameter to the tapetype definition in amanda\&.conf to enable labels\&. If you don\'t add this line to your tapetype definition, \fBamreport\fR -will not print tape labels\. +will not print tape labels\&. .PP You may use the \fIremap=\'I\'>printer\fR -keyword in amanda\.conf to print to other than the system default printer\. +keyword in amanda\&.conf to print to other than the system default printer\&. .SH "TEMPLATES" .PP \fIAmanda\fR -provides label templates for the following tape types\. These are pretty generic labels and should be easy to customize for other tape types or particular site needs\. +provides label templates for the following tape types\&. These are pretty generic labels and should be easy to customize for other tape types or particular site needs\&. .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + * ExaByte 8mm tapes * DAT 4mm tapes * DLT tapes * 3\-ring binder +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP -The 3\-ring binder type is the most generic\. It may be used to make a hardcopy log of the tapes\. +The 3\-ring binder type is the most generic\&. It may be used to make a hardcopy log of the tapes\&. .SH "EXIT CODE" The exit code of \fBamreport\fR is the ORed value of: @@ -134,3 +310,6 @@ The exit code of \fBamreport\fR is the ORed value of: \fBamanda\fR(8), \fBamflush\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amrestore.8 b/man/amrestore.8 index d7617d9..64615a0 100644 --- a/man/amrestore.8 +++ b/man/amrestore.8 @@ -1,20 +1,178 @@ .\" Title: amrestore -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMRESTORE" "8" "08/22/2008" "" "" +.TH "AMRESTORE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amrestore - extract backup images from an Amanda tape -.SH "SYNOPSIS" -.HP 10 -\fBamrestore\fR [\-r | \-c | \-C] [\-b | \fIblocksize\fR] [\-f | \fIfileno\fR] [\-l | \fIlabel\fR] [\-p] [\-h] \fItapedevice\fR|\ \fIholdingfile\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR | \.\.\.]]]]]] +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amrestore \- extract backup images from an \fIAmanda\fR tape +.SH "Synopsis" +.fam C +.HP \w'\fBamrestore\fR\ 'u +\fBamrestore\fR [\-r | \-c | \-C] [\-b | \fIblocksize\fR] [\-f | \fIfileno\fR] [\-l | \fIlabel\fR] [\-p] [\-h] \fItapedevice\fR|\ \fIholdingfile\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR [\fIhostname\fR [\fIdiskname\fR [\fIdatestamp\fR | \&.\&.\&.]]]]]] +.fam .SH "DESCRIPTION" .PP \fBAmrestore\fR @@ -27,70 +185,70 @@ that match \fIdiskname\fR and \fIdatestamp\fR -patterns given on the command line\. The tape or holding file must be in a format written by the +patterns given on the command line\&. The tape or holding file must be in a format written by the \fBamdump\fR or \fBamflush\fR -program\. +program\&. .PP If \fIdiskname\fR is not specified, all backups on the tape for the previous \fIhostname\fR -are candidates\. If +are candidates\&. If \fIdatestamp\fR is not specified, all backups on the tape for the previous \fIhostname\fR and \fIdiskname\fR -are candidates\. If no +are candidates\&. If no \fIhostname\fR, \fIdiskname\fR or \fIdatestamp\fR -are specified, every backup on the tape is a candidate\. +are specified, every backup on the tape is a candidate\&. .PP \fIHostname\fR and \fIdiskname\fR are special expressions described in the "HOST & DISK EXPRESSION" section of -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. \fIDatestamp\fR are special expression described in the "DATESTAMP EXPRESSION" section of -\fBamanda\fR(8)\. For example, if +\fBamanda\fR(8)\&. For example, if \fIdiskname\fR is "rz[23]a", it would match disks \fBrz2a\fR and -\fBrz3a\fR\. +\fBrz3a\fR\&. .PP \fIDatestamp\fR is useful if \fBamflush\fR -writes multiple backup runs to a single tape\. +writes multiple backup runs to a single tape\&. .PP Unless \fB\-p\fR is used, candidate backup images are extracted to files in the current directory named: .PP -\fIhostname\.diskname\.datestamp\.dumplevel\fR +\fIhostname\&.diskname\&.datestamp\&.dumplevel\fR .PP Amrestore doesn\'t use a changer, it restore from the tape already loaded in the -\fItapedevice\.\fR +\fItapedevice\&.\fR .SH "OPTIONS" .PP \fB\-b\fR .RS 4 -Set the blocksize used to read the tape or holding file\. All holding files must be read with a blocksize of 32 KBytes\. +Set the blocksize used to read the tape or holding file\&. All holding files must be read with a blocksize of 32 KBytes\&. \fBAmrestore\fR -should normally be able to determine the blocksize for tapes on its own and not need this parameter\. +should normally be able to determine the blocksize for tapes on its own and not need this parameter\&. .RE .PP -The default is 32 KBytes\. +The default is 32 KBytes\&. .PP \fB\-f\fR .RS 4 -Do a rewind followed by a fsf before trying to restore an image\. +Do a rewind followed by a fsf before trying to restore an image\&. .RE .PP \fB\-l\fR @@ -101,109 +259,145 @@ Check if we restoring from the tape with the right .PP \fB\-p\fR .RS 4 -Pipe output\. The first matching backup image is sent to standard output, which is normally a pipe to +Pipe output\&. The first matching backup image is sent to standard output, which is normally a pipe to \fBrestore\fR or \fBtar\fR, then \fBamrestore\fR -quits\. It may be run again to continue selecting backups to process\. Make sure you specify the no\-rewind +quits\&. It may be run again to continue selecting backups to process\&. Make sure you specify the no\-rewind \fItapedevice\fR -when doing this\. +when doing this\&. .RE .PP Note: \fBrestore\fR -may report "short read" errors when reading from a pipe\. Most versions of +may report "short read" errors when reading from a pipe\&. Most versions of \fBrestore\fR -support a blocking factor option to let you set the read block size, and you should set it to 2\. See the example below\. +support a blocking factor option to let you set the read block size, and you should set it to 2\&. See the example below\&. .PP \fB\-c\fR .RS 4 -Compress output using the fastest method the compression program provides\. +Compress output using the fastest method the compression program provides\&. \fBAmrestore\fR normally writes output files in a format understood by \fBrestore\fR or -\fBtar\fR, even if the backups on the tape are compressed\. With the +\fBtar\fR, even if the backups on the tape are compressed\&. With the \fB\-c\fR or \fB\-C\fR option, \fBamrestore\fR -writes all files in compressed format, even if the backups on the tape are not compressed\. Output file names will have a -\fB\.Z\fR +writes all files in compressed format, even if the backups on the tape are not compressed\&. Output file names will have a +\fB\&.Z\fR or -\fB\.gz\fR +\fB\&.gz\fR extension depending on whether \fBcompress\fR or \fBgzip\fR -is the preferred compression program\. This option is useful when the current directory disk is small\. +is the preferred compression program\&. This option is useful when the current directory disk is small\&. .RE .PP \fB\-C\fR .RS 4 -Compress output using the best method the compression program provides (may be very CPU intensive)\. See the notes above about the +Compress output using the best method the compression program provides (may be very CPU intensive)\&. See the notes above about the \fB\-c\fR -option\. +option\&. .RE .PP \fB\-r\fR .RS 4 -Raw output\. Backup images are output exactly as they are on the tape, including the +Raw output\&. Backup images are output exactly as they are on the tape, including the \fBamdump\fR -headers\. Output file names will have a -\fB\.RAW\fR -extension\. This option is only useful for debugging and other strange circumstances\. +headers\&. Output file names will have a +\fB\&.RAW\fR +extension\&. This option is only useful for debugging and other strange circumstances\&. .RE .PP \fB\-h\fR .RS 4 -Header output\. The tape header block is output at the beginning of each file\. This is like +Header output\&. The tape header block is output at the beginning of each file\&. This is like \fB\-r\fR except \fB\-c\fR or \fB\-C\fR -may also be used to compress the result\. +may also be used to compress the result\&. \fBAmrecover\fR -uses the header to determine the restore program to use\. +uses the header to determine the restore program to use\&. .RE .PP -If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize\. This makes the resulting image usable as a holding file\. +If a header is written (\-r or \-h), only 32 KBytes are output regardless of the tape blocksize\&. This makes the resulting image usable as a holding file\&. .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .SH "EXAMPLES" .PP The following does an interactive restore of disk \fIrz3g\fR from host -\fIseine\fR, to restore particular files\. Note the use of the +\fIseine\fR, to restore particular files\&. Note the use of the \fBb\fR option to -\fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time\. This helps keep it from complaining about short reads\. +\fBrestore\fR, which causes it to read in units of two 512\-byte blocks (1 Kbyte) at a time\&. This helps keep it from complaining about short reads\&. .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + % amrestore \-p /dev/nrmt9 seine rz3g | restore \-ivbf 2 \- +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP The next example extracts all backup images for host -\fIseine\fR\. This is the usual way to extract all data for a host after a disk crash\. +\fIseine\fR\&. This is the usual way to extract all data for a host after a disk crash\&. .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + % amrestore /dev/nrmt9 seine +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP If the backup datestamp in the above example is -19910125 +\FC19910125\F[] and \fIseine\fR has level 0 backups of disks @@ -212,49 +406,95 @@ and \fIrz1g\fR on the tape, these files will be created in the current directory: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf -seine\.rz1a\.19910125\.0 -seine\.rz1g\.19910125\.0 +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + +seine\&.rz1a\&.19910125\&.0 +seine\&.rz1g\&.19910125\&.0 +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP You may also use \fBamrestore\fR to extract a backup image from a holding disk file that has not yet been flushed to tape: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf -% amrestore \-p /amanda/20001119/seine\.rz1a\.2 | restore \-ivbf 2 \- +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + +% amrestore \-p /amanda/20001119/seine\&.rz1a\&.2 | restore \-ivbf 2 \- +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP \fBAmrestore\fR may be used to generate a listing of images on a tape: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + % mt \-f /dev/nrmt9 rewind % amrestore \-p /dev/nrmt9 no\-such\-host > /dev/null +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .PP This asks \fBamrestore\fR to find images for host -\fBno\-such\-host\fR\. It will not find any entries that match, but along the way will report each image it skips\. +\fBno\-such\-host\fR\&. It will not find any entries that match, but along the way will report each image it skips\&. .SH "CAVEATS" .PP \fBGNU\-tar\fR -must be used to restore files from backup images created with the GNUTAR dumptype\. Vendor tar programs sometimes fail to read GNU tar images\. -.SH "AUTHOR" -.PP -James da Silva, -, University of Maryland, College Park: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +must be used to restore files from backup images created with the GNUTAR dumptype\&. Vendor tar programs sometimes fail to read GNU tar images\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -263,3 +503,8 @@ Stefan G\. Weichinger, \fBtar\fR(1), \fBrestore\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amrmtape.8 b/man/amrmtape.8 index e3f1cf7..b97ce1e 100644 --- a/man/amrmtape.8 +++ b/man/amrmtape.8 @@ -1,56 +1,214 @@ .\" Title: amrmtape -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Adrian T. Filipi-Martin +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMRMTAPE" "8" "08/22/2008" "" "" +.TH "AMRMTAPE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amrmtape - remove a tape from the Amanda database -.SH "SYNOPSIS" -.HP 9 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amrmtape \- remove a tape from the \fIAmanda\fR database +.SH "Synopsis" +.fam C +.HP \w'\fBamrmtape\fR\ 'u \fBamrmtape\fR [\-n] [\-v] [\-q] [\-d] \fIconfig\fR \fIlabel\fR +.fam .SH "DESCRIPTION" .PP \fBAmrmtape\fR -invalidates the contents of an existing backup tape in the configuration database\. This is meant as a recovery mechanism when a good backup is damaged either by faulty hardware or user error, e\.g\. the tape is eaten by the drive or is overwritten\. +invalidates the contents of an existing backup tape in the configuration database\&. This is meant as a recovery mechanism when a good backup is damaged either by faulty hardware or user error, e\&.g\&. the tape is eaten by the drive or is overwritten\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP \fB\-n\fR .RS 4 Generate new -\fItapelist\fR +\fBtapelist\fR(5) and database files with \fIlabel\fR removed, but leave them in -\fI/tmp\fR -and do not update the original copies\. +\FC/tmp\F[] +and do not update the original copies\&. .RE .PP \fB\-v\fR .RS 4 -List backups of hosts and disks that are being discarded\. Enabled by default\. +List backups of hosts and disks that are being discarded\&. Enabled by default\&. .RE .PP \fB\-q\fR .RS 4 Opposite of -\fB\-v\fR\. +\fB\-v\fR\&. .RE .PP \fB\-d\fR .RS 4 -Run in debugging mode so all executed commands are shown\. +Run in debugging mode so all executed commands are shown\&. .RE .SH "EXAMPLE" .PP @@ -58,20 +216,17 @@ Remove tape labeled \fIDAILY034\fR from the \fIDailySet1\fR -configuration\. +configuration\&. .nf # amrmtape DailySet1 DAILY034 .fi -.SH "AUTHOR" -.PP -Adrian T\. Filipi\-Martin -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion .SH "SEE ALSO" .PP \fBamadmin\fR(8), \fBamanda\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBAdrian T\&. Filipi\-Martin\fR <\&atf3r@cs\&.virginia\&.edu\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amsamba.8 b/man/amsamba.8 new file mode 100644 index 0000000..c6e0f4a --- /dev/null +++ b/man/amsamba.8 @@ -0,0 +1,229 @@ +.\" Title: amsamba +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMSAMBA" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amsamba \- Amanda Application to interface with smbclient +.SH "DESCRIPTION" +.PP +Amsamba is an +\fIAmanda\fR +Application API script\&. It should not be run by users directly\&. It uses smbclient to backup and restore data\&. +.PP +The device name in the disklist must have the form \'//HOST/SHARE/SUBDIR\' where HOST is the CIFS host, SHARE is the share to connect and subdir is the subdirectory to backup\&. \'/subdir\' can be ommited, in which case the complete share is archived\&. The host in the disklist should be the name of an intermediate host that has smbclient installed, and is often the Amanda server itself\&. +.PP +Include or exclude can be used, but not both\&. The path for \'exclude list\' or \'include list\' must be absolute path on the client\&. The estimate calculates the complete size of the share, without regard for include or exclude directives\&. It will be larger than the actual dump if you use include or exclude\&. Using \'estimate server\' in the dumptype could give better estimate\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control amsamba\'s functionality\&. See +\fBamanda-applications\fR(7) +for information on application properties and how they are configured\&. +.PP +SMBCLIENT\-PATH +.RS 4 + +The path to the smbclient binary\&. The default is set when \fIAmanda\fR is built\&. +.RE +.PP +GNUTAR\-PATH +.RS 4 + +The path to the gnutar binary\&. The default is set when \fIAmanda\fR is built\&. gnutar +is use to create the index\&. +.RE +.PP +AMANDAPASS +.RS 4 + +Location of the amandapass file, The default is "/etc/amandapass"\&. +The format of the file is as follow: +.nf + Sharename User%Password Domain +.fi + +Sharename is \'//HOST/SHARE\' without the SUBDIR\&. +Sharename can be quoted, +it can be \'*\' to match all share, +it can be \'//pc\-host/*\' to match all share on pc\-host\&. +User is the username use to connect to the share\&. +Password is the password use to connect to the share\&. +Domain is optional\&. Example: +.nf + //another\-pc/share otheruser%otherpw domain +.fi +.RE +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-applications\fR(7) +.SH "Author" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amserverconfig.8 b/man/amserverconfig.8 index 093899d..2838d19 100644 --- a/man/amserverconfig.8 +++ b/man/amserverconfig.8 @@ -1,133 +1,291 @@ .\" Title: amserverconfig -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Kevin Till +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMSERVERCONFIG" "8" "08/22/2008" "" "" +.TH "AMSERVERCONFIG" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amserverconfig - program to setup initial Amanda configuration -.SH "SYNOPSIS" -.HP 15 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amserverconfig \- program to setup initial \fIAmanda\fR configuration +.SH "Synopsis" +.fam C +.HP \w'\fBamserverconfig\fR\ 'u \fBamserverconfig\fR \fIconfig\fR [\-\-template\ \fItemplate\fR] [\-\-no\-vtape] [\-\-tapetype\ \fItapetype\fR] [\-\-tpchanger\ \fItpchanger\fR] [\-\-tapedev\ \fItapedev\fR] [\-\-changerfile\ \fIchangerfile\fR] [\-\-changerdev\ \fIchangerdev\fR] [\-\-labelstr\ \fIlabelstr\fR] [\-\-mailto\ \fImailto\fR] [\-\-dumpcycle\ \fIdumpcycle\fR] [\-\-runspercycle\ \fIrunspercycle\fR] [\-\-runtapes\ \fIruntapes\fR] [\-\-tapecycle\ \fItapecycle\fR] [\-\-help] +.fam .SH "DESCRIPTION" .PP After Amanda rpms are successfully installed, \fBamserverconfig\fR will setup initial \fIAmanda\fR -configuration files\. It will create /var/lib/amanda/guntar\-lists directory if one does not exist\. +configuration files\&. It will create /var/lib/amanda/guntar\-lists directory if one does not exist\&. \fBamserverconfig\fR does not change existing \fIAmanda\fR -configurations\. +configurations\&. \fBamserverconfig\fR -must be run by user amandabackup\. -.SH "OPTIONS" +must be run by user amandabackup\&. +.SH "Options" .PP -Options may be abbreviated, as long as the abbreviation is not ambiguous\. Option argument can either separated by \'=\' or a space\. Example: \-\-templ=harddisk \-\-tapedev /dev/nst0 +Options may be abbreviated, as long as the abbreviation is not ambiguous\&. Option argument can either separated by \'=\' or a space\&. Example: \-\-templ=harddisk \-\-tapedev /dev/nst0 .PP \fBamserverconfig\fR builds a new "config" \fIAmanda\fR -configuration\. Customize the configuration with the options below\. +configuration\&. Customize the configuration with the options below\&. .PP \fB\-\-template template\fR .RS 4 build \fIAmanda\fR -configuration with pre\-configured template files\. Currently, +configuration with pre\-configured template files\&. Currently, \fBharddisk\fR, \fBsingle\-tape\fR, \fBtape\-changer\fR and \fBS3\fR -are the valid inputs for this option\. Pre\-configured template files can be found in /var/lib/amanda/template\.d\. This option may be combined with other options\. +are the valid inputs for this option\&. Pre\-configured template files can be found in /var/lib/amanda/template\&.d\&. This option may be combined with other options\&. .sp -If tape\-changer is chosen for this option, program mtx is required\. +If tape\-changer is chosen for this option, program mtx is required\&. \fBamserverconfig\fR -will search for mtx in the following directory: "/usr/sbin", "/usr/local/sbin", "/usr/local/bin", "/usr/bin", "/bin" and amandabackup\'s PATH\. +will search for mtx in the following directory: "/usr/sbin", "/usr/local/sbin", "/usr/local/bin", "/usr/bin", "/bin" and amandabackup\'s PATH\&. .sp If harddisk is chosen and \-\-no\-vtape is not specified, \fBamserverconfig\fR -will create and label virtual tape file://var/lib/amanda/vtapes/$config\. +will create and label virtual tape file://var/lib/amanda/vtapes/$config\&. .RE .PP \fB\-\-no\-vtape\fR .RS 4 -Do not create virtual tapes in the harddisk template case\. +Do not create virtual tapes in the harddisk template case\&. .RE .PP \fB\-\-tapedev tapedev\fR .RS 4 -The path name of non\-rewinding tape device\. default [file://var/lib/amanda/vtapes/$config] +The path name of non\-rewinding tape device\&. default [file://var/lib/amanda/vtapes/$config] .RE .PP \fB\-\-tpchanger tpchanger\fR .RS 4 -The name of the tape changer\. default [chg\-disk] +The name of the tape changer\&. default [chg\-disk] .RE .PP \fB\-\-changerdev changerdev\fR .RS 4 -A tape changer configuration parameter\. default [/dev/null] +A tape changer configuration parameter\&. default [/dev/null] .RE .PP \fB\-\-changerfile changerfile\fR .RS 4 -A tape changer configuration parameter\. default [/etc/amanda/$config/changer\.conf] +A tape changer configuration parameter\&. default [/etc/amanda/$config/changer\&.conf] .RE .PP \fB\-\-labelstr labelstr\fR .RS 4 -The tape label constraint regular expression\. default [^$config\-[0\-9][0\-9]*$] +The tape label constraint regular expression\&. default [^$config\-[0\-9][0\-9]*$] .sp -If this option is used with \-\-template=harddisk, only alphanumeric string is supported\. +If this option is used with \-\-template=harddisk, only alphanumeric string is supported\&. .RE .PP \fB\-\-tapetype tapetype\fR .RS 4 -The type of tape drive associated with tapedev or tpchanger\. default [HARDDISK] +The type of tape drive associated with tapedev or tpchanger\&. default [HARDDISK] .RE .PP \fB\-\-mailto mailto\fR .RS 4 -A space separated list of recipients for mail reports\. default [amandabackup] +A space separated list of recipients for mail reports\&. default [amandabackup] .RE .PP \fB\-\-dumpcycle dumpcycle\fR .RS 4 -The number of days in the backup cycle\. default [1week] +The number of days in the backup cycle\&. default [1week] .RE .PP \fB\-\-runspercycle runspercycle\fR .RS 4 -The number of days in the backup cycle\. default [5] +The number of days in the backup cycle\&. default [5] .RE .PP \fB\-\-runtapes runtapes\fR .RS 4 -The maximum number of tapes used in a single run\. default [1] +The maximum number of tapes used in a single run\&. default [1] .RE .PP \fB\-\-tapecycle tapecycle\fR .RS 4 -The size of tape rotation\. default [25] +The size of tape rotation\&. default [25] .RE .PP \fB\-\-help\fR .RS 4 -Display usage\. +Display usage\&. .RE -.SH "FILES" +.SH "Files" .PP -\fB/var/lib/amanda/template\.d\fR +\fB/var/lib/amanda/template\&.d\fR .RS 4 Amanda configuration template files install location .RE @@ -139,43 +297,46 @@ amandabackup home directory .PP \fB/var/lib/amanda/gnutar\-lists\fR .RS 4 -A directory which contains backup timestamp and list of files backed up\. +A directory which contains backup timestamp and list of files backed up\&. .RE .PP \fB/etc/amanda/$config\fR .RS 4 \fIAmanda\fR -configuration files location for $config(e\.g: DailySet1)\. +configuration files location for $config(e\&.g: DailySet1)\&. .RE .PP -\fB/etc/amanda/template\.d\fR +\fB/etc/amanda/template\&.d\fR .RS 4 A directory contains dumptypes and tapetypes files used by all \fIAmanda\fR -configurations\. +configurations\&. .RE .PP \fB/etc/amandates\fR .RS 4 \fIAmanda\fR -file on the client\. It keeps track of structures of previous dumps\. +file on the client\&. It keeps track of structures of previous dumps\&. .RE .PP \fB/tmp/amanda\fR .RS 4 directory contains \fIAmanda\fR -debug log files\. +debug log files\&. .RE .SH "RETURN VALUE" -On success, zero is returned\. On error, 1 is returned\. -.SH "AUTHOR" -.PP -The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.com/)\. +On success, zero is returned\&. On error, 1 is returned\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), \fBamanda.conf\fR(5), \fBamaddclient\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBKevin Till\fR <\&kevin\&.till@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amservice.8 b/man/amservice.8 new file mode 100644 index 0000000..6278247 --- /dev/null +++ b/man/amservice.8 @@ -0,0 +1,247 @@ +.\" Title: amservice +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMSERVICE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amservice \- run an amanda service on a client +.SH "Synopsis" +.fam C +.HP \w'\fBamservice\fR\ 'u +\fBamservice\fR \fIhostname\fR \fIauth\fR \fIservice\fR [\-f\ \fIinput_file\fR] [\-o\ \fIconfigoption\fR]... +.fam +.SH "DESCRIPTION" +.PP +\fBAmservice\fR +execute an +\fIAmanda\fR +service on a client\&. It can be used without amanda server configuration (amanda\&.conf and disklist)\&. It can be used to check communication between a server and a client\&. Amservice reads stdin to capture the REQ packet to send to the client\&. +.PP +See the +\fBamanda\fR(8) +man page for more details about +\fIAmanda\fR\&. +.SH "OPTIONS" +.PP +\fBhostname\fR +.RS 4 +The hostname of the client\&. +.RE +.PP +\fBauth\fR +.RS 4 +The auth to use, one of: bsd, bsdudp, bsdtcp, ssh, rsh or krb5\&. The client must be configured with this auth\&. +.RE +.PP +\fBservice\fR +.RS 4 +The amanda service to execute on the client\&. One of noop, selfcheck or sendsize\&. +.RE +.PP +\fB\-f input_file\fR +.RS 4 +Use the file input_file instead of stdin to read the REQ packet from\&. +.RE +.PP +\fB\-o\fR \fIconfigoption\fR +.RS 4 +See the "\fBCONFIGURATION OVERRIDE\fR" section in +\fBamanda\fR(8)\&. +.RE +.SH "EXAMPLE" +.PP +The noop service is easy to execute because it does not require a REQ packet: +.nf +amservice hostname bsdtcp noop < /dev/null.fi +.PP +The example executes the noop service on the client using bsdtcp auth\&. This is useful for debugging connection problems\&. It print an OPTIONS line upon success\&. +.PP +It is more difficult to execute the selfcheck or sendsize service, as these require a valid REQ packet\&. If you have already uccessfully run amanda, you can find valid REQ packets in the amandad\&.*\&.debug files\&. +.SH "EXIT CODE" + +The exit code of \fBamservice\fR is one of: +.nf + 0 = success + 1 = error executing amandad on the client\&. +.fi +.PP +As +\fBamservice\fR +doesn\'t parse the REP packet, it can only detect failures in executing amandad on the client\&. +\fBamservice\fR +can exit with value 0 even if the user is not authorized to execute the service\&. An error message will be printed\&. +.SH "SEE ALSO" +.PP +\fBamanda\fR(8), +\fBamcheck\fR(8), +\fBamdump\fR(8), +\fBamadmin\fR(8) +.SH "Author" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amstar.8 b/man/amstar.8 new file mode 100644 index 0000000..c5830ce --- /dev/null +++ b/man/amstar.8 @@ -0,0 +1,226 @@ +.\" Title: amstar +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMSTAR" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amstar \- Amanda Application to interface with star +.SH "DESCRIPTION" +.PP +Amstar is an +\fIAmanda\fR +Application API script\&. It should not be run by users directly\&. It uses star to backup and restore data\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control amstar\'s functionality\&. See +\fBamanda-applications\fR(7) +for information on application properties and how they are configured\&. +.PP +ONE\-FILE\-SYSTEM +.RS 4 + +If "YES" (the default), do not allow star to cross filesystem boundaries\&. If "NO", star will cross filesystem boundaries\&. This corresponds to the \fI\-xdev\fR option of star\&. +.RE +.PP +SPARSE +.RS 4 + +If "YES" (the default), star will store sparse files efficiently\&. If "NO", then the \fI\-sparse\fR option is not given to star, and it will not try to detect sparse files\&. +.RE +.PP +STAR\-DLE\-TARDUMP +.RS 4 + +If "YES", amstar will use a different tardump file for each DLE\&. The default is "NO"\&. This property is needed with older versions of star doing many dumps in parallel, because of a race condition in updating the tardump file\&. +.RE +.PP +STAR\-PATH +.RS 4 + +The path to the star binary\&. The default is set when \fIAmanda\fR is built\&. +.RE +.PP +STAR\-TARDUMP +.RS 4 + +The directory where star stores the database it uses to generate incremental dumps\&. The default is set when \fIAmanda\fR is built\&. +.RE +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-applications\fR(7) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amstatus.8 b/man/amstatus.8 index f17d645..092c9a0 100644 --- a/man/amstatus.8 +++ b/man/amstatus.8 @@ -1,20 +1,178 @@ .\" Title: amstatus -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Stefan G. Weichinger +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMSTATUS" "8" "08/22/2008" "" "" +.TH "AMSTATUS" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amstatus - display the state of an Amanda run -.SH "SYNOPSIS" -.HP 9 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amstatus \- display the state of an \fIAmanda\fR run +.SH "Synopsis" +.fam C +.HP \w'\fBamstatus\fR\ 'u \fBamstatus\fR [\-\-config] \fIconfig\fR [\-\-file\ \fIamdumpfile\fR] [\-\-summary] [\-\-dumping] [\-\-waitdumping] [\-\-waittaper] [\-\-dumpingtape] [\-\-writingtape] [\-\-finished] [\-\-failed] [\-\-estimate] [\-\-gestimate] [\-\-stats] [\-\-locale\-independent\-date\-format] +.fam .SH "DESCRIPTION" .PP \fBAmstatus\fR @@ -22,23 +180,23 @@ gives the current state of the \fIAmanda\fR run specified by the \fIconfig\fR -configuration\. If there is no active +configuration\&. If there is no active \fIAmanda\fR -running, it summarizes the result of the last run\. It may also be used to summarize the results of a previous run\. +running, it summarizes the result of the last run\&. It may also be used to summarize the results of a previous run\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "OPTIONS" .PP -All options may be abbreviated to the shortest non\-ambiguous sub\-string\. If no options are given, everything is displayed\. +All options may be abbreviated to the shortest non\-ambiguous sub\-string\&. If no options are given, everything is displayed\&. .PP \fB[\-\-config] config\fR .RS 4 Specify the \fIAmanda\fR -configuration you want to display the state for\. +configuration you want to display the state for\&. .RE .PP \fB\-\-file amdumpfile\fR @@ -47,67 +205,67 @@ Specify an alternate file instead of the \fIamdump\fR or \fIamflush\fR -file\. +file\&. .RE .PP \fB\-\-summary\fR .RS 4 -Display a summary of the state of the run\. +Display a summary of the state of the run\&. .RE .PP \fB\-\-dumping\fR .RS 4 -Display all partitions that are dumping\. +Display all partitions that are dumping\&. .RE .PP \fB\-\-waitdumping|wdumping\fR .RS 4 -Display all partitions that are waiting to be dumped\. +Display all partitions that are waiting to be dumped\&. .RE .PP \fB\-\-waittaper|wtaper\fR .RS 4 -Display all partitions dumped that are waiting to be written to tape\. +Display all partitions dumped that are waiting to be written to tape\&. .RE .PP \fB\-\-dumpingtape|dtape\fR .RS 4 -Display all partitions that are dumping directly to tape\. +Display all partitions that are dumping directly to tape\&. .RE .PP \fB\-\-writingtape|wtape\fR .RS 4 -Display all partitions that are writing to tape\. +Display all partitions that are writing to tape\&. .RE .PP \fB\-\-finished\fR .RS 4 -Display all partitions that are dumped and written to tape\. +Display all partitions that are dumped and written to tape\&. .RE .PP \fB\-\-failed|error\fR .RS 4 -Display all partitions that failed\. +Display all partitions that failed\&. .RE .PP \fB\-\-estimate\fR .RS 4 -Display all partitions whose estimate is finished\. Works only during the estimate phase\. +Display all partitions whose estimate is finished\&. Works only during the estimate phase\&. .RE .PP \fB\-\-gestimate|gettingestimate\fR .RS 4 -Display all partitions whose estimate is not finished\. Works only during the estimate phase\. +Display all partitions whose estimate is not finished\&. Works only during the estimate phase\&. .RE .PP \fB\-\-stats|statistics\fR .RS 4 -Display statistics about active\-time of taper and dumpers\. +Display statistics about active\-time of taper and dumpers\&. .RE .PP \fB\-\-locale\-independent\-date\-format\fR .RS 4 -Output the date in a locale independent format\. The format is the same executing: date +\'%Y\-%m\-%d %H:%M:%S %Z\' +Output the date in a locale independent format\&. The format is the same executing: date +\'%Y\-%m\-%d %H:%M:%S %Z\' .RE .SH "EXIT CODE" @@ -127,3 +285,6 @@ The exit code of \fBamstatus\fR is the ORed value of: \fBamrestore\fR(8), \fBamadmin\fR(8), : http://wiki.zmanda.com +.SH "Author" +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amtape.8 b/man/amtape.8 index fcf3296..e0c6ae1 100644 --- a/man/amtape.8 +++ b/man/amtape.8 @@ -1,67 +1,225 @@ .\" Title: amtape -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMTAPE" "8" "08/22/2008" "" "" +.TH "AMTAPE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amtape - user interface to Amanda tape changer controls -.SH "SYNOPSIS" -.HP 7 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amtape \- user interface to \fIAmanda\fR tape changer controls +.SH "Synopsis" +.fam C +.HP \w'\fBamtape\fR\ 'u \fBamtape\fR \fIconfig\fR \fIcommand\fR [\fIcommand_options\fR...] [\fB\-o\ \fR\fIconfigoption\fR]... +.fam .SH "DESCRIPTION" .PP \fBAmtape\fR -performs tape changer control operations\. It uses the underlying tape changer script defined by the +performs tape changer control operations\&. It uses the underlying tape changer script defined by the \fBtpchanger\fR option for a particular \fIAmanda\fR configuration as specified by the \fIconfig\fR -argument\. +argument\&. .PP Tape changers maintain a notion of the \fIcurrent\fR and \fInext\fR -slot for each configuration\. These may or may not correspond to an actual physical state of the device, but do tend to minimize searching through the tape storage slots\. If the desired tape is in the current slot, it is likely the next tape needed is in the next slot rather than at some random position in the storage slots\. +slot for each configuration\&. These may or may not correspond to an actual physical state of the device, but do tend to minimize searching through the tape storage slots\&. If the desired tape is in the current slot, it is likely the next tape needed is in the next slot rather than at some random position in the storage slots\&. .PP See the \fBamanda\fR(8) man page for more details about -\fIAmanda\fR\. +\fIAmanda\fR\&. .SH "COMMANDS" .PP \fBreset\fR .RS 4 -Reset the tape changer to a known state\. The +Reset the tape changer to a known state\&. The \fIcurrent\fR slot is set to the \fIfirst\fR -slot\. Other device\-specific side effects may occur\. Some gravity stackers need to be reset to the top position by hand\. This command notifies +slot\&. Other device\-specific side effects may occur\&. Some gravity stackers need to be reset to the top position by hand\&. This command notifies \fIAmanda\fR -the stacker is back in that position\. +the stacker is back in that position\&. .RE .PP \fBeject\fR .RS 4 -If a tape is loaded in the drive, it is ejected and returned to the slot from which it was loaded\. +If a tape is loaded in the drive, it is ejected and returned to the slot from which it was loaded\&. .RE .PP \fBclean\fR .RS 4 -If a cleaning tape is defined for the changer, it is used to clean the drive\. +If a cleaning tape is defined for the changer, it is used to clean the drive\&. .RE .PP \fBshow\fR .RS 4 -Show the contents of all slots\. This can be slow\. +Show the contents of all slots\&. This can be slow\&. .RE .PP \fBlabel\fR \fIlabel\fR @@ -69,30 +227,30 @@ Show the contents of all slots\. This can be slow\. Search for and load the \fIAmanda\fR tape with label -\fIlabel\fR\. +\fIlabel\fR\&. .RE .PP \fBtaper\fR .RS 4 Perform the \fBtaper\fR -scan algorithm\. Load the next tape in the configuration\'s tape sequence, or a fresh tape with a suitable label\. +scan algorithm\&. Load the next tape in the configuration\'s tape sequence, or a fresh tape with a suitable label\&. .RE .PP \fBdevice\fR .RS 4 Display the name of the current tape device on -\fIstdout\fR\. +\fIstdout\fR\&. .RE .PP \fBcurrent\fR .RS 4 -Display the current slot\. +Display the current slot\&. .RE .PP \fBupdate\fR .RS 4 -Update the changer label database, if it has one, to match the tapes now available\. +Update the changer label database, if it has one, to match the tapes now available\&. .RE .PP \fBslot\fR \fIslot\fR @@ -100,73 +258,56 @@ Update the changer label database, if it has one, to match the tapes now availab Eject any tape in the drive and put it away, then load the tape from slot \fIslot\fR and reset -\fIcurrent\fR\. +\fIcurrent\fR\&. .RE .PP \fBslot current\fR .RS 4 -Eject any tape in the drive and put it away, then load the tape from the current slot\. -.RE -.PP -\fBslot prev\fR -.RS 4 -Eject any tape in the drive and put it away, then load the tape from the previous slot and reset -\fIcurrent\fR\. +Eject any tape in the drive and put it away, then load the tape from the current slot\&. .RE .PP \fBslot next\fR .RS 4 Eject any tape in the drive and put it away, then load the tape from the next slot and reset -\fIcurrent\fR\. +\fIcurrent\fR\&. .RE .PP \fBslot first\fR .RS 4 Eject any tape in the drive and put it away, then load the tape from the first slot and reset -\fIcurrent\fR\. -.RE -.PP -\fBslot last\fR -.RS 4 -Eject any tape in the drive and put it away, then load the tape from the last slot and reset -\fIcurrent\fR\. +\fIcurrent\fR\&. .RE .PP \fBslot advance\fR .RS 4 -Eject any tape in the drive and put it away\. Advance -\fIcurrent\fR -to the next tape, but do not load it\. +Synonym for +\fBslot next\fR\&. .RE .PP \fB\-o\fR \fIconfigoption\fR .RS 4 See the "\fBCONFIGURATION OVERRIDE\fR" section in -\fBamanda\fR(8)\. +\fBamanda\fR(8)\&. .RE .PP This is useful with non\-gravity stackers to unload the last tape used and set up \fIAmanda\fR -for the next run\. If you just use -\fBeject\fR, the current tape will be mounted again in the next run, where it will be rejected as being still in use, ejected and the next tape requested\. Using +for the next run\&. If you just use +\fBeject\fR, the current tape will be mounted again in the next run, where it will be rejected as being still in use, ejected and the next tape requested\&. Using \fBslot next\fR followed by \fBeject\fR -does an unnecessary mount\. +does an unnecessary mount\&. .PP Note: most changers optimize the \fBslot\fR -commands to not eject the loaded tape if it is the one being requested\. -.SH "AUTHOR" -.PP -James da Silva, - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +commands to not eject the loaded tape if it is the one being requested\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), : http://wiki.zmanda.com +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amtapetype.8 b/man/amtapetype.8 index a4f0b70..1632f6d 100644 --- a/man/amtapetype.8 +++ b/man/amtapetype.8 @@ -1,98 +1,289 @@ .\" Title: amtapetype -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Dustin J. Mitchell +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMTAPETYPE" "8" "08/22/2008" "" "" +.TH "AMTAPETYPE" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amtapetype - generate a tapetype definition. -.SH "SYNOPSIS" -.HP 11 -\fBamtapetype\fR [\-h] [\-c] [\-o] [\-b\ \fIblocksize\fR] \-e\ \fIestsize\fR [\-f\ \fItapedev\fR] [\-t\ \fItypename\fR] +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amtapetype \- generate a tapetype definition by testing the device directly +.SH "Synopsis" +.fam C +.HP \w'\fBamtapetype\fR\ 'u +\fBamtapetype\fR [\-h] [\-c] [\-f] [\-b\ \fIblocksize\fR] [\-t\ \fItypename\fR] [\-l\ \fIlabel\fR] [\-o\ \fIconfig_overwrite\fR] [\fIdevice\fR] +.fam .SH "DESCRIPTION" .PP \fBamtapetype\fR generates a tapetype entry for -\fIAmanda\fR\. +\fIAmanda\fR +by testing the device directly .SH "OPTIONS" +.if n \{\ +.sp +.\} +.RS 4 +.BM yellow +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +The options for +\fBamtapetype\fR +have changed in version 2\&.6\&.1 +.sp .5v +.EM yellow +.RE .PP \fB\-h\fR .RS 4 -Display an help message\. +Display the help message\&. .RE .PP \fB\-c\fR .RS 4 -Run only the hardware compression detection heuristic test and stop\. This takes a few minutes only\. +Run only the hardware compression detection heuristic test and stop\&. This takes a few minutes only\&. .RE .PP -\fB\-o\fR +\fB\-f\fR .RS 4 -Overwrite the tape, even if it\'s an -\fIAmanda\fR -tape\. +Run amtapetype even if the loaded volume is already in use or compression is enabled\&. .RE .PP \fB\-b\fR\fI blocksize\fR .RS 4 -record block size (default: 32k) +block size to use with the device (default: 32k) .RE .PP -\fB\-e\fR\fI estsize\fR +\fB\-t\fR \fItypename\fR .RS 4 -estimated tape size (No default!) +Name to give to the new tapetype definition\&. .RE .PP -\fB\-f\fR\fI tapedev\fR +\fB\-l\fR\fI label\fR .RS 4 -tape device name (default: $TAPE) The device to perform the test\. +Label to write on the tape (default is randomly generated)\&. .RE .PP -\fB\-t\fR\fI typename\fR +\fB\-o\fR \fIconfigoption\fR .RS 4 -tapetype name (default: unknown\-tapetype) +See the "\fBCONFIGURATION OVERRIDE\fR" section in +\fBamanda\fR(8)\&. .RE .SH "EXAMPLE" .PP Generate a tapetype definition for your tape device: .sp +.if n \{\ .RS 4 +.\} +.fam C +.ps -1 .nf -% amtapetype \-f /dev/nst0 \-e 150G +.if t \{\ +.sp -1 +.\} +.BB lightgray adjust-for-leading-newline +.sp -1 + +% amtapetype \-f /dev/nst0 +.EB lightgray adjust-for-leading-newline +.if t \{\ +.sp 1 +.\} .fi +.fam +.ps +1 +.if n \{\ .RE +.\} .SH "NOTES" .PP -Hardware compression is detected by measuring the writing speed difference of the tape drive when writing an amount of compressable and uncompresseable data\. It does not rely on the status bits of the tape drive or the OS parameters\. If your tape drive has very large buffers or is very fast, the program could fail to detect hardware compression status reliably\. -.PP -During the first pass, it writes files that are estimated to be 1% of the expected tape capacity\. It gets the expected capacity from the \-e command line flag, or defaults to 1 GByte\. In a perfect world (which means there is zero chance of this happening with tapes :\-), there would be 100 files and 100 file marks\. -.PP -During the second pass, the file size is cut in half\. In that same fairyland world, this means 200 files and 200 file marks\. -.PP -In both passes the total amount of data written is summed as well as the number of file marks written\. At the end of the second pass, quoting from the code: -.PP -* Compute the size of a filemark as the difference in data written between pass 1 and pass 2 divided by the difference in number of file marks written between pass 1 and pass 2\. \.\.\. * -.PP -So if we wrote 1\.0 GBytes on the first pass and 100 file marks, and 0\.9 GBytes on the second pass with 200 file marks, those additional 100 file marks in the second pass took 0\.1 GBytes and therefor a file mark is 0\.001 GBytes (1 MByte)\. +If the device cannot reliably report its comprssion status (and as of this writing, no devices can do so), hardware compression is detected by measuring the writing speed difference of the tape drive when writing an amount of compressable and uncompresseable data\&. If your tape drive has very large buffers or is very fast, the program could fail to detect hardware compression status reliably\&. .PP -Note that if the estimated capacity is wrong, the only thing that happens is a lot more (or less, but unlikely) files, and thus, file marks, get written\. But the math still works out the same\. The \-e flag is there to keep the number of file marks down because they can be slow (since they force the drive to flush all its buffers to physical media)\. +Volume capacity is determined by writing one large file until an error, interpereted as end\-of\-tape, is encountered\&. In the next phase, about 100 files are written to fill the tape\&. This second phase will write less data, because each filemark consumes some tape\&. With a little arithmetic, +\fBamtapetype\fR +calculates the size of these filemarks\&. .PP -All sorts of things might happen to cause the amount of data written to vary enough to generate a big file mark size guess\. A little more "shoe shining" because of the additional file marks (and flushes), dirt left on the heads from the first pass of a brand new tape, the temperature/humidity changed during the multi\-hour run, a different amount of data was written after the last file mark before EOT was reported, etc\. +All sorts of things might happen to cause the amount of data written to vary enough to generate a strange file mark size guess\&. A little more "shoe shining" because of the additional file marks (and flushes), dirt left on the heads from the first pass of a brand new tape, the temperature/humidity changed during the multi\-hour run, a different amount of data was written after the last file mark before EOT was reported, etc\&. .PP Note that the file mark size might really be zero for whatever device this is, and it was just the measured capacity variation that caused \fBamtapetype\fR -to think those extra file marks in pass 2 actually took up space\. +to think those extra file marks in pass 2 actually took up space\&. +.SH "Authors" .PP -It also explains why -\fBamtapetype\fR -used to sometimes report a negative file mark size if the math happened to end up that way\. When that happens now we just report it as zero\. -.SH "SEE ALSO" +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE .PP -\fBamanda\fR(8), -: http://wiki.zmanda.com +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amtoc.8 b/man/amtoc.8 index 045ff1d..65c997a 100644 --- a/man/amtoc.8 +++ b/man/amtoc.8 @@ -1,71 +1,229 @@ .\" Title: amtoc -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: +.\" Author: Nicolas Mayencourt +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English .\" -.TH "AMTOC" "8" "08/22/2008" "" "" +.TH "AMTOC" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l -.SH "NAME" -amtoc - generate TOC (Table Of Contents) for an Amanda run -.SH "SYNOPSIS" -.HP 6 +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amtoc \- generate TOC (Table Of Contents) for an \fIAmanda\fR run +.SH "Synopsis" +.fam C +.HP \w'\fBamtoc\fR\ 'u \fBamtoc\fR [\-a] [\-i] [\-t] [\-f\ \fIfile\fR] [\-s\ \fIsubs\fR] [\-w] [\-\-] \fIlogfile\fR +.fam .SH "DESCRIPTION" .PP \fIAmtoc\fR generates a table of contents for an \fIAmanda\fR -run\. It\'s a perl script (if you don\'t have perl, install it first!)\. +run\&. It\'s a perl script (if you don\'t have perl, install it first!)\&. .SH "OPTIONS" .PP \fB\-a\fR .RS 4 The output file name will be -\fIlabel\-of\-the\-tape\fR\.toc in the same directory as -\fIlogfile\fR\. +\fIlabel\-of\-the\-tape\fR\&.toc in the same directory as +\fIlogfile\fR\&. .RE .PP \fB\-i\fR .RS 4 Display help about -\fBamtoc\fR\. +\fBamtoc\fR\&. .RE .PP \fB\-t\fR .RS 4 -Generate the output in tabular form\. +Generate the output in tabular form\&. .RE .PP \fB\-f file\fR .RS 4 -Write the output to a file (\'\-\' for stdout)\. +Write the output to a file (\'\-\' for stdout)\&. .RE .PP \fB\-s subs\fR .RS 4 Evaluate the output file name from \fIsubs\fR, with $_ set to -\fIlabel\-of\-the\-tape\fR\. The +\fIlabel\-of\-the\-tape\fR\&. The \fB\-a\fR option is equivalent to \fB\-s\fR -\fI\'s/$_/\.toc/\'\fR\. +\fI\'s/$_/\&.toc/\'\fR\&. .RE .PP \fB\-w\fR .RS 4 -Separate tapes with form\-feeds and display blank lines before totals\. +Separate tapes with form\-feeds and display blank lines before totals\&. .RE .PP \fB\-\-\fR .RS 4 Marks the last option so the next parameter is the -\fIlogfile\fR\. +\fIlogfile\fR\&. .RE .PP \fBlogfile\fR @@ -80,7 +238,7 @@ The standard output has five fields separated by two spaces: 0 daily\-05: 19991005 \- \- 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 - \.\.\. + \&.\&.\&. 103 cuisg11:/ 19991005 0 4139136 103 total: \- \- 16716288 .fi @@ -91,7 +249,7 @@ In tabular format (\-t), this would look like: 0 daily\-05: 19991005 \- \- 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 - \.\.\. + \&.\&.\&. 103 cuisg11:/ 19991005 0 4139136 103 total: \- \- 16716288 .fi @@ -104,13 +262,13 @@ right after in the \fIcron job:\fR .nf -amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls \-1t $logdir/log\.*\.[0\-9] | head \-1` ; amtoc \-a $log +amdump daily ; logdir=`amgetconf daily logdir` ; log=`ls \-1t $logdir/log\&.*\&.[0\-9] | head \-1` ; amtoc \-a $log .fi .PP -which will generate /usr/local/etc/amanda//daily/\fItape_label\fR\.toc\. You may also want to call +which will generate /usr/local/etc/amanda//daily/\fItape_label\fR\&.toc\&. You may also want to call \fBamtoc\fR after an -\fIamflush\fR\. +\fIamflush\fR\&. .SH "SEE ALSO" .PP \fBamanda\fR(8), @@ -118,11 +276,11 @@ after an \fBamflush\fR(8), \fBamgetconf\fR(8), cron, perl, : http://wiki.zmanda.com -.SH "AUTHOR" +.SH "Authors" .PP -Nicolas Mayencourt -, University of Geneva/Switzerland : Original text +\fBNicolas Mayencourt\fR <\&Nicolas\&.Mayencourt@cui\&.unige\&.ch\&> +.RS 4 +University of Geneva/Switzerland +.RE .PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> diff --git a/man/amvault.8 b/man/amvault.8 new file mode 100644 index 0000000..5b36e39 --- /dev/null +++ b/man/amvault.8 @@ -0,0 +1,222 @@ +.\" Title: amvault +.\" Author: Dustin J. Mitchell +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMVAULT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amvault \- Copy \fIAmanda\fR dumps from one volume to another +.SH "Synopsis" +.fam C +.HP \w'\fBamvault\fR\ 'u +\fBamvault\fR [\-o\ \fIconfigoption\fR]... \fIconfig\fR \fIsrc\-run\-timestamp\fR \fIdst\-changer\fR \fIlabel\-template\fR +.fam +.SH "WARNING" +.PP +This application is not yet in its final form, and is subject to major revision in subsequent versions of Amanda\&. Backward compatibility is not guaranteed\&. +.PP +The significant limitations of this version of amvault are: tapetypes for secondary and tertiary volumes much match (including length and device_properties); tertiary volumes must be blank (manual erasure is required to re\-use tertiary media; restore/recover operations will request tertiary media by label when dumpfiles are not found on secondary media, but there is no provision to automatically fetch such media from a different changer; and all dumpfiles on a secondary volume are moved to tertiary media \- there is no provision to filter dumps\&. +.PP +Feedback on and patches to this application are invited and encouraged! +.SH "DESCRIPTION" +.PP +\fBAmvault\fR +Copies data from the run with timestamp +\fIsrc\-run\-timestamp\fR +onto volumes using the changer +\fIdst\-changer\fR, labeling new volumes with +\fIlabel\-template\fR\&. If +\fIsrc\-run\-timestamp\fR +is "latest", then the most recent amdump or amflush run will be used\&. +.PP +In a vaulting operation, the source media is referred to as "secondary media", while the destination is referred to as "tertiary media"\&. +.PP +Each source volume will be copied to a new destination volume; no re\-assembly or splitting will be performed\&. Destination volumes must be at least as large as the source volumes\&. +.PP +The changer parameter should specify the name of a changer defined in +\fBamanda.conf\fR(5)\&. For example: +.sp +.nf +define changer vaulting_tape { + tapedev "/dev/rmt/1n" + tpchanger "chg\-zd\-mtx" + changerdev "/dev/sg0" + changerfile "vaulting\-changer\&.conf" +} +.fi +.PP +The label template functions identically to the +\fIlabel\-new\-tapes\fR +parameter in +\fBamanda.conf\fR(5)\&. +.SH "SEE ALSO" +.PP +\fBamanda\fR(8) +.SH "Author" +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amverify.8 b/man/amverify.8 deleted file mode 100644 index d9ada11..0000000 --- a/man/amverify.8 +++ /dev/null @@ -1,64 +0,0 @@ -.\" Title: amverify -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: -.\" -.TH "AMVERIFY" "8" "08/22/2008" "" "" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -amverify - check an Amanda tape for errors -.SH "SYNOPSIS" -.HP 9 -\fBamverify\fR \fIconfig\fR [\fIslot\fR\ [\fIruntapes\fR]] -.SH "DESCRIPTION" -.PP -\fBAmverify\fR -reads an Amanda format tape and makes sure each backup image can be processed by -\fBamrestore\fR -and, if possible, the appropriate restore program (e\.g\. -\fBtar\fR)\. -.PP -\fBAmverify\fR -runs -\fBamrestore\fR -on each file of the tape and pipes the output to a restore program (if available) with an option to create a catalogue of the backup\. The catalogue itself is discarded\. Only the success or failure of the operation itself is reported\. -.PP -If the backup image cannot be processed by the restore program, e\.g\. if it was written on a different operating system, the image is sent through -\fBdd\fR -to /dev/null\. This still determines if the tape is readable, but does not do any internal consistency check on the image\. -.PP -If -\fIconfig\fR -is set up to use a tape changer, the -\fIslot\fR -argument may be used to choose the first tape to process\. Otherwise, the -\fBcurrent\fR -slot is used\. -.PP -The -\fBruntapes\fR -configuration parameter determines how many tapes are processed unless it is specified on the command line\. -.PP -See the -\fBamanda\fR(8) -man page for more details about Amanda\. -.SH "AUTHOR" -.PP -Axel Zinser - -: Original text -.PP -Stefan G\. Weichinger, -, maintainer of the -\fIAmanda\fR\-documentation: XML\-conversion -.SH "SEE ALSO" -.PP -\fBamrestore\fR(8), -\fBamanda\fR(8), -\fBamverifyrun\fR(8), -: http://wiki.zmanda.com diff --git a/man/amverifyrun.8 b/man/amverifyrun.8 deleted file mode 100644 index 8390574..0000000 --- a/man/amverifyrun.8 +++ /dev/null @@ -1,30 +0,0 @@ -.\" Title: amverifyrun -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 08/22/2008 -.\" Manual: -.\" Source: -.\" -.TH "AMVERIFYRUN" "8" "08/22/2008" "" "" -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH "NAME" -amverifyrun - check the tapes written by the last Amanda run -.SH "SYNOPSIS" -.HP 12 -\fBamverifyrun\fR \fIconfig\fR -.SH "DESCRIPTION" -.PP -\fBAmverifyrun\fR -read the log from the last -\fIAmanda\fR -run to find the slot of the first tape used and the number of tapes used\. It call -\fBamverify\fR -with these argument\. -.SH "SEE ALSO" -.PP -\fBamanda\fR(8), -\fBamverify\fR(8), -: http://wiki.zmanda.com diff --git a/man/amzfs-sendrecv.8 b/man/amzfs-sendrecv.8 new file mode 100644 index 0000000..e0d6168 --- /dev/null +++ b/man/amzfs-sendrecv.8 @@ -0,0 +1,268 @@ +.\" Title: amzfs-sendrecv +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMZFS\-SENDRECV" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amzfs-sendrecv \- Amanda script to create zfs sendrecv +.SH "DESCRIPTION" +.PP +amzfs\-sendrecv is an +\fIAmanda\fR +application implementing the Application API\&. It should not be run by users directly\&. It create a zfs snapshot of the filesystem and backup the snapshot with \'zfs send\'\&. Snapshot are kept after the backup is done, this increase the disk space use on the client but it is neccesary to be able do to incremental backup\&. If you want only full backup, you can disable this feature by setting the KEEP\-SNAPSHOT property to \'NO\'\&. Only the restoration of the complete backup is allowed, it is impossible to restore a single file\&. +.PP +The application is run as the amanda user, it must have many zfs priviledge: +.sp +.nf + zfs allow \-ldu AMANDA_USER mount,create,rename,snapshot,destroy,send,receive FILESYSTEM +.fi +.PP +Some system doesn\'t have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command: +.sp +.nf +usermod \-P "ZFS File System Management,ZFS Storage Management" AMANDA_USER +.fi +This will require that your run zfs under pfexec, set the PFEXEC property to YES\&. +.PP +The format of the DLE must be one of: +.sp +.nf +Desciption Example +\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- +Mountpoint /data +ZFS pool name datapool +ZFS filesystem datapool/database +ZFS logical volume datapool/dbvol +.fi +.PP +The filesystem doesn\'t need to be mounted\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control amzfs\-sendrecv\'s functionality\&. See +\fBamanda-applications\fR(7) +for information on the Application API, application configuration\&. +.PP +DF\-PATH +.RS 4 + +Path to the \'df\' binary, search in $PATH by default\&. +.RE +.PP +KEEP\-SNAPSHOT +.RS 4 + +If "YES" (the default), snapshot are kept after the backup, if set to "NO" then snapshot are no kept and incremental backup will fail\&. +.RE +.PP +ZFS\-PATH +.RS 4 + +Path to the \'zfs\' binary, search in $PATH by default\&. +.RE +.PP +PFEXEC\-PATH +.RS 4 + +Path to the \'pfexec\' binary, search in $PATH by default\&. +.RE +.PP +PFEXEC +.RS 4 + +If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used\&. +.RE +.SH "EXAMPLE" + + +In this example, a dumptype is defined to use amzfs\-sendrecv application to backup a zfs filesystem\&. +.nf + define application\-tool amzfs_sendrecv { + comment "amzfs\-sendrecv" + plugin "amzfs\-sendrecv" + #property "DF\-PATH" "/usr/sbin/df" + #property "KEEP\-SNAPSHOT" "YES" + #property "ZFS\-PATH" "/usr/sbin/zfs" + #property "PFEXEC\-PATH" "/usr/sbin/pfexec" + #property "PFEXEC" "NO" + } + + define dumptype user\-zfs\-sendrecv { + program "APPLICATAION" + application "amzfs_sendrecv" + } +.fi +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-client.conf\fR(5), +\fBamanda-applications\fR(7) +.SH "Author" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/amzfs-snapshot.8 b/man/amzfs-snapshot.8 new file mode 100644 index 0000000..ab76f1e --- /dev/null +++ b/man/amzfs-snapshot.8 @@ -0,0 +1,278 @@ +.\" Title: amzfs-snapshot +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "AMZFS\-SNAPSHOT" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +amzfs-snapshot \- Amanda script to create zfs snapshot +.SH "DESCRIPTION" +.PP +amzfs\-snapshot is an +\fIAmanda\fR +script implementing the Script API\&. It should not be run by users directly\&. It create a zfs snapshot of the filesystem where the path specified is mounted\&. +.PP +PRE\-DLE\-* create a snapshot and the POST_DLE_* destroy the snapshot, *\-DLE\-AMCHECK, *\-DLE\-ESTIMATE and *\-DLE\-BACKUP must be set to be executed on the client: +.sp +.nf + execute\-on pre\-dle\-amcheck, post\-dle\-amcheck, pre\-dle\-estimate, post\-dle\-estimate, pre\-dle\-backup, post\-dle\-backup + execute\-where client +.fi +.PP +The PRE_DLE_* script output a DIRECTORY property telling where the directory is located in the snapshot\&. The application must be able to use the DIRECTORY property, amgtar can do it\&. +.PP +The script is run as the amanda user, it must have the priviledge to create and destroy snapshot: +.sp +.nf + zfs allow \-ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM +.fi +.PP +Some system doesn\'t have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command: +.sp +.nf +usermod \-P "ZFS File System Management,ZFS Storage Management" AMANDA_USER +.fi +This will require that your run zfs under pfexec, set the PFEXEC property to YES\&. +.PP +The format of the DLE must be one of: +.sp +.nf +Desciption Example +\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\- +Mountpoint /data +Arbitrary mounted dir /data/interesting_dir +ZFS pool name datapool +ZFS filesystem datapool/database +ZFS logical volume datapool/dbvol +.fi +.PP +The filesystem must be mounted\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control amzfs\-snapshot\'s functionality\&. See +\fBamanda-scripts\fR(7) +for information on the Script API, script configuration\&. +.PP +DF\-PATH +.RS 4 + +Path to the \'df\' binary, search in $PATH by default\&. +.RE +.PP +ZFS\-PATH +.RS 4 + +Path to the \'zfs\' binary, search in $PATH by default\&. +.RE +.PP +PFEXEC\-PATH +.RS 4 + +Path to the \'pfexec\' binary, search in $PATH by default\&. +.RE +.PP +PFEXEC +.RS 4 + +If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used\&. +.RE +.SH "EXAMPLE" + + +In this example, a dumptype is defined to use amzfs\-snapshot script to create a snapshot and use amgtar to backup the snapshot\&. +.nf + define script\-tool amzfs_snapshot { + comment "backup of zfs snapshot" + plugin "amzfs\-snapshot" + execute\-on pre\-dle\-amcheck, post\-dle\-amcheck, pre\-dle\-estimate, post\-dle\-estimate, pre\-dle\-backup, post\-dle\-backup + execute\-where client + #property "DF\-PATH" "/usr/sbin/df" + #property "ZFS\-PATH" "/usr/sbin/zfs" + #property "PFEXEC\-PATH" "/usr/sbin/pfexec" + #property "PFEXEC" "NO" + } + + define dumptype user\-zfs\-amgtar { + dt_amgtar + script "amzfs_snapshot" + } +.fi +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-client.conf\fR(5), +\fBamanda-scripts\fR(7) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/disklist.5 b/man/disklist.5 new file mode 100644 index 0000000..bd1b95f --- /dev/null +++ b/man/disklist.5 @@ -0,0 +1,298 @@ +.\" Title: disklist +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: File formats and conventions +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "DISKLIST" "5" "01/22/2009" "Amanda 2\&.6\&.1" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +disklist \- List of partitions to back up for \fIAmanda\fR +.SH "DESCRIPTION" +.PP +The +\fIdisklist\fR +file determines which disks will be backed up by +\fIAmanda\fR\&. The file usually contains one line per disk: +.nf +\fIhostname diskname\fR [\fIdiskdevice\fR] \fIdumptype\fR [\fIspindle\fR [\fIinterface\fR] ] +.fi +.PP +All pairs [ +\fIhostname diskname\fR +] must be unique\&. +.PP +Lines starting with # are ignored, as are blank lines\&. The fields have the following meanings: +.PP +\fIhostname\fR +.RS 4 +The name of the host to be backed up\&. If +\fBdiskdevice\fR +refers to a PC share, this is the host +\fIAmanda\fR +will run the Samba +\fBsmbclient\fR +program on to back up the share\&. +.RE +.PP +\fIdiskname\fR +.RS 4 +The name of the disk (a label)\&. In most case, you set your +\fBdiskname\fR +to the +\fBdiskdevice\fR +and you don\'t set the +\fBdiskdevice\&.\fR +If you want multiple entries with the same +\fBdiskdevice\fR, you must set a different +\fBdiskname\fR +for each entry\&. It\'s the +\fBdiskname\fR +that you use on the commandline for any +\fIAmanda\fR +command\&. Look at the example/disklist file for example\&. +.RE +.PP +\fIdiskdevice\fR +.RS 4 +Default: same as diskname\&. The name of the disk device to be backed up\&. It may be a full device name, a device name without the +\FC/dev/\F[] +prefix, e\&.g\&. +\fIsd0a\fR, or a mount point such as +\FC/usr\F[]\&. +.sp +It may also refer to a PC share by starting the name with two (forward) slashes, e\&.g\&. +\FC//some\-pc/home\F[]\&. In this case, the +\fBprogram\fR +option in the associated +\fBdumptype\fR +must be entered as +\fBGNUTAR\fR\&. It is the combination of the double slash disk name and +\fBprogram GNUTAR\fR +in the +\fBdumptype\fR +that triggers the use of Samba\&. +.RE +.PP +\fIdumptype\fR +.RS 4 +Refers to a +\fBdumptype\fR +defined in the +\fBamanda\&.conf\fR +file\&. +\fIDumptype\fRs specify backup related parameters, such as whether to compress the backups, whether to record backup results in +\FC/etc/dumpdates\F[], the disk\'s relative priority, etc\&. +.RE +.PP +\fIspindle\fR +.RS 4 +Default: +\fB\-1\fR\&. A number used to balance backup load on a host\&. +\fIAmanda\fR +will not run multiple backups at the same time on the same spindle, unless the spindle number is \-1, which means there is no spindle restriction\&. +.RE +.PP +\fIinterface\fR +.RS 4 +Default: +\fIlocal\fR\&. The name of a network interface definition in the +\fBamanda\&.conf\fR +file, used to balance network load\&. +.RE +.PP +Instead of naming a +\fBdumptype\fR, it is possible to define one in\-line, enclosing +\fBdumptype\fR +options within curly braces, one per line, just like a +\fBdumptype\fR +definition in +\fBamanda\&.conf\fR\&. Since pre\-existing +\fBdumptype\fRs are valid option names, this syntax may be used to customize +\fBdumptype\fRs for particular disks\&. +.PP +A line break +\fBmust\fR +follow the left curly bracket\&. +.PP +For instance, if a +\fBdumptype\fR +named +\fInormal\fR +is used for most disks, but use of the holding disk needs to be disabled for the file system that holds it, this would work instead of defining a new dumptype: +.nf +\fIhostname diskname\fR [ \fIdiskdevice\fR ] { + normal + holdingdisk never +} [ \fIspindle\fR [ \fIinterface\fR ] ] +.fi +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/entities/global.entities b/man/entities/global.entities deleted file mode 100644 index 99f9e49..0000000 --- a/man/entities/global.entities +++ /dev/null @@ -1,99 +0,0 @@ - - -sgw@amanda.org'> - -jds@amanda.org'> -ian@zmanda.com'> -building@nap.edu'> -Amanda'> - - -amandad.debug'> -amanda.conf'> -amanda-client.conf'> -.amandahosts'> -disklist'> -/etc/amandapass'> -/etc/inetd.conf'> -tapelist'> - - -/etc/dumpdates'> - - -amadmin'> -amaespipe'> -amcheck'> -amcheckdb'> -amcleanup'> -amcrypt'> -amcryptsimple'> -amcrypt-ossl'> -amcrypt-ossl-asym'> -amgpgcrypt'> -amdd'> -amaddclient'> -amdump'> -amflush'> -amgetconf'> -amlabel'> -ammt'> -amoverview'> -amplot'> -amrecover'> -amreport'> -amrestore'> -amrmtape'> -amserverconfig'> -amstatus'> -amtape'> -amtapetype'> -amtoc'> -amverify'> -amverifyrun'> - -amandad'> -amandaidx'> -amgetidx'> -amidxtape '> -amidxtaped'> -amindexd'> -amtrmidx'> -calcsize'> -driver'> -dumper'> -planner'> -reporter'> -runtar'> -selfcheck'> -sendbackup'> -sendsize'> -taper'> - - -mt'> -mtx'> -tar'> -GNU-tar'> -GNU-zip'> - -dump'> -restore'> - -dd'> -cpio'> - -gcc'> -configure'> -make'> -ssh'> -rsh'> -inetd'> -xinetd'> -lsof'> - -runtapes'> -dumpers'> -dumptype'> -dumpcycle'> diff --git a/man/entities/global.entities.in b/man/entities/global.entities.in new file mode 100644 index 0000000..619bb6f --- /dev/null +++ b/man/entities/global.entities.in @@ -0,0 +1,153 @@ + + + +Amanda'> +@VERSION@'> +File formats and conventions'> +Miscellanea'> +System Administration Commands'> + + + + Zmanda, Inc. + http://www.zmanda.com'> + + National Academies Press'> + + Trusted Information Systems'> + + University of Geneva/Switzerland'> + + +Dustin J. Mitchell + &affil.zmanda; + dustin@zmanda.com'> +Jean-Louis Martineau + &affil.zmanda; + martineau@zmanda.com'> +Stefan G. Weichinger + sgw@amanda.org'> +Stefan G. Weichinger + XML-conversion + sgw@amanda.org'> +Ian Turner + &affil.zmanda; + ian@zmanda.com'> +James da Silva + jds@amanda.org'> +John Stange + &affil.nap; + building@nap.edu'> +Kevin Till + &affil.zmanda; + kevin.till@zmanda.com'> +Dan Locks + &affil.zmanda; + dwlocks@zmanda.com'> +Nikolas Coukouma + &affil.zmanda; + atrus@zmanda.com'> +Adrian T. Filipi-Martin + atf3r@cs.virginia.edu'> +Alan M. McIvor + alan@kauri.auck.irl.cri.nz'> +Olafur Gudmundsson + &affil.tis; + ogud@tis.com'> +Nicolas Mayencourt + &affil.unigech; + Nicolas.Mayencourt@cui.unige.ch'> +Paul Yeatman + &affil.zmanda; + pyeatman@zmanda.com'> + + + +Amanda'> + + +amanda.conf5'> +amanda-client.conf5'> +.amandahosts'> +disklist5'> +/etc/amandapass'> +/etc/inetd.conf'> +tapelist5'> + + +/etc/dumpdates'> + + +amadmin'> +amaespipe'> +amcheck'> +amcheckdb'> +amcleanup'> +amcrypt'> +amcryptsimple'> +amcrypt-ossl'> +amcrypt-ossl-asym'> +amgpgcrypt'> +amdd'> +amaddclient'> +amdump'> +amflush'> +amgetconf'> +amlabel'> +ammt'> +amoverview'> +amplot'> +amrecover'> +amreport'> +amrestore'> +amrmtape'> +amserverconfig'> +amstatus'> +amtape'> +amtapetype'> +amtoc'> + +amandad'> +amandaidx'> +amgetidx'> +amidxtape '> +amidxtaped'> +amindexd'> +amtrmidx'> +calcsize'> +driver'> +dumper'> +planner'> +reporter'> +runtar'> +selfcheck'> +sendbackup'> +sendsize'> +taper'> + + +mt'> +mtx'> +tar'> +GNU-tar'> +GNU-zip'> + +dump'> +restore'> + +dd'> +cpio'> + +gcc'> +configure'> +make'> +ssh'> +rsh'> +inetd'> +xinetd'> +lsof'> + +runtapes'> +dumpers'> +dumptype'> +dumpcycle'> diff --git a/man/script-email.8 b/man/script-email.8 new file mode 100644 index 0000000..d548a56 --- /dev/null +++ b/man/script-email.8 @@ -0,0 +1,227 @@ +.\" Title: script-email +.\" Author: Jean-Louis Martineau +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: System Administration Commands +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "SCRIPT\-EMAIL" "8" "01/22/2009" "Amanda 2\&.6\&.1" "System Administration Commands" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +script-email \- Amanda script to send email notifications +.SH "DESCRIPTION" +.PP +script\-email is an +\fIAmanda\fR +script implementing the Script API\&. It should not be run by users directly\&. It sends a notification email to the addresses specified in the MAILTO property\&. +.SH "PROPERTIES" +.PP +This section lists the properties that control script\-email\'s functionality\&. See +\fBamanda-scripts\fR(7) +for information on the Script API, script configuration\&. +.PP +MAILTO +.RS 4 + +List of email addresses that will receive an email on command execution\&. It is a multi\-valued property: +.nf + property "MAILTO" "amanda@domain\&.com" "sysadmin@domain\&.com" "amandauser@domain\&.com" +.fi +.RE +.SH "EXAMPLE" + + +In this example, script\-email is scheduled to be run before the DLE, on the +server\&. The unqualified email address \fIamanda\fR will be +passed to the email system unchanged\&. The script is then attached to a +dumptype, which can then be specified for any DLEs which require notification\&. +.nf + define script\-tool pre\-email { + comment "email me before this DLE is backed up" + plugin "script\-email" + execute\-on pre\-dle\-backup + execute\-where server + property "mailto" "amanda" + } + + define dumptype user\-tar\-email { + user\-tar + script "pre\-email" + } +.fi +.SH "SEE ALSO" +.PP + +\fBamanda.conf\fR(5), +\fBamanda-client.conf\fR(5), +\fBamanda-scripts\fR(7) +.SH "Authors" +.PP +\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/tapelist.5 b/man/tapelist.5 new file mode 100644 index 0000000..5d2ffb3 --- /dev/null +++ b/man/tapelist.5 @@ -0,0 +1,216 @@ +.\" Title: tapelist +.\" Author: James da Silva +.\" Generator: DocBook XSL Stylesheets v1.74.0 +.\" Date: 01/22/2009 +.\" Manual: File formats and conventions +.\" Source: Amanda 2.6.1 +.\" Language: English +.\" +.TH "TAPELIST" "5" "01/22/2009" "Amanda 2\&.6\&.1" "File formats and conventions" +.\" ----------------------------------------------------------------- +.\" * (re)Define some macros +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" toupper - uppercase a string (locale-aware) +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de toupper +.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ +\\$* +.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH-xref - format a cross-reference to an SH section +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de SH-xref +.ie n \{\ +.\} +.toupper \\$* +.el \{\ +\\$* +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SH - level-one heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SH +.\" put an extra blank line of space above the head in non-TTY output +.if t \{\ +.sp 1 +.\} +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[an-margin]u +.ti 0 +.HTML-TAG ".NH \\n[an-level]" +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +\." make the size of the head bigger +.ps +3 +.ft B +.ne (2v + 1u) +.ie n \{\ +.\" if n (TTY output), use uppercase +.toupper \\$* +.\} +.el \{\ +.nr an-break-flag 0 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 +.in \\n[an-margin]u +.ti 0 +.\" if not n (not TTY), put a border/line under subheading +.sp -.6 +\l'\n(.lu' +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" SS - level-two heading that works better for non-TTY output +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de1 SS +.sp \\n[PD]u +.nr an-level 1 +.set-an-margin +.nr an-prevailing-indent \\n[IN] +.fi +.in \\n[IN]u +.ti \\n[SN]u +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.ps \\n[PS-SS]u +\." make the size of the head bigger +.ps +2 +.ft B +.ne (2v + 1u) +.if \\n[.$] \&\\$* +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BB/BE - put background/screen (filled box) around block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BB +.if t \{\ +.sp -.5 +.br +.in +2n +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EB +.if t \{\ +.if "\\$2"adjust-for-leading-newline" \{\ +.sp -1 +.\} +.br +.di +.in +.ll +.gcolor +.nr BW \\n(.lu-\\n(.i +.nr BH \\n(dn+.5v +.ne \\n(BHu+.5v +.ie "\\$2"adjust-for-leading-newline" \{\ +\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.el \{\ +\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] +.\} +.in 0 +.sp -.5v +.nf +.BX +.in +.sp .5v +.fi +.\} +.. +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" BM/EM - put colored marker in margin next to block of text +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.de BM +.if t \{\ +.br +.ll -2n +.gcolor red +.di BX +.\} +.. +.de EM +.if t \{\ +.br +.di +.ll +.gcolor +.nr BH \\n(dn +.ne \\n(BHu +\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] +.in 0 +.nf +.BX +.in +.fi +.\} +.. +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "Name" +tapelist \- The list of \fIAmanda\fR volumes in use +.SH "DESCRIPTION" +.PP +The +\fItapelist\fR +file contains the list of tapes in active use\&. This file is not ordinarily ordinarily edited or examined manually\&. Its format may change, or it may be removed altogether, in future versions of +\fIAmanda\fR\&. It contains lines of the form: +.PP +.nf +YYYYMMDD label flags [#comment] +.fi +.PP +Where +\fIYYYYMMDD\fR +is the date the tape was written, +\fIlabel\fR +is a label for the tape as written by +\fBamlabel\fR +and +\fIflags\fR +is one of "reuse" or "no\-reuse" and tells +\fIAmanda\fR +whether the tape may be reused\&. A non\-reusable tape will not be overwritten, even if it is older than +\fBdumpcycle\fR +dumps\&. See the +\fBreuse\fR +options of +\fBamadmin\fR(8)\&. The optional comment is prefixed with a \'#\' and continues to the end of the line\&. Amanda will maintain this comment until the tape is overwritten\&. Note that comments are not allowed on blank lines\&. +.PP +\fBAmdump\fR +and +\fBamflush\fR +will by default refuse to write to an unlabeled tape, or to a labeled tape that is considered active or marked "no\-reuse"\&. There must be more tapes in active rotation (see the +\fBtapecycle\fR +option) than there are runs in the backup cycle (see the +\fBdumpcycle\fR +option) to prevent overwriting a backup image that would be needed to do a full recovery\&. +.SH "Authors" +.PP +\fBJames da Silva\fR <\&jds@amanda\&.org\&> +.PP +\fBStefan G\&. Weichinger\fR <\&sgw@amanda\&.org\&> +.PP +\fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&> +.RS 4 +Zmanda, Inc\&. (\FChttp://www\&.zmanda\&.com\F[]) +.RE diff --git a/man/xml-source/amaddclient.8.xml b/man/xml-source/amaddclient.8.xml index 36bb72a..926a837 100644 --- a/man/xml-source/amaddclient.8.xml +++ b/man/xml-source/amaddclient.8.xml @@ -1,4 +1,3 @@ - amaddclient 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amaddclient program to add client to an existing &A; configuration + +&author.ktill; + @@ -46,7 +51,8 @@ After Amanda rpms are successfully installed and &amserverconfig; is run, &amaddclient; will add client to the &A; configuration. -&amaddclient; create or update &A; disklist file and create or update +&amaddclient; create or update &A; &disklist; +file and create or update /var/lib/amanda/.amandahosts file on the server. If --no-client-update is not specified, &amaddclient; will attempt to update or create /var/lib/amanda/.amandahost, @@ -94,8 +100,8 @@ Example: --conf=v253, --client client8.zmanda.com -Modify existing entry in the disklist file. -Note: if disklist file has been modified manually, this option might not work. +Modify existing entry in the &disklist; file. +Note: if &disklist; file has been modified manually, this option might not work. @@ -162,7 +168,7 @@ set, this program will attempt to create the directory on the client. -If any of the following four options are used, &amaddclient; will extend the dumptype definition to an in-line definition in the disklist file. See amanda8 DISKLIST FILE section for detail. +If any of the following four options are used, &amaddclient; will extend the dumptype definition to an in-line definition in the &disklist; file. @@ -266,12 +272,6 @@ Specify either --excludefile or --excludelist. On success, zero is returned. On error, 1 is returned. -AUTHOR - - The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). - - - SEE ALSO amanda8, amanda.conf5, diff --git a/man/xml-source/amadmin.8.xml b/man/xml-source/amadmin.8.xml index 7efd519..64153d4 100644 --- a/man/xml-source/amadmin.8.xml +++ b/man/xml-source/amadmin.8.xml @@ -10,14 +10,22 @@ + amadmin 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amadmin administrative interface to control &A; backups + +&author.jds; +&author.sgw.xml; + @@ -43,10 +51,10 @@ man page for more details about &A;. COMMANDS Commands that take a hostname [ disks ] -parameter pair operate on all disks in the disklist for that +parameter pair operate on all disks in the &disklist; for that hostname if no disks are specified. Where hostname is also marked as being optional, -the command operates on all hosts and disks in the disklist. +the command operates on all hosts and disks in the &disklist;. Both hostname and disks are special expressions; see the "HOST & DISK EXPRESSION" section of amanda8 @@ -144,7 +152,7 @@ security to be sure amanda will not overwrite them. - find [ hkdlpb ] [ hostname [ disks ]* ]* + find [ hkdlpbfw ] [ hostname [ disks ]* ]* Display all backups currently on tape or in the holding disk. The tape label or holding disk filename, @@ -154,14 +162,16 @@ and status are displayed. h: host name k: disk name -d: dump date +d: dump timestamp l: backup level p: dump part b: tape label +f: filenum on tape +w: write timestamp An uppercase letter reverses the sort order for that key. -The default sort order is hkdlpb. +The default sort order is hkdlpbfw. @@ -204,8 +214,7 @@ The default sort order is hkdlpb. on hostname from the &A; database. -If you do not also remove the disk from the -disklist +If you do not also remove the disk from the &disklist; file, &A; will treat it as a new disk during the next run. @@ -252,8 +261,7 @@ and insert them into the database on this machine. disklist [ hostname [ disks ]* ]* -Display the -disklist +Display the &disklist; information for each of the disks on @@ -361,14 +369,13 @@ date host disk lv tape or file file part status /workspace disk on machine-d. -If you do not also remove the disk from the -disklist +If you do not also remove the disk from the &disklist; file, &A; will treat it as a new disk during the next run. $ amadmin daily delete machine-d /workspace amadmin: machine-d:/workspace deleted from database. -amadmin: NOTE: you'll have to remove these from the disklist yourself. +amadmin: NOTE: you'll have to remove these from the &disklist; yourself. Find the next tape &A; will use (in this case, 123456). @@ -429,11 +436,6 @@ TOTAL 241 12412187 7316312 731631 (estimated 8 runs per dumpcycle) /usr/local/etc/amanda/config/amanda.conf -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amcheck8, diff --git a/man/xml-source/amaespipe.8.xml b/man/xml-source/amaespipe.8.xml index b3c87f0..7740f0c 100755 --- a/man/xml-source/amaespipe.8.xml +++ b/man/xml-source/amaespipe.8.xml @@ -11,11 +11,17 @@ amaespipe 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amaespipe wrapper program for aespipe + +&author.ktill; + @@ -38,8 +44,6 @@ During decryption, &amaespipe; autodects encryption type and hash function from the encrypted image. - - SEE ALSO amanda8, amanda.conf5, diff --git a/man/xml-source/amanda-applications.7.xml b/man/xml-source/amanda-applications.7.xml new file mode 100644 index 0000000..c59f6be --- /dev/null +++ b/man/xml-source/amanda-applications.7.xml @@ -0,0 +1,65 @@ + + + + %global_entities; +]> + + + + +amanda-applications +7 +&rmi.source; +&rmi.version; +&rmi.manual.7; + + +amanda-applications +Application-api for amanda + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +Describe how to use application with &A; + + +APPLICATIONS + +This section lists the applications included with &A;. See the individual man pages for instructions on using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. + + + +amgtar8, +- use GNU Tar to backup and restore data. + + +amsamba8, +- use smbclient to backup and restore data. + + +amstar8, +- use star to backup and restore data. + + +amzfs-sendrecv8, +- use zfs to create a snapshot and use 'zfs send' to generate the backup. + + + + + +SEE ALSO + +amanda.conf5 + + + + diff --git a/man/xml-source/amanda-archive-format.5.xml b/man/xml-source/amanda-archive-format.5.xml new file mode 100644 index 0000000..d7b729a --- /dev/null +++ b/man/xml-source/amanda-archive-format.5.xml @@ -0,0 +1,89 @@ + + + + %global_entities; +]> + + + + +amanda-archive-format +5 +&rmi.source; +&rmi.version; +&rmi.manual.5; + + +amanda-archive-format +Format of amanda archive streams + + +&author.dustin; + + + +DESCRIPTION + +The &A; archive format is designed to be a simple, efficient means of interleaving multiple simultaneous files, allowing an arbitrary number of data streams for a file. It is a streaming format in the sense that the writer need not know the size of files until they are completely written to the archive, and the reader can process the archive in constant space. + + + +DATA MODEL + +The data stored in an archive consists of an unlimited number of files. Each file consists of a number of "attributes", each identified by a 16-bit ID. Each attribute can contain an unlimited amount of data. + +Attribute IDs less than 16 (AMAR_ATTR_APP_START) are reserved for special purposes, but the remaining IDs are available for application-specific uses. + + + +STRUCTURE + +RECORDS + +A record can be either a header record or a data record. A header record serves as a "checkpoint" in the file, with a magic value that can be used to recognize archive files. + +A header record has a fixed size of 28 bytes, as follows: + + 28 bytes: magic string + +The magic string is the ASCII text "AMANDA ARCHIVE FORMAT " followed by a decimal representation of the format version number (currently '1'), padded to 28 bytes with NUL bytes. + +A data record has a variable size, as follows: + + 2 bytes: file number + 2 bytes: attribute ID + 4 bytes: data size (N) + N bytes: data + +The file number and attribute ID serve to identify the data stream to which this data belongs. The low 31 bits of the data size give the number of data bytes following, while the high bit (the EOA bit) indicates the end of the attribute, as described below. Because records are generally read into memory in their entirety, the data size must not exceed 4MB (4194304 bytes). All integers are in network byte order. + +A header record is distinguished from a data record by the magic string. The file number 0x414d, corresponding to the characters "AM", is forbidden and must be skipped on writing. + +Attribute ID 0 (AMAR_ATTR_FILENAME) gives the filename of a file. This attribute is mandatory for each file, must be nonempty, must fit in a single record, and must precede any other attributes for the same file in the archive. The filename should be a printable string (ASCII or UTF-8), to facilitate use of generic archive-display utilities, but the format permits any nonempty bytestring. The filename cannot span multiple records. + +Attribute ID 1 (AMAR_ATTR_EOF) signals the end of a file. This attribute must contain no data, but should have the EOA bit set. + + + +CONNECTION TO DATA MODEL + +Each file in an archive is assigned a file number distinct from any other active file in the archive. The first record for a file must have attribute ID 0 (AMAR_ATTR_FILENAME), indicating a filename. A file ends with an empty record with ID 1 (AMAR_ATTR_EOF). For every file at which a reader might want to begin reading, the filename record should be preceded by a header record. How often to write header records is left to the discretion of the application. + +All data records with the same file number and attribute ID are considered a part of the same attribute. The boundaries between such records are not significant to the contents of the attribute, and both readers and writers are free to alter such boundaries as necessary. + +The final data record for each attribute has the high bit (the EOA bit) of its data size field set. A writer must not reuse an attribute ID within a file. An attribute may be terminated by a record containing both data and an EOA bit, or by a zero-length record with its EOA bit set. + + + + + +SEE ALSO + +amanda8, + + + + diff --git a/man/xml-source/amanda-auth.7.xml b/man/xml-source/amanda-auth.7.xml new file mode 100644 index 0000000..0fb1715 --- /dev/null +++ b/man/xml-source/amanda-auth.7.xml @@ -0,0 +1,535 @@ + + + + %global_entities; +]> + + + + + amanda-auth + 7 +&rmi.source; +&rmi.version; +&rmi.manual.7; + + + amanda-auth + Communication/Authentication methods between &A; server and client + + + &author.jlm; + &author.dustin; + &author.pby; + + + + +DESCRIPTION + &A; offers 7 methods of communication between Amanda server (sometimes also called the tape server) and clients, each with its own authentication method. The desired communication method is specified by the auth parameter in the amanda.conf file (&amconf;) commonly as a dumptype. Valid values to the auth parameter are bsd, bsdudp, bsdtcp, krb4, krb5, local, rsh, and ssh. Please note that krb4 will be removed in the next release. The authentication and communication method is used during the backup process &amdump; (amdump(8)) as well as the recovery process &amrecover; (amrecover(8)). For detailed information, please see http://wiki.zmanda.com/index.php/Server/Client_authentication. + + +COMPILATION AND GENERAL INFORMATION + The communication method and thus type of authentication that will be used by the Amanda server is specified by the auth parameter in the dumptype for each disklist entry (DLE). The auth parameter thus may be easily and globally specified in the "global" dumptype. If auth is not specified, the bsd communication method is used. See &amconf; for more information on Amanda configuration and dumptypes, and &disklist; for more information on disklists. + +On the client side, the Amanda daemon &amandad; validates the connection depending on the value of the auth argument passed to it (see &A;(8)). Also, when it comes to recovery, the auth parameter can be specified in the &amclientconf; file to specify the communication method to be used by the client to the server. + + When &A; is being built from source code, desired communication and thus authentication methods (shown as "Authentication") must be specified as configure options at compilation time. + +Authentication Configure option(s) + bsd --with-bsd-security --with-amandahosts (pre-2.6) + bsdtcp --with-bsdtcp-security --with-amandahosts (pre-2.6) + bsdudp --with-bsdudp-security --with-amandahosts (pre-2.6) + krb5 --with-krb5-security + local (always included) + rsh --with-rsh-security + ssh --with-ssh-security + + + +There are additional configure options for bsd, bsdudp, and bsdtcp to allow for specifying explicit UDP and TCP port ranges. + + + --with-udpportrange + --with-tcpportrange + --with-low-tcpportrange + + + +See PORT USAGE below for more information. + +There are additional configure options for Kerberos if you so desire. All but the last option are for Kerberos 4. Defaults shown in square brackets. + + + --with-server-principal=ARG server host principal [amanda] + --with-server-instance=ARG server host instance [] + --with-server-keyfile=ARG server host key file [/.amanda] + --with-client-principal=ARG client host principal [rcmd] + --with-client-instance=ARG client host instance [HOSTNAME_INSTANCE] + --with-client-keyfile=ARG client host key file [KEYFILE] + --with-ticket-lifetime=ARG ticket lifetime [128] + --with-krb4-security=DIR where libkrb.a lives [see below] + --with-krb5-security=DIR where libkrb.a lives [see below] + + + +If configuring with --with-krb4-security and/or --with-krb5-security, the configure script will search under /usr/kerberos/lib, /usr/cygnus/lib, /usr/lib, and /opt/kerberos/lib for the kerberos bits, libkrb.a, in this order. Kerberos support will not be added if it does not find them. If the kerberos bits are found under some other hierarchy, you can specify this via --with-krb5-security=DIR and/or --with-krb4-security=DIR, where DIR is where the kerberos bits live. The configure script will then look in the 'lib' directory under this hierarchy for libkrb.a. + +The auth parameter selects a communication/authentication method to use between the client and the backup server. These methods are described each in their own section below. + + +BSD, BSDUDP, AND BSDTCP COMMUNICATION AND AUTHENTICATION +For more detail, see http://wiki.zmanda.com/index.php/Configuring_bsd/bsdudp/bsdtcp_authentication. + + The bsd, bsdudp, and bsdtcp communication methods use either UDP, TCP, or both protocols operating as a network service to authenticate and exchange data between server and clients. + + In addition to compilation and general configuration (see COMPILATION AND GENERAL INFORMATION above), the authentication method that the client is configured to receive is specified by the auth parameter in the network service configuration for &A;. The authentication method used by an Amanda client to reach the server during recovery is the authentication method specified by the auth parameter in the client's Amanda network service configuration or in its amanda-client.conf file (see amanda-client.conf(5)). + + .amandahosts file + Servers and clients using the bsd, bsdudp, and bsdtcp authentication methods refer to the .amandahosts file to control access. Amanda should be compiled for this access control if one of these methods will be used and is the default compilation option for Amanda 2.6 (use --with-amandahosts when compiling pre-2.6 versions of Amanda). + + Amanda looks for the .amandahosts file in the Amanda user's home directory, commonly /var/lib/amanda. + + Each authorization is on its own line in the following format + +hostname [ username [ service... ] ] + +If username is ommitted, it defaults to the user running amandad, i.e. the user listed in the inetd or xinetd +configuration file. + +service... is a space-delimited list of services the client is authorized to execute: + +noop, +selfcheck, +sendsize, + +sendbackup, +amdump (a shortcut for the previous four services which are required on clients), +amindexd, and +amidxtaped. The last two services are required on a server for clients to connect to it using amrecover. + + Example of the .amandahosts file on an Amanda client + + + amandaserver.example.com amandabackup amdump + + + + Example of the .amandahosts file on an Amanda server + + + amandaclient1.example.com root amindexd amidxtaped + + + + + bsd communication and authentication + The authentication is done using .amandahosts file in the Amanda user's home directory. The protocol between Amanda server and client is UDP. The number of disk list entries (DLEs)--number of Amanda clients--is limited by the UDP packet size. This authentication protocol will use a different port for each data stream (see PORT USAGE below) + + + bsdudp communication and authentication + The authentication is done using .amandahosts files in the Amanda user's home directory. It uses UDP protocol between Amanda server and client for data and hence the number of DLEs is limited by the UDP packet size. It uses one TCP port to establish the connection and multiplexes all data streams using one port on the server (see PORT USAGE below). + + + bsdtcp communication and authentication + The authentication is done using .amandahosts files in the backup user's (for example: amandabackup) home directory. It uses TCP protocol between Amanda server and client. On the client, two reserved ports are used. On the server, all data streams are multiplexed to one port (see PORT USAGE below). + + + USING INETD SERVER + Template for Amanda client inetd service entry + + + service_name socket_type protocol wait/nowait amanda_backup_user absolute_path_to_amandad amandad server_args + + + Client example of using bsd authorization for inetd server given Amanda user is "amandabackup": + + + amanda dgram udp wait amandabackup /path/to/amandad amandad -auth=bsd amdump + + + The same could be used for bsdudp if specifying -auth=bsdudp instead of -auth=bsd. + Client example of using bsdtcp authorization for inetd server given Amanda user is "amandabackup": + + + amanda stream tcp nowait amanda /path/to/amandad amandad -auth=bsdtcp amdump + + + amindexd and amidxtaped would typically be added at the end of the line as &amandad; server arguments for an Amanda server. + Server example of using bsdtcp authorization for inetd server given Amanda user is "amandabackup": + + + amanda stream tcp nowait amanda /path/to/amandad amandad -auth=bsdtcp amdump amindexd amidxtaped + + + For Amanda version 2.5.0 and earlier, remember that neither bsdudp nor bsdtcp are supported and the Amanda daemon &amandad; accepts no arguments. Because of the latter, &amrecover; as of Amanda version 2.5.1 is not compatible with 2.5.0 and earlier servers. Thus, servers that are 2.5.0 or earlier must, in addition to the amanda service, run amindexd and amidxtaped Amanda services as their own network services, amandaidx and amidxtape, respectively (see below). + +There are no compatibility issues if server and clients are all 2.5.0 or earlier. If your server is 2.5.1 or later, you can still have clients that are 2.5.0 and earlier although you must then use bsd communication/authentication with these clients and must also run amindexd and amidxtaped Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below). If you have a server that is 2.5.0 and earlier, clients of a later version on which you wish to run &amrecover; must use amoldrecover instead and, again, the server must be running the amandaidx and amidxtape network services. + +Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2.5.0 or earlier server or a newer server having 2.5.0 or earlier clients + + + amandaidx stream tcp nowait amanda /usr/local/libexec/amanda/current/amindexd amindexd + amidxtape stream tcp nowait amanda /usr/local/libexec/amanda/current/amidxtaped amidxtaped + + + + + USING XINETD SERVER + Template for Amanda client xinetd service file + + +service amanda +{ + only_from = Amanda server + socket_type = socket type + protocol = protocol + wait = yes/no + user = amanda backup user + group = amanda backup user group id + groups = yes + server = absolute path to amandad + server_args = amandad server arguments + disable = no +} + + + The only_from parameter can be used with xinetd but is usually in addition to the primary form of access control via the .amandahosts file. + Client example of using bsd authorization for xinetd server and for Amanda user "amandabackup": + + +service amanda +{ + only_from = amandaserver.example.com + socket_type = dgram + protocol = udp + wait = yes + user = amandabackup + group = disk + groups = yes + server = /path/to/amandad + server_args = -auth=bsd amdump + disable = no +} + + + The same could be used for bsdudp if specifying -auth=bsdudp instead of -auth=bsd. + Client example of using bsdtcp authorization for xinetd server and for Amanda user "amandabackup": + + +service amanda +{ + only_from = amandaserver.example.com amandaclient.example.com + socket_type = stream + protocol = tcp + wait = no + user = amandabackup + group = disk + groups = yes + server = /path/to/amandad + server_args = -auth=bsdtcp amdump + disable = no +} + + + amindexd and amidxtaped would typically be added as additional &amandad; server_args for an Amanda server. + For Amanda version 2.5.0 and earlier, remember that neither bsdudp nor bsdtcp are supported and the Amanda daemon &amandad; accepts no arguments. Because of the latter, &amrecover; as of Amanda version 2.5.1 is not compatible with 2.5.0 and earlier servers. Thus, servers that are 2.5.0 or earlier must, in addition to the amanda service, run amindexd and amidxtaped Amanda services as their own network services, amandaidx and amidxtape, respectively (see below). + +There are no compatibility issues if server and clients are all 2.5.0 or earlier. If your server is 2.5.1 or later, you can still have clients that are 2.5.0 and earlier although you must then use bsd communication/authentication with these clients and must also run amindexd and amidxtaped Amanda services on the server as their own network services, amandaidx and amidxtape, respectively (see below). If you have a server that is 2.5.0 and earlier, clients of a later version on which you wish to run &amrecover; must use amoldrecover instead and, again, the server must be running the amandaidx and amidxtape network services. + +Example of amindexd and amidxtaped Amanda daemon services configured as their own network services for a 2.5.0 or earlier server or a newer server having 2.5.0 or earlier clients + +service amandaidx +{ + socket_type = stream + protocol = tcp + wait = no + user = amanda + group = disk + server = /usr/local/libexec/amanda/amindexd + disable = no +} + +service amidxtape +{ + socket_type = stream + protocol = tcp + wait = no + user = amanda + group = disk + server = /usr/local/libexec/amanda/amidxtaped + disable = no +} + + + + + + PORT USAGE + List of TCP/UDP ports used by network service communication methods for Amanda server and client. + + + Key: + UP = Unreserved Port + RPpAP = Reserved Port per Amanda Process + UPpDLE = Unreserved Port per DLE + [..] = Configure options that can be used at compile time to define port ranges + +Authentication Protocol Amanda server Amanda client +bsd udp 1 RPpAP [--with-udpportrange] 10080 + tcp 1 UP [--with-tcpportrange] 3 UPpDLE [--with-tcpportrange] +bsdudp udp 1 RPpAP [--with-udpportrange] 10080 + tcp 1 UP [-with-tcpportrange] 1 UPpDLE [--with-tcpportrange] +bsdtcp tcp 1 RPpAP [--with-low-tcpportrange] 10080 + + + Amanda server also uses two ports (dumper process) to communicate with the chunker/taper processes. These ports are in the range set by --with-tcpportrange. +You can override the default port ranges that Amanda was compiled with in each configuration using the reserved-udp-port, reserved-tcp-port, and unreserved-tcp-port parameters in amanda.conf and amanda-client.conf configuration files (see &amconf; and &amclientconf;). + + + +KERBEROS COMMUNICATION AND AUTHENTICATION +For more detail, see http://wiki.zmanda.com/index.php/Kerberos_authentication. + +Amanda supports Kerberos 4 and 5 communication methods between Amanda server and client. Please note, however, that support for Kerberos 4 will be removed in the next release. + +General information including compilation are given above (see COMPILATION AND GENERAL INFORMATION above). Below sections give specific Kerberos 4 and 5 information. + +KERBEROS v4 +Please note that support for Kerberos 4 will be removed in the next release. + +Kerberos 4 uses UDP protocol and the number of DLEs is limited by UDP packet size. + +The kerberized AMANDA service uses a different port on the client hosts. The /etc/services line is: + + kamanda 10081/udp + +And the /etc/inetd.conf line is: + + + kamanda dgram udp wait root /usr/local/libexec/amanda/amandad amandad -auth=krb4 + + + +Note that you're running this as root, rather than as your dump user. AMANDA will set its uid down to the dump user at times it doesn't need to read the srvtab file, and give up root permissions entirely before it goes off and runs dump. Alternately you can change your srvtab files to be readable by user amanda. + +The following dumptype options apply to krb4: + + +auth "krb4" # use krb4 auth for this host + # (you can mingle krb hosts and bsd .rhosts in one conf) +kencrypt # encrypt this filesystem over the net using the krb4 + # session key. About 2x slower. Good for those root + # partitions containing your keyfiles. Don't want to + # give away the keys to an ethernet sniffer! + # This is currently always enabled. There is no + # way to disable it. This is a bug. + + + + +KERBEROS v5 +Kerberos 5 uses TCP and the server uses only one TCP port and data streams are multiplexed to this port. + +The krb5 driver script defaults to: + +/* + * The lifetime of our tickets in minutes. + */ +#define AMANDA_TKT_LIFETIME (12*60) + +/* + * The name of the service in /etc/services. + */ +#define AMANDA_KRB5_SERVICE_NAME "k5amanda" + +You can currently only override these by editing the source code. + +The kerberized AMANDA service uses a different port on the client hosts. The /etc/services line is: + + k5amanda 10082/tcp + +And the /etc/inetd.conf line is: + + + k5amanda stream tcp nowait root /usr/local/libexec/amanda/amandad amandad -auth=krb5 + + + +Note that you're running this as root, rather than as your dump user. AMANDA will set its UID down to the dump user at times it doesn't need to read the keytab file, and give up root permissions entirely before it goes off and runs dump. Alternately you can change your keytab files to be readable by user amanda. You should understand the security implications of this before changing the permissions on the keytab. + +The following dumptype options apply to krb5: + + + auth "krb5" # use krb5 auth for this host + # (you can mingle krb hosts and bsd .rhosts in one conf) + + + +The principal and keytab files that Amanda uses must be set in the amanda.conf file for kerberos 5 dumps to work. You can hardcode this in the source code if you really want to (common-src/krb5-security.c) + + + krb5keytab + krb5principal + + + +For example: + + + krb5keytab "/etc/krb5.keytab-amanda" + krb5principal "amanda/saidin.omniscient.com" + + + +The principal in the second option must be contained in the first. The keytab should be readable by the amanda user (and definitely not world readable!) and is (obviously) on the server. In MIT's kadmin, the following: + + + addprinc -randkey amanda/saidin.omniscient.com + ktadd -k /etc/krb5.keytab-amanda amanda/saidin.omniscient.com + + + +will do the trick. You will obviously want to change the principal name to reflect something appropriate for the conventions at your site. + +You must also configure each client to allow the amanda principal in for dumps. + +There are several ways to go about authorizing a server to connect to a client. + +The normal way is via a .k5amandausers file or a .k5login file in the client user's home directory. The determination of which file to use is based on the way you ran configure on AMANDA. By default, AMANDA will use .k5amandahosts, but if you configured with --without-amandahosts, AMANDA will use .k5login. (similar to the default for .rhosts/.amandahosts-style security). The .k5login file syntax is a superset of the default krb5 .k5login. The routines to check it are implemented in amanda rather than using krb5_kuserok because the connections are actually gssapi based. + +This .k5amandahosts/.k5login is a hybrid of the .amandahosts and a .k5login file. You can just list principal names, as in a .k5login file and the principal will be permitted in from any host. If you do NOT specify a realm, then there is no attempt to validate the realm (this is only really a concern if you have cross-realm authentication set up with another realm or something else that allows you multiple realms in your kdc. If you do specify a realm, only that principal@realm will be permitted to connect. + +You may prepend this with a hostname and whitespace, and only that principal (with optional realm as above) will be permitted to access from that hostname. + +Here are examples of valid entries in the .k5amandahosts: + + + service/amanda + service/amanda@TEST.COM + dumpmaster.test.com service/amanda + dumpmaster.test.com service/amanda@TEST.COM + + + +Rather than using a .k5amandahosts or .k5login file, the easiest way is to use a principal named after the destination user, (such as amanda@TEST.COM in our example) and not have either a .k5amandahosts or .k5login file in the destination user's home directory. + +There is no attempt to verify the realm in this case (only a concern if you have cross-realm authentication setup). + + + +LOCAL COMMUNICATION +The Amanda server communicates with the client internally versus over the network, ie. the client is also the server. +This is the only method that requires no authentication as it is clearly not needed. + + +RSH COMMUNICATION AND AUTHENTICATION +For more detail, see http://wiki.zmanda.com/index.php/Configuring_rsh_authentication. + +The Amanda server communicates with its client as the Amanda user via the RSH protocol. + +Please note that RSH protocol itself is insecure and should be used with caution especially on any servers and clients with public IPs. + +Each Amanda client communicates with the server using one TCP port and all data streams from the client are multiplexed over one port. The number of Amanda clients is limited by the number of reserved ports available on the Amanda server. Some versions of RSH do not use reserved ports and, thus, this restriction is not valid. + +General information including compilation is given above (see COMPILATION AND GENERAL INFORMATION above). + +In addition to specifying the auth field in dumptype definition, it might be required to specify client_username and &amandad; fields. If the backup user name is different on the Amanda client, the user name is specified as client_username. If the location of the Amanda daemon &amandad; is different on the Amanda client, the location is specified as amandad_path field value. + + +For example: +define dumptype rsh_example { + ... + auth "rsh" + client_username "amandabackup" + amandad_path "/usr/lib/exec/amandad" + ... +} + + + + +SSH COMMUNICATION AND AUTHENTICATION +For more detail, see http://wiki.zmanda.com/index.php/How_To:Set_up_transport_encryption_with_SSH. + +Amanda client sends data to the server using SSH. SSH keys have to be set up so that Amanda server can communicate with its clients using SSH. + +General information including compilation is given above (see COMPILATION AND GENERAL INFORMATION above). + +SSH provides transport encryption and authentication. To set up an SSH authentication session, Amanda will run the equivalent of the following to start the backup process. + + /path/to/ssh -l user_name client.zmanda.com $libexecdir/amandad + +To use SSH, you need to set up SSH keys either by storing the passphrase in cleartext, using ssh-agent, or using no passphrase at all. All of these options have security implications which should be carefully considered before adoption. + +When you use a public key on the client to do data encryption (see http://wiki.zmanda.com/index.php/How_To:Set_up_data_encryption), you can lock away the private key in a secure place. Both, transport and storage will be encrypted with such a setup. See http://wiki.zmanda.com/index.php/Encryption for an overview of encryption options. + +Enable SSH authentication and set the ssh_keys option in all DLEs for that host by adding the following to the DLE itself or to the corresponding dumptype in amanda.conf: + + auth "ssh" + ssh_keys "/home/amandabackup/.ssh/id_rsa_amdump" + +ssh_keys is the path to the private key on the client. If the username to which Amanda should connect is different from the default, then you should also add + + client_username "otherusername" + +If your server &amandad; path and client &amandad; path are different, you should also add + + amandad_path "/client/amandad/path" + +For a marginal increase in security, prepend the keys used for AMANDA in the clients' authorized_keys file with the following: + + + from="amanda_server.your.domain.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/absolute/path/to/amandad -auth=ssh amdump" + + + +This will limit that key to connect only from Amanda server and only be able to execute &amandad;(8). + +In the same way, prepend the key used for AMANDA in the server's authorized_keys file with: + + + from="amanda_client.your.domain.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/absolute/path/to/amandad -auth=ssh amindexd amidxtaped" + + + +You can omit the from=.. option if you have too many clients to list, although this has obvious security implications. + +Set ssh_keys and any other necessary options in /etc/amanda/amanda_client.conf: + + + auth "ssh" + ssh_keys "/root/.ssh/id_rsa_amrecover" + client_username "amanda" + amandad_path "/server/amandad/path" + + + +Besides user keys, SSH uses host keys to uniquely identify each host, to prevent one host from impersonating another. Unfortunately, the only easy way to set up these host keys is to make a connection and tell SSH that you trust the identity: + + + $ ssh client1.zmanda.com + The authenticity of host 'client1.zmanda.com (192.168.10.1)' can't be established. + RSA key fingerprint is 26:4e:df:a2:be:c8:cb:20:1c:68:8b:cc:c0:3b:8e:9d. + Are you sure you want to continue connecting (yes/no)?yes + + + +As Amanda will not answer this question itself, you must manually make every connection (server to client and client to server) that you expect Amanda to make. Note that you must use the same username that Amanda will use (that is, ssh client and ssh client.domain.com are distinct). + + +SEE ALSO + +&amconf;, +&amclientconf;, +&disklist;, +&amdump;(8), +&amrecover;(8) + + + + + diff --git a/man/xml-source/amanda-changers.7.xml b/man/xml-source/amanda-changers.7.xml new file mode 100644 index 0000000..4d68e2c --- /dev/null +++ b/man/xml-source/amanda-changers.7.xml @@ -0,0 +1,232 @@ + + + + %global_entities; +]> + + + + +amanda-changers +7 +&rmi.source; +&rmi.version; +&rmi.manual.7; + + +amanda-changers +Configuring and Using Amanda Changers + + +&author.dustin; + + + +DESCRIPTION + +Amanda uses changers to arbitrate access to devices +(amanda-devices7) +and data volumes. Changers provide an abstraction of tape robots, but are used +to manage non-tape media, too. Amanda communicates with changers through the +Changer API. This manpage contains a user-level overview +of the API, and does not address details that are only of concern to +developers. For that purpose, consult the Amanda source code and +http://wiki.zmanda.com. + + + +TRANSITION + +The Amanda Changer API is in transition from version 1.0 - driven by +shell scripts invoked for each changer operation - to version 2.0, composed of +perl objects that can manage parallel access to multiple devices and other +complexity. When this transition is complete, Amanda devices will, in general, +be specified via a changer, which will provide the necessary device specifier +to access a requested volume. In the interim, support for the "new" changer +syntax is limited to the experimental +amvault8. + + + +SPECIFYING CHANGERS + +Changer specifications are strings like +chg-disk:/my/vtapes. The +chg- prefix serves to differentiate changers +from devices (see +amanda-devices7). +The next portion (disk, in this case) +identifies the particular changer driver to use, and everything that follows +the : is interpreted by the driver. + +A name which does not match this pattern, but which matches an old +changer script (e.g., chg-zd-mtx), invokes the +backward-compatibility changer driver as +chg-compat:chg-zd-mtx. If the name does not +match an old changer, then it is treated as an Amanda device, and is wrapped by +the single-device changer, e.g., +chg-single:tape:/dev/rmt/0. + +Changers which require additional parameters can also be described in &amconf; with "changer" sections, for example, + +define changer hp-robot { + tapedev "chg-robot:/dev/sg1" + property "drives" "0=/dev/nst0;1=/dev/nst0" + property "slots" "1-10" +} + + +(note that "chg-robot" is not yet implemented, so this is hypothetical). A +changer defininition creates a changer "alias", in this case named +hp-robot, which can then be named where an application +expects a changer - for example, the target of the amvault command. + + +CHANGER DRIVERS + +This section lists the changer drivers included with Amanda, and basic instructions for using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. + +chg-disk (new) + +tpchanger "chg-disk:/u01/vtapes" + + +This changer driver replaces the old chg-disk, +supporting parallel access to vtapes stored in directories named +slotN in the directory specified after +chg-disk:. It does so by creating numbered +"drives" so that simultaneous processes can access distinct slots. + + + +chg-disk (old) + +tapedev "file:/u01/vtapes" +tpchanger "chg-disk" + + +This changer script supports sequential access to vtapes stored in +directories named slotN in the directory +specified by the tapedev parameter. + + + +chg-multi + +tpchanger "chg-multi" +changerfile "chg-multi-state" + + +This script simply round-robins a number of distinct device names, as +specified in its configuration file. It is useful when all volumes for a +configuration have different device names -- for example, with S3 devices. +The changerfile need not exist; it is used as a prefix +for filenames of state files. + + + + +chg-manual + +tpchanger "chg-manual" +changerfile "chg-manual.conf" + + +This script simply provides distinct device names in a round-robin +fashion, as specified in its configuration file. It is useful when all volumes +for a configuration have different device names -- for example, with S3 +devices. The configuration file parameters are (as listed in the script): + +resend_mail=900 # resend mail every __ seconds +timeout_mail=604800 # time out after this many seconds (default 7 days) +request="[type]" # How to request a new tape (default "tty_email") + request="tty" # Use the tty to ask the user to change tape. + # Can't be use by cron + request="email" # Send an email to ask the user to change tape. + request="tty_email" # Use the tty if it exist or send an email. + + + + + +chg-zd-mtx + +tpchanger "chg-zd-mtx" +changerdev "/dev/sg0" # used with 'mtx -f' +changerfile "chg-zd-mtx.conf" +tapedev "tape:/dev/nst0" + + +This script interfaces with a tape drive using the Zubkoff/Dandelion +version of mtx. That's the version that takes a device specifier with the +-f option and has subcommands like +status. The configuration file parameters are (as listed in +the script itself): + +firstslot=? #### First storage slot (element) +lastslot=? #### Last storage slot (element) +cleanslot=-1 #### Slot with cleaner tape -- default is "-1" + #### Set negative to indicate no cleaner available +driveslot=0 #### Drive slot number. Defaults to 0 + #### Use the 'Data Transfer Element' you want +autoclean=0 #### Set to '1' or greater to enable +autocleancount=99 #### Number of access before a clean. +havereader=0 #### If you have a barcode reader, set to 1. +offline_before_unload=0 #### Does your robot require an + #### 'mt offline' before mtx unload? +poll_drive_ready=NN #### Time (seconds) between tests to see if + #### the tape drive has gone ready (default: 3). +max_drive_wait=NN #### Maximum time (seconds) to wait for the + #### tape drive to become ready (default: 120). +initial_poll_delay=NN #### initial delay after load before polling for + #### readiness +slotinfofile=FILENAME #### record slot information to this file, in + #### the line-based format "SLOT LABEL\n" + + + + + +chg-rait + +tpchanger "chg-rait" +changerfile "chg-rait.conf" + + +This changer script constructs RAIT devices out of the devices provided by several "sub-changers". The configuration file specifies nchangers, the number of +subchangers, and then provides tpchanger, changerdev_N, changerfile_N, and tpchanger_N for each sub-changer, 1 through N. + + + +chg-null + +tpchanger "chg-null" + + +This changer always provides the device "null:". It is sometimes useful in conjunction with chg-rait. + + + +Unmaintained Changers + +Amanda has many other changer scripts and programs beyond those described +here (see the changer-src/ in the source +directory), but most of these scripts are unmaintained and undocumented, and +will be removed when the new changer API is fully implemented. + + + + + +SEE ALSO + +amanda8, +amanda.conf5, +amanda-devices7, + + + + diff --git a/man/xml-source/amanda-client.conf.5.xml b/man/xml-source/amanda-client.conf.5.xml index d110291..10b2d92 100644 --- a/man/xml-source/amanda-client.conf.5.xml +++ b/man/xml-source/amanda-client.conf.5.xml @@ -12,11 +12,18 @@ amanda-client.conf 5 +&rmi.source; +&rmi.version; +&rmi.manual.5; amanda-client.conf Client configuration file for &A;, the Advanced Maryland Automatic Network Disk Archiver + +&author.jds; +&author.sgw.xml; + DESCRIPTION @@ -25,131 +32,34 @@ relevant sections and parameters of this file for quick reference. The files <CONFIG_DIR>/amanda-client.conf and <CONFIG_DIR>/<config>/amanda-client.conf are loaded. -PARAMETERS +SYNTAX -There are a number of configuration parameters that control the -behavior of the &A; programs. -All have default values, -so you need not specify the parameter in -amanda-client.conf -if the default is suitable. +The syntax of &amclientconf; is identical to that for +amanda.conf5. -Lines starting with # are ignored, as are blank lines. -Comments may be placed on a line with a directive by starting -the comment with a #. -The remainder of the line is ignored. - -Keywords are case insensitive, i.e. -auth -and -Auth -are treated the same. - -Integer arguments may have one of the following (case insensitive) suffixes, -some of which have a multiplier effect: + -POSSIBLE SUFFIXES + +GLOBAL PARAMETERS - b byte bytes - -Some number of bytes. - - - - bps - -Some number of bytes per second. - - - - k kb kbyte kbytes kilobyte kilobytes - -Some number of kilobytes (bytes*1024). - - - - kps kbps - -Some number of kilobytes per second (bytes*1024). - - - - m mb meg mbyte mbytes megabyte megabytes - -Some number of megabytes (bytes*1024*1024). - - - - mps mbps - -Some number of megabytes per second (bytes*1024*1024). - - - - g gb gbyte gbytes gigabyte gigabytes - -Some number of gigabytes (bytes*1024*1024*1024). - - - - tape tapes - -Some number of tapes. - - - - day days - -Some number of days. - - - - week weeks + conf string -Some number of weeks (days*7). - -The value -inf -may be used in most places where an integer is expected -to mean an infinite amount. - -Boolean arguments may have any of the values -y, -yes, -t, -true -or -on -to indicate a true state, or -n, -no, -f, -false -or -off -to indicate a false state. -If no argument is given, -true -is assumed. - - +Default: +Set by configure. +The conf use by amrecover. - - - -PARAMETERS - - - conf string + client_username string Default: -Set by configure. -The conf use by amrecover. +CLIENT_LOGIN. +Similar to the parameter of the same name in &amconf;, this specifies the username that +&amrecover; should send when connecting to the server. It should match the username +specified in &amandahosts; on the server. @@ -224,6 +134,13 @@ The directory where gnutar keep its state file. + + mailer string + +Default found by configure. A mail program that can send mail with 'MAILER -s "subject" user < message_file'. + + + amandates string @@ -377,13 +294,228 @@ Unreserved tcp port that will be used (bsd, bsdudp) + + property "name" "value" + +Adds a global property for this client host, useful for e.g., Application API plugins. + + + + + + +APPLICATION SECTION +The +amanda.conf +file may define multiple types of application. +The information is entered in a application-tool +section, which looks like this: + + +define application-tool "name" { + application-option appli +cation-value + ... +} + + +name +is the name of this type of application. It is referenced from the +dumptype + +The application-tool options and values are: + + + comment string + +Default: +none. +A comment string describing this application. + + + + plugin string + +No default. Must be set to the name of the program. This program must be +in the $libexecdir/amanda/application directory +on the client. + + + + property [append] [priority] string string+ + +No default. You can set property for the application, each application have a different set of property. Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. +priority keyword disallow the setting of that property on the server. + + + - -AUTHOR -James da Silva, &email.jds;: Original text -&maintainer.sgw;: XML-conversion, major update, splitting +SCRIPT SECTION +The +amanda.conf +file may define multiple types of script. +The information is entered in a script-tool +section, which looks like this: + + +define script-tool "name" { + script-option script-value + ... +} + + +name +is the name of this type of script. It is referenced from the +dumptype + +The script-tool options and values are: + + + comment string + +Default: +none. +A comment string describing this script. + + + + plugin string + +No default. Must be set to the name of the program. This program must be in the $libdir/amanda/application directory on the client and/or server. + + + + execute_where [client|server] + +Default: client. Where the script must be executed, on the client or server. Only client is valid. + + + + execute_on execute_on[,execute_on]* + +No default. When the script must be executed, you can specify many of them: + + + + pre-dle-amcheck + +Execute before the amcheck command for the dle. + + + + pre-host-amcheck + +Execute before the amcheck command for all dle for the client. + + + + post-dle-amcheck + +Execute after the amcheck command for the dle. + + + + post-host-amcheck + +Execute after the amcheck command for all dle for the client. + + + + pre-dle-estimate + +Execute before the estimate command for the dle. + + + + pre-host-estimate + +Execute before the estimate command for all dle for the client. + + + + post-dle-estimate + +Execute after the estimate command for the dle. + + + + post-host-estimate + +Execute after the estimate command for all dle for the client. + + + + pre-dle-backup + +Execute before the backup command for the dle. + + + + pre-host-backup + +Execute before the backup command for all dle for the client. + + + + post-dle-backup + +Execute after the backup command for the dle. + + + + post-host-backup + +Execute after the backup command for all dle for the client. + + + + pre-recover + +Execute before any level is recovered. + + + + post-recover + +Execute after all levels are recovered. + + + + pre-level-recover + +Execute before each level recovery. + + + + post-level-recover + +Execute after each level recovery. + + + + inter-level-recover + +Execute between two levels of recovery. + + + + + + + property [append] [priority] string string+ + +No default. You can set property for the script, each script have a different set of property. Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. +priority keyword disallow the setting of that property on the server. + + + + SEE ALSO diff --git a/man/xml-source/amanda-devices.7.xml b/man/xml-source/amanda-devices.7.xml new file mode 100644 index 0000000..852f75f --- /dev/null +++ b/man/xml-source/amanda-devices.7.xml @@ -0,0 +1,466 @@ + + + + %global_entities; +]> + + + + +amanda-devices +7 +&rmi.source; +&rmi.version; +&rmi.manual.7; + + +amanda-devices +Configuring and Using Amanda Devices + + +&author.ian; +&author.dustin; + + + +DESCRIPTION + +The Device API specifies a generic interface between Amanda and storage +devices such as tapes or disks. This manual page describes the device +drivers included with Amanda. + +This is a user-level description of the API, and +does not address details that are only of concern to developers. For that +purpose, consult the Amanda source code and http://wiki.zmanda.com. + +The term "device driver" describes the software that can communicate with +some kind of backend storage, e.g., a tape driver. A "device" is the + storage element itself, usually a piece of hardware. When discussing + a device and its driver as a unit, the term "device" is sometimes + also used to refer to the combination of device and driver. + + + + +SPECIFYING DEVICES + +Device names take the form TYPE:NODE, where TYPE selects a device driver, and NODE provides further information to that driver. The syntax for each device driver is given in the corresponding section below. + +Devices are described in &amconf; with "device" sections, e.g., + +define device top_drive { + tapedev "tape:/dev/nst0" + device_property "BLOCK_SIZE" "131072" +} + +A device defininition creates a device "alias", in this case named top_drive, which can then be named in the global tapedev parameter: + +tapedev "top_drive" + + + +The global tapedev parameter can also specify a literal device name. For example, + +tapedev "file:/amdisks" + +is equivalent to + +tapedev "default" +define device default { + tapedev "file:/amdisks" +} + +Device properties specified outside of any device definition apply to all devices. This syntax is provided mainly for backward compatibility, and for simple Amanda configurations. Note that there is no way to provide properties specific to a device without defining a device alias. + +See amanda.conf5 +for more information on Amanda configuration. + + + +DEVICES + +This section lists the device drivers included with Amanda, and basic instructions for using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. + +Null Device + +tapedev "null:" + + +The null device driver only supports writing, and discards all data. It is +generally only useful for testing purposes. + + + +RAIT Device + +tapedev "rait:tape:/dev/rmt/tps0d{4,5,6}n" + + +The RAIT device driver mirrors or stripes data over multiple "child" devices. +The child devices are specified using a shell-like syntax, where alternatives +are enclosed in braces and separated by commas. + +With two child devices, the RAIT device driver mirrors data such that the +two devices contain identical data and can be used singly for + recovery. With more than two devices, the RAIT device "stripes" + data across all but one device and writes a parity block to the + final device, usable for data recovery in the event of a device or + volume failure. The RAIT device scales its blocksize as necessary + to match the number of children that will be used to store data. + +When a child device is known to have failed, the RAIT device should be reconfigured to replace that device with the text "ERROR", e.g., + +tapedev "rait:{tape:/dev/st0,ERROR,tape:/dev/st2}" + +This will cause the RAIT device to start up in degraded mode, reconstructing the data from the missing device. + + +Like ordinary RAID drivers, the RAIT device driver can automatically +enter degraded mode when one of its child devices fails. However, the RAIT +device cannot automatically recover from any write error nor write any data in +degraded mode. When reading, certain errors may be fatal (rather than causing +degraded mode). And in any case, labels on all volumes must initially match +(labeled or otherwise). If you have lost one volume from a set, explicitly +start the device in degraded mode as described above. + +Child Device Block Sizes + +The RAIT device driver requires that all of its child devices use the +same block size. If no block sizes are specified, the driver selects the block +size closest to 32k that is within the MIN_BLOCK_SIZE - MAX_BLOCK_SIZE range of +all child devices, and calculates its own blocksize according to the formula +rait_blocksize = child_blocksize * (num_children - 1). If +a block size is specified for the RAIT device, then it calculates its child +block sizes according to the formula child_blocksize = rait_blocksize +/ (num_children - 1). Either way, it sets the BLOCK_SIZE property +of each child device accordingly. + + + + + +S3 Device + +tapedev "s3:foocorp-backups/DailySet1-" +device_property "S3_ACCESS_KEY" "MYACCESSKEY" +device_property "S3_SECRET_KEY" "MYSECRETKEY" + + +The S3 device driver uploads data to the Amazon S3 "storage cloud". Its +device name is a slash-sparated combination of bucket name and prefix: +"s3:BUCKET/PREFIX". Since buckets must be unique across all Amazon S3 users, +and since the number of buckets allowed to each user is limited, the driver can +store multiple Amanda volumes in a single S3 bucket, distinguished by prefix. +The prefix and slash can be omitted if they are not needed: "s3:BUCKET". + +The access and secret keys used to authenticate to Amazon S3 are provided +as properties. + +The S3 device driver stores each block in a distinct S3 object. Due to +high HTTP overhead for each request, use of larger than normal block + sizes (> 1 megabyte) is reccomended with the S3 device. + +You can control where your data is physically stored by Amazon S3 using +a location constraint. Setting this affects can affect both billing and legal +concerns, so you are encouraged to consult Amazon's documentation for details. + + + +To control location constraints, set the S3_BUCKET_LOCATION property. +Currently, there are two valid settings: "" (any location) and "EU" (Europe). +If the S3_BUCKET_LOCATION is set, Amanda will check to make sure that the +setting agrees with the constraint currently on the bucket. + + + + +Tape Device + +tapedev "tape:/dev/nst0" + + +The tape device driver interacts with a tape drive. The device uses the +operating system's built-in tape support, which is generally similar to that +available via the command-line utilities dd(1) and mt(1). + +The tape device name should specify a path to the operating system's +device file. + + + +VFS Device + +tapedev "file:/path/to/vtape" + + +The VFS device driver stores data on a UNIX filesystem. Note + that although one typically uses the VFS device driver to store data + on hard disks, the driver does not interface with any hardware on a + block level. + +The device name specifies a path to a directory which must exist and +contain a "data/" subdirectory. Each tape file is stored as a distinct file in +this directory, the name of which reflects the Amanda header in the tape file. +Block boundaries are not maintained: the driver supports reads of arbitrary +size, regardless of the blocksize used to write the data. + + + + + +PROPERTIES + +Device drivers use properties as a generic means to +interact with other parts of Amanda. Some properties are set by the device +driver and used by Amanda to determine how its devices should be used. Other +properties can be set by Amanda or by the user to influence the driver's +behavior. Properties are set for a particular device, so that if you have two +tape devices, they will not share property values. + +Properties are specified in amanda.conf with the +device-property parameter. The syntax looks like this: + +device_property "FROBNICATOR_PATH" "/var/frobd/state" +device_property "BYTES_PER_FORTNIGHT" "128k" +device_property "USE_QUBITS" "no" + + +Both the property name and the property value are always quoted. String +values are given as simple strings, like FROBNICATOR_PATH in the example above. +Integer values can be specified with any of the suffixes given in the "VALUE +SUFFIXES" section of &amconf;, like BYTES_PER_FORTNIGHT, above. Boolean values +can be specified as any of "true", "yes", "1", "0", "no", "false", like +USE_QUBITS, above. Some properties have special formats, as described +below. + +Some properties are set based on other configuration values, such as +tapetype parameters. These special cases are detailed under the appropriate +property, below. + +The order in which device properties are set is as follows: + +Tapetype parameters (including length, blocksize, and readblocksize) are translated into device properties and set accordingly. +Device properties from any device_property + configuration parameters are set, in the order they appear in the + configuration file. + + + +Properties described as read-only are not accessible to users. They are +listed here for completeness. + +COMMON PROPERTIES + +Note that some of these properties are currently unused, and present only +for future expansion. Not all devices implement all of these properties. + + + + + + APPENDABLE + (read-only) This boolean property indicates whether this device supports appending data to volumes. + + + BLOCK_SIZE + (read-write) This property gives the block size, in bytes, that will be used to write to the device. The usual suffixes ("kbytes", etc.) are allowed. The tapetype parameter blocksize sets this property. + + + CANONICAL_NAME + (read-only) This property contains the full canonical name for this device. This name may not be the same as the user-supplied name, but is a valid name by which to access this device. + + + COMPRESSION + (read-write) This boolean property represents the compression status of the device, and can be used to enable and disable such compression. This applies mostly to tape devices, although many tape devices do not support setting compression from software. + + + COMPRESSION_RATE + (read-only) This property gives the compression rate, as a decimal ratio. It may be a measured value over some unspecified period or a simple estimate. + + + CONCURRENCY + (read-only) This property indicates the level of concurrent access that this device supports. + + + FREE_SPACE + (read-only) This property gives the amount of free space available on the current volume, if known. This is often an estimate; for example, tape devices can only estimate the amount of tape left on a spool. + + + MAX_BLOCK_SIZE + (read-only) This property gives the maximum block size this device can support. See BLOCK SIZES, below. + + + MEDIUM_ACCESS_TYPE + (read-only) This property gives the type of the media in the device: read only, WORM (Write Once, Read Many), read/write, or write only. Write-only devices do not support recovery, but the data are not necessarily thrown out. + + + MIN_BLOCK_SIZE + (read-write) This property gives the minimum block size this device can support. See BLOCK SIZES, below. + + + MAX_VOLUME_USAGE + (read-write) On devices that support it, this property will limit the total amount of data written to a volume; attempts to write beyond this point will cause the device to simulate "out of space." Zero means no limit. The tapetype parameter length sets this property. + + + PARTIAL_DELETION + (read-only) This property indicates whether the device supports deletion of specific files. Aside from linear tapes, most devices can support this feature. It is currently unused by Amanda. + + + STREAMING + (read-only) This property gives the streaming requirement for this device. For example, tape drives often require a steady supply of data to avoid shoe-shining, while disk devices have no such requirement. + + + VERBOSE + (read-write) If this boolean property is set, then the device will produce verbose debugging output. This property is not recognized by all devices. + + + + +BLOCK SIZES + +Amanda writes device data in blocks. On most devices the block +boundaries are embedded in the media along with the data itself, so subsequent +reads must use the same block sizes. On tape devices, the block size is +dictated by the capabilities of the hardware -- buffer sizes, physical format, +and so on. + +Amanda has historically supported a single, fixed block size -- usually +32k. The Device API adds the ability to specify a block size at runtime, using +the BLOCK_SIZE property. Devices provide MIN_BLOCK_SIZE and MAX_BLOCK_SIZE as +a guide to the range of acceptable block sizes. Note that this does not imply +that all sizes in the range MIN_BLOCK_SIZE - MAX_BLOCK_SIZE are available -- +the device may require that block sizes are even multiples of some power of +two, for example. Consult the documentation for your hardware and operating +system for more information. + +Most devices are flexible enough to read a volume using a different block +size than that with which it was written. This can be useful when handling old +volumes written with a smaller blocksize, or volumes of unknown blocksize. +Unfortunately, some tape devices do not detect oversized blocks correctly, and +may lose data if the configured block size is smaller than the volume's block +size. The tape device driver has a READ_BUFFER_SIZE property which specifies +the minimum buffer size that will be allocated for reads from tape. If the +hardware supports it, setting this property allows Amanda to correctly read +from tapes written with any blocksize less than or equal to READ_BUFFER +SIZE. + +The RAIT device does not support flexible block sizes, as its +parity algorithm requires that all child devices have the same, fixed block +size. + + + + + +DRIVER-SPECIFIC PROPERTIES + +S3 Device + + + + + S3_ACCESS_KEY + (read-write) This property gives the Amazon S3 access key used to access the service. + + + S3_BUCKET_LOCATION + (read-write) Location constraint for buckets on Amazon S3. +Currently, it can be set to "", for no constraint (i.e. store data in the US), +or "EU" (i.e. store data in the EU). +See Amazon's documentation for details and latest information + + + S3_SECRET_KEY + (read-write) This property gives the Amazon S3 secret key used to access the service. + + + S3_SSL + (read-write) Whether or not to use SSL/TLS to secure communications with Amazon S3. + + + S3_USER_TOKEN + (read-write) This property specifies the user token for Amanda Enterprise Edition customers. + + + + +Most Amanda devices work just fine without any properties, but not the S3 +device. A typical S3 configuration will have an access key and secret key +specified: + + +device_property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8" +device_property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr" + + + + +Tape Device + +Most of these properties are automatically detected, but can be +overridden in the configuration file if the autodetection fails. Note that tape +drives are required to at least support the MTREW (rewind) operation; all other +operations can be emulated with the MTREW and read data operations. + + + + + BROKEN_GMT_ONLINE + (read-write) Set this boolean property if the system's GMT_ONLINE macro gives incorrect results. This is currently true for the Linux IDE-TAPE driver. + + + BSF + (read-write) This boolean property specifies whether the device + driver may execute the MTBSF operation (backward seek file). + + + BSF_AFTER_EOM + (read-write) This boolean property specifies whether the device + driver should execute an MTBSF (backward seek file) operation after + MTEOM (seek to end of recorded data) in order to append. + + + BSR + (read-write) This boolean property specifies whether the device + driver may use the MTBSR operation (backward seek record). + + + EOM + (read-write) This boolean property specifies whether the device + driver may use the MTEOM command (seek to end of recorded data). + + + FINAL_FILEMARKS + (read-write) This integer property gives the number of filemarks that should be written at EOD. It is usually 1 or 2. + + + FSF + (read-write) This boolean property specifies whether the device driver may use the MTFSF operation (forward seek file). + + + FSR + (read-write) This boolean property specifies whether the device driver may use the MTFSR operation (forward seek record). + + + READ_BUFFER_SIZE + (read-write) This property specifies the minimum buffer size that will be used for reads; this should be large enough to contain any block that may be read from the device, and must be larger than BLOCK_SIZE. This property exists for tape devices which cannot determine the size of on-tape blocks, or which may discard data which overflows a small buffer. The tapetype parameter READBLOCKSIZE sets this property. See BLOCK SIZES, above. + + + + + + + + + + +SEE ALSO + +amanda.conf5, + + + + diff --git a/man/xml-source/amanda-scripts.7.xml b/man/xml-source/amanda-scripts.7.xml new file mode 100644 index 0000000..43aa973 --- /dev/null +++ b/man/xml-source/amanda-scripts.7.xml @@ -0,0 +1,61 @@ + + + + %global_entities; +]> + + + + +amanda-scripts +7 +&rmi.source; +&rmi.version; +&rmi.manual.7; + + +amanda-scripts +Configuring and using the Script API + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +The Script API is a flexible system for invoking user-supplied scripts at +various points in the execution of Amanda. This manual page describes the +operation and configuration of the API. For help writing Script API scripts, +see http://wiki.zmanda.com/index.php/Script_API. + + + +SCRIPTS + +This section lists the scripts included with &A;, see the individual man page for instructions on using them. For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com. + + + +amzfs-snapshot8, +- create/destroy zfs snapshot. + + +script-email8, +- send email. + + + + + +SEE ALSO + +amanda.conf5 + + + + diff --git a/man/xml-source/amanda.8.xml b/man/xml-source/amanda.8.xml index 383e35a..96d548e 100644 --- a/man/xml-source/amanda.8.xml +++ b/man/xml-source/amanda.8.xml @@ -13,434 +13,213 @@ amanda 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amanda -Advanced Maryland Automatic Network Disk Archiver +The Open Source Backup Platform + +&author.jds; +&author.sgw.xml; + - - - - amadmin - config - command - options - - - - - amcheck - options - config - - - - - amcheckdb - config - - - - - - amcleanup - config - - - - - amcrypt - - - - - amdd - options - - - - amdump - config - - - - - amaespipe - - - - - amflush - -f - config - - - - - amgetconf - config - parameter - - - - - amlabel - config - label - slotslot - - - - - ammt - options - - - - amoverview - config - options - - - - - amplot - options - amdump-files - - - - - amrecover - config - options - - - - - amreport - config - options - - - - - amrestore - options - tapedevice - hostnamediskname - - - - - amfetchdump - options - config - hostnamedisknamedatelevel - - - - amrmtape - options - config - label - - - - - amstatus - config - options - - - - - amtape - config - command - options - - - - - amtapetype - options - - - - amtoc - options - logfile - - - - - amcheckdump - options - config - - - - - amserverconfig - options - config - - - - - amaddclient - config - options - - - - DESCRIPTION -&A; is the -"Advanced Maryland Automatic Network Disk Archiver". -This manual page gives an overview of the &A; commands and +This manual page gives an overview of the &A; commands and configuration files for quick reference. -Here are all the &A; commands. -Each one has its own manual page. -See them for all the gory details. - - - amdump - -Take care of automatic &A; backups. -This is normally executed by -cron -on a computer called the -tape server host -and requests backups of file systems located on -backup -clients. -Amdump -backs up all disks in the -disklist -file (discussed below) to tape or, if there is a problem, to a special -holding -disk. -After all backups are done, -amdump -sends mail reporting failures and successes. - - - - amflush - -Flush backups from the holding disk to tape. -Amflush -is used after -amdump -has reported it could not write backups to tape for some reason. -When this happens, backups stay in the holding disk. -Run amflush after the tape problem is corrected -to write backups from the holding disk to tape. - - - - amcleanup - -Clean up after an interrupted -amdump. -This command is only needed if -amdump -was unable to complete for some reason, usually because the -tape server host crashed while -amdump -was running. - - - - amrecover - -Provides an interactive interface to browse the &A; index files -(backup image catalogues) -and select which tapes to recover files from. -It can also run -amrestore -and a restore program (e.g. -tar) -to actually recover the files. - - - - amrestore - -Read an &A; tape, searching for requested backups. -Amrestore -is suitable for everything from interactive restores of single files -to a full restore of all partitions on a failed disk. - - - - amfetchdump - -Performs &A; tape restoration, similar to amrestore. Additional capabilities include - "hands-off" searching of multiple tapes, automatic - retrieval of specific dump files based on dump logs, and assembly of - tape-spanning split dump files. - - - - amlabel - -Write an &A; format label onto a tape. -All &A; tapes must be labeled with -amlabel. -Amdump -and -amflush -will not write to an unlabeled tape (see TAPE MANAGEMENT below). - - - - amcheck - -Verify the correct tape is mounted and all file systems on all backup client systems -are ready to be backed up. Often run by -cron -before -amdump -to generate a mail warning that backups might fail -unless corrective action is taken. - - - - amadmin - -Take care of administrative tasks like finding out which -tapes are needed to restore a filesystem, -forcing hosts to do full backups of selected disks -and looking at schedule balance information. - - - - amtape - -Take care of tape changer control operations like loading particular tapes, -ejecting tapes and scanning the tape storage slots. - - - - amcheckdump - -Check the results of an &A; dump. - - - - amserverconfig - -Program to setup initial &A; configuration. - - - - amaddclient - -Program to add client to an existing &A; configuration. - - - - amrmtape - -Delete a tape from the &A; databases. - - - - amstatus - -Report the status of a running or completed -amdump. - - - - amoverview - -Display a chart of hosts and file systems backed up every run. - - - - amplot - -Generate utilization plots of &A; runs for performance tuning. - - - - amreport - -Generate an &A; summary E-mail report. - - - - amtoc - -Generate table of content files for &A; tapes. - - - - amcheckdb - -Verify every tape &A; knows about is consistent in the database. - - - - amgetconf - -Look up parameters in the &A; configuration file. - - - - amtapetype - -Generate a tapetype definition. - - - - amaespipe - -Wrapper program from aespipe (data encryption utility) - - - - amcrypt - -Reference encryption program for Amanda symmetric data encryption - - - + + +COMMANDS +Here are all the &A; commands. Each one has its own manual page. See them for all the gory details. + + +amaddclient8, + + +amadmin8, + + +amaespipe8, + + +amcheck8, + + +amcheckdb8, + + +amcheckdump8, + + +amcleanup8, + + +amcrypt-ossl-asym8, + + +amcrypt-ossl8, + + +amcrypt8, + + +amcryptsimple8, + + +amdd8, + + +amdevcheck8, + + +amdump8, + + +amfetchdump8, + + +amflush8, + + +amgetconf8, + + +amgpgcrypt8, + + +amgtar8, + + +amlabel8, + + +ammt8, + + +amoverview8, + + +amplot8, + + +amrecover8, + + +amreport8, + + +amrestore8, + + +amrmtape8, + + +amsamba8, + + +amserverconfig8, + + +amservice8, + + +amstar8, + + +amstatus8, + + +amtape8, + + +amtapetype8, + + +amtoc8, + + +amvault8, + + +amzfs-sendrecv8, + + +amzfs-snapshot8, + + +script-email8, + + + +CONFIGURATION FILES + + +amanda.conf5, + + +amanda-client.conf5, + + +disklist5, + + +tapelist5, + + + +DATA FORMATS + + +amanda-archive-format5, + + + +CONCEPTS + + +amanda-applications7, + + +amanda-auth7, + + +amanda-changers7, + + +amanda-devices7, + + +amanda-scripts7, + + + CONFIGURATION -There are three user-editable files that control the behavior of &A;. +There are four user-editable files that control the behavior of &A;. -The first is -amanda.conf, -the main configuration file. -It contains parameters to customize &A; for the site. -Refer to the -amanda.conf5, -manpage for details on &A; configuration parameters. +The first two are &amconf; and &amclientconf;, +the main configuration files for the server and client, respectively. +They contain parameters to customize &A; for the site. -Second is the -disklist -file, which lists hosts and disk partitions to back up. +Next is the &disklist; file, which lists hosts and disk partitions to back up. -Third is the -tapelist +Last is the seldom-edited &tapelist; file, which lists tapes that are currently active. These files are described in more detail in the following sections. All files are stored in individual configuration -directories under /usr/local/etc/amanda/. +directories, usually under /etc/amanda/. A site will often have more than one configuration. For example, it might have a @@ -449,15 +228,17 @@ configuration for everyday backups and an archive configuration for infrequent full archival backups. The configuration files would be stored under directories -/usr/local/etc/amanda/normal/ and -/usr/local/etc/amanda/archive/, respectively. +/etc/amanda/normal/ and +/etc/amanda/archive/, respectively. Part of the job of an &A; administrator is to create, populate and maintain these directories. + +LOG FILES All log and database files generated by &A; go in corresponding directories somewhere. The exact location is controlled by entries in -amanda.conf. +amanda.conf5. A typical location would be under /var/adm/amanda. For the above example, the files might go in /var/adm/amanda/normal/ and @@ -469,7 +250,7 @@ For the above example, the files might go in Detailed information about amdump -runs are stored in files named +runs are stored in dump logs -- files named amdump.NN where NN @@ -482,12 +263,13 @@ worth of them. The file used by amreport -to generate the mail summary is named -log.YYYYMMDD.NN +to generate the mail summary is the trace log. This file constitutes the "catalog" +describing the data on the tapes written in a run. It is named +log.YYYYMMDDHHMMSS.NN where -YYYYMMDD +YYYYMMDDHHMMSS is the datestamp of the start of the -amdump +amdump or amflush run and NN is a sequence number started at 0. @@ -510,425 +292,9 @@ are removed by at the end of each run. -DISKLIST FILE -The -disklist -file determines which disks will be backed up by &A;. -The file usually contains one line per disk: - - -hostname diskname [diskdevice] dumptype [spindle [interface] ] - - -All pairs [ hostname diskname ] must be unique. - -Lines starting with # are ignored, as are blank lines. -The fields have the following meanings: - - - hostname - -The name of the host to be backed up. -If -diskdevice -refers to a PC share, this is the host &A; will run the Samba -smbclient program on to back up the share. - - - - diskname - -The name of the disk (a label). -In most case, you set your -diskname -to the -diskdevice -and you don't set the -diskdevice. -If you want multiple entries with the same -diskdevice, -you must set a different -diskname -for each entry. It's the -diskname -that you use on the commandline for any &A; command. -Look at the example/disklist file for example. - - - - diskdevice - -Default: same as diskname. -The name of the disk device to be backed up. It may be a full device name, -a device name without the -/dev/ -prefix, e.g. -sd0a, -or a mount point such as -/usr. - -It may also refer to a PC share by starting the name with two (forward) slashes, e.g. -//some-pc/home. -In this case, the -program -option in the associated -dumptype -must be entered as -GNUTAR. -It is the combination of the double slash disk name and -program GNUTAR -in the -dumptype -that triggers the use of Samba. - - - - - dumptype - -Refers to a -dumptype -defined in the -amanda.conf -file. -Dumptypes -specify backup related parameters, -such as whether to compress the backups, -whether to record backup results in -/etc/dumpdates, the disk's relative priority, etc. - - - - spindle - -Default: -. -A number used to balance backup load on a host. -&A; will not run multiple backups at the same time -on the same spindle, unless the spindle number is -1, -which means there is no spindle restriction. - - - - interface - -Default: -local. -The name of a network interface definition in the -amanda.conf -file, used to balance network load. - - - - -Instead of naming a -dumptype, -it is possible to define one in-line, enclosing -dumptype -options within curly braces, one per line, just like a -dumptype -definition in -amanda.conf. -Since pre-existing -dumptypes -are valid option names, this syntax may be used to customize -dumptypes -for particular disks. - -A line break -must -follow the left curly bracket. - -For instance, if a -dumptype -named -normal -is used for most disks, but use of the holding disk needs to be disabled -for the file system that holds it, this would work instead of defining -a new dumptype: - - -hostname diskname [ diskdevice ] { - normal - holdingdisk never -} [ spindle [ interface ] ] - - - - -TAPE MANAGEMENT -The -tapelist -file contains the list of tapes in active use. -This file is maintained entirely by &A; and should not be created -or edited during normal operation. -It contains lines of the form: - -YYYYMMDD label flags - - -Where -YYYYMMDD -is the date the tape was written, -label -is a label for the tape as written by -amlabel -and -flags -tell &A; whether the tape may be reused, etc (see the -reuse -options of -amadmin). - -Amdump -and -amflush -will refuse to write to an unlabeled tape, or to a labeled tape that is considered active. -There must be more tapes in active rotation (see the -tapecycle -option) than there are runs in the backup cycle (see the -dumpcycle -option) to prevent overwriting a backup image that would be needed to do a full recovery. - - -OUTPUT DRIVERS -The normal value for the -tapedev -parameter, or for what a tape changer returns, -is a full path name to a non-rewinding tape device, such as -/dev/nst0 -or -/dev/rmt/0mn -or -/dev/nst0.1 -or whatever conventions the operating system uses. &A; provides additional application level drivers that -support non-traditional tape-simulations or features. To access a specific output driver, set -tapedev -(or configure your changer to return) a string of the form -driver:driver-info -where -driver -is one of the supported drivers and -driver-info -is optional additional information needed by the driver. - -The supported drivers are: - - - tape - -This is the default driver. -The -driver-info -is the tape device name. -Entering -tapedev /dev/rmt/0mn - -is really a short hand for -tapedev tape:/dev/rmt/0mn - - - - - null - -This driver throws away anything written to it and returns EOF -for any reads except a special case is made for reading a label, -in which case a "fake" value is returned that &A; checks for -and allows through regardless of what you have set in -labelstr. -The -driver-info -field is not used and may be left blank: - -tapedev null: - - -The length -value from the associated -tapetype -is used to limit the amount of data written. When the limit is reached, the driver will simulate end of tape. - -This driver should only be used for debugging and testing, -and probably only with the -record -option set to -no. - - - - - - - rait - -Redundant -Array -of -Inexpensive (?) -Tapes. -Reads and writes tapes mounted on multiple drives by spreading -the data across N-1 drives and using the last drive for a checksum. -See docs/RAIT for more information. - -The -driver-info -field describes the devices to use. Curly braces indicate multiple replacements in the string. -For instance: - -tapedev rait:/dev/rmt/tps0d{4,5,6}n - - -would use the following devices: -/dev/rmt/tps0d4n -/dev/rmt/tps0d5n -/dev/rmt/tps0d6n - - - - - - - file - -This driver emulates a tape device with a set of files in a directory. -The -driver-info -field must be the name of an existing directory. -The driver will test for a subdirectory of that named -data -and return -offline -until it is present. -When present, the driver uses two files in the -data -subdirectory for each tape file. One contains the actual data. -The other contains record length information. - -The driver uses a file named -status -in the -file -device directory to hold driver status information, such as tape position. -If not present, the driver will create it as though the device is rewound. - -The -length -value from the associated -tapetype -is used to limit the amount of data written. -When the limit is reached, the driver will simulate end of tape. - -One way to use this driver with a real device such as a CD-writer is to -create a directory for the -file -device and one or more other directories for the actual data. -Create a symlink named -data -in the -file -directory to one of the data directories. -Set the -tapetype -length to whatever the medium will hold. - -When &A; fills the -file -device, remove the symlink and (optionally) create a new symlink to another -data area. -Use a CD writer software package to burn the image from the first data area. - -To read the CD, mount it and create the -data -symlink in the -file -device directory. - - - - - -AUTHORIZATION -&A; processes on the tape server host run as the -dumpuser -user listed in -amanda.conf. -When they connect to a backup client, they do so with an &A;-specific protocol. -They do not, for instance, use -rsh -or -ssh -directly. - -On the client side, the -amandad -daemon validates the connection using one of several methods, -depending on how it was compiled and on options it is passed: - - - - .rhosts - -Even though &A; does not use -rsh, -it can use -.rhosts-style -authentication and a -.rhosts -file. - - - - .amandahosts - -This is essentially the same as -.rhosts -authentication except a different file, with almost the same format, is used. -This is the default mechanism built into &A;. - -The format of the -.amandahosts -file is: - -hostname -[ -username -[ -service -]*] - -If -username -is ommitted, it defaults to the user running -amandad, -i.e. the user listed in the -inetd -or -xinetd -configuration file. -The service is a list of the service the client is authorized to execute: -amdump, -noop, -selfcheck, -sendsize, -sendbackup, -amindexd, -amidxtaped. -amdump is a shortcut for "noop selfcheck sendsize sendbackup" - - - - Kerberos - -&A; may use the Kerberos authentication system. -Further information is in the -docs/KERBEROS - -file that comes with an &A; distribution. - -For Samba access, -&A; needs a file on the Samba server (which may +Using Samba +For Samba access, &A; needs a file on the Samba server (which may or may not also be the tape server) named /etc/amandapass with share names, (clear text) passwords and (optional) domain names, @@ -945,14 +311,6 @@ For instance: With clear text passwords, this file should obviously be tightly protected. It only needs to be readable by the &A;-user on the Samba server. -You can find further information in the -docs/SAMBA - -file that comes with an &A; distribution. - - - - HOST & DISK EXPRESSION @@ -969,172 +327,144 @@ succeeds if all words in your expression match contiguous words in the host or disk. - - - - - -. -word separator for a host - - - -/ -word separator for a disk - - - -^ -anchor at left - - - -$ -anchor at right - - - -? -match exactly one character except the separator - - - -* -match zero or more characters except the separator - + - -** -match zero or more characters including the separator - + + dot (.) + word separator for a host + + + + / + word separator for a disk + + + + ^ + anchor at left + + + + $ + anchor at right + + + + ? + match exactly one character except the separator + + + + * + match zero or more characters except the separator + + + + ** + match zero or more characters including the separator + - - - + Some examples: - - - - - -EXPRESSION -WILL MATCH -WILL NOT MATCH - - - -hosta -hosta -hostb - - - - -hoSTA.dOMAIna.ORG - - - - - -foo.hosta.org - - - - -host -host -hosta - - - -host? -hosta -host - - - - -hostb - - - - -ho*na -hoina -ho.aina.org - - - -ho**na -hoina - - - - - -ho.aina.org - - - - -^hosta -hosta -foo.hosta.org - - - -sda* -/dev/sda1 - - - - - -/dev/sda12 - - - - -/opt -opt (disk) -opt (host) - - - -.opt. -opt (host) -opt (disk) - - - -/ -/ -any other disk - - - -/usr -/usr - - - - - -/usr/opt - - - - -/usr$ -/usr -/usr/opt - - - - - + + + hosta + + Will match hosta, foo.hosta.org, and + hoSTA.dOMAIna.ORG but not hostb. + + + + + host + + Will match host but not hosta. + + + + + host? + + Will match hosta and hostb, but + not host. + + + + + ho*na + + Will match hoina + but not ho.aina.org. + + + + + ho**na + + Will match hoina + and ho.aina.org. + + + + + ^hosta + + Will match hosta + but not foo.hosta.org. + + + + + sda* + + Will match /dev/sda1 + and /dev/sda12. + + + + + /opt + + Will match the disk opt + but not the host opt. + + + + + (note dots:) .opt. + + Will match the host opt + but not the disk opt. + + + + + / + + Will match the disk / + but no other disk. + + + + + /usr + + Will match the disks /usr + and /usr/local. + + + + + /usr$ + + Will match the disks /usr + but not /usr/local. + + + + @@ -1145,49 +475,44 @@ the host or disk. expression is a range expression where we only match the prefix. Leading ^ is removed. Trailing $ forces an exact match. - - - - - -20001212-14 -match all dates beginning with 20001212, 20001213 or 20001214 - - - -20001212-4 -same as previous - - - -20001212-24 -match all dates between 20001212 and 20001224 - - - -2000121 -match all dates that start with 2000121 (20001210-20001219) - - - -2 -match all dates that start with 2 (20000101-29991231) - - - -2000-10 -match all dates between 20000101-20101231 - - - -200010$ -match only 200010 - - - - - - + + + + 20001212-14 + match all dates beginning with 20001212, 20001213 or 20001214 + + + + 20001212-4 + same as previous + + + + 20001212-24 + match all dates between 20001212 and 20001224 + + + + 2000121 + match all dates that start with 2000121 (20001210-20001219) + + + + 2 + match all dates that start with 2 (20000101-29991231) + + + + 2000-10 + match all dates between 20000101-20101231 + + + + 200010$ + match only 200010 + + + @@ -1200,43 +525,32 @@ escaped within any component by preceding them with a '\'. Some examples: - - - - - -DUMPSPEC -DESCRIPTION - - - -client17 -all dumps of client17 - - - -@20080615 -All dumps on with datestamps matching 20080615 - - - -webserver:/var/www -All dumps of /var/www on host webserver - - - -webserver:/var/www@200806150317 -The dump of webserver with datestamp 200806150317 - - - -:/var/www -All dumps of /var/www on any host - - - - - + + + client17 + all dumps of client17 + + + + @20080615 + All dumps on with datestamps matching 20080615 + + + + webserver:/var/www + All dumps of /var/www on host webserver + + + + webserver:/var/www@200806150317 + The dump of webserver with datestamp 200806150317 + + + + :/var/www + All dumps of /var/www on any host + + @@ -1267,6 +581,13 @@ amdump -o INTERFACE:local:use="2000 kbps" +When overriding device properties, one must carefully quote the + command line to simulate the syntax of real configuration files. The + following example should serve as a guide: + +amdump -o 'device-property="PROPERTY_MAX_VOLUME_USAGE" "100000"' + + Note that configuration overrides are not effective for tape changers, which supply a tapedev based on their own configuration. In order to override tapedev, you must also disable any changer: @@ -1277,41 +598,5 @@ amdump -otapedev=/dev/nst1 -otpchanger='' -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion, major update - - -SEE ALSO - -amadmin8, -amanda.conf5, -amanda-client.conf5, -amcheck8, -amcheckdb8, -amcleanup8, -amdd8, -amdump8, -amfetchdump8 -amflush8, -amgetconf8, -amlabel8, -ammt8, -amoverview8, -amplot8, -amrecover8, -amreport8, -amrestore8, -amrmtape8, -amstatus8, -amtape8, -amtapetype8, -amtoc8, -amcheckdump8, -amserverconfig8, -amaddclient8, - - - diff --git a/man/xml-source/amanda.conf.5.xml b/man/xml-source/amanda.conf.5.xml index 6b15ca7..79a7f05 100644 --- a/man/xml-source/amanda.conf.5.xml +++ b/man/xml-source/amanda.conf.5.xml @@ -12,11 +12,18 @@ amanda.conf 5 +&rmi.source; +&rmi.version; +&rmi.manual.5; amanda.conf Main configuration file for &A;, the Advanced Maryland Automatic Network Disk Archiver + +&author.jds; +&author.sgw.xml; + DESCRIPTION @@ -25,7 +32,7 @@ relevant sections and parameters of this file for quick reference. The file <CONFIG_DIR>/<config>/amanda.conf is loaded. -PARAMETERS +SYNTAX There are a number of configuration parameters that control the behavior of the &A; programs. @@ -34,22 +41,68 @@ so you need not specify the parameter in amanda.conf if the default is suitable. +COMMENTS + Lines starting with # are ignored, as are blank lines. Comments may be placed on a line with a directive by starting the comment with a #. The remainder of the line is ignored. + + +KEYWORDS AND IDENTIFIERS Keywords are case insensitive, i.e. mailto and MailTo -are treated the same. +are treated the same. Also, the characters +'-' +and +'_' +are interchangeable in all predefined &A; keywords: +device_property +and +device-property +have the same meaning. + +Identifiers are names which are defined in the configuration itself, such +as dumptypes or interfaces. Identifiers are are case-insensitive, but +sensitive to +'-' +vs. +'_'. +Identifiers should be quoted in the configuration file, although For historical +reasons, the quotes are optional. + +Strings are always quoted with double quotes ("), and any double quotes +or backslashes within the string are escaped with a backslash: + +tapelist "/path/to/tapelist" +property "escaped-string" "escaping: \\ (backslash) and \" (double-quote)" + + + +To summarize, then: + + # QUOTES CASE -/_ +logdir "logs" # required sensitive sensitive +send-amreport-on strange # prohibited insensitive insensitive +tapetype "EXABYTE" # optional insensitive sensitive + +define dumptype "dt" { # optional insensitive sensitive + "dumptype-common" # optional insensitive sensitive + strategy noincr # prohibited insensitive insensitive +} + + + + + +VALUE SUFFIXES Integer arguments may have one of the following (case insensitive) suffixes, some of which have a multiplier effect: -POSSIBLE SUFFIXES - b byte bytes @@ -73,6 +126,7 @@ some of which have a multiplier effect: kps kbps Some number of kilobytes per second (bytes*1024). +It is the default multiplier for all size options. @@ -140,8 +194,46 @@ is assumed. - -PARAMETERS +PARAMETER ORDER + +In general, the order in which parameters occur in the configuration file +does not matter, with the exception of subsection inheritance. For example, if +dumptype "normal-encrypt" which inherits from dumptype "normal", then "normal" +must appear first in the configuration file. + + + +STRINGS +Quoted strings in Amanda follow a common, C-like syntax. Printable +characters and whitespace are kept as-is, except that the backslash character +(\) is used as an escape character, and a double-quote ends the string. The allowed +escape sequences are + + ESCAPE SEQUENCE BECOMES + \\ \ + \" " + \n (newline) + \t (tab) + \r (carriage return) + \f (form-feed) + \1 - \7 + \01 - \77 + \001 - \377 (character specified in octal) + +Illegally quoted strings are handled on a "best-effort" basis, which may lead to +unexpected results. + +Examples: + +finserver "/data/finance/XYZ Corp's \"real\" finances" finance-high eth0 -1 +property "syspath" "C:\\WINDOWS\\SYSTEM" + + + + + + +GLOBAL PARAMETERS @@ -153,6 +245,12 @@ A descriptive name for the configuration. This string appears in the Subject line of mail reports. Each &A; configuration should have a different string to keep mail reports distinct. + + + + mailer string + +Default found by configure. A mail program that can send mail with 'MAILER -s "subject" user < message_file'. @@ -164,6 +262,41 @@ A space separated list of recipients for mail reports. + send-amreport-on [all|strange|error|never] + +Default: +all. +Specify which types of messages will trigger an email from amreport. amreport is used by amdump and amflush. + + + + all + +Send an email on any message. + + + + strange + +Send an email on strange or error message. A strange message occurs when the dump succeeded, but returned one or more errors unknown to &A;. + + + + error + +Send an email only on error messages. + + + + never + +Never send an email. + + + + + + dumpcycle int Default: @@ -195,9 +328,7 @@ The number of amdump runs in days. A value of 0 means the same value as dumpcycle. -A value of -1 means guess the number of runs from the -tapelist -file, +A value of -1 means guess the number of runs from the &tapelist; file, which is the number of tapes used in the last dumpcycle days / @@ -289,24 +420,17 @@ option. Default: null:. -The path name of the non-rewinding tape device. -Non-rewinding tape device names often have an 'n' in the name, -e.g. -/dev/rmt/0mn, -however this is operating system specific and you should consult -that documentation for detailed naming information. +The device name, referencing the name of a "device" section in the configuration file. See +amanda-devices7 +for more information on device names. If a tape changer is configured (see the tpchanger option), this option might not be used. -If the -null -output driver is selected -(see the section OUTPUT DRIVERS in the -amanda8 -manpage for more information), +If tapedev is +null:, programs such as &amdump; will run normally but all images will be thrown away. @@ -321,22 +445,28 @@ option set to device_property string string -These options can set various device properties, including block size, -maximum volume usage, authentication information, hardware feature support, -and more.Specifics of how properties are used are device-dependent, though -some common properties are supported across multiple device drivers. - - Both strings are quoted; the first string contains the name of +These options can set various device properties. See +amanda-devices7 +for more information on device properties and their syntax. +Both strings are always quoted; the first string contains the name of the property to set, and the second contains its value. For example, to set -a fixed block size of 128k, do:device_property "BLOCK_SIZE" "131072" - -The order in which device properties are set is as follows: -Tapetype parameters, including length, blocksize, -readblocksize, file-pad, are translated into device properties and set -accordingly. -Device properties from any device_property configuration directives -are set, in the order they appear in the configuration file. - +a fixed block size of 128k, write: + +device_property "BLOCK_SIZE" "128k" + + + + + + + property [append] string string+ + +These options can set various properties, they can be used by third + party software to store information in the configuration file. +Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. + @@ -400,6 +530,7 @@ the backup image &A; was processing starts over again on the next tape. Default: runtapes*tape_length. Maximum number of bytes the planner will schedule for a run. +The default unit is Kbytes if it is not specified. @@ -467,10 +598,10 @@ to avoid overwriting each other's tapes. - tapetype string + tapetype identifier Default: -EXABYTE. +"EXABYTE". The type of tape drive associated with tapedev or @@ -483,8 +614,6 @@ like the size, and speed of the tape media and device. -First character of a tapetype string must -be an alphabetic character @@ -634,6 +763,7 @@ it will do the next level. The value of this parameter is used only if the parameter bumppercent is set to 0. +The default unit is Kbytes if it is not specified. The global setting of this parameter can be overwritten inside of a dumptype-definition. @@ -767,9 +897,7 @@ option enabled. Default: tapelist. -The file name for the active -tapelist -file. +The file name for the active &tapelist;. &A; maintains this file with information about the active set of tapes. @@ -777,11 +905,12 @@ file. device_output_buffer_size int Default: -640k. +1280k. Controls the amount of memory used by &A; to hold data as it is read from the network or disk before it is written to the output device. Higher values may be useful on fast tape drives and optical media. +The default unit is bytes if it is not specified. @@ -855,7 +984,7 @@ These three parts specify: the name of the column, which may be: - + Compress (compression ratio) Disk (client disk name) DumpRate (dump rate in KBytes/sec) @@ -866,7 +995,7 @@ These three parts specify: OutKB (output image size in KBytes) TapeRate (tape writing rate in KBytes/sec) TapeTime (total tape time in hours:minutes) - + @@ -992,12 +1121,13 @@ Debug level of the taper process &A; will not begin writing data to a new volume until the amount of data on the holding disk is at least this percentage of the volume size. In other words, &A; will not begin until the - inequality h < t × + inequality h > t × d is satisfied, where h is the amount of data on the holding disk, t is the capacity of a volume, and d is this parameter, expressed as a - percentage. + percentage. This parameter may be larger than 100%, for example to keep + more recent dumps on the holding disk for faster recovery. Needless to say, your holding disk must be big enough that this criterion could be satisfied. If the holding disk cannot be used for a particular dump (because, for example, there is no @@ -1019,14 +1149,14 @@ Debug level of the taper process amount of data on the holding disk and the estimated amount of data remaining to be dumped during this run is at least this percentage of the volume size. In other words, &A; will not begin until the - inequality h + s < t × + inequality h + s > t × d is satisfied, where h is the amount of data on the holding disk, s is the total amount of data scheduled for this run but not dumped yet, t is the capacity of a volume, and d is this parameter, expressed as a - percentage. + percentage. This parameter may be larger than 100%. Needless to say, your holding disk must be big enough that this criterion could be satisfied. If the holding disk cannot be used for a particular dump (because, for example, there is no @@ -1052,13 +1182,13 @@ Debug level of the taper process the capacity of a single volume. In other words, at the end of a run, &A; will begin a new tape if the - inequality h < t × + inequality h > t × f is satisfied, where h is the amount of data remaining on the holding disk from this or previous runs, t is the capacity of a volume, and f is this parameter, expressed as a - percentage. + percentage. This parameter may be greater than 100%. The value of this parameter may not exceed that of the flush-threshold-scheduled parameter.; autoflush must be set to 'yes' if @@ -1097,7 +1227,6 @@ Range is inclusive. - HOLDINGDISK SECTION @@ -1158,6 +1287,7 @@ holding disk files. The size of each chunk will not exceed the specified value. However, even though dump images are split in the holding disk, they are concatenated as they are written to tape, so each dump image still corresponds to a single continuous tape section. +The default unit is Kbytes if it is not specified. If 0 is specified, &A; will create holding disk chunks as large as ((INT_MAX/1024)-64) Kbytes. @@ -1189,7 +1319,7 @@ another set for file systems that should always get a full backup and so on. -define dumptype name { +define dumptype "name" { dumptype-option dumptype-value ... } @@ -1223,24 +1353,7 @@ are defined. Default: bsd. -Type of authorization to perform between tape server and backup client hosts. -bsd, bsd authorization with udp initial -connection and one tcp connection by data stream. -bsdtcp, bsd authorization but use only -one tcp connection. -bsdudp, like bsd, but will use only one -tcp connection for all data stream. -krb4 to use Kerberos-IV -authorization. -krb5 to use Kerberos-V -authorization. -local, if the client is the server, it -doesn't require authencation setup. -rsh to use rsh -authorization. -ssh to use OpenSSH -authorization. - +Type of authorization to perform between tape server and backup client hosts. See amanda-auth7 for more detail. @@ -1279,6 +1392,7 @@ it will do the next level. The value of this parameter is used only if the parameter bumppercent is set to 0. +The default unit is Kbytes if it is not specified. See also the options bumppercent, @@ -1453,7 +1567,7 @@ server host as it goes from the network into the holding disk or to tape. PROG must not contain white space. Specify client_decrypt_option "decryption-parameter" Default: "-d" decryption-parameter must not contain white space. - (See dumptype server-encrypt-fast in example/amanda.conf for reference) + (See dumptype client-encrypt-nocomp in example/amanda.conf for reference) @@ -1463,7 +1577,7 @@ server host as it goes from the network into the holding disk or to tape. PROG must not contain white space. Specify server_decrypt_option "decryption-parameter" Default: "-d" decryption-parameter must not contain white space. - (See dumptype client-encrypt-nocomp in example/amanda.conf for reference) + (See dumptype server-encrypt-fast in example/amanda.conf for reference) @@ -1701,17 +1815,58 @@ high (2), medium (1), low (0) or a number of your choice. - program string + program [DUMP|GNUTAR|APPLICATION] Default: DUMP. -The type of backup to perform. Valid values are -DUMP -for the native operating system backup program, and -GNUTAR -to use &gnutar; or to do PC backups using Samba. +The type of backup to perform. Valid values are: + + + + DUMP + +The native operating system backup program. + + + + GNUTAR + +To use GNU-tar or to do PC backups using Samba. + + + + APPLICATION + +To use an application-tool, see the application option. + + + + + application string + +No default. Must be the name of an application-tool if program is set to APPLICATION. See APPLICATION SECTION below. + + + + script string + +No default. Must be the name of a script-tool. You can have many script. See SCRIPT SECTION below. + + + + property [append] string string+ + +These options can set various properties, they can be used by third + party software to store information in the configuration file. +Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. + + + + record boolean @@ -1805,6 +1960,7 @@ average dump being split), substantial tape space can be wasted. If too small, large dumps will be split into innumerable tiny dumpfiles, adding to restoration complexity. A good rule of thumb, usually, is 1/10 of the size of your tape. +The default unit is Kbytes if it is not specified. @@ -1832,6 +1988,7 @@ The size of this buffer can be changed from its (very conservative) default to a value reflecting the amount of memory that each taper process on the dump server may reasonably consume. +The default unit is Kbytes if it is not specified. @@ -1839,31 +1996,31 @@ the dump server may reasonably consume. The following dumptype entries are predefined by &A;: -define dumptype no-compress { +define dumptype "no-compress" { compress none } -define dumptype compress-fast { +define dumptype "compress-fast" { compress client fast } -define dumptype compress-best { +define dumptype "compress-best" { compress client best } -define dumptype srvcompress { +define dumptype "srvcompress" { compress server fast } -define dumptype bsd-auth { +define dumptype "bsd-auth" { auth bsd } -define dumptype krb4-auth { +define dumptype "krb4-auth" { auth krb4 } -define dumptype no-record { +define dumptype "no-record" { record no } -define dumptype no-hold { +define dumptype "no-hold" { holdingdisk no } -define dumptype no-full { +define dumptype "no-full" { skip-full yes } @@ -1872,7 +2029,7 @@ define dumptype no-full { dumptype section, one or more other dumptype -names may be entered, which make this +names may be supplied as identifiers, which make this dumptype inherit options from other previously defined dumptypes. @@ -1880,15 +2037,15 @@ For instance, two sections might be the same except for the record option: -define dumptype normal { +define dumptype "normal" { comment "Normal backup, no compression, do indexing" no-compress index yes maxdumps 2 } -define dumptype testing { +define dumptype "testing" { comment "Test backup, no compression, do indexing, no recording" - normal + "normal" record no } @@ -1914,7 +2071,7 @@ The information is entered in a section, which looks like this in the config file: -define tapetype name { +define tapetype "name" { tapetype-option tapetype-value ... } @@ -1958,7 +2115,9 @@ regardless of what value is entered for length (but see the section OUTPUT DRIVERS in the amanda8 manpage for exceptions). - + +The default unit is bytes if it is not specified. + @@ -1966,45 +2125,22 @@ manpage for exceptions). Default: 32 kbytes. -How much data will be written in each tape record expressed in KiloBytes. -The tape record size (= blocksize) can not be reduced below the default 32 KBytes. -The parameter blocksize can only be raised if &A; was compiled with the configure option ---with-maxtapeblocksize=N set with "N" greater than 32 during -&configure;. +How much data will be written in each tape record. This is equivalent to the BLOCK_SIZE device property. +The default unit is Kbytes if it is not specified. readblocksize int -Default: -(from configure --with-maxtapeblocksize). -How much data will be read in each tape record expressed in KiloBytes. -Some hardware require a value not too large, and some require it to be equal to the blocksize. -It is useful if you configured amanda with a big --with-maxtapeblocksize and your -hardware don't work with a value that big. +Default: 32 kytes +How much data will be read in each tape record. This can be used to override a +device's block size for reads only. This may be useful, for example, in +reading a tape written with a 256k block size when Amanda is configured to use +128k blocks. This unusual feature is not supported by all operating systems and +tape devices. - - - - file-pad boolean - -Default: -true. -If true, every record, including the last one in the file, will have the same length. -This matches the way &A; wrote tapes prior to the availability of this parameter. -It may also be useful on devices that only support a fixed blocksize. - -Note that the last record on the tape probably includes trailing -null byte padding, which will be passed back to -gzip, -compress -or the restore program. Most programs just ignore this (although possibly with a warning). - -If this parameter is false, the last record in a file may be shorter -than the block size. The file will contain the same amount of data the dump program generated, -without trailing null byte padding. When read, the same amount of data that was written -will be returned. +The default unit is Kbytes if it is not specified. @@ -2033,7 +2169,7 @@ man page for more information. In addition to options, another tapetype -name may be entered, which makes this +name may be supplie as an identifier, which makes this tapetype inherit options from another tapetype. @@ -2042,14 +2178,14 @@ Compact-III tapes and one using Compact-IV tapes is the length of the tape. So they could be entered as: -define tapetype DLT4000-III { +define tapetype "DLT4000-III" { comment "DLT4000 tape drives with Compact-III tapes" length 12500 mbytes # 10 Gig tapes with some compression filemark 2000 kbytes speed 1536 kps } -define tapetype DLT4000-IV { - DLT4000-III +define tapetype "DLT4000-IV" { + "DLT4000-III" comment "DLT4000 tape drives with Compact-IV tapes" length 25000 mbytes # 20 Gig tapes with some compression } @@ -2070,7 +2206,7 @@ The information is entered in an interface section, which looks like this: -define interface name { +define interface "name" { interface-option interface-value ... } @@ -2111,16 +2247,290 @@ The speed of the interface in Kbytes per second. In addition to options, another interface -name may be entered, which makes this +name may be supplied as an identifier, which makes this interface inherit options from another interface. At the moment, this is of little use. -AUTHOR -James da Silva, &email.jds;: Original text -&maintainer.sgw;: XML-conversion, major update, splitting +APPLICATION SECTION +The +amanda.conf +file may define multiple types of application. +The information is entered in a application-tool +section, which looks like this: + + +define application-tool "name" { + application-option application-value + ... +} + + +name +is the name of this type of application. It is referenced from the +dumptype + +The application-tool options and values are: + + + comment string + +Default: +none. +A comment string describing this application. + + + + plugin string + +No default. Must be set to the name of the program. This program must be in the $libexecdir/amanda/application directory on the client. + + + + property [append] [priority] string string+ + +No default. You can set property for the application, each application have a different set of property. Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. +priority keyword disallow the setting of that property on the client. + + + + + + +SCRIPT SECTION +The +amanda.conf +file may define multiple types of script. +The information is entered in a script-tool +section, which looks like this: + + +define script-tool "name" { + script-option script-value + ... +} + + +name +is the name of this type of script. It is referenced from the +dumptype + +The script-tool options and values are: + + + comment string + +Default: +none. +A comment string describing this script. + + + + plugin string + +No default. Must be set to the name of the program. This program must be in the $libexecdir/amanda/application directory on the client and/or server. + + + + execute_where [client|server] + +Default: client. Where the script must be executed, on the client or server. + + + + execute_on execute_on[,execute_on]* + +No default. When the script must be executed, you can specify many of them: + + + + pre-dle-amcheck + +Execute before the amcheck command for the dle. + + + + pre-host-amcheck + +Execute before the amcheck command for all dle for the client. + + + + post-dle-amcheck + +Execute after the amcheck command for the dle. + + + + post-host-amcheck + +Execute after the amcheck command for all dle for the client. + + + + pre-dle-estimate + +Execute before the estimate command for the dle. + + + + pre-host-estimate + +Execute before the estimate command for all dle for the client. + + + + post-dle-estimate + +Execute after the estimate command for the dle. + + + + post-host-estimate + +Execute after the estimate command for all dle for the client. + + + + pre-dle-backup + +Execute before the backup command for the dle. + + + + pre-host-backup + +Execute before the backup command for all dle for the client. + + + + post-dle-backup + +Execute after the backup command for the dle. + + + + post-host-backup + +Execute after the backup command for all dle for the client. + + + + pre-recover + +Execute before any level is recovered. + + + + post-recover + +Execute after all levels are recovered. + + + + pre-level-recover + +Execute before each level recovery. + + + + post-level-recover + +Execute after each level recovery. + + + + inter-level-recover + +Execute between two levels of recovery. + + + + If you recover level 0 and 2 of the disk /usr with amrecover, it will execute: + +script --pre-recover +script --pre-level-recover --level 0 +#recovering level 0 +script --post-level-recover --level 0 +script --inter-level-recover --level 0 --level 2 +script --pre-level-recover --level 2 +#recovering level 2 +script --post-level-recover --level 2 +script --post-recover + + + + + property [append] [priority] string string+ + +No default. You can set property for the script, each script have a different set of property. Both strings are quoted; the first string contains the name of +the property to set, and the others contains its values. +append keyword append the values to the list of values for that property. +priority keyword disallow the setting of that property on the client. + + + + + + +DEVICE SECTION +Backend storage devices are specified in +amanda.conf +in the form of "device" sections, which look like this: + + +define device name { + commend "comment (optional)" + tapedev "device-specifier" + device_property "prop-name" "prop-value" + ... +} + + +name is the user-specified name of +this device. It is referenced from the global tapedev parameter. The device-specifier specifies the device name to use; +see amanda-devices7. +As with most sections, the comment +parmeter is optional and only for the user's convenience. + +An arbitrary number of device_property parameters can be specified. +Again, see +amanda-devices7 +for information on device properties. + + + +CHANGER SECTION +Changers are described in +amanda.conf +in the form of "changer" sections, which look like this: + + +define changer name { + comment "comment (optional)" + tapedev "tape-device" + tpchanger "changer-type" + changerdev "device-name" + changerfile "state-file" + ... +} + + +name is the user-specified name of this +device. The remaining parameters are specific to the changer type selected. + + + +TODO: more detail here once it's known + + SEE ALSO diff --git a/man/xml-source/amarchiver.8.xml b/man/xml-source/amarchiver.8.xml new file mode 100644 index 0000000..1722d7e --- /dev/null +++ b/man/xml-source/amarchiver.8.xml @@ -0,0 +1,99 @@ + + + + %global_entities; +]> + + + + +amarchiver +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amarchiver +Create, extract or list amanda archive + + +&author.dustin; +&author.jlm; + + + + + amarchiver + --version|--create|--extract|--list + --verbose + --file file + filename + + + +DESCRIPTION + +Amarchiver manipulates amanda archive +file. On creation, amarchiver doesn't recurse into directories. If a filename +specifies a directory, it will be ignored. If it specifies a character device, +amarchiver reads the device and archives the data. If a filename specifies a +named pipe, amarchiver reads the named pipe and archives the data. + +Note that this tool is more limited than the Amanda archive library, and +may not be appropriate for some archive files -- particularly those which use +non-strings in their filenames. + + + +OPTIONS + + + + +print the amarchiver version + + + + + + +Create an amanda archive. Only the supplied filenames are included. With one , lists the filenames. With two, lists the filenames and sizes. + + + + + + +List the filenames in an amanda archive. No additional filenames are allowed on the command line. + + + + + +Extract an amanda archive. If filenames are supplied, only those files are extracted. Files are created in the current directory, suffixed with a dot ('.') and the attribute ID. + + + + + +Give more information. + + + + file + +Create, list or extract from the given file instead of stdin/stdout. + + + + + +SEE ALSO +amanda8 +amanda-archive-format5 + + diff --git a/man/xml-source/amcheck.8.xml b/man/xml-source/amcheck.8.xml index 0ee87d5..ada5072 100644 --- a/man/xml-source/amcheck.8.xml +++ b/man/xml-source/amcheck.8.xml @@ -13,11 +13,18 @@ amcheck 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcheck run &A; self-checks + +&author.jds; +&author.sgw.xml; + @@ -418,10 +425,7 @@ in tapelist -for the &A; tapelist directory (see -tapelist -in -amanda.conf) +for the &tapelist; @@ -507,27 +511,13 @@ does not allow search permission. ERROR: tape list tapelist: not writable -(error) -&A; tape list file -tapelist -(see -tapelist -in -amanda.conf) -is not writable or was not found. +(error) &tapelist; is not writable or was not found. ERROR: tape list tapelist: parse error -(error) -&A; tape list file -tapelist -(see -tapelist -in -amanda.conf) -could not be read or parsed. +(error) &tapelist; could not be read or parsed. @@ -870,11 +860,6 @@ The exit code of amcheck is one of: -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amdump8, diff --git a/man/xml-source/amcheckdb.8.xml b/man/xml-source/amcheckdb.8.xml index 7585a8b..2b52a78 100644 --- a/man/xml-source/amcheckdb.8.xml +++ b/man/xml-source/amcheckdb.8.xml @@ -13,11 +13,18 @@ amcheckdb 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcheckdb check &A; database for tape consistency + +&author.atf3r; +&author.sgw.xml; + @@ -30,9 +37,7 @@ DESCRIPTION Amcheckdb verifies that every tape mentioned in the &A; database -is still valid in the -tapelist -file. +is still valid in the &tapelist;. See the amanda8 @@ -49,9 +54,7 @@ Ready. This shows tape DMP014 -is still listed in the database but is no longer listed in the -tapelist -file: +is still listed in the database but is no longer listed in the &tapelist;: # amcheckdb daily @@ -60,11 +63,6 @@ Ready. -AUTHOR -Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>: Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amadmin8, amrmtape8, diff --git a/man/xml-source/amcheckdump.8.xml b/man/xml-source/amcheckdump.8.xml index e37da35..47cb4e1 100644 --- a/man/xml-source/amcheckdump.8.xml +++ b/man/xml-source/amcheckdump.8.xml @@ -11,11 +11,17 @@ amcheckdump 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcheckdump check the results of an &A; dump + +&author.ian; + @@ -48,11 +54,6 @@ remap='B'>CONFIGURATION OVERRIDE" section in amanda8 for information on the -o option. - SEE ALSO - amanda8, - - - EXAMPLE @@ -64,8 +65,9 @@ amcheckdump MYCONFIG --timestamp 19780615 SEE ALSO - amanda8, - http://wiki.zmanda.com + amanda8, + - + + diff --git a/man/xml-source/amcleanup.8.xml b/man/xml-source/amcleanup.8.xml index 76c9f1d..3e61f6b 100644 --- a/man/xml-source/amcleanup.8.xml +++ b/man/xml-source/amcleanup.8.xml @@ -13,16 +13,24 @@ amcleanup 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcleanup run the &A; cleanup process after a failure + +&author.jds; +&author.sgw.xml; + amcleanup + config @@ -52,7 +60,13 @@ man page for more details about &A;. - Kill all Amanda processes. + Kill all process listed in the log file are their child. if there is no log file, then kill all amdump and amflush process and their child. + + + + + + Do the cleanup only if all process listed in the log file are already terminated. @@ -90,11 +104,6 @@ amcleanup: no unprocessed logfile to clean up. -AUTHOR -James da Silva, &email.jds;: Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amdump8, diff --git a/man/xml-source/amcrypt-ossl-asym.8.xml b/man/xml-source/amcrypt-ossl-asym.8.xml index 3c2a974..ea0d7be 100644 --- a/man/xml-source/amcrypt-ossl-asym.8.xml +++ b/man/xml-source/amcrypt-ossl-asym.8.xml @@ -12,11 +12,17 @@ amcrypt-ossl-asym 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcrypt-ossl-asym crypt program for &A; asymmetric data encryption using OpenSSL + +&author.ktill; + @@ -127,6 +133,7 @@ Writing RSA key + SEE ALSO diff --git a/man/xml-source/amcrypt-ossl.8.xml b/man/xml-source/amcrypt-ossl.8.xml index 1b6e7a2..6c966d9 100644 --- a/man/xml-source/amcrypt-ossl.8.xml +++ b/man/xml-source/amcrypt-ossl.8.xml @@ -12,11 +12,17 @@ amcrypt-ossl 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcrypt-ossl crypt program for &A; symmetric data encryption using OpenSSL + +&author.ktill; + @@ -68,6 +74,7 @@ + SEE ALSO diff --git a/man/xml-source/amcrypt.8.xml b/man/xml-source/amcrypt.8.xml index 5d93ea3..b4008bd 100755 --- a/man/xml-source/amcrypt.8.xml +++ b/man/xml-source/amcrypt.8.xml @@ -11,11 +11,17 @@ amcrypt 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcrypt reference crypt program for &A; symmetric data encryption + +&author.ktill; + diff --git a/man/xml-source/amcryptsimple.8.xml b/man/xml-source/amcryptsimple.8.xml index 29151e1..49bd780 100644 --- a/man/xml-source/amcryptsimple.8.xml +++ b/man/xml-source/amcryptsimple.8.xml @@ -11,11 +11,17 @@ amcryptsimple 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amcryptsimple reference simple crypt program for &A; symmetric data encryption + +&author.ktill; + @@ -52,12 +58,6 @@ restored with the passphrase. There is no backdoor. encryption uses the public key to encrypt and uses the private key to decrypt. -AUTHOR - - The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). - - - SEE ALSO amanda8, amanda.conf5, diff --git a/man/xml-source/amdd.8.xml b/man/xml-source/amdd.8.xml deleted file mode 100644 index 02a206f..0000000 --- a/man/xml-source/amdd.8.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - %global_entities; -]> - - - - - - -amdd -8 - - -amdd -&A; version of dd - - - - - amdd - -d - if=input - of=output - bs=blocksize - skip=count - count=count - - - - -DESCRIPTION -Amdd -provides just enough of the standard UNIX -dd -command for the needs of &A;. -This is handy when doing a full restore and the standard -dd -program has not yet been found. - -Amdd -also provides access to the &A; output drivers that support various tape simulations. -This may be used for debugging or to convert from one format to another. - -See the -amanda8 -man page for more details about &A;. -See the -OUTPUT DRIVERS -section of -amanda(8) -for more information on the &A; output drivers. - - -OPTIONS - - - - -Turn on debugging output. - - - - length - -Set the output length. -If the output driver limits the output size, this controls -when end of tape will be simulated. -Length -may have a multiplier suffix: - - -k -> 1024 (Kilobytes) -b -> 512 (Blocks) -M -> 1024*1024 (Megabytes) - - -The default is no multiplier (bytes). - - - - - - - if=input - -Input to -dd. -Default is stdin. - - - - of=output - -Where to send the output of -dd. -Default is stdout. - - - - bs=blocksize - -Size of each record. -Input records smaller than this will -not -be padded. -Output records will be the same size as the corresponding input record. -Default is 512 bytes. -Blocksize -may have a multiplier suffix: - -k -> 1024 (Kilobytes) -b -> 512 (Blocks) -M -> 1024*1024 (Megabytes) - -The default is no multiplier (bytes). - - - - - - - count=count - -Number of records to copy. -Default is all records until end of file. - - - - skip=count - -Number of records to skip before copying input to output. -Default is zero. - - - - - -AUTHOR -Marc Mengel mengel@fnal.gov, John R. Jackson -jrj@purdue.edu : Original text -&maintainer.sgw;: XML-conversion - - -SEE ALSO - - amanda8, - - - - - diff --git a/man/xml-source/amdevcheck.8.xml b/man/xml-source/amdevcheck.8.xml index d4ca82d..7646078 100644 --- a/man/xml-source/amdevcheck.8.xml +++ b/man/xml-source/amdevcheck.8.xml @@ -12,11 +12,17 @@ amdevcheck 8 + &rmi.source; + &rmi.version; + &rmi.manual.8; amdevcheck Validate an &A; device and volume. + + &author.ian; + @@ -42,12 +48,9 @@ See the amanda8 - man page for more details about &A;. - See the - OUTPUT DRIVERS - section of - amanda(8) - for more information on the &A; output drivers. + man page for more details about &A;. See + amanda-devices7 + for more information on devices. @@ -84,11 +87,42 @@ - AUTHOR - - Ian Turner ian@zmanda.com and others. Authorship of this - tool and its documentation was funded by Zmanda, Inc. - + OUTPUT + Amdevcheck returns one or more of the following lines. If multiple lines appear, then at least one, but not necessarily all of +the messages apply. This situation can occur when working with hardware or +operating systems which cannot distinguish, for example, between a +malfunctioning drive and a functional but unloaded drive. + + + + SUCCESS + A tape is ready. + + + DEVICE_ERROR + A device error has occurred. + + + DEVICE_BUSY + The device is busy. + + + VOLUME_MISSING + No tape is loaded in the drive. + + + VOLUME_UNLABELED + The tape in the drive is unlabeled. + + + VOLUME_ERROR + A volume error has occurred. + + + MESSAGE text + Where text provides a human-readable description of the problem. + + SEE ALSO diff --git a/man/xml-source/amdump.8.xml b/man/xml-source/amdump.8.xml index c559cfd..5a6cba8 100644 --- a/man/xml-source/amdump.8.xml +++ b/man/xml-source/amdump.8.xml @@ -13,11 +13,18 @@ amdump 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amdump back up all disks in an &A; configuration + +&author.jds; +&author.sgw.xml; + @@ -135,11 +142,6 @@ The exit code of amdump is the ORed value of: -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, diff --git a/man/xml-source/amfetchdump.8.xml b/man/xml-source/amfetchdump.8.xml index 5a7d120..727f4cc 100644 --- a/man/xml-source/amfetchdump.8.xml +++ b/man/xml-source/amfetchdump.8.xml @@ -12,11 +12,18 @@ amfetchdump 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amfetchdump extract backup images from multiple &A; tapes. + +&author.jstange; +&author.ian; + @@ -177,18 +184,16 @@ operation. Here's a simple case, restoring all known dumps of the host vanya to the current working directory. - - + $ amfetchdump SetA vanya - + A more likely scenario involves restoring a particular dump from a particular date. We'll pipe this one to &gnutar; as well, to automatically extract the dump. - - + $ amfetchdump -p SetA vanya /home 20051020 | gtar -xvpf - - + @@ -205,11 +210,6 @@ or instead. -AUTHOR -John Stange, &email.jstange;, National Academies Press -Ian Turner, &email.itt;: XML-conversion - - SEE ALSO amanda8, amadmin8, diff --git a/man/xml-source/amflush.8.xml b/man/xml-source/amflush.8.xml index 24fde4e..50b4760 100644 --- a/man/xml-source/amflush.8.xml +++ b/man/xml-source/amflush.8.xml @@ -13,11 +13,18 @@ amflush 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amflush flush &A; backup files from holding disk to tape + +&author.jds; +&author.sgw.xml; + @@ -39,7 +46,7 @@ DESCRIPTION Amflush writes &A; backups from the holding disks to tape, -and updates the &A; info database and tapelist accordingly. +and updates the &A; info database and &tapelist; accordingly. Backups may stay in a holding disk when something is wrong with the tape at the time amdump @@ -151,7 +158,7 @@ a mail report similar to amdump8. -% amflush daily +% amflush MyConfig Scanning /amanda-hold... 20001113: found &A; directory. 20001114: found &A; directory. @@ -169,6 +176,13 @@ Are you sure you want to do this? yes Running in background, you can log off now. You'll get mail when amflush is finished. + +The following example causes amflush to flush everything to tape, then +ejects tape, using 'at' to run the task in the background. + + +% echo 'amflush -b -f MyConfig && mt offline' | at now + EXIT CODE @@ -182,11 +196,6 @@ The exit code of amflush is the ORed value of: -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, diff --git a/man/xml-source/amgetconf.8.xml b/man/xml-source/amgetconf.8.xml index 9dab511..5be005a 100644 --- a/man/xml-source/amgetconf.8.xml +++ b/man/xml-source/amgetconf.8.xml @@ -13,195 +13,292 @@ amgetconf 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amgetconf -look up amanda.conf variables +look up configuration parameters and manipulate debug logs + +&author.jlm; + amgetconf + -l|--list + -o configoption + --client + --execute-where client|server config - --list parameter - -o configoption - DESCRIPTION -Amgetconf -looks up parameters in -amanda.conf, -the &A; configuration file, -or from the build and runtime environment, -and returns their corresponding value. - -If -config -is not specified, -amgetconf -assumes it is being run from the configuration directory and that -amanda.conf -is present. - -If -parameter -begins with -build., -the (case insensitive) string following the period -is a build environment variable. -Variables without a value (e.g. -XFSDUMP -on a system that does not support that type of file system) -will not report an error and will return an empty string as the value. -Flag variables (e.g. -USE_AMANDAHOSTS) -will return -1 -if the flag is set or an empty string if it is not. - -If -parameter -begins with -dbopen., -the string following the period is a program name and an &A; debug -file will be created for the caller. -The name of the file is returned. - -If -parameter -begins with -dbclose., -the string following the period is a program name previously used with -dbopen., -followed by a colon (:) and the previously opened file name. - -See the + +Amgetconf has three main jobs: + to +fetch configuration information from the Amanda configuration; to fetch +build-time configuration values; and to open and close debug logs for +shell scripts. Each is treated in its own subsection, below. + +If config is not +specified, amgetconf assumes it is +being run from the configuration directory and that amanda.conf is present. The order of options and +arguments does not matter. parameter +is always case-insensitive, and '-' and '_' are treated as identical, just +as in amanda.conf5. + +See the "CONFIGURATION OVERRIDE" section in amanda8 -man page for more details about &A;. - +for information on the -o option. -OPTIONS - +AMANDA CONFIGURATION - - --list - -The parameter must be 'tapetype', 'dumptype, 'holdingdisk' or 'interface'. It will output, one by line, the list of identifier for the parameter. - - - --list tapetype - - Output the list of tapetype, one by line. - - - - --list dumptype - - Output the list of dumptype, one by line. - - - - --list holdingdisk - - Output the list of holdingdisk, one by line. - - - - --list interface - - Output the list of interface, one by line. - - - - - +If parameter is a configuration +keyword (from amanda.conf +5 ), then amgetconf will return +the corresponding value. For keywords which can take multiple values, +amgetconf will return all values, one on each line. - - parameter - - It could be one of the below format: - - - runtapes - - - DUMPTYPE:no-compress:compress - - - TAPETYPE:HP-DAT:length - - - INTERFACE:local:use - - - HOLDINGDISK:hd1:use - - - - +Values in configuration subsections are specified with +parameters of the form TYPE:NAME:PARAMETER, +where TYPE is the subsection type (one +of dumptype, tapetype, +interface, holdingdisk, +application-tool, or script-tool; +NAME is the name of the subsection (e.g., +user-tar), and PARAMETER is +the name of the disired parameter within that subsection. - --o configoption - -See the "CONFIGURATION OVERRIDE" section in amanda8. - - +The --list option lists the subsections of +a certain type, where the type is givein as the parameter. + +The --client option is equivalent to +--execute-where server (below). + +The --execute-where option tells amgetconf whether +to operate on the client or the server; the server is the default. + + + +BUILD CONFIGURATION + +If parameter begins +with build., then the following name is a +build environment variable. Variables without a value (e.g. +XFSDUMP on a system that does not support that +type of file system) will not report an error and will return an +empty string as the value. Some boolean variables (e.g. USE_AMANDAHOSTS) will return 1 +if the flag is set or an empty string if it is not, while others +return yes or no, as indicated +below (the difference is historical). + +Combining the --list option with the parameter +build will enumerate all available build parameters. + +Build Parameters + bindir + sbindir + libexecdir + mandir + Install directories + + + AMANDA_TMPDIR + CONFIG_DIR + AMANDA_DBGDIR + GNUTAR_LISTED_INCREMENTAL_DIR + Runtime directories + + listed_inc_dir + Same as GNUTAR_LISTED_INCREMENTAL_DIR + + + CC + VERSION + ASSERTIONS + LOCKING + USE_VERSION_SUFFIXES + Build information. ASSERTIONS + is 1 or empty, while USE_VERSION_SUFFIXES is + yes/no. + + DUMP + RESTORE + VDUMP + VRESTORE + XFSDUMP + XFSRESTORE + VXDUMP + VXRESTORE + SAMBA_CLIENT + GNUTAR + STAR + COMPRESS_PATH + UNCOMPRESS_PATH + Paths to various utility progarms (empty if they + are not found or not used) + + + AIX_BACKUP + Is DUMP the AIX backup program? (empty or 1) + + + DUMP_RETURNS_1 + Does DUMP return 1 on success? (empty or 1) + + + BSD_SECURITY + BSDUDP_SECURITY + BSDTCP_SECURITY + KRB4_SECURITY + KRB5_SECURITY + SSH_SECURITY + RSH_SECURITY + Indicate which authentication mechanisms are + available (yes or no). + + + USE_AMANDAHOSTS + Should the "bsd" authentication mechanism use + amandahosts? (yes or no). + + + AMANDA_DEBUG_DAYS + Number of days after which debug logs are deleted. + + + DEFAULT_SERVER + DEFAULT_CONFIG + DEFAULT_TAPE_SERVER + DEFAULT_TAPE_DEVICE + Default values for configuration parameters + + + CLIENT_LOGIN + Userid under which the client runs (from + --with-user). + + + USE_RUNDUMP + Should Amanda use the rundump + wrapper? (empty or 1) + + + CHECK_USERID + Does Amanda check that userids are correct? (empty or 1) + + + COMPRESS_SUFFIX + COMPRESS_FAST_OPT + COMPRESS_BEST_OPT + UNCOMPRESS_OPT + Command-line options for the compression program. + + + TICKET_LIFETIME + SERVER_HOST_PRINCIPAL + SERVER_HOST_INSTANCE + SERVER_HOST_KEY_FILE + CLIENT_HOST_PRINCIPAL + CLIENT_HOST_INSTANCE + CLIENT_HOST_KEY_FILE + Kerberos parameters. + + + + +DEBUG LOG MANAGEMENT + +That this application is responsible for debug logs is a +historical quirk, but the functionality is widely used. + +If parameter begins with dbopen., the string following the period is a +program name and an &A; debug file will be created for the caller. +The name of the logfile is returned. + +If parameter begins with +dbclose., the string following +the period is a program name previously used with dbopen., followed by a colon (:) and +the previously opened file name. The name of the logfile is +returned. + + -EXAMPLE + +EXAMPLES Find out the path to the log file directory: - - + % amgetconf daily logdir -/usr/local/etc/amanda//daily - +/usr/local/etc/amanda/daily/logs + Find out the current tape type: - - - + % amgetconf daily tapetype DLT4000-IV - + -Find out the default configuration directory: +Find out that tape type's length: + +% amgetconf daily tapetype:DLT4000-IV:length +1024000 + - - -% amgetconf daily build.CONFIG_DIR +List the other available tapetype: + +% amgetconf daily --list tapetype +DISK +QIC-60 +DEC-DLT2000 +... + + +Find out the configuration directory: + +% amgetconf build.CONFIG_DIR /usr/local/etc/amanda/ - + -Create, use and close a debug file in a script: +List all build-time parameters + +% amgetconf --list build +AIX_BACKUP +AMANDA_DBGDIR +AMANDA_DEBUG_DAYS +... + - - -% set debug_file = `amgetconf daily dbopen.myscript` +Create, use and close a debug file in a script: + +% debug_file=`amgetconf daily dbopen.myscript` % echo debug information >> $debug_file % amgetconf daily dbclose.myscript:$debug_file - + MESSAGES amgetconf: no such parameter param - -Parameter -param -is not a known keyword -(e.g. not a valid -amanda.conf -keyword). - - + + Parameter param + is not a known keyword (e.g. not a valid amanda.conf keyword). @@ -213,4 +310,3 @@ keyword). - diff --git a/man/xml-source/amgpgcrypt.8.xml b/man/xml-source/amgpgcrypt.8.xml index a2db468..b8da64b 100644 --- a/man/xml-source/amgpgcrypt.8.xml +++ b/man/xml-source/amgpgcrypt.8.xml @@ -11,11 +11,17 @@ amgpgcrypt 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amgpgcrypt reference crypt program for &A; public-key data encryption + +&author.ktill; + @@ -152,12 +158,6 @@ and protect it properly during other time. mode. &amgpgcrypt; calls gpg with mdc disabled -AUTHOR - - The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). - - - SEE ALSO amanda8, diff --git a/man/xml-source/amgtar.8.xml b/man/xml-source/amgtar.8.xml new file mode 100644 index 0000000..480cedf --- /dev/null +++ b/man/xml-source/amgtar.8.xml @@ -0,0 +1,139 @@ + + + + %global_entities; +]> + + + + +amgtar +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amgtar +Amanda Application to interface with GNU Tar + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +Amgtar is an &A; Application API script. It should not be run +by users directly. It uses GNU Tar to backup and restore data. + + + +PROPERTIES + +This section lists the properties that control amgtar's functionality. +See amanda-applications7 +for information on application properties and how they are configured. + + + + + ATIME-PRESERVE +If "YES" (the default), amgtar use the --atime-preserve=system option of gnutar to not update the atime of all files accessed; if "NO", gnutar will updates the atime for all files accessed. This property works only if you have gnutar 1.15.90 or newer, if not, you must set ATIME_PRESERVE to "NO". + + + CHECK-DEVICE +If "YES" (the default), amgtar checks that the device number doesn't change for each file. If "NO", changes in device number are ignored. To ignore device numbers, tar must support the --no-check-device option (gnutar 1.19.90 and newer). This option is needed for some filesystems and devices on which device numbers change frequently, such as LVM or FiberChannel. + + + DIRECTORY +If set, gnutar will backup from that directory instead of the diskdevice set by the DLE. + + + GNUTAR-LISTDIR +The directory where gnutar stores the database it uses to generate incremental dumps. The default is set when &A; is built. + + + GNUTAR-PATH +The path to the gnutar binary. The default is set when &A; is built. + + + ONE-FILE-SYSTEM +If "YES" (the default), do not allow gnutar to cross filesystem boundaries. If "NO", gnutar will cross filesystem boundaries. This corresponds to the --one-filesystem option of gnutar. + + + TAR-BLOCKSIZE +Block size of Nx512 bytes (default N=20). This corresponds to the --blocking-factor option of gnutar. + + + SPARSE +If "YES" (the default), gnutar will store sparse files efficiently. If "NO", then the --sparse option is not given to gnutar, and it will not try to detect sparse files. + + + EXIT-HANDLING +List which exit status of gtar are good or bad. eg. "1=GOOD 2=BAD", exit status of 1 will produce a good backup, exit status of 2 will give an error. + + + NORMAL +List all regex (POSIX Extended Regular Expression syntax) that are normal output from gtar. These output are in the "FAILED DUMP DETAILS" section of the email report if the dump result is STRANGE or FAILED. Default values: + + "^could not open conf file" + "^Elapsed time:" + "^Throughput" + ": socket ignored$" + ": File .* shrunk by [0-9][0-9]* bytes, padding with zeros" + ": Cannot add file .*: No such file or directory$" + ": Error exit delayed from previous errors" + +To treat one of these default patterns differently, specify it explicitly in a different property. + + + IGNORE +List all regex (POSIX Extended Regular Expression syntax) that amanda ignore. These output are never in the email report. Default values: + + ": Directory is new$" + ": Directory has been renamed" + +To treat one of these default patterns differently, specify it explicitly in a different property. + + + STRANGE +List all regex (POSIX Extended Regular Expression syntax) that are strange output from gtar. All gtar output that doesn't match a normal or ignore regex are strange by default. The result of the dump is STRANGE if gtar produce a strange output. These output are in the "FAILED DUMP DETAILS" section of the email report. + + + + + +EXAMPLE + + define application-tool app_amgtar { + property "ATIME-PRESERVE" "NO" + property "CHECK-DEVICE" "YES" + property "GNUTAR-LISTDIR" " + property "GNUTAR-PATH" "/bin/tar" + property "ONE-FILE-SYSTEM" "YES" + property "TAR_BLOCKSIZE" "20" + property "SPARSE" "YES" + property "EXIT-HANDLING" "1=GOOD 2=BAD" + # change a default NORMAL regex to a STRANGE regex. + property "STRANGE" ": socket ignored$" + # add three new IGNORE regex + property "IGNORE" ": Directory is new$" + property append "IGNORE" ": Directory has been renamed" + property append "IGNORE" "file changed as we read it$" + } + + + +SEE ALSO + +amanda.conf5, +amanda-applications7 + + + + diff --git a/man/xml-source/amlabel.8.xml b/man/xml-source/amlabel.8.xml index 47717a0..3e46026 100644 --- a/man/xml-source/amlabel.8.xml +++ b/man/xml-source/amlabel.8.xml @@ -13,11 +13,18 @@ amlabel 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amlabel label an &A; tape + +&author.jds; +&author.sgw.xml; + @@ -51,8 +58,7 @@ regular expression option. It is up to the system administrator to define a naming convention. Amlabel -appends the new tape to the -tapelist +appends the new tape to the &tapelist; file so it will be used by &A; before it reuses any other tapes. When you amlabel @@ -178,11 +184,6 @@ instead of a non-rewinding device name for -AUTHOR -James da Silva, &email.jds;: Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amdump8, diff --git a/man/xml-source/ammt.8.xml b/man/xml-source/ammt.8.xml deleted file mode 100644 index 509eef8..0000000 --- a/man/xml-source/ammt.8.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - %global_entities; -]> - - - - - -ammt -8 - - -ammt -&A; version of mt - - - - - ammt - -d - -f -t device - command - count - - - - -DESCRIPTION -Ammt -provides just enough of the standard UNIX -mt -command for the needs of &A;. -This is handy when doing a full restore and the standard -mt -program has not yet been found. - -Ammt -also provides access to the &A; output drivers that support -various tape simulations. - -See the -amanda8 -man page for more details about &A;. -See the -OUTPUT DRIVERS -section of -amanda(8) -for more information on the &A; output drivers. - - -OPTIONS - - - - -Turn on debugging output. - - - - device - -Access tape device -device. -If not specified, the -TAPE -environment variable is used. - - - - device - -Same as -. - - - - command count - -Which command to issue, and an optional count of operations. - - - - - -COMMANDS -Each command may be abbreviated to whatever length makes it unique. - - - eof|weof count - -Write -count -(default: 1) end of file marks (tapemarks). - - - - fsf count - -Skip forward -count -(default: 1) files. - - - - bsf count - -Skip backward -count -(default: 1) files. - - - - asf count - -Position to file number -count -(default: 0) -where zero is beginning of tape. -This is the same as a -rewind -followed by a -fsf -count. - - - - rewind - -Rewind to beginning of tape. - - - - offline|rewoffl - -Rewind to beginning of tape and unload the tape from the drive. - - - - status - -Report status information about the drive. -Which data reported, and what it means, -depends on the underlying operating system, -and may include: - - - ONLINE - -Indicates the drive is online and ready. - - - - OFFLINE - -Indicates the drive is offline or not ready. - - - - BOT - -Indicates the drive is at beginning of tape. - - - - EOT - -Indicates the drive is at end of tape. - - - - PROTECTED - -Indicates the tape is write protected. - - - - ds - -Device status. - - - - er - -Error register. - - - - fileno - -Current tape file number. - - - - blkno - -Current tape block number file. - - - - - - - -Many systems only report good data when a tape is in the drive and ready. - - - -AUTHOR -Marc Mengel mengel@fnal.gov, John R. Jackson -jrj@purdue.edu: Original text -&maintainer.sgw;: XML-conversion - - -SEE ALSO -amanda8, - - - - - diff --git a/man/xml-source/amoverview.8.xml b/man/xml-source/amoverview.8.xml index 910eded..cef7a8a 100644 --- a/man/xml-source/amoverview.8.xml +++ b/man/xml-source/amoverview.8.xml @@ -13,11 +13,17 @@ amoverview 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amoverview display file systems processed by &A; over time + +&author.sgw.xml; + diff --git a/man/xml-source/amplot.8.xml b/man/xml-source/amplot.8.xml index eac7c38..5fa8fc0 100644 --- a/man/xml-source/amplot.8.xml +++ b/man/xml-source/amplot.8.xml @@ -12,11 +12,18 @@ amplot 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amplot visualize the behavior of &A; + +&author.ogud; +&author.sgw.xml; + @@ -188,13 +195,6 @@ This process can take a while if hosts are down or it takes them a long time to generate estimates. -AUTHOR -Olafur Gudmundsson ogud@tis.com, -Trusted Information Systems, -formerly at University of Maryland, College Park: Original text -&maintainer.sgw;: XML-conversion - - BUGS Reports lines it does not recognize, mainly error cases but some are legitimate lines the program needs to be taught about. diff --git a/man/xml-source/amrecover.8.xml b/man/xml-source/amrecover.8.xml index 38770b3..722658a 100644 --- a/man/xml-source/amrecover.8.xml +++ b/man/xml-source/amrecover.8.xml @@ -14,11 +14,18 @@ amrecover 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amrecover &A; index database browser + +&author.alan; +&author.sgw.xml; + @@ -45,7 +52,7 @@ to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory. See the examples below for details. -Amrecover will read the amanda-client.conf file and the config/amanda-client.conf file. +Amrecover will read the amanda-client.conf file and the config/amanda-client.conf file. If no configuration name is supplied on the command line, Amrecover will try the compiled-in default configuration ,usually DailySet1. See the amanda8 @@ -178,9 +185,7 @@ It can only be set after the host is set with Diskname is the device name specified in the amanda.conf -or -disklist -configuration file. +or &disklist;. The disk must be local to the host. If mountpoint @@ -213,8 +218,7 @@ If the tape device is omitted, the default is used. tapedev must be equal to the amrecover_changer setting on the server. -If you need to change the protocol (tape:, rait:, file:, null:) then you -must specify the hostname. +Since device names contain colons, you must always specify the hostname. settape 192.168.0.10:file:/file1 @@ -411,12 +415,12 @@ file. # cd /var/log # ls -l syslog.7 syslog.7: No such file or directory -# amrecover +# amrecover MyConfig AMRECOVER Version 2.4.2. Contacting server on oops ... 220 oops &A; index server (2.4.2) ready. Setting restore date to today (1997-12-09) 200 Working date set to 1997-12-09. -200 Config set to daily. +200 Config set to MyConfig. 200 Dump host set to this-host.some.org. $CWD '/var/log' is on disk '/var' mounted at '/var'. 200 Disk set to /var. @@ -539,7 +543,7 @@ The first backup image is in file position one. AMRECOVER Version 2.4.2. Contacting server on oops ... ... amrecover> history -200- Dump history for config "daily" host "this-host.some.org" disk "/var" +200- Dump history for config "MyConfig" host "this-host.some.org" disk "/var" 201- 1997-12-09 1 DMP015 9 201- 1997-12-08 1 DMP014 11 201- 1997-12-07 0 DMP013 22 @@ -579,11 +583,6 @@ but will be overridden by the -t switch. -AUTHOR -Alan M. McIvor alan@kauri.auck.irl.cri.nz : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amanda-client.conf5, diff --git a/man/xml-source/amreport.8.xml b/man/xml-source/amreport.8.xml index 38e7fbe..72c5395 100644 --- a/man/xml-source/amreport.8.xml +++ b/man/xml-source/amreport.8.xml @@ -13,11 +13,17 @@ amreport 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amreport generate a formatted output of statistics for an &A; run + +&author.sgw.xml; + diff --git a/man/xml-source/amrestore.8.xml b/man/xml-source/amrestore.8.xml index 009e7df..50064fc 100644 --- a/man/xml-source/amrestore.8.xml +++ b/man/xml-source/amrestore.8.xml @@ -13,11 +13,18 @@ amrestore 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amrestore extract backup images from an &A; tape + +&author.jds; +&author.sgw.xml; + @@ -331,12 +338,6 @@ the GNUTAR dumptype. Vendor tar programs sometimes fail to read GNU tar images. -AUTHOR -James da Silva, &email.jds;, University of Maryland, -College Park: Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, amdump8, diff --git a/man/xml-source/amrmtape.8.xml b/man/xml-source/amrmtape.8.xml index acdcb78..359da03 100644 --- a/man/xml-source/amrmtape.8.xml +++ b/man/xml-source/amrmtape.8.xml @@ -13,11 +13,18 @@ amrmtape 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amrmtape remove a tape from the &A; database + +&author.atf3r; +&author.sgw.xml; + @@ -50,9 +57,7 @@ man page for more details about &A;. -Generate new -tapelist -and database files with +Generate new &tapelist; and database files with label removed, but leave them in /tmp @@ -93,11 +98,6 @@ configuration. -AUTHOR -Adrian T. Filipi-Martin atf3r@cs.virginia.edu: Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amadmin8, amanda8, diff --git a/man/xml-source/amsamba.8.xml b/man/xml-source/amsamba.8.xml new file mode 100644 index 0000000..4722149 --- /dev/null +++ b/man/xml-source/amsamba.8.xml @@ -0,0 +1,95 @@ + + + + %global_entities; +]> + + + + +amsamba +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amsamba +Amanda Application to interface with smbclient + + +&author.jlm; + + + +DESCRIPTION + +Amsamba is an &A; Application API script. It should not be run +by users directly. It uses smbclient to backup and restore data. + +The device name in the disklist must have the form '//HOST/SHARE/SUBDIR' +where HOST is the CIFS host, SHARE is the share to connect and subdir is the +subdirectory to backup. '/subdir' can be ommited, in which case the complete +share is archived. The host in the disklist should be the name of an +intermediate host that has smbclient installed, and is often the Amanda server +itself. + +Include or exclude can be used, but not both. The path for 'exclude list' +or 'include list' must be absolute path on the client. The estimate calculates +the complete size of the share, without regard for include or exclude +directives. It will be larger than the actual dump if you use include or +exclude. Using 'estimate server' in the dumptype could give better +estimate. + + + +PROPERTIES + +This section lists the properties that control amsamba's functionality. +See amanda-applications7 +for information on application properties and how they are configured. + + + + + SMBCLIENT-PATH +The path to the smbclient binary. The default is set when &A; is built. + + + GNUTAR-PATH +The path to the gnutar binary. The default is set when &A; is built. gnutar +is use to create the index. + + + AMANDAPASS +Location of the amandapass file, The default is "/etc/amandapass". +The format of the file is as follow: + + Sharename User%Password Domain + +Sharename is '//HOST/SHARE' without the SUBDIR. +Sharename can be quoted, +it can be '*' to match all share, +it can be '//pc-host/*' to match all share on pc-host. +User is the username use to connect to the share. +Password is the password use to connect to the share. +Domain is optional. Example: + + //another-pc/share otheruser%otherpw domain + + + + + + +SEE ALSO + +amanda.conf5, +amanda-applications7 + + + + diff --git a/man/xml-source/amserverconfig.8.xml b/man/xml-source/amserverconfig.8.xml index 22a4f44..97b5826 100644 --- a/man/xml-source/amserverconfig.8.xml +++ b/man/xml-source/amserverconfig.8.xml @@ -11,11 +11,17 @@ amserverconfig 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amserverconfig program to setup initial &A; configuration + +&author.ktill; + @@ -233,13 +239,6 @@ is supported. On success, zero is returned. On error, 1 is returned. -AUTHOR - - The tool and its documentation was written by Zmanda, Inc (http://www.zmanda.com/). - - - - SEE ALSO amanda8, amanda.conf5, diff --git a/man/xml-source/amservice.8.xml b/man/xml-source/amservice.8.xml new file mode 100644 index 0000000..de36456 --- /dev/null +++ b/man/xml-source/amservice.8.xml @@ -0,0 +1,121 @@ + + + + %global_entities; +]> + + + + + + +amservice +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amservice +run an amanda service on a client + + +&author.jlm; + + + + + amservice + hostname + auth + service + -finput_file + -o configoption + + + + +DESCRIPTION +Amservice +execute an &A; service on a client. +It can be used without amanda server configuration (amanda.conf and disklist). +It can be used to check communication between a server and a client. +Amservice reads stdin to capture the REQ packet to send to the client. +See the +amanda8 +man page for more details about &A;. + + +OPTIONS + + + hostname + +The hostname of the client. + + + + + +The auth to use, one of: bsd, bsdudp, bsdtcp, ssh, rsh or krb5. +The client must be configured with this auth. + + + + + +The amanda service to execute on the client. One of noop, selfcheck or sendsize. + + + + + +Use the file input_file instead of stdin to read the REQ packet from. + + + + + -o configoption + +See the "CONFIGURATION OVERRIDE" section in amanda8. + + + + + + +EXAMPLE + +The noop service is easy to execute because it does not require a REQ packet: +amservice hostname bsdtcp noop < /dev/null +The example executes the noop service on the client using bsdtcp auth. +This is useful for debugging connection problems. +It print an OPTIONS line upon success. + +It is more difficult to execute the selfcheck or sendsize service, as these require a valid REQ packet. If you have already uccessfully run amanda, you can find valid REQ packets in the amandad.*.debug files. + + +EXIT CODE +The exit code of amservice is one of: + + 0 = success + 1 = error executing amandad on the client. + +As amservice doesn't parse the REP packet, +it can only detect failures in executing amandad on the client. +amservice can exit with value 0 even if the user +is not authorized to execute the service. An error message will be printed. + + + +SEE ALSO +amanda8, +amcheck8, +amdump8, +amadmin8 + + + diff --git a/man/xml-source/amstar.8.xml b/man/xml-source/amstar.8.xml new file mode 100644 index 0000000..036035b --- /dev/null +++ b/man/xml-source/amstar.8.xml @@ -0,0 +1,75 @@ + + + + %global_entities; +]> + + + + +amstar +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amstar +Amanda Application to interface with star + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +Amstar is an &A; Application API script. It should not be run +by users directly. It uses star to backup and restore data. + + + +PROPERTIES + +This section lists the properties that control amstar's functionality. +See amanda-applications7 +for information on application properties and how they are configured. + + + + + ONE-FILE-SYSTEM +If "YES" (the default), do not allow star to cross filesystem boundaries. If "NO", star will cross filesystem boundaries. This corresponds to the -xdev option of star. + + + SPARSE +If "YES" (the default), star will store sparse files efficiently. If "NO", then the -sparse option is not given to star, and it will not try to detect sparse files. + + + STAR-DLE-TARDUMP +If "YES", amstar will use a different tardump file for each DLE. The default is "NO". This property is needed with older versions of star doing many dumps in parallel, because of a race condition in updating the tardump file. + + + STAR-PATH +The path to the star binary. The default is set when &A; is built. + + + STAR-TARDUMP +The directory where star stores the database it uses to generate incremental dumps. The default is set when &A; is built. + + + + + +SEE ALSO + +amanda.conf5, +amanda-applications7 + + + + diff --git a/man/xml-source/amstatus.8.xml b/man/xml-source/amstatus.8.xml index 1073023..bf90a9a 100644 --- a/man/xml-source/amstatus.8.xml +++ b/man/xml-source/amstatus.8.xml @@ -14,11 +14,17 @@ amstatus 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amstatus display the state of an &A; run + +&author.sgw.xml; + diff --git a/man/xml-source/amtape.8.xml b/man/xml-source/amtape.8.xml index 0d65052..db4d20c 100644 --- a/man/xml-source/amtape.8.xml +++ b/man/xml-source/amtape.8.xml @@ -13,11 +13,18 @@ amtape 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amtape user interface to &A; tape changer controls + +&author.jds; +&author.sgw.xml; + @@ -145,14 +152,6 @@ and reset Eject any tape in the drive and put it away, then load the tape from the current slot. - - - - slot prev - -Eject any tape in the drive and put it away, -then load the tape from the previous slot and reset -current. @@ -168,24 +167,13 @@ then load the tape from the next slot and reset Eject any tape in the drive and put it away, then load the tape from the first slot and reset -current. - - - - slot last - -Eject any tape in the drive and put it away, -then load the tape from the last slot and reset current. slot advance -Eject any tape in the drive and put it away. -Advance -current -to the next tape, but do not load it. +Synonym for slot next. @@ -217,11 +205,6 @@ does an unnecessary mount. commands to not eject the loaded tape if it is the one being requested. -AUTHOR -James da Silva, &email.jds; : Original text -&maintainer.sgw;: XML-conversion - - SEE ALSO amanda8, diff --git a/man/xml-source/amtapetype.8.xml b/man/xml-source/amtapetype.8.xml index 06dbae4..9f96324 100644 --- a/man/xml-source/amtapetype.8.xml +++ b/man/xml-source/amtapetype.8.xml @@ -14,37 +14,45 @@ amtapetype 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amtapetype -generate a tapetype definition. +generate a tapetype definition by testing the device directly + +&author.dustin; +&author.jlm; + amtapetype -h -c - -o + -f -b blocksize - -e estsize - -f tapedev -t typename + -l label + -o config_overwrite + device - DESCRIPTION amtapetype -generates a tapetype entry for &A;. +generates a tapetype entry for &A; by testing the device directly OPTIONS +The options for &amtapetype; have changed in version 2.6.1 -Display an help message. +Display the help message. @@ -55,35 +63,34 @@ This takes a few minutes only. - + -Overwrite the tape, even if it's an &A; tape. +Run amtapetype even if the loaded volume is already in use or compression +is enabled. blocksize -record block size (default: 32k) +block size to use with the device (default: 32k) - estsize + typename -estimated tape size (No default!) +Name to give to the new tapetype definition. - tapedev + label -tape device name (default: $TAPE) -The device to perform the test. +Label to write on the tape (default is randomly generated). - typename + configoption -tapetype name (default: unknown-tapetype) - +See the "CONFIGURATION OVERRIDE" section in amanda8. @@ -94,65 +101,34 @@ The device to perform the test. -% amtapetype -f /dev/nst0 -e 150G +% amtapetype -f /dev/nst0 NOTES -Hardware compression is detected by measuring -the writing speed difference of the tape drive -when writing an amount of compressable and uncompresseable data. -It does not rely on the status bits of the tape drive or the OS parameters. -If your tape drive has very large buffers or is very fast, the program -could fail to detect hardware compression status reliably. - -During the first pass, it writes files that are estimated to be 1% -of the expected tape capacity. It gets the expected capacity from -the -e command line flag, or defaults to 1 GByte. In a perfect world -(which means there is zero chance of this happening with tapes :-), -there would be 100 files and 100 file marks. - -During the second pass, the file size is cut in half. In that same -fairyland world, this means 200 files and 200 file marks. - -In both passes the total amount of data written is summed as well as the -number of file marks written. At the end of the second pass, quoting -from the code: - -* Compute the size of a filemark as the difference in data written -between pass 1 and pass 2 divided by the difference in number of -file marks written between pass 1 and pass 2. ... * - -So if we wrote 1.0 GBytes on the first pass and 100 file marks, and -0.9 GBytes on the second pass with 200 file marks, those additional 100 -file marks in the second pass took 0.1 GBytes and therefor a file mark -is 0.001 GBytes (1 MByte). - -Note that if the estimated capacity is wrong, the only thing that happens -is a lot more (or less, but unlikely) files, and thus, file marks, -get written. But the math still works out the same. The -e flag is -there to keep the number of file marks down because they can be slow -(since they force the drive to flush all its buffers to physical media). - -All sorts of things might happen to cause the amount of data -written to vary enough to generate a big file mark size guess. A little -more "shoe shining" because of the additional file marks (and flushes), +If the device cannot reliably report its comprssion status (and as of +this writing, no devices can do so), hardware compression is detected by +measuring the writing speed difference of the tape drive when writing an amount +of compressable and uncompresseable data. If your tape drive has very large +buffers or is very fast, the program could fail to detect hardware compression +status reliably. + +Volume capacity is determined by writing one large file until an error, +interpereted as end-of-tape, is encountered. In the next phase, about 100 +files are written to fill the tape. This second phase will write less data, +because each filemark consumes some tape. With a little arithmetic, +&amtapetype; calculates the size of these filemarks. + +All sorts of things might happen to cause the amount of data written to +vary enough to generate a strange file mark size guess. A little more +"shoe shining" because of the additional file marks (and flushes), dirt left on the heads from the first pass of a brand new tape, the -temperature/humidity changed during the multi-hour run, a different amount -of data was written after the last file mark before EOT was reported, etc. +temperature/humidity changed during the multi-hour run, a different amount of +data was written after the last file mark before EOT was reported, etc. Note that the file mark size might really be zero for whatever device this is, and it was just the measured capacity variation that caused &amtapetype; to think those extra file marks in pass 2 actually took up space. -It also explains why &amtapetype; used to sometimes report a negative file -mark size if the math happened to end up that way. When that happens -now we just report it as zero. -SEE ALSO -amanda8, - - - - diff --git a/man/xml-source/amtoc.8.xml b/man/xml-source/amtoc.8.xml index b4eb1eb..303bc23 100644 --- a/man/xml-source/amtoc.8.xml +++ b/man/xml-source/amtoc.8.xml @@ -12,11 +12,18 @@ amtoc 8 +&rmi.source; +&rmi.version; +&rmi.manual.8; amtoc generate TOC (Table Of Contents) for an &A; run + +&author.nm; +&author.sgw.xml; + @@ -160,9 +167,5 @@ perl, -AUTHOR -Nicolas Mayencourt Nicolas.Mayencourt@cui.unige.ch, University of Geneva/Switzerland : Original text -&maintainer.sgw;: XML-conversion - diff --git a/man/xml-source/amvault.8.xml b/man/xml-source/amvault.8.xml new file mode 100644 index 0000000..fd337ea --- /dev/null +++ b/man/xml-source/amvault.8.xml @@ -0,0 +1,91 @@ + + + + %global_entities; +]> + + + +amvault +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amvault +Copy &A; dumps from one volume to another + + +&author.dustin; + + + + + amvault + -o configoption + config + src-run-timestamp + dst-changer + label-template + + + +WARNING +This application is not yet in its final form, and is subject to major revision +in subsequent versions of Amanda. Backward compatibility is not guaranteed. + +The significant limitations of this version of amvault are: tapetypes for +secondary and tertiary volumes much match (including length and +device_properties); tertiary volumes must be blank (manual erasure is required +to re-use tertiary media; restore/recover operations will request tertiary +media by label when dumpfiles are not found on secondary media, but there is no +provision to automatically fetch such media from a different changer; and all +dumpfiles on a secondary volume are moved to tertiary media - there is no +provision to filter dumps. + +Feedback on and patches to this application are invited and +encouraged! + + + +DESCRIPTION + +Amvault Copies data from the run with +timestamp src-run-timestamp onto volumes using +the changer dst-changer, labeling new volumes +with label-template. If src-run-timestamp is "latest", then the most recent amdump +or amflush run will be used. + +In a vaulting operation, the source media is referred to as "secondary +media", while the destination is referred to as "tertiary media". + +Each source volume will be copied to a new destination volume; no +re-assembly or splitting will be performed. Destination volumes must be at +least as large as the source volumes. + +The changer parameter should specify the name of a changer defined in +&amconf;. For example: + +define changer vaulting_tape { + tapedev "/dev/rmt/1n" + tpchanger "chg-zd-mtx" + changerdev "/dev/sg0" + changerfile "vaulting-changer.conf" +} + + +The label template functions identically to the label-new-tapes parameter in &amconf;. + + + +SEE ALSO +amanda8 + + + diff --git a/man/xml-source/amverify.8.xml b/man/xml-source/amverify.8.xml deleted file mode 100644 index f68db90..0000000 --- a/man/xml-source/amverify.8.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - %global_entities; -]> - - - - - -amverify -8 - - -amverify -check an Amanda tape for errors - - - - - amverify - config - slotruntapes - - - - -DESCRIPTION -Amverify -reads an Amanda format tape and makes sure each backup image -can be processed by -amrestore -and, if possible, the appropriate restore program (e.g. -tar). - -Amverify -runs -amrestore -on each file of the tape and pipes the output -to a restore program (if available) with an option to create a catalogue -of the backup. -The catalogue itself is discarded. -Only the success or failure of the operation itself is reported. - -If the backup image cannot be processed by the restore program, -e.g. if it was written on a different operating system, -the image is sent through -dd -to /dev/null. -This still determines if the tape is readable, -but does not do any internal consistency check on the image. - -If -config -is set up to use a tape changer, -the -slot -argument may be used to choose the first tape to process. -Otherwise, -the -current -slot is used. - -The -runtapes -configuration parameter determines how many tapes are processed unless -it is specified on the command line. - -See the -amanda8 -man page for more details about Amanda. - - -AUTHOR -Axel Zinser fifi@icem.de : Original text -&maintainer.sgw;: XML-conversion - - -SEE ALSO -amrestore8, -amanda8, -amverifyrun8, - - - - - diff --git a/man/xml-source/amverifyrun.8.xml b/man/xml-source/amverifyrun.8.xml deleted file mode 100644 index 24043a6..0000000 --- a/man/xml-source/amverifyrun.8.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - %global_entities; -]> - - - - -amverifyrun -8 - - -amverifyrun -check the tapes written by the last &A; run - - - - - amverifyrun - config - - - - -DESCRIPTION -Amverifyrun -read the log from the last &A; run to find the slot of the first tape -used and the number of tapes used. -It call -amverify -with these argument. - - - -SEE ALSO -amanda8, -amverify8, - - - - - diff --git a/man/xml-source/amzfs-sendrecv.8.xml b/man/xml-source/amzfs-sendrecv.8.xml new file mode 100644 index 0000000..c97a921 --- /dev/null +++ b/man/xml-source/amzfs-sendrecv.8.xml @@ -0,0 +1,124 @@ + + + + %global_entities; +]> + + + + +amzfs-sendrecv +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amzfs-sendrecv +Amanda script to create zfs sendrecv + + +&author.jlm; + + + +DESCRIPTION + +amzfs-sendrecv is an &A; application implementing the Application API. +It should not be run by users directly. +It create a zfs snapshot of the filesystem and backup the snapshot with 'zfs send'. +Snapshot are kept after the backup is done, this increase the disk space use on the client but it is neccesary to be able do to incremental backup. +If you want only full backup, you can disable this feature by setting the KEEP-SNAPSHOT property to 'NO'. +Only the restoration of the complete backup is allowed, it is impossible to restore a single file. + +The application is run as the amanda user, it must have many zfs priviledge: + + zfs allow -ldu AMANDA_USER mount,create,rename,snapshot,destroy,send,receive FILESYSTEM + + +Some system doesn't have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command: + +usermod -P "ZFS File System Management,ZFS Storage Management" AMANDA_USER + +This will require that your run zfs under pfexec, set the PFEXEC property to YES. + +The format of the DLE must be one of: + +Desciption Example +---------- ------- +Mountpoint /data +ZFS pool name datapool +ZFS filesystem datapool/database +ZFS logical volume datapool/dbvol + + +The filesystem doesn't need to be mounted. + + + +PROPERTIES + +This section lists the properties that control amzfs-sendrecv's functionality. +See amanda-applications7 +for information on the Application API, application configuration. + + + + + DF-PATH +Path to the 'df' binary, search in $PATH by default. + + + KEEP-SNAPSHOT +If "YES" (the default), snapshot are kept after the backup, if set to "NO" then snapshot are no kept and incremental backup will fail. + + + ZFS-PATH +Path to the 'zfs' binary, search in $PATH by default. + + + PFEXEC-PATH +Path to the 'pfexec' binary, search in $PATH by default. + + + PFEXEC +If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used. + + + + + +EXAMPLE + +In this example, a dumptype is defined to use amzfs-sendrecv application to backup a zfs filesystem. + + + define application-tool amzfs_sendrecv { + comment "amzfs-sendrecv" + plugin "amzfs-sendrecv" + #property "DF-PATH" "/usr/sbin/df" + #property "KEEP-SNAPSHOT" "YES" + #property "ZFS-PATH" "/usr/sbin/zfs" + #property "PFEXEC-PATH" "/usr/sbin/pfexec" + #property "PFEXEC" "NO" + } + + define dumptype user-zfs-sendrecv { + program "APPLICATAION" + application "amzfs_sendrecv" + } + + + +SEE ALSO + +amanda.conf5, +amanda-client.conf5, +amanda-applications7 + + + + diff --git a/man/xml-source/amzfs-snapshot.8.xml b/man/xml-source/amzfs-snapshot.8.xml new file mode 100644 index 0000000..f679de9 --- /dev/null +++ b/man/xml-source/amzfs-snapshot.8.xml @@ -0,0 +1,127 @@ + + + + %global_entities; +]> + + + + +amzfs-snapshot +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +amzfs-snapshot +Amanda script to create zfs snapshot + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +amzfs-snapshot is an &A; script implementing the Script API. It should +not be run by users directly. It create a zfs snapshot of the filesystem +where the path specified is mounted. + +PRE-DLE-* create a snapshot and the POST_DLE_* destroy the snapshot, +*-DLE-AMCHECK, *-DLE-ESTIMATE and *-DLE-BACKUP must be set to be executed on the client: + + execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup + execute-where client + +The PRE_DLE_* script output a DIRECTORY property telling where the directory is located in the snapshot. The application must be able to use the DIRECTORY property, amgtar can do it. + +The script is run as the amanda user, it must have the priviledge to create and destroy snapshot: + + zfs allow -ldu AMANDA_USER mount,snapshot,destroy FILESYSTEM + + +Some system doesn't have "zfs allow", but you can give the Amanda backup user the rights to manipulate ZFS filesystems by using the following command: + +usermod -P "ZFS File System Management,ZFS Storage Management" AMANDA_USER + +This will require that your run zfs under pfexec, set the PFEXEC property to YES. + +The format of the DLE must be one of: + +Desciption Example +---------- ------- +Mountpoint /data +Arbitrary mounted dir /data/interesting_dir +ZFS pool name datapool +ZFS filesystem datapool/database +ZFS logical volume datapool/dbvol + +The filesystem must be mounted. + + + +PROPERTIES + +This section lists the properties that control amzfs-snapshot's functionality. +See amanda-scripts7 +for information on the Script API, script configuration. + + + + + DF-PATH +Path to the 'df' binary, search in $PATH by default. + + + ZFS-PATH +Path to the 'zfs' binary, search in $PATH by default. + + + PFEXEC-PATH +Path to the 'pfexec' binary, search in $PATH by default. + + + PFEXEC +If "NO" (the default), pfexec is not used, if set to "YES" then pfexec is used. + + + + + +EXAMPLE + +In this example, a dumptype is defined to use amzfs-snapshot script to create a snapshot and use amgtar to backup the snapshot. + + + define script-tool amzfs_snapshot { + comment "backup of zfs snapshot" + plugin "amzfs-snapshot" + execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, post-dle-estimate, pre-dle-backup, post-dle-backup + execute-where client + #property "DF-PATH" "/usr/sbin/df" + #property "ZFS-PATH" "/usr/sbin/zfs" + #property "PFEXEC-PATH" "/usr/sbin/pfexec" + #property "PFEXEC" "NO" + } + + define dumptype user-zfs-amgtar { + dt_amgtar + script "amzfs_snapshot" + } + + + +SEE ALSO + +amanda.conf5, +amanda-client.conf5, +amanda-scripts7 + + + + diff --git a/man/xml-source/disklist.5.xml b/man/xml-source/disklist.5.xml new file mode 100644 index 0000000..110d440 --- /dev/null +++ b/man/xml-source/disklist.5.xml @@ -0,0 +1,176 @@ + + + + %global_entities; +]> + + + + +disklist +5 +&rmi.source; +&rmi.version; +&rmi.manual.5; + + +disklist +List of partitions to back up for &A; + + +&author.jds; +&author.sgw.xml; +&author.dustin; + + + +DESCRIPTION +The +disklist +file determines which disks will be backed up by &A;. +The file usually contains one line per disk: + + +hostname diskname [diskdevice] dumptype [spindle [interface] ] + + +All pairs [ hostname diskname ] must be unique. + +Lines starting with # are ignored, as are blank lines. +The fields have the following meanings: + + + hostname + +The name of the host to be backed up. +If +diskdevice +refers to a PC share, this is the host &A; will run the Samba +smbclient program on to back up the share. + + + + diskname + +The name of the disk (a label). +In most case, you set your +diskname +to the +diskdevice +and you don't set the +diskdevice. +If you want multiple entries with the same +diskdevice, +you must set a different +diskname +for each entry. It's the +diskname +that you use on the commandline for any &A; command. +Look at the example/disklist file for example. + + + + diskdevice + +Default: same as diskname. +The name of the disk device to be backed up. It may be a full device name, +a device name without the +/dev/ +prefix, e.g. +sd0a, +or a mount point such as +/usr. + +It may also refer to a PC share by starting the name with two (forward) slashes, e.g. +//some-pc/home. +In this case, the +program +option in the associated +dumptype +must be entered as +GNUTAR. +It is the combination of the double slash disk name and +program GNUTAR +in the +dumptype +that triggers the use of Samba. + + + + + dumptype + +Refers to a +dumptype +defined in the +amanda.conf +file. +Dumptypes +specify backup related parameters, +such as whether to compress the backups, +whether to record backup results in +/etc/dumpdates, the disk's relative priority, etc. + + + + spindle + +Default: +. +A number used to balance backup load on a host. +&A; will not run multiple backups at the same time +on the same spindle, unless the spindle number is -1, +which means there is no spindle restriction. + + + + interface + +Default: +local. +The name of a network interface definition in the +amanda.conf +file, used to balance network load. + + + + +Instead of naming a +dumptype, +it is possible to define one in-line, enclosing +dumptype +options within curly braces, one per line, just like a +dumptype +definition in +amanda.conf. +Since pre-existing +dumptypes +are valid option names, this syntax may be used to customize +dumptypes +for particular disks. + +A line break +must +follow the left curly bracket. + +For instance, if a +dumptype +named +normal +is used for most disks, but use of the holding disk needs to be disabled +for the file system that holds it, this would work instead of defining +a new dumptype: + + +hostname diskname [ diskdevice ] { + normal + holdingdisk never +} [ spindle [ interface ] ] + + + + + diff --git a/man/xml-source/script-email.8.xml b/man/xml-source/script-email.8.xml new file mode 100644 index 0000000..0708637 --- /dev/null +++ b/man/xml-source/script-email.8.xml @@ -0,0 +1,88 @@ + + + + %global_entities; +]> + + + + +script-email +8 +&rmi.source; +&rmi.version; +&rmi.manual.8; + + +script-email +Amanda script to send email notifications + + +&author.jlm; +&author.dustin; + + + +DESCRIPTION + +script-email is an &A; script implementing the Script API. It should not +be run by users directly. It sends a notification email to the addresses +specified in the MAILTO property. + + + +PROPERTIES + +This section lists the properties that control script-email's functionality. +See amanda-scripts7 +for information on the Script API, script configuration. + + + + + MAILTO +List of email addresses that will receive an email on command execution. It is a multi-valued property: + + property "MAILTO" "amanda@domain.com" "sysadmin@domain.com" "amandauser@domain.com" + + + + + + + +EXAMPLE + +In this example, script-email is scheduled to be run before the DLE, on the +server. The unqualified email address amanda will be +passed to the email system unchanged. The script is then attached to a +dumptype, which can then be specified for any DLEs which require notification. + + + define script-tool pre-email { + comment "email me before this DLE is backed up" + plugin "script-email" + execute-on pre-dle-backup + execute-where server + property "mailto" "amanda" + } + + define dumptype user-tar-email { + user-tar + script "pre-email" + } + + + +SEE ALSO + +amanda.conf5, +amanda-client.conf5, +amanda-scripts7 + + + + diff --git a/man/xml-source/tapelist.5.xml b/man/xml-source/tapelist.5.xml new file mode 100644 index 0000000..ae5c343 --- /dev/null +++ b/man/xml-source/tapelist.5.xml @@ -0,0 +1,70 @@ + + + + %global_entities; +]> + + + + +tapelist +5 +&rmi.source; +&rmi.version; +&rmi.manual.5; + + +tapelist +The list of &A; volumes in use + + +&author.jds; +&author.sgw.xml; +&author.dustin; + + + +DESCRIPTION + +The tapelist file contains the list of +tapes in active use. This file is not ordinarily ordinarily edited or examined +manually. Its format may change, or it may be removed altogether, in future +versions of &A;. It contains lines of the form: + +YYYYMMDD label flags [#comment] + + +Where +YYYYMMDD +is the date the tape was written, +label +is a label for the tape as written by +amlabel +and +flags +is one of "reuse" or "no-reuse" and tells &A; whether the tape may be reused. +A non-reusable tape will not be overwritten, even if it is older than dumpcycle dumps. See the +reuse +options of +amadmin8. +The optional comment is prefixed with a '#' and continues to the end of the line. Amanda +will maintain this comment until the tape is overwritten. Note that comments are not +allowed on blank lines. + +Amdump +and +amflush +will by default refuse to write to an unlabeled tape, or to a labeled tape that +is considered active or marked "no-reuse". There must be more tapes in active +rotation (see the +tapecycle +option) than there are runs in the backup cycle (see the +dumpcycle +option) to prevent overwriting a backup image that would be needed to do a full recovery. + + + diff --git a/man/xslt/html.xsl.in b/man/xslt/html.xsl.in index 03ae385..5f2fcd5 100644 --- a/man/xslt/html.xsl.in +++ b/man/xslt/html.xsl.in @@ -19,13 +19,130 @@ + ..html - + + + +
+ + + + + + +
+
+ + +
+

+ AUTHOR + + S + +

+ + +

+ This manual page was written by + + + + + and + + + , + + + + + + . +

+
+ +

+ Contributions were derived from + + + + + and + + + , + + + + + + . +

+
+ +

+ Edited by + + + + + and + + + , + + + + + + . +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + ( + + ) + + diff --git a/man/xslt/man.xsl.in b/man/xslt/man.xsl.in index 2453bc0..2cd21d6 100644 --- a/man/xslt/man.xsl.in +++ b/man/xslt/man.xsl.in @@ -13,6 +13,7 @@ + + + + + .RS 4 + + + () + + + .RE + + + + + diff --git a/oldrecover-src/Makefile.am b/oldrecover-src/Makefile.am index 8a0472d..77c7fa8 100644 --- a/oldrecover-src/Makefile.am +++ b/oldrecover-src/Makefile.am @@ -1,5 +1,6 @@ # Makefile for Amanda file recovery programs. +include $(top_srcdir)/config/automake/vars.am include $(top_srcdir)/config/automake/installperms.am include $(top_srcdir)/config/automake/precompile.am @@ -11,8 +12,8 @@ INCLUDES = -I$(top_builddir)/common-src \ AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -LINT=@AMLINT@ -LINTFLAGS=@AMLINTFLAGS@ +LINT=$(AMLINT) +LINTFLAGS=$(AMLINTFLAGS) LIB_EXTENSION = la @@ -29,8 +30,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ @LEXLIB@ \ $(READLINE_LIBS) \ ../client-src/libamclient.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) + ../common-src/libamanda.$(LIB_EXTENSION) amoldrecover_CSRC = amrecover.c \ display_commands.c extract_list.c \ @@ -56,7 +56,7 @@ uparse.$(OBJEXT): uparse.c INSTALLPERMS_exec = \ - dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS) + dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS) lint: @ f="$(amoldrecover_CSRC)"; \ diff --git a/oldrecover-src/Makefile.in b/oldrecover-src/Makefile.in index 3caa50f..6ec2940 100644 --- a/oldrecover-src/Makefile.in +++ b/oldrecover-src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,28 @@ # Makefile for Amanda file recovery programs. +# vim:ft=automake +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +# simple include file to pre-define variables which are then +='d by other +# scripts in this directory. + # vim:ft=automake # # Adjust post-install permissions settings. This rule works off two @@ -43,7 +65,7 @@ # INSTALLPERMS_exec = \ # dest=$(sbindir) chown=amanda chmod= \ # foo bar \ -# chmod=u+s,o-rwx \ +# chmod=07450 \ # bing # dest=$(libexecdir) chmod= \ # $(libexec_PROGRAMS) @@ -53,7 +75,15 @@ # # This whole operation is not required when making builds for packaging, # and can be disabled with --disable-installperms, via the WANT_INSTALLPERMS -# AM_CONDITIONAL. +# AM_CONDITIONAL. When disabled, the file 'installperms.sh' in the top-level +# build directory is populated with a format suitable for shell interpretation, +# with lines like this: +# installperm "amanda:disk" "04750" "/usr/local/sbin/bing" +# the arguments being, respectively, owner:group, mode, and filename. There will +# be exactly one line for each file which has specific permissions. The intention +# is that this file be used by packaging scripts to set correct permissions at install +# time. Note that files which have no special permissions requirements do not appear +# in this file at all, due to limitations of Automake. # vim:ft=automake @@ -80,13 +110,16 @@ target_triplet = @target@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in \ $(top_srcdir)/config/automake/installperms.am \ - $(top_srcdir)/config/automake/precompile.am uparse.c uparse.h \ + $(top_srcdir)/config/automake/precompile.am \ + $(top_srcdir)/config/automake/vars.am uparse.c uparse.h \ uscan.c +@WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh) sbin_PROGRAMS = amoldrecover$(EXEEXT) subdir = oldrecover-src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -120,6 +153,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -142,7 +176,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -170,7 +206,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -181,7 +216,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -209,9 +243,8 @@ am__DEPENDENCIES_1 = amoldrecover_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \ $(am__DEPENDENCIES_1) \ ../client-src/libamclient.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) -DEFAULT_INCLUDES = -I. -I$(top_builddir)/config@am__isrc@ + ../common-src/libamanda.$(LIB_EXTENSION) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -237,6 +270,7 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -251,8 +285,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -264,16 +300,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -287,6 +335,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -294,7 +343,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -307,6 +356,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -317,9 +367,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -329,6 +382,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -353,8 +407,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -363,11 +419,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -381,6 +441,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -389,9 +450,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -399,7 +461,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -408,8 +472,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -417,7 +483,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -426,10 +491,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -445,6 +512,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -461,6 +530,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -469,7 +540,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -505,26 +575,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -532,7 +613,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -542,6 +627,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -551,7 +637,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -560,6 +653,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -588,6 +682,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -606,6 +701,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -635,12 +732,39 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUFFIXES = +EXTRA_DIST = +BUILT_SOURCES = +MOSTLYCLEANFILES = +CLEANFILES = +DISTCLEANFILES = $(am__append_1) +MAINTAINERCLEANFILES = # sed expression to strip leading directories from a filename; this converts e.g., # src/foo/bar.so to bar.so. strip_leading_dirs = s|^.*/|| +@WANT_INSTALLPERMS_FALSE@do_file = pa="$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_FALSE@ echo "installperm \"$$chown\" \"$$chmod\" \"$$pa\"" >> "$(installperms_sh)" + + +# define a snippet of the scripts below to either perform a chown/chmod operation, +# or record that operation in the logfile. On entry to the snippet, $$dest is the +# destination directory, $$cmd is the srcdir-relative pathname of the target file, +# $$chown is the ownership, and $$chmod is the permission pattern. +@WANT_INSTALLPERMS_TRUE@do_file = pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi; \ +@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ +@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ +@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ +@WANT_INSTALLPERMS_TRUE@ fi + +@WANT_INSTALLPERMS_FALSE@installperms_sh = "$(top_builddir)/installperms.sh" INCLUDES = -I$(top_builddir)/common-src \ -I$(top_srcdir)/common-src \ -I$(top_srcdir)/client-src \ @@ -648,8 +772,8 @@ INCLUDES = -I$(top_builddir)/common-src \ AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) -LINT = @AMLINT@ -LINTFLAGS = @AMLINTFLAGS@ +LINT = $(AMLINT) +LINTFLAGS = $(AMLINTFLAGS) LIB_EXTENSION = la ### @@ -662,8 +786,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \ @LEXLIB@ \ $(READLINE_LIBS) \ ../client-src/libamclient.$(LIB_EXTENSION) \ - ../common-src/libamanda.$(LIB_EXTENSION) \ - ../gnulib/libgnu.$(LIB_EXTENSION) + ../common-src/libamanda.$(LIB_EXTENSION) amoldrecover_CSRC = amrecover.c \ display_commands.c extract_list.c \ @@ -673,13 +796,14 @@ amoldrecover_SOURCES = $(amoldrecover_CSRC) uparse.y uscan.l noinst_HEADERS = amrecover.h uparse.h AM_YFLAGS = -d INSTALLPERMS_exec = \ - dest=$(sbindir) chown=amanda chmod=o-rwx $(sbin_PROGRAMS) + dest=$(sbindir) chown=amanda chmod=0750 $(sbin_PROGRAMS) -all: all-am +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/automake/vars.am $(top_srcdir)/config/automake/installperms.am $(top_srcdir)/config/automake/precompile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -717,8 +841,8 @@ install-sbinPROGRAMS: $(sbin_PROGRAMS) || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done @@ -797,8 +921,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -810,8 +934,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -821,13 +945,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -867,13 +990,15 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -888,11 +1013,14 @@ install-strip: `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -900,8 +1028,8 @@ maintainer-clean-generic: -rm -f uparse.c -rm -f uparse.h -rm -f uscan.c -@WANT_INSTALLPERMS_FALSE@install-exec-hook: -@WANT_INSTALLPERMS_FALSE@install-data-hook: + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ @@ -983,52 +1111,40 @@ uninstall-am: uninstall-sbinPROGRAMS uninstall-sbinPROGRAMS -@WANT_INSTALLPERMS_TRUE@installperms-exec: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_exec)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on executables"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@installperms-data: -@WANT_INSTALLPERMS_TRUE@ @installperms="$(INSTALLPERMS_data)"; \ -@WANT_INSTALLPERMS_TRUE@ test -n "$$installperms" && echo "Setting installation permissions on data"; \ -@WANT_INSTALLPERMS_TRUE@ dest=; chown=; chmod=; \ -@WANT_INSTALLPERMS_TRUE@ for cmd in $$installperms; do \ -@WANT_INSTALLPERMS_TRUE@ case "$$cmd" in \ -@WANT_INSTALLPERMS_TRUE@ chown=amanda) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ -@WANT_INSTALLPERMS_TRUE@ dest=*|chown=*|chmod=*) \ -@WANT_INSTALLPERMS_TRUE@ echo " ($$cmd)"; eval $$cmd;; \ -@WANT_INSTALLPERMS_TRUE@ *) pa="$(DESTDIR)$$dest"/`echo "$$cmd"|sed '$(strip_leading_dirs)'|sed '$(transform)'`; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chown"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chown "$$chown" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chown "$$chown" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ if test -n "$$chmod"; then \ -@WANT_INSTALLPERMS_TRUE@ echo chmod "$$chmod" "$$pa"; \ -@WANT_INSTALLPERMS_TRUE@ chmod "$$chmod" "$$pa" || exit 1; \ -@WANT_INSTALLPERMS_TRUE@ fi; \ -@WANT_INSTALLPERMS_TRUE@ esac; \ -@WANT_INSTALLPERMS_TRUE@ done - -@WANT_INSTALLPERMS_TRUE@install-exec-hook: installperms-exec -@WANT_INSTALLPERMS_TRUE@install-data-hook: installperms-data +installperms-exec: + @installperms="$(INSTALLPERMS_exec)"; \ + test -n "$$installperms" && echo "Setting installation permissions on executables"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +installperms-data: + @installperms="$(INSTALLPERMS_data)"; \ + dest=; chown=; chmod=; \ + for cmd in $$installperms; do \ + case "$$cmd" in \ + chown=amanda) \ + echo " ($$cmd)"; chown="$(BINARY_OWNER):$(SETUID_GROUP)";; \ + dest=*|chown=*|chmod=*) \ + echo " ($$cmd)"; eval $$cmd;; \ + *) $(do_file) ;; \ + esac; \ + done + +install-exec-hook: installperms-exec +install-data-hook: installperms-data + +# define a rule to initialize the installperms manifest file +@WANT_INSTALLPERMS_TRUE@installperms-init: +@WANT_INSTALLPERMS_FALSE@installperms-init: +@WANT_INSTALLPERMS_FALSE@ rm -f "$(installperms_sh)" # A rule to make precompiler output from C files. This is not used during # ordinary builds, but but can very useful in debugging problems on strange diff --git a/oldrecover-src/amrecover.c b/oldrecover-src/amrecover.c index 43d839d..6f2dde3 100644 --- a/oldrecover-src/amrecover.c +++ b/oldrecover-src/amrecover.c @@ -453,6 +453,13 @@ main( config_init(CONFIG_INIT_CLIENT, NULL); + if (config_errors(NULL) >= CFGERR_WARNINGS) { + config_print_errors(); + if (config_errors(NULL) >= CFGERR_ERRORS) { + g_critical(_("errors processing config file")); + } + } + if (argc > 1 && argv[1][0] != '-') { /* diff --git a/oldrecover-src/extract_list.c b/oldrecover-src/extract_list.c index 61c9a6a..d1d8955 100644 --- a/oldrecover-src/extract_list.c +++ b/oldrecover-src/extract_list.c @@ -1254,7 +1254,7 @@ okay_to_continue( break; } s = line; - while ((ch = *s++) != '\0' && isspace(ch)) { + while ((ch = *s++) != '\0' && g_ascii_isspace(ch)) { (void)ch; /* Quiet empty loop body warning */ } if (ch == '?') { @@ -1301,9 +1301,9 @@ send_to_tape_server( { char *msg = stralloc2(cmd, "\r\n"); - if (fullwrite(tss, msg, strlen(msg)) < 0) + if (full_write(tss, msg, strlen(msg)) < strlen(msg)) { - error(_("Error writing to tape server")); + error(_("Error writing to tape server: %s"), strerror(errno)); /*NOTREACHED*/ } amfree(msg); @@ -1447,7 +1447,7 @@ extract_files_setup( am_has_feature(indexsrv_features, fe_amidxtaped_datestamp)) { if(am_has_feature(indexsrv_features, fe_amidxtaped_config)) { - tt = newstralloc2(tt, "CONFIG=", config_name); + tt = newstralloc2(tt, "CONFIG=", config); send_to_tape_server(tape_control_sock, tt); } if(am_has_feature(indexsrv_features, fe_amidxtaped_label) && @@ -1874,7 +1874,7 @@ writer_intermediary( int child_pipe[2]; pid_t pid; char buffer[DISK_BLOCK_BYTES]; - ssize_t bytes_read; + size_t bytes_read; amwait_t extractor_status; int max_fd, nfound; SELECT_ARG_TYPE readset, selectset; @@ -2014,7 +2014,7 @@ writer_intermediary( * spit what we got from the server to the child * process handling actual dumpfile extraction */ - if(fullwrite(child_pipe[1], buffer, (size_t)bytes_read) < 0) { + if(full_write(child_pipe[1], buffer, bytes_read) < bytes_read) { if(errno == EPIPE) { error(_("pipe data reader has quit: %s\n"), strerror(errno)); diff --git a/oldrecover-src/uscan.c b/oldrecover-src/uscan.c index 01f7936..923f357 100644 --- a/oldrecover-src/uscan.c +++ b/oldrecover-src/uscan.c @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -30,7 +30,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. @@ -93,11 +93,12 @@ typedef unsigned int flex_uint32_t; #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST @@ -177,14 +178,9 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ - #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T -typedef unsigned int yy_size_t; +typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -593,7 +589,7 @@ int process_line(char *line); #line 62 "uscan.l" static char *string_buf = NULL; -#line 597 "uscan.c" +#line 593 "uscan.c" #define INITIAL 0 #define quotedpath 1 @@ -683,7 +679,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -694,7 +690,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -783,7 +779,7 @@ YY_DECL /* literal keyword tokens */ -#line 787 "uscan.c" +#line 783 "uscan.c" if ( !(yy_init) ) { @@ -1109,7 +1105,7 @@ YY_RULE_SETUP #line 165 "uscan.l" ECHO; YY_BREAK -#line 1113 "uscan.c" +#line 1109 "uscan.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(quotedpath): yyterminate(); @@ -1341,7 +1337,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1365,6 +1361,14 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; @@ -1780,7 +1784,9 @@ static void yyensure_buffer_stack (void) (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); - + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; @@ -1798,6 +1804,8 @@ static void yyensure_buffer_stack (void) ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); @@ -1842,7 +1850,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. - * @param str a NUL-terminated string to scan + * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use diff --git a/packaging/Makefile.in b/packaging/Makefile.in index 1952026..562403c 100644 --- a/packaging/Makefile.in +++ b/packaging/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -37,6 +37,7 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = \ $(top_srcdir)/config/macro-archive/ac_define_dir.m4 \ + $(top_srcdir)/config/macro-archive/ac_perl_module_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_perl_version.m4 \ $(top_srcdir)/config/macro-archive/ac_prog_swig.m4 \ $(top_srcdir)/config/macro-archive/ax_compare_version.m4 \ @@ -70,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/amanda/libs.m4 \ $(top_srcdir)/config/amanda/net.m4 \ $(top_srcdir)/config/amanda/progs.m4 \ + $(top_srcdir)/config/amanda/ps.m4 \ $(top_srcdir)/config/amanda/readdir.m4 \ $(top_srcdir)/config/amanda/readline.m4 \ $(top_srcdir)/config/amanda/rsh-security.m4 \ @@ -92,7 +94,9 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/float_h.m4 \ $(top_srcdir)/config/gnulib/fsusage.m4 \ $(top_srcdir)/config/gnulib/getaddrinfo.m4 \ + $(top_srcdir)/config/gnulib/getopt.m4 \ $(top_srcdir)/config/gnulib/gettimeofday.m4 \ + $(top_srcdir)/config/gnulib/gnulib-common.m4 \ $(top_srcdir)/config/gnulib/gnulib-comp.m4 \ $(top_srcdir)/config/gnulib/include_next.m4 \ $(top_srcdir)/config/gnulib/inet_ntop.m4 \ @@ -120,7 +124,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gnulib/sys_stat_h.m4 \ $(top_srcdir)/config/gnulib/sys_time_h.m4 \ $(top_srcdir)/config/gnulib/tempname.m4 \ - $(top_srcdir)/config/gnulib/ulonglong.m4 \ $(top_srcdir)/config/gnulib/unistd_h.m4 \ $(top_srcdir)/config/gnulib/vasnprintf.m4 \ $(top_srcdir)/config/gnulib/visibility.m4 \ @@ -131,7 +134,6 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/gettext-macros/lib-ld.m4 \ $(top_srcdir)/config/gettext-macros/lib-link.m4 \ $(top_srcdir)/config/gettext-macros/lib-prefix.m4 \ - $(top_srcdir)/config/gettext-macros/longlong.m4 \ $(top_srcdir)/config/gettext-macros/nls.m4 \ $(top_srcdir)/config/gettext-macros/po.m4 \ $(top_srcdir)/config/gettext-macros/progtest.m4 \ @@ -150,6 +152,7 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +AIX_BACKUP = @AIX_BACKUP@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMANDA_DBGDIR = @AMANDA_DBGDIR@ @@ -164,8 +167,10 @@ AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@ AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@ AMTAR = @AMTAR@ +APPLICATION_DIR = @APPLICATION_DIR@ AR = @AR@ ARPA_INET_H = @ARPA_INET_H@ +ASSERTIONS = @ASSERTIONS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -177,16 +182,28 @@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ +BSDTCP_SECURITY = @BSDTCP_SECURITY@ +BSDUDP_SECURITY = @BSDUDP_SECURITY@ +BSD_SECURITY = @BSD_SECURITY@ CAT = @CAT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ +CHECK_USERID = @CHECK_USERID@ CHIO = @CHIO@ CHS = @CHS@ +CLIENT_HOST_INSTANCE = @CLIENT_HOST_INSTANCE@ +CLIENT_HOST_KEY_FILE = @CLIENT_HOST_KEY_FILE@ +CLIENT_HOST_PRINCIPAL = @CLIENT_HOST_PRINCIPAL@ CLIENT_LOGIN = @CLIENT_LOGIN@ CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@ COMPRESS = @COMPRESS@ +COMPRESS_BEST_OPT = @COMPRESS_BEST_OPT@ +COMPRESS_FAST_OPT = @COMPRESS_FAST_OPT@ +COMPRESS_PATH = @COMPRESS_PATH@ +COMPRESS_SUFFIX = @COMPRESS_SUFFIX@ +CONFIG_CLOBBER_MY_CONFIG = @CONFIG_CLOBBER_MY_CONFIG@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -200,6 +217,7 @@ DD = @DD@ DEFAULT_AMANDATES_FILE = @DEFAULT_AMANDATES_FILE@ DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@ DEFAULT_CONFIG = @DEFAULT_CONFIG@ +DEFAULT_MAILER = @DEFAULT_MAILER@ DEFAULT_SERVER = @DEFAULT_SERVER@ DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@ DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@ @@ -207,7 +225,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_BUILD_DATE = @DOC_BUILD_DATE@ DUMP = @DUMP@ -DUMPER_DIR = @DUMPER_DIR@ +DUMP_RETURNS_1 = @DUMP_RETURNS_1@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -220,6 +238,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FLOAT_H = @FLOAT_H@ GETCONF = @GETCONF@ +GETOPT_H = @GETOPT_H@ GETTEXT = @GETTEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ @@ -230,9 +249,12 @@ GMSGFMT_015 = @GMSGFMT_015@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_DUP2 = @GNULIB_DUP2@ +GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ +GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FSEEK = @GNULIB_FSEEK@ GNULIB_FSEEKO = @GNULIB_FSEEKO@ GNULIB_FTELL = @GNULIB_FTELL@ @@ -242,6 +264,7 @@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETLINE = @GNULIB_GETLINE@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ +GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LSEEK = @GNULIB_LSEEK@ @@ -266,8 +289,10 @@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@ +GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ +GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_SNPRINTF = @GNULIB_SNPRINTF@ GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@ @@ -276,11 +301,15 @@ GNULIB_STPNCPY = @GNULIB_STPNCPY@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ +GNULIB_STRERROR = @GNULIB_STRERROR@ GNULIB_STRNDUP = @GNULIB_STRNDUP@ GNULIB_STRNLEN = @GNULIB_STRNLEN@ GNULIB_STRPBRK = @GNULIB_STRPBRK@ GNULIB_STRSEP = @GNULIB_STRSEP@ +GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@ +GNULIB_STRSTR = @GNULIB_STRSTR@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ +GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@ GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@ GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@ @@ -294,6 +323,7 @@ GOBJECT_QUERY = @GOBJECT_QUERY@ GREP = @GREP@ GZIP = @GZIP@ HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@ +HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ @@ -302,9 +332,10 @@ HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@ HAVE_DECL_MKDIR = @HAVE_DECL_MKDIR@ HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ -HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ +HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ +HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ @@ -312,7 +343,9 @@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FTELLO = @HAVE_FTELLO@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ +HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GZIP = @HAVE_GZIP@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_IO_H = @HAVE_IO_H@ HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@ @@ -321,8 +354,10 @@ HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ +HAVE_OS_H = @HAVE_OS_H@ HAVE_READLINK = @HAVE_READLINK@ HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@ +HAVE_SETENV = @HAVE_SETENV@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -330,7 +365,6 @@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ -HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ HAVE_STRNDUP = @HAVE_STRNDUP@ @@ -339,10 +373,12 @@ HAVE_STRSEP = @HAVE_STRSEP@ HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@ HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@ +HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ +HAVE_UNSETENV = @HAVE_UNSETENV@ HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@ HAVE_VASPRINTF = @HAVE_VASPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ @@ -358,6 +394,8 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +KRB4_SECURITY = @KRB4_SECURITY@ +KRB5_SECURITY = @KRB5_SECURITY@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ @@ -374,6 +412,8 @@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ +LOCKING = @LOCKING@ +LOW_TCPPORTRANGE = @LOW_TCPPORTRANGE@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ @@ -382,7 +422,6 @@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAILER = @MAILER@ MAKEINFO = @MAKEINFO@ -MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@ MCUTIL = @MCUTIL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ @@ -418,26 +457,37 @@ PERL_INC = @PERL_INC@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ PRINT = @PRINT@ +PS = @PS@ +PS_ARGUMENT = @PS_ARGUMENT@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_FCHDIR = @REPLACE_FCHDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ +REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ REPLACE_FTELL = @REPLACE_FTELL@ REPLACE_FTELLO = @REPLACE_FTELLO@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETLINE = @REPLACE_GETLINE@ +REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LSEEK = @REPLACE_LSEEK@ +REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_PRINTF = @REPLACE_PRINTF@ +REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_STRCASESTR = @REPLACE_STRCASESTR@ +REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@ +REPLACE_STRSTR = @REPLACE_STRSTR@ REPLACE_VASPRINTF = @REPLACE_VASPRINTF@ REPLACE_VFPRINTF = @REPLACE_VFPRINTF@ REPLACE_VPRINTF = @REPLACE_VPRINTF@ @@ -445,7 +495,11 @@ REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@ REPLACE_WCWIDTH = @REPLACE_WCWIDTH@ RESTORE = @RESTORE@ +RSH_SECURITY = @RSH_SECURITY@ SAMBA_CLIENT = @SAMBA_CLIENT@ +SERVER_HOST_INSTANCE = @SERVER_HOST_INSTANCE@ +SERVER_HOST_KEY_FILE = @SERVER_HOST_KEY_FILE@ +SERVER_HOST_PRINCIPAL = @SERVER_HOST_PRINCIPAL@ SERVICE_SUFFIX = @SERVICE_SUFFIX@ SETUID_GROUP = @SETUID_GROUP@ SET_MAKE = @SET_MAKE@ @@ -455,6 +509,7 @@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ SNAPSHOT_STAMP = @SNAPSHOT_STAMP@ SORT = @SORT@ SSH = @SSH@ +SSH_SECURITY = @SSH_SECURITY@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ @@ -464,7 +519,14 @@ SWIG_LIB = @SWIG_LIB@ SYS_SOCKET_H = @SYS_SOCKET_H@ SYS_STAT_H = @SYS_STAT_H@ SYS_TIME_H = @SYS_TIME_H@ +TCPPORTRANGE = @TCPPORTRANGE@ +TICKET_LIFETIME = @TICKET_LIFETIME@ +UDPPORTRANGE = @UDPPORTRANGE@ +UNCOMPRESS_OPT = @UNCOMPRESS_OPT@ +UNCOMPRESS_PATH = @UNCOMPRESS_PATH@ +USE_AMANDAHOSTS = @USE_AMANDAHOSTS@ USE_NLS = @USE_NLS@ +USE_RUNDUMP = @USE_RUNDUMP@ USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@ VDUMP = @VDUMP@ VERSION = @VERSION@ @@ -473,6 +535,7 @@ VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ VERSION_PATCH = @VERSION_PATCH@ VERSION_SUFFIX = @VERSION_SUFFIX@ +VOID_UNSETENV = @VOID_UNSETENV@ VRESTORE = @VRESTORE@ VXDUMP = @VXDUMP@ VXRESTORE = @VXRESTORE@ @@ -501,6 +564,7 @@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ +amdatadir = @amdatadir@ amincludedir = @amincludedir@ amlibdir = @amlibdir@ amlibexecdir = @amlibexecdir@ @@ -519,6 +583,8 @@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ +gltests_LIBOBJS = @gltests_LIBOBJS@ +gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -548,6 +614,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ diff --git a/packaging/deb/amanda-backup-client.install b/packaging/deb/amanda-backup-client.install index 3e572ef..e8d0b35 100644 --- a/packaging/deb/amanda-backup-client.install +++ b/packaging/deb/amanda-backup-client.install @@ -7,11 +7,15 @@ usr/sbin/amcryp* usr/sbin/amgpgcrypt usr/sbin/amoldrecover usr/sbin/amrecover +usr/sbin/amgetconf usr/share/man/man5/amanda.conf.5 usr/share/man/man5/amanda-client.conf.5 +usr/share/man/man7/amanda-devices.7 +usr/share/man/man7/amanda-applications.7 usr/share/man/man8/amanda.8 usr/share/man/man8/amcheckdump.8 usr/share/man/man8/amrecover.8 +usr/share/man/man8/amgetconf.8 var/lib/amanda/* var/lib/amanda/gnutar-lists/* var/lib/amanda/example/xinetd.amandaclient diff --git a/packaging/deb/amanda-backup-client.lintian b/packaging/deb/amanda-backup-client.lintian index b7069a4..adea097 100644 --- a/packaging/deb/amanda-backup-client.lintian +++ b/packaging/deb/amanda-backup-client.lintian @@ -9,7 +9,6 @@ amanda-backup-client: file-in-unusual-dir usr/libexec/amanda/* amanda-backup-client: manpage-has-bad-whatis-entry amanda-backup-client: non-standard-dir-in-usr usr/libexec amanda-backup-client: non-standard-dir-in-var var/log/amanda -amanda-backup-client: non-standard-dir-in-var var/amanda amanda-backup-client: non-standard-dir-perm var/lib/amanda/gnutar-lists amanda-backup-client: non-standard-dir-perm var/log/amanda amanda-backup-client: package-name-doesnt-match-sonames diff --git a/packaging/deb/amanda-backup-client.postinst b/packaging/deb/amanda-backup-client.postinst old mode 100755 new mode 100644 diff --git a/packaging/deb/amanda-backup-client.postrm b/packaging/deb/amanda-backup-client.postrm old mode 100755 new mode 100644 diff --git a/packaging/deb/amanda-backup-server.install b/packaging/deb/amanda-backup-server.install index 42e429d..36dfe3e 100644 --- a/packaging/deb/amanda-backup-server.install +++ b/packaging/deb/amanda-backup-server.install @@ -4,6 +4,7 @@ usr/libexec/amanda/* usr/libexec/amanda/application/* usr/sbin/* usr/share/man/man5/* +usr/share/man/man7/* usr/share/man/man8/* var/lib/amanda/* var/lib/amanda/gnutar-lists/* diff --git a/packaging/deb/amanda-backup-server.postinst b/packaging/deb/amanda-backup-server.postinst old mode 100755 new mode 100644 index 260db60..82769c6 --- a/packaging/deb/amanda-backup-server.postinst +++ b/packaging/deb/amanda-backup-server.postinst @@ -49,6 +49,18 @@ echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${AMTMP}'." chown ${amanda_user}:${amanda_group} ${AMTMP} || exit 1 chmod 0640 ${AMTMP} || exit 1 +# install am_passphrase file to server +echo "`date +'%b %e %Y %T'`: Checking '${AMANDAHOMEDIR}/.am_passphrase' file." +if [ ! -f ${AMANDAHOMEDIR}/.am_passphrase ] ; then + echo "`date +'%b %e %Y %T'`: Create '${AMANDAHOMEDIR}/.am_passphrase' file." + touch ${AMANDAHOMEDIR}/.am_passphrase || exit 1 + phrase=`echo $RANDOM | md5sum | awk '{print $1}'` + echo ${phrase} >>${AMANDAHOMEDIR}/.am_passphrase + + chown ${amanda_user}:${amanda_group} ${AMANDAHOMEDIR}/.am_passphrase + chmod 0700 ${AMANDAHOMEDIR}/.am_passphrase +fi + # Install .gnupg directory echo "`date +'%b %e %Y %T'`: Installing '${AMHOMEDIR}/.gnupg'." if [ ! -d ${AMHOMEDIR}/.gnupg ] ; then diff --git a/packaging/deb/amanda-backup-server.postrm b/packaging/deb/amanda-backup-server.postrm old mode 100755 new mode 100644 diff --git a/packaging/deb/buildpkg b/packaging/deb/buildpkg index 4cee2d6..c054e32 100755 --- a/packaging/deb/buildpkg +++ b/packaging/deb/buildpkg @@ -49,7 +49,7 @@ fi if [ -z $AMVER ] then - AMVER=amanda-2.6.0p2 + AMVER=amanda-2.6.1 fi if [ -z $AMTARBALL ] diff --git a/packaging/deb/changelog b/packaging/deb/changelog index 63eabb3..306d3dc 100644 --- a/packaging/deb/changelog +++ b/packaging/deb/changelog @@ -1,9 +1,6 @@ -amanda (2.6.0p1-1) unstable; urgency=low +amanda (2.6.1-1) unstable; urgency=low * Initial debian release: This package is based on Bdale Garbee's work as the official debian maintainer for amanda. - * Found by Daniel_p: Fixed typos in preinst and postrm. Added permission - check for /tmp/amanda. Fixed rules to append default perl site_lib to - .install file so that perl modules are installed. - -- Zmanda Mon, 10 Mar 2008 1:00:09 -0600 + -- Zmanda Wed, 26 Nov 2008 23:00:09 -0600 diff --git a/packaging/deb/rules b/packaging/deb/rules index bae37a0..6fcae65 100755 --- a/packaging/deb/rules +++ b/packaging/deb/rules @@ -8,7 +8,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -AMVER=2.6.0p2 +AMVER=2.6.1 # These are variables that the user can override. They get used in various # places during configure, build, and install. @@ -60,7 +60,8 @@ build-stamp: /sbin/dump /usr/bin/smbclient --libexecdir=$(LIBEXECDIR) \ --enable-shared \ --sysconfdir=$(SYSCONFDIR) \ - --localstatedir=$(LOCALSTATEDIR)\ + --localstatedir=$(LOCALSTATEDIR) \ + --with-amdatadir=$(AMHOMEDIR) \ --with-gnutar-listdir=$(AMHOMEDIR)/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ @@ -149,10 +150,14 @@ binary-arch: build chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists $(server)/$(AMHOMEDIR)/gnutar-lists # .. setuid chown root:disk \ + $(client)/$(AMLIBEXECDIR)/application/amgtar \ + $(client)/$(AMLIBEXECDIR)/application/amstar \ $(client)/$(AMLIBEXECDIR)/killpgrp \ $(client)/$(AMLIBEXECDIR)/rundump \ $(client)/$(AMLIBEXECDIR)/runtar \ $(client)/$(AMLIBEXECDIR)/calcsize \ + $(server)/$(AMLIBEXECDIR)/application/amgtar \ + $(server)/$(AMLIBEXECDIR)/application/amstar \ $(server)/$(AMLIBEXECDIR)/killpgrp \ $(server)/$(AMLIBEXECDIR)/rundump \ $(server)/$(AMLIBEXECDIR)/runtar \ @@ -161,10 +166,14 @@ binary-arch: build $(server)/$(AMLIBEXECDIR)/planner \ $(server)/usr/sbin/amcheck chmod u=srwx,g=rx,o=r \ + $(client)/$(AMLIBEXECDIR)/application/amgtar \ + $(client)/$(AMLIBEXECDIR)/application/amstar \ $(client)$(AMLIBEXECDIR)/killpgrp \ $(client)$(AMLIBEXECDIR)/rundump \ $(client)$(AMLIBEXECDIR)/runtar \ $(client)$(AMLIBEXECDIR)/calcsize \ + $(server)/$(AMLIBEXECDIR)/application/amgtar \ + $(server)/$(AMLIBEXECDIR)/application/amstar \ $(server)$(AMLIBEXECDIR)/killpgrp \ $(server)$(AMLIBEXECDIR)/rundump \ $(server)$(AMLIBEXECDIR)/runtar \ diff --git a/packaging/rpm/amanda.spec b/packaging/rpm/amanda.spec index 64deb84..acb6d23 100644 --- a/packaging/rpm/amanda.spec +++ b/packaging/rpm/amanda.spec @@ -15,8 +15,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com # @@ -62,11 +62,11 @@ %define disttag fc %define distver 7 %endif - %if %(awk '$1 == "Fedora" && $3 ~ /8.*/ { exit 1; }' /etc/redhat-release; echo $?) + # if macro cannot have an empty test and we're just testing the existance + %if %{?fedora:yes}%{!?fedora:no} == yes %define dist fedora %define disttag fc - %define distver 8 - # TODO: generalize this so that any platform can cross compile + %define distver %{fedora} %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686 # Do nothing if PKG_CONFIG_PATH was set by the user above. %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig} @@ -84,29 +84,58 @@ %define distver 4 %define tarver 1.14 %endif + %if %(awk '$1 == "CentOS" && $3 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?) + %define dist redhat + %define disttag rhel + %define distver 4 + %define tarver 1.14 + %endif %if %(awk '$1 == "Red" && $7 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) %define dist redhat %define disttag rhel %define distver 5 %endif + %if %(awk '$1 == "CentOS" && $3 ~ /5.*/ { exit 1; }' /etc/redhat-release; echo $?) + %define dist redhat + %define disttag rhel + %define distver 5 + %endif + + # If dist is undefined, we didn't detect. + %{!?dist:%define dist unknown} %endif # Detect Suse variants. Suse gives us some nice macros in their rpms %if %{_vendor} == "suse" - %if %{suse_version} == 910 - %define dist SuSE - %define disttag sles - %define distver 9 - %endif - %if %{suse_version} == 1010 - %define dist SuSE - %define disttag sles - %define distver 10 - %endif - %if %{suse_version} == 1000 - %define dist SuSE - %define disttag suse - %define distver 10 + %define dist SuSE + %if %{sles_version} == 0 + %define disttag suse + %if %{suse_version} == 910 + %define distver 9 + %endif + %if %{suse_version} == 1000 + %define distver 10 + %endif + %if %{suse_version} == 1010 + %define distver 10 + %endif + # Written against SLES11-beta2, which is using SUSE11's rpm system. + # This will change when they release, I assume. + %if %{suse_version} == 1100 + # assume it's sles11 in disguise, for now + %define disttag sles + %define distver 11 + %endif + %if %{suse_version} == 1110 + %define distver 11.1 + %endif + %else + %define disttag sles + # sles versions are simple integers, just like we want + %define distver %{sles_version} %endif + + # If dist is undefined, we didn't detect. + %{!?dist:%define dist unknown} %endif # Set options per distribution @@ -119,6 +148,9 @@ %define xinetd_reload restart %endif +# Let's die if we haven't detected the distro. This might save some frustration. +# RPM does not provide a way to exit gracefully, hence the tag_to_cause_exit. +%{!?distver: %{error:"Your distribution and its version were not detected."}; %tag_to_cause_exit } # Set minimum tar version if it wasn't set in the per-distro section %{!?tarver: %define tarver 1.15} @@ -127,7 +159,7 @@ # --- Definitions --- # Define amanda_version if it is not already defined. -%{!?amanda_version: %define amanda_version 2.6.0p2} +%{!?amanda_version: %define amanda_version 2.6.1} %{!?amanda_release: %define amanda_release 1} %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" %define amanda_user amandabackup @@ -159,7 +191,12 @@ BuildRequires: flex BuildRequires: gcc BuildRequires: glibc >= 2.2.0 BuildRequires: readline +BuildRequires: readline-devel BuildRequires: curl >= 7.10.0 +BuildRequires: curl-devel >= 7.10.0 +BuildRequires: openssl +BuildRequires: openssl-devel +BuildRequires: perl(ExtUtils::Embed) Requires: /bin/awk Requires: /bin/date Requires: /usr/bin/id @@ -174,11 +211,15 @@ Requires: libc.so.6 Requires: libm.so.6 Requires: libnsl.so.1 Requires: curl >= 7.10.0 +Requires: openssl Requires: xinetd Requires: perl >= 5.6.0 Requires: tar >= %{tarver} -%if %{dist} == redhat || %{dist}== fedora +Requires: readline +%if %{dist} == redhat || %{dist} == fedora + %if %{distver} <= 8 Requires: libtermcap.so.2 + %endif Requires: initscripts %endif Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version} @@ -190,7 +231,9 @@ Requires: /bin/awk Requires: fileutils Requires: grep %if %{dist} == redhat || %{dist}== fedora + %if %{distver} <= 8 Requires: libtermcap.so.2 + %endif Requires: initscripts %endif Requires: xinetd @@ -198,7 +241,8 @@ Requires: libc.so.6 Requires: libm.so.6 Requires: libnsl.so.1 Requires: perl >= 5.6.0 -Requires: tar >= 1.15 +Requires: tar >= %{tarver} +Requires: readline Provides: amanda-backup_client = %{amanda_version} Provides: libamclient-%{version}.so = %{amanda_version} Provides: libamanda-%{version}.so = %{amanda_version} @@ -214,12 +258,14 @@ Requires: libc.so.6 Requires: libm.so.6 Requires: libnsl.so.1 %if %{dist} == redhat || %{dist}== fedora + %if %{distver} <= 8 Requires: libtermcap.so.2 + %endif Requires: initscripts %endif Requires: xinetd Requires: perl >= 5.6.0 -Requires: tar >= 1.15 +Requires: tar >= %{tarver} Provides: amanda-backup_server = %{amanda_version} Provides: libamclient-%{version}.so = %{amanda_version} Provides: libamanda-%{version}.so = %{amanda_version} @@ -278,6 +324,7 @@ Amanda Documentation is available at: http://wiki.zmanda.com/ %define DATADIR %{PREFIX}/share %define SYSCONFDIR /etc %define LOCALSTATEDIR /var +%define AMANDATES %{AMANDAHOMEDIR}/amandates %define AMANDAHOMEDIR %{LOCALSTATEDIR}/lib/amanda %ifarch x86_64 %define LIBDIR %{EPREFIX}/lib64 @@ -289,6 +336,7 @@ Amanda Documentation is available at: http://wiki.zmanda.com/ %define MANDIR %{DATADIR}/man %define LOGDIR /var/log/amanda %define PERLSITELIB %(eval "`perl -V:installsitelib`"; echo $installsitelib) +%define AMDATADIR /var/lib/amanda # Installation directories: %define ROOT_SBINDIR %{buildroot}/%{SBINDIR} @@ -300,6 +348,7 @@ Amanda Documentation is available at: http://wiki.zmanda.com/ %define ROOT_LIBDIR %{buildroot}/%{LIBDIR} %define ROOT_MANDIR %{buildroot}/%{MANDIR} %define ROOT_LOGDIR %{buildroot}/%{LOGDIR} +%define ROOT_AMDATADIR %{buildroot}/%{AMDATADIR} # --- Unpack --- @@ -321,8 +370,8 @@ Amanda Documentation is available at: http://wiki.zmanda.com/ --localstatedir=%{LOCALSTATEDIR} \ --libdir=%{LIBDIR} \ --includedir=%{INCLUDEDIR} \ + --with-amdatadir=%{AMDATADIR} \ --with-gnuplot=/usr/bin/gnuplot \ - --with-gnutar=/bin/tar \ --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ @@ -354,6 +403,7 @@ Amanda Documentation is available at: http://wiki.zmanda.com/ --localstatedir=%{LOCALSTATEDIR} \ --libdir=%{LIBDIR} \ --includedir=%{INCLUDEDIR} \ + --with-amdatadir=%{AMDATADIR} \ --with-star=/usr/bin/star \ --with-gnuplot=/usr/bin/gnuplot \ --with-gnutar=/bin/tar \ @@ -612,29 +662,29 @@ if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then fi fi -echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE} ret_val=0 -if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then - touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 +if [ ! -f %{AMANDATES} ] ; then + touch %{AMANDATES} >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE} fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} - chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 - chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1 + chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1 if [ -x /sbin/restorecon ] ; then - /sbin/restorecon %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + /sbin/restorecon %{AMANDATES} >>${TMPFILE} 2>&1 fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_LOG} else - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_ERR} fi @@ -977,26 +1027,26 @@ if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then fi fi -echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE} ret_val=0 -if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then - touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 +if [ ! -f %{AMANDATES} ] ; then + touch %{AMANDATES} >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE} fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} - chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 - chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1 + chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1 fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_LOG} else - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_ERR} fi @@ -1034,7 +1084,7 @@ echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." > if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE} touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1 - phrase=`echo "amandabackup" | md5sum | awk '{print $1}'` + phrase=`echo $RANDOM | md5sum | awk '{print $1}'` echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1 @@ -1361,26 +1411,26 @@ if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then fi fi -echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDATES}'." >${TMPFILE} ret_val=0 -if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then - touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 +if [ ! -f %{AMANDATES} ] ; then + touch %{AMANDATES} >>${TMPFILE} 2>&1 ret_val=$? if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The file '%{AMANDATES}' has been created." >>${TMPFILE} fi fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} - chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 - chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{AMANDATES}'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDATES} >>${TMPFILE} 2>&1 + chmod 0640 %{AMANDATES} >>${TMPFILE} 2>&1 fi if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation successful." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_LOG} else - echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{AMANDATES}' Installation failed." >>${TMPFILE} cat ${TMPFILE} cat ${TMPFILE} >>${INSTALL_ERR} fi @@ -1508,14 +1558,13 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an # Notes: Do not use wildcards on directories not wholly owned by amanda. An # uninstall of the software will attempt to delete whatever matches here. %files backup_client -%defattr(0755,%{amanda_user},%{amanda_group}) -%{SYSCONFDIR}/amanda -%{AMANDAHOMEDIR} +%defattr(0755,%{amanda_user},%{amanda_group},0755) %{AMLIBEXECDIR} %{AMLIBDIR} -%{AMLIBEXECDIR}/amanda-sh-lib.sh -%{LOCALSTATEDIR}/amanda +%{PERLSITELIB}/auto/Amanda %defattr(4750,root,disk) +%{AMLIBEXECDIR}/application/amgtar +%{AMLIBEXECDIR}/application/amstar %{AMLIBEXECDIR}/calcsize %{AMLIBEXECDIR}/killpgrp %{AMLIBEXECDIR}/rundump @@ -1527,17 +1576,30 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an %{SBINDIR}/amgpgcrypt %{SBINDIR}/amoldrecover %{SBINDIR}/amrecover -%defattr(0644,%{amanda_user},%{amanda_group}) +%defattr(0644,%{amanda_user},%{amanda_group},0755) +%{LOCALSTATEDIR}/amanda +%{PERLSITELIB}/Amanda +%{SYSCONFDIR}/amanda %docdir %{MANDIR} %{MANDIR}/man5/amanda.conf.5.gz %{MANDIR}/man5/amanda-client.conf.5.gz +%{MANDIR}/man7/amanda-devices.7.gz +%{MANDIR}/man7/amanda-applications.7.gz +%{MANDIR}/man7/amanda-scripts.7.gz +%{MANDIR}/man8/amaespipe.8.gz %{MANDIR}/man8/amanda.8.gz %{MANDIR}/man8/amcheckdump.8.gz +%{MANDIR}/man8/amcrypt* +%{MANDIR}/man8/amgpgcrypt.8.gz %{MANDIR}/man8/amrecover.8.gz %{AMLIBEXECDIR}/amcat.awk -%{AMANDAHOMEDIR}/amanda-release -%{AMANDAHOMEDIR}/example/xinetd.amandaclient -%{AMANDAHOMEDIR}/example/amanda-client.conf +%{AMANDAHOMEDIR}/gnutar-lists +%doc %{AMANDAHOMEDIR}/amanda-release +%doc %{AMANDAHOMEDIR}/example/xinetd.amandaclient +%doc %{AMANDAHOMEDIR}/example/xinetd.amandaserver +%doc %{AMANDAHOMEDIR}/example/amanda-client.conf +%doc %{AMANDAHOMEDIR}/template.d/README +%doc %{AMANDAHOMEDIR}/template.d/dumptypes %files backup_server %defattr(0755,%{amanda_user},%{amanda_group}) @@ -1548,32 +1610,7 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an %{PERLSITELIB}/auto/Amanda %{AMANDAHOMEDIR} %{LOCALSTATEDIR}/amanda -%{SBINDIR}/amaddclient -%{SBINDIR}/amadmin -%{SBINDIR}/amcheckdb -%{SBINDIR}/amcheckdump -%{SBINDIR}/amcleanup -%{SBINDIR}/amdd -%{SBINDIR}/amdevcheck -%{SBINDIR}/amdump -%{SBINDIR}/amfetchdump -%{SBINDIR}/amflush -%{SBINDIR}/amgetconf -%{SBINDIR}/amlabel -%{SBINDIR}/ammt -%{SBINDIR}/amoverview -%{SBINDIR}/amplot -%{SBINDIR}/amreport -%{SBINDIR}/amrestore -%{SBINDIR}/amrmtape -%{SBINDIR}/amserverconfig -%{SBINDIR}/amstatus -%{SBINDIR}/amtape -%{SBINDIR}/amtapetype -%{SBINDIR}/amtoc -%{SBINDIR}/amverify -%{SBINDIR}/amverifyrun -%{AMLIBEXECDIR}/amanda-sh-lib.sh +%{SBINDIR}/am* %defattr(4750,root,disk) %{AMLIBEXECDIR}/calcsize %{AMLIBEXECDIR}/killpgrp @@ -1584,11 +1621,9 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an %{SBINDIR}/amcheck %defattr(0750,%{amanda_user},%{amanda_group}) %{LOGDIR} +%{SBINDIR}/activate-devpay %{SBINDIR}/amaespipe -%{SBINDIR}/amcrypt -%{SBINDIR}/amcrypt-ossl -%{SBINDIR}/amcrypt-ossl-asym -%{SBINDIR}/amcryptsimple +%{SBINDIR}/amcrypt* %{SBINDIR}/amgpgcrypt %{SBINDIR}/amoldrecover %{SBINDIR}/amrecover @@ -1598,55 +1633,32 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an %{AMLIBEXECDIR}/amplot.g %{AMLIBEXECDIR}/amplot.gp %docdir %{MANDIR} -%{MANDIR}/man5/amanda.conf.5.gz -%{MANDIR}/man5/amanda-client.conf.5.gz -%{MANDIR}/man8/amaddclient.8.gz -%{MANDIR}/man8/amadmin.8.gz -%{MANDIR}/man8/amanda.8.gz -%{MANDIR}/man8/amcheck.8.gz -%{MANDIR}/man8/amcheckdb.8.gz -%{MANDIR}/man8/amcheckdump.8.gz -%{MANDIR}/man8/amcleanup.8.gz -%{MANDIR}/man8/amdd.8.gz -%{MANDIR}/man8/amdump.8.gz -%{MANDIR}/man8/amfetchdump.8.gz -%{MANDIR}/man8/amflush.8.gz -%{MANDIR}/man8/amgetconf.8.gz -%{MANDIR}/man8/amlabel.8.gz -%{MANDIR}/man8/ammt.8.gz -%{MANDIR}/man8/amoverview.8.gz -%{MANDIR}/man8/amplot.8.gz -%{MANDIR}/man8/amrecover.8.gz -%{MANDIR}/man8/amreport.8.gz -%{MANDIR}/man8/amrestore.8.gz -%{MANDIR}/man8/amrmtape.8.gz -%{MANDIR}/man8/amserverconfig.8.gz -%{MANDIR}/man8/amstatus.8.gz -%{MANDIR}/man8/amtape.8.gz -%{MANDIR}/man8/amtapetype.8.gz -%{MANDIR}/man8/amtoc.8.gz -%{MANDIR}/man8/amverify.8.gz -%{MANDIR}/man8/amverifyrun.8.gz -%{MANDIR}/man8/amcrypt.8.gz -%{MANDIR}/man8/amcrypt-ossl.8.gz -%{MANDIR}/man8/amcrypt-ossl-asym.8.gz -%{MANDIR}/man8/amcryptsimple.8.gz -%{MANDIR}/man8/amgpgcrypt.8.gz -%{MANDIR}/man8/amaespipe.8.gz -%{MANDIR}/man8/amdevcheck.8.gz -%{AMANDAHOMEDIR}/amanda-release -%{AMANDAHOMEDIR}/example/amanda-client.conf -%{AMANDAHOMEDIR}/example/xinetd.amandaserver +%{MANDIR}/man5/am* +%{MANDIR}/man5/disklist.5.gz +%{MANDIR}/man5/tapelist.5.gz +%{MANDIR}/man7/am* +%{MANDIR}/man8/am* +%{MANDIR}/man8/script-email.8.gz +%doc %{AMANDAHOMEDIR}/amanda-release +%docdir %{AMANDAHOMEDIR}/example +%docdir %{AMANDAHOMEDIR}/template.d # --- ChangeLog %changelog +* Mon Sep 15 2008 Dan Locks 2.6.1alpha +- Added detection of CentOS 4 and 5 as suggested by dswartz +- graceful failure when Distro/version is not detected correctly +* Thu Jun 12 2008 Dan Locks 2.6.1alpha +- install amgtar and amstar suid root +* Mon Jun 09 2008 Dan Locks 2.6.1alpha +- Replaced individual SBINDIR/am... entries with SBINDIR/am* in %%files * Fri May 02 2008 Dan Locks - Changed instances of ${ to %%{ where applicable * Tue Mar 11 2008 Dan Locks - fixed many rpmlint complaints - added --quiet to configure statements -- moved PERLSITELIB to definitions section +- added PERLSITELIB to definitions section and perl files to %%files section * Wed Feb 13 2008 Dan Locks - added an environment check for PKG_CONFIG_PATH - added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment diff --git a/packaging/rpm/buildpkg b/packaging/rpm/buildpkg index 6361d14..d2b3934 100755 --- a/packaging/rpm/buildpkg +++ b/packaging/rpm/buildpkg @@ -1,13 +1,35 @@ #!/bin/bash -# Buildpkg script for producing RPM packages. Does not require root access. + +# Buildpkg script for producing RPM packages. (Does not require root access.) +# Buildpkg is designed to be used by both buildbot (to automate rpm production) +# and by J Random User (to build an rpm for kicks). The odd way of handling +# all optioins through environment variables is a product of buildbot. +# +# AMVER: the version of amanda we're working on. This will become part of the +# rpm name. AMVER must line up with the version number mentioned in the +# .spec file. +# AMTARBALL: the name of the tarball which contains the source code. it must +# unpack into a directory named AMVER. It's easiest and safest to just +# let the script create a new one for you, even if it's a bit more overhead +# AMPKGDIR: Rpmbuild expects absolute paths, so we provide this var. It also +# allows you to build somewhere other than `pwd`. You probably don't want +# to use the system-wide location, as the script tries to blow these +# directories away. +# +# Other Hints: +# Not everyone will want to use the ./configure options we provide. The +# easiest way to change them is by editing the .spec file. This isn't so +# easy, unfortunately. Look at the %build section, and the %define xxxx +# statements immediately above it. good luck. # This is useful for debugging set -x # Buildbot exports some useful env variables. # Check for $AMVER. I couldn't come up with a good way to detect it. if [ -z $AMVER ]; then - AMVER=amanda-2.6.0p2 + AMVER=amanda-2.6.1 fi + # Check for AMTARBALL variable. if [ -z $AMTARBALL ]; then AMTARBALL=$AMVER.tar.gz @@ -17,7 +39,7 @@ fi if [ ! -f ${AMTARBALL} ]; then mkdir ${AMVER} cp -Rfp * ${AMVER}/ - tar -cf ${AMTARBALL} -z ${AMVER} + tar -cf ${AMTARBALL} -z ${AMVER} || exit 1 rm -rf ${AMVER} fi @@ -26,27 +48,27 @@ if [ -z $AMPKGDIR ]; then AMPKGDIR=${PWD} fi if [ ! -d ${AMPKGDIR} ]; then - mkdir ${AMPKGDIR} + mkdir ${AMPKGDIR} || exit 1 fi cd ${AMPKGDIR} if [ -d rpm ]; then - rm -rf rpm + rm -rf rpm || exit 1 fi mkdir rpm mkdir rpm/SOURCES mkdir rpm/SRPMS mkdir rpm/SPECS mkdir rpm/BUILD -mkdir rpm/RPMS +mkdir rpm/RPMS || exit 1 # Make a copy of the tarball with the name that rpmbuild expects -cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz -cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec +cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz || exit 1 +cp packaging/rpm/amanda.spec rpm/SPECS || exit 1 # Rpmbuild requires absolute paths. annoying. If you need to change the # default value of some rpm.spec variable, just pass extra --define options. # this is useful for changing %amanda_release or %amanda_version rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \ - ${AMPKGDIR}/rpm/SPECS/amanda.spec + ${AMPKGDIR}/rpm/SPECS/amanda.spec || exit 1 cp rpm/RPMS/*/*.rpm . || exit 1 cp rpm/SRPMS/*.rpm . || exit 1 diff --git a/perl/Amanda/Application.c b/perl/Amanda/Application.c new file mode 100644 index 0000000..1462e23 --- /dev/null +++ b/perl/Amanda/Application.c @@ -0,0 +1,2020 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPERL +#define SWIG_CASTRANK_MODE +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic CAPI SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the swig runtime code. + In 99.9% of the cases, swig just needs to declare them as 'static'. + + But only do this if is strictly necessary, ie, if you have problems + with your compiler or so. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The swig conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old swig versions, you usually write code as: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit as: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + that seems to be the same, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + requires also to SWIG_ConvertPtr to return new result values, as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + swig errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() + + + */ +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* think of this as a c++ template<> or a scheme macro */ +#define SWIG_TypeCheck_Template(comparison, ty) \ + if (ty) { \ + swig_cast_info *iter = ty->cast; \ + while (iter) { \ + if (comparison) { \ + if (iter == ty->cast) return iter; \ + /* Move iter to the top of the linked list */ \ + iter->prev->next = iter->next; \ + if (iter->next) \ + iter->next->prev = iter->prev; \ + iter->next = ty->cast; \ + iter->prev = 0; \ + if (ty->cast) ty->cast->prev = iter; \ + ty->cast = iter; \ + return iter; \ + } \ + iter = iter->next; \ + } \ + } \ + return 0 + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +} + +/* Same as previous function, except strcmp is replaced with a pointer comparison */ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { + SWIG_TypeCheck_Template(iter->type == from, into); +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ + +/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ +#ifndef PERL_REVISION +# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) +# define PERL_PATCHLEVEL_H_IMPLICIT +# include +# endif +# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) +# include +# endif +# ifndef PERL_REVISION +# define PERL_REVISION (5) +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION +# endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +#ifndef SvIOK_UV +# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) +#endif + +#ifndef SvUOK +# define SvUOK(sv) SvIOK_UV(sv) +#endif + +#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) +# define PL_sv_undef sv_undef +# define PL_na na +# define PL_errgv errgv +# define PL_sv_no sv_no +# define PL_sv_yes sv_yes +# define PL_markstack_ptr markstack_ptr +#endif + +#ifndef IVSIZE +# ifdef LONGSIZE +# define IVSIZE LONGSIZE +# else +# define IVSIZE 4 /* A bold guess, but the best we can make. */ +# endif +#endif + +#ifndef INT2PTR +# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +# define PTRV UV +# define INT2PTR(any,d) (any)(d) +# else +# if PTRSIZE == LONGSIZE +# define PTRV unsigned long +# else +# define PTRV unsigned +# endif +# define INT2PTR(any,d) (any)(PTRV)(d) +# endif + +# define NUM2PTR(any,d) (any)(PTRV)(d) +# define PTR2IV(p) INT2PTR(IV,p) +# define PTR2UV(p) INT2PTR(UV,p) +# define PTR2NV(p) NUM2PTR(NV,p) + +# if PTRSIZE == LONGSIZE +# define PTR2ul(p) (unsigned long)(p) +# else +# define PTR2ul(p) INT2PTR(unsigned long,p) +# endif +#endif /* !INT2PTR */ + +#ifndef SvPV_nolen +# define SvPV_nolen(x) SvPV(x,PL_na) +#endif + +#ifndef get_sv +# define get_sv perl_get_sv +#endif + +#ifndef ERRSV +# define ERRSV get_sv("@",FALSE) +#endif + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGINTERN const char* +SWIG_Perl_ErrorType(int code) { + const char* type = 0; + switch(code) { + case SWIG_MemoryError: + type = "MemoryError"; + break; + case SWIG_IOError: + type = "IOError"; + break; + case SWIG_RuntimeError: + type = "RuntimeError"; + break; + case SWIG_IndexError: + type = "IndexError"; + break; + case SWIG_TypeError: + type = "TypeError"; + break; + case SWIG_DivisionByZero: + type = "ZeroDivisionError"; + break; + case SWIG_OverflowError: + type = "OverflowError"; + break; + case SWIG_SyntaxError: + type = "SyntaxError"; + break; + case SWIG_ValueError: + type = "ValueError"; + break; + case SWIG_SystemError: + type = "SystemError"; + break; + case SWIG_AttributeError: + type = "AttributeError"; + break; + default: + type = "RuntimeError"; + } + return type; +} + + + + +/* ----------------------------------------------------------------------------- + * perlrun.swg + * + * This file contains the runtime support for Perl modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef PERL_OBJECT +#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), +#define SWIG_PERL_OBJECT_CALL pPerl, +#else +#define SWIG_PERL_OBJECT_DECL +#define SWIG_PERL_OBJECT_CALL +#endif + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) +#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) + + +/* Error manipulation */ + +#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) +#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + +/* Perl-specific SWIG API */ + +#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) +#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) +#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) + + +#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) +#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) +#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) +#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +/* For backward compatibility only */ +#define SWIG_POINTER_EXCEPTION 0 + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_OWNER SWIG_POINTER_OWN +#define SWIG_SHADOW SWIG_OWNER << 1 + +#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL + +/* SWIG Perl macros */ + +/* Macro to declare an XS function */ +#ifndef XSPROTO +# define XSPROTO(name) void name(pTHX_ CV* cv) +#endif + +/* Macro to call an XS function */ +#ifdef PERL_OBJECT +# define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +# ifndef MULTIPLICITY +# define SWIG_CALLXS(_name) _name(cv) +# else +# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +# endif +#endif + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC + +#else /* PERL_OBJECT */ + +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static SWIGUNUSED + +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#else /* MULTIPLICITY */ + +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif /* MULTIPLICITY */ +#endif /* PERL_OBJECT */ + +/* Workaround for bug in perl 5.6.x croak and earlier */ +#if (PERL_VERSION < 8) +# ifdef PERL_OBJECT +# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) +static void SWIG_Perl_croak_null(CPerlObj *pPerl) +# else +static void SWIG_croak_null() +# endif +{ + SV *err=ERRSV; +# if (PERL_VERSION < 6) + croak("%_", err); +# else + if (SvOK(err) && !SvROK(err)) croak("%_", err); + croak(Nullch); +# endif +} +#else +# define SWIG_croak_null() croak(Nullch) +#endif + + +/* + Define how strict is the cast between strings and integers/doubles + when overloading between these types occurs. + + The default is making it as strict as possible by using SWIG_AddCast + when needed. + + You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to + disable the SWIG_AddCast, making the casting between string and + numbers less strict. + + In the end, we try to solve the overloading between strings and + numerical types in the more natural way, but if you can avoid it, + well, avoid it using %rename, for example. +*/ +#ifndef SWIG_PERL_NO_STRICT_STR2NUM +# ifndef SWIG_PERL_STRICT_STR2NUM +# define SWIG_PERL_STRICT_STR2NUM +# endif +#endif +#ifdef SWIG_PERL_STRICT_STR2NUM +/* string takes precedence */ +#define SWIG_Str2NumCast(x) SWIG_AddCast(x) +#else +/* number takes precedence */ +#define SWIG_Str2NumCast(x) x +#endif + + + +#include + +SWIGRUNTIME const char * +SWIG_Perl_TypeProxyName(const swig_type_info *type) { + if (!type) return NULL; + if (type->clientdata != NULL) { + return (const char*) type->clientdata; + } + else { + return type->name; + } +} + +SWIGRUNTIME swig_cast_info * +SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) + || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); +} + + +/* Function for getting a pointer value */ + +SWIGRUNTIME int +SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { + swig_cast_info *tc; + void *voidptr = (void *)0; + SV *tsv = 0; + /* If magical, apply more magic */ + if (SvGMAGICAL(sv)) + mg_get(sv); + + /* Check to see if this is an object */ + if (sv_isobject(sv)) { + IV tmp = 0; + tsv = (SV*) SvRV(sv); + if ((SvTYPE(tsv) == SVt_PVHV)) { + MAGIC *mg; + if (SvMAGICAL(tsv)) { + mg = mg_find(tsv,'P'); + if (mg) { + sv = mg->mg_obj; + if (sv_isobject(sv)) { + tsv = (SV*)SvRV(sv); + tmp = SvIV(tsv); + } + } + } else { + return SWIG_ERROR; + } + } else { + tmp = SvIV(tsv); + } + voidptr = INT2PTR(void *,tmp); + } else if (! SvOK(sv)) { /* Check for undef */ + *(ptr) = (void *) 0; + return SWIG_OK; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + if (!SvROK(sv)) { + *(ptr) = (void *) 0; + return SWIG_OK; + } else { + return SWIG_ERROR; + } + } else { /* Don't know what it is */ + return SWIG_ERROR; + } + if (_t) { + /* Now see if the types match */ + char *_c = HvNAME(SvSTASH(SvRV(sv))); + tc = SWIG_TypeProxyCheck(_c,_t); + if (!tc) { + return SWIG_ERROR; + } + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } + } else { + *ptr = voidptr; + } + + /* + * DISOWN implementation: we need a perl guru to check this one. + */ + if (tsv && (flags & SWIG_POINTER_DISOWN)) { + /* + * almost copy paste code from below SWIG_POINTER_OWN setting + */ + SV *obj = sv; + HV *stash = SvSTASH(SvRV(obj)); + GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE); + if (isGV(gv)) { + HV *hv = GvHVn(gv); + /* + * To set ownership (see below), a newSViv(1) entry is added. + * Hence, to remove ownership, we delete the entry. + */ + if (hv_exists_ent(hv, obj, 0)) { + hv_delete_ent(hv, obj, 0, 0); + } + } + } + return SWIG_OK; +} + +SWIGRUNTIME void +SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { + if (ptr && (flags & SWIG_SHADOW)) { + SV *self; + SV *obj=newSV(0); + HV *hash=newHV(); + HV *stash; + sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + stash=SvSTASH(SvRV(obj)); + if (flags & SWIG_POINTER_OWN) { + HV *hv; + GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); + if (!isGV(gv)) + gv_init(gv, stash, "OWNER", 5, FALSE); + hv=GvHVn(gv); + hv_store_ent(hv, obj, newSViv(1), 0); + } + sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); + SvREFCNT_dec(obj); + self=newRV_noinc((SV *)hash); + sv_setsv(sv, self); + SvREFCNT_dec((SV *)self); + sv_bless(sv, stash); + } + else { + sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + } +} + +SWIGRUNTIMEINLINE SV * +SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { + SV *result = sv_newmortal(); + SWIG_MakePtr(result, ptr, t, flags); + return result; +} + +SWIGRUNTIME void +SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { + char result[1024]; + char *r = result; + if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + strcpy(r,SWIG_Perl_TypeProxyName(type)); + sv_setpv(sv, result); +} + +SWIGRUNTIME SV * +SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { + SV *result = sv_newmortal(); + SWIG_Perl_MakePackedObj(result, ptr, sz, type); + return result; +} + +/* Convert a packed value value */ +SWIGRUNTIME int +SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { + swig_cast_info *tc; + const char *c = 0; + + if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; + c = SvPV_nolen(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') return SWIG_ERROR; + c++; + c = SWIG_UnpackData(c,ptr,sz); + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) return SWIG_ERROR; + } + return SWIG_OK; +} + + +/* Macros for low-level exception handling */ +#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } + + +typedef XSPROTO(SwigPerlWrapper); +typedef SwigPerlWrapper *SwigPerlWrapperPtr; + +/* Structure for command table */ +typedef struct { + const char *name; + SwigPerlWrapperPtr wrapper; +} swig_command_info; + +/* Information for constant table */ + +#define SWIG_INT 1 +#define SWIG_FLOAT 2 +#define SWIG_STRING 3 +#define SWIG_POINTER 4 +#define SWIG_BINARY 5 + +/* Constant information structure */ +typedef struct swig_constant_info { + int type; + const char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_constant_info; + + +/* Structure for variable table */ +typedef struct { + const char *name; + SwigMagicFunc set; + SwigMagicFunc get; + swig_type_info **type; +} swig_variable_info; + +/* Magic variable code */ +#ifndef PERL_OBJECT +#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) + #ifndef MULTIPLICITY + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) + #else + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) + #endif +#else +# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) +SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) +#endif +{ + MAGIC *mg; + sv_magic(sv,sv,'U',(char *) name,strlen(name)); + mg = mg_find(sv,'U'); + mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); + mg->mg_virtual->svt_get = (SwigMagicFunc) get; + mg->mg_virtual->svt_set = (SwigMagicFunc) set; + mg->mg_virtual->svt_len = 0; + mg->mg_virtual->svt_clear = 0; + mg->mg_virtual->svt_free = 0; +} + + +SWIGRUNTIME swig_module_info * +SWIG_Perl_GetModule(void) { + static void *type_pointer = (void *)0; + SV *pointer; + + /* first check if pointer already created */ + if (!type_pointer) { + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); + if (pointer && SvOK(pointer)) { + type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); + } + } + + return (swig_module_info *) type_pointer; +} + +SWIGRUNTIME void +SWIG_Perl_SetModule(swig_module_info *module) { + SV *pointer; + + /* create a new pointer */ + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); + sv_setiv(pointer, PTR2IV(module)); +} + +#ifdef __cplusplus +} +#endif + +/* Workaround perl5 global namespace pollution. Note that undefining library + * functions like fopen will not solve the problem on all platforms as fopen + * might be a macro on Windows but not necessarily on other operating systems. */ +#ifdef do_open + #undef do_open +#endif +#ifdef do_close + #undef do_close +#endif +#ifdef scalar + #undef scalar +#endif +#ifdef list + #undef list +#endif +#ifdef apply + #undef apply +#endif +#ifdef convert + #undef convert +#endif +#ifdef Error + #undef Error +#endif +#ifdef form + #undef form +#endif +#ifdef vform + #undef vform +#endif +#ifdef LABEL + #undef LABEL +#endif +#ifdef METHOD + #undef METHOD +#endif +#ifdef Move + #undef Move +#endif +#ifdef yylex + #undef yylex +#endif +#ifdef yyparse + #undef yyparse +#endif +#ifdef yyerror + #undef yyerror +#endif +#ifdef invert + #undef invert +#endif +#ifdef ref + #undef ref +#endif +#ifdef read + #undef read +#endif +#ifdef write + #undef write +#endif +#ifdef eof + #undef eof +#endif +#ifdef bool + #undef bool +#endif +#ifdef close + #undef close +#endif +#ifdef rewind + #undef rewind +#endif +#ifdef free + #undef free +#endif +#ifdef malloc + #undef malloc +#endif +#ifdef calloc + #undef calloc +#endif +#ifdef Stat + #undef Stat +#endif +#ifdef check + #undef check +#endif +#ifdef seekdir + #undef seekdir +#endif +#ifdef open + #undef open +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_GSList swig_types[0] +#define SWIGTYPE_p_char swig_types[1] +#define SWIGTYPE_p_double swig_types[2] +#define SWIGTYPE_p_float swig_types[3] +#define SWIGTYPE_p_int swig_types[4] +#define SWIGTYPE_p_unsigned_char swig_types[5] +static swig_type_info *swig_types[7]; +static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_init boot_Amanda__Application + +#define SWIG_name "Amanda::Applicationc::boot_Amanda__Application" +#define SWIG_prefix "Amanda::Applicationc::" + +#define SWIGVERSION 0x010335 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#ifdef __cplusplus +extern "C" +#endif +#ifndef PERL_OBJECT +#ifndef MULTIPLICITY +SWIGEXPORT void SWIG_init (CV* cv); +#else +SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); +#endif +#else +SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); +#endif + + +#include "amglue.h" + + +#include "amglue.h" + + +#include "amglue.h" + + +#include "amanda.h" +#include "client_util.h" + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +{ + if (SvPOK(obj)) { + STRLEN len = 0; + char *cstr = SvPV(obj, len); + size_t size = len + 1; + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size)); + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + } + if (psize) *psize = size; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + char* vptr = 0; + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef PERL_OBJECT +#define MAGIC_CLASS _wrap_Amanda::Application_var:: +class _wrap_Amanda::Application_var : public CPerlObj { +public: +#else +#define MAGIC_CLASS +#endif +SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + croak("Value is read-only."); + return 0; +} + + +#ifdef PERL_OBJECT +}; +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +XS(_wrap_run_calcsize_C) { + { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + GSList *arg5 = (GSList *) 0 ; + char *arg6 = (char *) 0 ; + char *arg7 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int res6 ; + char *buf6 = 0 ; + int alloc6 = 0 ; + int res7 ; + char *buf7 = 0 ; + int alloc7 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 7) || (items > 7)) { + SWIG_croak("Usage: run_calcsize_C(config,program,disk,dirname,levels,file_exclude,file_include);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "run_calcsize_C" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "run_calcsize_C" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "run_calcsize_C" "', argument " "3"" of type '" "char *""'"); + } + arg3 = (char *)(buf3); + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "run_calcsize_C" "', argument " "4"" of type '" "char *""'"); + } + arg4 = (char *)(buf4); + { + AV *tempav; + GSList *level = NULL; + int num; + int i; + SV **tv; + + if (!SvROK(ST(4))) + croak("Argument 5 is not a reference."); + if (SvTYPE(SvRV(ST(4))) != SVt_PVAV) + croak("Argument 5 is not an array."); + tempav = (AV*)SvRV(ST(4)); + num = av_len(tempav); + for (i=0; i <= num; i++) { + tv = av_fetch(tempav, i, 0); + level = g_slist_append(level, GINT_TO_POINTER(SvIV(*tv))); + } + arg5 = level; + } + res6 = SWIG_AsCharPtrAndSize(ST(5), &buf6, NULL, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "run_calcsize_C" "', argument " "6"" of type '" "char *""'"); + } + arg6 = (char *)(buf6); + res7 = SWIG_AsCharPtrAndSize(ST(6), &buf7, NULL, &alloc7); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "run_calcsize_C" "', argument " "7"" of type '" "char *""'"); + } + arg7 = (char *)(buf7); + run_calcsize(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + { + if(arg5) + g_slist_free(arg5); + } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + if (alloc7 == SWIG_NEWOBJ) free((char*)buf7); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); + if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + { + if(arg5) + g_slist_free(arg5); + } + if (alloc6 == SWIG_NEWOBJ) free((char*)buf6); + if (alloc7 == SWIG_NEWOBJ) free((char*)buf7); + SWIG_croak_null(); + } +} + + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_GSList, + &_swigt__p_char, + &_swigt__p_double, + &_swigt__p_float, + &_swigt__p_int, + &_swigt__p_unsigned_char, +}; + +static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_GSList, + _swigc__p_char, + _swigc__p_double, + _swigc__p_float, + _swigc__p_int, + _swigc__p_unsigned_char, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_constant_info swig_constants[] = { +{0,0,0,0,0,0} +}; +#ifdef __cplusplus +} +#endif +static swig_variable_info swig_variables[] = { +{0,0,0,0} +}; +static swig_command_info swig_commands[] = { +{"Amanda::Applicationc::run_calcsize_C", _wrap_run_calcsize_C}, +{0,0} +}; +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" +#endif + +XS(SWIG_init) { + dXSARGS; + int i; + + SWIG_InitializeModule(0); + + /* Install commands */ + for (i = 0; swig_commands[i].name; i++) { + newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + } + + /* Install variables */ + for (i = 0; swig_variables[i].name; i++) { + SV *sv; + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + if (swig_variables[i].type) { + SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); + } else { + sv_setiv(sv,(IV) 0); + } + swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + } + + /* Install constant */ + for (i = 0; swig_constants[i].type; i++) { + SV *sv; + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + switch(swig_constants[i].type) { + case SWIG_INT: + sv_setiv(sv, (IV) swig_constants[i].lvalue); + break; + case SWIG_FLOAT: + sv_setnv(sv, (double) swig_constants[i].dvalue); + break; + case SWIG_STRING: + sv_setpv(sv, (char *) swig_constants[i].pvalue); + break; + case SWIG_POINTER: + SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); + break; + case SWIG_BINARY: + SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); + break; + default: + break; + } + SvREADONLY_on(sv); + } + + ST(0) = &PL_sv_yes; + XSRETURN(1); +} + diff --git a/perl/Amanda/Application.pm b/perl/Amanda/Application.pm new file mode 100644 index 0000000..9fa02a0 --- /dev/null +++ b/perl/Amanda/Application.pm @@ -0,0 +1,126 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.35 +# +# Don't modify this file, modify the SWIG interface instead. + +package Amanda::Application; +require Exporter; +require DynaLoader; +@ISA = qw(Exporter DynaLoader); +package Amanda::Applicationc; +bootstrap Amanda::Application; +package Amanda::Application; +@EXPORT = qw( ); + +# ---------- BASE METHODS ------------- + +package Amanda::Application; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + $self->$member_func(); +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + $self->$member_func($newval); +} + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package Amanda::Application; + +*run_calcsize_C = *Amanda::Applicationc::run_calcsize_C; + +# ------- VARIABLE STUBS -------- + +package Amanda::Application; + + +@EXPORT_OK = (); +%EXPORT_TAGS = (); + +push @ISA, qw(Amanda::Script_App); +require Amanda::Script_App; + +use strict; +use warnings; + +=head1 NAME + +Amanda::Application - perl utility functions for Applications. + +=head1 SYNOPSIS + + package Amanda::Application::my_application; + use base qw(Amanda::Application); + + sub new { + my $class = shift; + my ($foo, $bar) = @_; + my $self = $class->SUPER::new(); + + $self->{'foo'} = $foo; + $self->{'bar'} = $bar; + + return $self; + } + + # Define all command_* subs that you need, e.g., + sub command_support { + my $self = shift; + # ... + } + + package main; + + # .. parse arguments .. + + my $application = Amanda::Application::my_application->new($opt_foo, $opt_bar); + $application->do($cmd); + +=cut + +sub new { + my $class = shift; + + my $self = Amanda::Script_App::new($class, "client", "application", @_); + + $self->{known_commands} = { + support => 1, + selfcheck => 1, + estimate => 1, + backup => 1, + restore => 1, + validate => 1, + }; + return $self; +} + +sub run_calcsize { + my $self = shift; + my $program = shift; + + run_calcsize_C($self->{config}, $program, $self->{disk}, $self->{device}, $self->{level}, undef, undef); + +} +1; diff --git a/perl/Amanda/Application.swg b/perl/Amanda/Application.swg new file mode 100644 index 0000000..471cc33 --- /dev/null +++ b/perl/Amanda/Application.swg @@ -0,0 +1,131 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +%module "Amanda::Application" +%include "amglue/amglue.swg" +%include "exception.i" +%include "cstring.i" + +%perlcode %{ +push @ISA, qw(Amanda::Script_App); +require Amanda::Script_App; + +use strict; +use warnings; + +=head1 NAME + +Amanda::Application - perl utility functions for Applications. + +=head1 SYNOPSIS + + package Amanda::Application::my_application; + use base qw(Amanda::Application); + + sub new { + my $class = shift; + my ($foo, $bar) = @_; + my $self = $class->SUPER::new(); + + $self->{'foo'} = $foo; + $self->{'bar'} = $bar; + + return $self; + } + + # Define all command_* subs that you need, e.g., + sub command_support { + my $self = shift; + # ... + } + + package main; + + # .. parse arguments .. + + my $application = Amanda::Application::my_application->new($opt_foo, $opt_bar); + $application->do($cmd); + +=cut + +sub new { + my $class = shift; + + my $self = Amanda::Script_App::new($class, "client", "application", @_); + + $self->{known_commands} = { + support => 1, + selfcheck => 1, + estimate => 1, + backup => 1, + restore => 1, + validate => 1, + }; + return $self; +} + +sub run_calcsize { + my $self = shift; + my $program = shift; + + run_calcsize_C($self->{config}, $program, $self->{disk}, $self->{device}, $self->{level}, undef, undef); + +} +%} + +/* C interfaces used by the above */ + +%{ +#include "amanda.h" +#include "client_util.h" +%} + +%typemap(in) GSList *levels { + AV *tempav; + GSList *level = NULL; + int num; + int i; + SV **tv; + + if (!SvROK($input)) + croak("Argument $argnum is not a reference."); + if (SvTYPE(SvRV($input)) != SVt_PVAV) + croak("Argument $argnum is not an array."); + tempav = (AV*)SvRV($input); + num = av_len(tempav); + for (i=0; i <= num; i++) { + tv = av_fetch(tempav, i, 0); + level = g_slist_append(level, GINT_TO_POINTER(SvIV(*tv))); + } + $1 = level; +} +/* free the list */ +%typemap(freearg) GSList *levels { + if($1) + g_slist_free($1); +} + +%rename(run_calcsize_C) run_calcsize; +void +run_calcsize(char *config, char *program, char *disk, char *dirname, + GSList *levels, char *file_exclude, char *file_include); + +%typemap(in) GSList *levels; +%typemap(freearg) GSList *levels; diff --git a/perl/Amanda/Application/Zfs.pm b/perl/Amanda/Application/Zfs.pm new file mode 100644 index 0000000..8c7e716 --- /dev/null +++ b/perl/Amanda/Application/Zfs.pm @@ -0,0 +1,394 @@ +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::Application::Zfs; + +use strict; +use warnings; +use Symbol; +use IPC::Open3; +use Amanda::Debug qw( :logging ); + +=head1 NAME + +Amanda::Application::Zfs -- collection of function to use with zfs + +=head1 SYNOPSIS + +=head1 INTERFACE + +=cut + +sub zfs_set_value { + my $self = shift; + + my $action = $_[0]; + + if (defined $self->{execute_where} && $self->{execute_where} ne "client") { + $self->print_to_server_and_die($action, " Script must be run on the client 'execute_where client'", $Amanda::Script_App::ERROR); + } + if (!defined $self->{device}) { + $self->print_to_server_and_die($action, "'--device' is not provided", + $Amanda::Script_App::ERROR); + } + if ($self->{df_path} ne "df" && !-e $self->{df_path}) { + $self->print_to_server_and_die($action, "Can't execute DF-PATH '$self->{df_path}' command", + $Amanda::Script_App::ERROR); + } + if ($self->{zfs_path} ne "zfs" && !-e $self->{zfs_path}) { + $self->print_to_server_and_die($action, "Can't execute ZFS-PATH '$self->{zfs_path}' command", + $Amanda::Script_App::ERROR); + } + + if ($self->{pfexec} =~ /^YES$/i) { + $self->{pfexec_cmd} = $self->{pfexec_path}; + } + if (defined $self->{pfexec_cmd} && $self->{pfexec_cmd} ne "pfexec" && !-e $self->{pfexec_cmd}) { + $self->print_to_server_and_die($action, "Can't execute PFEXEC-PATH '$self->{pfexec_cmd}' command", + $Amanda::Script_App::ERROR); + } + if (!defined $self->{pfexec_cmd}) { + $self->{pfexec_cmd} = ""; + } + + # determine if $self->{device} is a mountpoint or ZFS dataset + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} get -H -o value mountpoint $self->{device}"; + debug "running: $cmd"; + my($wtr, $rdr, $err, $pid); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + my $zmountpoint = <$rdr>; + waitpid $pid, 0; + close $rdr; + close $err; + + if ($? == 0) { + chomp $zmountpoint; + + # zfs dataset supplied + $self->{filesystem} = $self->{device}; + + # check if zfs volume + if ($zmountpoint ne '-') { + $self->{mountpoint} = $zmountpoint; + } else { + $self->{mountpoint} = undef; + } + } else { + # filesystem, directory or invalid ZFS dataset name + $cmd = "$self->{df_path} $self->{device}"; + debug "running: $self->{df_path} $self->{device}"; + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + my @ret; + while (<$rdr>) { + chomp; + push @ret,$_; + } + my $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + + if ($? != 0) { + my $ret = $ret[0]; + # invalid filesystem of ZFS dataset name + if (defined $errmsg) { + chomp $errmsg; + } + if (defined $ret && defined $errmsg) { + $self->print_to_server_and_die($action, "$ret, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $ret) { + $self->print_to_server_and_die($action, $ret, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, + "Failed to find mount points: $self->{device}", + $Amanda::Script_App::ERROR); + } + } + + my $size = @ret; + if ($size eq 1) { + # Solaris type df + @ret = split /:/, $ret[0]; + if ($ret[0] =~ /(\S*)(\s*)(\()(\S*)(\s*)(\))$/) { + $self->{mountpoint} = $1; + $self->{filesystem} = $4; + } else { + $self->print_to_server_and_die($action, + "Failed to find mount points: $self->{device}", + $Amanda::Script_App::ERROR); + } + } else { + # FreeBSD type df with header + if ($ret[1] =~ /^(\S+)(\s+)((\S+)(\s+))+(\S+)(\s*)$/) { + $self->{mountpoint} = $6; + $self->{filesystem} = $1; + } else { + $self->print_to_server_and_die($action, + "Failed to find mount points: $self->{device}", + $Amanda::Script_App::ERROR); + } + } + + $cmd = "$self->{pfexec_cmd} $self->{zfs_path} get -H -o value mountpoint $self->{filesystem}"; + debug "running: $cmd|"; + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + $zmountpoint = <$rdr>; + chomp $zmountpoint; + $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + + if ($? != 0) { + if (defined $errmsg) { + chomp $errmsg; + } + if (defined $zmountpoint && defined $errmsg) { + $self->print_to_server_and_die($action, $zmountpoint, $errmsg, $Amanda::Script_App::ERROR); + } elsif (defined $zmountpoint) { + $self->print_to_server_and_die($action, $zmountpoint, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, + "Failed to find mount points: $self->{filesystem}", + $Amanda::Script_App::ERROR); + } + } + if ($zmountpoint ne 'legacy' && $zmountpoint ne $self->{mountpoint}) { + $self->print_to_server_and_die($action, + "mountpoint from 'df' ($self->{mountpoint}) and 'zfs list' ($zmountpoint) differ", + $Amanda::Script_App::ERROR); + } + + if (!($self->{device} =~ /^$self->{mountpoint}/)) { + $self->print_to_server_and_die($action, + "mountpoint '$self->{mountpoint}' is not a prefix of diskdevice '$self->{device}'", + $Amanda::Script_App::ERROR); + } + + } + + if ($action eq 'check') { + $self->{snapshot} = $self->zfs_build_snapshotname($self->{device}, -1); + } else { + $self->{snapshot} = $self->zfs_build_snapshotname($self->{device}); + } + if (defined $self->{mountpoint}) { + if ($self->{device} =~ /^$self->{mountpoint}/) { + $self->{dir} = $self->{device}; + $self->{dir} =~ s,^$self->{mountpoint},,; + $self->{directory} = $self->{mountpoint} . "/.zfs/snapshot/" . + $self->{snapshot} . $self->{dir}; + } else { # device is not the mountpoint + $self->{directory} = $self->{mountpoint} . "/.zfs/snapshot/" . + $self->{snapshot}; + } + } +} + +sub zfs_create_snapshot { + my $self = shift; + my $action = shift; + + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} snapshot $self->{filesystem}\@$self->{snapshot}"; + debug "running: $cmd"; + my($wtr, $rdr, $err, $pid); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + my ($msg) = <$rdr>; + my ($errmsg) = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if( $? != 0 ) { + if(defined $msg && defined $errmsg) { + $self->print_to_server_and_die($action, "$msg, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $msg) { + $self->print_to_server_and_die($action, $msg, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, "cannot create snapshot '$self->{filesystem}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } +} + +sub zfs_destroy_snapshot { + my $self = shift; + my $action = shift; + + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} destroy $self->{filesystem}\@$self->{snapshot}"; + debug "running: $cmd|"; + my($wtr, $rdr, $err, $pid); + my($msg, $errmsg); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + $msg = <$rdr>; + $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if( $? != 0 ) { + if(defined $msg && defined $errmsg) { + $self->print_to_server_and_die($action, "$msg, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $msg) { + $self->print_to_server_and_die($action, $msg, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, "cannot destroy snapshot '$self->{filesystem}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } +} + +sub zfs_destroy_snapshot_level { + my $self = shift; + my $level = shift; + my $action = shift; + + my $snapshotname = $self->zfs_find_snapshot_level($level); + debug "zfs_destroy_snapshot_level: Current $snapshotname"; + if ($snapshotname ne "") { + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} destroy $self->{filesystem}\@$snapshotname"; + debug "running: $cmd|"; + my($wtr, $rdr, $err, $pid); + my($msg, $errmsg); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + $msg = <$rdr>; + $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if( $? != 0 ) { + if(defined $msg && defined $errmsg) { + $self->print_to_server_and_die($action, "$msg, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $msg) { + $self->print_to_server_and_die($action, $msg, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, "cannot destroy snapshot '$self->{filesystem}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } + } +} + +sub zfs_rename_snapshot { + my $self = shift; + my $level = shift; + my $action = shift; + + my $newsnapshotname = $self->zfs_build_snapshotname($self->{device}, $level); + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} rename $self->{filesystem}\@$self->{snapshot} $newsnapshotname"; + debug "running: $cmd|"; + my($wtr, $rdr, $err, $pid); + my($msg, $errmsg); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + $msg = <$rdr>; + $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if( $? != 0 ) { + if(defined $msg && defined $errmsg) { + $self->print_to_server_and_die($action, "$msg, $errmsg", $Amanda::Script_App::ERROR); + } elsif (defined $msg) { + $self->print_to_server_and_die($action, $msg, $Amanda::Script_App::ERROR); + } elsif (defined $errmsg) { + $self->print_to_server_and_die($action, $errmsg, $Amanda::Script_App::ERROR); + } else { + $self->print_to_server_and_die($action, "cannot rename snapshot '$self->{filesystem}\@$self->{snapshot}': unknown reason", $Amanda::Script_App::ERROR); + } + } +} + +sub zfs_purge_snapshot { + my $self = shift; + my $minlevel = shift; + my $maxlevel = shift; + my $action = shift; + + my $level; + for ($level = $maxlevel; $level >= $minlevel; $level--) { + debug "zfs_purge_snapshot: Check for existing snapshot at level $level"; + $self->zfs_destroy_snapshot_level($level, $action); + } +} + +sub zfs_find_snapshot_level { + my $self = shift; + my $level = shift; + my $action = shift; + + my $snapshotname = $self->zfs_build_snapshotname($self->{device}, $level); + + my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} list -t snapshot $self->{filesystem}\@$snapshotname"; + debug "running: $cmd|"; + my($wtr, $rdr, $err, $pid); + my($msg, $errmsg); + $err = Symbol::gensym; + $pid = open3($wtr, $rdr, $err, $cmd); + close $wtr; + $msg = <$rdr>; + $errmsg = <$err>; + waitpid $pid, 0; + close $rdr; + close $err; + if( $? != 0 ) { + return ""; + } + return $snapshotname; +} + +sub zfs_build_snapshotname { + my $self = shift; + my $device = shift; + my $level = shift; + my $action = shift; + + my $snapshotname = ""; + + if (!defined $level) { + $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($device) . "-current"; + } else { + if ($level < 0) { + $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($device) . "-check"; + } else { + $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($device) . "-" . $level; + } + } + + return $snapshotname; +} + +1; diff --git a/perl/Amanda/Archive.c b/perl/Amanda/Archive.c new file mode 100644 index 0000000..feec4de --- /dev/null +++ b/perl/Amanda/Archive.c @@ -0,0 +1,2874 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPERL +#define SWIG_CASTRANK_MODE +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic CAPI SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the swig runtime code. + In 99.9% of the cases, swig just needs to declare them as 'static'. + + But only do this if is strictly necessary, ie, if you have problems + with your compiler or so. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The swig conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old swig versions, you usually write code as: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit as: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + that seems to be the same, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + requires also to SWIG_ConvertPtr to return new result values, as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + swig errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() + + + */ +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* think of this as a c++ template<> or a scheme macro */ +#define SWIG_TypeCheck_Template(comparison, ty) \ + if (ty) { \ + swig_cast_info *iter = ty->cast; \ + while (iter) { \ + if (comparison) { \ + if (iter == ty->cast) return iter; \ + /* Move iter to the top of the linked list */ \ + iter->prev->next = iter->next; \ + if (iter->next) \ + iter->next->prev = iter->prev; \ + iter->next = ty->cast; \ + iter->prev = 0; \ + if (ty->cast) ty->cast->prev = iter; \ + ty->cast = iter; \ + return iter; \ + } \ + iter = iter->next; \ + } \ + } \ + return 0 + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +} + +/* Same as previous function, except strcmp is replaced with a pointer comparison */ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { + SWIG_TypeCheck_Template(iter->type == from, into); +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ + +/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ +#ifndef PERL_REVISION +# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) +# define PERL_PATCHLEVEL_H_IMPLICIT +# include +# endif +# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) +# include +# endif +# ifndef PERL_REVISION +# define PERL_REVISION (5) +# define PERL_VERSION PATCHLEVEL +# define PERL_SUBVERSION SUBVERSION +# endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +#ifndef SvIOK_UV +# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) +#endif + +#ifndef SvUOK +# define SvUOK(sv) SvIOK_UV(sv) +#endif + +#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) +# define PL_sv_undef sv_undef +# define PL_na na +# define PL_errgv errgv +# define PL_sv_no sv_no +# define PL_sv_yes sv_yes +# define PL_markstack_ptr markstack_ptr +#endif + +#ifndef IVSIZE +# ifdef LONGSIZE +# define IVSIZE LONGSIZE +# else +# define IVSIZE 4 /* A bold guess, but the best we can make. */ +# endif +#endif + +#ifndef INT2PTR +# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +# define PTRV UV +# define INT2PTR(any,d) (any)(d) +# else +# if PTRSIZE == LONGSIZE +# define PTRV unsigned long +# else +# define PTRV unsigned +# endif +# define INT2PTR(any,d) (any)(PTRV)(d) +# endif + +# define NUM2PTR(any,d) (any)(PTRV)(d) +# define PTR2IV(p) INT2PTR(IV,p) +# define PTR2UV(p) INT2PTR(UV,p) +# define PTR2NV(p) NUM2PTR(NV,p) + +# if PTRSIZE == LONGSIZE +# define PTR2ul(p) (unsigned long)(p) +# else +# define PTR2ul(p) INT2PTR(unsigned long,p) +# endif +#endif /* !INT2PTR */ + +#ifndef SvPV_nolen +# define SvPV_nolen(x) SvPV(x,PL_na) +#endif + +#ifndef get_sv +# define get_sv perl_get_sv +#endif + +#ifndef ERRSV +# define ERRSV get_sv("@",FALSE) +#endif + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGINTERN const char* +SWIG_Perl_ErrorType(int code) { + const char* type = 0; + switch(code) { + case SWIG_MemoryError: + type = "MemoryError"; + break; + case SWIG_IOError: + type = "IOError"; + break; + case SWIG_RuntimeError: + type = "RuntimeError"; + break; + case SWIG_IndexError: + type = "IndexError"; + break; + case SWIG_TypeError: + type = "TypeError"; + break; + case SWIG_DivisionByZero: + type = "ZeroDivisionError"; + break; + case SWIG_OverflowError: + type = "OverflowError"; + break; + case SWIG_SyntaxError: + type = "SyntaxError"; + break; + case SWIG_ValueError: + type = "ValueError"; + break; + case SWIG_SystemError: + type = "SystemError"; + break; + case SWIG_AttributeError: + type = "AttributeError"; + break; + default: + type = "RuntimeError"; + } + return type; +} + + + + +/* ----------------------------------------------------------------------------- + * perlrun.swg + * + * This file contains the runtime support for Perl modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef PERL_OBJECT +#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), +#define SWIG_PERL_OBJECT_CALL pPerl, +#else +#define SWIG_PERL_OBJECT_DECL +#define SWIG_PERL_OBJECT_CALL +#endif + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) +#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) + + +/* Error manipulation */ + +#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) +#define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + +/* Perl-specific SWIG API */ + +#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) +#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) +#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) + + +#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) +#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) +#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) +#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +/* For backward compatibility only */ +#define SWIG_POINTER_EXCEPTION 0 + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_OWNER SWIG_POINTER_OWN +#define SWIG_SHADOW SWIG_OWNER << 1 + +#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL + +/* SWIG Perl macros */ + +/* Macro to declare an XS function */ +#ifndef XSPROTO +# define XSPROTO(name) void name(pTHX_ CV* cv) +#endif + +/* Macro to call an XS function */ +#ifdef PERL_OBJECT +# define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +# ifndef MULTIPLICITY +# define SWIG_CALLXS(_name) _name(cv) +# else +# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +# endif +#endif + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC + +#else /* PERL_OBJECT */ + +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static SWIGUNUSED + +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#else /* MULTIPLICITY */ + +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif /* MULTIPLICITY */ +#endif /* PERL_OBJECT */ + +/* Workaround for bug in perl 5.6.x croak and earlier */ +#if (PERL_VERSION < 8) +# ifdef PERL_OBJECT +# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) +static void SWIG_Perl_croak_null(CPerlObj *pPerl) +# else +static void SWIG_croak_null() +# endif +{ + SV *err=ERRSV; +# if (PERL_VERSION < 6) + croak("%_", err); +# else + if (SvOK(err) && !SvROK(err)) croak("%_", err); + croak(Nullch); +# endif +} +#else +# define SWIG_croak_null() croak(Nullch) +#endif + + +/* + Define how strict is the cast between strings and integers/doubles + when overloading between these types occurs. + + The default is making it as strict as possible by using SWIG_AddCast + when needed. + + You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to + disable the SWIG_AddCast, making the casting between string and + numbers less strict. + + In the end, we try to solve the overloading between strings and + numerical types in the more natural way, but if you can avoid it, + well, avoid it using %rename, for example. +*/ +#ifndef SWIG_PERL_NO_STRICT_STR2NUM +# ifndef SWIG_PERL_STRICT_STR2NUM +# define SWIG_PERL_STRICT_STR2NUM +# endif +#endif +#ifdef SWIG_PERL_STRICT_STR2NUM +/* string takes precedence */ +#define SWIG_Str2NumCast(x) SWIG_AddCast(x) +#else +/* number takes precedence */ +#define SWIG_Str2NumCast(x) x +#endif + + + +#include + +SWIGRUNTIME const char * +SWIG_Perl_TypeProxyName(const swig_type_info *type) { + if (!type) return NULL; + if (type->clientdata != NULL) { + return (const char*) type->clientdata; + } + else { + return type->name; + } +} + +SWIGRUNTIME swig_cast_info * +SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) + || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); +} + + +/* Function for getting a pointer value */ + +SWIGRUNTIME int +SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { + swig_cast_info *tc; + void *voidptr = (void *)0; + SV *tsv = 0; + /* If magical, apply more magic */ + if (SvGMAGICAL(sv)) + mg_get(sv); + + /* Check to see if this is an object */ + if (sv_isobject(sv)) { + IV tmp = 0; + tsv = (SV*) SvRV(sv); + if ((SvTYPE(tsv) == SVt_PVHV)) { + MAGIC *mg; + if (SvMAGICAL(tsv)) { + mg = mg_find(tsv,'P'); + if (mg) { + sv = mg->mg_obj; + if (sv_isobject(sv)) { + tsv = (SV*)SvRV(sv); + tmp = SvIV(tsv); + } + } + } else { + return SWIG_ERROR; + } + } else { + tmp = SvIV(tsv); + } + voidptr = INT2PTR(void *,tmp); + } else if (! SvOK(sv)) { /* Check for undef */ + *(ptr) = (void *) 0; + return SWIG_OK; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + if (!SvROK(sv)) { + *(ptr) = (void *) 0; + return SWIG_OK; + } else { + return SWIG_ERROR; + } + } else { /* Don't know what it is */ + return SWIG_ERROR; + } + if (_t) { + /* Now see if the types match */ + char *_c = HvNAME(SvSTASH(SvRV(sv))); + tc = SWIG_TypeProxyCheck(_c,_t); + if (!tc) { + return SWIG_ERROR; + } + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } + } else { + *ptr = voidptr; + } + + /* + * DISOWN implementation: we need a perl guru to check this one. + */ + if (tsv && (flags & SWIG_POINTER_DISOWN)) { + /* + * almost copy paste code from below SWIG_POINTER_OWN setting + */ + SV *obj = sv; + HV *stash = SvSTASH(SvRV(obj)); + GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE); + if (isGV(gv)) { + HV *hv = GvHVn(gv); + /* + * To set ownership (see below), a newSViv(1) entry is added. + * Hence, to remove ownership, we delete the entry. + */ + if (hv_exists_ent(hv, obj, 0)) { + hv_delete_ent(hv, obj, 0, 0); + } + } + } + return SWIG_OK; +} + +SWIGRUNTIME void +SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { + if (ptr && (flags & SWIG_SHADOW)) { + SV *self; + SV *obj=newSV(0); + HV *hash=newHV(); + HV *stash; + sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr); + stash=SvSTASH(SvRV(obj)); + if (flags & SWIG_POINTER_OWN) { + HV *hv; + GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE); + if (!isGV(gv)) + gv_init(gv, stash, "OWNER", 5, FALSE); + hv=GvHVn(gv); + hv_store_ent(hv, obj, newSViv(1), 0); + } + sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); + SvREFCNT_dec(obj); + self=newRV_noinc((SV *)hash); + sv_setsv(sv, self); + SvREFCNT_dec((SV *)self); + sv_bless(sv, stash); + } + else { + sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr); + } +} + +SWIGRUNTIMEINLINE SV * +SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { + SV *result = sv_newmortal(); + SWIG_MakePtr(result, ptr, t, flags); + return result; +} + +SWIGRUNTIME void +SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { + char result[1024]; + char *r = result; + if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + strcpy(r,SWIG_Perl_TypeProxyName(type)); + sv_setpv(sv, result); +} + +SWIGRUNTIME SV * +SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { + SV *result = sv_newmortal(); + SWIG_Perl_MakePackedObj(result, ptr, sz, type); + return result; +} + +/* Convert a packed value value */ +SWIGRUNTIME int +SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { + swig_cast_info *tc; + const char *c = 0; + + if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; + c = SvPV_nolen(obj); + /* Pointer values must start with leading underscore */ + if (*c != '_') return SWIG_ERROR; + c++; + c = SWIG_UnpackData(c,ptr,sz); + if (ty) { + tc = SWIG_TypeCheck(c,ty); + if (!tc) return SWIG_ERROR; + } + return SWIG_OK; +} + + +/* Macros for low-level exception handling */ +#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } + + +typedef XSPROTO(SwigPerlWrapper); +typedef SwigPerlWrapper *SwigPerlWrapperPtr; + +/* Structure for command table */ +typedef struct { + const char *name; + SwigPerlWrapperPtr wrapper; +} swig_command_info; + +/* Information for constant table */ + +#define SWIG_INT 1 +#define SWIG_FLOAT 2 +#define SWIG_STRING 3 +#define SWIG_POINTER 4 +#define SWIG_BINARY 5 + +/* Constant information structure */ +typedef struct swig_constant_info { + int type; + const char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_constant_info; + + +/* Structure for variable table */ +typedef struct { + const char *name; + SwigMagicFunc set; + SwigMagicFunc get; + swig_type_info **type; +} swig_variable_info; + +/* Magic variable code */ +#ifndef PERL_OBJECT +#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) + #ifndef MULTIPLICITY + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) + #else + SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) + #endif +#else +# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) +SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) +#endif +{ + MAGIC *mg; + sv_magic(sv,sv,'U',(char *) name,strlen(name)); + mg = mg_find(sv,'U'); + mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); + mg->mg_virtual->svt_get = (SwigMagicFunc) get; + mg->mg_virtual->svt_set = (SwigMagicFunc) set; + mg->mg_virtual->svt_len = 0; + mg->mg_virtual->svt_clear = 0; + mg->mg_virtual->svt_free = 0; +} + + +SWIGRUNTIME swig_module_info * +SWIG_Perl_GetModule(void) { + static void *type_pointer = (void *)0; + SV *pointer; + + /* first check if pointer already created */ + if (!type_pointer) { + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); + if (pointer && SvOK(pointer)) { + type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); + } + } + + return (swig_module_info *) type_pointer; +} + +SWIGRUNTIME void +SWIG_Perl_SetModule(swig_module_info *module) { + SV *pointer; + + /* create a new pointer */ + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); + sv_setiv(pointer, PTR2IV(module)); +} + +#ifdef __cplusplus +} +#endif + +/* Workaround perl5 global namespace pollution. Note that undefining library + * functions like fopen will not solve the problem on all platforms as fopen + * might be a macro on Windows but not necessarily on other operating systems. */ +#ifdef do_open + #undef do_open +#endif +#ifdef do_close + #undef do_close +#endif +#ifdef scalar + #undef scalar +#endif +#ifdef list + #undef list +#endif +#ifdef apply + #undef apply +#endif +#ifdef convert + #undef convert +#endif +#ifdef Error + #undef Error +#endif +#ifdef form + #undef form +#endif +#ifdef vform + #undef vform +#endif +#ifdef LABEL + #undef LABEL +#endif +#ifdef METHOD + #undef METHOD +#endif +#ifdef Move + #undef Move +#endif +#ifdef yylex + #undef yylex +#endif +#ifdef yyparse + #undef yyparse +#endif +#ifdef yyerror + #undef yyerror +#endif +#ifdef invert + #undef invert +#endif +#ifdef ref + #undef ref +#endif +#ifdef read + #undef read +#endif +#ifdef write + #undef write +#endif +#ifdef eof + #undef eof +#endif +#ifdef bool + #undef bool +#endif +#ifdef close + #undef close +#endif +#ifdef rewind + #undef rewind +#endif +#ifdef free + #undef free +#endif +#ifdef malloc + #undef malloc +#endif +#ifdef calloc + #undef calloc +#endif +#ifdef Stat + #undef Stat +#endif +#ifdef check + #undef check +#endif +#ifdef seekdir + #undef seekdir +#endif +#ifdef open + #undef open +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_amar_attr_t swig_types[0] +#define SWIGTYPE_p_amar_file_t swig_types[1] +#define SWIGTYPE_p_amar_t swig_types[2] +#define SWIGTYPE_p_char swig_types[3] +#define SWIGTYPE_p_double swig_types[4] +#define SWIGTYPE_p_float swig_types[5] +#define SWIGTYPE_p_gsize swig_types[6] +#define SWIGTYPE_p_guint16 swig_types[7] +#define SWIGTYPE_p_int swig_types[8] +#define SWIGTYPE_p_off_t swig_types[9] +#define SWIGTYPE_p_unsigned_char swig_types[10] +static swig_type_info *swig_types[12]; +static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_init boot_Amanda__Archive + +#define SWIG_name "Amanda::Archivec::boot_Amanda__Archive" +#define SWIG_prefix "Amanda::Archivec::" + +#define SWIGVERSION 0x010335 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#ifdef __cplusplus +extern "C" +#endif +#ifndef PERL_OBJECT +#ifndef MULTIPLICITY +SWIGEXPORT void SWIG_init (CV* cv); +#else +SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); +#endif +#else +SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); +#endif + + +#include "amglue.h" + + +#include "amglue.h" + + +#include "amglue.h" + + +#include "amar.h" + + +/* Support code (not directly available from perl) */ + +/* A C object to contain all of the relevant callbacks and other state during a + * read operation; this becomes the user_data during the read */ +typedef struct perl_read_data_s { + SV *user_data; + SV *file_start_sub; + SV *file_finish_sub; + + amar_attr_handling_t *handling_array; +} perl_read_data_t; + +static gboolean +read_start_file_cb( + gpointer user_data, + uint16_t filenum, + gpointer filename, + gsize filename_len, + gboolean *ignore, + gpointer *file_data) +{ + dSP; + perl_read_data_t *dat = user_data; + SV *rv = NULL; + STRLEN len; + int count; + + *file_data = NULL; + + g_assert(dat->file_start_sub != NULL); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(dat->user_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs(sv_2mortal(newSVpvn(filename, filename_len))); + PUTBACK; + + count = call_sv(dat->file_start_sub, G_EVAL|G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak("file_start_sub returned nothing"); + + rv = POPs; + + /* if it's the string "IGNORE", then ignore it */ + if (SvPOK(rv)) { + static const char *ign = "IGNORE"; + char *rvstr = SvPV(rv, len); + if (strlen(ign) == len && 0 == strncmp(ign, rvstr, len)) + *ignore = TRUE; + } + + /* otherwise, keep the value */ + if (!*ignore) + *(SV **)(file_data) = SvREFCNT_inc(rv); + + PUTBACK; + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static gboolean +read_finish_file_cb( + gpointer user_data, + uint16_t filenum, + gpointer *file_data, + gboolean truncated) +{ + dSP; + perl_read_data_t *dat = user_data; + + g_assert(dat->file_finish_sub != NULL); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); XPUSHs(dat->user_data); XPUSHs(*(SV **)file_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs(sv_2mortal(newSViv(truncated))); PUTBACK; + + call_sv(dat->file_finish_sub, G_EVAL|G_DISCARD); + + /* we're done with this file's file_data */ + SvREFCNT_dec(*(SV **)file_data); + + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static gboolean +read_frag_cb( + gpointer user_data, + uint16_t filenum, + gpointer file_data, + uint16_t attrid, + gpointer attrid_data, + gpointer *attr_data, + gpointer data, + gsize size, + gboolean eoa, + gboolean truncated) +{ + dSP; + perl_read_data_t *dat = user_data; + SV *rv; + int count; + + if (!attrid_data) + return TRUE; + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(dat->user_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs((SV *)file_data); + XPUSHs(sv_2mortal(newSViv(attrid))); + if (*attr_data) + XPUSHs((SV *)(*attr_data)); + else + XPUSHs(&PL_sv_undef); + XPUSHs(sv_2mortal(newSVpvn(data, size))); + XPUSHs(sv_2mortal(newSViv(eoa))); + XPUSHs(sv_2mortal(newSViv(truncated))); + PUTBACK; + + count = call_sv(attrid_data, G_EVAL|G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak("fragment callback returned nothing"); + + rv = POPs; + + if (eoa) { + SvREFCNT_dec(*attr_data); + } else { + /* increment before decrement here, in case they're the same object */ + SvREFCNT_inc(rv); + SvREFCNT_dec(*attr_data); + *attr_data = rv; + } + + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static void +croak_gerror(GError **error) +{ + static char *errstr = NULL; + if (errstr) g_free(errstr); + errstr = g_strdup((*error)->message); + g_clear_error(error); + croak("Amanda archive: %s", errstr); +} + +/* generic function to recognize when a string+len represents a number and + * incidentally return the resulting value. Note that this does not handle + * negative numbers. */ +static gboolean +is_number(char *str, int len, int *result) +{ + char *end = str+len; + int r = 0; + + while (str < end) { + if (!g_ascii_isdigit(*str)) return FALSE; + r = r * 10 + (int)(*str - '0'); + if (r < 0) { + /* overflow */ + return FALSE; + } + str++; + } + + *result = r; + return TRUE; +} + + + + +/* Wrapper functions, mostly dealing with error handling */ + +amar_t *amar_new_(int fd, char *modestr) { + GError *error = NULL; + amar_t *rv; + int mode; + + if (strcmp(modestr, ">") == 0) + mode = O_WRONLY; + else if (strcmp(modestr, "<") == 0) + mode = O_RDONLY; + else + croak("mode must be '<' or '>'"); + + if ((rv = amar_new(fd, mode, &error))) { + return rv; + } + + croak_gerror(&error); + return NULL; +} + +void amar_close_(amar_t *arch) { + GError *error = NULL; + if (!amar_close(arch, &error)) + croak_gerror(&error); +} + +amar_file_t * +amar_new_file_(amar_t *arch, char *filename, gsize filename_len, off_t *want_position) { + GError *error = NULL; + amar_file_t *file; + g_assert(arch != NULL); + + file = amar_new_file(arch, filename, filename_len, want_position, &error); + if (file) + return file; + + croak_gerror(&error); + return NULL; +} + +void amar_file_close_(amar_file_t *file) { + GError *error = NULL; + if (!amar_file_close(file, &error)) + croak_gerror(&error); +} + +amar_attr_t * +amar_new_attr_(amar_file_t *file, guint16 attrid) { + GError *error = NULL; + amar_attr_t *attr; + + g_assert(file != NULL); + + attr = amar_new_attr(file, attrid, &error); + if (attr) + return attr; + + croak_gerror(&error); + return NULL; +} + +void amar_attr_close_(amar_attr_t *attr) { + GError *error = NULL; + if (!amar_attr_close(attr, &error)) + croak_gerror(&error); +} + +void amar_attr_add_data_buffer_(amar_attr_t *attr, char *buffer, gsize size, gboolean eoa) { + GError *error = NULL; + if (!amar_attr_add_data_buffer(attr, buffer, size, eoa, &error)) + croak_gerror(&error); +} + +size_t +amar_attr_add_data_fd_(amar_attr_t *attr, int fd, gboolean eoa) { + GError *error = NULL; + size_t rv = amar_attr_add_data_fd(attr, fd, eoa, &error); + if (rv < 0) + croak_gerror(&error); + return rv; +} + +/* reading */ + +void amar_read_(amar_t *archive, SV *params_hashref) { + perl_read_data_t *dat = g_new0(perl_read_data_t, 1); + GError *error = NULL; + gboolean success; + HV *params; + HE *param; + I32 len; + int maxhandlers; + int hdl_idx; + + /* make sure we got a hashref */ + if (!SvROK(params_hashref) || SvTYPE(SvRV(params_hashref)) != SVt_PVHV) + croak("read() expects a single hashref"); + params = (HV *)SvRV(params_hashref); + len = hv_iterinit(params); + + maxhandlers = hdl_idx = len; + dat->handling_array = g_new0(amar_attr_handling_t, len+1); + + /* loop through the parameters */ + while ((param = hv_iternext(params))) { + I32 keylen; + char *key = hv_iterkey(param, &keylen); + int attrid; + + /* if it's a number, it's handling information for an attrid */ + if (is_number(key, keylen, &attrid)) { + SV *val = hv_iterval(params, param); + SV *coderef; + UV bufsize = 0; + int i; + + if (!SvROK(val)) goto croak_hdl; + + switch (SvTYPE(SvRV(val))) { + case SVt_PVCV: + coderef = val; + break; + + case SVt_PVAV: { + AV *arr = (AV *)SvRV(val); + SV **svp; + + if (av_len(arr) != 1) /* av_len == largest index, not length */ + goto croak_hdl; + + /* get the bufsize */ + svp = av_fetch(arr, 0, 0); + if (!SvIOK(*svp)) + goto croak_hdl; + bufsize = SvUV(*svp); + + /* and the coderef */ + svp = av_fetch(arr, 1, 0); + if (!SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVCV) + goto croak_hdl; + coderef = *svp; + break; + } + + default: + goto croak_hdl; + } + + /* fill in the handling array, putting attrid 0 at the end, and + * filling in entries backward from there */ + i = (attrid == 0)? maxhandlers : --hdl_idx; + dat->handling_array[i].attrid = attrid; + dat->handling_array[i].min_size = bufsize; + dat->handling_array[i].callback = read_frag_cb; + dat->handling_array[i].attrid_data = coderef; + SvREFCNT_inc(coderef); + continue; + + croak_hdl: + croak("Expected CODEREF or [ MIN_SIZE, CODEREF ] for attrid %d", attrid); + } + +#define key_compare(key, val, keylen) \ + (keylen == sizeof(val)-1) && (0 == strncmp(key, val, keylen)) + + if (key_compare(key, "file_start", keylen)) { + SV *val = hv_iterval(params, param); + if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVCV) + croak("Expected a CODEREF for file_start"); + dat->file_start_sub = val; + SvREFCNT_inc(val); + continue; + } + + if (key_compare(key, "file_finish", keylen)) { + SV *val = hv_iterval(params, param); + if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVCV) + croak("Expected a CODEREF for file_finish"); + dat->file_finish_sub = val; + SvREFCNT_inc(val); + continue; + } + + if (key_compare(key, "user_data", keylen)) { + SV *val = hv_iterval(params, param); + dat->user_data = val; + SvREFCNT_inc(val); + continue; + } +#undef key_compare + croak("Invalid parameter named '%*s'", (int)keylen, key); + } + + if (!dat->user_data) + dat->user_data = &PL_sv_undef; + + success = amar_read(archive, dat, dat->handling_array + hdl_idx, + dat->file_start_sub? read_start_file_cb : NULL, + dat->file_finish_sub? read_finish_file_cb : NULL, + &error); + + /* now unreference and free everything we referenced earlier */ + if (dat->file_start_sub) + SvREFCNT_dec(dat->file_start_sub); + if (dat->file_finish_sub) + SvREFCNT_dec(dat->file_finish_sub); + if (dat->user_data && dat->user_data != &PL_sv_undef) + SvREFCNT_dec(dat->user_data); + + for (hdl_idx = 0; hdl_idx <= maxhandlers; hdl_idx++) { + if (dat->handling_array[hdl_idx].attrid_data) + SvREFCNT_dec(dat->handling_array[hdl_idx].attrid_data); + } + + g_free(dat->handling_array); + g_free(dat); + + /* if amar_read returned FALSE, then either we hit an internal + * error, or one of the perl callbacks raised an exception, and $@ + * is still set */ + if (!success) { + if (error) + croak_gerror(&error); + else + croak(NULL); + } +} + + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +{ + if (SvPOK(obj)) { + STRLEN len = 0; + char *cstr = SvPV(obj, len); + size_t size = len + 1; + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size)); + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + } + if (psize) *psize = size; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + char* vptr = 0; + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +#include +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) +{ + if (SvNIOK(obj)) { + if (val) *val = SvNV(obj); + return SWIG_OK; + } else if (SvIOK(obj)) { + if (val) *val = (double) SvIV(obj); + return SWIG_AddCast(SWIG_OK); + } else { + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + double v = strtod(nptr, &endptr); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + } + return SWIG_TypeError; +} + + +#include + + +#include + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) +{ + if (SvIOK(obj)) { + if (val) *val = SvIV(obj); + return SWIG_OK; + } else { + int dispatch = 0; + const char *nptr = SvPV_nolen(obj); + if (nptr) { + char *endptr; + long v; + errno = 0; + v = strtol(nptr, &endptr,0); + if (errno == ERANGE) { + errno = 0; + return SWIG_OverflowError; + } else { + if (*endptr == '\0') { + if (val) *val = v; + return SWIG_Str2NumCast(SWIG_OK); + } + } + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } + return SWIG_TypeError; +} + + +SWIGINTERN int +SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (int)(v); + } + } + return res; +} + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef PERL_OBJECT +#define MAGIC_CLASS _wrap_Amanda::Archive_var:: +class _wrap_Amanda::Archive_var : public CPerlObj { +public: +#else +#define MAGIC_CLASS +#endif +SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) { + MAGIC_PPERL + croak("Value is read-only."); + return 0; +} + + +#ifdef PERL_OBJECT +}; +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" { +#endif +XS(_wrap_amar_new) { + { + int arg1 ; + char *arg2 = (char *) 0 ; + amar_t *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: amar_new(fd,modestr);"); + } + { + if (sizeof(signed int) == 1) { + arg1 = amglue_SvI8(ST(0)); + } else if (sizeof(signed int) == 2) { + arg1 = amglue_SvI16(ST(0)); + } else if (sizeof(signed int) == 4) { + arg1 = amglue_SvI32(ST(0)); + } else if (sizeof(signed int) == 8) { + arg1 = amglue_SvI64(ST(0)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "amar_new" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + result = (amar_t *)amar_new_(arg1,arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_amar_t, 0 | 0); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_close) { + { + amar_t *arg1 = (amar_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: amar_close(arch);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_close" "', argument " "1"" of type '" "amar_t *""'"); + } + arg1 = (amar_t *)(argp1); + amar_close_(arg1); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_new_file) { + { + amar_t *arg1 = (amar_t *) 0 ; + char *arg2 = (char *) 0 ; + gsize arg3 ; + off_t *arg4 = (off_t *) 0 ; + amar_file_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + size_t size2 = 0 ; + int alloc2 = 0 ; + off_t position4 ; + int argvi = 0; + SV * _saved[1] ; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: amar_new_file(arch,filename,filename_len,want_position);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_new_file" "', argument " "1"" of type '" "amar_t *""'"); + } + arg1 = (amar_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, &size2, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "amar_new_file" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + arg3 = (gsize)(size2 - 1); + { + if (SvTRUE(ST(2))) { + position4 = 0; + arg4 = &position4; + } else { + arg4 = NULL; + } + } + _saved[0] = ST(2); + result = (amar_file_t *)amar_new_file_(arg1,arg2,arg3,arg4); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_amar_file_t, 0 | 0); argvi++ ; + { + if (arg4) { + ST(argvi) = amglue_newSVi64(*arg4); + argvi++; + } + } + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_file_close) { + { + amar_file_t *arg1 = (amar_file_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: amar_file_close(file);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_file_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_file_close" "', argument " "1"" of type '" "amar_file_t *""'"); + } + arg1 = (amar_file_t *)(argp1); + amar_file_close_(arg1); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_new_attr) { + { + amar_file_t *arg1 = (amar_file_t *) 0 ; + guint16 arg2 ; + amar_attr_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: amar_new_attr(file,attrid);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_file_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_new_attr" "', argument " "1"" of type '" "amar_file_t *""'"); + } + arg1 = (amar_file_t *)(argp1); + { + arg2 = amglue_SvU16(ST(1)); + } + result = (amar_attr_t *)amar_new_attr_(arg1,arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_amar_attr_t, 0 | 0); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_attr_close) { + { + amar_attr_t *arg1 = (amar_attr_t *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: amar_attr_close(attr);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_attr_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_attr_close" "', argument " "1"" of type '" "amar_attr_t *""'"); + } + arg1 = (amar_attr_t *)(argp1); + amar_attr_close_(arg1); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_attr_add_data_buffer) { + { + amar_attr_t *arg1 = (amar_attr_t *) 0 ; + char *arg2 = (char *) 0 ; + gsize arg3 ; + gboolean arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + size_t size2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: amar_attr_add_data_buffer(attr,buffer,size,eoa);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_attr_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_attr_add_data_buffer" "', argument " "1"" of type '" "amar_attr_t *""'"); + } + arg1 = (amar_attr_t *)(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, &size2, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "amar_attr_add_data_buffer" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + arg3 = (gsize)(size2 - 1); + { + if (sizeof(signed int) == 1) { + arg4 = amglue_SvI8(ST(2)); + } else if (sizeof(signed int) == 2) { + arg4 = amglue_SvI16(ST(2)); + } else if (sizeof(signed int) == 4) { + arg4 = amglue_SvI32(ST(2)); + } else if (sizeof(signed int) == 8) { + arg4 = amglue_SvI64(ST(2)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + amar_attr_add_data_buffer_(arg1,arg2,arg3,arg4); + + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_attr_add_data_fd) { + { + amar_attr_t *arg1 = (amar_attr_t *) 0 ; + int arg2 ; + gboolean arg3 ; + size_t result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: amar_attr_add_data_fd(attr,fd,eoa);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_attr_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_attr_add_data_fd" "', argument " "1"" of type '" "amar_attr_t *""'"); + } + arg1 = (amar_attr_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + { + if (sizeof(signed int) == 1) { + arg3 = amglue_SvI8(ST(2)); + } else if (sizeof(signed int) == 2) { + arg3 = amglue_SvI16(ST(2)); + } else if (sizeof(signed int) == 4) { + arg3 = amglue_SvI32(ST(2)); + } else if (sizeof(signed int) == 8) { + arg3 = amglue_SvI64(ST(2)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = amar_attr_add_data_fd_(arg1,arg2,arg3); + { + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + argvi++; + } + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_amar_read) { + { + amar_t *arg1 = (amar_t *) 0 ; + SV *arg2 = (SV *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: amar_read(archive,params_hashref);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_amar_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "amar_read" "', argument " "1"" of type '" "amar_t *""'"); + } + arg1 = (amar_t *)(argp1); + arg2 = ST(1); + amar_read_(arg1,arg2); + + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_amar_attr_t = {"_p_amar_attr_t", "amar_attr_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_amar_file_t = {"_p_amar_file_t", "amar_file_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_amar_t = {"_p_amar_t", "amar_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_gsize = {"_p_gsize", "gsize *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_guint16 = {"_p_guint16", "guint16 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|gboolean *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_amar_attr_t, + &_swigt__p_amar_file_t, + &_swigt__p_amar_t, + &_swigt__p_char, + &_swigt__p_double, + &_swigt__p_float, + &_swigt__p_gsize, + &_swigt__p_guint16, + &_swigt__p_int, + &_swigt__p_off_t, + &_swigt__p_unsigned_char, +}; + +static swig_cast_info _swigc__p_amar_attr_t[] = { {&_swigt__p_amar_attr_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_amar_file_t[] = { {&_swigt__p_amar_file_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_amar_t[] = { {&_swigt__p_amar_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_gsize[] = { {&_swigt__p_gsize, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_guint16[] = { {&_swigt__p_guint16, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_off_t[] = { {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_amar_attr_t, + _swigc__p_amar_file_t, + _swigc__p_amar_t, + _swigc__p_char, + _swigc__p_double, + _swigc__p_float, + _swigc__p_gsize, + _swigc__p_guint16, + _swigc__p_int, + _swigc__p_off_t, + _swigc__p_unsigned_char, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_constant_info swig_constants[] = { +{0,0,0,0,0,0} +}; +#ifdef __cplusplus +} +#endif +static swig_variable_info swig_variables[] = { +{0,0,0,0} +}; +static swig_command_info swig_commands[] = { +{"Amanda::Archivec::amar_new", _wrap_amar_new}, +{"Amanda::Archivec::amar_close", _wrap_amar_close}, +{"Amanda::Archivec::amar_new_file", _wrap_amar_new_file}, +{"Amanda::Archivec::amar_file_close", _wrap_amar_file_close}, +{"Amanda::Archivec::amar_new_attr", _wrap_amar_new_attr}, +{"Amanda::Archivec::amar_attr_close", _wrap_amar_attr_close}, +{"Amanda::Archivec::amar_attr_add_data_buffer", _wrap_amar_attr_add_data_buffer}, +{"Amanda::Archivec::amar_attr_add_data_fd", _wrap_amar_attr_add_data_fd}, +{"Amanda::Archivec::amar_read", _wrap_amar_read}, +{0,0} +}; +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" +#endif + +XS(SWIG_init) { + dXSARGS; + int i; + + SWIG_InitializeModule(0); + + /* Install commands */ + for (i = 0; swig_commands[i].name; i++) { + newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + } + + /* Install variables */ + for (i = 0; swig_variables[i].name; i++) { + SV *sv; + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); + if (swig_variables[i].type) { + SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); + } else { + sv_setiv(sv,(IV) 0); + } + swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + } + + /* Install constant */ + for (i = 0; swig_constants[i].type; i++) { + SV *sv; + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); + switch(swig_constants[i].type) { + case SWIG_INT: + sv_setiv(sv, (IV) swig_constants[i].lvalue); + break; + case SWIG_FLOAT: + sv_setnv(sv, (double) swig_constants[i].dvalue); + break; + case SWIG_STRING: + sv_setpv(sv, (char *) swig_constants[i].pvalue); + break; + case SWIG_POINTER: + SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); + break; + case SWIG_BINARY: + SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); + break; + default: + break; + } + SvREADONLY_on(sv); + } + + ST(0) = &PL_sv_yes; + XSRETURN(1); +} + diff --git a/perl/Amanda/Archive.pm b/perl/Amanda/Archive.pm new file mode 100644 index 0000000..b06dfc4 --- /dev/null +++ b/perl/Amanda/Archive.pm @@ -0,0 +1,380 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.35 +# +# Don't modify this file, modify the SWIG interface instead. + +package Amanda::Archive; +require Exporter; +require DynaLoader; +@ISA = qw(Exporter DynaLoader); +package Amanda::Archivec; +bootstrap Amanda::Archive; +package Amanda::Archive; +@EXPORT = qw( ); + +# ---------- BASE METHODS ------------- + +package Amanda::Archive; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + $self->$member_func(); +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + $self->$member_func($newval); +} + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package Amanda::Archive; + +*amar_new = *Amanda::Archivec::amar_new; +*amar_close = *Amanda::Archivec::amar_close; +*amar_new_file = *Amanda::Archivec::amar_new_file; +*amar_file_close = *Amanda::Archivec::amar_file_close; +*amar_new_attr = *Amanda::Archivec::amar_new_attr; +*amar_attr_close = *Amanda::Archivec::amar_attr_close; +*amar_attr_add_data_buffer = *Amanda::Archivec::amar_attr_add_data_buffer; +*amar_attr_add_data_fd = *Amanda::Archivec::amar_attr_add_data_fd; +*amar_read = *Amanda::Archivec::amar_read; + +# ------- VARIABLE STUBS -------- + +package Amanda::Archive; + + +@EXPORT_OK = (); +%EXPORT_TAGS = (); + +=head1 NAME + +Amanda::Archive - Perl access to the amanda archive library + +=head1 SYNOPSIS + + use Amanda::Archive + + # Write to the file descriptor $fd, and add /etc/hosts to it + my $archive = Amanda::Archive->new($fd, ">"); + my $file = $archive->new_file("/etc/hosts"); + my $attr = $file->new_attr(16); + open(my $fh, "<", "/etc/hosts"); + $attr->add_data_fd(fileno($fh), 1); + $file->close(); + $archive->close(); + + # Read from an archive + my $archive = Amanda::Archive->new($fd, "<"); + $ar->read( + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + # ... + return "foo"; # this becomes $file_data + }, + file_finish => sub { + my ($user_data, $file_data, $filenum, $truncated) = @_; + # ... + }, + 21 => [ 32768, # buffer into 32k chunks + sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + return "pants"; # becomes the new $attr_data for + # any subsequent fragments + } ], + 0 => sub { # note no buffering here; attrid 0 is "default" + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + return "shorts"; # becomes the new $attr_data for + # any subsequent fragments + }, + user_data => [ "mydata" ], # sent to all callbacks + ); + +=head1 WRITING + +=head2 Amanda::Archive::Archive Objects + +Note that Cnew> and Cnew> are +equivalent. + +=over + +=item C + +Create a new archive for reading ("<") or writing (">") from or to file +descriptor C<$fd>. + +=item C + +Create a new C object with the given filename (writing +only). Equivalent to + + Amanda::Archive::File->new($archive, $filename, $want_posn); + +if C<$want_posn> is false, then this method returns a new +C object. If C<$want_posn> is true, then it returns +C<($file, $posn)> where C<$file> is the object and C<$posn> is the offset into +the datastream at which this file begins. This offset can be stored in an +index and used later to seek into the file. + +=item C + +See I, below. + +=item C + +Flush all buffers and close this archive. This does not close the file descriptor. + +=back + +=head2 Amanda::Archive::File Objects + +=over + +=item C + +Create a new file in the given archive. See C, above. + +=item C + +Create a new C object. Equivalent to + + Amanda::Archive::Attr->new($file, $attrid); + +=item C + +Close this file, writing an EOF record. + +=back + +=head2 Amanda::Archive::Attribute Objects + +=over + +=item C + +Add C<$data> to this attribute, adding an EOA (end-of-attribute) bit if C<$eoa> is true. + +=item C + +Copy data from C<$fd> to this attribute, adding an EOA (end-of-attribute) bit if C<$eoa> is true. + +=item C + +Close this attribute, adding an EOA bit if none has been written already. + +=back + +=head1 READING + +The C method C handles reading archives via a callback mechanism. It takes its arguments in hash form, with the following keys: + + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + # .. + }, + +C gives a sub which is called for every file in the archive. It +can return an arbitrary value which will become the C<$file_data> for +subsequent callbacks in this file, or the string "IGNORE" which will cause the +reader to ignore all data for this file. In this case, no other callbacks will +be made for the file (not even C). + + file_finish => sub { + my ($user_data, $file_data, $filenum, $truncated) = @_; + # .. + }, + +C gives a sub which is called when an EOF record appears. +C<$file_data> comes from the return value of the C callback. +C<$truncated> is true if the file may be missing data (e.g., when an early EOF +is detected). + + user_data => $my_object, + +C gives an arbitrary value which is passed to each callback as C<$user_data>. + + 13 => sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + # ... + }, + 19 => [ 10240, sub { ... } ], + +Any numeric key is treated as an attribute ID, and specifies the handling for +that attribute. Attribute ID zero is treated as a wildcard, and will match any +attribute without an explicit handler. The handler can be specified as a sub +(as for attribute ID 13 in the example above) or as an arrayref C<[$minsize, +$sub]>. In the latter case, the sub is only called when at least C<$minsize> +bytes of data are available for the attribute, or at the end of the attribute +data. + +The parameters to the callback include C<$file_data>, the value returned from +C, and C<$attr_data>, which is the return value of the last +invocation of this sub for this attribute. If this is the last fragment of +data for this attribute, then C<$eoa> is true. The meaning of C<$truncated> +is similar to that in C. + +=head2 EXAMPLE + + sub read_to_files { + my ($arch_fh, $basedir) = @_; + + my $arch = Amanda::Archive->new(fileno($arch_fh), "<"); + $arch->read( + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + return "$basedir/$filenum"; # becomes $file_data + }, + 0 => [ 32768, sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + warn("file $filename attribute $attrid is truncated") + if ($truncated); + # store the open filehandle in $attr_data + if (!$attr_data) { + open($attr_data, "$file_data.$attrid", ">") + or die("open: $!"); + } + print $attr_data $data; + if ($eoa) { + close($attr_data); + } + return $attr_data; + }, + ); + } + +=cut + +package Amanda::Archive; + +# Expose the Archive constructor at Amanda::Archive->new +sub new { + my $pkg = shift; + Amanda::Archive::Archive->new(@_); +} + +package Amanda::Archive::Archive; + +sub new { + my ($class, $fd, $mode) = @_; + my $arch = Amanda::Archive::amar_new($fd, $mode); + return bless (\$arch, $class); +} + +sub close { + my $self = shift; + if ($$self) { + Amanda::Archive::amar_close($$self); + $$self = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub new_file { + my ($self, $filename, $want_offset) = @_; + return Amanda::Archive::File->new($self, $filename, $want_offset); +} + +sub Amanda::Archive::Archive::read { + my $self = shift; + die "Archive is not open" unless ($$self); + # pass a hashref to the C code + my %h = @_; + Amanda::Archive::amar_read($$self, \%h); +} + +package Amanda::Archive::File; + +sub new { + my ($class, $arch, $filename, $want_offset) = @_; + die "Archive is not open" unless ($$arch); + if ($want_offset) { + # note that posn is returned first by the SWIG wrapper + my ($file, $posn) = Amanda::Archive::amar_new_file($$arch, $filename, $want_offset); + return (bless([ $file, $arch ], $class), $posn); + } else { + my $file = Amanda::Archive::amar_new_file($$arch, $filename, $want_offset); + return bless([ $file, $arch ], $class); + } +} + +sub close { + my $self = shift; + if ($self->[0]) { + Amanda::Archive::amar_file_close($self->[0]); + $self->[0] = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub new_attr { + my ($self, $attrid) = @_; + return Amanda::Archive::Attr->new($self, $attrid); +} + +package Amanda::Archive::Attr; + +sub new { + my ($class, $file, $attrid) = @_; + die "File is not open" unless ($file->[0]); + my $attr = Amanda::Archive::amar_new_attr($file->[0], $attrid); + return bless ([$attr, $file], $class); +} + +sub close { + my $self = shift; + if ($self->[0]) { + Amanda::Archive::amar_attr_close($self->[0]); + $self->[0] = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub add_data { + my ($self, $data, $eoa) = @_; + die "Attr is not open" unless ($self->[0]); + Amanda::Archive::amar_attr_add_data_buffer($self->[0], $data, $eoa); +} + +sub add_data_fd { + my ($self, $fd, $eoa) = @_; + die "Attr is not open" unless ($self->[0]); + return Amanda::Archive::amar_attr_add_data_fd($self->[0], $fd, $eoa); +} +1; diff --git a/perl/Amanda/Archive.swg b/perl/Amanda/Archive.swg new file mode 100644 index 0000000..22626c5 --- /dev/null +++ b/perl/Amanda/Archive.swg @@ -0,0 +1,814 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +%module "Amanda::Archive" +%include "amglue/amglue.swg" +%include "exception.i" +%include "cstring.i" + +%{ +#include "amar.h" +%} + +%perlcode %{ +=head1 NAME + +Amanda::Archive - Perl access to the amanda archive library + +=head1 SYNOPSIS + + use Amanda::Archive + + # Write to the file descriptor $fd, and add /etc/hosts to it + my $archive = Amanda::Archive->new($fd, ">"); + my $file = $archive->new_file("/etc/hosts"); + my $attr = $file->new_attr(16); + open(my $fh, "<", "/etc/hosts"); + $attr->add_data_fd(fileno($fh), 1); + $file->close(); + $archive->close(); + + # Read from an archive + my $archive = Amanda::Archive->new($fd, "<"); + $ar->read( + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + # ... + return "foo"; # this becomes $file_data + }, + file_finish => sub { + my ($user_data, $file_data, $filenum, $truncated) = @_; + # ... + }, + 21 => [ 32768, # buffer into 32k chunks + sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + return "pants"; # becomes the new $attr_data for + # any subsequent fragments + } ], + 0 => sub { # note no buffering here; attrid 0 is "default" + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + return "shorts"; # becomes the new $attr_data for + # any subsequent fragments + }, + user_data => [ "mydata" ], # sent to all callbacks + ); + +=head1 WRITING + +=head2 Amanda::Archive::Archive Objects + +Note that Cnew> and Cnew> are +equivalent. + +=over + +=item C + +Create a new archive for reading ("<") or writing (">") from or to file +descriptor C<$fd>. + +=item C + +Create a new C object with the given filename (writing +only). Equivalent to + + Amanda::Archive::File->new($archive, $filename, $want_posn); + +if C<$want_posn> is false, then this method returns a new +C object. If C<$want_posn> is true, then it returns +C<($file, $posn)> where C<$file> is the object and C<$posn> is the offset into +the datastream at which this file begins. This offset can be stored in an +index and used later to seek into the file. + +=item C + +See I, below. + +=item C + +Flush all buffers and close this archive. This does not close the file descriptor. + +=back + +=head2 Amanda::Archive::File Objects + +=over + +=item C + +Create a new file in the given archive. See C, above. + +=item C + +Create a new C object. Equivalent to + + Amanda::Archive::Attr->new($file, $attrid); + +=item C + +Close this file, writing an EOF record. + +=back + +=head2 Amanda::Archive::Attribute Objects + +=over + +=item C + +Add C<$data> to this attribute, adding an EOA (end-of-attribute) bit if C<$eoa> is true. + +=item C + +Copy data from C<$fd> to this attribute, adding an EOA (end-of-attribute) bit if C<$eoa> is true. + +=item C + +Close this attribute, adding an EOA bit if none has been written already. + +=back + +=head1 READING + +The C method C handles reading archives via a callback mechanism. It takes its arguments in hash form, with the following keys: + + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + # .. + }, + +C gives a sub which is called for every file in the archive. It +can return an arbitrary value which will become the C<$file_data> for +subsequent callbacks in this file, or the string "IGNORE" which will cause the +reader to ignore all data for this file. In this case, no other callbacks will +be made for the file (not even C). + + file_finish => sub { + my ($user_data, $file_data, $filenum, $truncated) = @_; + # .. + }, + +C gives a sub which is called when an EOF record appears. +C<$file_data> comes from the return value of the C callback. +C<$truncated> is true if the file may be missing data (e.g., when an early EOF +is detected). + + user_data => $my_object, + +C gives an arbitrary value which is passed to each callback as C<$user_data>. + + 13 => sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + # ... + }, + 19 => [ 10240, sub { ... } ], + +Any numeric key is treated as an attribute ID, and specifies the handling for +that attribute. Attribute ID zero is treated as a wildcard, and will match any +attribute without an explicit handler. The handler can be specified as a sub +(as for attribute ID 13 in the example above) or as an arrayref C<[$minsize, +$sub]>. In the latter case, the sub is only called when at least C<$minsize> +bytes of data are available for the attribute, or at the end of the attribute +data. + +The parameters to the callback include C<$file_data>, the value returned from +C, and C<$attr_data>, which is the return value of the last +invocation of this sub for this attribute. If this is the last fragment of +data for this attribute, then C<$eoa> is true. The meaning of C<$truncated> +is similar to that in C. + +=head2 EXAMPLE + + sub read_to_files { + my ($arch_fh, $basedir) = @_; + + my $arch = Amanda::Archive->new(fileno($arch_fh), "<"); + $arch->read( + file_start => sub { + my ($user_data, $filenum, $filename) = @_; + return "$basedir/$filenum"; # becomes $file_data + }, + 0 => [ 32768, sub { + my ($user_data, $filenum, $file_data, $attrid, + $attr_data, $data, $eoa, $truncated) = @_; + warn("file $filename attribute $attrid is truncated") + if ($truncated); + # store the open filehandle in $attr_data + if (!$attr_data) { + open($attr_data, "$file_data.$attrid", ">") + or die("open: $!"); + } + print $attr_data $data; + if ($eoa) { + close($attr_data); + } + return $attr_data; + }, + ); + } + +=cut +%} + +%{ +/* Support code (not directly available from perl) */ + +/* A C object to contain all of the relevant callbacks and other state during a + * read operation; this becomes the user_data during the read */ +typedef struct perl_read_data_s { + SV *user_data; + SV *file_start_sub; + SV *file_finish_sub; + + amar_attr_handling_t *handling_array; +} perl_read_data_t; + +static gboolean +read_start_file_cb( + gpointer user_data, + uint16_t filenum, + gpointer filename, + gsize filename_len, + gboolean *ignore, + gpointer *file_data) +{ + dSP; + perl_read_data_t *dat = user_data; + SV *rv = NULL; + STRLEN len; + int count; + + *file_data = NULL; + + g_assert(dat->file_start_sub != NULL); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(dat->user_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs(sv_2mortal(newSVpvn(filename, filename_len))); + PUTBACK; + + count = call_sv(dat->file_start_sub, G_EVAL|G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak("file_start_sub returned nothing"); + + rv = POPs; + + /* if it's the string "IGNORE", then ignore it */ + if (SvPOK(rv)) { + static const char *ign = "IGNORE"; + char *rvstr = SvPV(rv, len); + if (strlen(ign) == len && 0 == strncmp(ign, rvstr, len)) + *ignore = TRUE; + } + + /* otherwise, keep the value */ + if (!*ignore) + *(SV **)(file_data) = SvREFCNT_inc(rv); + + PUTBACK; + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static gboolean +read_finish_file_cb( + gpointer user_data, + uint16_t filenum, + gpointer *file_data, + gboolean truncated) +{ + dSP; + perl_read_data_t *dat = user_data; + + g_assert(dat->file_finish_sub != NULL); + + ENTER; + SAVETMPS; + + PUSHMARK(SP); XPUSHs(dat->user_data); XPUSHs(*(SV **)file_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs(sv_2mortal(newSViv(truncated))); PUTBACK; + + call_sv(dat->file_finish_sub, G_EVAL|G_DISCARD); + + /* we're done with this file's file_data */ + SvREFCNT_dec(*(SV **)file_data); + + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static gboolean +read_frag_cb( + gpointer user_data, + uint16_t filenum, + gpointer file_data, + uint16_t attrid, + gpointer attrid_data, + gpointer *attr_data, + gpointer data, + gsize size, + gboolean eoa, + gboolean truncated) +{ + dSP; + perl_read_data_t *dat = user_data; + SV *rv; + int count; + + if (!attrid_data) + return TRUE; + + ENTER; + SAVETMPS; + + PUSHMARK(SP); + XPUSHs(dat->user_data); + XPUSHs(sv_2mortal(newSViv(filenum))); + XPUSHs((SV *)file_data); + XPUSHs(sv_2mortal(newSViv(attrid))); + if (*attr_data) + XPUSHs((SV *)(*attr_data)); + else + XPUSHs(&PL_sv_undef); + XPUSHs(sv_2mortal(newSVpvn(data, size))); + XPUSHs(sv_2mortal(newSViv(eoa))); + XPUSHs(sv_2mortal(newSViv(truncated))); + PUTBACK; + + count = call_sv(attrid_data, G_EVAL|G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak("fragment callback returned nothing"); + + rv = POPs; + + if (eoa) { + SvREFCNT_dec(*attr_data); + } else { + /* increment before decrement here, in case they're the same object */ + SvREFCNT_inc(rv); + SvREFCNT_dec(*attr_data); + *attr_data = rv; + } + + FREETMPS; + LEAVE; + + if (SvTRUE(ERRSV)) + return FALSE; + return TRUE; +} + +static void +croak_gerror(GError **error) +{ + static char *errstr = NULL; + if (errstr) g_free(errstr); + errstr = g_strdup((*error)->message); + g_clear_error(error); + croak("Amanda archive: %s", errstr); +} + +/* generic function to recognize when a string+len represents a number and + * incidentally return the resulting value. Note that this does not handle + * negative numbers. */ +static gboolean +is_number(char *str, int len, int *result) +{ + char *end = str+len; + int r = 0; + + while (str < end) { + if (!g_ascii_isdigit(*str)) return FALSE; + r = r * 10 + (int)(*str - '0'); + if (r < 0) { + /* overflow */ + return FALSE; + } + str++; + } + + *result = r; + return TRUE; +} + +%} + +/* Rename all of the below wrapper functions (suffixed with '_') for + * consumption by perl */ +%rename(amar_new) amar_new_; +%rename(amar_close) amar_close_; +%rename(amar_new_file) amar_new_file_; +%rename(amar_file_close) amar_file_close_; +%rename(amar_new_attr) amar_new_attr_; +%rename(amar_attr_close) amar_attr_close_; +%rename(amar_attr_add_data_buffer) amar_attr_add_data_buffer_; +%rename(amar_attr_add_data_fd) amar_attr_add_data_fd_; +%rename(amar_read) amar_read_; + +/* typemaps for the below */ +%apply (char *STRING, int LENGTH) { (char *filename, gsize filename_len) }; +%apply (char *STRING, int LENGTH) { (char *buffer, gsize size) }; +%typemap(in) SV * "$1 = $input;" + +%typemap(in) off_t *want_position (off_t position) { + if (SvTRUE($input)) { + position = 0; + $1 = &position; + } else { + $1 = NULL; + } +} +%typemap(argout) off_t *want_position { + if ($1) { + $result = amglue_newSVi64(*$1); + argvi++; + } +} + +%inline %{ + +/* Wrapper functions, mostly dealing with error handling */ + +amar_t *amar_new_(int fd, char *modestr) { + GError *error = NULL; + amar_t *rv; + int mode; + + if (strcmp(modestr, ">") == 0) + mode = O_WRONLY; + else if (strcmp(modestr, "<") == 0) + mode = O_RDONLY; + else + croak("mode must be '<' or '>'"); + + if ((rv = amar_new(fd, mode, &error))) { + return rv; + } + + croak_gerror(&error); + return NULL; +} + +void amar_close_(amar_t *arch) { + GError *error = NULL; + if (!amar_close(arch, &error)) + croak_gerror(&error); +} + +amar_file_t * +amar_new_file_(amar_t *arch, char *filename, gsize filename_len, off_t *want_position) { + GError *error = NULL; + amar_file_t *file; + g_assert(arch != NULL); + + file = amar_new_file(arch, filename, filename_len, want_position, &error); + if (file) + return file; + + croak_gerror(&error); + return NULL; +} + +void amar_file_close_(amar_file_t *file) { + GError *error = NULL; + if (!amar_file_close(file, &error)) + croak_gerror(&error); +} + +amar_attr_t * +amar_new_attr_(amar_file_t *file, guint16 attrid) { + GError *error = NULL; + amar_attr_t *attr; + + g_assert(file != NULL); + + attr = amar_new_attr(file, attrid, &error); + if (attr) + return attr; + + croak_gerror(&error); + return NULL; +} + +void amar_attr_close_(amar_attr_t *attr) { + GError *error = NULL; + if (!amar_attr_close(attr, &error)) + croak_gerror(&error); +} + +void amar_attr_add_data_buffer_(amar_attr_t *attr, char *buffer, gsize size, gboolean eoa) { + GError *error = NULL; + if (!amar_attr_add_data_buffer(attr, buffer, size, eoa, &error)) + croak_gerror(&error); +} + +size_t +amar_attr_add_data_fd_(amar_attr_t *attr, int fd, gboolean eoa) { + GError *error = NULL; + size_t rv = amar_attr_add_data_fd(attr, fd, eoa, &error); + if (rv < 0) + croak_gerror(&error); + return rv; +} + +/* reading */ + +void amar_read_(amar_t *archive, SV *params_hashref) { + perl_read_data_t *dat = g_new0(perl_read_data_t, 1); + GError *error = NULL; + gboolean success; + HV *params; + HE *param; + I32 len; + int maxhandlers; + int hdl_idx; + + /* make sure we got a hashref */ + if (!SvROK(params_hashref) || SvTYPE(SvRV(params_hashref)) != SVt_PVHV) + croak("read() expects a single hashref"); + params = (HV *)SvRV(params_hashref); + len = hv_iterinit(params); + + maxhandlers = hdl_idx = len; + dat->handling_array = g_new0(amar_attr_handling_t, len+1); + + /* loop through the parameters */ + while ((param = hv_iternext(params))) { + I32 keylen; + char *key = hv_iterkey(param, &keylen); + int attrid; + + /* if it's a number, it's handling information for an attrid */ + if (is_number(key, keylen, &attrid)) { + SV *val = hv_iterval(params, param); + SV *coderef; + UV bufsize = 0; + int i; + + if (!SvROK(val)) goto croak_hdl; + + switch (SvTYPE(SvRV(val))) { + case SVt_PVCV: + coderef = val; + break; + + case SVt_PVAV: { + AV *arr = (AV *)SvRV(val); + SV **svp; + + if (av_len(arr) != 1) /* av_len == largest index, not length */ + goto croak_hdl; + + /* get the bufsize */ + svp = av_fetch(arr, 0, 0); + if (!SvIOK(*svp)) + goto croak_hdl; + bufsize = SvUV(*svp); + + /* and the coderef */ + svp = av_fetch(arr, 1, 0); + if (!SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVCV) + goto croak_hdl; + coderef = *svp; + break; + } + + default: + goto croak_hdl; + } + + /* fill in the handling array, putting attrid 0 at the end, and + * filling in entries backward from there */ + i = (attrid == 0)? maxhandlers : --hdl_idx; + dat->handling_array[i].attrid = attrid; + dat->handling_array[i].min_size = bufsize; + dat->handling_array[i].callback = read_frag_cb; + dat->handling_array[i].attrid_data = coderef; + SvREFCNT_inc(coderef); + continue; + + croak_hdl: + croak("Expected CODEREF or [ MIN_SIZE, CODEREF ] for attrid %d", attrid); + } + +#define key_compare(key, val, keylen) \ + (keylen == sizeof(val)-1) && (0 == strncmp(key, val, keylen)) + + if (key_compare(key, "file_start", keylen)) { + SV *val = hv_iterval(params, param); + if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVCV) + croak("Expected a CODEREF for file_start"); + dat->file_start_sub = val; + SvREFCNT_inc(val); + continue; + } + + if (key_compare(key, "file_finish", keylen)) { + SV *val = hv_iterval(params, param); + if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVCV) + croak("Expected a CODEREF for file_finish"); + dat->file_finish_sub = val; + SvREFCNT_inc(val); + continue; + } + + if (key_compare(key, "user_data", keylen)) { + SV *val = hv_iterval(params, param); + dat->user_data = val; + SvREFCNT_inc(val); + continue; + } +#undef key_compare + croak("Invalid parameter named '%*s'", (int)keylen, key); + } + + if (!dat->user_data) + dat->user_data = &PL_sv_undef; + + success = amar_read(archive, dat, dat->handling_array + hdl_idx, + dat->file_start_sub? read_start_file_cb : NULL, + dat->file_finish_sub? read_finish_file_cb : NULL, + &error); + + /* now unreference and free everything we referenced earlier */ + if (dat->file_start_sub) + SvREFCNT_dec(dat->file_start_sub); + if (dat->file_finish_sub) + SvREFCNT_dec(dat->file_finish_sub); + if (dat->user_data && dat->user_data != &PL_sv_undef) + SvREFCNT_dec(dat->user_data); + + for (hdl_idx = 0; hdl_idx <= maxhandlers; hdl_idx++) { + if (dat->handling_array[hdl_idx].attrid_data) + SvREFCNT_dec(dat->handling_array[hdl_idx].attrid_data); + } + + g_free(dat->handling_array); + g_free(dat); + + /* if amar_read returned FALSE, then either we hit an internal + * error, or one of the perl callbacks raised an exception, and $@ + * is still set */ + if (!success) { + if (error) + croak_gerror(&error); + else + croak(NULL); + } +} + +%} + +/* now wrap those flat functions in Perl classes, depending on the perl + * refcounting to close objects in the right order */ + +%perlcode %{ +package Amanda::Archive; + +# Expose the Archive constructor at Amanda::Archive->new +sub new { + my $pkg = shift; + Amanda::Archive::Archive->new(@_); +} + +package Amanda::Archive::Archive; + +sub new { + my ($class, $fd, $mode) = @_; + my $arch = Amanda::Archive::amar_new($fd, $mode); + return bless (\$arch, $class); +} + +sub close { + my $self = shift; + if ($$self) { + Amanda::Archive::amar_close($$self); + $$self = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub new_file { + my ($self, $filename, $want_offset) = @_; + return Amanda::Archive::File->new($self, $filename, $want_offset); +} + +sub Amanda::Archive::Archive::read { + my $self = shift; + die "Archive is not open" unless ($$self); + # pass a hashref to the C code + my %h = @_; + Amanda::Archive::amar_read($$self, \%h); +} + +package Amanda::Archive::File; + +sub new { + my ($class, $arch, $filename, $want_offset) = @_; + die "Archive is not open" unless ($$arch); + if ($want_offset) { + # note that posn is returned first by the SWIG wrapper + my ($file, $posn) = Amanda::Archive::amar_new_file($$arch, $filename, $want_offset); + return (bless([ $file, $arch ], $class), $posn); + } else { + my $file = Amanda::Archive::amar_new_file($$arch, $filename, $want_offset); + return bless([ $file, $arch ], $class); + } +} + +sub close { + my $self = shift; + if ($self->[0]) { + Amanda::Archive::amar_file_close($self->[0]); + $self->[0] = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub new_attr { + my ($self, $attrid) = @_; + return Amanda::Archive::Attr->new($self, $attrid); +} + +package Amanda::Archive::Attr; + +sub new { + my ($class, $file, $attrid) = @_; + die "File is not open" unless ($file->[0]); + my $attr = Amanda::Archive::amar_new_attr($file->[0], $attrid); + return bless ([$attr, $file], $class); +} + +sub close { + my $self = shift; + if ($self->[0]) { + Amanda::Archive::amar_attr_close($self->[0]); + $self->[0] = undef; + } +} + +sub DESTROY { + my $self = shift; + $self->close(); +} + +sub add_data { + my ($self, $data, $eoa) = @_; + die "Attr is not open" unless ($self->[0]); + Amanda::Archive::amar_attr_add_data_buffer($self->[0], $data, $eoa); +} + +sub add_data_fd { + my ($self, $fd, $eoa) = @_; + die "Attr is not open" unless ($self->[0]); + return Amanda::Archive::amar_attr_add_data_fd($self->[0], $fd, $eoa); +} +%} diff --git a/perl/Amanda/BigIntCompat.pm b/perl/Amanda/BigIntCompat.pm new file mode 100644 index 0000000..485657b --- /dev/null +++ b/perl/Amanda/BigIntCompat.pm @@ -0,0 +1,99 @@ +# Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::BigIntCompat; + +use strict; +use warnings; +use overload; +use Math::BigInt; + +=head1 NAME + +Amanda::BigIntCompat -- make C behave consistently + +=head1 SYNOPSIS + + use Amanda::BigIntCompat; + use Math::BigInt; + + my $bn = Math::BigInt->new(1); + print "okay\n" if $bn eq "1"; + +=head1 API STATUS + +Stable + +=head1 INTERFACE + +This module will modify C to hide inconsistent behaviors across +Perl versions. Spefically, it handles the following. + +=over + +=item stringification + +Older versions of C, like the one shipped with Perl 5.6.1, +stringify positive numbers with a leading C<+> (e.g. C<+1> instead of C<1>). + +=back + +=cut + +my $test_num = Math::BigInt->new(1); +our $stringify = overload::Method($test_num, '""'); + +if ($test_num =~ /^\+/) { + eval <<'EVAL'; + package Math::BigInt; + use overload 'eq' => sub { + my ($self, $other) = @_; + return "$self" eq "$other"; + }; + + # stringify is already overloaded; seems to be no good way to + # re-overload it without triggering a warning + no warnings 'redefine'; + sub stringify { + my $str = $Amanda::BigIntCompat::stringify->(@_); + $str =~ s/^\+//; + return $str; + } +EVAL + die $@ if $@; +} + +# the "sign" method does not exist in older versions, either, but is used +# by bigint2uint64(). +if (!$test_num->can("sign")) { + eval <<'EVAL'; + package Math::BigInt; + sub sign { ($_[0] =~ /^-/)? "-" : "+"; } +EVAL + die $@ if $@; +} + +# similarly for bstr +if (!$test_num->can("bstr")) { + eval <<'EVAL'; + package Math::BigInt; + sub bstr { "$_[0]"; } +EVAL + die $@ if $@; +} +1; diff --git a/perl/Amanda/Changer.pm b/perl/Amanda/Changer.pm index bfad1bf..a012650 100644 --- a/perl/Amanda/Changer.pm +++ b/perl/Amanda/Changer.pm @@ -1,8 +1,8 @@ -# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -13,25 +13,21 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 -# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com package Amanda::Changer; +use strict; +use warnings; use Carp; use POSIX (); -use Exporter; -@ISA = qw( Exporter ); - -@EXPORT_OK = qw( - reset clean eject label - query loadslot find scan -); +use vars qw( @ISA ); use Amanda::Paths; use Amanda::Util; -use Amanda::Device qw( :constants ); use Amanda::Config qw( :getconf ); +use Amanda::Device qw( :constants ); =head1 NAME @@ -39,311 +35,554 @@ Amanda::Changer -- interface to changer scripts =head1 SYNOPSIS - use Amanda::Changer; + use Amanda::Changer; - my ($error, $slot) = Amanda::Changer::reset(); + my $chg = Amanda::Changer->new(); # loads the default changer; OR + $chg = Amanda::Changer->new("somechanger"); # references a defined changer in amanda.conf - my ($nslots, $curslot, $backwards, $searchable) = Amanda::Changer::query(); + $chg->load( + label => "TAPE-012", + res_cb => sub { + my ($err, $reservation) = @_; + if ($err) { + die $err->{message}; + } + $dev = Amanda::Device->new($reservation->{device_name}); + # use device.. + }); - my ($tpslot, $tpdevice) = Amanda::Changer::find("TAPE018"); - - sub slot_callback { - my ($slot, $device, $error) = @_; - if (!$error) print "Slot $slot: $device\n"; - return 0; - } - Amanda::Changer::scan(\&slot_callback); + # later.. + $reservation->release(finished_cb => $start_next_volume); =head1 API STATUS -Stable +This interface will change before the next release. + +=head1 INTERFACE + +All operations in the module return immediately, and take as an argument a +callback function which will indicate completion of the changer operation -- a +kind of continuation. The caller should run a main loop (see +L) to allow the interactions with the changer script to +continue. + +A new object is created with the C function as follows: + + my $chg = Amanda::Changer->new($changer); + +to create a named changer (a name provided by the user, either specifying a +changer directly or specifying a changer definition), or + + my $chg = Amanda::Changer->new(); + +to run the default changer. This function handles the many ways a user can +configure a changer. -=head1 FUNCTIONS +=head2 CALLBACKS -All of these functions return an array of values, beginning with -C<$error>, and containing any other results appropriate to the -operation. +A res_cb C<$cb> is called back as: -The functions C in the event of a serious error (problems -running the changer script, or an exit status of 2 or higher). -"Benign" errors, corresponding to an exit status of 1 or a slot named -"", result in the return of a single-element array containing -the error message. Error-handling for calls can be written + $cb->($error, undef); -C<$error> and C<$slot>. The first is false unless a "benign" -error, such as a positioning error, has occurred, in which case it -contains the message from the changer script, and the other results -are undefined. C<$slot> is the first word returned from the changer -script, and is usually a number, but occasionally a string such as -"". +in the event of an error, or -=over + $cb->(undef, $reservation); -=item reset +with a successful reservation. res_cb must always be specified. A finished_cb +C<$cb> is called back as - my ($error, $slot) = reset(); + $cb->($error); -Resets the tape changer, if supported, by calling +in the event of an error, or - $tpchanger -reset + $cb->(undef); -=item clean +on success. A finished_cb may be omitted if no notification of completion is +required. - my ($error, $slot) = clean(); +=head2 CURRENT SLOT -Triggers a cleaning cycle, if supported, by calling +Changers maintain a global concept of a "current" slot, for +compatibility with Amanda algorithms such as the taperscan. However, it +is not compatible with concurrent use of the same changer, and may be +inefficient for some changers, so new algorithms should avoid using it, +preferring instead to load the correct tape immediately (with C), +and to progress from tape to tape using the reservation objects' +C attribute. - $tpchanger -clean +=head2 CHANGER OBJECTS -=item eject +=head3 $chg->load(res_cb => $cb, label => $label, set_current => $sc) - my ($error, $slot) = eject(); +Load a volume with the given label. This may leverage any barcodes or other +indices that the changer has created, or may resort to a sequential scan of +media. If set_current is specified and true, then the changer's current slot +should be updated to correspond to $slot. If not, then the changer should not +update its current slot (but some changers will anyway - specifically, +chg-compat). -Ejects the tape in the current slot, if supported, by calling +Note that the changer I to load the requested volume, but it's a mean +world out there, and you may not get what you want, so check the label on the +loaded volume before getting started. - $tpchanger -eject +=head3 $chg->load(res_cb => $cb, slot => "current") -=item label +Reserve the volume in the "current" slot. This is used by the sequential +taperscan algorithm to begin its search. - my ($error) = label($label); +=head3 $chg->load(res_cb => $cb, slot => "next") -Inform the changer that the tape in the current slot is labeled C<$label>. Calls +Reserve the volume that follows the current slot. This may not be a +very efficient operation on all devices. - $tpchanger -label $label +=head3 $chg->load(res_cb => $cb, slot => $slot, set_current => $sc) -=item query +Reserve the volume in the given slot. $slot must be a string that appeared in a +reservation's 'next_slot' field at some point, or a string from the user (e.g., +an argument to amtape). + +=head3 $chg->info(info_cb => $cb, info => [ $key1, $key2, .. ]) + +Query the changer for miscellaneous information. Any number of keys may be +specified. The C is called with C<$error> as the first argument, +much like a C, but the remaining arguments form a hash giving values +for all of the requested keys that are supported by the changer. The preamble +to such a callback is usually + + info_cb => sub { + my $error = shift; + my %results = @_; + # .. + } + +Supported keys are: + +=over 2 + +=item num_slots + +The total number of slots in the changer device. If this key is not +present, then the device cannot determine its slot count (for example, +an archival device that names slots by timestamp could potentially run +until the heat-death of the universe). + +=item vendor_string + +A string describing the name and model of the changer device. + +=back - my ($error, $slot, $nslots, $backwards, $searchable) = query(); +=head3 $chg->reset(finished_cb => $cb) -Query the changer to determine the current slot (C<$slot>), the -number of slots (C<$nslots>), whether it can move backward through tapes -(C<$backwards>), and whether it is searchable (that is, has a barcode -reader; C<$searchable>). A changer which cannot move backward through -tapes is also known as a gravity feeder. +Reset the changer to a "base" state. This will generally reset the "current" +slot to something the user would think of as the "first" tape, unload any +loaded drives, etc. It is an error to call this while any reservations are +outstanding. -This function runs +=head3 $chg->clean(finished_cb => $cb, drive => $drivename) - $tpchanger -info +Clean a drive, if the changer supports it. Drivename can be an empty string for +devices with only one drive, or can be an arbitrary string from the user (e.g., +an amtape argument). Note that some changers cannot detect the completion of a +cleaning cycle; in this case, the user will just need to delay further Amanda +activities until the cleaning is complete. -=item loadslot +=head3 $chg->update(finished_cb => $cb, changed => $changed) - my ($error, $slot, $device) = loadslot($desired_slot); +The user has changed something -- loading or unloading tapes, +reconfiguring the changer, etc. -- that may have invalidated the +database. C<$changed> is a changer-specific string indicating what has +changed; if it is omitted, the changer will check everything. -Load the tape in the given slot, returning its slot and device. -C<$desired_slot> can be a numeric slot number or one of the symbolic -names defined by the changer API, e.g., "next", "current", or "first". +=head3 $chg->import(finished_cb => $cb, slots => $slots) - $tpchanger -slot $slot +The user has placed volumes in the import/export slots, and would like the +changer to place them in storage slots. This is a very changer-specific +operation, and $slots should be supplied by the user for verbatim transmission +to the changer, and may specify which import/export slots, for example, contain +the new volumes. -=item find +=head3 $chg->export(finished_cb => $cb, slot => $slot) - my ($error, $tpslot, $tpdevice) = Amanda::Changer::find($label); +=head3 $chg->export(finished_cb => $cb, label => $label) -Search the changer for a tape with the given label, returning with -C<$tpslot = ""> if the given label is not found. +Place the indicated volume (by $label, or in $slot) into an available +import/export slot. This, too, is a very changer-specific operation. -If the changer is searchable, this function calls +=head3 $chg->move(finished_cb => $cb, from_slot => $from, to_slot => $to) - $tpchanger -search $label +Move a volume between two slots in the changer. These slots are provided by the +user, and have meaning for the changer. -Otherwise it scans all slots in order, beginning with the current slot, -until it finds one with a label equal to C<$label> or exhausts all -slots. Note that it is considered a fatal error if the label is not -found. +=head2 RESERVATION OBJECTS -=item scan +=head3 $res->{'device_name'} - my ($error) = Amanda::Changer::scan(\&slot_callback); +This is the name of the device reserved by a reservation object. -Call C for all slots, beginning with the current slot, -until C returns a nonzero value or all slots are -exhausted. C gets three arguments: a slot number, a -device name for that slot, and a boolean value which is true if the -changer successfully loaded the slot. +=head3 $res->{'this_slot'} + +This is the name of this slot. It is an arbitrary string which will +have some meaning to the changer's C method. It is safe to +access this field after the reservation has been released. + +=head3 $res->{'next_slot'} + +This is the "next" slot after this one. It is safe to access this field, +too, after the reservation has been released (and, in changers with only +one "drive", this is the only way you will get to the next volume!) + +=head3 $res->release(finished_cb => $cb, eject => $eject) + +This is how an Amanda application indicates that it no longer needs the +reserved volume. The callback is called after any related operations are +complete -- possibly immediately. Some drives and changers have a notion of +"ejecting" a volume, and some don't. In particular, a manual changer can cause +the tape drive to eject the tape, while a tape robot can move a tape back to +storage, leaving the drive empty. If the eject parameter is given and true, it +indicates that Amanda is done with the volume and has reason to believe the +user is done with the volume, too -- for example, when a tape has been written +completely. + +A reservation will be released automatically when the object is destroyed, but +in this case no finished_cb is given, so the release operation may not complete +before the process exits. Wherever possible, reservations should be explicitly +released. + +=head3 $res->set_label(finished_cb => $cb, label => $label) + +This is how Amanda indicates to the changer that the volume in the device has +been (re-)labeled. Changers can keep a database of volume labels by slot or by +barcode, or just ignore this function and call $cb immediately. Note that the +reservation must still be held when this function is called. + +=head1 SEE ALSO + +See the other changer packages, including: + +=over 2 + +=item L + +=item L + +=item L =back -=cut +=head1 TODO -sub reset { - my ($error, $slot, $rest) = run_tpchanger("-reset"); - return ($error) if $error; + - support loading by barcode, showing barcodes in reservations + - support deadlock avoidance by returning more information in load errors + - Amanda::Changer::Single + +=cut - return (0, $slot); +# this is a "virtual" constructor which instantiates objects of different +# classes based on its argument. Subclasses should not try to chain up! +sub new { + shift eq 'Amanda::Changer' + or die("Do not call the Amanda::Changer constructor from subclasses"); + my ($name) = @_; + my ($uri, $cc); + + # creating a named changer is a bit easier + if (defined($name)) { + # first, is it a changer alias? + if (($uri,$cc) = _changer_alias_to_uri($name)) { + return _new_from_uri($uri, $cc, $name); + } + + # maybe a straight-up changer URI? + if (_uri_to_pkgname($name)) { + return _new_from_uri($name, undef, $name); + } + + # assume it's a device name or alias, and invoke the single-changer + return _new_from_uri("chg-single:$name", undef, $name); + } else { # !defined($name) + if (getconf_seen($CNF_TPCHANGER)) { + my $tpchanger = getconf($CNF_TPCHANGER); + + # first, is it an old changer script? + if ($uri = _old_script_to_uri($tpchanger)) { + return _new_from_uri($uri, undef, $name); + } + + # if not, then there had better be no tapdev + if (getconf_seen($CNF_TAPEDEV)) { + die "Cannot specify both 'tapedev' and 'tpchanger' unless using an old-style changer script"; + } + + # maybe a changer alias? + if (($uri,$cc) = _changer_alias_to_uri($tpchanger)) { + return _new_from_uri($uri, $cc, $name); + } + + # maybe a straight-up changer URI? + if (_uri_to_pkgname($tpchanger)) { + return _new_from_uri($tpchanger, undef, $name); + } + + # assume it's a device name or alias, and invoke the single-changer + return _new_from_uri("chg-single:$tpchanger", undef, $name); + } elsif (getconf_seen($CNF_TAPEDEV)) { + my $tapedev = getconf($CNF_TAPEDEV); + + # first, is it a changer alias? + if (($uri,$cc) = _changer_alias_to_uri($tapedev)) { + return _new_from_uri($uri, $cc, $name); + } + + # maybe a straight-up changer URI? + if (_uri_to_pkgname($tapedev)) { + return _new_from_uri($tapedev, undef, $name); + } + + # assume it's a device name or alias, and invoke the single-changer + return _new_from_uri("chg-single:$tapedev", undef, $name); + } else { + die "Must specify one of 'tapedev' or 'tpchanger'"; + } + } } -sub clean { - my ($error, $slot, $rest) = run_tpchanger("-clean"); - return ($error) if $error; +# helper functions for new + +sub _changer_alias_to_uri { + my ($name) = @_; + + my $cc = Amanda::Config::lookup_changer_config($name); + if ($cc) { + my $tpchanger = changer_config_getconf($cc, $CHANGER_CONFIG_TPCHANGER); + if (my $uri = _old_script_to_uri($tpchanger)) { + return ($uri, $cc); + } elsif (_uri_to_pkgname($tpchanger)) { + return ($tpchanger, $cc); + } else { + die "Changer '$name' specifies invalid tpchanger '$tpchanger'"; + } + } - return (0, $slot); + # not an alias + return; } -sub eject { - my ($error, $slot, $rest) = run_tpchanger("-eject"); - return ($error) if $error; +sub _old_script_to_uri { + my ($name) = @_; + + if ((-x "$amlibexecdir/$name") or (($name =~ qr{^/}) and (-x $name))) { + return "chg-compat:$name" + } - return (0, $slot); + # not an old script + return; } -sub label { - my ($label) = @_; +# try to load the package for the given URI. $@ is set properly +# if this function returns a false value. +sub _uri_to_pkgname { + my ($name) = @_; - my ($error, $slot, $rest) = run_tpchanger("-label", $label); - return ($error) if $error; + my ($type) = ($name =~ /^chg-([A-Za-z_]+):/); + if (!defined $type) { + $@ = "'$name' is not a changer URI"; + return 0; + } + + $type =~ tr/A-Z-/a-z_/; + + # create a package name to see if it's already imported + my $pkgname = "Amanda::Changer::$type"; + my $filename = $pkgname; + $filename =~ s|::|/|g; + $filename .= '.pm'; + return $pkgname if (exists $INC{$filename}); + + # try loading it + eval "use $pkgname;"; + if ($@) { + my $err = $@; + + # determine whether the module doesn't exist at all, or if there was an + # error loading it; die if we found a syntax error + if (exists $INC{$filename}) { + die($err); + } - return (0); + return 0; + } + + return $pkgname; } -sub query { - my ($error, $slot, $rest) = run_tpchanger("-info"); - return ($error) if $error; +# already-instsantiated changer objects (using 'our' so that the installcheck +# and reset this list as necessary) +our %changers_by_uri_cc = (); + +sub _new_from_uri { # (note: this sub is patched by the installcheck) + my ($uri, $cc, $name) = @_; - # old, unsearchable changers don't return the third result, so it's optional in the regex - $rest =~ /(\d+) (\d+) ?(\d+)?/ or croak("Malformed response from changer -seek: $rest"); + # make up a key for our hash of already-instantiated objects, + # using a newline as a separator, since perl can't use tuples + # as keys + my $uri_cc = "$uri\n"; + if (defined $cc) { + $uri_cc = $uri_cc . changer_config_name($cc); + } + + # return a pre-existing changer, if possible - # return array: error, nslots, curslot, backwards, searchable - return (0, $slot, $1, $2, $3?1:0); + if (exists($changers_by_uri_cc{$uri_cc})) { + return $changers_by_uri_cc{$uri_cc}; + } + + # look up the type and load the class + my $pkgname = _uri_to_pkgname($uri); + if (!$pkgname) { + die $@; + } + + my $rv = $pkgname->new($cc, $uri); + die "$pkgname->new did not return an Amanda::Changer object" + unless ($rv->isa("Amanda::Changer")); + + # store this in our cache for next time + $changers_by_uri_cc{$uri_cc} = $rv; + + return $rv; } -sub loadslot { - my ($desired_slot) = @_; +# parent-class methods; mostly "unimplemented method" - my ($error, $slot, $rest) = run_tpchanger("-slot", $desired_slot); - return ($error) if $error; +sub load { + my $self = shift; + my %params = @_; - return (0, $slot, $rest); + my $class = ref($self); + $params{'res_cb'}->("$class does not support load()", undef); } -sub find { - my ($label) = @_; - - my ($error, $curslot, $nslots, $backwards, $searchable) = query(); - return ($error) if $error; - - if ($searchable) { - # search using the barcode reader, etc. - my ($error, $slot, $rest) = run_tpchanger("-search", $label); - return ($error) if $error; - return ($error, $slot, $rest); - } else { - # search manually, starting with "current" - my $slotstr = "current"; - for (my $checked = 0; $checked < $nslots; $checked++) { - my ($error, $slot, $rest) = run_tpchanger("-slot", $slotstr); - $slotstr = "next"; - - # ignore "benign" errors - next if $error; - - my $device = Amanda::Device->new($rest); - next if (!$device); - next if ($device->read_label() != $READ_LABEL_STATUS_SUCESS); - - # we found it! - if ($device->{'volume_label'} eq $label) { - return (0, $slot, $rest); - } - } +sub reset { + my $self = shift; + my %params = @_; - croak("Label $label not found in any slot"); + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support reset()"); } } -sub scan { - my ($slot_callback) = @_; +sub info { + my $self = shift; + my %params = @_; - my ($error, $curslot, $nslots, $backwards, $searchable) = query(); - return ($error) if $error; + my $class = ref($self); + if (exists $params{'info_cb'}) { + $params{'info_cb'}->("$class does not support info()"); + } +} - my $slotstr = "current"; - my $done = 0; - for (my $checked = 0; $checked < $nslots; $checked++) { - my ($error, $slot, $rest) = run_tpchanger("-slot", $slotstr); - $slotstr = "next"; +sub clean { + my $self = shift; + my %params = @_; - if ($error) { - $done = $slot_callback->(undef, undef, $error); - } else { - $done = $slot_callback->($slot, $rest, 0); - } + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support clean()"); + } +} + +sub update { + my $self = shift; + my %params = @_; - last if $done; + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support update()"); } - - return (0); } -# Internal-use function to actually invoke a changer script and parse -# its output. If the script's exit status is neither 0 nor 1, or if an error -# occurs running the script, then run_tpchanger croaks with the error message. -# -# @params @args: command-line arguments to follow the name of the changer -# @returns: array ($error, $slot, $rest), where $error is an error message if -# a benign error occurred, or 0 if no error occurred -sub run_tpchanger { - my @args = @_; - - # get the tape changer and extend it to a full path - my $tapechanger = getconf($CNF_TPCHANGER); - if ($tapechanger !~ qr(^/)) { - $tapechanger = "$amlibexecdir/$tapechanger"; +sub import { + my $self = shift; + my %params = @_; + + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support import()"); } +} - my $pid = open(my $child, "-|"); - if (!defined($pid)) { - croak("Can't fork to run changer script: $!"); +sub export { + my $self = shift; + my %params = @_; + + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support export()"); } +} - if (!$pid) { - # child - - # cd into the config dir, if one exists - # TODO: construct a "fake" config dir including any "-o" overrides - my $config_dir = Amanda::Config::get_config_dir(); - if ($config_dir) { - if (!chdir($config_dir)) { - print " Could not chdir to '$config_dir'\n"; - exit(2); - } - } +sub move { + my $self = shift; + my %params = @_; + + my $class = ref($self); + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->("$class does not support move()"); + } +} - %ENV = Amanda::Util::safe_env(); +package Amanda::Changer::Reservation; - exec { $tapechanger } $tapechanger, @args or - print " Could not exec $tapechanger: $!\n"; - exit 2; +# this is a simple base class with stub method or two. + +sub new { + my $class = shift; + my $self = { + released => 0, + }; + return bless ($self, $class) +} + +sub DESTROY { + my ($self) = @_; + if (!$self->{'released'}) { + $self->release(finished_cb => sub { + my ($err) = @_; + if (defined $err) { + warn "While releasing reservation: $err"; + } + }); } +} - # parent - my @child_output = <$child>; +sub set_label { + my $self = shift; + my %params = @_; - # close the child and get its exit status - my $child_exit = 0; - if (!close($child)) { - if ($!) { - croak("Error running changer script: $!"); - } else { - $child_exit = $?; - } + # nothing to do: just call the finished callback + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); } +} - # parse the response - croak("Malformed output from changer script -- no output") - if (@child_output < 1); - croak("Malformed output from changer script -- too many lines") - if (@child_output > 1); - croak("Malformed output from changer script: '$child_output[0]'") - if ($child_output[0] !~ /\s*([^\s]+)\s+(.+)?/); - my ($slot, $rest) = ($1, $2); - - if ($child_exit == 0) { - return (0, $slot, $rest); - } elsif (POSIX::WIFEXITED($child_exit) && POSIX::WEXITSTATUS($child_exit) == 1) { - return ($rest); # non-fatal error - } else { - croak("Fatal error from changer script: $rest"); +sub release { + my $self = shift; + my %params = @_; + + return if $self->{'released'}; + + $self->{'released'} = 1; + $self->do_release(%params); + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); } } +sub do_release { + # this is the one subclasses should override +} + 1; diff --git a/perl/Amanda/Changer/compat.pm b/perl/Amanda/Changer/compat.pm new file mode 100644 index 0000000..3a96935 --- /dev/null +++ b/perl/Amanda/Changer/compat.pm @@ -0,0 +1,537 @@ +# Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::Changer::compat; + +use strict; +use warnings; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer ); + +use Carp; +use File::Glob qw( :glob ); +use File::Path; +use Amanda::Paths; +use Amanda::MainLoop qw( :GIOCondition ); +use Amanda::Config qw( :getconf ); +use Amanda::Debug; +use Amanda::Device qw( :constants ); +use Amanda::Changer; + +=head1 NAME + +Amanda::Changer::compat -- run "old" changer scripts + +=head1 DESCRIPTION + +This package, calls through to old Changer API shell scripts using the new API. +If necessary, this writes temporary configurations under C<$AMANDA_TMPDIR> and +invokes the changer there, allowing multiple distinct changers to run within +the same Amanda process. + +=head1 TODO + +In-process reservations are handled correctly - only one device may be used at +a time. However, the underlying scripts do not support reservations, so +another application can easily run the script and change the current device. +Caveat emptor. + +Concurrent _run_tpchanger invocations are currently forbidden with a die() -- +that should change to a simple FIFO queue of tpchanger invocations to make. + +Clean out old changer temporary directories on object destruction. + +Support 'update' + +=cut + +sub new { + my $class = shift; + my ($cc, $tpchanger) = @_; + my ($script) = ($tpchanger =~ /chg-compat:(.*)/); + + my $self = { + script => $script, + reserved => 0, + nslots => undef, + backwards => undef, + searchable => undef, + }; + bless ($self, $class); + + $self->_make_cfg_dir($cc); + + return $self; +} + +sub load { + my $self = shift; + my %params = @_; + + die "no callback supplied" unless (exists $params{'res_cb'}); + my $cb = $params{'res_cb'}; + + if ($self->{'reserved'}) { + $cb->("Changer is already reserved: '" . $self->{'reserved'} . "'", undef); + return; + } + + # make sure the info is loaded, and re-call load() if we have to wait + if (!defined($self->{'nslots'})) { + $self->_get_info( + sub { + my ($err) = @_; + $self->load(%params); + }, + sub { + my ($msg) = @_; + $cb->($msg, undef); + }); + return; + } + + my $run_success_cb = sub { + my ($slot, $rest) = @_; + my $res = Amanda::Changer::compat::Reservation->new($self, $slot, $rest); + $cb->(undef, $res); + }; + my $run_fail_cb = sub { + my ($exitval, $message) = @_; + $cb->($message, undef); + }; + + if (exists $params{'label'}) { + if ($self->{'searchable'}) { + $self->_run_tpchanger($run_success_cb, $run_fail_cb, "-search", $params{'label'}); + } else { + # not searchable -- run a manual scan + $self->_manual_scan(%params); + } + } elsif (exists $params{'slot'}) { + $self->_run_tpchanger($run_success_cb, $run_fail_cb, "-slot", $params{'slot'}); + } +} + +sub _manual_scan { + my $self = shift; + my %params = @_; + my $nchecked = 0; + my $check_slot; + + # search manually, starting with "current". This is complicated, because + # it's an event-based loop. + + # TODO: support the case where nslots == -1 + + $check_slot = sub { + my ($err, $res) = @_; + + TRYSLOT: { + # ignore "benign" errors + next TRYSLOT if $err; + + my $device = Amanda::Device->new($res->{'device_name'}); + next TRYSLOT unless $device; + next TRYSLOT if ($device->read_label() != $DEVICE_STATUS_SUCCESS); + next TRYSLOT unless ($device->volume_label() eq $params{'label'}); + + # we found the correct slot + Amanda::MainLoop::call_later($params{'res_cb'}, undef, $res); + return; + } + + # on to the next slot + if (++$nchecked >= $self->{'nslots'}) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "Volume '$params{label}' not found", undef); + return; + } else { + # loop again with the next slot + $res->release(); # we know this completes immediately + $self->load(slot => "next", res_cb => $check_slot); + } + }; + + # kick off the loop with the current slot + $self->load(slot => "current", res_cb => $check_slot); +} + +sub info { + my $self = shift; + my %params = @_; + my %results; + + die "no info_cb supplied" unless (exists $params{'info_cb'}); + die "no info supplied" unless (exists $params{'info'}); + + # make sure the info is loaded, and re-call info() if we have to wait + if (!defined($self->{'nslots'}) && grep(/^num_slots$/, @{$params{'info'}})) { + $self->_get_info( + sub { + my ($err) = @_; + $self->info(%params); + }, + sub { + my ($msg) = @_; + $params{'info_cb'}->($msg); + }); + return; + } + + # ok, info is loaded, so call back with the results + for my $inf (@{$params{'info'}}) { + if ($inf eq 'num_slots') { + $results{$inf} = $self->{'nslots'}; + } else { + warn "Ignoring request for info key '$inf'"; + } + } + + Amanda::MainLoop::call_later($params{'info_cb'}, undef, %results); +} + +# run a simple op -- no arguments, no slot returned +sub _simple_op { + my $self = shift; + my $op = shift; + my %params = @_; + + my $run_success_cb = sub { + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->(undef); + } + }; + my $run_fail_cb = sub { + my ($exitval, $message) = @_; + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->($message); + } + }; + $self->_run_tpchanger($run_success_cb, $run_fail_cb, "-$op"); +} + +sub reset { + my $self = shift; + my %params = @_; + + $self->_simple_op("reset", %params); +} + +sub clean { + my $self = shift; + my %params = @_; + + # note: parameter 'drive' is ignored + $self->_simple_op("clean", %params); +} + +sub update { + my $self = shift; + my %params = @_; + + # TODO: not implemented + # -- need to shuffle the driver over every slot + if (exists $params{'finished_cb'}) { + $params{'finished_cb'}->(undef); + } +} + +# Internal function to call the script's -info, store the results in $self, and +# call either $success_cb (with no arguments) or $error_cb (with an error +# message). +sub _get_info { + my ($self, $success_cb, $error_cb) = @_; + + my $run_success_cb = sub { + my ($slot, $rest) = @_; + # old, unsearchable changers don't return the third result, so it's + # optional in the regex + $rest =~ /(\d+) (\d+) ?(\d+)?/ or + croak("Malformed response from changer -info: $rest"); + + $self->{'nslots'} = $1; + $self->{'backward'} = $2; + $self->{'searchable'} = $3? 1:0; + + $success_cb->(); + }; + my $run_fail_cb = sub { + my ($exitval, $message) = @_; + $error_cb->($message); + }; + $self->_run_tpchanger($run_success_cb, $run_fail_cb, "-info"); +} + +# Internal function to create a temporary configuration directory, which persists +# for the duration of this changer's lifetime (and beyond, TODO) +sub _make_cfg_dir { + my ($self, $cc) = @_; + + if (defined $cc) { + my $cfg_name = Amanda::Config::get_config_name(); + my $changer_name = changer_config_name($cc); + my $tapedev = changer_config_getconf($cc, $CHANGER_CONFIG_TAPEDEV); + my $tpchanger = changer_config_getconf($cc, $CHANGER_CONFIG_TPCHANGER); + my $changerdev = changer_config_getconf($cc, $CHANGER_CONFIG_CHANGERDEV); + my $changerfile = changer_config_getconf($cc, $CHANGER_CONFIG_CHANGERFILE); + + my $cfg_dir = "$AMANDA_TMPDIR/Amanda::Changer::compat/$cfg_name-$changer_name"; + + if (-d $cfg_dir) { + rmtree($cfg_dir) + or die("Could not delete '$cfg_dir'"); + } + + mkpath($cfg_dir) + or die("Could not create '$cfg_dir'"); + + # Write an amanda.conf + open(my $amconf, ">", "$cfg_dir/amanda.conf") + or die ("Could not write '$cfg_dir/amanda.conf'"); + + print $amconf "# automatically generated by Amanda::Changer::compat\n"; + print $amconf 'org "', getconf($CNF_ORG), "\"\n" + if getconf_seen($CNF_ORG); + print $amconf 'mailto "', getconf($CNF_MAILTO), "\"\n" + if getconf_seen($CNF_MAILTO); + print $amconf 'mailer "', getconf($CNF_MAILER), "\"\n" + if getconf_seen($CNF_MAILER); + print $amconf "tapedev \"$tapedev\"\n" + if defined($tapedev); + print $amconf "tpchanger \"$tpchanger\"\n" + if defined($tpchanger); + print $amconf "changerdev \"$changerdev\"\n" + if defined($changerdev); + print $amconf "changerfile \"", + Amanda::Config::config_dir_relative($changerfile), + "\"\n" + if defined($changerfile); + + # TODO: device_property, tapetype, and the tapetype def + + close $amconf; + + $self->{'cfg_dir'} = $cfg_dir; + } else { + # for the default changer, we don't need to invent a config.. + $self->{'cfg_dir'} = Amanda::Config::get_config_dir(); + } + +} + +# Internal-use function to actually invoke a changer script and parse +# its output. +# +# @param $success_cb: called with ($slot, $rest) on success +# @param $failure_cb: called with ($exitval, $message) on any failure +# @params @args: command-line arguments to follow the name of the changer +# @returns: array ($error, $slot, $rest), where $error is an error message if +# a benign error occurred, or 0 if no error occurred +sub _run_tpchanger { + my ($self, $success_cb, $failure_cb, @args) = @_; + + if ($self->{'busy'}) { + croak("Changer is already in use"); + } + + my ($readfd, $writefd) = POSIX::pipe(); + if (!defined($writefd)) { + croak("Error creating pipe to run changer script: $!"); + } + + my $pid = fork(); + if (!defined($pid) or $pid < 0) { + croak("Can't fork to run changer script: $!"); + } + + if (!$pid) { + ## child + + # get our file-handle house in order + POSIX::close($readfd); + POSIX::dup2($writefd, 1); + POSIX::close($writefd); + + # cd into the config dir + if (!chdir($self->{'cfg_dir'})) { + print " Could not chdir to '" . $self->{cfg_dir} . "'\n"; + exit(2); + } + + %ENV = Amanda::Util::safe_env(); + + my $script = $self->{'script'}; + unless (-x $script) { + $script = "$amlibexecdir/$script"; + } + { exec { $script } $script, @args; } # braces protect against warning + + my $err = " Could not exec $script: $!\n"; + POSIX::write($writefd, $err, length($err)); + exit 2; + } + + ## parent + + # clean up file descriptors from the fork + POSIX::close($writefd); + + # mark this object as "busy", so we can't begin another operation + # until this one is finished. + $self->{'busy'} = 1; + + # the callbacks that follow share these lexical variables + my $child_eof = 0; + my $child_output = ''; + my $child_dead = 0; + my $child_exit_status = 0; + my ($fdsrc, $cwsrc); + my ($maybe_finished, $fd_source_cb, $child_watch_source_cb); + + # Perl note: we have to use anonymous subs here, as they are instantiated + # at runtime, rather than at compile time. + + $maybe_finished = sub { + return unless $child_eof; + return unless $child_dead; + + # everything is finished -- process the results and invoke the callback + chomp $child_output; + + # handle fatal errors + if (!POSIX::WIFEXITED($child_exit_status) || POSIX::WEXITSTATUS($child_exit_status) > 1) { + $failure_cb->(POSIX::WEXITSTATUS($child_exit_status), + "Fatal error from changer script: ".$child_output); + return; + } + + # parse the child's output + my @child_output = split '\n', $child_output; + $failure_cb->(2, "Malformed output from changer script -- no output") + if (@child_output < 1); + $failure_cb->(2, "Malformed output from changer script -- too many lines") + if (@child_output > 1); + $failure_cb->(2, "Malformed output from changer script: '$child_output[0]'") + if ($child_output[0] !~ /\s*([^\s]+)(?:\s+(.+))?/); + my ($slot, $rest) = ($1, $2); + + # mark this object as no longer busy. This frees the + # object up to begin the next operation, which may happen + # during the invocation of the callback + $self->{'busy'} = 0; + + # let the callback take care of any further interpretation + my $exitval = POSIX::WEXITSTATUS($child_exit_status); + if ($exitval == 0) { + $success_cb->($slot, $rest); + } else { + $failure_cb->($exitval, $rest); + } + }; + + $fd_source_cb = sub { + my ($fdsrc) = @_; + my ($len, $bytes); + $len = POSIX::read($readfd, $bytes, 1024); + + # if we got an EOF, shut things down. + if ($len == 0) { + $child_eof = 1; + POSIX::close($readfd); + $fdsrc->remove(); + $fdsrc = undef; # break a reference loop + $maybe_finished->(); + } else { + # otherwise, just keep the bytes + $child_output .= $bytes; + } + }; + $fdsrc = Amanda::MainLoop::fd_source($readfd, $G_IO_IN | $G_IO_ERR | $G_IO_HUP); + $fdsrc->set_callback($fd_source_cb); + + $child_watch_source_cb = sub { + my ($cwsrc, $got_pid, $got_status) = @_; + $cwsrc->remove(); + $cwsrc = undef; # break a reference loop + $child_dead = 1; + $child_exit_status = $got_status; + + $maybe_finished->(); + }; + $cwsrc = Amanda::MainLoop::child_watch_source($pid); + $cwsrc->set_callback($child_watch_source_cb); +} + +package Amanda::Changer::compat::Reservation; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer::Reservation ); + +sub new { + my $class = shift; + my ($chg, $slot, $device_name) = @_; + my $self = Amanda::Changer::Reservation::new($class); + + $self->{'chg'} = $chg; + + $self->{'device_name'} = $device_name; + $self->{'this_slot'} = $slot; + $self->{'next_slot'} = "next"; # clever, no? + + # mark the changer as reserved + $self->{'chg'}->{'reserved'} = $device_name; + + return $self; +} + +sub do_release { + my $self = shift; + my %params = @_; + + $self->{'chg'}->{'reserved'} = 0; +} + +sub set_label { + my $self = shift; + my %params = @_; + + # non-searchable changers don't get -label, except that chg-zd-mtx needs + # it to maintain its slotinfofile (this is a hack) + if (!$self->{'chg'}->{'searchable'} + && $self->{'chg'}->{'script'} !~ /chg-zd-mtx$/) { + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } + return; + } + + my $run_success_cb = sub { + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, undef); + } + }; + my $run_fail_cb = sub { + my ($exitval, $message) = @_; + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}, $message); + } + }; + $self->{'chg'}->_run_tpchanger( + $run_success_cb, $run_fail_cb, "-label", $params{'label'}); +} + +1; diff --git a/perl/Amanda/Changer/disk.pm b/perl/Amanda/Changer/disk.pm new file mode 100644 index 0000000..05e34a7 --- /dev/null +++ b/perl/Amanda/Changer/disk.pm @@ -0,0 +1,390 @@ +# Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::Changer::disk; + +use strict; +use warnings; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer ); + +use File::Glob qw( :glob ); +use File::Path; +use Amanda::Config qw( :getconf ); +use Amanda::Debug; +use Amanda::Changer; +use Amanda::MainLoop; + +=head1 NAME + +Amanda::Changer::disk + +=head1 DESCRIPTION + +This changer operates within a root directory, specified in the changer +string, which it arranges as follows: + + $dir -| + |- drive0/ -| + | | data -> '../slot4' + |- drive1/ -| + | | data -> '../slot1' + |- current -> slot5 + |- slot1/ + |- slot2/ + |- ... + |- slot$n/ + +The user should create the desired number C subdirectories, and +the changer will take care of dynamically creating the drives as needed, +and track the "current" slot using the eponymous symlink. + +Drives are dynamically allocated as Amanda applications request access to +particular slots. Each drive is represented as a subdirectory containing a +'data' symlink pointing to the "loaded" slot. + +=head1 TODO + + - better locking (at least to work on a shared filesystem, if not NFS) + - manpage + +=cut + +sub new { + my $class = shift; + my ($cc, $tpchanger) = @_; + my ($dir) = ($tpchanger =~ /chg-disk:(.*)/); + + # note that we don't track outstanding Reservation objects -- we know + # they're gone when they delete their drive directory + my $self = { + dir => $dir, + }; + + bless ($self, $class); + return $self; +} + +sub load { + my $self = shift; + my %params = @_; + + die "no res_cb supplied" unless (exists $params{'res_cb'}); + + if (exists $params{'slot'}) { + $self->_load_by_slot(%params); + } elsif (exists $params{'label'}) { + $self->_load_by_label(%params); + } else { + die "Invalid parameters to 'load'"; + } +} + +sub info { + my $self = shift; + my %params = @_; + my %results; + + die "no info_cb supplied" unless (exists $params{'info_cb'}); + die "no info supplied" unless (exists $params{'info'}); + + for my $inf (@{$params{'info'}}) { + if ($inf eq 'num_slots') { + my @slots = $self->_all_slots(); + $results{$inf} = scalar @slots; + } else { + warn "Ignoring request for info key '$inf'"; + } + } + + Amanda::MainLoop::call_later($params{'info_cb'}, undef, %results); +} + +sub reset { + my $self = shift; + my %params = @_; + my $slot; + my @slots = $self->_all_slots(); + + $slot = (scalar @slots)? $slots[0] : 0; + $self->_set_current($slot); + + if (exists $params{'finished_cb'}) { + Amanda::MainLoop::call_later($params{'finished_cb'}); + } +} + +sub _load_by_slot { + my $self = shift; + my %params = @_; + my $slot = $params{'slot'}; + my $drive; + + if ($slot eq "current") { + $slot = $self->_get_current(); + } elsif ($slot eq "next") { + $slot = $self->_get_current(); + $slot = $self->_get_next($slot); + } + + if (!$self->_slot_exists($slot)) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "Slot $slot not found", undef); + return; + } + + if ($drive = $self->_is_slot_in_use($slot)) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "Slot $slot is already in use by drive '$drive'", undef); + return; + } + + $drive = $self->_alloc_drive(); + $self->_load_drive($drive, $slot); + $self->_set_current($slot) if ($params{'set_current'}); + + my $next_slot = $self->_get_next($slot); + + Amanda::MainLoop::call_later($params{'res_cb'}, + undef, Amanda::Changer::disk::Reservation->new($self, $drive, $slot, $next_slot)); +} + +sub _load_by_label { + my $self = shift; + my %params = @_; + my $label = $params{'label'}; + my $slot; + my $drive; + + $slot = $self->_find_label($label); + if (!defined $slot) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "Label '$label' not found", undef); + return; + } + + if ($drive = $self->_is_slot_in_use($slot)) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "Slot $slot, containing '$label', is already in use by drive '$drive'", undef); + } + + $drive = $self->_alloc_drive(); + $self->_load_drive($drive, $slot); + $self->_set_current($slot) if ($params{'set_current'}); + + my $next_slot = $self->_get_next($slot); + + Amanda::MainLoop::call_later($params{'res_cb'}, + undef, Amanda::Changer::disk::Reservation->new($self, $drive, $slot, $next_slot)); +} + +# Internal function to find an unused (nonexistent) driveN subdirectory and +# create it. Note that this does not add a 'data' symlink inside the directory. +sub _alloc_drive { + my ($self) = @_; + my $n = 0; + + while (1) { + my $drive = $self->{'dir'} . "/drive$n"; + $n++; + + warn "$drive is not a directory; please remove it" if (-e $drive and ! -d $drive); + next if (-e $drive); + next if (!mkdir($drive)); # TODO probably not a very effective locking mechanism.. + + return $drive; + } +} + +# Internal function to enumerate all available slots. Slots are described by +# integers. +sub _all_slots { + my ($self) = @_; + my $dir = _quote_glob($self->{'dir'}); + my @slots; + + for my $slotname (bsd_glob("$dir/slot*/")) { + my $slot; + next unless (($slot) = ($slotname =~ /.*slot([0-9]+)\/$/)); + push @slots, $slot + 0; + } + + return sort @slots; +} + +# Internal function to determine whether a slot exists. +sub _slot_exists { + my ($self, $slot) = @_; + return (-d $self->{'dir'} . "/slot$slot"); +} + +# Internal function to determine if a slot (specified by number) is in use by a +# drive, and return the path for that drive if so. +sub _is_slot_in_use { + my ($self, $slot) = @_; + my $dir = _quote_glob($self->{'dir'}); + + for my $symlink (bsd_glob("$dir/drive*/data")) { + if (! -l $symlink) { + warn "'$symlink' is not a symlink; please remove it"; + next; + } + + my $target = readlink($symlink); + if (!$target) { + warn "could not read '$symlink': $!"; + next; + } + + my $tslot; + if (!(($tslot) = ($target =~ /..\/slot([0-9]+)/))) { + warn "invalid changer symlink '$symlink' -> '$target'"; + next; + } + + if ($tslot+0 == $slot) { + $symlink =~ s{/data$}{}; # strip the trailing '/data' + return $symlink; + } + } + + return 0; +} + +# Internal function to point a drive to a slot +sub _load_drive { + my ($self, $drive, $slot) = @_; + + die "'$drive' does not exist" unless (-d $drive); + if (-e "$drive/data") { + unlink("$drive/data"); + } + + symlink("../slot$slot", "$drive/data"); + # TODO: read it to be sure?? +} + +# Internal function to return the slot containing a volume with the given +# label. This takes advantage of the naming convention used by vtapes. +sub _find_label { + my ($self, $label) = @_; + my $dir = _quote_glob($self->{'dir'}); + $label = _quote_glob($label); + + my @tapelabels = bsd_glob("$dir/slot*/00000.$label"); + if (!@tapelabels) { + return undef; + } + + if (scalar @tapelabels > 1) { + warn "Multiple slots with label '$label': " . (join ", ", @tapelabels); + } + + my ($slot) = ($tapelabels[0] =~ qr{/slot([0-9]+)/00000.}); + return $slot; +} + +# Internal function to get the next slot after $slot. +sub _get_next { + my ($self, $slot) = @_; + my $next_slot; + + # Try just incrementing the slot number + $next_slot = $slot+1; + return $next_slot if (-d $self->{'dir'} . "/slot$next_slot"); + + # Otherwise, search through all slots + my @all_slots = $self->_all_slots(); + my $prev = $all_slots[-1]; + for $next_slot (@all_slots) { + return $next_slot if ($prev == $slot); + $prev = $next_slot; + } + + # not found? take a guess. + return $all_slots[0]; +} + +# Get the 'current' slot, represented as a symlink named 'current' +sub _get_current { + my ($self) = @_; + my $curlink = $self->{'dir'} . "/current"; + + if (-l $curlink) { + my $target = readlink($curlink); + if ($target =~ "^slot([0-9]+)/?") { + return $1; + } + } + + # get the first slot as a default + my @slots = $self->_all_slots(); + return 0 unless (@slots); + return $slots[0]; +} + +# Set the 'current' slot +sub _set_current { + my ($self, $slot) = @_; + my $curlink = $self->{'dir'} . "/current"; + + if (-e $curlink) { + unlink($curlink) + or die("Could not unlink '$curlink'"); + } + + # TODO: locking + symlink("slot$slot", $curlink); +} + +# utility function +sub _quote_glob { + my ($filename) = @_; + $filename =~ s/([]{}\\?*[])/\\$1/g; + return $filename; +} + +package Amanda::Changer::disk::Reservation; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer::Reservation ); + +sub new { + my $class = shift; + my ($chg, $drive, $slot, $next_slot) = @_; + my $self = Amanda::Changer::Reservation::new($class); + + $self->{'chg'} = $chg; + $self->{'drive'} = $drive; + + $self->{'device_name'} = "file:$drive"; + $self->{'this_slot'} = $slot; + $self->{'next_slot'} = $next_slot; + + return $self; +} + +sub do_release { + my $self = shift; + my %params = @_; + my $drive = $self->{'drive'}; + + unlink("$drive/data") + or warn("Could not unlink '$drive/data': $!"); + rmdir("$drive") + or warn("Could not rmdir '$drive': $!"); +} diff --git a/perl/Amanda/Changer/single.pm b/perl/Amanda/Changer/single.pm new file mode 100644 index 0000000..33bf291 --- /dev/null +++ b/perl/Amanda/Changer/single.pm @@ -0,0 +1,125 @@ +# Copyright (c) 2005-2008 Zmanda, Inc. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License version 2.1 as +# published by the Free Software Foundation. +# +# This library 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 Lesser General Public +# License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +# +# Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::Changer::single; + +use strict; +use warnings; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer ); + +use File::Glob qw( :glob ); +use File::Path; +use Amanda::Config qw( :getconf ); +use Amanda::Debug; +use Amanda::Changer; +use Amanda::MainLoop; + +=head1 NAME + +Amanda::Changer::single + +=head1 DESCRIPTION + +This changer represents a single drive as a changer. It may eventually morph +into something similar to the old C. + +Whatever you load, you get the volume in the drive. The volume's either +reserved or not. All pretty straightforward. + +=head1 TODO + +Support notifying the user that a tape is required, and some kind of "OK, +loaded" feedback mechanism -- perhaps a utility script of some sort, or an +amtape subcommand? + +=cut + +sub new { + my $class = shift; + my ($cc, $tpchanger) = @_; + my ($device_name) = ($tpchanger =~ /chg-single:(.*)/); + + my $self = { + device_name => $device_name, + reserved => 0, + }; + + bless ($self, $class); + return $self; +} + +sub load { + my $self = shift; + my %params = @_; + + die "no res_cb supplied" unless (exists $params{'res_cb'}); + + if ($self->{'reserved'}) { + Amanda::MainLoop::call_later($params{'res_cb'}, + "'{$self->{device_name}}' is already reserved", undef); + } else { + Amanda::MainLoop::call_later($params{'res_cb'}, + undef, Amanda::Changer::single::Reservation->new($self)); + } +} + +sub info { + my $self = shift; + my %params = @_; + my %results; + + die "no info_cb supplied" unless (exists $params{'info_cb'}); + die "no info supplied" unless (exists $params{'info'}); + + for my $inf (@{$params{'info'}}) { + if ($inf eq 'num_slots') { + $results{$inf} = 1; + } else { + warn "Ignoring request for info key '$inf'"; + } + } + + Amanda::MainLoop::call_later($params{'info_cb'}, undef, %results); +} + +package Amanda::Changer::single::Reservation; +use vars qw( @ISA ); +@ISA = qw( Amanda::Changer::Reservation ); + +sub new { + my $class = shift; + my ($chg, $drive, $next_slot) = @_; + my $self = Amanda::Changer::Reservation::new($class); + + $self->{'chg'} = $chg; + + $self->{'device_name'} = $chg->{'device_name'}; + $self->{'this_slot'} = '1'; + $self->{'next_slot'} = '1'; + $chg->{'reserved'} = 1; + + return $self; +} + +sub do_release { + my $self = shift; + my %params = @_; + + $self->{'chg'}->{'reserved'} = 0; +} diff --git a/perl/Amanda/Cmdline.c b/perl/Amanda/Cmdline.c index d23c52a..8388453 100644 --- a/perl/Amanda/Cmdline.c +++ b/perl/Amanda/Cmdline.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -122,7 +122,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -157,6 +157,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,10 +298,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -427,8 +428,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -1061,7 +1062,7 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); } @@ -1119,7 +1120,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (!tc) { return SWIG_ERROR; } - *ptr = SWIG_TypeCast(tc,voidptr); + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } } else { *ptr = voidptr; } @@ -1294,7 +1299,7 @@ SWIG_Perl_GetModule(void) { /* first check if pointer already created */ if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } @@ -1308,7 +1313,7 @@ SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } @@ -1443,7 +1448,7 @@ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0}; #define SWIG_name "Amanda::Cmdlinec::boot_Amanda__Cmdline" #define SWIG_prefix "Amanda::Cmdlinec::" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -2230,7 +2235,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -2240,6 +2245,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -2268,6 +2276,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -2421,7 +2435,7 @@ XS(SWIG_init) { /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2); + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { @@ -2433,7 +2447,7 @@ XS(SWIG_init) { /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2); + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -2457,18 +2471,18 @@ XS(SWIG_init) { } SWIG_TypeClientData(SWIGTYPE_p_dumpspec_t, (void*) "Amanda::Cmdline::dumpspec_t"); - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_DATESTAMP", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_DATESTAMP", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_DATESTAMP))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_LEVEL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_PARSE_LEVEL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_PARSE_LEVEL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_EMPTY_TO_WILDCARD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CMDLINE_EMPTY_TO_WILDCARD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CMDLINE_EMPTY_TO_WILDCARD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; diff --git a/perl/Amanda/Cmdline.pm b/perl/Amanda/Cmdline.pm index fa99ed1..fe6792f 100644 --- a/perl/Amanda/Cmdline.pm +++ b/perl/Amanda/Cmdline.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. diff --git a/perl/Amanda/Cmdline.swg b/perl/Amanda/Cmdline.swg index 953edab..9b0c6e9 100644 --- a/perl/Amanda/Cmdline.swg +++ b/perl/Amanda/Cmdline.swg @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ %module "Amanda::Cmdline" diff --git a/perl/Amanda/Config.c b/perl/Amanda/Config.c index dfd13c5..d32954d 100644 --- a/perl/Amanda/Config.c +++ b/perl/Amanda/Config.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -122,7 +122,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -157,6 +157,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,10 +298,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -427,8 +428,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -1061,7 +1062,7 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); } @@ -1119,7 +1120,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (!tc) { return SWIG_ERROR; } - *ptr = SWIG_TypeCast(tc,voidptr); + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } } else { *ptr = voidptr; } @@ -1294,7 +1299,7 @@ SWIG_Perl_GetModule(void) { /* first check if pointer already created */ if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } @@ -1308,7 +1313,7 @@ SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } @@ -1423,19 +1428,24 @@ SWIG_Perl_SetModule(swig_module_info *module) { /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_char swig_types[0] -#define SWIGTYPE_p_config_overwrites_t swig_types[1] -#define SWIGTYPE_p_double swig_types[2] -#define SWIGTYPE_p_dumptype_t swig_types[3] -#define SWIGTYPE_p_float swig_types[4] -#define SWIGTYPE_p_holdingdisk_t swig_types[5] -#define SWIGTYPE_p_int swig_types[6] -#define SWIGTYPE_p_interface_t swig_types[7] -#define SWIGTYPE_p_p_char swig_types[8] -#define SWIGTYPE_p_tapetype_t swig_types[9] -#define SWIGTYPE_p_unsigned_char swig_types[10] -static swig_type_info *swig_types[12]; -static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; +#define SWIGTYPE_p_application_t swig_types[0] +#define SWIGTYPE_p_changer_config_t swig_types[1] +#define SWIGTYPE_p_char swig_types[2] +#define SWIGTYPE_p_config_overwrites_t swig_types[3] +#define SWIGTYPE_p_device_config_t swig_types[4] +#define SWIGTYPE_p_double swig_types[5] +#define SWIGTYPE_p_dumptype_t swig_types[6] +#define SWIGTYPE_p_float swig_types[7] +#define SWIGTYPE_p_holdingdisk_t swig_types[8] +#define SWIGTYPE_p_int swig_types[9] +#define SWIGTYPE_p_interface_t swig_types[10] +#define SWIGTYPE_p_p_GSList swig_types[11] +#define SWIGTYPE_p_p_char swig_types[12] +#define SWIGTYPE_p_pp_script_t swig_types[13] +#define SWIGTYPE_p_tapetype_t swig_types[14] +#define SWIGTYPE_p_unsigned_char swig_types[15] +static swig_type_info *swig_types[17]; +static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1446,7 +1456,7 @@ static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; #define SWIG_name "Amanda::Configc::boot_Amanda__Config" #define SWIG_prefix "Amanda::Configc::" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -1675,6 +1685,14 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +typedef char **val_t_strs; +val_t_strs getconf_byname_strs(char *key, int str_needs_quotes) { + val_t *val = getconf_byname(key); + if (!val) return NULL; + return val_t_display_strs(val, str_needs_quotes); +} + + SWIGINTERNINLINE SV * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { @@ -1694,11 +1712,6 @@ SWIG_FromCharPtr(const char *cptr) return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); } - - char *get_config_name(void) { return config_name; } - char *get_config_dir(void) { return config_dir; } - char *get_config_filename(void) { return config_filename; } - #ifdef __cplusplus extern "C" { #endif @@ -2105,123 +2118,131 @@ XS(_wrap_getconf) { } result = (val_t *)getconf(arg1); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); - argvi++; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; break; - break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; - sv_setiv(optional, ei->optional); + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - ST(argvi) = sv_2mortal(newRV((SV *)hv)); + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); argvi++; break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } @@ -2290,123 +2311,131 @@ XS(_wrap_getconf_byname) { arg1 = (char *)(buf1); result = (val_t *)getconf_byname(arg1); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); - argvi++; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; break; - break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; - sv_setiv(optional, ei->optional); + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - ST(argvi) = sv_2mortal(newRV((SV *)hv)); + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); argvi++; break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -2457,6 +2486,60 @@ XS(_wrap_getconf_list) { } +XS(_wrap_getconf_byname_strs) { + { + char *arg1 = (char *) 0 ; + int arg2 ; + val_t_strs result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: getconf_byname_strs(key,str_needs_quotes);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getconf_byname_strs" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (val_t_strs)getconf_byname_strs(arg1,arg2); + { + char **it = result; + + while (it && *it) { + ST(argvi) = sv_2mortal(newSVpv(*it, 0)); + argvi++; + it++; + } + g_strfreev(result); + } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + + SWIG_croak_null(); + } +} + + XS(_wrap_lookup_tapetype) { { char *arg1 = (char *) 0 ; @@ -2519,123 +2602,131 @@ XS(_wrap_tapetype_getconf) { } result = (val_t *)tapetype_getconf(arg1,arg2); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); - argvi++; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; break; - break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; - sv_setiv(optional, ei->optional); + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - ST(argvi) = sv_2mortal(newRV((SV *)hv)); + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); argvi++; break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } @@ -2786,123 +2877,131 @@ XS(_wrap_dumptype_getconf) { } result = (val_t *)dumptype_getconf(arg1,arg2); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); - argvi++; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; break; - break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } - - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; - sv_setiv(optional, ei->optional); + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - ST(argvi) = sv_2mortal(newRV((SV *)hv)); + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); argvi++; break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } @@ -3053,123 +3152,131 @@ XS(_wrap_interface_getconf) { } result = (val_t *)interface_getconf(arg1,arg2); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); + + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; + break; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); argvi++; break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - /* first set up each of the hash values */ + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); + argvi++; + break; - sv_setiv(optional, ei->optional); - - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); - - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); - - ST(argvi) = sv_2mortal(newRV((SV *)hv)); - argvi++; + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } @@ -3366,123 +3473,131 @@ XS(_wrap_holdingdisk_getconf) { } result = (val_t *)holdingdisk_getconf(arg1,arg2); { - switch (result->type) { - case CONFTYPE_RATE: { - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[0]); - argvi++; + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } - ST(argvi)= sv_newmortal(); - sv_setnv(ST(argvi), val_t__rate(result)[1]); + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); argvi++; break; - } - - case CONFTYPE_INTRANGE: { - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[0]); - argvi++; - ST(argvi)= sv_newmortal(); - sv_setiv(ST(argvi), val_t__intrange(result)[1]); + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); argvi++; break; - break; - } - - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude(result); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); - } - } - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); - } - } + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; - sv_setiv(optional, ei->optional); + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; - ST(argvi) = sv_2mortal(newRV((SV *)hv)); + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); argvi++; break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; } - - case CONFTYPE_PROPLIST: - ST(argvi) = sv_2mortal(g_hash_table_to_hashref(val_t__proplist(result))); - argvi++; - break; - - case CONFTYPE_SIZE: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); - argvi++; - break; - - case CONFTYPE_AM64: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__am64(result))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); - argvi++; - break; - - case CONFTYPE_TIME: - ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); - argvi++; - break; - - case CONFTYPE_REAL: - ST(argvi) = sv_newmortal(); - sv_setnv(ST(argvi), val_t__real(result)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), val_t__str(result)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; } } @@ -3571,22 +3686,1347 @@ XS(_wrap_holdingdisk_seen) { } -XS(_wrap_getconf_unit_divisor) { +XS(_wrap_lookup_application) { { - long result; + char *arg1 = (char *) 0 ; + application_t *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: getconf_unit_divisor();"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: lookup_application(identifier);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_application" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + result = (application_t *)lookup_application(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_application_t, 0 | 0); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + SWIG_croak_null(); + } +} + + +XS(_wrap_application_getconf) { + { + application_t *arg1 = (application_t *) 0 ; + application_key arg2 ; + val_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: application_getconf(app,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_application_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "application_getconf" "', argument " "1"" of type '" "application_t *""'"); + } + arg1 = (application_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (val_t *)application_getconf(arg1,arg2); + { + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); + argvi++; + break; + + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); + argvi++; + break; + + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; + + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; + + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; + + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); + argvi++; + break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; + } + } + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_application_name) { + { + application_t *arg1 = (application_t *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: application_name(app);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_application_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "application_name" "', argument " "1"" of type '" "application_t *""'"); + } + arg1 = (application_t *)(argp1); + result = (char *)application_name(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_application_seen) { + { + application_t *arg1 = (application_t *) 0 ; + application_key arg2 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: application_seen(app,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_application_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "application_seen" "', argument " "1"" of type '" "application_t *""'"); + } + arg1 = (application_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)application_seen(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_lookup_pp_script) { + { + char *arg1 = (char *) 0 ; + pp_script_t *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: lookup_pp_script(identifier);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_pp_script" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + result = (pp_script_t *)lookup_pp_script(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_pp_script_t, 0 | 0); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + SWIG_croak_null(); + } +} + + +XS(_wrap_pp_script_getconf) { + { + pp_script_t *arg1 = (pp_script_t *) 0 ; + pp_script_key arg2 ; + val_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: pp_script_getconf(pps,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_pp_script_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pp_script_getconf" "', argument " "1"" of type '" "pp_script_t *""'"); + } + arg1 = (pp_script_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (val_t *)pp_script_getconf(arg1,arg2); + { + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); + argvi++; + break; + + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); + argvi++; + break; + + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; + + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; + + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; + + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); + argvi++; + break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; + } + } + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_pp_script_name) { + { + pp_script_t *arg1 = (pp_script_t *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: pp_script_name(pps);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_pp_script_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pp_script_name" "', argument " "1"" of type '" "pp_script_t *""'"); + } + arg1 = (pp_script_t *)(argp1); + result = (char *)pp_script_name(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_pp_script_seen) { + { + pp_script_t *arg1 = (pp_script_t *) 0 ; + pp_script_key arg2 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: pp_script_seen(app,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_pp_script_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pp_script_seen" "', argument " "1"" of type '" "pp_script_t *""'"); + } + arg1 = (pp_script_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)pp_script_seen(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_lookup_device_config) { + { + char *arg1 = (char *) 0 ; + device_config_t *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: lookup_device_config(identifier);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_device_config" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + result = (device_config_t *)lookup_device_config(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_device_config_t, 0 | 0); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + SWIG_croak_null(); + } +} + + +XS(_wrap_device_config_getconf) { + { + device_config_t *arg1 = (device_config_t *) 0 ; + device_config_key arg2 ; + val_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: device_config_getconf(pps,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_device_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_config_getconf" "', argument " "1"" of type '" "device_config_t *""'"); + } + arg1 = (device_config_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (val_t *)device_config_getconf(arg1,arg2); + { + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); + argvi++; + break; + + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); + argvi++; + break; + + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; + + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; + + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; + + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); + argvi++; + break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; + } + } + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_device_config_name) { + { + device_config_t *arg1 = (device_config_t *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: device_config_name(pps);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_device_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_config_name" "', argument " "1"" of type '" "device_config_t *""'"); + } + arg1 = (device_config_t *)(argp1); + result = (char *)device_config_name(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_device_config_seen) { + { + device_config_t *arg1 = (device_config_t *) 0 ; + device_config_key arg2 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: device_config_seen(app,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_device_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "device_config_seen" "', argument " "1"" of type '" "device_config_t *""'"); + } + arg1 = (device_config_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)device_config_seen(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_lookup_changer_config) { + { + char *arg1 = (char *) 0 ; + changer_config_t *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: lookup_changer_config(identifier);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_changer_config" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + result = (changer_config_t *)lookup_changer_config(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_changer_config_t, 0 | 0); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + SWIG_croak_null(); + } +} + + +XS(_wrap_changer_config_getconf) { + { + changer_config_t *arg1 = (changer_config_t *) 0 ; + changer_config_key arg2 ; + val_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: changer_config_getconf(pps,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_changer_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "changer_config_getconf" "', argument " "1"" of type '" "changer_config_t *""'"); + } + arg1 = (changer_config_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (val_t *)changer_config_getconf(arg1,arg2); + { + if (!result) { + ST(argvi) = &PL_sv_undef; + argvi++; + } else { + switch (result->type) { + case CONFTYPE_RATE: { + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setnv(ST(argvi), val_t__rate(result)[1]); + argvi++; + break; + } + + case CONFTYPE_INTRANGE: { + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[0]); + argvi++; + + ST(argvi)= sv_newmortal(); + sv_setiv(ST(argvi), val_t__intrange(result)[1]); + argvi++; + break; + break; + } + + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude(result); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } + } + + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } + } + + sv_setiv(optional, ei->optional); + + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); + + ST(argvi) = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } + + case CONFTYPE_PROPLIST: + ST(argvi) = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist(result))); + argvi++; + break; + + case CONFTYPE_SIZE: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__size(result))); + argvi++; + break; + + case CONFTYPE_INT64: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int64(result))); + argvi++; + break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__int(result))); + argvi++; + break; + + case CONFTYPE_TIME: + ST(argvi) = sv_2mortal(amglue_newSVi64(val_t__time(result))); + argvi++; + break; + + case CONFTYPE_REAL: + ST(argvi) = sv_newmortal(); + sv_setnv(ST(argvi), val_t__real(result)); + argvi++; + break; + + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + ST(argvi) = sv_newmortal(); + sv_setpv(ST(argvi), val_t__str(result)); + argvi++; + break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; + } + } + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_changer_config_name) { + { + changer_config_t *arg1 = (changer_config_t *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: changer_config_name(pps);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_changer_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "changer_config_name" "', argument " "1"" of type '" "changer_config_t *""'"); + } + arg1 = (changer_config_t *)(argp1); + result = (char *)changer_config_name(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_changer_config_seen) { + { + changer_config_t *arg1 = (changer_config_t *) 0 ; + changer_config_key arg2 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: changer_config_seen(app,key);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_changer_config_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "changer_config_seen" "', argument " "1"" of type '" "changer_config_t *""'"); + } + arg1 = (changer_config_t *)(argp1); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)changer_config_seen(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_getconf_unit_divisor) { + { + long result; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: getconf_unit_divisor();"); + } + result = (long)getconf_unit_divisor(); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_config_init) { + { + config_init_flags arg1 ; + char *arg2 = (char *) 0 ; + gboolean result; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: config_init(flags,arg_config_name);"); + } + { + if (sizeof(signed int) == 1) { + arg1 = amglue_SvI8(ST(0)); + } else if (sizeof(signed int) == 2) { + arg1 = amglue_SvI16(ST(0)); + } else if (sizeof(signed int) == 4) { + arg1 = amglue_SvI32(ST(0)); + } else if (sizeof(signed int) == 8) { + arg1 = amglue_SvI64(ST(0)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "config_init" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + result = (gboolean)config_init(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + SWIG_croak_null(); + } +} + + +XS(_wrap_config_uninit) { + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: config_uninit();"); + } + config_uninit(); + + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_get_config_options) { + { + int arg1 ; + char **result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: get_config_options(first);"); + } + { + if (sizeof(signed int) == 1) { + arg1 = amglue_SvI8(ST(0)); + } else if (sizeof(signed int) == 2) { + arg1 = amglue_SvI16(ST(0)); + } else if (sizeof(signed int) == 4) { + arg1 = amglue_SvI32(ST(0)); + } else if (sizeof(signed int) == 8) { + arg1 = amglue_SvI64(ST(0)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (char **)get_config_options(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_get_config_name) { + { + char *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: get_config_name();"); + } + result = (char *)get_config_name(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_get_config_dir) { + { + char *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: get_config_dir();"); + } + result = (char *)get_config_dir(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_get_config_filename) { + { + char *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: get_config_filename();"); + } + result = (char *)get_config_filename(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_config_print_errors) { + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: config_print_errors();"); + } + config_print_errors(); + + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_config_clear_errors) { + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: config_clear_errors();"); + } + config_clear_errors(); + + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + +XS(_wrap_config_errors) { + { + GSList **arg1 = (GSList **) 0 ; + cfgerr_level_t result; + GSList *templist1 ; + int argvi = 0; + dXSARGS; + + { + templist1 = NULL; + arg1 = &templist1; + } + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: config_errors();"); } - result = (long)getconf_unit_divisor(); + result = (cfgerr_level_t)config_errors(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } + { + GSList *it = *arg1; + + while (it) { + ST(argvi) = sv_2mortal(newSVpv(it->data, 0)); + argvi++; + it = it->next; + } + } + XSRETURN(argvi); fail: + SWIG_croak_null(); } } @@ -3743,6 +5183,7 @@ XS(_wrap_add_config_overwrite_opt) { XS(_wrap_apply_config_overwrites) { { config_overwrites_t *arg1 = (config_overwrites_t *) 0 ; + cfgerr_level_t result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; @@ -3756,165 +5197,15 @@ XS(_wrap_apply_config_overwrites) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "apply_config_overwrites" "', argument " "1"" of type '" "config_overwrites_t *""'"); } arg1 = (config_overwrites_t *)(argp1); - apply_config_overwrites(arg1); - - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_config_init) { - { - config_init_flags arg1 ; - char *arg2 = (char *) 0 ; - gboolean result; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: config_init(flags,arg_config_name);"); - } - { - if (sizeof(signed int) == 1) { - arg1 = amglue_SvI8(ST(0)); - } else if (sizeof(signed int) == 2) { - arg1 = amglue_SvI16(ST(0)); - } else if (sizeof(signed int) == 4) { - arg1 = amglue_SvI32(ST(0)); - } else if (sizeof(signed int) == 8) { - arg1 = amglue_SvI64(ST(0)); - } else { - g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ - } - } - res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "config_init" "', argument " "2"" of type '" "char *""'"); - } - arg2 = (char *)(buf2); - result = (gboolean)config_init(arg1,arg2); + result = (cfgerr_level_t)apply_config_overwrites(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - XSRETURN(argvi); - fail: - - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); - SWIG_croak_null(); - } -} - - -XS(_wrap_config_uninit) { - { - int argvi = 0; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: config_uninit();"); - } - config_uninit(); - - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_get_config_options) { - { - int arg1 ; - char **result = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: get_config_options(first);"); - } - { - if (sizeof(signed int) == 1) { - arg1 = amglue_SvI8(ST(0)); - } else if (sizeof(signed int) == 2) { - arg1 = amglue_SvI16(ST(0)); - } else if (sizeof(signed int) == 4) { - arg1 = amglue_SvI32(ST(0)); - } else if (sizeof(signed int) == 8) { - arg1 = amglue_SvI64(ST(0)); - } else { - g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ - } - } - result = (char **)get_config_options(arg1); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_get_config_name) { - { - char *result = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: get_config_name();"); - } - result = (char *)get_config_name(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_get_config_dir) { - { - char *result = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: get_config_dir();"); - } - result = (char *)get_config_dir(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_get_config_filename) { - { - char *result = 0 ; - int argvi = 0; - dXSARGS; - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: get_config_filename();"); - } - result = (char *)get_config_filename(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - XSRETURN(argvi); - fail: SWIG_croak_null(); } } @@ -3958,6 +5249,7 @@ XS(_wrap_config_dir_relative) { result = (char *)config_dir_relative(arg1); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + free((char*)result); XSRETURN(argvi); fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); @@ -4035,54 +5327,74 @@ XS(_wrap_find_multiplier) { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static swig_type_info _swigt__p_application_t = {"_p_application_t", "application_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_changer_config_t = {"_p_changer_config_t", "changer_config_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_config_overwrites_t = {"_p_config_overwrites_t", "config_overwrites_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_device_config_t = {"_p_device_config_t", "device_config_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_dumptype_t = {"_p_dumptype_t", "dumptype_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_holdingdisk_t = {"_p_holdingdisk_t", "holdingdisk_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "strategy_t *|int *|comp_t *|dump_holdingdisk_t *|holdingdisk_key *|interface_key *|confparm_key *|dumptype_key *|tapetype_key *|encrypt_t *|taperalgo_t *|gboolean *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|comp_t *|dump_holdingdisk_t *|holdingdisk_key *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|dumptype_key *|tapetype_key *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_interface_t = {"_p_interface_t", "interface_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_GSList = {"_p_p_GSList", "GSList **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_pp_script_t = {"_p_pp_script_t", "pp_script_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_tapetype_t = {"_p_tapetype_t", "tapetype_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { + &_swigt__p_application_t, + &_swigt__p_changer_config_t, &_swigt__p_char, &_swigt__p_config_overwrites_t, + &_swigt__p_device_config_t, &_swigt__p_double, &_swigt__p_dumptype_t, &_swigt__p_float, &_swigt__p_holdingdisk_t, &_swigt__p_int, &_swigt__p_interface_t, + &_swigt__p_p_GSList, &_swigt__p_p_char, + &_swigt__p_pp_script_t, &_swigt__p_tapetype_t, &_swigt__p_unsigned_char, }; +static swig_cast_info _swigc__p_application_t[] = { {&_swigt__p_application_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_changer_config_t[] = { {&_swigt__p_changer_config_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_config_overwrites_t[] = { {&_swigt__p_config_overwrites_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_device_config_t[] = { {&_swigt__p_device_config_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_dumptype_t[] = { {&_swigt__p_dumptype_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_holdingdisk_t[] = { {&_swigt__p_holdingdisk_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_interface_t[] = { {&_swigt__p_interface_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_GSList[] = { {&_swigt__p_p_GSList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_pp_script_t[] = { {&_swigt__p_pp_script_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_tapetype_t[] = { {&_swigt__p_tapetype_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { + _swigc__p_application_t, + _swigc__p_changer_config_t, _swigc__p_char, _swigc__p_config_overwrites_t, + _swigc__p_device_config_t, _swigc__p_double, _swigc__p_dumptype_t, _swigc__p_float, _swigc__p_holdingdisk_t, _swigc__p_int, _swigc__p_interface_t, + _swigc__p_p_GSList, _swigc__p_p_char, + _swigc__p_pp_script_t, _swigc__p_tapetype_t, _swigc__p_unsigned_char, }; @@ -4120,6 +5432,7 @@ static swig_command_info swig_commands[] = { {"Amanda::Configc::getconf_seen", _wrap_getconf_seen}, {"Amanda::Configc::getconf_byname", _wrap_getconf_byname}, {"Amanda::Configc::getconf_list", _wrap_getconf_list}, +{"Amanda::Configc::getconf_byname_strs", _wrap_getconf_byname_strs}, {"Amanda::Configc::lookup_tapetype", _wrap_lookup_tapetype}, {"Amanda::Configc::tapetype_getconf", _wrap_tapetype_getconf}, {"Amanda::Configc::tapetype_name", _wrap_tapetype_name}, @@ -4138,18 +5451,37 @@ static swig_command_info swig_commands[] = { {"Amanda::Configc::holdingdisk_getconf", _wrap_holdingdisk_getconf}, {"Amanda::Configc::holdingdisk_name", _wrap_holdingdisk_name}, {"Amanda::Configc::holdingdisk_seen", _wrap_holdingdisk_seen}, +{"Amanda::Configc::lookup_application", _wrap_lookup_application}, +{"Amanda::Configc::application_getconf", _wrap_application_getconf}, +{"Amanda::Configc::application_name", _wrap_application_name}, +{"Amanda::Configc::application_seen", _wrap_application_seen}, +{"Amanda::Configc::lookup_pp_script", _wrap_lookup_pp_script}, +{"Amanda::Configc::pp_script_getconf", _wrap_pp_script_getconf}, +{"Amanda::Configc::pp_script_name", _wrap_pp_script_name}, +{"Amanda::Configc::pp_script_seen", _wrap_pp_script_seen}, +{"Amanda::Configc::lookup_device_config", _wrap_lookup_device_config}, +{"Amanda::Configc::device_config_getconf", _wrap_device_config_getconf}, +{"Amanda::Configc::device_config_name", _wrap_device_config_name}, +{"Amanda::Configc::device_config_seen", _wrap_device_config_seen}, +{"Amanda::Configc::lookup_changer_config", _wrap_lookup_changer_config}, +{"Amanda::Configc::changer_config_getconf", _wrap_changer_config_getconf}, +{"Amanda::Configc::changer_config_name", _wrap_changer_config_name}, +{"Amanda::Configc::changer_config_seen", _wrap_changer_config_seen}, {"Amanda::Configc::getconf_unit_divisor", _wrap_getconf_unit_divisor}, -{"Amanda::Configc::new_config_overwrites", _wrap_new_config_overwrites}, -{"Amanda::Configc::free_config_overwrites", _wrap_free_config_overwrites}, -{"Amanda::Configc::add_config_overwrite", _wrap_add_config_overwrite}, -{"Amanda::Configc::add_config_overwrite_opt", _wrap_add_config_overwrite_opt}, -{"Amanda::Configc::apply_config_overwrites", _wrap_apply_config_overwrites}, {"Amanda::Configc::config_init", _wrap_config_init}, {"Amanda::Configc::config_uninit", _wrap_config_uninit}, {"Amanda::Configc::get_config_options", _wrap_get_config_options}, {"Amanda::Configc::get_config_name", _wrap_get_config_name}, {"Amanda::Configc::get_config_dir", _wrap_get_config_dir}, {"Amanda::Configc::get_config_filename", _wrap_get_config_filename}, +{"Amanda::Configc::config_print_errors", _wrap_config_print_errors}, +{"Amanda::Configc::config_clear_errors", _wrap_config_clear_errors}, +{"Amanda::Configc::config_errors", _wrap_config_errors}, +{"Amanda::Configc::new_config_overwrites", _wrap_new_config_overwrites}, +{"Amanda::Configc::free_config_overwrites", _wrap_free_config_overwrites}, +{"Amanda::Configc::add_config_overwrite", _wrap_add_config_overwrite}, +{"Amanda::Configc::add_config_overwrite_opt", _wrap_add_config_overwrite_opt}, +{"Amanda::Configc::apply_config_overwrites", _wrap_apply_config_overwrites}, {"Amanda::Configc::dump_configuration", _wrap_dump_configuration}, {"Amanda::Configc::config_dir_relative", _wrap_config_dir_relative}, {"Amanda::Configc::taperalgo2str", _wrap_taperalgo2str}, @@ -4213,7 +5545,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -4223,6 +5555,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -4251,6 +5586,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -4404,7 +5745,7 @@ XS(SWIG_init) { /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2); + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { @@ -4416,7 +5757,7 @@ XS(SWIG_init) { /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2); + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -4439,841 +5780,1036 @@ XS(SWIG_init) { SvREADONLY_on(sv); } - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_ORG", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_ORG", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_ORG))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CONF", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CONF", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CONF))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEX_SERVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEX_SERVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_INDEX_SERVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPE_SERVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPE_SERVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPE_SERVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AUTH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_SSH_KEYS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_SSH_KEYS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_SSH_KEYS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDAD_PATH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDAD_PATH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AMANDAD_PATH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CLIENT_USERNAME", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CLIENT_USERNAME", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CLIENT_USERNAME))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_GNUTAR_LIST_DIR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_GNUTAR_LIST_DIR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_GNUTAR_LIST_DIR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDATES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AMANDATES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AMANDATES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_MAILTO", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_MAILER", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_MAILER))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_MAILTO", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_MAILTO))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPUSER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPUSER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPUSER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEDEV", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEDEV", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPEDEV))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_PROPERTY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEVICE_PROPERTY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERDEV", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_PROPERTY))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERDEV", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CHANGERDEV))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERFILE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CHANGERFILE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CHANGERFILE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_LABELSTR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_LABELSTR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_LABELSTR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPELIST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPELIST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPELIST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DISKFILE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DISKFILE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DISKFILE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_INFOFILE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_INFOFILE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_INFOFILE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_LOGDIR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_LOGDIR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_LOGDIR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEXDIR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEXDIR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_INDEXDIR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPETYPE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPETYPE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPETYPE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPCYCLE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPCYCLE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPCYCLE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNSPERCYCLE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNSPERCYCLE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_RUNSPERCYCLE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPECYCLE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPECYCLE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPECYCLE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_NETUSAGE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_NETUSAGE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_NETUSAGE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_INPARALLEL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_INPARALLEL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_INPARALLEL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPORDER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DUMPORDER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DUMPORDER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPPERCENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPPERCENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPPERCENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPMULT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPMULT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPMULT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPDAYS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_BUMPDAYS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_BUMPDAYS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TPCHANGER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TPCHANGER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TPCHANGER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNTAPES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_RUNTAPES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_RUNTAPES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_MAXDUMPS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_ETIMEOUT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_ETIMEOUT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_ETIMEOUT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DTIMEOUT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DTIMEOUT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DTIMEOUT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CTIMEOUT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CTIMEOUT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CTIMEOUT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEBUFS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPEBUFS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPEBUFS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_OUTPUT_BUFFER_SIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEVICE_OUTPUT_BUFFER_SIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEVICE_OUTPUT_BUFFER_SIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_PRINTER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_PRINTER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_PRINTER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTOFLUSH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AUTOFLUSH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AUTOFLUSH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_MAXDUMPSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_MAXDUMPSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_COLUMNSPEC", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_COLUMNSPEC", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_COLUMNSPEC))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_DO_FSF", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_DO_FSF", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_DO_FSF))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHECK_LABEL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHECK_LABEL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_CHECK_LABEL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHANGER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_AMRECOVER_CHANGER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_AMRECOVER_CHANGER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERALGO", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERALGO", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPERALGO))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_DUMPED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_DUMPED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_FLUSH_THRESHOLD_DUMPED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_SCHEDULED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_FLUSH_THRESHOLD_SCHEDULED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_FLUSH_THRESHOLD_SCHEDULED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERFLUSH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERFLUSH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPERFLUSH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DISPLAYUNIT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DISPLAYUNIT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DISPLAYUNIT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5KEYTAB", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5KEYTAB", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_KRB5KEYTAB))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5PRINCIPAL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_KRB5PRINCIPAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_KRB5PRINCIPAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_LABEL_NEW_TAPES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_LABEL_NEW_TAPES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_LABEL_NEW_TAPES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_USETIMESTAMPS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_USETIMESTAMPS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_USETIMESTAMPS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_REP_TRIES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_REP_TRIES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_REP_TRIES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_CONNECT_TRIES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_CONNECT_TRIES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_CONNECT_TRIES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_REQ_TRIES", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_REQ_TRIES", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_REQ_TRIES))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMANDAD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMANDAD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMANDAD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMIDXTAPED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMIDXTAPED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMIDXTAPED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMINDEXD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMINDEXD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMINDEXD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMRECOVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AMRECOVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AMRECOVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AUTH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_AUTH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_AUTH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_EVENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_EVENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_EVENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_HOLDING", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_HOLDING", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_HOLDING))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PROTOCOL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PROTOCOL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_PROTOCOL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PLANNER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_PLANNER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_PLANNER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DRIVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DRIVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_DRIVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DUMPER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_DUMPER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_DUMPER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_CHUNKER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_CHUNKER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_CHUNKER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_TAPER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_TAPER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_TAPER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SELFCHECK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SELFCHECK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SELFCHECK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SENDSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDBACKUP", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_DEBUG_SENDBACKUP", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_DEBUG_SENDBACKUP))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_UDP_PORT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_UDP_PORT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVED_UDP_PORT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_TCP_PORT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_RESERVED_TCP_PORT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_RESERVED_TCP_PORT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CNF_UNRESERVED_TCP_PORT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CNF_UNRESERVED_TCP_PORT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CNF_UNRESERVED_TCP_PORT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_COMMENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_COMMENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_COMMENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LBL_TEMPL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LBL_TEMPL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_LBL_TEMPL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_BLOCKSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_BLOCKSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_BLOCKSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_READBLOCKSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_READBLOCKSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_READBLOCKSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LENGTH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_LENGTH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_LENGTH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILEMARK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILEMARK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_FILEMARK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_SPEED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_SPEED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_SPEED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILE_PAD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_FILE_PAD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_FILE_PAD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMMENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMMENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMMENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PROGRAM", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PROGRAM", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PROGRAM))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRVCOMPPROG", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRVCOMPPROG", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRVCOMPPROG))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNTCOMPPROG", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNTCOMPPROG", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNTCOMPPROG))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_ENCRYPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_ENCRYPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRV_ENCRYPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_ENCRYPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_ENCRYPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNT_ENCRYPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_AMANDAD_PATH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_AMANDAD_PATH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_AMANDAD_PATH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLIENT_USERNAME", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLIENT_USERNAME", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLIENT_USERNAME))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SSH_KEYS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SSH_KEYS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SSH_KEYS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SECURITY_DRIVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SECURITY_DRIVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SECURITY_DRIVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_EXCLUDE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_EXCLUDE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_EXCLUDE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INCLUDE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INCLUDE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_INCLUDE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PRIORITY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PRIORITY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PRIORITY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_DUMPCYCLE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_DUMPCYCLE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_DUMPCYCLE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXDUMPS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXDUMPS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_MAXDUMPS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXPROMOTEDAY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_MAXPROMOTEDAY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_MAXPROMOTEDAY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPPERCENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPPERCENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPPERCENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPDAYS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPDAYS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPDAYS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPMULT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_BUMPMULT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_BUMPMULT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STARTTIME", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STARTTIME", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_STARTTIME))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STRATEGY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_STRATEGY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_STRATEGY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ESTIMATE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_ESTIMATE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRESS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRESS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMPRESS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ENCRYPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_ENCRYPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_ENCRYPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_DECRYPT_OPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SRV_DECRYPT_OPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SRV_DECRYPT_OPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_DECRYPT_OPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_CLNT_DECRYPT_OPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_CLNT_DECRYPT_OPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRATE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_COMPRATE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_COMPRATE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_TAPE_SPLITSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_TAPE_SPLITSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_TAPE_SPLITSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_FALLBACK_SPLITSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_FALLBACK_SPLITSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_FALLBACK_SPLITSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SPLIT_DISKBUFFER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SPLIT_DISKBUFFER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SPLIT_DISKBUFFER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_RECORD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_RECORD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_RECORD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_INCR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_INCR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SKIP_INCR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_FULL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_SKIP_FULL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_SKIP_FULL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_HOLDINGDISK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_HOLDINGDISK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_HOLDINGDISK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_KENCRYPT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_KENCRYPT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_KENCRYPT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_IGNORE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_IGNORE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_IGNORE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INDEX", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_INDEX", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_INDEX))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "INTER_COMMENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_APPLICATION", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_APPLICATION))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PP_SCRIPTLIST", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PP_SCRIPTLIST))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_PROPERTY))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "INTER_COMMENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(INTER_COMMENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "INTER_MAXUSAGE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "INTER_MAXUSAGE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(INTER_MAXUSAGE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLDING_COMMENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLDING_COMMENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLDING_COMMENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKDIR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKDIR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLDING_DISKDIR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLDING_DISKSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLDING_DISKSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLDING_CHUNKSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLDING_CHUNKSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLDING_CHUNKSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLD_NEVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "APPLICATION_COMMENT", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(APPLICATION_COMMENT))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "APPLICATION_PLUGIN", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(APPLICATION_PLUGIN))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "APPLICATION_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(APPLICATION_PROPERTY))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_COMMENT", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_COMMENT))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_PLUGIN", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_PLUGIN))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_PROPERTY))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_EXECUTE_ON", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_EXECUTE_ON))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_EXECUTE_WHERE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_EXECUTE_WHERE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_CONFIG_COMMENT", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_CONFIG_COMMENT))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_CONFIG_TAPEDEV", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_CONFIG_TAPEDEV))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_CONFIG_DEVICE_PROPERTY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_CONFIG_DEVICE_PROPERTY))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CHANGER_CONFIG_COMMENT", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_COMMENT))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CHANGER_CONFIG_TAPEDEV", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_TAPEDEV))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CHANGER_CONFIG_TPCHANGER", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_TPCHANGER))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CHANGER_CONFIG_CHANGERDEV", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_CHANGERDEV))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CHANGER_CONFIG_CHANGERFILE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_CHANGERFILE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLD_NEVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLD_NEVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLD_AUTO", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLD_AUTO", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLD_AUTO))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "HOLD_REQUIRED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "HOLD_REQUIRED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(HOLD_REQUIRED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_NONE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_NONE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_NONE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_FAST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_FAST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_FAST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_BEST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_BEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_BEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_CUST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_CUST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_CUST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_FAST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_FAST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_FAST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_BEST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_BEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_BEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_CUST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "COMP_SERVER_CUST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(COMP_SERVER_CUST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_NONE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_NONE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_NONE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_CUST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_CUST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_CUST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_SERV_CUST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ENCRYPT_SERV_CUST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ENCRYPT_SERV_CUST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_SKIP", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_SKIP", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_SKIP))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_STANDARD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_STANDARD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_STANDARD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_NOFULL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_NOFULL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_NOFULL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_NOINC", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_NOINC", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_NOINC))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_4", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_4", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_4))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_5", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_5", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_5))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_HANOI", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_HANOI", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_HANOI))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "DS_INCRONLY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DS_INCRONLY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DS_INCRONLY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ES_CLIENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ES_CLIENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ES_CLIENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ES_SERVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ES_SERVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ES_SERVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ES_CALCSIZE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ES_CALCSIZE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ES_CALCSIZE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_FIRST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRSTFIT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_FIRSTFIT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_FIRSTFIT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGEST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_LARGEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGESTFIT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_LARGESTFIT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_LARGESTFIT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_SMALLEST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_SMALLEST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_SMALLEST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ALGO_LAST", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ALGO_LAST", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ALGO_LAST))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_EXPLICIT_NAME", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_AMCHECK", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_AMCHECK))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_HOST_AMCHECK", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_AMCHECK))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_AMCHECK", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_AMCHECK))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_HOST_AMCHECK", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_HOST_AMCHECK))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_ESTIMATE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_HOST_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_ESTIMATE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_ESTIMATE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_HOST_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_HOST_ESTIMATE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_BACKUP", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_BACKUP))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_HOST_BACKUP", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_BACKUP))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_BACKUP", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_BACKUP))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_HOST_BACKUP", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_HOST_BACKUP))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SEND_AMREPORT_ALL", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SEND_AMREPORT_ALL))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SEND_AMREPORT_STRANGE", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SEND_AMREPORT_STRANGE))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SEND_AMREPORT_ERROR", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SEND_AMREPORT_ERROR))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SEND_AMREPORT_NEVER", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SEND_AMREPORT_NEVER))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CFGERR_OK", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CFGERR_OK))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CFGERR_WARNINGS", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CFGERR_WARNINGS))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CFGERR_ERRORS", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CFGERR_ERRORS))); + SvREADONLY_on(sv); + } while(0) /*@SWIG@*/; + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_EXPLICIT_NAME", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_EXPLICIT_NAME))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_USE_CWD", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_USE_CWD", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_USE_CWD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_CLIENT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_CLIENT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_CLIENT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_OVERLAY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_OVERLAY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_OVERLAY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONFIG_INIT_FATAL", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONFIG_INIT_FATAL))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; ST(0) = &PL_sv_yes; XSRETURN(1); } diff --git a/perl/Amanda/Config.pm b/perl/Amanda/Config.pm index b254c92..beaf07b 100644 --- a/perl/Amanda/Config.pm +++ b/perl/Amanda/Config.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -53,6 +53,7 @@ package Amanda::Config; *getconf_seen = *Amanda::Configc::getconf_seen; *getconf_byname = *Amanda::Configc::getconf_byname; *getconf_list = *Amanda::Configc::getconf_list; +*getconf_byname_strs = *Amanda::Configc::getconf_byname_strs; *lookup_tapetype = *Amanda::Configc::lookup_tapetype; *tapetype_getconf = *Amanda::Configc::tapetype_getconf; *tapetype_name = *Amanda::Configc::tapetype_name; @@ -71,18 +72,37 @@ package Amanda::Config; *holdingdisk_getconf = *Amanda::Configc::holdingdisk_getconf; *holdingdisk_name = *Amanda::Configc::holdingdisk_name; *holdingdisk_seen = *Amanda::Configc::holdingdisk_seen; +*lookup_application = *Amanda::Configc::lookup_application; +*application_getconf = *Amanda::Configc::application_getconf; +*application_name = *Amanda::Configc::application_name; +*application_seen = *Amanda::Configc::application_seen; +*lookup_pp_script = *Amanda::Configc::lookup_pp_script; +*pp_script_getconf = *Amanda::Configc::pp_script_getconf; +*pp_script_name = *Amanda::Configc::pp_script_name; +*pp_script_seen = *Amanda::Configc::pp_script_seen; +*lookup_device_config = *Amanda::Configc::lookup_device_config; +*device_config_getconf = *Amanda::Configc::device_config_getconf; +*device_config_name = *Amanda::Configc::device_config_name; +*device_config_seen = *Amanda::Configc::device_config_seen; +*lookup_changer_config = *Amanda::Configc::lookup_changer_config; +*changer_config_getconf = *Amanda::Configc::changer_config_getconf; +*changer_config_name = *Amanda::Configc::changer_config_name; +*changer_config_seen = *Amanda::Configc::changer_config_seen; *getconf_unit_divisor = *Amanda::Configc::getconf_unit_divisor; -*new_config_overwrites = *Amanda::Configc::new_config_overwrites; -*free_config_overwrites = *Amanda::Configc::free_config_overwrites; -*add_config_overwrite = *Amanda::Configc::add_config_overwrite; -*add_config_overwrite_opt = *Amanda::Configc::add_config_overwrite_opt; -*apply_config_overwrites = *Amanda::Configc::apply_config_overwrites; *config_init = *Amanda::Configc::config_init; *config_uninit = *Amanda::Configc::config_uninit; *get_config_options = *Amanda::Configc::get_config_options; *get_config_name = *Amanda::Configc::get_config_name; *get_config_dir = *Amanda::Configc::get_config_dir; *get_config_filename = *Amanda::Configc::get_config_filename; +*config_print_errors = *Amanda::Configc::config_print_errors; +*config_clear_errors = *Amanda::Configc::config_clear_errors; +*config_errors = *Amanda::Configc::config_errors; +*new_config_overwrites = *Amanda::Configc::new_config_overwrites; +*free_config_overwrites = *Amanda::Configc::free_config_overwrites; +*add_config_overwrite = *Amanda::Configc::add_config_overwrite; +*add_config_overwrite_opt = *Amanda::Configc::add_config_overwrite_opt; +*apply_config_overwrites = *Amanda::Configc::apply_config_overwrites; *dump_configuration = *Amanda::Configc::dump_configuration; *config_dir_relative = *Amanda::Configc::config_dir_relative; *taperalgo2str = *Amanda::Configc::taperalgo2str; @@ -102,10 +122,12 @@ package Amanda::Config; *CNF_CLIENT_USERNAME = *Amanda::Configc::CNF_CLIENT_USERNAME; *CNF_GNUTAR_LIST_DIR = *Amanda::Configc::CNF_GNUTAR_LIST_DIR; *CNF_AMANDATES = *Amanda::Configc::CNF_AMANDATES; +*CNF_MAILER = *Amanda::Configc::CNF_MAILER; *CNF_MAILTO = *Amanda::Configc::CNF_MAILTO; *CNF_DUMPUSER = *Amanda::Configc::CNF_DUMPUSER; *CNF_TAPEDEV = *Amanda::Configc::CNF_TAPEDEV; *CNF_DEVICE_PROPERTY = *Amanda::Configc::CNF_DEVICE_PROPERTY; +*CNF_PROPERTY = *Amanda::Configc::CNF_PROPERTY; *CNF_CHANGERDEV = *Amanda::Configc::CNF_CHANGERDEV; *CNF_CHANGERFILE = *Amanda::Configc::CNF_CHANGERFILE; *CNF_LABELSTR = *Amanda::Configc::CNF_LABELSTR; @@ -218,12 +240,31 @@ package Amanda::Config; *DUMPTYPE_KENCRYPT = *Amanda::Configc::DUMPTYPE_KENCRYPT; *DUMPTYPE_IGNORE = *Amanda::Configc::DUMPTYPE_IGNORE; *DUMPTYPE_INDEX = *Amanda::Configc::DUMPTYPE_INDEX; +*DUMPTYPE_APPLICATION = *Amanda::Configc::DUMPTYPE_APPLICATION; +*DUMPTYPE_PP_SCRIPTLIST = *Amanda::Configc::DUMPTYPE_PP_SCRIPTLIST; +*DUMPTYPE_PROPERTY = *Amanda::Configc::DUMPTYPE_PROPERTY; *INTER_COMMENT = *Amanda::Configc::INTER_COMMENT; *INTER_MAXUSAGE = *Amanda::Configc::INTER_MAXUSAGE; *HOLDING_COMMENT = *Amanda::Configc::HOLDING_COMMENT; *HOLDING_DISKDIR = *Amanda::Configc::HOLDING_DISKDIR; *HOLDING_DISKSIZE = *Amanda::Configc::HOLDING_DISKSIZE; *HOLDING_CHUNKSIZE = *Amanda::Configc::HOLDING_CHUNKSIZE; +*APPLICATION_COMMENT = *Amanda::Configc::APPLICATION_COMMENT; +*APPLICATION_PLUGIN = *Amanda::Configc::APPLICATION_PLUGIN; +*APPLICATION_PROPERTY = *Amanda::Configc::APPLICATION_PROPERTY; +*PP_SCRIPT_COMMENT = *Amanda::Configc::PP_SCRIPT_COMMENT; +*PP_SCRIPT_PLUGIN = *Amanda::Configc::PP_SCRIPT_PLUGIN; +*PP_SCRIPT_PROPERTY = *Amanda::Configc::PP_SCRIPT_PROPERTY; +*PP_SCRIPT_EXECUTE_ON = *Amanda::Configc::PP_SCRIPT_EXECUTE_ON; +*PP_SCRIPT_EXECUTE_WHERE = *Amanda::Configc::PP_SCRIPT_EXECUTE_WHERE; +*DEVICE_CONFIG_COMMENT = *Amanda::Configc::DEVICE_CONFIG_COMMENT; +*DEVICE_CONFIG_TAPEDEV = *Amanda::Configc::DEVICE_CONFIG_TAPEDEV; +*DEVICE_CONFIG_DEVICE_PROPERTY = *Amanda::Configc::DEVICE_CONFIG_DEVICE_PROPERTY; +*CHANGER_CONFIG_COMMENT = *Amanda::Configc::CHANGER_CONFIG_COMMENT; +*CHANGER_CONFIG_TAPEDEV = *Amanda::Configc::CHANGER_CONFIG_TAPEDEV; +*CHANGER_CONFIG_TPCHANGER = *Amanda::Configc::CHANGER_CONFIG_TPCHANGER; +*CHANGER_CONFIG_CHANGERDEV = *Amanda::Configc::CHANGER_CONFIG_CHANGERDEV; +*CHANGER_CONFIG_CHANGERFILE = *Amanda::Configc::CHANGER_CONFIG_CHANGERFILE; *HOLD_NEVER = *Amanda::Configc::HOLD_NEVER; *HOLD_AUTO = *Amanda::Configc::HOLD_AUTO; *HOLD_REQUIRED = *Amanda::Configc::HOLD_REQUIRED; @@ -254,6 +295,22 @@ package Amanda::Config; *ALGO_LARGESTFIT = *Amanda::Configc::ALGO_LARGESTFIT; *ALGO_SMALLEST = *Amanda::Configc::ALGO_SMALLEST; *ALGO_LAST = *Amanda::Configc::ALGO_LAST; +*EXECUTE_ON_PRE_DLE_AMCHECK = *Amanda::Configc::EXECUTE_ON_PRE_DLE_AMCHECK; +*EXECUTE_ON_PRE_HOST_AMCHECK = *Amanda::Configc::EXECUTE_ON_PRE_HOST_AMCHECK; +*EXECUTE_ON_POST_DLE_AMCHECK = *Amanda::Configc::EXECUTE_ON_POST_DLE_AMCHECK; +*EXECUTE_ON_POST_HOST_AMCHECK = *Amanda::Configc::EXECUTE_ON_POST_HOST_AMCHECK; +*EXECUTE_ON_PRE_DLE_ESTIMATE = *Amanda::Configc::EXECUTE_ON_PRE_DLE_ESTIMATE; +*EXECUTE_ON_PRE_HOST_ESTIMATE = *Amanda::Configc::EXECUTE_ON_PRE_HOST_ESTIMATE; +*EXECUTE_ON_POST_DLE_ESTIMATE = *Amanda::Configc::EXECUTE_ON_POST_DLE_ESTIMATE; +*EXECUTE_ON_POST_HOST_ESTIMATE = *Amanda::Configc::EXECUTE_ON_POST_HOST_ESTIMATE; +*EXECUTE_ON_PRE_DLE_BACKUP = *Amanda::Configc::EXECUTE_ON_PRE_DLE_BACKUP; +*EXECUTE_ON_PRE_HOST_BACKUP = *Amanda::Configc::EXECUTE_ON_PRE_HOST_BACKUP; +*EXECUTE_ON_POST_DLE_BACKUP = *Amanda::Configc::EXECUTE_ON_POST_DLE_BACKUP; +*EXECUTE_ON_POST_HOST_BACKUP = *Amanda::Configc::EXECUTE_ON_POST_HOST_BACKUP; +*SEND_AMREPORT_ALL = *Amanda::Configc::SEND_AMREPORT_ALL; +*SEND_AMREPORT_STRANGE = *Amanda::Configc::SEND_AMREPORT_STRANGE; +*SEND_AMREPORT_ERROR = *Amanda::Configc::SEND_AMREPORT_ERROR; +*SEND_AMREPORT_NEVER = *Amanda::Configc::SEND_AMREPORT_NEVER; *debug_amandad = *Amanda::Configc::debug_amandad; *debug_amidxtaped = *Amanda::Configc::debug_amidxtaped; *debug_amindexd = *Amanda::Configc::debug_amindexd; @@ -270,11 +327,13 @@ package Amanda::Config; *debug_selfcheck = *Amanda::Configc::debug_selfcheck; *debug_sendsize = *Amanda::Configc::debug_sendsize; *debug_sendbackup = *Amanda::Configc::debug_sendbackup; +*CFGERR_OK = *Amanda::Configc::CFGERR_OK; +*CFGERR_WARNINGS = *Amanda::Configc::CFGERR_WARNINGS; +*CFGERR_ERRORS = *Amanda::Configc::CFGERR_ERRORS; *CONFIG_INIT_EXPLICIT_NAME = *Amanda::Configc::CONFIG_INIT_EXPLICIT_NAME; *CONFIG_INIT_USE_CWD = *Amanda::Configc::CONFIG_INIT_USE_CWD; *CONFIG_INIT_CLIENT = *Amanda::Configc::CONFIG_INIT_CLIENT; *CONFIG_INIT_OVERLAY = *Amanda::Configc::CONFIG_INIT_OVERLAY; -*CONFIG_INIT_FATAL = *Amanda::Configc::CONFIG_INIT_FATAL; @EXPORT_OK = (); %EXPORT_TAGS = (); @@ -329,9 +388,6 @@ is loaded. =item If C is given, then any existing configuration is not reset. -=item If C is given, then any errors are considered -fatal, and C does not return. - =back See C for more detailed information on these flags and @@ -346,6 +402,19 @@ and filename (C) are available from C, C, and C, respectively. +=head3 CONFIG ERRORS + +This module collects configuration errors and warnings in a list, and also +tracks the overall error level with an enumeration: C<$CFGERR_OK>, +C<$CFGERR_WARNINGS>, and C<$CFGERR_ERRORS>. C and +C both return the current level. The level and the +list of error messages are available from C: + + my ($cfgerr_level, @errors) = Amanda::Configconfig_errors(); + +As a convenience, C will print all error messages to +stderr. The error state can be cleared with C. + =head2 CONFIG OVERWRITES Most Amanda applications accept the command-line option C<-o> @@ -434,6 +503,10 @@ with constants beginning with C<$TAPETYPE_> with constants beginning with C<$DUMPTYPE_> +=item C + +with constants beginning with C<$INTER_> + =item C with constants beginning with C<$HOLDING_> @@ -446,14 +519,28 @@ with constants beginning with C<$APPLICATION_> with constants beginning with C<$PP_SCRIPT_> +=item C + +with constants beginning with C<$DEVICE_CONFIG_>. + +=item C + +with constants beginning with C<$CHANGER_CONFIG_>. + =back See C for the names of the constants themselves. -Parameter values are available by name from C. -This function implements the C syntax advertised by -C to access values in subsections. C -returns a list of the names of all subsections of the given type. +Parameter values are available by name from C and +C. These functions implement +the C syntax advertised by C to access values in +subsections. The first function returns a perl value, while the second returns +a string suitable for use in C, including quotes around strings if +C<$str_needs_quotes> is true. + +C returns a list of the names of all subsections of the +given type. C<%subsection_names> is a hash whose keys are allowed subsection +names. The C<$CNF_DISPLAYUNIT> implies a certain divisor to convert from kilobytes to the desired unit. This divisor is available from @@ -557,6 +644,11 @@ push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_AMANDATES); $_confparm_key_VALUES{"CNF_AMANDATES"} = $CNF_AMANDATES; +push @EXPORT_OK, qw($CNF_MAILER); +push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAILER); + +$_confparm_key_VALUES{"CNF_MAILER"} = $CNF_MAILER; + push @EXPORT_OK, qw($CNF_MAILTO); push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_MAILTO); @@ -577,6 +669,11 @@ push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_DEVICE_PROPERTY); $_confparm_key_VALUES{"CNF_DEVICE_PROPERTY"} = $CNF_DEVICE_PROPERTY; +push @EXPORT_OK, qw($CNF_PROPERTY); +push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_PROPERTY); + +$_confparm_key_VALUES{"CNF_PROPERTY"} = $CNF_PROPERTY; + push @EXPORT_OK, qw($CNF_CHANGERDEV); push @{$EXPORT_TAGS{"confparm_key"}}, qw($CNF_CHANGERDEV); @@ -1185,6 +1282,21 @@ push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_INDEX); $_dumptype_key_VALUES{"DUMPTYPE_INDEX"} = $DUMPTYPE_INDEX; +push @EXPORT_OK, qw($DUMPTYPE_APPLICATION); +push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_APPLICATION); + +$_dumptype_key_VALUES{"DUMPTYPE_APPLICATION"} = $DUMPTYPE_APPLICATION; + +push @EXPORT_OK, qw($DUMPTYPE_PP_SCRIPTLIST); +push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PP_SCRIPTLIST); + +$_dumptype_key_VALUES{"DUMPTYPE_PP_SCRIPTLIST"} = $DUMPTYPE_PP_SCRIPTLIST; + +push @EXPORT_OK, qw($DUMPTYPE_PROPERTY); +push @{$EXPORT_TAGS{"dumptype_key"}}, qw($DUMPTYPE_PROPERTY); + +$_dumptype_key_VALUES{"DUMPTYPE_PROPERTY"} = $DUMPTYPE_PROPERTY; + #copy symbols in dumptype_key to getconf push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"dumptype_key"}}; @@ -1266,6 +1378,182 @@ $_holdingdisk_key_VALUES{"HOLDING_CHUNKSIZE"} = $HOLDING_CHUNKSIZE; #copy symbols in holdingdisk_key to getconf push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"holdingdisk_key"}}; +push @EXPORT_OK, qw(application_key_to_string); +push @{$EXPORT_TAGS{"application_key"}}, qw(application_key_to_string); + +my %_application_key_VALUES; +#Convert an enum value to a single string +sub application_key_to_string { + my ($enumval) = @_; + + for my $k (keys %_application_key_VALUES) { + my $v = $_application_key_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($APPLICATION_COMMENT); +push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_COMMENT); + +$_application_key_VALUES{"APPLICATION_COMMENT"} = $APPLICATION_COMMENT; + +push @EXPORT_OK, qw($APPLICATION_PLUGIN); +push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_PLUGIN); + +$_application_key_VALUES{"APPLICATION_PLUGIN"} = $APPLICATION_PLUGIN; + +push @EXPORT_OK, qw($APPLICATION_PROPERTY); +push @{$EXPORT_TAGS{"application_key"}}, qw($APPLICATION_PROPERTY); + +$_application_key_VALUES{"APPLICATION_PROPERTY"} = $APPLICATION_PROPERTY; + +#copy symbols in application_key to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"application_key"}}; + +push @EXPORT_OK, qw(pp_script_key_to_string); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw(pp_script_key_to_string); + +my %_pp_script_key_VALUES; +#Convert an enum value to a single string +sub pp_script_key_to_string { + my ($enumval) = @_; + + for my $k (keys %_pp_script_key_VALUES) { + my $v = $_pp_script_key_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($PP_SCRIPT_COMMENT); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_COMMENT); + +$_pp_script_key_VALUES{"PP_SCRIPT_COMMENT"} = $PP_SCRIPT_COMMENT; + +push @EXPORT_OK, qw($PP_SCRIPT_PLUGIN); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_PLUGIN); + +$_pp_script_key_VALUES{"PP_SCRIPT_PLUGIN"} = $PP_SCRIPT_PLUGIN; + +push @EXPORT_OK, qw($PP_SCRIPT_PROPERTY); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_PROPERTY); + +$_pp_script_key_VALUES{"PP_SCRIPT_PROPERTY"} = $PP_SCRIPT_PROPERTY; + +push @EXPORT_OK, qw($PP_SCRIPT_EXECUTE_ON); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_EXECUTE_ON); + +$_pp_script_key_VALUES{"PP_SCRIPT_EXECUTE_ON"} = $PP_SCRIPT_EXECUTE_ON; + +push @EXPORT_OK, qw($PP_SCRIPT_EXECUTE_WHERE); +push @{$EXPORT_TAGS{"pp_script_key"}}, qw($PP_SCRIPT_EXECUTE_WHERE); + +$_pp_script_key_VALUES{"PP_SCRIPT_EXECUTE_WHERE"} = $PP_SCRIPT_EXECUTE_WHERE; + +#copy symbols in pp_script_key to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"pp_script_key"}}; + +push @EXPORT_OK, qw(device_config_key_to_string); +push @{$EXPORT_TAGS{"device_config_key"}}, qw(device_config_key_to_string); + +my %_device_config_key_VALUES; +#Convert an enum value to a single string +sub device_config_key_to_string { + my ($enumval) = @_; + + for my $k (keys %_device_config_key_VALUES) { + my $v = $_device_config_key_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($DEVICE_CONFIG_COMMENT); +push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_COMMENT); + +$_device_config_key_VALUES{"DEVICE_CONFIG_COMMENT"} = $DEVICE_CONFIG_COMMENT; + +push @EXPORT_OK, qw($DEVICE_CONFIG_TAPEDEV); +push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_TAPEDEV); + +$_device_config_key_VALUES{"DEVICE_CONFIG_TAPEDEV"} = $DEVICE_CONFIG_TAPEDEV; + +push @EXPORT_OK, qw($DEVICE_CONFIG_DEVICE_PROPERTY); +push @{$EXPORT_TAGS{"device_config_key"}}, qw($DEVICE_CONFIG_DEVICE_PROPERTY); + +$_device_config_key_VALUES{"DEVICE_CONFIG_DEVICE_PROPERTY"} = $DEVICE_CONFIG_DEVICE_PROPERTY; + +#copy symbols in device_config_key to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"device_config_key"}}; + +push @EXPORT_OK, qw(changer_config_key_to_string); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw(changer_config_key_to_string); + +my %_changer_config_key_VALUES; +#Convert an enum value to a single string +sub changer_config_key_to_string { + my ($enumval) = @_; + + for my $k (keys %_changer_config_key_VALUES) { + my $v = $_changer_config_key_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($CHANGER_CONFIG_COMMENT); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_COMMENT); + +$_changer_config_key_VALUES{"CHANGER_CONFIG_COMMENT"} = $CHANGER_CONFIG_COMMENT; + +push @EXPORT_OK, qw($CHANGER_CONFIG_TAPEDEV); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_TAPEDEV); + +$_changer_config_key_VALUES{"CHANGER_CONFIG_TAPEDEV"} = $CHANGER_CONFIG_TAPEDEV; + +push @EXPORT_OK, qw($CHANGER_CONFIG_TPCHANGER); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_TPCHANGER); + +$_changer_config_key_VALUES{"CHANGER_CONFIG_TPCHANGER"} = $CHANGER_CONFIG_TPCHANGER; + +push @EXPORT_OK, qw($CHANGER_CONFIG_CHANGERDEV); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_CHANGERDEV); + +$_changer_config_key_VALUES{"CHANGER_CONFIG_CHANGERDEV"} = $CHANGER_CONFIG_CHANGERDEV; + +push @EXPORT_OK, qw($CHANGER_CONFIG_CHANGERFILE); +push @{$EXPORT_TAGS{"changer_config_key"}}, qw($CHANGER_CONFIG_CHANGERFILE); + +$_changer_config_key_VALUES{"CHANGER_CONFIG_CHANGERFILE"} = $CHANGER_CONFIG_CHANGERFILE; + +#copy symbols in changer_config_key to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"changer_config_key"}}; + push @EXPORT_OK, qw(dump_holdingdisk_t_to_string); push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw(dump_holdingdisk_t_to_string); @@ -1560,10 +1848,140 @@ $_taperalgo_t_VALUES{"ALGO_LAST"} = $ALGO_LAST; #copy symbols in taperalgo_t to getconf push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"taperalgo_t"}}; +push @EXPORT_OK, qw(execute_on_t_to_string); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw(execute_on_t_to_string); + +my %_execute_on_t_VALUES; +#Convert an enum value to a single string +sub execute_on_t_to_string { + my ($enumval) = @_; + + for my $k (keys %_execute_on_t_VALUES) { + my $v = $_execute_on_t_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_AMCHECK); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_AMCHECK); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_DLE_AMCHECK"} = $EXECUTE_ON_PRE_DLE_AMCHECK; + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_HOST_AMCHECK); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_AMCHECK); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_AMCHECK"} = $EXECUTE_ON_PRE_HOST_AMCHECK; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_AMCHECK); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_AMCHECK); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_DLE_AMCHECK"} = $EXECUTE_ON_POST_DLE_AMCHECK; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_HOST_AMCHECK); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_HOST_AMCHECK); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_HOST_AMCHECK"} = $EXECUTE_ON_POST_HOST_AMCHECK; + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_ESTIMATE); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_ESTIMATE); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_DLE_ESTIMATE"} = $EXECUTE_ON_PRE_DLE_ESTIMATE; + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_HOST_ESTIMATE); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_ESTIMATE); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_ESTIMATE"} = $EXECUTE_ON_PRE_HOST_ESTIMATE; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_ESTIMATE); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_ESTIMATE); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_DLE_ESTIMATE"} = $EXECUTE_ON_POST_DLE_ESTIMATE; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_HOST_ESTIMATE); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_HOST_ESTIMATE); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_HOST_ESTIMATE"} = $EXECUTE_ON_POST_HOST_ESTIMATE; + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_BACKUP); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_BACKUP); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_DLE_BACKUP"} = $EXECUTE_ON_PRE_DLE_BACKUP; + +push @EXPORT_OK, qw($EXECUTE_ON_PRE_HOST_BACKUP); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_BACKUP); + +$_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_BACKUP"} = $EXECUTE_ON_PRE_HOST_BACKUP; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_BACKUP); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_BACKUP); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_DLE_BACKUP"} = $EXECUTE_ON_POST_DLE_BACKUP; + +push @EXPORT_OK, qw($EXECUTE_ON_POST_HOST_BACKUP); +push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_HOST_BACKUP); + +$_execute_on_t_VALUES{"EXECUTE_ON_POST_HOST_BACKUP"} = $EXECUTE_ON_POST_HOST_BACKUP; + +#copy symbols in execute_on_t to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"execute_on_t"}}; + +push @EXPORT_OK, qw(send_amreport_on_t_to_string); +push @{$EXPORT_TAGS{"send_amreport_on_t"}}, qw(send_amreport_on_t_to_string); + +my %_send_amreport_on_t_VALUES; +#Convert an enum value to a single string +sub send_amreport_on_t_to_string { + my ($enumval) = @_; + + for my $k (keys %_send_amreport_on_t_VALUES) { + my $v = $_send_amreport_on_t_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($SEND_AMREPORT_ALL); +push @{$EXPORT_TAGS{"send_amreport_on_t"}}, qw($SEND_AMREPORT_ALL); + +$_send_amreport_on_t_VALUES{"SEND_AMREPORT_ALL"} = $SEND_AMREPORT_ALL; + +push @EXPORT_OK, qw($SEND_AMREPORT_STRANGE); +push @{$EXPORT_TAGS{"send_amreport_on_t"}}, qw($SEND_AMREPORT_STRANGE); + +$_send_amreport_on_t_VALUES{"SEND_AMREPORT_STRANGE"} = $SEND_AMREPORT_STRANGE; + +push @EXPORT_OK, qw($SEND_AMREPORT_ERROR); +push @{$EXPORT_TAGS{"send_amreport_on_t"}}, qw($SEND_AMREPORT_ERROR); + +$_send_amreport_on_t_VALUES{"SEND_AMREPORT_ERROR"} = $SEND_AMREPORT_ERROR; + +push @EXPORT_OK, qw($SEND_AMREPORT_NEVER); +push @{$EXPORT_TAGS{"send_amreport_on_t"}}, qw($SEND_AMREPORT_NEVER); + +$_send_amreport_on_t_VALUES{"SEND_AMREPORT_NEVER"} = $SEND_AMREPORT_NEVER; + +#copy symbols in send_amreport_on_t to getconf +push @{$EXPORT_TAGS{"getconf"}}, @{$EXPORT_TAGS{"send_amreport_on_t"}}; + push @EXPORT_OK, qw(getconf getconf_seen - getconf_byname getconf_list); + getconf_byname getconf_byname_strs + getconf_list); push @{$EXPORT_TAGS{"getconf"}}, qw(getconf getconf_seen - getconf_byname getconf_list); + getconf_byname getconf_byname_strs + getconf_list); push @EXPORT_OK, qw(lookup_tapetype tapetype_getconf tapetype_name tapetype_seen tapetype_seen); @@ -1587,6 +2005,40 @@ push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_holdingdisk holdingdisk_getconf holdi getconf_holdingdisks holdingdisk_next holdingdisk_seen holdingdisk_seen); +push @EXPORT_OK, qw(lookup_application application_getconf application_name + application_seen application_seen); +push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_application application_getconf application_name + application_seen application_seen); + +push @EXPORT_OK, qw(lookup_pp_script pp_script_getconf pp_script_name + pp_script_seen pp_script_seen); +push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_pp_script pp_script_getconf pp_script_name + pp_script_seen pp_script_seen); + +push @EXPORT_OK, qw(lookup_device_config device_config_getconf device_config_name + device_config_seen device_config_seen); +push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_device_config device_config_getconf device_config_name + device_config_seen device_config_seen); + +push @EXPORT_OK, qw(lookup_changer_config changer_config_getconf changer_config_name + changer_config_seen changer_config_seen); +push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_changer_config changer_config_getconf changer_config_name + changer_config_seen changer_config_seen); + +our %subsection_names = ( + "tapetype" => 1, + "dumptype" => 1, + "interface" => 1, + "holdingdisk" => 1, + "application-tool" => 1, + "script-tool" => 1, + "device" => 1, + "changer" => 1, +); + +push @EXPORT_OK, qw(%subsection_names); +push @{$EXPORT_TAGS{"getconf"}}, qw(%subsection_names); + push @EXPORT_OK, qw(getconf_unit_divisor $debug_amandad $debug_amidxtaped $debug_amindexd $debug_amrecover @@ -1600,10 +2052,44 @@ push @{$EXPORT_TAGS{"getconf"}}, qw(getconf_unit_divisor $debug_planner $debug_driver $debug_dumper $debug_chunker $debug_taper $debug_selfcheck $debug_sendsize $debug_sendbackup); -push @EXPORT_OK, qw(new_config_overwrites free_config_overwrites add_config_overwrite - add_config_overwrite_opt apply_config_overwrites); -push @{$EXPORT_TAGS{"init"}}, qw(new_config_overwrites free_config_overwrites add_config_overwrite - add_config_overwrite_opt apply_config_overwrites); +push @EXPORT_OK, qw(cfgerr_level_t_to_string); +push @{$EXPORT_TAGS{"cfgerr_level_t"}}, qw(cfgerr_level_t_to_string); + +my %_cfgerr_level_t_VALUES; +#Convert an enum value to a single string +sub cfgerr_level_t_to_string { + my ($enumval) = @_; + + for my $k (keys %_cfgerr_level_t_VALUES) { + my $v = $_cfgerr_level_t_VALUES{$k}; + + #is this a matching flag? + if ($enumval == $v) { + return $k; + } + } + +#default, just return the number + return $enumval; +} + +push @EXPORT_OK, qw($CFGERR_OK); +push @{$EXPORT_TAGS{"cfgerr_level_t"}}, qw($CFGERR_OK); + +$_cfgerr_level_t_VALUES{"CFGERR_OK"} = $CFGERR_OK; + +push @EXPORT_OK, qw($CFGERR_WARNINGS); +push @{$EXPORT_TAGS{"cfgerr_level_t"}}, qw($CFGERR_WARNINGS); + +$_cfgerr_level_t_VALUES{"CFGERR_WARNINGS"} = $CFGERR_WARNINGS; + +push @EXPORT_OK, qw($CFGERR_ERRORS); +push @{$EXPORT_TAGS{"cfgerr_level_t"}}, qw($CFGERR_ERRORS); + +$_cfgerr_level_t_VALUES{"CFGERR_ERRORS"} = $CFGERR_ERRORS; + +#copy symbols in cfgerr_level_t to init +push @{$EXPORT_TAGS{"init"}}, @{$EXPORT_TAGS{"cfgerr_level_t"}}; push @EXPORT_OK, qw(config_init_flags_to_strings); push @{$EXPORT_TAGS{"config_init_flags"}}, qw(config_init_flags_to_strings); @@ -1651,23 +2137,19 @@ push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_OVERLAY); $_config_init_flags_VALUES{"CONFIG_INIT_OVERLAY"} = $CONFIG_INIT_OVERLAY; -push @EXPORT_OK, qw($CONFIG_INIT_FATAL); -push @{$EXPORT_TAGS{"config_init_flags"}}, qw($CONFIG_INIT_FATAL); - -$_config_init_flags_VALUES{"CONFIG_INIT_FATAL"} = $CONFIG_INIT_FATAL; - #copy symbols in config_init_flags to init push @{$EXPORT_TAGS{"init"}}, @{$EXPORT_TAGS{"config_init_flags"}}; -push @EXPORT_OK, qw(config_init config_uninit get_config_options); -push @{$EXPORT_TAGS{"init"}}, qw(config_init config_uninit get_config_options); - -push @EXPORT_OK, qw(get_config_name - get_config_dir - get_config_filename); -push @{$EXPORT_TAGS{"init"}}, qw(get_config_name - get_config_dir - get_config_filename); +push @EXPORT_OK, qw(config_init config_uninit get_config_options + get_config_name get_config_dir get_config_filename + config_print_errors config_clear_errors config_errors + new_config_overwrites free_config_overwrites add_config_overwrite + add_config_overwrite_opt apply_config_overwrites); +push @{$EXPORT_TAGS{"init"}}, qw(config_init config_uninit get_config_options + get_config_name get_config_dir get_config_filename + config_print_errors config_clear_errors config_errors + new_config_overwrites free_config_overwrites add_config_overwrite + add_config_overwrite_opt apply_config_overwrites); push @EXPORT_OK, qw(dump_configuration config_dir_relative taperalgo2str find_multiplier); 1; diff --git a/perl/Amanda/Config.swg b/perl/Amanda/Config.swg index ddeab5e..06f3564 100644 --- a/perl/Amanda/Config.swg +++ b/perl/Amanda/Config.swg @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ %module "Amanda::Config" @@ -77,9 +77,6 @@ is loaded. =item If C is given, then any existing configuration is not reset. -=item If C is given, then any errors are considered -fatal, and C does not return. - =back See C for more detailed information on these flags and @@ -94,6 +91,19 @@ and filename (C) are available from C, C, and C, respectively. +=head3 CONFIG ERRORS + +This module collects configuration errors and warnings in a list, and also +tracks the overall error level with an enumeration: C<$CFGERR_OK>, +C<$CFGERR_WARNINGS>, and C<$CFGERR_ERRORS>. C and +C both return the current level. The level and the +list of error messages are available from C: + + my ($cfgerr_level, @errors) = Amanda::Configconfig_errors(); + +As a convenience, C will print all error messages to +stderr. The error state can be cleared with C. + =head2 CONFIG OVERWRITES Most Amanda applications accept the command-line option C<-o> @@ -182,6 +192,10 @@ with constants beginning with C<$TAPETYPE_> with constants beginning with C<$DUMPTYPE_> +=item C + +with constants beginning with C<$INTER_> + =item C with constants beginning with C<$HOLDING_> @@ -194,14 +208,28 @@ with constants beginning with C<$APPLICATION_> with constants beginning with C<$PP_SCRIPT_> +=item C + +with constants beginning with C<$DEVICE_CONFIG_>. + +=item C + +with constants beginning with C<$CHANGER_CONFIG_>. + =back See C for the names of the constants themselves. -Parameter values are available by name from C. -This function implements the C syntax advertised by -C to access values in subsections. C -returns a list of the names of all subsections of the given type. +Parameter values are available by name from C and +C. These functions implement +the C syntax advertised by C to access values in +subsections. The first function returns a perl value, while the second returns +a string suitable for use in C, including quotes around strings if +C<$str_needs_quotes> is true. + +C returns a list of the names of all subsections of the +given type. C<%subsection_names> is a hash whose keys are allowed subsection +names. The C<$CNF_DISPLAYUNIT> implies a certain divisor to convert from kilobytes to the desired unit. This divisor is available from @@ -252,10 +280,12 @@ amglue_add_constant(CNF_AMANDAD_PATH, confparm_key); amglue_add_constant(CNF_CLIENT_USERNAME, confparm_key); amglue_add_constant(CNF_GNUTAR_LIST_DIR, confparm_key); amglue_add_constant(CNF_AMANDATES, confparm_key); +amglue_add_constant(CNF_MAILER, confparm_key); amglue_add_constant(CNF_MAILTO, confparm_key); amglue_add_constant(CNF_DUMPUSER, confparm_key); amglue_add_constant(CNF_TAPEDEV, confparm_key); amglue_add_constant(CNF_DEVICE_PROPERTY, confparm_key); +amglue_add_constant(CNF_PROPERTY, confparm_key); amglue_add_constant(CNF_CHANGERDEV, confparm_key); amglue_add_constant(CNF_CHANGERFILE, confparm_key); amglue_add_constant(CNF_LABELSTR, confparm_key); @@ -374,6 +404,9 @@ amglue_add_constant(DUMPTYPE_HOLDINGDISK, dumptype_key); amglue_add_constant(DUMPTYPE_KENCRYPT, dumptype_key); amglue_add_constant(DUMPTYPE_IGNORE, dumptype_key); amglue_add_constant(DUMPTYPE_INDEX, dumptype_key); +amglue_add_constant(DUMPTYPE_APPLICATION, dumptype_key); +amglue_add_constant(DUMPTYPE_PP_SCRIPTLIST, dumptype_key); +amglue_add_constant(DUMPTYPE_PROPERTY, dumptype_key); amglue_copy_to_tag(dumptype_key, getconf); amglue_add_enum_tag_fns(interface_key); @@ -388,6 +421,34 @@ amglue_add_constant(HOLDING_DISKSIZE, holdingdisk_key); amglue_add_constant(HOLDING_CHUNKSIZE, holdingdisk_key); amglue_copy_to_tag(holdingdisk_key, getconf); +amglue_add_enum_tag_fns(application_key); +amglue_add_constant(APPLICATION_COMMENT, application_key); +amglue_add_constant(APPLICATION_PLUGIN, application_key); +amglue_add_constant(APPLICATION_PROPERTY, application_key); +amglue_copy_to_tag(application_key, getconf); + +amglue_add_enum_tag_fns(pp_script_key); +amglue_add_constant(PP_SCRIPT_COMMENT, pp_script_key); +amglue_add_constant(PP_SCRIPT_PLUGIN, pp_script_key); +amglue_add_constant(PP_SCRIPT_PROPERTY, pp_script_key); +amglue_add_constant(PP_SCRIPT_EXECUTE_ON, pp_script_key); +amglue_add_constant(PP_SCRIPT_EXECUTE_WHERE, pp_script_key); +amglue_copy_to_tag(pp_script_key, getconf); + +amglue_add_enum_tag_fns(device_config_key); +amglue_add_constant(DEVICE_CONFIG_COMMENT, device_config_key); +amglue_add_constant(DEVICE_CONFIG_TAPEDEV, device_config_key); +amglue_add_constant(DEVICE_CONFIG_DEVICE_PROPERTY, device_config_key); +amglue_copy_to_tag(device_config_key, getconf); + +amglue_add_enum_tag_fns(changer_config_key); +amglue_add_constant(CHANGER_CONFIG_COMMENT, changer_config_key); +amglue_add_constant(CHANGER_CONFIG_TAPEDEV, changer_config_key); +amglue_add_constant(CHANGER_CONFIG_TPCHANGER, changer_config_key); +amglue_add_constant(CHANGER_CONFIG_CHANGERDEV, changer_config_key); +amglue_add_constant(CHANGER_CONFIG_CHANGERFILE, changer_config_key); +amglue_copy_to_tag(changer_config_key, getconf); + /* * Various enumerated conftypes */ @@ -440,143 +501,175 @@ amglue_add_constant(ALGO_SMALLEST, taperalgo_t); amglue_add_constant(ALGO_LAST, taperalgo_t); amglue_copy_to_tag(taperalgo_t, getconf); +amglue_add_enum_tag_fns(execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_DLE_AMCHECK, execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_HOST_AMCHECK, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_DLE_AMCHECK, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_HOST_AMCHECK, execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_DLE_ESTIMATE, execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_HOST_ESTIMATE, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_DLE_ESTIMATE, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_HOST_ESTIMATE, execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_DLE_BACKUP, execute_on_t); +amglue_add_constant(EXECUTE_ON_PRE_HOST_BACKUP, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_DLE_BACKUP, execute_on_t); +amglue_add_constant(EXECUTE_ON_POST_HOST_BACKUP, execute_on_t); +amglue_copy_to_tag(execute_on_t, getconf); + +amglue_add_enum_tag_fns(send_amreport_on_t); +amglue_add_constant(SEND_AMREPORT_ALL, send_amreport_on_t); +amglue_add_constant(SEND_AMREPORT_STRANGE, send_amreport_on_t); +amglue_add_constant(SEND_AMREPORT_ERROR, send_amreport_on_t); +amglue_add_constant(SEND_AMREPORT_NEVER, send_amreport_on_t); +amglue_copy_to_tag(send_amreport_on_t, getconf); + /* * val_t typemaps */ /* Typemap to convert a val_t, the union in which config values are * stored, to a Perl value of the appropriate type. This converts: - * - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_AM64, + * - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_INT64, * CONFTYPE_BOOLEAN -> IV * - CONFTYPE_REAL -> NV * - CONFTYPE_STR, CONFTYPE_IDENT -> PV * - CONFTYPE_TIME -> IV (epoch timestamp) * - CONFTYPE_COMPRESS, CONFTYPE_ENCRYPT, CONFTYPE_ESTIMATE, CONFTYPE_STRATEGY, - * CONFTYPE_TAPERALGO, CONFTYPE_PRIORITY, CONFTYPE_HOLDING -> IV (enums) + * CONFTYPE_TAPERALGO, CONFTYPE_PRIORITY, CONFTYPE_HOLDING, CONFTYPE_EXECUTE_ON, + * CONFTYPE_EXECUTE_WHERE, SEND_AMREPORT_ON -> IV (enums) * - CONFTYPE_RATE -> list of two NVs * - CONFTYPE_INTRANGE -> list of two IVs * - CONFTYPE_EXINCLUDE -> hashref with keys 'list' (listref), 'file' (listref), * and 'optional' (int) - * - CONFTYPE_PROPLIST -> hashref + * - CONFTYPE_PROPLIST -> hashref of hashref with keys 'append' (IV), 'priority' (IV), + * 'values' (listref) */ %typemap (out) val_t * { - switch ($1->type) { - case CONFTYPE_RATE: { - $result= sv_newmortal(); - sv_setnv($result, val_t__rate($1)[0]); - argvi++; - - $result= sv_newmortal(); - sv_setnv($result, val_t__rate($1)[1]); - argvi++; - break; - } + if (!$1) { + $result = &PL_sv_undef; + argvi++; + } else { + switch ($1->type) { + case CONFTYPE_RATE: { + $result= sv_newmortal(); + sv_setnv($result, val_t__rate($1)[0]); + argvi++; + + $result= sv_newmortal(); + sv_setnv($result, val_t__rate($1)[1]); + argvi++; + break; + } - case CONFTYPE_INTRANGE: { - $result= sv_newmortal(); - sv_setiv($result, val_t__intrange($1)[0]); - argvi++; + case CONFTYPE_INTRANGE: { + $result= sv_newmortal(); + sv_setiv($result, val_t__intrange($1)[0]); + argvi++; - $result= sv_newmortal(); - sv_setiv($result, val_t__intrange($1)[1]); - argvi++; - break; - break; - } + $result= sv_newmortal(); + sv_setiv($result, val_t__intrange($1)[1]); + argvi++; + break; + break; + } - case CONFTYPE_EXINCLUDE: { - /* exincludes are represented in perl as { - * 'list' : [ 'list1', 'list2', ..], - * 'file' : [ 'file1', 'file2', ..], - * 'optional' : 1, - * } - */ - exinclude_t *ei = &val_t__exinclude($1); - AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); - AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); - SV *optional = sv_newmortal(); - HV *hv; - sle_t *iter; - - /* first set up each of the hash values */ - - if (ei->sl_list) { - for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { - av_push(list_entries, newSVpv(iter->name, 0)); + case CONFTYPE_EXINCLUDE: { + /* exincludes are represented in perl as { + * 'list' : [ 'list1', 'list2', ..], + * 'file' : [ 'file1', 'file2', ..], + * 'optional' : 1, + * } + */ + exinclude_t *ei = &val_t__exinclude($1); + AV *list_entries = (AV *)sv_2mortal((SV *)newAV()); + AV *file_entries = (AV *)sv_2mortal((SV *)newAV()); + SV *optional = sv_newmortal(); + HV *hv; + sle_t *iter; + + /* first set up each of the hash values */ + + if (ei->sl_list) { + for (iter = ei->sl_list->first; iter != NULL; iter = iter->next) { + av_push(list_entries, newSVpv(iter->name, 0)); + } } - } - if(ei->sl_file) { - for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { - av_push(file_entries, newSVpv(iter->name, 0)); + if(ei->sl_file) { + for (iter = ei->sl_file->first; iter != NULL; iter = iter->next) { + av_push(file_entries, newSVpv(iter->name, 0)); + } } - } - sv_setiv(optional, ei->optional); + sv_setiv(optional, ei->optional); - /* now build the hash */ - hv = (HV *)sv_2mortal((SV *)newHV()); - - hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); - hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); - hv_store(hv, "optional", 8, optional, 0); - SvREFCNT_inc(optional); + /* now build the hash */ + hv = (HV *)sv_2mortal((SV *)newHV()); + + hv_store(hv, "file", 4, newRV((SV *)file_entries), 0); + hv_store(hv, "list", 4, newRV((SV *)list_entries), 0); + hv_store(hv, "optional", 8, optional, 0); + SvREFCNT_inc(optional); - $result = sv_2mortal(newRV((SV *)hv)); - argvi++; - break; - } + $result = sv_2mortal(newRV((SV *)hv)); + argvi++; + break; + } - case CONFTYPE_PROPLIST: - $result = sv_2mortal(g_hash_table_to_hashref(val_t__proplist($1))); - argvi++; - break; - - case CONFTYPE_SIZE: - $result = sv_2mortal(amglue_newSVi64(val_t__size($1))); - argvi++; - break; - - case CONFTYPE_AM64: - $result = sv_2mortal(amglue_newSVi64(val_t__am64($1))); - argvi++; - break; - - case CONFTYPE_BOOLEAN: /* all same as INT.. */ - case CONFTYPE_COMPRESS: - case CONFTYPE_ENCRYPT: - case CONFTYPE_ESTIMATE: - case CONFTYPE_STRATEGY: - case CONFTYPE_TAPERALGO: - case CONFTYPE_PRIORITY: - case CONFTYPE_HOLDING: - case CONFTYPE_INT: - $result = sv_2mortal(amglue_newSVi64(val_t__int($1))); - argvi++; - break; - - case CONFTYPE_TIME: - $result = sv_2mortal(amglue_newSVi64(val_t__time($1))); - argvi++; - break; - - case CONFTYPE_REAL: - $result = sv_newmortal(); - sv_setnv($result, val_t__real($1)); - argvi++; - break; - - case CONFTYPE_IDENT: /* same as STRING */ - case CONFTYPE_STR: - $result = sv_newmortal(); - sv_setpv($result, val_t__str($1)); - argvi++; - break; - - /* No match yet -> not one of the "complex" types */ - default: - SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); - break; + case CONFTYPE_PROPLIST: + $result = sv_2mortal(g_hash_table_to_hashref_property(val_t__proplist($1))); + argvi++; + break; + + case CONFTYPE_SIZE: + $result = sv_2mortal(amglue_newSVi64(val_t__size($1))); + argvi++; + break; + + case CONFTYPE_INT64: + $result = sv_2mortal(amglue_newSVi64(val_t__int64($1))); + argvi++; + break; + + case CONFTYPE_BOOLEAN: /* all same as INT.. */ + case CONFTYPE_COMPRESS: + case CONFTYPE_ENCRYPT: + case CONFTYPE_ESTIMATE: + case CONFTYPE_STRATEGY: + case CONFTYPE_TAPERALGO: + case CONFTYPE_PRIORITY: + case CONFTYPE_HOLDING: + case CONFTYPE_EXECUTE_ON: + case CONFTYPE_EXECUTE_WHERE: + case CONFTYPE_SEND_AMREPORT_ON: + case CONFTYPE_INT: + $result = sv_2mortal(amglue_newSVi64(val_t__int($1))); + argvi++; + break; + + case CONFTYPE_TIME: + $result = sv_2mortal(amglue_newSVi64(val_t__time($1))); + argvi++; + break; + + case CONFTYPE_REAL: + $result = sv_newmortal(); + sv_setnv($result, val_t__real($1)); + argvi++; + break; + + case CONFTYPE_IDENT: /* same as STRING */ + case CONFTYPE_STR: + $result = sv_newmortal(); + sv_setpv($result, val_t__str($1)); + argvi++; + break; + + /* No match yet -> not one of the "complex" types */ + default: + SWIG_exception(SWIG_TypeError, "Unknown val_t conftype"); + break; + } } } @@ -596,13 +689,37 @@ amglue_copy_to_tag(taperalgo_t, getconf); g_slist_free($1); } +/* typedef and typemap for getconf_byname_strs, which is like getconf_byname, + * but converts the result with val_t_dispaly_strs + */ +%typemap (out) val_t_strs { + char **it = $1; + + while (it && *it) { + $result = sv_2mortal(newSVpv(*it, 0)); + argvi++; + it++; + } + g_strfreev($1); +} + val_t *getconf(confparm_key key); gboolean getconf_seen(confparm_key key); val_t *getconf_byname(char *key); GSList *getconf_list(char *listname); +%inline %{ +typedef char **val_t_strs; +val_t_strs getconf_byname_strs(char *key, int str_needs_quotes) { + val_t *val = getconf_byname(key); + if (!val) return NULL; + return val_t_display_strs(val, str_needs_quotes); +} +%} + amglue_export_tag(getconf, getconf getconf_seen - getconf_byname getconf_list + getconf_byname getconf_byname_strs + getconf_list ); tapetype_t *lookup_tapetype(char *identifier); @@ -644,6 +761,56 @@ amglue_export_tag(getconf, holdingdisk_seen holdingdisk_seen ); +application_t *lookup_application(char *identifier); +val_t *application_getconf(application_t *app, application_key key); +char *application_name(application_t *app); +gboolean application_seen(application_t *app, application_key key); +amglue_export_tag(getconf, + lookup_application application_getconf application_name + application_seen application_seen +); + +pp_script_t *lookup_pp_script(char *identifier); +val_t *pp_script_getconf(pp_script_t *pps, pp_script_key key); +char *pp_script_name(pp_script_t *pps); +gboolean pp_script_seen(pp_script_t *app, pp_script_key key); +amglue_export_tag(getconf, + lookup_pp_script pp_script_getconf pp_script_name + pp_script_seen pp_script_seen +); + +device_config_t *lookup_device_config(char *identifier); +val_t *device_config_getconf(device_config_t *pps, device_config_key key); +char *device_config_name(device_config_t *pps); +gboolean device_config_seen(device_config_t *app, device_config_key key); +amglue_export_tag(getconf, + lookup_device_config device_config_getconf device_config_name + device_config_seen device_config_seen +); + +changer_config_t *lookup_changer_config(char *identifier); +val_t *changer_config_getconf(changer_config_t *pps, changer_config_key key); +char *changer_config_name(changer_config_t *pps); +gboolean changer_config_seen(changer_config_t *app, changer_config_key key); +amglue_export_tag(getconf, + lookup_changer_config changer_config_getconf changer_config_name + changer_config_seen changer_config_seen +); + +%perlcode %{ +our %subsection_names = ( + "tapetype" => 1, + "dumptype" => 1, + "interface" => 1, + "holdingdisk" => 1, + "application-tool" => 1, + "script-tool" => 1, + "device" => 1, + "changer" => 1, +); +%} +amglue_export_tag(getconf, %subsection_names); + long int getconf_unit_divisor(void); extern int debug_amandad; @@ -675,50 +842,64 @@ amglue_export_tag(getconf, * Initialization */ -config_overwrites_t *new_config_overwrites(int size_estimate); -void free_config_overwrites(config_overwrites_t *co); -void add_config_overwrite(config_overwrites_t *co, - char *key, - char *value); -void add_config_overwrite_opt(config_overwrites_t *co, - char *optarg); -void apply_config_overwrites(config_overwrites_t *co); -amglue_export_tag(init, - new_config_overwrites free_config_overwrites add_config_overwrite - add_config_overwrite_opt apply_config_overwrites -); - - - +amglue_add_enum_tag_fns(cfgerr_level_t); +amglue_add_constant(CFGERR_OK, cfgerr_level_t); +amglue_add_constant(CFGERR_WARNINGS, cfgerr_level_t); +amglue_add_constant(CFGERR_ERRORS, cfgerr_level_t); +amglue_copy_to_tag(cfgerr_level_t, init); amglue_add_flag_tag_fns(config_init_flags); amglue_add_constant(CONFIG_INIT_EXPLICIT_NAME, config_init_flags); amglue_add_constant(CONFIG_INIT_USE_CWD, config_init_flags); amglue_add_constant(CONFIG_INIT_CLIENT, config_init_flags); amglue_add_constant(CONFIG_INIT_OVERLAY, config_init_flags); -amglue_add_constant(CONFIG_INIT_FATAL, config_init_flags); amglue_copy_to_tag(config_init_flags, init); gboolean config_init(config_init_flags flags, char *arg_config_name); void config_uninit(void); char **get_config_options(int first); -amglue_export_tag(init, - config_init config_uninit get_config_options -); +char *get_config_name(void); +char *get_config_dir(void); +char *get_config_filename(void); + +void config_print_errors(void); +void config_clear_errors(void); + +/* Typemap for config_errors' result parameter; this is a GSList of strings + * which should *not* be freed. */ +%typemap(in, numinputs=0) GSList **ERRLIST (GSList *templist) { + templist = NULL; + $1 = &templist; +} + +%typemap (argout) GSList **ERRLIST { + GSList *it = *$1; + + while (it) { + $result = sv_2mortal(newSVpv(it->data, 0)); + argvi++; + it = it->next; + } +} +cfgerr_level_t config_errors(GSList **ERRLIST); + + +config_overwrites_t *new_config_overwrites(int size_estimate); +void free_config_overwrites(config_overwrites_t *co); +void add_config_overwrite(config_overwrites_t *co, + char *key, + char *value); +void add_config_overwrite_opt(config_overwrites_t *co, + char *optarg); +cfgerr_level_t apply_config_overwrites(config_overwrites_t *co); -/* These are accessor functions, because SWIG's wrapping of global string - * variables is no so good -- the resulting strings can't be passed to other - * functions expecting char * arguments. */ -%inline %{ - char *get_config_name(void) { return config_name; } - char *get_config_dir(void) { return config_dir; } - char *get_config_filename(void) { return config_filename; } -%} amglue_export_tag(init, - get_config_name - get_config_dir - get_config_filename + config_init config_uninit get_config_options + get_config_name get_config_dir get_config_filename + config_print_errors config_clear_errors config_errors + new_config_overwrites free_config_overwrites add_config_overwrite + add_config_overwrite_opt apply_config_overwrites ); /* @@ -726,9 +907,11 @@ amglue_export_tag(init, */ void dump_configuration(void); +%newobject config_dir_relative; char *config_dir_relative(char *filename); char *taperalgo2str(taperalgo_t taperalgo); gint64 find_multiplier(char * casestr); + amglue_export_ok( dump_configuration config_dir_relative taperalgo2str find_multiplier ); diff --git a/perl/Amanda/Constants.pm.in b/perl/Amanda/Constants.pm.in new file mode 100644 index 0000000..50630c6 --- /dev/null +++ b/perl/Amanda/Constants.pm.in @@ -0,0 +1,106 @@ +# vim:ft=perl +# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +package Amanda::Constants; + +=head1 NAME + +Amanda::Constants - perl access to build-time configuration values + +=head1 SYNOPSIS + + use Amanda::Constants; + + my $default_config = $Amanda::Constants::DEFAULT_CONFIG; + +This package is a means of getting all of the necessary variables +provided by configure into Perl scripts, without a bunch of +boilerplate, and without requiring config.status substitution for +every .pm file. + +This module does not automatically export any of its values. + +See the source for the list of constants available. + +=head1 API STATUS + +Constants will not be removed from this file unless they are no longer available in the codebase. + +=cut + +# the 'warnings' pragma doesn't recognized exported variables as "used", and generates warnings +# for variables only used once. We turn it off for this module. +no warnings; + +# (keep this list sorted in alphabetical order, for ease of updates) + +$AIX_BACKUP = "@AIX_BACKUP@"; +$AMANDA_DEBUG_DAYS = "@AMANDA_DEBUG_DAYS@"; +$ASSERTIONS = "@ASSERTIONS@"; +$BSDTCP_SECURITY = "@BSDTCP_SECURITY@"; +$BSDUDP_SECURITY = "@BSDUDP_SECURITY@"; +$BSD_SECURITY = "@BSD_SECURITY@"; +$CC = "@CC@"; +$CHECK_USERID = "@CHECK_USERID@"; +$CLIENT_HOST_INSTANCE = "@CLIENT_HOST_INSTANCE@"; +$CLIENT_HOST_KEY_FILE = "@CLIENT_HOST_KEY_FILE@"; +$CLIENT_HOST_PRINCIPAL = "@CLIENT_HOST_PRINCIPAL@"; +$CLIENT_LOGIN = "@CLIENT_LOGIN@"; +$COMPRESS_BEST_OPT = "@COMPRESS_BEST_OPT@"; +$COMPRESS_FAST_OPT = "@COMPRESS_FAST_OPT@"; +$COMPRESS_PATH = "@COMPRESS_PATH@"; +$COMPRESS_SUFFIX = "@COMPRESS_SUFFIX@"; +$DEFAULT_AMANDATES_FILE = "@DEFAULT_AMANDATES_FILE@"; +$DEFAULT_CONFIG = "@DEFAULT_CONFIG@"; +$DEFAULT_SERVER = "@DEFAULT_SERVER@"; +$DEFAULT_TAPE_DEVICE = "@DEFAULT_TAPE_DEVICE@"; +$DEFAULT_TAPE_SERVER = "@DEFAULT_TAPE_SERVER@"; +$DUMP = "@DUMP@"; +$DUMP_RETURNS_1 = "@DUMP_RETURNS_1@"; +$GNUTAR = "@GNUTAR@"; +$HAVE_GZIP = "@HAVE_GZIP@"; +$KRB4_SECURITY = "@KRB4_SECURITY@"; +$KRB5_SECURITY = "@KRB5_SECURITY@"; +$LOCKING = "@LOCKING@"; +$MAILER = "@MAILER@"; +$RESTORE = "@RESTORE@"; +$PS = "@PS@"; +$PS_ARGUMENT = "@PS_ARGUMENT@"; +$RSH_SECURITY = "@RSH_SECURITY@"; +$SAMBA_CLIENT = "@SAMBA_CLIENT@"; +$SERVER_HOST_INSTANCE = "@SERVER_HOST_INSTANCE@"; +$SERVER_HOST_KEY_FILE = "@SERVER_HOST_KEY_FILE@"; +$SERVER_HOST_PRINCIPAL = "@SERVER_HOST_PRINCIPAL@"; +$SSH_SECURITY = "@SSH_SECURITY@"; +$STAR = "@STAR@"; +$TICKET_LIFETIME = "@TICKET_LIFETIME@"; +$UNCOMPRESS_OPT = "@UNCOMPRESS_OPT@"; +$UNCOMPRESS_PATH = "@UNCOMPRESS_PATH@"; +$USE_AMANDAHOSTS = "@USE_AMANDAHOSTS@"; +$USE_RUNDUMP = "@USE_RUNDUMP@"; +$USE_VERSION_SUFFIXES = "@USE_VERSION_SUFFIXES@"; +$VDUMP = "@VDUMP@"; +$VERSION = "@VERSION@"; +$VRESTORE = "@VRESTORE@"; +$VXDUMP = "@VXDUMP@"; +$VXRESTORE = "@VXRESTORE@"; +$XFSDUMP = "@XFSDUMP@"; +$XFSRESTORE = "@XFSRESTORE@"; + +1; diff --git a/perl/Amanda/DB/Catalog.pm b/perl/Amanda/DB/Catalog.pm new file mode 100644 index 0000000..8e457ea --- /dev/null +++ b/perl/Amanda/DB/Catalog.pm @@ -0,0 +1,652 @@ +# Copyright (c) 2006 Zmanda Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program 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 program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + +package Amanda::DB::Catalog; + +=head1 NAME + +Amanda::DB::Catalog - access to the Amanda catalog: where is that dump? + +=head1 SYNOPSIS + + use Amanda::DB::Catalog; + + # get all dump timestamps on record + my @timestamps = Amanda::DB::Catalog::get_timestamps(); + + # loop over those timestamps, printing dump info for each one + for my $timestamp (@timestamps) { + my @dumpfiles = Amanda::DB::Catalog::get_dumps( + timestamp => $timestamp, + ok => 1 + ); + print "$timstamp:\n"; + for my $dumpfile (@dumpfiles) { + print " ", $dumpfile->{hostname}, ":", $dumpfile->{diskname}, + " level ", $dumpfile->{level}, "\n"; + } + } + +=head1 DESCRIPTION + +=head2 MODEL + +The Amanda catalog is a set of dumpfiles, where each dumpfile corresponds to a +single file in a storage volume. On tapes, files are separated by filemarks +and numbered sequentially. This model is preserved on non-tape media such as +the VFS and S3 devices. A dumpfile, then, is completely specified by a volume +label and a file number (I). + +The catalog is presented as a single table containing one row per dumpfile. +Each row has the following values: + +=over + +=item label + +(string) -- volume label + +=item filenum + +(integer) -- file on that volume + +=item dump_timestamp + +(string) -- timestamp of the run in which the dump was created + +=item write_timestamp + +(string) -- timestamp of the run in which the dump was written to this volume + +=item hostname + +(string) -- dump hostname + +=item diskname + +(string) -- dump diskname + +=item level + +(integer) -- dump level + +=item status + +(string) -- "OK", "PARTIAL" or some other descriptor + +=item partnum + +(integer) -- part number of a split dump (1-based) + +=item nparts + +(integer) -- number of parts in this dump (estimated) + +=item kb + +(integer) -- size (in kb) of this dumpfile + +=item sec + +(integer) -- time (in seconds) spent writing this dumpfile + +=back + +A dumpfile is represented as a hashref with these keys. + +The label and filenum serve as a primary key. The dump_timestamp, hostname, +diskname, and level uniquely identify the dump. The write_timestamp gives the +time that the dump was written to this volume. The write_timestamp may differ +from the dump_timestamp if, for example, I wrote the dump to tape +after the initial dump. The remaining fields are informational. + +=head2 NOTES + +A dumpfile may be a part of a larger (split) dump, or may be partial (due to +end of tape or some other error), so the contents of the catalog require some +interpretation in order to find a particular dump. + +All timestamps used in this module are full-length, in the format +C. If the underlying data contains only datestamps, they are +zero-extended into timestamps: C. A dump_timestamp always +corresponds to the initiation of the I dump run, while +write_timestamp gives the time the file was written to the volume. When +dumpfiles are migrated from volume to volume (e.g., by I), the +dump_timestamp does not change. + +In Amanda, the tuple (hostname, diskname, level, dump_timestamp) serves as a unique +identifier for a dump. Since all of this information is preserved during +migrations, a catalog query with these four terms will return all dumpfiles +relevant to that dump. + +=head2 QUERIES + +This API is read-only at the moment. The following functions are available: + +=over + +=item get_write_timestamps() + +Get a list of all write timestamps, sorted in chronological order. + +=item get_latest_write_timestamp() + +Return the most recent write timestamp. + +=item get_labels_written_at_timestamp($ts) + +Return a list of labels for volumes written at the given timestamp. + +=item get_dumps(%parameters) + +This function is the workhorse query interface, and returns a sequence of +dumpfiles. Values in C<%parameters> restrict the set of dumpfiles that are +returned. The hash can have any of the following keys: + +=over + +=item write_timestamp + +restrict to dumpfiles written at this timestamp + +=item write_timestamps + +(arrayref) restrict to dumpfiles written at any of these timestamps + +=item dump_timestamp + +restrict to dumpfiles with exactly this timestamp + +=item dump_timestamps + +(arrayref) restrict to dumpfiles with any of these timestamps + +=item dump_timestamp_match + +restrict to dumpfiles with timestamps matching this expression + +=item hostname + +restrict to dumpfiles with exactly this hostname + +=item hostnames + +(arrayref) restrict to dumpfiles with any of these hostnames + +=item hostname_match + +restrict to dumpfiles with hostnames matching this expression + +=item diskname + +restrict to dumpfiles with exactly this diskname + +=item disknames + +(arrayref) restrict to dumpfiles with any of these disknames + +=item diskname_match + +restrict to dumpfiles with disknames matching this expression + +=item label + +restrict to dumpfiles with exactly this label + +=item labels + +(arrayref) restrict to dumpfiles with any of these labels + +=item level + +restrict to dumpfiles with exactly this level + +=item levels + +(arrayref) restrict to dumpfiles with any of these levels + +=item status + +restrict to dumpfiles with this status + +=back + +Match expressions are described in the amanda(8) manual page. + +=item sort_dumps([ $key1, $key2, .. ], @dumps) + +Given a list of dumps, this function sorts that list by the requested keys. +The following keys are available: + +=over + +=item hostname + +=item diskname + +=item write_timestamp + +=item dump_timestamp + +=item level + +=item filenum + +=item label + +=item partnum + +=item kb + +=item sec + +=back + +Keys are processed from left to right: if two dumps have the same value for +C<$key1>, then C<$key2> is examined, and so on. Key names may be prefixed by +"C<->" to reverse the order. + +=item add_dump($dumpfile) + +Add the given dumpfile to the database. In terms of logfiles, this will either +create a new logfile (if the dump's C has not been seen +before) or append to an existing logfile. Note that a new logfile will require +a corresponding new entry in the tapelist. + +Note that no locking is performed: multiple simultaneous calls to this function +can result in a corrupted or incorrect logfile. + +=back + +=head1 API STATUS + +New summary functions may be added to reduce code duplication in other parts of +Amanda. + +Support for loading and modifying the tapelist may eventually be folded into +this module. + +=cut + +use Amanda::Logfile; +use Amanda::Tapelist; +use Amanda::Config qw( :init :getconf config_dir_relative ); +use Amanda::Util qw( quote_string ); +use warnings; +use strict; + +# tapelist cache +my $tapelist = undef; +my $tapelist_filename = undef; + +# utility function +sub zeropad { + my ($timestamp) = @_; + if (length($timestamp) == 8) { + return $timestamp."000000"; + } + return $timestamp; +} + +sub get_write_timestamps { + my @rv; + + # find_log assumes that the tapelist has been loaded, so load it now + _load_tapelist(); + + for (Amanda::Logfile::find_log()) { + next unless (my ($timestamp) = /^log\.([0-9]+)(?:\.[0-9]+|\.amflush)?$/); + push @rv, zeropad($timestamp); + } + + return sort @rv; +} + +sub get_latest_write_timestamp { + # get all of the timestamps and select the last one + my @timestamps = get_write_timestamps(); + + if (@timestamps) { + return $timestamps[-1]; + } + + return undef; +} + +sub get_dumps { + my %params = @_; + my $logfile_dir = config_dir_relative(getconf($CNF_LOGDIR)); + + # find_log assumes that the tapelist has been loaded, so load it now + _load_tapelist(); + + # pre-process params by appending all of the "singular" parameters to the "plurals" + push @{$params{'write_timestamps'}}, map { zeropad($_) } $params{'write_timestamp'} + if exists($params{'write_timestamp'}); + push @{$params{'dump_timestamps'}}, map { zeropad($_) } $params{'dump_timestamp'} + if exists($params{'dump_timestamp'}); + push @{$params{'hostnames'}}, $params{'hostname'} + if exists($params{'hostname'}); + push @{$params{'disknames'}}, $params{'diskname'} + if exists($params{'diskname'}); + push @{$params{'levels'}}, $params{'level'} + if exists($params{'level'}); + push @{$params{'labels'}}, $params{'label'} + if exists($params{'label'}); + + # Since we're working from logfiles, we have to pick the logfiles we'll use first. + # Then we can use search_logfile. + my @logfiles; + if (exists($params{'write_timestamps'})) { + # if we have specific write_timestamps, the job is pretty easy. + my %timestamps_hash = map { ($_, undef) } @{$params{'write_timestamps'}}; + for my $logfile (Amanda::Logfile::find_log()) { + next unless (my ($timestamp) = $logfile =~ /^log\.([0-9]+)(?:\.[0-9]+|\.amflush)?$/); + next unless (exists($timestamps_hash{zeropad($timestamp)})); + push @logfiles, $logfile; + } + } elsif (exists($params{'dump_timestamps'})) { + # otherwise, we need only look in logfiles at or after the earliest dump timestamp + my @sorted_timestamps = sort @{$params{'dump_timestamps'}}; + my $earliest_timestamp = $sorted_timestamps[0]; + for my $logfile (Amanda::Logfile::find_log()) { + next unless (my ($timestamp) = $logfile =~ /^log\.([0-9]+)(?:\.[0-9]+|\.amflush)?$/); + next unless (zeropad($timestamp) ge $earliest_timestamp); + push @logfiles, $logfile; + } + } else { + # oh well -- it looks like we'll have to read all existing logfiles. + @logfiles = Amanda::Logfile::find_log(); + } + + # Set up some hash tables for speedy lookups of various attributes + my (%dump_timestamps_hash, %hostnames_hash, %disknames_hash, %levels_hash, %labels_hash); + %dump_timestamps_hash = map { ($_, undef) } @{$params{'dump_timestamps'}} + if (exists($params{'dump_timestamps'})); + %hostnames_hash = map { ($_, undef) } @{$params{'hostnames'}} + if (exists($params{'hostnames'})); + %disknames_hash = map { ($_, undef) } @{$params{'disknames'}} + if (exists($params{'disknames'})); + %levels_hash = map { ($_, undef) } @{$params{'levels'}} + if (exists($params{'levels'})); + %labels_hash = map { ($_, undef) } @{$params{'labels'}} + if (exists($params{'labels'})); + + # now loop over those logfiles and use search_logfile to load the dumpfiles + # from them, then process each entry from the logfile + my @results; + for my $logfile (@logfiles) { + # get the raw contents from search_logfile + my @find_results = Amanda::Logfile::search_logfile(undef, undef, + "$logfile_dir/$logfile", 1); + + # filter against *_match with dumps_match + @find_results = Amanda::Logfile::dumps_match([@find_results], + exists($params{'hostname_match'})? $params{'hostname_match'} : undef, + exists($params{'diskname_match'})? $params{'diskname_match'} : undef, + exists($params{'dump_timestamp_match'})? $params{'dump_timestamp_match'} : undef, + undef, + 0); + + # convert to dumpfile hashes, including the write_timestamp from the logfile name + my ($timestamp) = $logfile =~ /^log\.([0-9]+)(?:\.[0-9]+|\.amflush)?$/; + my $write_timestamp = zeropad($timestamp); + + # loop over each entry in the logfile. + for my $find_result (@find_results) { + + # filter out the non-dump error messages that find.c produces + next unless (defined $find_result->{'label'}); + + # bail out on this result early, if possible + next if (%dump_timestamps_hash + and !exists($dump_timestamps_hash{zeropad($find_result->{'timestamp'})})); + next if (%hostnames_hash + and !exists($hostnames_hash{$find_result->{'hostname'}})); + next if (%disknames_hash + and !exists($disknames_hash{$find_result->{'diskname'}})); + next if (%levels_hash + and !exists($levels_hash{$find_result->{'level'}})); + next if (%labels_hash + and !exists($labels_hash{$find_result->{'label'}})); + next if (exists($params{'status'}) + and $find_result->{'status'} ne $params{'status'}); + + # start setting up a dumpfile hash for this result + my %dumpfile = ( + 'write_timestamp' => $write_timestamp, + 'dump_timestamp' => zeropad($find_result->{'timestamp'}), + 'hostname' => $find_result->{'hostname'}, + 'diskname' => $find_result->{'diskname'}, + 'level' => $find_result->{'level'}, + 'label' => $find_result->{'label'}, + 'filenum' => $find_result->{'filenum'}, + 'status' => $find_result->{'status'}, + 'sec' => $find_result->{'sec'}, + 'kb' => $find_result->{'kb'}, + ); + + # partnum and nparts takes some special interpretation + if (my ($partnum, $nparts) = $find_result->{'partnum'} =~ m$(\d+)/(-?\d+)$) { + $dumpfile{'partnum'} = $partnum+0; + $dumpfile{'nparts'} = $nparts+0; + } else { + $dumpfile{'partnum'} = 1; + $dumpfile{'nparts'} = 1; + } + + # check partnum and nparts + next if (defined($params{'partnum'}) and $dumpfile{'partnum'} != $params{'partnum'}); + next if (defined($params{'nparts'}) and $dumpfile{'nparts'} != $params{'nparts'}); + + push @results, \%dumpfile; + } + } + + return @results; +} + +sub sort_dumps { + my ($keys, @dumps) = @_; + + return sort { + my $r; + for my $key (@$keys) { + if ($key =~ /^-(.*)$/) { + $r = $b->{$1} cmp $a->{$1}; # note: $a and $b are reversed + } else { + $r = $a->{$key} cmp $b->{$key}; + } + return $r if $r; + } + return 0; + } @dumps; +} + +# caches for add_dump() to avoid repeatedly looking up the log +# filename for a particular write_timestamp. +my $add_dump_last_label = undef; +my $add_dump_last_write_timestamp = undef; +my $add_dump_last_logfile = undef; + +sub add_dump { + my ($dump) = @_; + my $found; + my $logfh; + my $logfile; + my $find_result; + my $logdir = getconf($CNF_LOGDIR); + my ($last_filenum, $last_secs, $last_kbs); + + # first order of business is to find out whether we need to make a new + # dumpfile for this. + my $write_timestamp = zeropad($dump->{'write_timestamp'}); + die "dump has no 'write_timestamp'" unless defined $write_timestamp; + + # consult our one-element cache for this label and write_timestamp + if (!defined $add_dump_last_label + or $add_dump_last_label ne $dump->{'label'} + or $add_dump_last_write_timestamp ne $dump->{'write_timestamp'}) { + + # update the cache + $add_dump_last_logfile = undef; + LOGFILE: + for my $lf (Amanda::Logfile::find_log()) { + next unless (my ($log_timestamp) = $lf =~ /^log\.([0-9]+)(?:\.[0-9]+|\.amflush)?$/); + next unless (zeropad($log_timestamp) eq $write_timestamp); + + # write timestamp matches; now check the label + LOGFILE_DUMP: + for $find_result (Amanda::Logfile::search_logfile(undef, undef, + "$logdir/$lf", 1)) { + next unless (defined $find_result->{'label'}); + + if ($find_result->{'label'} eq $dump->{'label'}) { + $add_dump_last_label = $dump->{'label'}; + $add_dump_last_write_timestamp = $dump->{'write_timestamp'}; + $add_dump_last_logfile = $lf; + last LOGFILE; + } + } + } + } + $logfile = $add_dump_last_logfile; + + # truncate the write_timestamp if we're not using timestamps + if (!getconf($CNF_USETIMESTAMPS)) { + $write_timestamp = substr($write_timestamp, 0, 8); + } + + # get the information on the last dump and part in this logfile, or create + # a new logfile if none exists, then open the logfile for writing. + if (defined $logfile) { + $last_filenum = -1; + + # NOTE: this depends on an implementation detail of search_logfile: it + # returns the results in the reverse order of appearance in the logfile. + # Since we're concerned with the last elements of this logfile that we + # will be appending to shortly, we simply reverse this list. As this + # package is rewritten to parse logfiles on its own (or access a relational + # database), this implementation detail will no longer be relevant. + my @find_results = reverse Amanda::Logfile::search_logfile(undef, undef, + "$logdir/$logfile", 1); + for $find_result (@find_results) { + # filter out the non-dump error messages that find.c produces + next unless (defined $find_result->{'label'}); + + $last_filenum = $find_result->{'filenum'}; + + # if this is part number 1, reset our secs and kbs counters on the + # assumption that this is the beginning of a new dump + if ($find_result->{'partnum'} =~ qr{1/\d}) { + $last_secs = $last_kbs = 0; + } + $last_secs += $find_result->{'sec'}; + $last_kbs += $find_result->{'kb'}; + } + + open($logfh, ">>", "$logdir/$logfile"); + } else { + $last_filenum = -1; + $last_secs = 0; + $last_kbs = 0; + + # pick an unused log filename + my $i = 0; + while (1) { + $logfile = "log.$write_timestamp.$i"; + last unless -f "$logdir/$logfile"; + $i++; + } + + open($logfh, ">", "$logdir/$logfile") + or die("Could not write '$logdir/$logfile': $!"); + + print $logfh + "INFO taper This logfile was generated by Amanda::DB::Catalog\n"; + + print $logfh + "START taper datestamp $write_timestamp label $dump->{label} tape $i\n"; + + if (!defined $tapelist_filename) { + $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST)); + } + + # reload the tapelist immediately, in case it's been modified + $tapelist = Amanda::Tapelist::read_tapelist($tapelist_filename); + + # see if we need to add an entry to the tapelist for this dump + if (!grep { $_->{'label'} eq $dump->{'label'} + and zeropad($_->{'datestamp'}) eq zeropad($dump->{'write_timestamp'}) + } @$tapelist) { + $tapelist->add_tapelabel($write_timestamp, $dump->{'label'}); + $tapelist->write($tapelist_filename); + } + } + + if ($last_filenum >= 0 && $last_filenum+1 != $dump->{'filenum'}) { + warn "Discontinuity in filenums in $logfile: " . + "from $last_filenum to $dump->{filenum}"; + } + + my $kps = $dump->{'sec'}? (($dump->{'kb'} + 0.0) / $dump->{'sec'}) : 0.0; + + my $part_line = "PART taper "; + $part_line .= "$dump->{label} "; + $part_line .= "$dump->{filenum} "; + $part_line .= quote_string($dump->{hostname}) . " "; + $part_line .= quote_string($dump->{diskname}) . " "; + $part_line .= "$dump->{dump_timestamp} "; + $part_line .= "$dump->{partnum}/$dump->{nparts} "; + $part_line .= "$dump->{level} "; + $part_line .= "[sec $dump->{sec} kb $dump->{kb} kps $kps]"; + print $logfh "$part_line\n"; + + # TODO: we don't always know nparts when writing a part, so + # this is not always an effective way to detect a complete dump. + # However, it works for purposes of data vaulting. + if ($dump->{'partnum'} == $dump->{'nparts'}) { + my $secs = $last_secs + $dump->{'sec'}; + my $kbs = $last_kbs + $dump->{'kb'}; + $kps = $secs? ($kbs + 0.0) / $secs : 0.0; + + my $done_line = "DONE taper "; + $done_line .= quote_string($dump->{hostname}) ." "; + $done_line .= quote_string($dump->{diskname}) ." "; + $done_line .= "$dump->{dump_timestamp} "; + $done_line .= "$dump->{nparts} "; + $done_line .= "$dump->{level} "; + $done_line .= "[sec $secs kb $kbs kps $kps]"; + print $logfh "$done_line\n"; + } + + close($logfh); +} + +sub _load_tapelist { + if (!defined $tapelist) { + $tapelist_filename = config_dir_relative(getconf($CNF_TAPELIST)); + $tapelist = Amanda::Tapelist::read_tapelist($tapelist_filename); + } +} + +sub _clear_cache { # (used by installcheck) + $tapelist = $tapelist_filename = undef; +} + +1; diff --git a/perl/Amanda/Debug.c b/perl/Amanda/Debug.c index b3ff7ae..89c9cc3 100644 --- a/perl/Amanda/Debug.c +++ b/perl/Amanda/Debug.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -122,7 +122,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -157,6 +157,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,10 +298,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -427,8 +428,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -1061,7 +1062,7 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); } @@ -1119,7 +1120,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (!tc) { return SWIG_ERROR; } - *ptr = SWIG_TypeCast(tc,voidptr); + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } } else { *ptr = voidptr; } @@ -1294,7 +1299,7 @@ SWIG_Perl_GetModule(void) { /* first check if pointer already created */ if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } @@ -1308,7 +1313,7 @@ SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } @@ -1440,7 +1445,7 @@ static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0}; #define SWIG_name "Amanda::Debugc::boot_Amanda__Debug" #define SWIG_prefix "Amanda::Debugc::" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -1770,6 +1775,23 @@ SWIGCLASS_STATIC int _wrap_error_exit_status_get(pTHX_ SV *sv, MAGIC *SWIGUNUSED #ifdef __cplusplus extern "C" { #endif +XS(_wrap_debug_init) { + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: debug_init();"); + } + debug_init(); + + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + XS(_wrap_dbopen) { { char *arg1 = (char *) 0 ; @@ -2163,6 +2185,7 @@ static swig_variable_info swig_variables[] = { {0,0,0,0} }; static swig_command_info swig_commands[] = { +{"Amanda::Debugc::debug_init", _wrap_debug_init}, {"Amanda::Debugc::dbopen", _wrap_dbopen}, {"Amanda::Debugc::dbreopen", _wrap_dbreopen}, {"Amanda::Debugc::dbrename", _wrap_dbrename}, @@ -2235,7 +2258,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -2245,6 +2268,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -2273,6 +2299,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -2426,7 +2458,7 @@ XS(SWIG_init) { /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2); + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { @@ -2438,7 +2470,7 @@ XS(SWIG_init) { /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2); + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -2461,18 +2493,18 @@ XS(SWIG_init) { SvREADONLY_on(sv); } - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ERR_INTERACTIVE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ERR_INTERACTIVE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ERR_INTERACTIVE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ERR_SYSLOG", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ERR_SYSLOG", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ERR_SYSLOG))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ERR_AMANDALOG", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ERR_AMANDALOG", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ERR_AMANDALOG))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; diff --git a/perl/Amanda/Debug.pm b/perl/Amanda/Debug.pm index ad6795f..fc1d6b1 100644 --- a/perl/Amanda/Debug.pm +++ b/perl/Amanda/Debug.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -49,6 +49,7 @@ sub this { package Amanda::Debug; +*debug_init = *Amanda::Debugc::debug_init; *dbopen = *Amanda::Debugc::dbopen; *dbreopen = *Amanda::Debugc::dbreopen; *dbrename = *Amanda::Debugc::dbrename; @@ -82,15 +83,14 @@ Amanda::Debug - support for debugging Amanda applications =head1 SYNOPSIS - use Amanda::Debug qw( :init :logging ); + use Amanda::Util qw( :constants ); - # (note: dbopen and such are usually handled by - # Amanda::Util::setup_applicaton) - dbopen("server"); + Amanda::Util::setup_application("amcooltool", "server", $CONTEXT_CMDLINE); debug("this is a debug message"); + die("Unable to frobnicate the ergonator"); -See C for a more in-depth description of the functionality of +See C for a more in-depth description of the logging functionality of this module. =head1 API STATUS @@ -99,7 +99,7 @@ Stable =head1 DEBUG LOGGING -Several debug logging messages, each taking a single string, are +Several debug logging functions, each taking a single string, are available: =over @@ -118,7 +118,10 @@ available: =back -ALl of the debug logging functions are available via the export tag +Perl's built-in C and C functions are patched to call C +and C, respectively. + +All of the debug logging functions are available via the export tag C<:logging>. =head1 ADVANCED USAGE @@ -157,9 +160,9 @@ applications which may produce error output. =cut -push @EXPORT_OK, qw(dbopen dbreopen dbrename dbclose +push @EXPORT_OK, qw(debug_init dbopen dbreopen dbrename dbclose $erroutput_type $error_exit_status); -push @{$EXPORT_TAGS{"init"}}, qw(dbopen dbreopen dbrename dbclose +push @{$EXPORT_TAGS{"init"}}, qw(debug_init dbopen dbreopen dbrename dbclose $erroutput_type $error_exit_status); push @EXPORT_OK, qw(erroutput_type_t_to_strings); @@ -203,6 +206,33 @@ push @{$EXPORT_TAGS{"erroutput_type_t"}}, qw($ERR_AMANDALOG); $_erroutput_type_t_VALUES{"AMANDALOG"} = $ERR_AMANDALOG; +sub _my_die { + # $^S is set if we're in an eval { .. }, in which case we want + # to use the default Perl semantics. + if ($^S) { + die(@_); + } else { + my ($msg) = @_; + chomp $msg; + critical(@_); + } +}; +$SIG{__DIE__} = \&my_die; + +sub _my_warn { + my ($msg) = @_; + chomp $msg; + warning(@_); +}; +$SIG{__WARN__} = \&my_warn; + +# utility function for test scripts, which want to use the regular +# perl mechanisms +sub disable_die_override { + delete $SIG{__DIE__}; + delete $SIG{__WARN__}; +} + push @EXPORT_OK, qw(error critical warning message info debug); push @{$EXPORT_TAGS{"logging"}}, qw(error critical warning message info debug); 1; diff --git a/perl/Amanda/Debug.swg b/perl/Amanda/Debug.swg index e1285d6..1610b7c 100644 --- a/perl/Amanda/Debug.swg +++ b/perl/Amanda/Debug.swg @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ %module "Amanda::Debug" @@ -34,15 +34,14 @@ Amanda::Debug - support for debugging Amanda applications =head1 SYNOPSIS - use Amanda::Debug qw( :init :logging ); + use Amanda::Util qw( :constants ); - # (note: dbopen and such are usually handled by - # Amanda::Util::setup_applicaton) - dbopen("server"); + Amanda::Util::setup_application("amcooltool", "server", $CONTEXT_CMDLINE); debug("this is a debug message"); + die("Unable to frobnicate the ergonator"); -See C for a more in-depth description of the functionality of +See C for a more in-depth description of the logging functionality of this module. =head1 API STATUS @@ -51,7 +50,7 @@ Stable =head1 DEBUG LOGGING -Several debug logging messages, each taking a single string, are +Several debug logging functions, each taking a single string, are available: =over @@ -70,7 +69,10 @@ available: =back -ALl of the debug logging functions are available via the export tag +Perl's built-in C and C functions are patched to call C +and C, respectively. + +All of the debug logging functions are available via the export tag C<:logging>. =head1 ADVANCED USAGE @@ -115,10 +117,11 @@ applications which may produce error output. */ amglue_export_tag(init, - dbopen dbreopen dbrename dbclose + debug_init dbopen dbreopen dbrename dbclose $erroutput_type $error_exit_status ); +void debug_init(void); void dbopen(char *subdir); void dbreopen(char *file, char *notation); void dbrename(char *config, char *subdir); @@ -133,6 +136,38 @@ amglue_copy_tag_to(erroutput_type_t, init); erroutput_type_t erroutput_type; int error_exit_status; +/* + * Override die() and warn() + */ +%perlcode %{ +sub _my_die { + # $^S is set if we're in an eval { .. }, in which case we want + # to use the default Perl semantics. + if ($^S) { + die(@_); + } else { + my ($msg) = @_; + chomp $msg; + critical(@_); + } +}; +$SIG{__DIE__} = \&my_die; + +sub _my_warn { + my ($msg) = @_; + chomp $msg; + warning(@_); +}; +$SIG{__WARN__} = \&my_warn; + +# utility function for test scripts, which want to use the regular +# perl mechanisms +sub disable_die_override { + delete $SIG{__DIE__}; + delete $SIG{__WARN__}; +} +%} + /* * Logging */ diff --git a/perl/Amanda/Device.c b/perl/Amanda/Device.c index 0b41118..aff3abd 100644 --- a/perl/Amanda/Device.c +++ b/perl/Amanda/Device.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -122,7 +122,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -157,6 +157,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,10 +298,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -427,8 +428,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -1061,7 +1062,7 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); } @@ -1119,7 +1120,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (!tc) { return SWIG_ERROR; } - *ptr = SWIG_TypeCast(tc,voidptr); + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } } else { *ptr = voidptr; } @@ -1294,7 +1299,7 @@ SWIG_Perl_GetModule(void) { /* first check if pointer already created */ if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } @@ -1308,7 +1313,7 @@ SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } @@ -1434,9 +1439,10 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_guint swig_types[8] #define SWIGTYPE_p_guint64 swig_types[9] #define SWIGTYPE_p_int swig_types[10] -#define SWIGTYPE_p_unsigned_char swig_types[11] -static swig_type_info *swig_types[13]; -static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0}; +#define SWIGTYPE_p_queue_fd_t swig_types[11] +#define SWIGTYPE_p_unsigned_char swig_types[12] +static swig_type_info *swig_types[14]; +static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1447,7 +1453,7 @@ static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0}; #define SWIG_name "Amanda::Devicec::boot_Amanda__Device" #define SWIG_prefix "Amanda::Devicec::" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -1526,7 +1532,7 @@ set_sv_from_gvalue(GValue *value) sv = newRV((SV *)hv); return newRV((SV *)hv); } else { - warn("Unsupported boxed property type #%d", boxed_type); + warn("Unsupported boxed property type #%d", (int)boxed_type); sv = sv_newmortal(); sv_setsv(sv, &PL_sv_undef); @@ -1584,7 +1590,7 @@ set_sv_from_gvalue(GValue *value) case G_TYPE_INTERFACE: case G_TYPE_OBJECT: case G_TYPE_PARAM: - warn("Unsupported fundamental property type #%d", fundamental); + warn("Unsupported fundamental property type #%d", (int)fundamental); sv_setsv(sv, &PL_sv_undef); break; } @@ -1696,66 +1702,6 @@ SWIG_FromCharPtr(const char *cptr) } -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -{ - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size)); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - -SWIGINTERN Device *new_Device(char *device_name){ - return device_open(device_name); - } -SWIGINTERN void delete_Device(Device *self){ - g_object_unref(self); - } -SWIGINTERN ReadLabelStatusFlags Device_read_label(Device *self){ - return device_read_label(self); - } - #include #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) @@ -1883,29 +1829,99 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) return res; } +SWIGINTERN queue_fd_t *new_queue_fd_t(int fd){ + return queue_fd_new(fd, NULL); + } +SWIGINTERN void delete_queue_fd_t(queue_fd_t *self){ + amfree(self->errmsg); + g_free(self); + } + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) +{ + if (SvPOK(obj)) { + STRLEN len = 0; + char *cstr = SvPV(obj, len); + size_t size = len + 1; + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size)); + } else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } + } + if (psize) *psize = size; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + char* vptr = 0; + if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = vptr; + if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + +SWIGINTERN Device *new_Device(char *device_name){ + return device_open(device_name); + } +SWIGINTERN void delete_Device(Device *self){ + g_object_unref(self); + } +SWIGINTERN gboolean Device_configure(Device *self,gboolean use_global_config){ + return device_configure(self, use_global_config); + } +SWIGINTERN char *Device_error(Device *self){ + return device_error(self); + } +SWIGINTERN char *Device_status_error(Device *self){ + return device_status_error(self); + } +SWIGINTERN char *Device_error_or_status(Device *self){ + return device_error_or_status(self); + } +SWIGINTERN DeviceStatusFlags Device_read_label(Device *self){ + return device_read_label(self); + } SWIGINTERN gboolean Device_start(Device *self,DeviceAccessMode mode,char *label,char *timestamp){ return device_start(self, mode, label, timestamp); } SWIGINTERN gboolean Device_finish(Device *self){ return device_finish(self); } -SWIGINTERN gboolean Device_start_file(Device *self,dumpfile_t const *jobInfo){ +SWIGINTERN gboolean Device_start_file(Device *self,dumpfile_t *jobInfo){ return device_start_file(self, jobInfo); } -SWIGINTERN guint Device_write_min_size(Device *self){ - return device_write_min_size(self); - } -SWIGINTERN guint Device_write_max_size(Device *self){ - return device_write_max_size(self); - } -SWIGINTERN guint Device_read_max_size(Device *self){ - return device_read_max_size(self); +SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data){ + return device_write_block(self, size, data); } -SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data,gboolean short_block){ - return device_write_block(self, size, data, short_block); - } -SWIGINTERN gboolean Device_write_from_fd(Device *self,int fd){ - return device_write_from_fd(self, fd); +SWIGINTERN gboolean Device_write_from_fd(Device *self,queue_fd_t *queue_fd){ + return device_write_from_fd(self, queue_fd); } SWIGINTERN gboolean Device_finish_file(Device *self){ return device_finish_file(self); @@ -1919,14 +1935,14 @@ SWIGINTERN gboolean Device_seek_block(Device *self,guint64 block){ SWIGINTERN int Device_read_block(Device *self,gpointer buffer,int *size){ return device_read_block(self, buffer, size); } -SWIGINTERN gboolean Device_read_to_fd(Device *self,int fd){ - return device_read_to_fd(self, fd); +SWIGINTERN gboolean Device_read_to_fd(Device *self,queue_fd_t *queue_fd){ + return device_read_to_fd(self, queue_fd); } -SWIGINTERN DeviceProperty const *Device_property_list(Device *self){ +SWIGINTERN GSList const *Device_property_list(Device *self){ return device_property_get_list(self); } -SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,gboolean *val_found){ - *val_found = device_property_get(self, pbase->ID, out_val); +SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,PropertySurety *surety,PropertySource *source,gboolean *val_found){ + *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source); } SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){ GValue gval; @@ -1938,6 +1954,22 @@ SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,S if (!device_property_set(self, pbase->ID, &gval)) goto fail; + g_value_unset(&gval); + return TRUE; + fail: + g_value_unset(&gval); + return FALSE; + } +SWIGINTERN gboolean Device_property_set_ex(Device *self,DevicePropertyBase *pbase,SV *sv,PropertySurety surety,PropertySource source){ + GValue gval; + memset(&gval, 0, sizeof(gval)); + g_value_init(&gval, pbase->type); + if (!set_gvalue_from_sv(sv, &gval)) + goto fail; + + if (!device_property_set_ex(self, pbase->ID, &gval, surety, source)) + goto fail; + g_value_unset(&gval); return TRUE; fail: @@ -1947,9 +1979,19 @@ SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,S SWIGINTERN gboolean Device_recycle_file(Device *self,guint filenum){ return device_recycle_file(self, filenum); } -SWIGINTERN void Device_set_startup_properties_from_config(Device *self){ - device_set_startup_properties_from_config(self); - } +SWIGINTERN int Device_file(Device *self){ return self->file; } +SWIGINTERN guint64 Device_block(Device *self){ return self->block; } +SWIGINTERN gboolean Device_in_file(Device *self){ return self->in_file; } +SWIGINTERN char *Device_device_name(Device *self){ return self->device_name; } +SWIGINTERN DeviceAccessMode Device_access_mode(Device *self){ return self->access_mode; } +SWIGINTERN gboolean Device_is_eof(Device *self){ return self->is_eof; } +SWIGINTERN char *Device_volume_label(Device *self){ return self->volume_label; } +SWIGINTERN char *Device_volume_time(Device *self){ return self->volume_time; } +SWIGINTERN DeviceStatusFlags Device_status(Device *self){ return self->status; } +SWIGINTERN gsize Device_min_block_size(Device *self){ return self->min_block_size; } +SWIGINTERN gsize Device_max_block_size(Device *self){ return self->max_block_size; } +SWIGINTERN gsize Device_block_size(Device *self){ return self->block_size; } +SWIGINTERN dumpfile_t *Device_volume_header(Device *self){ return self->volume_header; } SWIGINTERNINLINE SV * SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) @@ -1995,9 +2037,9 @@ SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SW #ifdef __cplusplus extern "C" { #endif -XS(_wrap_Device_file_get) { +XS(_wrap_queue_fd_t_fd_get) { { - Device *arg1 = (Device *) 0 ; + queue_fd_t *arg1 = (queue_fd_t *) 0 ; int result; void *argp1 = 0 ; int res1 = 0 ; @@ -2005,14 +2047,14 @@ XS(_wrap_Device_file_get) { dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_file_get(self);"); + SWIG_croak("Usage: queue_fd_t_fd_get(self);"); } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_file_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_fd_get" "', argument " "1"" of type '" "queue_fd_t *""'"); } - arg1 = (Device *)(argp1); - result = (int) ((arg1)->file); + arg1 = (queue_fd_t *)(argp1); + result = (int) ((arg1)->fd); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2026,28 +2068,25 @@ XS(_wrap_Device_file_get) { } -XS(_wrap_Device_block_get) { +XS(_wrap_queue_fd_t_errmsg_get) { { - Device *arg1 = (Device *) 0 ; - guint64 result; + queue_fd_t *arg1 = (queue_fd_t *) 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_block_get(self);"); + SWIG_croak("Usage: queue_fd_t_errmsg_get(self);"); } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block_get" "', argument " "1"" of type '" "Device *""'"); - } - arg1 = (Device *)(argp1); - result = ((arg1)->block); - { - ST(argvi) = sv_2mortal(amglue_newSVu64(result)); - argvi++; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_errmsg_get" "', argument " "1"" of type '" "queue_fd_t *""'"); } + arg1 = (queue_fd_t *)(argp1); + result = (char *) ((arg1)->errmsg); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: @@ -2057,28 +2096,31 @@ XS(_wrap_Device_block_get) { } -XS(_wrap_Device_in_file_get) { +XS(_wrap_new_queue_fd_t) { { - Device *arg1 = (Device *) 0 ; - gboolean result; - void *argp1 = 0 ; - int res1 = 0 ; + int arg1 ; + queue_fd_t *result = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_in_file_get(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_in_file_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_croak("Usage: new_queue_fd_t(fd);"); } - arg1 = (Device *)(argp1); - result = (gboolean) ((arg1)->in_file); { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); - argvi++; + if (sizeof(signed int) == 1) { + arg1 = amglue_SvI8(ST(0)); + } else if (sizeof(signed int) == 2) { + arg1 = amglue_SvI16(ST(0)); + } else if (sizeof(signed int) == 4) { + arg1 = amglue_SvI32(ST(0)); + } else if (sizeof(signed int) == 8) { + arg1 = amglue_SvI64(ST(0)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } } + result = (queue_fd_t *)new_queue_fd_t(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_queue_fd_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ; XSRETURN(argvi); fail: @@ -2088,25 +2130,25 @@ XS(_wrap_Device_in_file_get) { } -XS(_wrap_Device_device_name_get) { +XS(_wrap_delete_queue_fd_t) { { - Device *arg1 = (Device *) 0 ; - char *result = 0 ; + queue_fd_t *arg1 = (queue_fd_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_device_name_get(self);"); + SWIG_croak("Usage: delete_queue_fd_t(self);"); } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_device_name_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_queue_fd_t" "', argument " "1"" of type '" "queue_fd_t *""'"); } - arg1 = (Device *)(argp1); - result = (char *) ((arg1)->device_name); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + arg1 = (queue_fd_t *)(argp1); + delete_queue_fd_t(arg1); + + XSRETURN(argvi); fail: @@ -2116,28 +2158,54 @@ XS(_wrap_Device_device_name_get) { } -XS(_wrap_Device_access_mode_get) { +XS(_wrap_new_Device) { + { + char *arg1 = (char *) 0 ; + Device *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: new_Device(device_name);"); + } + res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Device" "', argument " "1"" of type '" "char *""'"); + } + arg1 = (char *)(buf1); + result = (Device *)new_Device(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + XSRETURN(argvi); + fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + SWIG_croak_null(); + } +} + + +XS(_wrap_delete_Device) { { Device *arg1 = (Device *) 0 ; - DeviceAccessMode result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_access_mode_get(self);"); + SWIG_croak("Usage: delete_Device(self);"); } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_access_mode_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Device" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (DeviceAccessMode) ((arg1)->access_mode); - { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); - argvi++; - } + delete_Device(arg1); + + XSRETURN(argvi); fail: @@ -2147,38 +2215,54 @@ XS(_wrap_Device_access_mode_get) { } -XS(_wrap_Device_is_eof_get) { +XS(_wrap_Device_configure) { { Device *arg1 = (Device *) 0 ; + gboolean arg2 ; gboolean result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_is_eof_get(self);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_configure(self,use_global_config);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eof_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_configure" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (gboolean) ((arg1)->is_eof); + { + if (sizeof(signed int) == 1) { + arg2 = amglue_SvI8(ST(1)); + } else if (sizeof(signed int) == 2) { + arg2 = amglue_SvI16(ST(1)); + } else if (sizeof(signed int) == 4) { + arg2 = amglue_SvI32(ST(1)); + } else if (sizeof(signed int) == 8) { + arg2 = amglue_SvI64(ST(1)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)Device_configure(arg1,arg2); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } + XSRETURN(argvi); fail: + SWIG_croak_null(); } } -XS(_wrap_Device_volume_label_get) { +XS(_wrap_Device_error) { { Device *arg1 = (Device *) 0 ; char *result = 0 ; @@ -2188,14 +2272,14 @@ XS(_wrap_Device_volume_label_get) { dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_volume_label_get(self);"); + SWIG_croak("Usage: Device_error(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_label_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_error" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (char *) ((arg1)->volume_label); + result = (char *)Device_error(arg1); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); @@ -2206,7 +2290,7 @@ XS(_wrap_Device_volume_label_get) { } -XS(_wrap_Device_volume_time_get) { +XS(_wrap_Device_status_error) { { Device *arg1 = (Device *) 0 ; char *result = 0 ; @@ -2216,14 +2300,14 @@ XS(_wrap_Device_volume_time_get) { dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_volume_time_get(self);"); + SWIG_croak("Usage: Device_status_error(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_time_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_status_error" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (char *) ((arg1)->volume_time); + result = (char *)Device_status_error(arg1); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); @@ -2234,54 +2318,25 @@ XS(_wrap_Device_volume_time_get) { } -XS(_wrap_new_Device) { +XS(_wrap_Device_error_or_status) { { - char *arg1 = (char *) 0 ; - Device *result = 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; + Device *arg1 = (Device *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: new_Device(device_name);"); + SWIG_croak("Usage: Device_error_or_status(self);"); } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Device" "', argument " "1"" of type '" "char *""'"); - } - arg1 = (char *)(buf1); - result = (Device *)new_Device(arg1); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); - SWIG_croak_null(); - } -} - - -XS(_wrap_delete_Device) { - { - Device *arg1 = (Device *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: delete_Device(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, SWIG_POINTER_DISOWN | 0 ); + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Device" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_error_or_status" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - delete_Device(arg1); - - + result = (char *)Device_error_or_status(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: @@ -2294,7 +2349,7 @@ XS(_wrap_delete_Device) { XS(_wrap_Device_read_label) { { Device *arg1 = (Device *) 0 ; - ReadLabelStatusFlags result; + DeviceStatusFlags result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; @@ -2308,7 +2363,7 @@ XS(_wrap_Device_read_label) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_label" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (ReadLabelStatusFlags)Device_read_label(arg1); + result = (DeviceStatusFlags)Device_read_label(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2444,10 +2499,10 @@ XS(_wrap_Device_start_file) { arg1 = (Device *)(argp1); res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_dumpfile_t, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_start_file" "', argument " "2"" of type '" "dumpfile_t const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_start_file" "', argument " "2"" of type '" "dumpfile_t *""'"); } arg2 = (dumpfile_t *)(argp2); - result = (gboolean)Device_start_file(arg1,(dumpfile_t const *)arg2); + result = (gboolean)Device_start_file(arg1,arg2); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2463,88 +2518,120 @@ XS(_wrap_Device_start_file) { } -XS(_wrap_Device_write_min_size) { +XS(_wrap_Device_write_block) { { Device *arg1 = (Device *) 0 ; - guint result; + guint arg2 ; + gpointer arg3 = (gpointer) 0 ; + gboolean result; void *argp1 = 0 ; int res1 = 0 ; + int res3 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_write_min_size(self);"); + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Device_write_block(self,size,data);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_min_size" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_block" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = Device_write_min_size(arg1); { - ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + if (sizeof(guint) == 1) { + arg2 = amglue_SvU8(ST(1)); + } else if (sizeof(guint) == 2) { + arg2 = amglue_SvU16(ST(1)); + } else if (sizeof(guint) == 4) { + arg2 = amglue_SvU32(ST(1)); + } else if (sizeof(guint) == 8) { + arg2 = amglue_SvU64(ST(1)); + } else { + croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */ + } + } + res3 = SWIG_ConvertPtr(ST(2),SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_write_block" "', argument " "3"" of type '" "gpointer""'"); + } + result = (gboolean)Device_write_block(arg1,arg2,arg3); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } + XSRETURN(argvi); fail: + SWIG_croak_null(); } } -XS(_wrap_Device_write_max_size) { +XS(_wrap_Device_write_from_fd) { { Device *arg1 = (Device *) 0 ; - guint result; + queue_fd_t *arg2 = (queue_fd_t *) 0 ; + gboolean result; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_write_max_size(self);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_write_from_fd(self,queue_fd);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_max_size" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_fd" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = Device_write_max_size(arg1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_write_from_fd" "', argument " "2"" of type '" "queue_fd_t *""'"); + } + arg2 = (queue_fd_t *)(argp2); + result = (gboolean)Device_write_from_fd(arg1,arg2); { - ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } + XSRETURN(argvi); fail: + SWIG_croak_null(); } } -XS(_wrap_Device_read_max_size) { +XS(_wrap_Device_finish_file) { { Device *arg1 = (Device *) 0 ; - guint result; + gboolean result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_read_max_size(self);"); + SWIG_croak("Usage: Device_finish_file(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_max_size" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = Device_read_max_size(arg1); + result = (gboolean)Device_finish_file(arg1); { - ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } @@ -2556,25 +2643,22 @@ XS(_wrap_Device_read_max_size) { } -XS(_wrap_Device_write_block) { +XS(_wrap_Device_seek_file) { { Device *arg1 = (Device *) 0 ; guint arg2 ; - gpointer arg3 = (gpointer) 0 ; - gboolean arg4 ; - gboolean result; + dumpfile_t *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res3 ; int argvi = 0; dXSARGS; - if ((items < 4) || (items > 4)) { - SWIG_croak("Usage: Device_write_block(self,size,data,short_block);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_seek_file(self,file);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_block" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); { @@ -2590,10 +2674,354 @@ XS(_wrap_Device_write_block) { croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */ } } - res3 = SWIG_ConvertPtr(ST(2),SWIG_as_voidptrptr(&arg3), 0, 0); + result = (dumpfile_t *)Device_seek_file(arg1,arg2); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_seek_block) { + { + Device *arg1 = (Device *) 0 ; + guint64 arg2 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_seek_block(self,block);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + { + arg2 = amglue_SvU64(ST(1)); + } + result = (gboolean)Device_seek_block(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_read_block) { + { + Device *arg1 = (Device *) 0 ; + gpointer arg2 = (gpointer) 0 ; + int *arg3 = (int *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + void *argp3 = 0 ; + int res3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Device_read_block(self,buffer,size);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'"); + } + res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_write_block" "', argument " "3"" of type '" "gpointer""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'"); + } + arg3 = (int *)(argp3); + result = (int)Device_read_block(arg1,arg2,arg3); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_read_to_fd) { + { + Device *arg1 = (Device *) 0 ; + queue_fd_t *arg2 = (queue_fd_t *) 0 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_read_to_fd(self,queue_fd);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_fd" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_to_fd" "', argument " "2"" of type '" "queue_fd_t *""'"); + } + arg2 = (queue_fd_t *)(argp2); + result = (gboolean)Device_read_to_fd(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_property_list) { + { + Device *arg1 = (Device *) 0 ; + GSList *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_property_list(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_list" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + result = (GSList *)Device_property_list(arg1); + { + GSList *iter; + + /* Count the DeviceProperties */ + EXTEND(SP, g_slist_length(result)); /* make room for return values */ + + /* Note that we set ST(argvi) several times. the nature of + * SWIG's wrapping is such that incrementing argvi points + * ST(argvi) to the next location in perl's argument stack. + */ + + for (iter = result; iter; iter = g_slist_next(iter)) { + DeviceProperty *prop = iter->data; + HV *hash = newHV(); + SV *rv = newRV_noinc((SV *)hash); + + hv_store(hash, "name", 4, + newSVpv(prop->base->name, 0), 0); + hv_store(hash, "description", 11, + newSVpv(prop->base->description, 0), 0); + hv_store(hash, "access", 6, + newSViv(prop->access), 0); + ST(argvi) = sv_2mortal(rv); + argvi++; + } + } + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_property_get) { + { + Device *arg1 = (Device *) 0 ; + DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ; + GValue *arg3 = (GValue *) 0 ; + PropertySurety *arg4 = (PropertySurety *) 0 ; + PropertySource *arg5 = (PropertySource *) 0 ; + gboolean *arg6 = (gboolean *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + GValue val3 ; + PropertySurety surety3 ; + PropertySource source3 ; + gboolean found3 ; + int argvi = 0; + dXSARGS; + + { + memset(&val3, 0, sizeof(val3)); + arg3 = &val3; + if (GIMME_V == G_ARRAY) { + arg4 = &surety3; + arg5 = &source3; + } + arg6 = &found3; + } + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Device_property_get(self,pbase,surety,source,val_found);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_get" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + { + char *pname = NULL; + + if (SvPOK(ST(1))) + pname = SvPV_nolen(ST(1)); + + if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname); + if (!pname || !arg2) { + SWIG_exception_fail(SWIG_ValueError, "Invalid property name"); + } + } + Device_property_get(arg1,arg2,arg3,arg4,arg5,arg6); + + { + /* if the result is valid */ + if (*arg6) { + /* move data from arg3 to ST(argvi), somehow */ + ST(argvi) = set_sv_from_gvalue(arg3); + argvi++; + + /* free any memory for the GValue */ + g_value_unset(arg3); + + if (GIMME_V == G_ARRAY) { + ST(argvi) = newSViv(*arg4); + argvi++; + ST(argvi) = newSViv(*arg5); + argvi++; + } + } + /* otherwise, return nothing */ + } + + + XSRETURN(argvi); + fail: + + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_property_set) { + { + Device *arg1 = (Device *) 0 ; + DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ; + SV *arg3 = (SV *) 0 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Device_property_set(self,pbase,sv);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + { + char *pname = NULL; + + if (SvPOK(ST(1))) + pname = SvPV_nolen(ST(1)); + + if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname); + if (!pname || !arg2) { + SWIG_exception_fail(SWIG_ValueError, "Invalid property name"); + } + } + arg3 = ST(2); + result = (gboolean)Device_property_set(arg1,arg2,arg3); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_property_set_ex) { + { + Device *arg1 = (Device *) 0 ; + DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ; + SV *arg3 = (SV *) 0 ; + PropertySurety arg4 ; + PropertySource arg5 ; + gboolean result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: Device_property_set_ex(self,pbase,sv,surety,source);"); } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set_ex" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + { + char *pname = NULL; + + if (SvPOK(ST(1))) + pname = SvPV_nolen(ST(1)); + + if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname); + if (!pname || !arg2) { + SWIG_exception_fail(SWIG_ValueError, "Invalid property name"); + } + } + arg3 = ST(2); { if (sizeof(signed int) == 1) { arg4 = amglue_SvI8(ST(3)); @@ -2607,7 +3035,20 @@ XS(_wrap_Device_write_block) { g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ } } - result = (gboolean)Device_write_block(arg1,arg2,arg3,arg4); + { + if (sizeof(signed int) == 1) { + arg5 = amglue_SvI8(ST(4)); + } else if (sizeof(signed int) == 2) { + arg5 = amglue_SvI16(ST(4)); + } else if (sizeof(signed int) == 4) { + arg5 = amglue_SvI32(ST(4)); + } else if (sizeof(signed int) == 8) { + arg5 = amglue_SvI64(ST(4)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (gboolean)Device_property_set_ex(arg1,arg2,arg3,arg4,arg5); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2615,20 +3056,24 @@ XS(_wrap_Device_write_block) { + + XSRETURN(argvi); fail: + + SWIG_croak_null(); } } -XS(_wrap_Device_write_from_fd) { +XS(_wrap_Device_recycle_file) { { Device *arg1 = (Device *) 0 ; - int arg2 ; + guint arg2 ; gboolean result; void *argp1 = 0 ; int res1 = 0 ; @@ -2636,43 +3081,103 @@ XS(_wrap_Device_write_from_fd) { dXSARGS; if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_write_from_fd(self,fd);"); + SWIG_croak("Usage: Device_recycle_file(self,filenum);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_fd" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_recycle_file" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); { - if (sizeof(signed int) == 1) { - arg2 = amglue_SvI8(ST(1)); - } else if (sizeof(signed int) == 2) { - arg2 = amglue_SvI16(ST(1)); - } else if (sizeof(signed int) == 4) { - arg2 = amglue_SvI32(ST(1)); - } else if (sizeof(signed int) == 8) { - arg2 = amglue_SvI64(ST(1)); + if (sizeof(guint) == 1) { + arg2 = amglue_SvU8(ST(1)); + } else if (sizeof(guint) == 2) { + arg2 = amglue_SvU16(ST(1)); + } else if (sizeof(guint) == 4) { + arg2 = amglue_SvU32(ST(1)); + } else if (sizeof(guint) == 8) { + arg2 = amglue_SvU64(ST(1)); } else { - g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */ } } - result = (gboolean)Device_write_from_fd(arg1,arg2); + result = (gboolean)Device_recycle_file(arg1,arg2); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_file) { + { + Device *arg1 = (Device *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_file(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_file" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + result = (int)Device_file(arg1); + { + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + argvi++; + } + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_Device_block) { + { + Device *arg1 = (Device *) 0 ; + guint64 result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_block(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block" "', argument " "1"" of type '" "Device *""'"); + } + arg1 = (Device *)(argp1); + result = Device_block(arg1); { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); argvi++; } - XSRETURN(argvi); fail: - SWIG_croak_null(); } } -XS(_wrap_Device_finish_file) { +XS(_wrap_Device_in_file) { { Device *arg1 = (Device *) 0 ; gboolean result; @@ -2682,14 +3187,14 @@ XS(_wrap_Device_finish_file) { dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_finish_file(self);"); + SWIG_croak("Usage: Device_in_file(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_in_file" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (gboolean)Device_finish_file(arg1); + result = (gboolean)Device_in_file(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2703,39 +3208,25 @@ XS(_wrap_Device_finish_file) { } -XS(_wrap_Device_seek_file) { +XS(_wrap_Device_device_name) { { Device *arg1 = (Device *) 0 ; - guint arg2 ; - dumpfile_t *result = 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_seek_file(self,file);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_device_name(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_device_name" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - { - if (sizeof(guint) == 1) { - arg2 = amglue_SvU8(ST(1)); - } else if (sizeof(guint) == 2) { - arg2 = amglue_SvU16(ST(1)); - } else if (sizeof(guint) == 4) { - arg2 = amglue_SvU32(ST(1)); - } else if (sizeof(guint) == 8) { - arg2 = amglue_SvU64(ST(1)); - } else { - croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */ - } - } - result = (dumpfile_t *)Device_seek_file(arg1,arg2); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ; + result = (char *)Device_device_name(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: @@ -2745,28 +3236,24 @@ XS(_wrap_Device_seek_file) { } -XS(_wrap_Device_seek_block) { +XS(_wrap_Device_access_mode) { { Device *arg1 = (Device *) 0 ; - guint64 arg2 ; - gboolean result; + DeviceAccessMode result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_seek_block(self,block);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_access_mode(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_access_mode" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - { - arg2 = amglue_SvU64(ST(1)); - } - result = (gboolean)Device_seek_block(arg1,arg2); + result = (DeviceAccessMode)Device_access_mode(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -2780,139 +3267,84 @@ XS(_wrap_Device_seek_block) { } -XS(_wrap_Device_read_block) { +XS(_wrap_Device_is_eof) { { Device *arg1 = (Device *) 0 ; - gpointer arg2 = (gpointer) 0 ; - int *arg3 = (int *) 0 ; - int result; + gboolean result; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - void *argp3 = 0 ; - int res3 = 0 ; int argvi = 0; dXSARGS; - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: Device_read_block(self,buffer,size);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_is_eof(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eof" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'"); - } - res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'"); - } - arg3 = (int *)(argp3); - result = (int)Device_read_block(arg1,arg2,arg3); + result = (gboolean)Device_is_eof(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } - - XSRETURN(argvi); fail: - - SWIG_croak_null(); } } -XS(_wrap_Device_read_to_fd) { +XS(_wrap_Device_volume_label) { { Device *arg1 = (Device *) 0 ; - int arg2 ; - gboolean result; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_read_to_fd(self,fd);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_volume_label(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_fd" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_label" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - { - if (sizeof(signed int) == 1) { - arg2 = amglue_SvI8(ST(1)); - } else if (sizeof(signed int) == 2) { - arg2 = amglue_SvI16(ST(1)); - } else if (sizeof(signed int) == 4) { - arg2 = amglue_SvI32(ST(1)); - } else if (sizeof(signed int) == 8) { - arg2 = amglue_SvI64(ST(1)); - } else { - g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ - } - } - result = (gboolean)Device_read_to_fd(arg1,arg2); - { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); - argvi++; - } - + result = (char *)Device_volume_label(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: - SWIG_croak_null(); } } -XS(_wrap_Device_property_list) { +XS(_wrap_Device_volume_time) { { Device *arg1 = (Device *) 0 ; - DeviceProperty *result = 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_property_list(self);"); + SWIG_croak("Usage: Device_volume_time(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_list" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_time" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - result = (DeviceProperty *)Device_property_list(arg1); - { - int i = 0; - int len = 0; - - /* Count the DeviceProperties */ - while (result[len].base) len++; - EXTEND(SP, len); /* make room for return values */ - - /* Note that we set ST(argvi) several times. the nature of - * SWIG's wrapping is such that incrementing argvi points - * ST(argvi) to the next location in perl's argument stack. - */ - - for (i = 0; i < len ; i++) { - ST(argvi) = sv_newmortal(); - sv_setpv(ST(argvi), result[i].base->name); - argvi++; - }; - } + result = (char *)Device_volume_time(arg1); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; XSRETURN(argvi); fail: @@ -2922,154 +3354,88 @@ XS(_wrap_Device_property_list) { } -XS(_wrap_Device_property_get) { +XS(_wrap_Device_status) { { Device *arg1 = (Device *) 0 ; - DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ; - GValue *arg3 = (GValue *) 0 ; - gboolean *arg4 = (gboolean *) 0 ; + DeviceStatusFlags result; void *argp1 = 0 ; int res1 = 0 ; - GValue val3 ; - gboolean found3 ; int argvi = 0; dXSARGS; - { - memset(&val3, 0, sizeof(val3)); - arg3 = &val3; - arg4 = &found3; - } - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_property_get(self,pbase,val_found);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_status(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_get" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_status" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); + result = (DeviceStatusFlags)Device_status(arg1); { - char *pname = NULL; - - if (SvPOK(ST(1))) - pname = SvPV_nolen(ST(1)); - - if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname); - if (!pname || !arg2) { - SWIG_exception_fail(SWIG_ValueError, "Invalid property name"); - } - } - Device_property_get(arg1,arg2,arg3,arg4); - - { - /* if the result is valid */ - if (*arg4) { - /* move data from arg3 to ST(argvi), somehow */ - ST(argvi) = set_sv_from_gvalue(arg3); - - /* free any memory for the GValue */ - g_value_unset(arg3); - } else { - /* silently return 'undef', the sentinel for "undefined" */ - ST(argvi) = sv_newmortal(); - sv_setsv(ST(argvi), &PL_sv_undef); - } + ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; } - XSRETURN(argvi); fail: - SWIG_croak_null(); } } -XS(_wrap_Device_property_set) { +XS(_wrap_Device_min_block_size) { { Device *arg1 = (Device *) 0 ; - DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ; - SV *arg3 = (SV *) 0 ; - gboolean result; + gsize result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: Device_property_set(self,pbase,sv);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_min_block_size(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_min_block_size" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); + result = Device_min_block_size(arg1); { - char *pname = NULL; - - if (SvPOK(ST(1))) - pname = SvPV_nolen(ST(1)); - - if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname); - if (!pname || !arg2) { - SWIG_exception_fail(SWIG_ValueError, "Invalid property name"); - } - } - arg3 = ST(2); - result = (gboolean)Device_property_set(arg1,arg2,arg3); - { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); argvi++; } - - XSRETURN(argvi); fail: - - SWIG_croak_null(); } } -XS(_wrap_Device_recycle_file) { +XS(_wrap_Device_max_block_size) { { Device *arg1 = (Device *) 0 ; - guint arg2 ; - gboolean result; + gsize result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Device_recycle_file(self,filenum);"); + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Device_max_block_size(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_recycle_file" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_max_block_size" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); + result = Device_max_block_size(arg1); { - if (sizeof(guint) == 1) { - arg2 = amglue_SvU8(ST(1)); - } else if (sizeof(guint) == 2) { - arg2 = amglue_SvU16(ST(1)); - } else if (sizeof(guint) == 4) { - arg2 = amglue_SvU32(ST(1)); - } else if (sizeof(guint) == 8) { - arg2 = amglue_SvU64(ST(1)); - } else { - croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */ - } - } - result = (gboolean)Device_recycle_file(arg1,arg2); - { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); argvi++; } @@ -3081,24 +3447,28 @@ XS(_wrap_Device_recycle_file) { } -XS(_wrap_Device_set_startup_properties_from_config) { +XS(_wrap_Device_block_size) { { Device *arg1 = (Device *) 0 ; + gsize result; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Device_set_startup_properties_from_config(self);"); + SWIG_croak("Usage: Device_block_size(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_set_startup_properties_from_config" "', argument " "1"" of type '" "Device *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block_size" "', argument " "1"" of type '" "Device *""'"); } arg1 = (Device *)(argp1); - Device_set_startup_properties_from_config(arg1); - + result = Device_block_size(arg1); + { + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + argvi++; + } XSRETURN(argvi); fail: @@ -3108,34 +3478,25 @@ XS(_wrap_Device_set_startup_properties_from_config) { } -XS(_wrap_IS_WRITABLE_ACCESS_MODE) { +XS(_wrap_Device_volume_header) { { - DeviceAccessMode arg1 ; - gboolean result; + Device *arg1 = (Device *) 0 ; + dumpfile_t *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: IS_WRITABLE_ACCESS_MODE(mode);"); - } - { - if (sizeof(signed int) == 1) { - arg1 = amglue_SvI8(ST(0)); - } else if (sizeof(signed int) == 2) { - arg1 = amglue_SvI16(ST(0)); - } else if (sizeof(signed int) == 4) { - arg1 = amglue_SvI32(ST(0)); - } else if (sizeof(signed int) == 8) { - arg1 = amglue_SvI64(ST(0)); - } else { - g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ - } + SWIG_croak("Usage: Device_volume_header(self);"); } - result = (gboolean)IS_WRITABLE_ACCESS_MODE(arg1); - { - ST(argvi) = sv_2mortal(amglue_newSVi64(result)); - argvi++; + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_header" "', argument " "1"" of type '" "Device *""'"); } + arg1 = (Device *)(argp1); + result = (dumpfile_t *)Device_volume_header(arg1); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ; XSRETURN(argvi); fail: @@ -3145,15 +3506,15 @@ XS(_wrap_IS_WRITABLE_ACCESS_MODE) { } -XS(_wrap_feature_support_flags_is_valid) { +XS(_wrap_IS_WRITABLE_ACCESS_MODE) { { - FeatureSupportFlags arg1 ; + DeviceAccessMode arg1 ; gboolean result; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: feature_support_flags_is_valid(FeatureSupportFlags);"); + SWIG_croak("Usage: IS_WRITABLE_ACCESS_MODE(mode);"); } { if (sizeof(signed int) == 1) { @@ -3168,7 +3529,7 @@ XS(_wrap_feature_support_flags_is_valid) { g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ } } - result = (gboolean)feature_support_flags_is_valid(arg1); + result = (gboolean)IS_WRITABLE_ACCESS_MODE(arg1); { ST(argvi) = sv_2mortal(amglue_newSVi64(result)); argvi++; @@ -3195,7 +3556,8 @@ static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_guint = {"_p_guint", "guint *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *|ConcurrencyParadigm *|filetype_t *|SizeAccuracy *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|FeatureSupportFlags *|ReadLabelStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|SizeAccuracy *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_queue_fd_t = {"_p_queue_fd_t", "struct queue_fd_t *|queue_fd_t *", 0, 0, (void*)"Amanda::Device::queue_fd_t", 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { @@ -3210,6 +3572,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_guint, &_swigt__p_guint64, &_swigt__p_int, + &_swigt__p_queue_fd_t, &_swigt__p_unsigned_char, }; @@ -3224,6 +3587,7 @@ static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, static swig_cast_info _swigc__p_guint[] = { {&_swigt__p_guint, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_guint64[] = { {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_queue_fd_t[] = { {&_swigt__p_queue_fd_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { @@ -3238,6 +3602,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_guint, _swigc__p_guint64, _swigc__p_int, + _swigc__p_queue_fd_t, _swigc__p_unsigned_char, }; @@ -3254,23 +3619,20 @@ static swig_variable_info swig_variables[] = { {0,0,0,0} }; static swig_command_info swig_commands[] = { -{"Amanda::Devicec::Device_file_get", _wrap_Device_file_get}, -{"Amanda::Devicec::Device_block_get", _wrap_Device_block_get}, -{"Amanda::Devicec::Device_in_file_get", _wrap_Device_in_file_get}, -{"Amanda::Devicec::Device_device_name_get", _wrap_Device_device_name_get}, -{"Amanda::Devicec::Device_access_mode_get", _wrap_Device_access_mode_get}, -{"Amanda::Devicec::Device_is_eof_get", _wrap_Device_is_eof_get}, -{"Amanda::Devicec::Device_volume_label_get", _wrap_Device_volume_label_get}, -{"Amanda::Devicec::Device_volume_time_get", _wrap_Device_volume_time_get}, +{"Amanda::Devicec::queue_fd_t_fd_get", _wrap_queue_fd_t_fd_get}, +{"Amanda::Devicec::queue_fd_t_errmsg_get", _wrap_queue_fd_t_errmsg_get}, +{"Amanda::Devicec::new_queue_fd_t", _wrap_new_queue_fd_t}, +{"Amanda::Devicec::delete_queue_fd_t", _wrap_delete_queue_fd_t}, {"Amanda::Devicec::new_Device", _wrap_new_Device}, {"Amanda::Devicec::delete_Device", _wrap_delete_Device}, +{"Amanda::Devicec::Device_configure", _wrap_Device_configure}, +{"Amanda::Devicec::Device_error", _wrap_Device_error}, +{"Amanda::Devicec::Device_status_error", _wrap_Device_status_error}, +{"Amanda::Devicec::Device_error_or_status", _wrap_Device_error_or_status}, {"Amanda::Devicec::Device_read_label", _wrap_Device_read_label}, {"Amanda::Devicec::Device_start", _wrap_Device_start}, {"Amanda::Devicec::Device_finish", _wrap_Device_finish}, {"Amanda::Devicec::Device_start_file", _wrap_Device_start_file}, -{"Amanda::Devicec::Device_write_min_size", _wrap_Device_write_min_size}, -{"Amanda::Devicec::Device_write_max_size", _wrap_Device_write_max_size}, -{"Amanda::Devicec::Device_read_max_size", _wrap_Device_read_max_size}, {"Amanda::Devicec::Device_write_block", _wrap_Device_write_block}, {"Amanda::Devicec::Device_write_from_fd", _wrap_Device_write_from_fd}, {"Amanda::Devicec::Device_finish_file", _wrap_Device_finish_file}, @@ -3281,10 +3643,22 @@ static swig_command_info swig_commands[] = { {"Amanda::Devicec::Device_property_list", _wrap_Device_property_list}, {"Amanda::Devicec::Device_property_get", _wrap_Device_property_get}, {"Amanda::Devicec::Device_property_set", _wrap_Device_property_set}, +{"Amanda::Devicec::Device_property_set_ex", _wrap_Device_property_set_ex}, {"Amanda::Devicec::Device_recycle_file", _wrap_Device_recycle_file}, -{"Amanda::Devicec::Device_set_startup_properties_from_config", _wrap_Device_set_startup_properties_from_config}, +{"Amanda::Devicec::Device_file", _wrap_Device_file}, +{"Amanda::Devicec::Device_block", _wrap_Device_block}, +{"Amanda::Devicec::Device_in_file", _wrap_Device_in_file}, +{"Amanda::Devicec::Device_device_name", _wrap_Device_device_name}, +{"Amanda::Devicec::Device_access_mode", _wrap_Device_access_mode}, +{"Amanda::Devicec::Device_is_eof", _wrap_Device_is_eof}, +{"Amanda::Devicec::Device_volume_label", _wrap_Device_volume_label}, +{"Amanda::Devicec::Device_volume_time", _wrap_Device_volume_time}, +{"Amanda::Devicec::Device_status", _wrap_Device_status}, +{"Amanda::Devicec::Device_min_block_size", _wrap_Device_min_block_size}, +{"Amanda::Devicec::Device_max_block_size", _wrap_Device_max_block_size}, +{"Amanda::Devicec::Device_block_size", _wrap_Device_block_size}, +{"Amanda::Devicec::Device_volume_header", _wrap_Device_volume_header}, {"Amanda::Devicec::IS_WRITABLE_ACCESS_MODE", _wrap_IS_WRITABLE_ACCESS_MODE}, -{"Amanda::Devicec::feature_support_flags_is_valid", _wrap_feature_support_flags_is_valid}, {0,0} }; /* ----------------------------------------------------------------------------- @@ -3344,7 +3718,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -3354,6 +3728,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -3382,6 +3759,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -3535,7 +3918,7 @@ XS(SWIG_init) { /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2); + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { @@ -3547,7 +3930,7 @@ XS(SWIG_init) { /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2); + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -3574,285 +3957,251 @@ XS(SWIG_init) { /* Initialize the Device API on load */ device_api_init(); + SWIG_TypeClientData(SWIGTYPE_p_queue_fd_t, (void*) "Amanda::Device::queue_fd_t"); SWIG_TypeClientData(SWIGTYPE_p_Device, (void*) "Amanda::Device::Device"); - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ACCESS_NULL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ACCESS_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ACCESS_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ACCESS_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ACCESS_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ACCESS_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ACCESS_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "ACCESS_APPEND", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "ACCESS_APPEND", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(ACCESS_APPEND))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_SUCCESS", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_SUCCESS))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_SUCCESS", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_SUCCESS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_DEVICE_MISSING", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_DEVICE_MISSING))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_DEVICE_ERROR", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_DEVICE_ERROR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_DEVICE_ERROR", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_DEVICE_ERROR))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_DEVICE_BUSY", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_DEVICE_BUSY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_MISSING", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_MISSING))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_MISSING", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_MISSING))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_UNLABELED", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_UNLABELED))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_UNLABELED", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_UNLABELED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_VOLUME_ERROR", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_VOLUME_ERROR))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_ERROR", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_ERROR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "READ_LABEL_STATUS_FLAGS_MAX", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(READ_LABEL_STATUS_FLAGS_MAX))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_FLAGS_MAX", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_FLAGS_MAX))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BEFORE_START", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BEFORE_START))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MAX", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MAX", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MAX))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MASK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MASK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MASK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_SHIFT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_SHIFT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_SHIFT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BEFORE_START", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BEFORE_START))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BEFORE_START", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BEFORE_START))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_MASK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_MASK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_MASK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_MASK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_MASK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_MASK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_EXCLUSIVE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_EXCLUSIVE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_EXCLUSIVE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_SHARED_READ", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_SHARED_READ", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_SHARED_READ))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_RANDOM_ACCESS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_RANDOM_ACCESS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_RANDOM_ACCESS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_NONE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_NONE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_NONE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_DESIRED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_DESIRED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_DESIRED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_REQUIRED", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_REQUIRED", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_REQUIRED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_ONLY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_ONLY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_ONLY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WORM", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WORM", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WORM))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_WRITE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_WRITE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_WRITE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WRITE_ONLY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WRITE_ONLY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WRITE_ONLY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_UNKNOWN", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_UNKNOWN", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_UNKNOWN))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_ESTIMATE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_ESTIMATE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_REAL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_REAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_REAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_STATUS_ENABLED", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_STATUS_ENABLED))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_STATUS_DISABLED", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_STATUS_DISABLED))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SURETY_BAD", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SURETY_BAD))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SURETY_GOOD", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SURETY_GOOD))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_DEFAULT", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_DEFAULT))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_DETECTED", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_DETECTED))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SOURCE_USER", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SOURCE_USER))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_MAX", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_MAX))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_BAD", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_BAD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_MASK", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_MASK))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_GOOD", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_GOOD))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_STATUS_MASK", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_STATUS_MASK))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_DEFAULT", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_DEFAULT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_SURETY_MASK", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_SURETY_MASK))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_DETECTED", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_DETECTED))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "FEATURE_SUPPORT_FLAGS_SOURCE_MASK", TRUE | 0x2); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(FEATURE_SUPPORT_FLAGS_SOURCE_MASK))); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_USER", TRUE | 0x2 | GV_ADDMULTI); + sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_USER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; ST(0) = &PL_sv_yes; diff --git a/perl/Amanda/Device.pm b/perl/Amanda/Device.pm index 5549f11..81a989f 100644 --- a/perl/Amanda/Device.pm +++ b/perl/Amanda/Device.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -51,7 +51,47 @@ sub this { package Amanda::Device; *IS_WRITABLE_ACCESS_MODE = *Amanda::Devicec::IS_WRITABLE_ACCESS_MODE; -*feature_support_flags_is_valid = *Amanda::Devicec::feature_support_flags_is_valid; + +############# Class : Amanda::Device::queue_fd_t ############## + +package Amanda::Device::queue_fd_t; +use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); +@ISA = qw( Amanda::Device ); +%OWNER = (); +%ITERATORS = (); +*swig_fd_get = *Amanda::Devicec::queue_fd_t_fd_get; +*swig_fd_set = *Amanda::Devicec::queue_fd_t_fd_set; +*swig_errmsg_get = *Amanda::Devicec::queue_fd_t_errmsg_get; +*swig_errmsg_set = *Amanda::Devicec::queue_fd_t_errmsg_set; +sub new { + my $pkg = shift; + my $self = Amanda::Devicec::new_queue_fd_t(@_); + bless $self, $pkg if defined($self); +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + Amanda::Devicec::delete_queue_fd_t($self); + delete $OWNER{$self}; + } +} + +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; +} + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; +} + ############# Class : Amanda::Device::Device ############## @@ -60,22 +100,6 @@ use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( Amanda::Device ); %OWNER = (); %ITERATORS = (); -*swig_file_get = *Amanda::Devicec::Device_file_get; -*swig_file_set = *Amanda::Devicec::Device_file_set; -*swig_block_get = *Amanda::Devicec::Device_block_get; -*swig_block_set = *Amanda::Devicec::Device_block_set; -*swig_in_file_get = *Amanda::Devicec::Device_in_file_get; -*swig_in_file_set = *Amanda::Devicec::Device_in_file_set; -*swig_device_name_get = *Amanda::Devicec::Device_device_name_get; -*swig_device_name_set = *Amanda::Devicec::Device_device_name_set; -*swig_access_mode_get = *Amanda::Devicec::Device_access_mode_get; -*swig_access_mode_set = *Amanda::Devicec::Device_access_mode_set; -*swig_is_eof_get = *Amanda::Devicec::Device_is_eof_get; -*swig_is_eof_set = *Amanda::Devicec::Device_is_eof_set; -*swig_volume_label_get = *Amanda::Devicec::Device_volume_label_get; -*swig_volume_label_set = *Amanda::Devicec::Device_volume_label_set; -*swig_volume_time_get = *Amanda::Devicec::Device_volume_time_get; -*swig_volume_time_set = *Amanda::Devicec::Device_volume_time_set; sub new { my $pkg = shift; my $self = Amanda::Devicec::new_Device(@_); @@ -93,13 +117,14 @@ sub DESTROY { } } +*configure = *Amanda::Devicec::Device_configure; +*error = *Amanda::Devicec::Device_error; +*status_error = *Amanda::Devicec::Device_status_error; +*error_or_status = *Amanda::Devicec::Device_error_or_status; *read_label = *Amanda::Devicec::Device_read_label; *start = *Amanda::Devicec::Device_start; *finish = *Amanda::Devicec::Device_finish; *start_file = *Amanda::Devicec::Device_start_file; -*write_min_size = *Amanda::Devicec::Device_write_min_size; -*write_max_size = *Amanda::Devicec::Device_write_max_size; -*read_max_size = *Amanda::Devicec::Device_read_max_size; *write_block = *Amanda::Devicec::Device_write_block; *write_from_fd = *Amanda::Devicec::Device_write_from_fd; *finish_file = *Amanda::Devicec::Device_finish_file; @@ -110,8 +135,21 @@ sub DESTROY { *property_list = *Amanda::Devicec::Device_property_list; *property_get = *Amanda::Devicec::Device_property_get; *property_set = *Amanda::Devicec::Device_property_set; +*property_set_ex = *Amanda::Devicec::Device_property_set_ex; *recycle_file = *Amanda::Devicec::Device_recycle_file; -*set_startup_properties_from_config = *Amanda::Devicec::Device_set_startup_properties_from_config; +*file = *Amanda::Devicec::Device_file; +*block = *Amanda::Devicec::Device_block; +*in_file = *Amanda::Devicec::Device_in_file; +*device_name = *Amanda::Devicec::Device_device_name; +*access_mode = *Amanda::Devicec::Device_access_mode; +*is_eof = *Amanda::Devicec::Device_is_eof; +*volume_label = *Amanda::Devicec::Device_volume_label; +*volume_time = *Amanda::Devicec::Device_volume_time; +*status = *Amanda::Devicec::Device_status; +*min_block_size = *Amanda::Devicec::Device_min_block_size; +*max_block_size = *Amanda::Devicec::Device_max_block_size; +*block_size = *Amanda::Devicec::Device_block_size; +*volume_header = *Amanda::Devicec::Device_volume_header; sub DISOWN { my $self = shift; my $ptr = tied(%$self); @@ -133,13 +171,13 @@ package Amanda::Device; *ACCESS_READ = *Amanda::Devicec::ACCESS_READ; *ACCESS_WRITE = *Amanda::Devicec::ACCESS_WRITE; *ACCESS_APPEND = *Amanda::Devicec::ACCESS_APPEND; -*READ_LABEL_STATUS_SUCCESS = *Amanda::Devicec::READ_LABEL_STATUS_SUCCESS; -*READ_LABEL_STATUS_DEVICE_MISSING = *Amanda::Devicec::READ_LABEL_STATUS_DEVICE_MISSING; -*READ_LABEL_STATUS_DEVICE_ERROR = *Amanda::Devicec::READ_LABEL_STATUS_DEVICE_ERROR; -*READ_LABEL_STATUS_VOLUME_MISSING = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_MISSING; -*READ_LABEL_STATUS_VOLUME_UNLABELED = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_UNLABELED; -*READ_LABEL_STATUS_VOLUME_ERROR = *Amanda::Devicec::READ_LABEL_STATUS_VOLUME_ERROR; -*READ_LABEL_STATUS_FLAGS_MAX = *Amanda::Devicec::READ_LABEL_STATUS_FLAGS_MAX; +*DEVICE_STATUS_SUCCESS = *Amanda::Devicec::DEVICE_STATUS_SUCCESS; +*DEVICE_STATUS_DEVICE_ERROR = *Amanda::Devicec::DEVICE_STATUS_DEVICE_ERROR; +*DEVICE_STATUS_DEVICE_BUSY = *Amanda::Devicec::DEVICE_STATUS_DEVICE_BUSY; +*DEVICE_STATUS_VOLUME_MISSING = *Amanda::Devicec::DEVICE_STATUS_VOLUME_MISSING; +*DEVICE_STATUS_VOLUME_UNLABELED = *Amanda::Devicec::DEVICE_STATUS_VOLUME_UNLABELED; +*DEVICE_STATUS_VOLUME_ERROR = *Amanda::Devicec::DEVICE_STATUS_VOLUME_ERROR; +*DEVICE_STATUS_FLAGS_MAX = *Amanda::Devicec::DEVICE_STATUS_FLAGS_MAX; *PROPERTY_PHASE_BEFORE_START = *Amanda::Devicec::PROPERTY_PHASE_BEFORE_START; *PROPERTY_PHASE_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_BETWEEN_FILE_WRITE; *PROPERTY_PHASE_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_INSIDE_FILE_WRITE; @@ -173,18 +211,11 @@ package Amanda::Device; *SIZE_ACCURACY_UNKNOWN = *Amanda::Devicec::SIZE_ACCURACY_UNKNOWN; *SIZE_ACCURACY_ESTIMATE = *Amanda::Devicec::SIZE_ACCURACY_ESTIMATE; *SIZE_ACCURACY_REAL = *Amanda::Devicec::SIZE_ACCURACY_REAL; -*FEATURE_STATUS_ENABLED = *Amanda::Devicec::FEATURE_STATUS_ENABLED; -*FEATURE_STATUS_DISABLED = *Amanda::Devicec::FEATURE_STATUS_DISABLED; -*FEATURE_SURETY_BAD = *Amanda::Devicec::FEATURE_SURETY_BAD; -*FEATURE_SURETY_GOOD = *Amanda::Devicec::FEATURE_SURETY_GOOD; -*FEATURE_SOURCE_DEFAULT = *Amanda::Devicec::FEATURE_SOURCE_DEFAULT; -*FEATURE_SOURCE_DETECTED = *Amanda::Devicec::FEATURE_SOURCE_DETECTED; -*FEATURE_SOURCE_USER = *Amanda::Devicec::FEATURE_SOURCE_USER; -*FEATURE_SUPPORT_FLAGS_MAX = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_MAX; -*FEATURE_SUPPORT_FLAGS_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_MASK; -*FEATURE_SUPPORT_FLAGS_STATUS_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_STATUS_MASK; -*FEATURE_SUPPORT_FLAGS_SURETY_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_SURETY_MASK; -*FEATURE_SUPPORT_FLAGS_SOURCE_MASK = *Amanda::Devicec::FEATURE_SUPPORT_FLAGS_SOURCE_MASK; +*PROPERTY_SURETY_BAD = *Amanda::Devicec::PROPERTY_SURETY_BAD; +*PROPERTY_SURETY_GOOD = *Amanda::Devicec::PROPERTY_SURETY_GOOD; +*PROPERTY_SOURCE_DEFAULT = *Amanda::Devicec::PROPERTY_SOURCE_DEFAULT; +*PROPERTY_SOURCE_DETECTED = *Amanda::Devicec::PROPERTY_SOURCE_DETECTED; +*PROPERTY_SOURCE_USER = *Amanda::Devicec::PROPERTY_SOURCE_USER; @EXPORT_OK = (); %EXPORT_TAGS = (); @@ -198,8 +229,7 @@ Amanda::Device - interact with Amanda data-storage devices use Amanda::Device qw( :constants ); my $dev = Amanda::Device->new($device_name); - $dev->set_startup_properties_from_config(); - if ($dev->read_label() == $READ_LABEL_STATUS_SUCCESS) { + if ($dev->read_label() == $DEVICE_STATUS_SUCCESS) { print "Label on $device_name is '$dev->volume_label'\n"; } @@ -211,33 +241,12 @@ Stable =head1 Amanda::Device Objects -=head2 Instance Variables +See the wiki for descriptions of these functions. Note that C instance variables +are represented by accessor functions of the same name. =over -=item C<$file> - -=item C<$block> - -=item C<$in_file> - -=item C<$device_name> - -=item C<$access_mode> - -=item C<$is_eof> - -=item C<$volume_label> - -=item C<$volume_time> - -=back - -=head2 Methods - -See the wiki for descriptions of these functions - -=over +=item C =item C @@ -247,13 +256,7 @@ See the wiki for descriptions of these functions =item C -where C<$jobinfo> is a C (see L) - -=item C - -=item C - -=item C +where C<$jobinfo> is a C (see L) =item C @@ -261,7 +264,7 @@ Note that Perl code is not expected to handle on-device data, so there is currently no way to provide data to this function from Perl. This may change in future revisions. -=item C +=item C where C<$fd> is an integer file descriptor, not a filehandle @@ -273,7 +276,7 @@ where C<$fd> is an integer file descriptor, not a filehandle =item C -=item C +=item C where C<$fd> is an integer file descriptor, not a filehandle @@ -283,19 +286,50 @@ change in future revisions. =item C -returns a list of property names. +returns a list of properties, each represented as a hash: + + { 'access' => $access_flags, + 'name' => $property_name, + 'description' => $property_description } =item C -returns the property as the appropriate Perl type. +returns the property, with the appropriate Perl type, or undef. In array +context, returns the list C<($value, $surety, $source)>. =item C -where $value is of an appropriate type for the given property +=item C + +where C<$value> is of an appropriate type for the given property, C<$surety> is +a C<$PROPERTY_SURETY_*> constant, and C<$source> is a C<$PROPERTY_SOURCE_*> +constant. =item C -=item C +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) =back @@ -304,7 +338,7 @@ where $value is of an appropriate type for the given property This module defines a large number of constants. Again, consult the wiki or C for the details on their meaning. These constants are available from the package namespace (e.g., -C), of imported with the C<:constant> +C), or imported with the C<:constant> import tag. =cut @@ -361,17 +395,17 @@ push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw(IS_WRITABLE_ACCESS_MODE); #copy symbols in DeviceAccessMode to constants push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"DeviceAccessMode"}}; -push @EXPORT_OK, qw(ReadLabelStatusFlags_to_strings); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw(ReadLabelStatusFlags_to_strings); +push @EXPORT_OK, qw(DeviceStatusFlags_to_strings); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw(DeviceStatusFlags_to_strings); -my %_ReadLabelStatusFlags_VALUES; +my %_DeviceStatusFlags_VALUES; #Convert a flag value to a list of names for flags that are set. -sub ReadLabelStatusFlags_to_strings { +sub DeviceStatusFlags_to_strings { my ($flags) = @_; my @result = (); - for my $k (keys %_ReadLabelStatusFlags_VALUES) { - my $v = $_ReadLabelStatusFlags_VALUES{$k}; + for my $k (keys %_DeviceStatusFlags_VALUES) { + my $v = $_DeviceStatusFlags_VALUES{$k}; #is this a matching flag? if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) { @@ -387,41 +421,41 @@ sub ReadLabelStatusFlags_to_strings { return @result; } -push @EXPORT_OK, qw($READ_LABEL_STATUS_SUCCESS); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_SUCCESS); +push @EXPORT_OK, qw($DEVICE_STATUS_SUCCESS); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_SUCCESS); -$_ReadLabelStatusFlags_VALUES{"SUCCESS"} = $READ_LABEL_STATUS_SUCCESS; +$_DeviceStatusFlags_VALUES{"SUCCESS"} = $DEVICE_STATUS_SUCCESS; -push @EXPORT_OK, qw($READ_LABEL_STATUS_DEVICE_MISSING); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_DEVICE_MISSING); +push @EXPORT_OK, qw($DEVICE_STATUS_DEVICE_ERROR); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_DEVICE_ERROR); -$_ReadLabelStatusFlags_VALUES{"DEVICE_MISSING"} = $READ_LABEL_STATUS_DEVICE_MISSING; +$_DeviceStatusFlags_VALUES{"DEVICE_ERROR"} = $DEVICE_STATUS_DEVICE_ERROR; -push @EXPORT_OK, qw($READ_LABEL_STATUS_DEVICE_ERROR); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_DEVICE_ERROR); +push @EXPORT_OK, qw($DEVICE_STATUS_DEVICE_BUSY); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_DEVICE_BUSY); -$_ReadLabelStatusFlags_VALUES{"DEVICE_ERROR"} = $READ_LABEL_STATUS_DEVICE_ERROR; +$_DeviceStatusFlags_VALUES{"DEVICE_BUSY"} = $DEVICE_STATUS_DEVICE_BUSY; -push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_MISSING); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_MISSING); +push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_MISSING); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_MISSING); -$_ReadLabelStatusFlags_VALUES{"VOLUME_MISSING"} = $READ_LABEL_STATUS_VOLUME_MISSING; +$_DeviceStatusFlags_VALUES{"VOLUME_MISSING"} = $DEVICE_STATUS_VOLUME_MISSING; -push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_UNLABELED); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_UNLABELED); +push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_UNLABELED); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_UNLABELED); -$_ReadLabelStatusFlags_VALUES{"VOLUME_UNLABELED"} = $READ_LABEL_STATUS_VOLUME_UNLABELED; +$_DeviceStatusFlags_VALUES{"VOLUME_UNLABELED"} = $DEVICE_STATUS_VOLUME_UNLABELED; -push @EXPORT_OK, qw($READ_LABEL_STATUS_VOLUME_ERROR); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_VOLUME_ERROR); +push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_ERROR); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_ERROR); -$_ReadLabelStatusFlags_VALUES{"VOLUME_ERROR"} = $READ_LABEL_STATUS_VOLUME_ERROR; +$_DeviceStatusFlags_VALUES{"VOLUME_ERROR"} = $DEVICE_STATUS_VOLUME_ERROR; -push @EXPORT_OK, qw($READ_LABEL_STATUS_FLAGS_MAX); -push @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}, qw($READ_LABEL_STATUS_FLAGS_MAX); +push @EXPORT_OK, qw($DEVICE_STATUS_FLAGS_MAX); +push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_FLAGS_MAX); -#copy symbols in ReadLabelStatusFlags to constants -push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"ReadLabelStatusFlags"}}; +#copy symbols in DeviceStatusFlags to constants +push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"DeviceStatusFlags"}}; push @EXPORT_OK, qw(PropertyPhaseFlags_to_strings); push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw(PropertyPhaseFlags_to_strings); @@ -732,17 +766,17 @@ $_SizeAccuracy_VALUES{"REAL"} = $SIZE_ACCURACY_REAL; #copy symbols in SizeAccuracy to constants push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"SizeAccuracy"}}; -push @EXPORT_OK, qw(FeatureSupportFlags_to_strings); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw(FeatureSupportFlags_to_strings); +push @EXPORT_OK, qw(PropertySurety_to_strings); +push @{$EXPORT_TAGS{"PropertySurety"}}, qw(PropertySurety_to_strings); -my %_FeatureSupportFlags_VALUES; +my %_PropertySurety_VALUES; #Convert a flag value to a list of names for flags that are set. -sub FeatureSupportFlags_to_strings { +sub PropertySurety_to_strings { my ($flags) = @_; my @result = (); - for my $k (keys %_FeatureSupportFlags_VALUES) { - my $v = $_FeatureSupportFlags_VALUES{$k}; + for my $k (keys %_PropertySurety_VALUES) { + my $v = $_PropertySurety_VALUES{$k}; #is this a matching flag? if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) { @@ -758,61 +792,62 @@ sub FeatureSupportFlags_to_strings { return @result; } -push @EXPORT_OK, qw($FEATURE_STATUS_ENABLED); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_STATUS_ENABLED); - -$_FeatureSupportFlags_VALUES{"STATUS_ENABLED"} = $FEATURE_STATUS_ENABLED; - -push @EXPORT_OK, qw($FEATURE_STATUS_DISABLED); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_STATUS_DISABLED); - -$_FeatureSupportFlags_VALUES{"STATUS_DISABLED"} = $FEATURE_STATUS_DISABLED; +push @EXPORT_OK, qw($PROPERTY_SURETY_BAD); +push @{$EXPORT_TAGS{"PropertySurety"}}, qw($PROPERTY_SURETY_BAD); -push @EXPORT_OK, qw($FEATURE_SURETY_BAD); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SURETY_BAD); +$_PropertySurety_VALUES{"SURETY_BAD"} = $PROPERTY_SURETY_BAD; -$_FeatureSupportFlags_VALUES{"SURETY_BAD"} = $FEATURE_SURETY_BAD; +push @EXPORT_OK, qw($PROPERTY_SURETY_GOOD); +push @{$EXPORT_TAGS{"PropertySurety"}}, qw($PROPERTY_SURETY_GOOD); -push @EXPORT_OK, qw($FEATURE_SURETY_GOOD); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SURETY_GOOD); +$_PropertySurety_VALUES{"SURETY_GOOD"} = $PROPERTY_SURETY_GOOD; -$_FeatureSupportFlags_VALUES{"SURETY_GOOD"} = $FEATURE_SURETY_GOOD; +#copy symbols in PropertySurety to constants +push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertySurety"}}; -push @EXPORT_OK, qw($FEATURE_SOURCE_DEFAULT); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_DEFAULT); +push @EXPORT_OK, qw(PropertySource_to_strings); +push @{$EXPORT_TAGS{"PropertySource"}}, qw(PropertySource_to_strings); -$_FeatureSupportFlags_VALUES{"SOURCE_DEFAULT"} = $FEATURE_SOURCE_DEFAULT; +my %_PropertySource_VALUES; +#Convert a flag value to a list of names for flags that are set. +sub PropertySource_to_strings { + my ($flags) = @_; + my @result = (); -push @EXPORT_OK, qw($FEATURE_SOURCE_DETECTED); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_DETECTED); + for my $k (keys %_PropertySource_VALUES) { + my $v = $_PropertySource_VALUES{$k}; -$_FeatureSupportFlags_VALUES{"SOURCE_DETECTED"} = $FEATURE_SOURCE_DETECTED; + #is this a matching flag? + if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) { + push @result, $k; + } + } -push @EXPORT_OK, qw($FEATURE_SOURCE_USER); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SOURCE_USER); +#by default, just return the number as a 1-element list + if (!@result) { + return ($flags); + } -$_FeatureSupportFlags_VALUES{"SOURCE_USER"} = $FEATURE_SOURCE_USER; + return @result; +} -push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_MAX); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_MAX); +push @EXPORT_OK, qw($PROPERTY_SOURCE_DEFAULT); +push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_DEFAULT); -push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_MASK); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_MASK); +$_PropertySource_VALUES{"SOURCE_DEFAULT"} = $PROPERTY_SOURCE_DEFAULT; -push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_STATUS_MASK); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_STATUS_MASK); +push @EXPORT_OK, qw($PROPERTY_SOURCE_DETECTED); +push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_DETECTED); -push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_SURETY_MASK); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_SURETY_MASK); +$_PropertySource_VALUES{"SOURCE_DETECTED"} = $PROPERTY_SOURCE_DETECTED; -push @EXPORT_OK, qw($FEATURE_SUPPORT_FLAGS_SOURCE_MASK); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw($FEATURE_SUPPORT_FLAGS_SOURCE_MASK); +push @EXPORT_OK, qw($PROPERTY_SOURCE_USER); +push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_USER); -push @EXPORT_OK, qw(feature_support_flags_is_valid); -push @{$EXPORT_TAGS{"FeatureSupportFlags"}}, qw(feature_support_flags_is_valid); +$_PropertySource_VALUES{"SOURCE_USER"} = $PROPERTY_SOURCE_USER; -#copy symbols in FeatureSupportFlags to constants -push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"FeatureSupportFlags"}}; +#copy symbols in PropertySource to constants +push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertySource"}}; # SWIG produces a sub-package for the Device "class", in this case named diff --git a/perl/Amanda/Device.swg b/perl/Amanda/Device.swg index 73aac31..b83d70b 100644 --- a/perl/Amanda/Device.swg +++ b/perl/Amanda/Device.swg @@ -14,8 +14,8 @@ * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120 - * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com */ %module "Amanda::Device" @@ -41,8 +41,7 @@ Amanda::Device - interact with Amanda data-storage devices use Amanda::Device qw( :constants ); my $dev = Amanda::Device->new($device_name); - $dev->set_startup_properties_from_config(); - if ($dev->read_label() == $READ_LABEL_STATUS_SUCCESS) { + if ($dev->read_label() == $DEVICE_STATUS_SUCCESS) { print "Label on $device_name is '$dev->volume_label'\n"; } @@ -54,33 +53,12 @@ Stable =head1 Amanda::Device Objects -=head2 Instance Variables +See the wiki for descriptions of these functions. Note that C instance variables +are represented by accessor functions of the same name. =over -=item C<$file> - -=item C<$block> - -=item C<$in_file> - -=item C<$device_name> - -=item C<$access_mode> - -=item C<$is_eof> - -=item C<$volume_label> - -=item C<$volume_time> - -=back - -=head2 Methods - -See the wiki for descriptions of these functions - -=over +=item C =item C @@ -90,13 +68,7 @@ See the wiki for descriptions of these functions =item C -where C<$jobinfo> is a C (see L) - -=item C - -=item C - -=item C +where C<$jobinfo> is a C (see L) =item C @@ -104,7 +76,7 @@ Note that Perl code is not expected to handle on-device data, so there is currently no way to provide data to this function from Perl. This may change in future revisions. -=item C +=item C where C<$fd> is an integer file descriptor, not a filehandle @@ -116,7 +88,7 @@ where C<$fd> is an integer file descriptor, not a filehandle =item C -=item C +=item C where C<$fd> is an integer file descriptor, not a filehandle @@ -126,19 +98,50 @@ change in future revisions. =item C -returns a list of property names. +returns a list of properties, each represented as a hash: + + { 'access' => $access_flags, + 'name' => $property_name, + 'description' => $property_description } =item C -returns the property as the appropriate Perl type. +returns the property, with the appropriate Perl type, or undef. In array +context, returns the list C<($value, $surety, $source)>. =item C -where $value is of an appropriate type for the given property +=item C + +where C<$value> is of an appropriate type for the given property, C<$surety> is +a C<$PROPERTY_SURETY_*> constant, and C<$source> is a C<$PROPERTY_SOURCE_*> +constant. =item C -=item C +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) + +=item C (accessor function) =back @@ -147,7 +150,7 @@ where $value is of an appropriate type for the given property This module defines a large number of constants. Again, consult the wiki or C for the details on their meaning. These constants are available from the package namespace (e.g., -C), of imported with the C<:constant> +C), or imported with the C<:constant> import tag. =cut @@ -202,7 +205,7 @@ set_sv_from_gvalue(GValue *value) sv = newRV((SV *)hv); return newRV((SV *)hv); } else { - warn("Unsupported boxed property type #%d", boxed_type); + warn("Unsupported boxed property type #%d", (int)boxed_type); sv = sv_newmortal(); sv_setsv(sv, &PL_sv_undef); @@ -260,7 +263,7 @@ set_sv_from_gvalue(GValue *value) case G_TYPE_INTERFACE: case G_TYPE_OBJECT: case G_TYPE_PARAM: - warn("Unsupported fundamental property type #%d", fundamental); + warn("Unsupported fundamental property type #%d", (int)fundamental); sv_setsv(sv, &PL_sv_undef); break; } @@ -356,19 +359,31 @@ set_gvalue_from_sv(SV *sv, GValue *value) * Device struct, %extend-ed into a Perl class */ -typedef struct Device { +typedef struct queue_fd_t { /* Instance variables -- all readonly */ %immutable; - int file; - guint64 block; - gboolean in_file; - char * device_name; - DeviceAccessMode access_mode; - gboolean is_eof; - char * volume_label; - char * volume_time; + int fd; + char *errmsg; + %mutable; + /* methods */ + %extend { + /* constructor */ + queue_fd_t(int fd) { + return queue_fd_new(fd, NULL); + } + + /* destructor */ + ~queue_fd_t() { + amfree(self->errmsg); + g_free(self); + } + } +} queue_fd_t; + +typedef struct Device { + /* methods */ %extend { /* constructor */ @@ -380,7 +395,27 @@ typedef struct Device { g_object_unref(self); } - ReadLabelStatusFlags + gboolean + configure(gboolean use_global_config) { + return device_configure(self, use_global_config); + } + + char * + error() { + return device_error(self); + } + + char * + status_error() { + return device_status_error(self); + } + + char * + error_or_status() { + return device_error_or_status(self); + } + + DeviceStatusFlags read_label() { return device_read_label(self); } @@ -396,33 +431,18 @@ typedef struct Device { } gboolean - start_file(const dumpfile_t *jobInfo) { + start_file(dumpfile_t *jobInfo) { return device_start_file(self, jobInfo); } - guint - write_min_size() { - return device_write_min_size(self); - } - - guint - write_max_size() { - return device_write_max_size(self); - } - - guint - read_max_size() { - return device_read_max_size(self); - } - gboolean - write_block(guint size, gpointer data, gboolean short_block) { - return device_write_block(self, size, data, short_block); + write_block(guint size, gpointer data) { + return device_write_block(self, size, data); } gboolean - write_from_fd(int fd) { - return device_write_from_fd(self, fd); + write_from_fd(queue_fd_t *queue_fd) { + return device_write_from_fd(self, queue_fd); } gboolean @@ -445,34 +465,41 @@ typedef struct Device { return device_read_block(self, buffer, size); } - gboolean read_to_fd(int fd) { - return device_read_to_fd(self, fd); + gboolean read_to_fd(queue_fd_t *queue_fd) { + return device_read_to_fd(self, queue_fd); } - %typemap(out) const DeviceProperty * { - int i = 0; - int len = 0; + %typemap(out) const GSList * { + GSList *iter; /* Count the DeviceProperties */ - while ($1[len].base) len++; - EXTEND(SP, len); /* make room for return values */ + EXTEND(SP, g_slist_length($1)); /* make room for return values */ /* Note that we set $result several times. the nature of * SWIG's wrapping is such that incrementing argvi points * $result to the next location in perl's argument stack. */ - for (i = 0; i < len ; i++) { - $result = sv_newmortal(); - sv_setpv($result, $1[i].base->name); + for (iter = $1; iter; iter = g_slist_next(iter)) { + DeviceProperty *prop = iter->data; + HV *hash = newHV(); + SV *rv = newRV_noinc((SV *)hash); + + hv_store(hash, "name", 4, + newSVpv(prop->base->name, 0), 0); + hv_store(hash, "description", 11, + newSVpv(prop->base->description, 0), 0); + hv_store(hash, "access", 6, + newSViv(prop->access), 0); + $result = sv_2mortal(rv); argvi++; - }; + } } - const DeviceProperty * property_list(void) { + const GSList * property_list(void) { return device_property_get_list(self); } - %typemap(out) const DeviceProperty *; /* remove typemap */ + %typemap(out) const GSList *; /* remove typemap */ /* A typemap to convert a property name to a DevicePropertyBase. */ %typemap(in) DevicePropertyBase * { @@ -490,31 +517,45 @@ typedef struct Device { /* A typemap to convert the GValue in property_get to a return value. The * (in) typemap sets up storage for the parameters, while the (argout) converts * them to a perl SV. */ - %typemap(in,numinputs=0) (GValue *out_val, gboolean *val_found) - (GValue val, gboolean found) { + %typemap(in,numinputs=0) (GValue *out_val, PropertySurety *surety, + PropertySource *source, gboolean *val_found) + (GValue val, + PropertySurety surety, + PropertySource source, + gboolean found) { memset(&val, 0, sizeof(val)); $1 = &val; - $2 = &found; + if (GIMME_V == G_ARRAY) { + $2 = &surety; + $3 = &source; + } + $4 = &found; } - %typemap(argout) (GValue *out_val, gboolean *val_found) { + %typemap(argout) (GValue *out_val, PropertySurety *surety, + PropertySource *source, gboolean *val_found) { /* if the result is valid */ - if (*$2) { + if (*$4) { /* move data from $1 to $result, somehow */ $result = set_sv_from_gvalue($1); + argvi++; /* free any memory for the GValue */ g_value_unset($1); - } else { - /* silently return 'undef', the sentinel for "undefined" */ - $result = sv_newmortal(); - sv_setsv($result, &PL_sv_undef); + + if (GIMME_V == G_ARRAY) { + $result = newSViv(*$2); + argvi++; + $result = newSViv(*$3); + argvi++; + } } - argvi++; + /* otherwise, return nothing */ } void - property_get(DevicePropertyBase *pbase, GValue *out_val, gboolean *val_found) { - *val_found = device_property_get(self, pbase->ID, out_val); + property_get(DevicePropertyBase *pbase, GValue *out_val, PropertySurety *surety, + PropertySource *source, gboolean *val_found) { + *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source); } /* delete typemaps */ @@ -544,14 +585,46 @@ typedef struct Device { return FALSE; } + gboolean + property_set_ex(DevicePropertyBase *pbase, SV *sv, + PropertySurety surety, PropertySource source) { + GValue gval; + memset(&gval, 0, sizeof(gval)); + g_value_init(&gval, pbase->type); + if (!set_gvalue_from_sv(sv, &gval)) + goto fail; + + if (!device_property_set_ex(self, pbase->ID, &gval, surety, source)) + goto fail; + + g_value_unset(&gval); + return TRUE; + fail: + g_value_unset(&gval); + return FALSE; + } + gboolean recycle_file(guint filenum) { return device_recycle_file(self, filenum); } - void set_startup_properties_from_config(void) { - device_set_startup_properties_from_config(self); - } + /* accessor functions */ + + int file(void) { return self->file; } + guint64 block(void) { return self->block; } + gboolean in_file(void) { return self->in_file; } + char * device_name(void) { return self->device_name; } + DeviceAccessMode access_mode(void) { return self->access_mode; } + gboolean is_eof(void) { return self->is_eof; } + char * volume_label(void) { return self->volume_label; } + char * volume_time(void) { return self->volume_time; } + DeviceStatusFlags status(void) { return self->status; } + gsize min_block_size(void) { return self->min_block_size; } + gsize max_block_size(void) { return self->max_block_size; } + gsize block_size(void) { return self->block_size; } + dumpfile_t *volume_header(void) { return self->volume_header; } }; + } Device; /* @@ -569,15 +642,15 @@ gboolean IS_WRITABLE_ACCESS_MODE(DeviceAccessMode mode); amglue_export_tag(DeviceAccessMode, IS_WRITABLE_ACCESS_MODE); amglue_copy_to_tag(DeviceAccessMode, constants); -amglue_add_flag_tag_fns(ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_SUCCESS, "SUCCESS", ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_DEVICE_MISSING, "DEVICE_MISSING", ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_DEVICE_ERROR, "DEVICE_ERROR", ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_MISSING, "VOLUME_MISSING", ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_UNLABELED, "VOLUME_UNLABELED", ReadLabelStatusFlags); -amglue_add_constant_short(READ_LABEL_STATUS_VOLUME_ERROR, "VOLUME_ERROR", ReadLabelStatusFlags); -amglue_add_constant_noshort(READ_LABEL_STATUS_FLAGS_MAX, ReadLabelStatusFlags); -amglue_copy_to_tag(ReadLabelStatusFlags, constants); +amglue_add_flag_tag_fns(DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_SUCCESS, "SUCCESS", DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_DEVICE_ERROR, "DEVICE_ERROR", DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_DEVICE_BUSY, "DEVICE_BUSY", DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_VOLUME_MISSING, "VOLUME_MISSING", DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_VOLUME_UNLABELED, "VOLUME_UNLABELED", DeviceStatusFlags); +amglue_add_constant_short(DEVICE_STATUS_VOLUME_ERROR, "VOLUME_ERROR", DeviceStatusFlags); +amglue_add_constant_noshort(DEVICE_STATUS_FLAGS_MAX, DeviceStatusFlags); +amglue_copy_to_tag(DeviceStatusFlags, constants); amglue_add_flag_tag_fns(PropertyPhaseFlags); amglue_add_constant_short(PROPERTY_PHASE_BEFORE_START, "BEFORE_START", PropertyPhaseFlags); @@ -640,23 +713,16 @@ amglue_add_constant_short(SIZE_ACCURACY_ESTIMATE, "ESTIMATE", SizeAccuracy); amglue_add_constant_short(SIZE_ACCURACY_REAL, "REAL", SizeAccuracy); amglue_copy_to_tag(SizeAccuracy, constants); -amglue_add_flag_tag_fns(FeatureSupportFlags); -amglue_add_constant_short(FEATURE_STATUS_ENABLED, "STATUS_ENABLED", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_STATUS_DISABLED, "STATUS_DISABLED", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_SURETY_BAD, "SURETY_BAD", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_SURETY_GOOD, "SURETY_GOOD", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_SOURCE_DEFAULT, "SOURCE_DEFAULT", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_SOURCE_DETECTED, "SOURCE_DETECTED", FeatureSupportFlags); -amglue_add_constant_short(FEATURE_SOURCE_USER, "SOURCE_USER", FeatureSupportFlags); -amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_MAX, FeatureSupportFlags); -amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_MASK, FeatureSupportFlags); -amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_STATUS_MASK, FeatureSupportFlags); -amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_SURETY_MASK, FeatureSupportFlags); -amglue_add_constant_noshort(FEATURE_SUPPORT_FLAGS_SOURCE_MASK, FeatureSupportFlags); - -gboolean feature_support_flags_is_valid(FeatureSupportFlags); -amglue_export_tag(FeatureSupportFlags, feature_support_flags_is_valid); -amglue_copy_to_tag(FeatureSupportFlags, constants); +amglue_add_flag_tag_fns(PropertySurety); +amglue_add_constant_short(PROPERTY_SURETY_BAD, "SURETY_BAD", PropertySurety); +amglue_add_constant_short(PROPERTY_SURETY_GOOD, "SURETY_GOOD", PropertySurety); +amglue_copy_to_tag(PropertySurety, constants); + +amglue_add_flag_tag_fns(PropertySource); +amglue_add_constant_short(PROPERTY_SOURCE_DEFAULT, "SOURCE_DEFAULT", PropertySource); +amglue_add_constant_short(PROPERTY_SOURCE_DETECTED, "SOURCE_DETECTED", PropertySource); +amglue_add_constant_short(PROPERTY_SOURCE_USER, "SOURCE_USER", PropertySource); +amglue_copy_to_tag(PropertySource, constants); %perlcode %{ diff --git a/perl/Amanda/Logfile.c b/perl/Amanda/Logfile.c index a022c0f..6f88494 100644 --- a/perl/Amanda/Logfile.c +++ b/perl/Amanda/Logfile.c @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 + * Version 1.3.35 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -122,7 +122,7 @@ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" +#define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -157,6 +157,7 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -297,10 +298,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -427,8 +428,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -1061,7 +1062,7 @@ SWIG_Perl_TypeProxyName(const swig_type_info *type) { SWIGRUNTIME swig_cast_info * SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) + SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty); } @@ -1119,7 +1120,11 @@ SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info * if (!tc) { return SWIG_ERROR; } - *ptr = SWIG_TypeCast(tc,voidptr); + { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } } else { *ptr = voidptr; } @@ -1294,7 +1299,7 @@ SWIG_Perl_GetModule(void) { /* first check if pointer already created */ if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); if (pointer && SvOK(pointer)) { type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); } @@ -1308,7 +1313,7 @@ SWIG_Perl_SetModule(swig_module_info *module) { SV *pointer; /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE); + pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); sv_setiv(pointer, PTR2IV(module)); } @@ -1444,7 +1449,7 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; #define SWIG_name "Amanda::Logfilec::boot_Amanda__Logfile" #define SWIG_prefix "Amanda::Logfilec::" -#define SWIGVERSION 0x010333 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -1594,6 +1599,15 @@ SWIG_FromCharPtr(const char *cptr) } +SWIGINTERNINLINE SV * +SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value) +{ + SV *obj = sv_newmortal(); + sv_setnv(obj, value); + return obj; +} + + find_result_t *search_logfile_wrap(char *label, char *datestamp, char *logfile, int add_missing_disks) { find_result_t *rv = NULL; @@ -2117,6 +2131,65 @@ XS(_wrap_find_result_t_partnum_get) { } +XS(_wrap_find_result_t_sec_get) { + { + find_result_t *arg1 = (find_result_t *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: find_result_t_sec_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_sec_get" "', argument " "1"" of type '" "find_result_t *""'"); + } + arg1 = (find_result_t *)(argp1); + result = (double) ((arg1)->sec); + ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1((double)(result)); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_find_result_t_kb_get) { + { + find_result_t *arg1 = (find_result_t *) 0 ; + size_t result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: find_result_t_kb_get(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_find_result_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "find_result_t_kb_get" "', argument " "1"" of type '" "find_result_t *""'"); + } + arg1 = (find_result_t *)(argp1); + result = ((arg1)->kb); + { + ST(argvi) = sv_2mortal(amglue_newSVu64(result)); + argvi++; + } + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_new_find_result_t) { { find_result_t *result = 0 ; @@ -2126,7 +2199,7 @@ XS(_wrap_new_find_result_t) { if ((items < 0) || (items > 0)) { SWIG_croak("Usage: new_find_result_t();"); } - result = (find_result_t *)(find_result_t *) calloc(1, sizeof(find_result_t)); + result = (find_result_t *)calloc(1, sizeof(find_result_t)); ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ; XSRETURN(argvi); fail: @@ -2616,6 +2689,8 @@ static swig_command_info swig_commands[] = { {"Amanda::Logfilec::find_result_t_filenum_get", _wrap_find_result_t_filenum_get}, {"Amanda::Logfilec::find_result_t_status_get", _wrap_find_result_t_status_get}, {"Amanda::Logfilec::find_result_t_partnum_get", _wrap_find_result_t_partnum_get}, +{"Amanda::Logfilec::find_result_t_sec_get", _wrap_find_result_t_sec_get}, +{"Amanda::Logfilec::find_result_t_kb_get", _wrap_find_result_t_kb_get}, {"Amanda::Logfilec::new_find_result_t", _wrap_new_find_result_t}, {"Amanda::Logfilec::find_log", _wrap_find_log}, {"Amanda::Logfilec::search_logfile", _wrap_search_logfile}, @@ -2680,7 +2755,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -2690,6 +2765,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -2718,6 +2796,12 @@ SWIG_InitializeModule(void *clientdata) { module_head->next = &swig_module; } + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -2871,7 +2955,7 @@ XS(SWIG_init) { /* Install variables */ for (i = 0; swig_variables[i].name; i++) { SV *sv; - sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2); + sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); if (swig_variables[i].type) { SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); } else { @@ -2883,7 +2967,7 @@ XS(SWIG_init) { /* Install constant */ for (i = 0; swig_constants[i].type; i++) { SV *sv; - sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2); + sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); switch(swig_constants[i].type) { case SWIG_INT: sv_setiv(sv, (IV) swig_constants[i].lvalue); @@ -2906,148 +2990,148 @@ XS(SWIG_init) { SvREADONLY_on(sv); } - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_BOGUS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_BOGUS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_BOGUS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_FATAL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_FATAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_FATAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_ERROR", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_ERROR", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_ERROR))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_WARNING", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_WARNING", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_WARNING))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_INFO", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_INFO", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_INFO))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_SUMMARY", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_SUMMARY", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_SUMMARY))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_START", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_START", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_START))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_FINISH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_FINISH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_FINISH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_DISK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_DISK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_DISK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_DONE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_DONE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_DONE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_PART", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_PART", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_PART))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_PARTPARTIAL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_PARTPARTIAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_PARTPARTIAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_SUCCESS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_SUCCESS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_SUCCESS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_PARTIAL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_PARTIAL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_PARTIAL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_FAIL", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_FAIL", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_FAIL))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_STRANGE", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_STRANGE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_STRANGE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_CHUNK", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_CHUNK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_CHUNK))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_CHUNKSUCCESS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_CHUNKSUCCESS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_CHUNKSUCCESS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_STATS", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_STATS", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_STATS))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_MARKER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_MARKER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_MARKER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "L_CONT", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "L_CONT", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(L_CONT))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_UNKNOWN", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_UNKNOWN", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_UNKNOWN))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_PLANNER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_PLANNER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_PLANNER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_DRIVER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_DRIVER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_DRIVER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_REPORTER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_REPORTER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_REPORTER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_DUMPER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_DUMPER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_DUMPER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_CHUNKER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_CHUNKER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_CHUNKER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_TAPER", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_TAPER", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_TAPER))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.33/perl5/perltypemaps.swg,64,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "P_AMFLUSH", TRUE | 0x2); + /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + SV *sv = get_sv((char*) SWIG_prefix "P_AMFLUSH", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(P_AMFLUSH))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; diff --git a/perl/Amanda/Logfile.pm b/perl/Amanda/Logfile.pm index 4bec9e9..282478f 100644 --- a/perl/Amanda/Logfile.pm +++ b/perl/Amanda/Logfile.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -92,6 +92,10 @@ sub DESTROY { *swig_status_set = *Amanda::Logfilec::find_result_t_status_set; *swig_partnum_get = *Amanda::Logfilec::find_result_t_partnum_get; *swig_partnum_set = *Amanda::Logfilec::find_result_t_partnum_set; +*swig_sec_get = *Amanda::Logfilec::find_result_t_sec_get; +*swig_sec_set = *Amanda::Logfilec::find_result_t_sec_set; +*swig_kb_get = *Amanda::Logfilec::find_result_t_kb_get; +*swig_kb_set = *Amanda::Logfilec::find_result_t_kb_set; sub new { my $pkg = shift; my $self = Amanda::Logfilec::new_find_result_t(@_); @@ -154,7 +158,7 @@ Amanda::Logfile - manage Amanda trace logs =head1 SYNOPSIS - use Amanda::Logfile qw(:logtype_t); # XXX change + use Amanda::Logfile qw(:logtype_t); use Amanda::Config qw( :getconf config_dir_relative ); for my $logfile (Amanda::Logfile::find_log()) { @@ -169,7 +173,7 @@ Amanda::Logfile - manage Amanda trace logs } Amanda::Logfile::close_logfile($log); - my @dumps = Amanda::Logfile::search_logfile("TapeLabel-001", "19780615", $logfile); + my @dumps = Amanda::Logfile::search_logfile("TapeLabel-001", "19780615", $logfile, 1); my @matching = Amanda::Logfile::dumps_match([@dumps], "myhost", "/usr", undef, undef, 0); for my $dump (@matching) { @@ -224,24 +228,33 @@ Instance variables are: =over -=item C<$timestamp> +=item C -=item C<$hostname> +=item C -=item C<$diskname> +=item C -=item C<$level> +=item C -=item C<$label> +=item C