--no-header omits warranty. Patch from Martin von Gagem. Savannah #29307.

This commit is contained in:
R. Bernstein
2011-10-04 04:28:36 -04:00
parent 6d907afff7
commit dced0a55c4
29 changed files with 58 additions and 157 deletions

View File

@@ -51,15 +51,16 @@ print_version (char *program_name, const char *version,
int no_header, bool version_only) int no_header, bool version_only)
{ {
if (no_header == 0) if (no_header == 0) {
report( stdout, report( stdout,
"%s version %s\nCopyright (c) 2003, 2004, 2005, 2007, 2008, 2011 R. Bernstein\n", "%s version %s\nCopyright (c) 2003, 2004, 2005, 2007, 2008, 2011 R. Bernstein\n",
program_name, version); program_name, version);
report( stdout, report( stdout,
_("This is free software; see the source for copying conditions.\n\ _("This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n\ PARTICULAR PURPOSE.\n\
")); "));
}
if (version_only) { if (version_only) {
char *default_device; char *default_device;

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DA Disc mode is listed as: CD-DA

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 0x0000: 0000 0000 0000 0000 0000 0000 0000 0000
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 0x0010: 0000 0000 0000 0000 0000 0000 0000 0000
0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 0x0020: 0000 0000 0000 0000 0000 0000 0000 0000

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DA Disc mode is listed as: CD-DA

View File

@@ -46,75 +46,56 @@ check_result() {
fi fi
} }
test_cdinfo() { test_common() {
opts="$1" cmdname="$1"
outfile="$2" cmd="../src/${cmdname}@EXEEXT@"
rightfile="$3" opts="$2"
outfile="$3"
rightfile="$4"
CD_INFO="../src/cd-info@EXEEXT@" if [ ! -x "${cmd}" ]; then
echo "$0: No ${cmd}"
if [ ! -x ${CD_INFO} ]; then
echo "$0: No ${CD_INFO}"
return 1 return 1
fi fi
if ${CD_INFO} --no-header ${opts} >${outfile} 2>&1 ; then cmdline="${cmd}"
if "${cmd}" --no-header ${opts} >"${outfile}" 2>&1 ; then
if test "@DIFF@" != no; then if test "@DIFF@" != no; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then if @DIFF@ @DIFF_OPTS@ "${outfile}" "${rightfile}" ; then
rm -f $outfile rm -f "${outfile}"
return 0 return 0
else else
return 3 return 3
fi fi
else else
echo "$0: No diff(1) or cmp(1) found - cannot test ${CD_INFO}" echo "$0: No diff(1) or cmp(1) found - cannot test ${cmdname}"
rm -f $outfile rm -f "${outfile}"
return 77 return $SKIP_TEST_EXITCODE
fi fi
else else
echo "$0 failed running: ${CD_INFO} ${opts}" echo "$0 failed running: ${cmdname} ${opts}"
return 2 return 2
fi fi
} }
test_cdinfo() {
test_common cd-info "$@"
}
test_iso_info() { test_iso_info() {
test_common iso-info "$@"
}
opts="$1" test_cd_read() {
outfile="$2" test_common cd-read "$@"
rightfile="$3"
ISO_INFO="../src/iso-info@EXEEXT@"
if [ ! -x ${ISO_INFO} ]; then
echo "$0: No ${ISO_INFO}"
return 1
fi
cmdline="${ISO_INFO} --no-header ${opts}"
if $cmdline >${outfile} 2>&1 ; then
if test "/usr/bin/diff" != no; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
rm -f $outfile
return 0
else
return 3
fi
else
echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_INFO}"
rm -f $outfile
return 77
fi
else
echo "$0 failed running: $cmdline"
return 2
fi
} }
test_iso_read() { test_iso_read() {
# not test_common, as we use an output file not stdout.
opts="$1" opts="$1"
outfile="$2" outfile="$2"
rightfile="$3" rightfile="$3"
@@ -126,17 +107,17 @@ test_iso_read() {
return 1 return 1
fi fi
if ${ISO_READ} ${opts} -o ${outfile} 2>&1 ; then if "${ISO_READ}" ${opts} -o "${outfile}" 2>&1 ; then
if test "@DIFF@" != no; then if test "@DIFF@" != no; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then if @DIFF@ @DIFF_OPTS@ "${outfile}" "${rightfile}" ; then
rm -f $outfile rm -f "${outfile}"
return 0 return 0
else else
return 3 return 3
fi fi
else else
echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_READ}" echo "$0: No diff(1) or cmp(1) found - cannot test ${ISO_READ}"
rm -f $outfile rm -f "${outfile}"
return 77 return 77
fi fi
else else
@@ -146,36 +127,31 @@ test_iso_read() {
} }
test_cd_read() { test_legal_header() {
opts="$1" cmdname="$1"
outfile="$2" cmd="../src/${cmdname}@EXEEXT@"
rightfile="$3" opts="$2"
outfile="$3"
CD_READ="../src/cd-read@EXEEXT@" if test "@GREP@" == no; then
echo "$0: No grep(1) found - cannot test ${cmd}."
if [ ! -x ${CD_READ} ]; then echo "$0: Legal header test skipped."
echo "$0: No ${CD_READ}" exit $SKIP_TEST_EXITCODE
return 1
fi fi
"${cmd}" ${opts} > ${outfile} 2>&1
if ${CD_READ} --no-header ${opts} >${outfile} 2>&1 ; then while read line; do
if test "@DIFF@" != no; then if ! grep -q "${line}" ${outfile}; then
if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then echo "$0: Legal header test failed due to missing expected line:"
rm -f $outfile echo " ${line}"
return 0 echo "$0: Failed command:"
else echo " ${cmd} ${opts}"
return 3 rm -f "${outfile}"
fi exit 4
else
echo "$0: No diff(1) or cmp(1 found - cannot test ${CD_READ}"
rm -f $outfile
return 77
fi fi
else done < ${srcdir}/check_legal.regex
echo "$0 failed running: ${CD_READ} ${opts}" rm -f ${outfile}
return 2 echo "$0: Legal header of ${cmd} ${opts} ok."
fi
} }

View File

@@ -29,6 +29,8 @@ for opt in '-T' '--no-tracks' '-A' '--no-analyze' '-I' '--no-ioctl' \
i=`expr $i + 1` i=`expr $i + 1`
done done
test_legal_header cd-info "${srcdir}/data/${fname}.cue" cd-info_legal.dump
exit $RC exit $RC
#;;; Local Variables: *** #;;; Local Variables: ***

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD-DATA (Mode 1) Disc mode is listed as: CD-DATA (Mode 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
ISO-9660 Information ISO-9660 Information
/: /:

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
ISO-9660 Information ISO-9660 Information
/: /:

View File

@@ -1,7 +1,4 @@
CD Info 2.0 | (c) 2003 Gerd Knorr, Heiko Ei<45>feldt & R. Bernstein CD Info 2.0 | (c) 2003 Gerd Knorr, Heiko Ei<45>feldt & R. Bernstein
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 1) CD-ROM Track List (1 - 1)
#: MSF LSN Type #: MSF LSN Type

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 1) CD-ROM Track List (1 - 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
0x0000: 0909 2020 2020 474e 5520 4745 4e45 5241 .. GNU GENERA 0x0000: 0909 2020 2020 474e 5520 4745 4e45 5241 .. GNU GENERA
0x0010: 4c20 5055 424c 4943 204c 4943 454e 5345 L PUBLIC LICENSE 0x0010: 4c20 5055 424c 4943 204c 4943 454e 5345 L PUBLIC LICENSE
0x0020: 0a09 0920 2020 2020 2020 5665 7273 696f ... Versio 0x0020: 0a09 0920 2020 2020 2020 5665 7273 696f ... Versio

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 1) CD-ROM Track List (1 - 1)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
ISO-9660 Information ISO-9660 Information
/: /:

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
ISO-9660 Information ISO-9660 Information
/: /:

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD DATA (Mode 2) Disc mode is listed as: CD DATA (Mode 2)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 2) CD-ROM Track List (1 - 2)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD DATA (Mode 2) Disc mode is listed as: CD DATA (Mode 2)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 3) CD-ROM Track List (1 - 3)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 3) CD-ROM Track List (1 - 3)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
CD-ROM Track List (1 - 3) CD-ROM Track List (1 - 3)

View File

@@ -1,6 +1,3 @@
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
__________________________________ __________________________________
Disc mode is listed as: CD DATA (Mode 2) Disc mode is listed as: CD DATA (Mode 2)