From: Bdale Garbee Date: Wed, 22 Oct 2008 16:17:05 +0000 (+0200) Subject: config.sub and config.guess freshened X-Git-Tag: debian/2.6.1p1-1~35 X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=commitdiff_plain;h=6c1f39091444e58c33362f0cc086375d9d273e77 config.sub and config.guess freshened --- diff --git a/config/config.guess b/config/config.guess index 6960a39..f32079a 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-01-15' +timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -139,23 +139,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -if [ "${UNAME_SYSTEM}" = "Linux" ] ; then - eval $set_cc_for_build - cat << EOF > $dummy.c - #include - #ifdef __UCLIBC__ - # ifdef __UCLIBC_CONFIG_VERSION__ - LIBC=uclibc __UCLIBC_CONFIG_VERSION__ - # else - LIBC=uclibc - # endif - #else - LIBC=gnu - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` -fi - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -347,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -549,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -808,12 +791,18 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - x86:Interix*:[3456]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; @@ -847,28 +836,35 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-${LIBC} + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-${LIBC} + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-${LIBC} + echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build @@ -891,7 +887,7 @@ EOF s: ::g p }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -914,16 +910,16 @@ EOF s: ::g p }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-${LIBC} + echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -936,40 +932,40 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-${LIBC} + echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-${LIBC} + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -984,22 +980,20 @@ EOF p'` case "$ld_supported_targets" in elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" + echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) - echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" + echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac - # This should get integrated into the C code below, but now we hack - if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -1490,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/config/config.sub b/config/config.sub index 695284a..6759825 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-01-18' +timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -72,8 +72,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -244,7 +244,7 @@ case $basic_machine in | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx | dvp \ + | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ @@ -277,7 +277,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -358,7 +358,7 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -369,7 +369,7 @@ case $basic_machine in | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; @@ -487,8 +487,8 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -714,24 +714,6 @@ case $basic_machine in basic_machine=m68k-atari os=-mint ;; - mipsEE* | ee | ps2) - basic_machine=mips64r5900el-scei - case $os in - -linux*) - ;; - *) - os=-elf - ;; - esac - ;; - iop) - basic_machine=mipsel-scei - os=-irx - ;; - dvp) - basic_machine=dvp-scei - os=-elf - ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; @@ -1276,7 +1258,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) diff --git a/server-src/amdump.sh~HEAD b/server-src/amdump.sh~HEAD deleted file mode 100644 index 70a0a7f..0000000 --- a/server-src/amdump.sh~HEAD +++ /dev/null @@ -1,225 +0,0 @@ -#!@SHELL@ -# -# 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. -# -# Author: James da Silva, Systems Design and Analysis Group -# Computer Science Department -# University of Maryland at College Park -# - -# -# amdump: Manage running one night's Amanda dump run. -# - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -sbindir="@sbindir@" -amlibexecdir="@amlibexecdir@" -. "${amlibexecdir}/amanda-sh-lib.sh" - -confdir=@CONFIG_DIR@ - -# add sbin and ucb dirs -PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" -export PATH - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if test "$USE_VERSION_SUFFIXES" = "yes"; then - SUF="-@VERSION@" -else - SUF= -fi - -if [ $# -lt 1 ] -then -<<<<<<< HEAD:server-src/amdump.sh.in - echo "Usage: amdump config [host [disk...]...]" 1>&2 -======= - echo `_ 'Usage: %s config [host [disk...]...]' "$0"` 1>&2 ->>>>>>> upstream:server-src/amdump.sh - exit 1 -fi - -exit_status=0; - -conf=$1 -if [ ! -d $confdir/$conf ]; then -<<<<<<< HEAD:server-src/amdump.sh.in - echo "amdump$SUF: could not find directory $confdir/$conf" 1>&2 -======= - echo `_ '%s: could not find directory %s' "amdump$SUF" "$confdir/$conf"` 1>&2 ->>>>>>> upstream:server-src/amdump.sh - exit 1 -fi -shift - -cd $confdir/$conf || exit 1 - -logdir=`amgetconf$SUF $conf logdir "$@"` -[ $? -ne 0 ] && exit 1 -errfile=$logdir/amdump -tapecycle=`amgetconf$SUF $conf tapecycle "$@"` -[ $? -ne 0 ] && exit 1 -dumpuser=`amgetconf$SUF $conf dumpuser "$@"` -[ $? -ne 0 ] && exit 1 - -runuser=`{ whoami ; } 2>/dev/null` -if [ $? -ne 0 ]; then - idinfo=`{ id ; } 2>/dev/null` - if [ $? -ne 0 ]; then - runuser=${LOGNAME:-"??unknown??"} - else - runuser=`echo $idinfo | sed -e 's/).*//' -e 's/^.*(//'` - fi -fi - -<<<<<<< HEAD:server-src/amdump.sh.in -#if [ $runuser != $dumpuser ]; then -# echo "amdump: must be run as user $dumpuser, not $runuser" 1>&2 -# exit 1 -#fi - -if test -f hold; then - echo "amdump: waiting for hold file to be removed" 1>&2 -======= -if [ $runuser != $dumpuser ]; then - echo `_ '%s: must be run as user %s, not %s' "$0" "$dumpuser" "$runuser"` 1>&2 - exit 1 -fi - -if test -f hold; then - echo `_ '%s: waiting for hold file to be removed' "$0"` 1>&2 ->>>>>>> upstream:server-src/amdump.sh - while test -f hold; do - sleep 60 - done -fi - -if test -f $errfile || test -f $logdir/log; then -<<<<<<< HEAD:server-src/amdump.sh.in - echo "amdump: amdump or amflush is already running, or you must run amcleanup" 1>&2 -======= - echo `_ '%s: amdump or amflush is already running, or you must run amcleanup' "$0"` 1>&2 ->>>>>>> upstream:server-src/amdump.sh - exit 1 -fi - -umask 077 - -exit_code=0 -# Plan and drive the dumps. -#exec $errfile 2>&1 -touch $errfile -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code -exec >$errfile 1>&2 -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code -<<<<<<< HEAD:server-src/amdump.sh.in -echo "amdump: start at `date`" -echo "amdump: datestamp `date +%Y%m%d`" -echo "amdump: starttime `date +%Y%m%d%H%M%S`" -$libexecdir/planner$SUF $conf "$@" | $libexecdir/driver$SUF $conf "$@" -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code -echo "amdump: end at `date`" -======= - -gdate=`date +'%a %b %e %H:%M:%S %Z %YAAAAA%Y%m%dBBBBB%Y%m%d%H%M%SCCCCC%Y-%m-%d %H:%M:%S %Z'` - -#date=%a %b %e %H:%M:%S %Z %Y -date=`echo $gdate |sed -e "s/AAAAA.*$//"` - -#date_datestamp="%Y%m%d" -date_datestamp=`echo $gdate |sed -e "s/^.*AAAAA//;s/BBBBB.*$//"` - -#date_starttime="%Y%m%d%H%M%S" -date_starttime=`echo $gdate |sed -e "s/^.*BBBBB//;s/CCCCC.*$//"` - -#date_locale_independent=%Y-%m-%d %H:%M:%S %Z -date_locale_independent=`echo $gdate |sed -e "s/^.*CCCCC//"` - -printf '%s: start at %s\n' "amdump" "$date" -printf '%s: datestamp %s\n' "amdump" "$date_datestamp" -printf '%s: starttime %s\n' "amdump" "$date_starttime" -printf '%s: starttime-locale-independent %s\n' "amdump" "$date_locale_independent" - -$amlibexecdir/planner$SUF $conf --starttime $date_starttime "$@" | $amlibexecdir/driver$SUF $conf "$@" -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code -printf '%s: end at %s\n' "amdump" "`date`" ->>>>>>> upstream:server-src/amdump.sh - -# Send out a report on the dumps. -$sbindir/amreport$SUF $conf "$@" -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code - -# Roll the log file to its datestamped name. -<<<<<<< HEAD:server-src/amdump.sh.in -$libexecdir/amlogroll$SUF $conf "$@" -======= -$amlibexecdir/amlogroll$SUF $conf "$@" ->>>>>>> upstream:server-src/amdump.sh -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code - -# Trim the log file to those for dumps that still exist. -<<<<<<< HEAD:server-src/amdump.sh.in -$libexecdir/amtrmlog$SUF $conf "$@" -======= -$amlibexecdir/amtrmlog$SUF $conf "$@" ->>>>>>> upstream:server-src/amdump.sh -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code - -# Trim the index file to those for dumps that still exist. -<<<<<<< HEAD:server-src/amdump.sh.in -$libexecdir/amtrmidx$SUF $conf "$@" -======= -$amlibexecdir/amtrmidx$SUF $conf "$@" ->>>>>>> upstream:server-src/amdump.sh -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code - -# Keep a debug log through the tapecycle plus a couple of days. -maxdays=`expr $tapecycle + 2` -days=1 -# First, find out the last existing errfile, -# to avoid ``infinite'' loops if tapecycle is infinite -while [ $days -lt $maxdays ] && [ -f $errfile.$days ]; do - days=`expr $days + 1` -done -# Now, renumber the existing log files -while [ $days -ge 2 ]; do - ndays=`expr $days - 1` - mv $errfile.$ndays $errfile.$days - exit_code=$? - echo $exit_code - [ $exit_code -ne 0 ] && exit_status=$exit_code - days=$ndays -done -mv $errfile $errfile.1 -exit_code=$? -[ $exit_code -ne 0 ] && exit_status=$exit_code - -exit $exit_status diff --git a/server-src/amverify.sh~HEAD b/server-src/amverify.sh~HEAD deleted file mode 100644 index e34cd4e..0000000 --- a/server-src/amverify.sh~HEAD +++ /dev/null @@ -1,565 +0,0 @@ -#! @SHELL@ -# -# $Id: amverify.sh.in,v 1.38 2006/07/25 19:00:56 martinea Exp $ -# -# (C) 1996 by ICEM Systems GmbH -# Author: Axel Zinser (fifi@icem.de) -# -# amverify: check amanda tapes and report errors -# - -echo "amverify is deprecated -- use amcheckdump" >& 2 - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -sbindir="@sbindir@" -amlibexecdir="@amlibexecdir@" -. "${amlibexecdir}/amanda-sh-lib.sh" - -# add sbin and ucb dirs -PATH="$PATH:/usr/sbin:/sbin:/usr/ucb" -export PATH - -USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@" -if [ "$USE_VERSION_SUFFIXES" = "yes" ]; then - SUF="-@VERSION@" -else - SUF= -fi - -# If the shell/system echo support \r and \c, use them to write some -# status messages over the top of each other as things progress, otherwise -# use a normal echo and let them go on new lines. Define $Echoe to be -# an echo that goes to stderr. In the code, $Echoe is used and it may -# be either echoe or echone, the latter being code that knows about echon. - -t=`echo "abc\r\c" | wc -c` -if [ $t -eq 4 ]; then - Echon=echon -else - Echon=echo -fi -Echoe=echoe -elen=0 -echoe() { - echo "$@" >&2 - Echoe=echoe -} -echon() { - newelen=`expr "$1" : '.*'` - blanks= - while [ $newelen -lt $elen ]; do - blanks="$blanks " - elen=`expr $elen - 1` - done - echo "$1""$blanks\r\c" - elen=$newelen - Echoe=echone -} -echone() { - echon - echoe "$@" - Echoe=echoe -} - -report() { - $Echoe "$@" - echo "$@" >> $REPORT -} - -getparm() { - $AMGETCONF $CONFIG $1 2>/dev/null -} - -sendreport() { - if [ -f $REPORT -a X"$REPORTTO" != X"" ]; then - ( - echo `_ 'Tapes: %s' "$TAPELIST"` - if [ -s $DEFECTS ]; then - echo `_ 'Errors found:'` - cat $DEFECTS - else - echo `_ 'No errors found!'` - fi - echo - - [ -s $REPORT ] \ - && cat $REPORT - ) | ( - if test -n "$MAIL"; then - $MAIL -s "$ORG AMANDA VERIFY REPORT FOR$TAPELIST" $REPORTTO - else - cat >&2 - fi - ) - fi -} - -### -# This function is called to process one dump image. Standard input is -# the dump image. We parse the header and decide if it is a GNU tar -# dump or a system dump. Then we do a catalog operation to /dev/null -# and finally a "cat" to /dev/null to soak up whatever data is still in -# the pipeline. -# -# In the case of a system restore catalogue, this does not fully check -# the integrity of the dump image because system restore programs stop -# as soon as they are done with the directories, which are all at the -# beginning. But the trailing cat will at least make sure the whole -# image is readable. -### - -doonefile() { - - ### - # The goal here is to collect the first 32 KBytes and save the - # first line. But the pipe size coming in to us from amrestore - # is highly system dependent and "dd" does not do reblocking. - # So we pick a block size that is likely to always be available in - # the pipe and a count to take it up to 32 KBytes. Worst case, - # this could be changed to "bs=1 count=32k". We also have to - # soak up the rest of the output after the "head" so an EPIPE - # does not go back and terminate the "dd" early. - ### - - HEADER=`$DD bs=512 count=64 2>/dev/null | ( sed 1q ; cat > /dev/null )` - CMD= - result=1 - if [ X"$HEADER" = X"" ]; then - echo `_ '** No header'` > $TEMP/errors - else - set X $HEADER - # XXX meh, while[] is dangerous, what about a bad header? - while [ X"$1" != X"program" ]; do shift; done - if [ X"$1" = X"program" -a X"$2" != X"" ]; then - if [ X"$TAR" != X"" \ - -a \( X"`basename $2`" = X"`basename $TAR`" \ - -o X"`basename $2`" = X"gtar" \ - -o X"`basename $2`" = X"gnutar" \ - -o X"`basename $2`" = X"tar" \) ]; then - CMD=$TAR - ARGS="tf -" - elif [ X"$TAR" != X"" \ - -a X"$SAMBA_CLIENT" != X"" \ - -a X"$2" = X"$SAMBA_CLIENT" ]; then - CMD=$TAR - ARGS="tf -" - elif [ X"$DUMP" != X"" -a X"$2" = X"$DUMP" ]; then - CMD=$RESTORE - if [ $IS_AIX -eq 1 ]; then - ARGS=-tB - else - ARGS="tbf 2 -" - fi - elif [ X"$VDUMP" != X"" -a X"$2" = X"$VDUMP" ]; then - CMD=$VRESTORE - ARGS="tf -" - elif [ X"$VXDUMP" != X"" -a X"$2" = X"$VXDUMP" ]; then - CMD=$VXRESTORE - ARGS="tbf 2 -" - elif [ X"$XFSDUMP" != X"" -a X"$2" = X"$XFSDUMP" ]; then - CMD=$XFSRESTORE - ARGS="-t -v silent -" - else - echo `_ '** Cannot do %s dumps' "$2"` > $TEMP/errors - result=999 # flag as not really an error - fi - else - echo `_ '** Cannot find dump type'` > $TEMP/errors - fi - fi - echo $CMD > $TEMP/onefile.cmd - if [ X"`echo $HEADER | grep '^AMANDA: SPLIT_FILE'`" != X"" ]; then - result=500 - set X $HEADER - shift 7 - echo $1 | cut -f7 -d' ' > $TEMP/onefile.partnum - elif [ X"$CMD" != X"" ]; then - if [ -x $CMD ]; then - $CMD $ARGS > /dev/null 2> $TEMP/errors - result=$? - else - echo `_ '** Cannot execute %s' "$CMD"` > $TEMP/errors - fi - fi - cat >/dev/null # soak up the rest of the image - echo $result -} - -# -# some paths -# -# CONFIG_DIR directory in which the config file resides -# AMRESTORE full path name of amrestore -# AMGETCONF full path name of amgetconf -# AMTAPE full path name of amtape -# TAR ditto for GNU-tar -# SAMBA_CLIENT ditto for smbclient -# DUMP ditto for the system dump program -# RESTORE ditto for the system restore program -# VDUMP ditto for the system dump program -# VRESTORE ditto for the system restore program -# VXDUMP ditto for the system dump program -# VXRESTORE ditto for the system restore program -# XFSDUMP ditto for the system dump program -# XFSRESTORE ditto for the system restore program -# DD ditto for dd -# MT ditto for mt -# MTF flag given to MT to specify tape device: -f or -t -# MAIL mail program -# IS_AIX true if this is an AIX system - -CONFIG_DIR=@CONFIG_DIR@ -amlibexecdir=$amlibexecdir -sbindir=$sbindir -AMRESTORE=$sbindir/amrestore$SUF -AMGETCONF=$sbindir/amgetconf$SUF -AMTAPE=$sbindir/amtape$SUF -TAR=@GNUTAR@ -SAMBA_CLIENT=@SAMBA_CLIENT@ -DUMP=@DUMP@ -RESTORE=@RESTORE@ -VDUMP=@VDUMP@ -VRESTORE=@VRESTORE@ -VXDUMP=@VXDUMP@ -VXRESTORE=@VXRESTORE@ -XFSDUMP=@XFSDUMP@ -XFSRESTORE=@XFSRESTORE@ -MAIL=@MAILER@ -DD=@DD@ - -. ${amlibexecdir}/chg-lib.sh - -# -# config file -# -SLOT=0 -CONFIG=$1 -[ X"$CONFIG" = X"" ] \ - && $Echoe "usage: amverify$SUF [slot [ runtapes ] ]" \ - && exit 1 - -AMCONFIG=$CONFIG_DIR/$CONFIG/amanda.conf -[ ! -f $AMCONFIG ] \ - && $Echoe "Cannot find config file $AMCONFIG" \ - && exit 1 - -TPCHANGER=`getparm tpchanger` -if [ X"$TPCHANGER" = X"" ]; then - $Echoe "No tape changer..." - DEVICE=`getparm tapedev` - [ X"$DEVICE" = X"" ] \ - && $Echoe "No tape device..." \ - && exit 1 - $Echoe "Tape device is $DEVICE..." - SLOTS=1 -else - CHANGER_SLOT=${2:-current} - $Echoe "Tape changer is $TPCHANGER..." - SLOTS=${3:-`getparm runtapes`} - [ X"$SLOTS" = X"" ] && SLOTS=1 - if [ $SLOTS -eq 1 ]; then - p="" - else - p=s - fi - $Echoe "$SLOTS slot${p}..." - MAXRETRIES=2 -fi - -# -# check the accessability -# -[ X"$TAR" != X"" -a ! -x "$TAR" ] \ - && $Echoe "GNU tar not found: $TAR" -[ X"$DUMP" != X"" -a \( X"$RESTORE" = X"" -o ! -x "$RESTORE" \) ] \ - && $Echoe "System restore program not found: $RESTORE" -[ X"$VDUMP" != X"" -a \( X"$VRESTORE" = X"" -o ! -x "$VRESTORE" \) ] \ - && $Echoe "System restore program not found: $VRESTORE" -[ X"$VXDUMP" != X"" -a \( X"$VXRESTORE" = X"" -o ! -x "$VXRESTORE" \) ] \ - && $Echoe "System restore program not found: $VXRESTORE" -[ X"$XFSDUMP" != X"" -a \( X"$XFSRESTORE" = X"" -o ! -x "$XFSRESTORE" \) ] \ - && $Echoe "System restore program not found: $XFSRESTORE" -[ ! -x $AMRESTORE ] \ - && $Echoe "amrestore not found: $AMRESTORE" \ - && exit 1 - -REPORTTO=`getparm mailto` -if [ X"$REPORTTO" = X"" ]; then - $Echoe "No notification by mail!" -else - $Echoe "Verify summary to $REPORTTO" -fi - -ORG=`getparm org` -if [ X"$ORG" = X"" ]; then - $Echoe "No org in amanda.conf -- using $CONFIG" - ORG=$CONFIG -fi - -# -# ok, let's do it -# -# TEMP directory for temporary tar archives and stderr -# DEFECTS defect list -# REPORT report for mail - -if [ ! -d @AMANDA_TMPDIR@ ]; then - $Echoe "amverify: directory @AMANDA_TMPDIR@ does not exist." - exit 1 -fi - -cd @AMANDA_TMPDIR@ || exit 1 - -TEMP=@AMANDA_TMPDIR@/amverify.$$ -trap 'rm -fr $TEMP' EXIT -if ( umask 077 ; mkdir $TEMP ) ; then - : -else - $Echoe "Cannot create $TEMP" - exit 1 -fi -DEFECTS=$TEMP/defects; rm -f $DEFECTS -REPORT=$TEMP/report; rm -f $REPORT -TAPELIST= -EXITSTAT=$TEMP/amrecover.exit; rm -rf $EXITSTAT - -<<<<<<< HEAD:server-src/amverify.sh.in -trap 'report "aborted!"; echo "aborted!" >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' EXIT -======= -trap 'report "aborted!"; echo `_ 'aborted!'` >> $DEFECTS; sendreport; rm -fr $TEMP; exit 1' 1 2 3 4 5 6 7 8 10 12 13 14 15 ->>>>>>> upstream:server-src/amverify.sh - -$Echoe "Defects file is $DEFECTS" -report "amverify $CONFIG" -report "`date`" -report "" - -# ---------------------------------------------------------------------------- - -SPLIT_DUMPS= # this will keep track of split dumps that we'll tally later -while [ $SLOT -lt $SLOTS ]; do - SLOT=`expr $SLOT + 1` - # - # Tape Changer: dial slot - # - if [ X"$TPCHANGER" != X"" ]; then - report "Loading ${CHANGER_SLOT} slot..." - $AMTAPE $CONFIG slot $CHANGER_SLOT > $TEMP/amtape.out 2>&1 - THIS_SLOT=$CHANGER_SLOT - CHANGER_SLOT=next - RESULT=`grep "changed to slot" $TEMP/amtape.out` - [ X"$RESULT" = X"" ] \ - && report "** Error loading slot $THIS_SLOT" \ - && report "`cat $TEMP/amtape.out`" \ - && cat $TEMP/amtape.out >> $DEFECTS \ - && continue - DEVICE=`$AMTAPE $CONFIG device` - fi - report "Using device $DEVICE" - $Echon "Waiting for device to go ready..." - count=1800 -<<<<<<< HEAD:server-src/amverify.sh.in - until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do - [ count -lt 0 ] \ - && report "Device not ready" \ - && report "`cat $TEMP/ammt.out`" \ - && report cat $TEMP/ammt.out >> $DEFECTS \ - && break; - sleep 3 - count=`expr $count - 3` - done - $Echon "Rewinding..." - ERRORS=0 - until $MT $MTF $DEVICE rewind > $TEMP/ammt.out 2>&1; do - RESULT=`grep "No medium found" $TEMP/ammt.out` - [ X"$RESULT" != X"" ] \ - && report "** Error rewinding tape" \ - && report "`cat $TEMP/ammt.out`" \ - && cat $TEMP/ammt.out >> $DEFECTS \ - && break - ERRORS=`expr $ERRORS + 1` - [ $ERRORS -gt 100 ] \ - && report "** Error rewinding tape" \ - && report "`cat $TEMP/ammt.out`" \ - && cat $TEMP/ammt.out >> $DEFECTS \ - && break - sleep 3 -======= - while true; do - amdevcheck_output="`amdevcheck $CONFIG $DEVICE`" - amdevcheck_status=$? - if [ $amdevcheck_status -eq 0 ]; then - break; - else - if echo $amdevcheck_output | grep UNLABELED > /dev/null; then - if [ count -lt 0 ]; then - report "Device not ready" - break; - fi - sleep 3 - count=`expr $count - 3` - else - report "Volume in $DEVICE unlabeled." - break; - fi - fi ->>>>>>> upstream:server-src/amverify.sh - done - $Echon "Processing label..." - amtape_output="`amtape $CONFIG current 2>&1`"; - if echo "$amtape_output" | \ - egrep "^slot +[0-9]+: time [^ ]+ +label [^ ]+" > /dev/null; then - : # everything is fine - else - report "Error reading tape label using amtape." - continue - fi - - set X $amtape_output - until [ "$1" = "time" ]; do - shift - done - - VOLUME=$4 - DWRITTEN=$2 - report "Volume $VOLUME, Date $DWRITTEN" - [ X"$DWRITTEN" = X"0" -o X"$DWRITTEN" = X"X" ] \ - && report "Fresh tape. Skipping..." \ - && continue - TAPELIST="$TAPELIST $VOLUME" - - FILENO=0 - ERG=0 - ERRORS=0 - while [ $ERG = 0 ]; do -<<<<<<< HEAD:server-src/amverify.sh.in - if [ $Echon = echon ]; then - $Echon "Waiting for device to go ready..." - fi - count=1800 - until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do - [ count -lt 0 ] \ - && report "Device not ready" \ - && report "`cat $TEMP/ammt.out`" \ - && report cat $TEMP/ammt.out >> $DEFECTS \ - && break; - sleep 3 - count=`expr $count - 3` - done - if [ $Echon = echon ]; then - $Echon "Reading..." - fi - RESULT=`$AMRESTORE -h -p $DEVICE 2> $TEMP/amrestore.out \ - | doonefile 2> $TEMP/onefile.errors` - FILE=`grep restoring $TEMP/amrestore.out \ - | sed 's/^.*restoring //'` - EOF=`grep "reached end of tape" $TEMP/amrestore.out` - EOI=`grep "reached end of information" $TEMP/amrestore.out` - # amrestore: 0: restoring sundae._mnt_sol1_usr.19961127.1 -======= - FILENO=`expr $FILENO + 1` -# { cat < bs=32k skip=1 | /bin/tar -xpGf - ... -#EOF - RESULT=`$AMRESTORE -h -p -f $FILENO $DEVICE \ - 2> $TEMP/amrestore.out \ - | doonefile 2> $TEMP/onefile.errors` - FILE=`grep restoring $TEMP/amrestore.out \ - | sed 's/^.*restoring //'` ->>>>>>> upstream:server-src/amverify.sh - if [ X"$FILE" != X"" -a X"$RESULT" = X"0" ]; then - report "Checked $FILE" - elif [ X"$FILE" != X"" -a X"$RESULT" = X"500" ]; then - report "Skipped `cat $TEMP/onefile.cmd` check on partial dump $FILE" - dump="`echo $FILE | cut -d'.' -f'1,2,3,4'`" - cat $TEMP/onefile.partnum >> $TEMP/$dump.parts - if [ X"`echo $SPLIT_DUMPS | grep $dump`" = X"" ]; then - SPLIT_DUMPS="$dump $SPLIT_DUMPS" - fi - elif [ X"$FILE" != X"" -a X"$RESULT" = X"999" ]; then - report "Skipped $FILE (`cat $TEMP/errors`)" - elif [ -z "$FILE" ]; then - # Unless we went over, there is no extra output. - report "End-of-Tape detected." - break - elif [ -n "$EOI" ]; then - report "End-of-Information detected." - break - else - report "** Error detected ($FILE)" - echo "$VOLUME ($FILE):" >>$DEFECTS - [ -s $TEMP/amrestore.out ] \ - && report "`cat $TEMP/amrestore.out`" \ - && cat $TEMP/amrestore.out >>$DEFECTS - [ -s $TEMP/errors ] \ - && report "`cat $TEMP/errors`" \ - && cat $TEMP/errors >>$DEFECTS - [ -s $TEMP/onefile.errors ] \ - && report "`cat $TEMP/onefile.errors`" \ - && cat $TEMP/onefile.errors >>$DEFECTS - ERRORS=`expr $ERRORS + 1` - [ $ERRORS -gt 5 ] \ - && report "Too many errors." \ - && break - fi - done - rm -f $TEMP/header \ - $TEMP/amtape.out \ - $TEMP/amrestore.out \ - $TEMP/errors \ - $TEMP/onefile.cmd \ - $TEMP/onefile.partnum \ - $TEMP/onefile.errors -done - -[ -s $DEFECTS ] \ - && $Echoe "Errors found: " \ - && cat $DEFECTS - -# Work out whether any split dumps we saw had all their parts -for dump in $SPLIT_DUMPS;do - report "" - numparts=0 - max=0 - max_known=0 - missing=0 - # figure out - for part in `cat $TEMP/$dump.parts`;do - cur="`echo $part | cut -d/ -f1`" - max="`echo $part | cut -d/ -f2`" - if [ $max != "UNKNOWN" ]; then - numparts=$max - max_known=1 - break; - fi - if [ $cur -gt $numparts ]; then - numparts=$cur - fi - done - report "Split dump $dump should have $numparts total pieces" - if [ $max_known != 1 ]; then - report "NOTE: Header field for total pieces was UNKNOWN, $numparts is best guess" - fi - part=1 - while [ $part -lt $numparts ];do - part=`expr $part + 1` - if [ X"`grep \"^$part/\" $TEMP/$dump.parts`" = X"" ];then - report "Spanning chunk part $part is missing!" - missing=`expr $missing + 1` - fi - done - if [ $missing = 0 ];then - report "All parts found" - fi - rm -f $TEMP/$dump.parts -done - -sendreport - -rm -fr $TEMP -trap - EXIT - -exit 0