diff options
author | gdt <gdt> | 2015-03-27 23:45:29 +0000 |
---|---|---|
committer | gdt <gdt> | 2015-03-27 23:45:29 +0000 |
commit | 650c8d8973961c7e8fc855445a0efd8118ebf701 (patch) | |
tree | 3a9e6cd09b146d9f73ac42b620136234b2175502 /sysutils | |
parent | c103815e7255a27bc01a0374ac8877829bffbaa0 (diff) | |
download | pkgsrc-650c8d8973961c7e8fc855445a0efd8118ebf701.tar.gz |
Add 2 fixes to for amanda-server to work on NetBSD.
While amanda-client 3.3 has been stable on NetBSD for a while, the
server code has apparently never worked. This commit adds several
patches:
- include sys/{types,time}.h so autoconf tape drive checks pass
- improve error messages when tape drive code is not compiled in
- avoid perl crash in report generation
These changes have been tested on NetBSD 6 kernel with NetBSD 5
userland, amd64 (for no good reason, but this was the machine with the
tape drive), dumping many machines and writing to LTO.
The first two patches are taken from an upstream patch committed to
the 3.3 branch due to this problem being reported. The third patch is
ad hoc based on perl debugging, and needs further investigation. (But
it's better to get a report without a header line than an empty mail
message.)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/amanda-common/distinfo | 6 | ||||
-rw-r--r-- | sysutils/amanda-common/patches/patch-config_amanda_tape.m4 | 49 | ||||
-rw-r--r-- | sysutils/amanda-common/patches/patch-device-src_device.c | 27 | ||||
-rw-r--r-- | sysutils/amanda-common/patches/patch-perl_Amanda_Report_human.pm | 21 | ||||
-rw-r--r-- | sysutils/amanda-server/Makefile | 4 |
5 files changed, 103 insertions, 4 deletions
diff --git a/sysutils/amanda-common/distinfo b/sysutils/amanda-common/distinfo index 8369581dbab..b93b283e009 100644 --- a/sysutils/amanda-common/distinfo +++ b/sysutils/amanda-common/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.15 2014/07/28 15:53:44 jperkin Exp $ +$NetBSD: distinfo,v 1.16 2015/03/27 23:45:29 gdt Exp $ SHA1 (amanda-3.3.1.tar.gz) = 22273381f61319e46e1da9d7029ca2b3991eee98 RMD160 (amanda-3.3.1.tar.gz) = 0d66ad25fd905901a1afd3651bd6c1e00db9af8d @@ -9,19 +9,21 @@ SHA1 (patch-application-src_Makefile.am) = 3a5f256ab7e2439c2e19c4f75234d3a677707 SHA1 (patch-client-src_Makefile.am) = 641ef76fd1ea413b416704e1e52e25a93a596442 SHA1 (patch-client-src_sendbackup-dump.c) = aea1aca0bbcdab0c393b012a592cbc5ca458acec SHA1 (patch-client-src_sendsize.c) = 32a1627c250b6413e4695a610bba59796c6e7ed6 -SHA1 (patch-common-src_Makefile.in) = 422e4d519d8797e686d62cfeca8cda2e8a4a8bb3 SHA1 (patch-common-src_glib-util.c) = 8b62499f6730843fbf9e872adc80978b77b5573f SHA1 (patch-common-src_glib-util.h) = 6d5b14acd7a44b17a52ebc697f5354db2a4b04f9 SHA1 (patch-common-src_security-util.h) = c628cc19a624da2cfabdb7d488bc2cd2d4b955a4 SHA1 (patch-config_amanda_dumpers.m4) = 3d0cf6133b003de53e05929d2ce04eaa0f614819 SHA1 (patch-config_amanda_krb5-security.m4) = c82af0e106e49b59994b40f12ed5b1c165a8497f +SHA1 (patch-config_amanda_tape.m4) = ac8da578326756eeadd935bdeddb202ea990c006 SHA1 (patch-config_macro-archive_xsltproc.m4) = 20324db1ce3db016fa89fe39df5a8133c7766693 SHA1 (patch-device-src_Makefile.am) = 29fd554033ff0ff7b1d98a08306f157ced7324c5 +SHA1 (patch-device-src_device.c) = 31cb823dcce0f7f3d9de8f9def1a0f025ab10876 SHA1 (patch-example_Makefile.am) = 8d2dac1abdc473fbf94489bcb620a42a665fd27a SHA1 (patch-ndmp-src_ndmp2__xdr.c) = 9ae6d78c2192ece83a1aa141cb04c9761969ca5b SHA1 (patch-ndmp-src_ndmp3__xdr.c) = a080c7337ede4fe75f9735fb3355d0aa16b0af6c SHA1 (patch-ndmp-src_ndmp4__xdr.c) = 339b0d539754127446acf6456fb385f00b1fbcc3 SHA1 (patch-oldrecover-src_Makefile.am) = 9127c1523937da3955662cc0b0921d05bca75248 +SHA1 (patch-perl_Amanda_Report_human.pm) = 83e7955b264dfe54ac4f9645b9a690cffa72b5db SHA1 (patch-perl_Amanda_Xfer.pm) = 7389672ce0ed08d8b5f6548a6bb466ef4e18ab1d SHA1 (patch-perl_Makefile.am) = 7b09e5cc30c9b441dae03b06bef5c757c93ff9f7 SHA1 (patch-perl_amglue_Makefile.am) = 051e456a5d34dd19a11ccd45c32f078e72d16e6f diff --git a/sysutils/amanda-common/patches/patch-config_amanda_tape.m4 b/sysutils/amanda-common/patches/patch-config_amanda_tape.m4 new file mode 100644 index 00000000000..a4f06f571f1 --- /dev/null +++ b/sysutils/amanda-common/patches/patch-config_amanda_tape.m4 @@ -0,0 +1,49 @@ +$NetBSD: patch-config_amanda_tape.m4,v 1.1 2015/03/27 23:45:29 gdt Exp $ + +This patch is from upstream. It resolves a failure to compile in tape +support; without including sys/types.h and sys/time.h, sys/tape.h +generates an error on NetBSD. + +--- config/amanda/tape.m4.orig 2012-02-21 11:36:49.000000000 +0000 ++++ config/amanda/tape.m4 +@@ -34,6 +34,10 @@ AC_DEFUN([AMANDA_TAPE_DEVICE], [ + # check for MTIOCTOP, an indicator of POSIX tape support + AC_CACHE_CHECK([for MTIOCTOP], amanda_cv_HAVE_MTIOCTOP,[ + AC_TRY_COMPILE([ ++#include <sys/types.h> ++#ifdef HAVE_SYS_TIME_H ++# include <sys/time.h> ++# endif + #ifdef HAVE_SYS_TAPE_H + # include <sys/tape.h> + #endif +@@ -66,6 +70,9 @@ AC_DEFUN([AMANDA_TAPE_DEVICE], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <sys/types.h> ++#ifdef HAVE_SYS_TIME_H ++# include <sys/time.h> ++#endif + #include <sys/mtio.h> + ]], [[ + struct mtget buf; +@@ -85,6 +92,9 @@ AC_DEFUN([AMANDA_TAPE_DEVICE], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <sys/types.h> ++#ifdef HAVE_SYS_TIME_H ++# include <sys/time.h> ++#endif + #include <sys/mtio.h> + ]], [[ + struct mtget buf; +@@ -139,6 +149,9 @@ AC_DEFUN([AMANDA_TAPE_DEVICE], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <sys/types.h> ++#ifdef HAVE_SYS_TIME_H ++# include <sys/time.h> ++#endif + #include <sys/mtio.h> + ]], [[ + struct mtget buf; diff --git a/sysutils/amanda-common/patches/patch-device-src_device.c b/sysutils/amanda-common/patches/patch-device-src_device.c new file mode 100644 index 00000000000..9705ce4cc4a --- /dev/null +++ b/sysutils/amanda-common/patches/patch-device-src_device.c @@ -0,0 +1,27 @@ +$NetBSD: patch-device-src_device.c,v 1.1 2015/03/27 23:45:29 gdt Exp $ + +This patch is from upstream, to improve error reporting when amanda is +configured without tape drive support and one tries to use a tape. + +--- device-src/device.c.orig 2012-02-21 11:36:44.000000000 +0000 ++++ device-src/device.c +@@ -423,17 +423,13 @@ handle_device_regex(const char * user_na + regfree(®ex); + return FALSE; + } else if (reg_result == REG_NOMATCH) { ++ *driver_name = stralloc("tape"); ++ *device = stralloc(user_name); + #ifdef WANT_TAPE_DEVICE + 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 */ +- *errmsg = newvstrallocf(*errmsg, "\"%s\" is not a valid device name.\n", user_name); +- regfree(®ex); +- return FALSE; + #endif /* WANT_TAPE_DEVICE */ + } else { + *driver_name = find_regex_substring(user_name, pmatch[1]); diff --git a/sysutils/amanda-common/patches/patch-perl_Amanda_Report_human.pm b/sysutils/amanda-common/patches/patch-perl_Amanda_Report_human.pm new file mode 100644 index 00000000000..8100d433699 --- /dev/null +++ b/sysutils/amanda-common/patches/patch-perl_Amanda_Report_human.pm @@ -0,0 +1,21 @@ +$NetBSD: patch-perl_Amanda_Report_human.pm,v 1.1 2015/03/27 23:45:29 gdt Exp $ + +On NetBSD 5 amd64, perl coredumps because of this call (or some +component of it), leading to not getting a report. For now, comment +it out to get most of the report. This has not yet been reported +upstream. + +--- perl/Amanda/Report/human.pm.orig 2012-02-21 11:36:47.000000000 +0000 ++++ perl/Amanda/Report/human.pm +@@ -319,7 +319,10 @@ sub print_human_amreport + $self->calculate_stats(); + + ## print the basic info header +- $self->print_header(); ++ # The next line crashes perl 5.20 on NetBSD 5 amd64. Hence it is ++ # commented out as reports without the header are better than no ++ # reports. ++ #$self->print_header(); + + ## print out statements about past and predicted tape usage + $self->output_tapeinfo(); diff --git a/sysutils/amanda-server/Makefile b/sysutils/amanda-server/Makefile index 98080f1ab26..02ba583cfb1 100644 --- a/sysutils/amanda-server/Makefile +++ b/sysutils/amanda-server/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.57 2015/02/09 18:35:13 gdt Exp $ +# $NetBSD: Makefile,v 1.58 2015/03/27 23:45:29 gdt Exp $ PKGNAME= amanda-server-${AMANDA_VERSION} -PKGREVISION= 2 +PKGREVISION= 3 COMMENT= Server part of Amanda, a network backup system |