Adapted from patches by Nicolas Boullis on Debian:

* alignment issues on sparc
 * "make check" failure when stderr is not a tty
 * wrong program name in manpages in tarball
 * build failure with hurd
 * "make check" failure on machines with no disc drive
 * make distclean fixes
This commit is contained in:
R. Bernstein
2009-07-02 20:26:39 -04:00
parent e7ac0ea72c
commit 2522c26ec8
15 changed files with 84 additions and 1407 deletions

View File

@@ -16,7 +16,7 @@ dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301 USA. dnl 02110-1301 USA.
define(RELEASE_NUM, 82cvs) define(RELEASE_NUM, 82git)
define(CDIO_VERSION_STR, 0.$1) define(CDIO_VERSION_STR, 0.$1)
AC_PREREQ(2.52) AC_PREREQ(2.52)
@@ -661,6 +661,7 @@ AC_CONFIG_FILES([
src/cd-paranoia/doc/ja/Makefile \ src/cd-paranoia/doc/ja/Makefile \
src/Makefile \ src/Makefile \
test/testbincue.c \ test/testbincue.c \
test/testgetdevices.c \
test/testisocd2.c \ test/testisocd2.c \
test/testpregap.c \ test/testpregap.c \
test/testnrg.c \ test/testnrg.c \

View File

@@ -11,3 +11,5 @@
/main /main
/mmc1 /mmc1
/mmc2 /mmc2
/paranoia
/paranoia2

View File

@@ -8,6 +8,7 @@
/eject /eject
/iso4 /iso4
/isofile /isofile
/isofile2
/isolist /isolist
/mmc1 /mmc1
/mmc2 /mmc2

View File

@@ -1,7 +1,7 @@
/* /*
$Id: scan_devices.c,v 1.33 2008/06/16 19:45:44 flameeyes Exp $ $Id: scan_devices.c,v 1.33 2008/06/16 19:45:44 flameeyes Exp $
Copyright (C) 2004, 2005, 2007, 2008 Rocky Bernstein <rocky@gnu.org> Copyright (C) 2004, 2005, 2007, 2008, 2009 Rocky Bernstein <rocky@gnu.org>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -39,6 +39,10 @@
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#define MAX_DEV_LEN 20 /* Safe because strings only come from below */ #define MAX_DEV_LEN 20 /* Safe because strings only come from below */
/* must be absolute paths! */ /* must be absolute paths! */
static const char scsi_cdrom_prefixes[][16]={ static const char scsi_cdrom_prefixes[][16]={

View File

@@ -7,3 +7,5 @@
/Makefile.in /Makefile.in
/libcdio.la /libcdio.la
/libcdio.la.ver /libcdio.la.ver
/*.orig
/*.rej

View File

@@ -1,7 +1,8 @@
/* /*
$Id: _cdio_generic.c,v 1.27 2008/04/22 15:29:11 karl Exp $ $Id: _cdio_generic.c,v 1.27 2008/04/22 15:29:11 karl Exp $
Copyright (C) 2004, 2005, 2006, 2007, 2008 Rocky Bernstein <rocky@gnu.org> Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
Rocky Bernstein <rocky@gnu.org>
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 it under the terms of the GNU General Public License as published by
@@ -49,6 +50,10 @@ static const char _rcsid[] = "$Id: _cdio_generic.c,v 1.27 2008/04/22 15:29:11 ka
#include "_cdio_stdio.h" #include "_cdio_stdio.h"
#include "portable.h" #include "portable.h"
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
/*! /*!
Eject media -- there's nothing to do here. We always return -2. Eject media -- there's nothing to do here. We always return -2.
Should we also free resources? Should we also free resources?

View File

@@ -2,7 +2,7 @@
$Id: gnu_linux.c,v 1.33 2008/06/25 07:46:21 rocky Exp $ $Id: gnu_linux.c,v 1.33 2008/06/25 07:46:21 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009
Rocky Bernstein <rocky@gnu.org> Rocky Bernstein <rocky@gnu.org>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -77,6 +77,10 @@ static const char _rcsid[] = "$Id: gnu_linux.c,v 1.33 2008/06/25 07:46:21 rocky
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
typedef enum { typedef enum {
_AM_NONE, _AM_NONE,
_AM_IOCTL, _AM_IOCTL,
@@ -1429,7 +1433,7 @@ cdio_get_default_device_linux(void)
/* Scan the system for CD-ROM drives. /* Scan the system for CD-ROM drives.
*/ */
for ( i=0; strlen(checklist1[i]) > 0; ++i ) { for ( i=0; i < checklist1_size; ++i ) {
if (snprintf(drive, sizeof(drive), "/dev/%s", checklist1[i]) < 0) if (snprintf(drive, sizeof(drive), "/dev/%s", checklist1[i]) < 0)
continue; continue;
if ( is_cdrom_linux(drive, NULL) > 0 ) { if ( is_cdrom_linux(drive, NULL) > 0 ) {

View File

@@ -1,7 +1,8 @@
/* /*
$Id: nrg.c,v 1.31 2008/04/21 18:30:22 karl Exp $ $Id: nrg.c,v 1.31 2008/04/21 18:30:22 karl Exp $
Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001, 2003 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -715,23 +716,28 @@ parse_nrg (_img_private_t *p_env, const char *psz_nrg_name,
case SINF_ID: { /* "SINF" */ case SINF_ID: { /* "SINF" */
uint32_t *_sessions = (void *) chunk->data; uint32_t _sessions;
cdio_assert (UINT32_FROM_BE (chunk->len) == 4); cdio_assert (UINT32_FROM_BE (chunk->len) == 4);
memcpy(&_sessions, chunk->data, 4);
cdio_debug ("SINF: %lu sessions", cdio_debug ("SINF: %lu sessions",
(long unsigned int) UINT32_FROM_BE (*_sessions)); (long unsigned int) UINT32_FROM_BE (_sessions));
} }
break; break;
case MTYP_ID: { /* "MTYP" */ case MTYP_ID: { /* "MTYP" */
uint32_t *mtyp_p = (void *) chunk->data; uint32_t mtyp_be;
uint32_t mtyp = UINT32_FROM_BE (*mtyp_p); uint32_t mtyp;
cdio_assert (UINT32_FROM_BE (chunk->len) == 4); cdio_assert (UINT32_FROM_BE (chunk->len) == 4);
memcpy(&mtyp_be, chunk->data, 4);
mtyp = UINT32_FROM_BE (mtyp_be);
cdio_debug ("MTYP: %lu", cdio_debug ("MTYP: %lu",
(long unsigned int) UINT32_FROM_BE (*mtyp_p)); (long unsigned int) mtyp);
if (mtyp != MTYP_AUDIO_CD) { if (mtyp != MTYP_AUDIO_CD) {
cdio_log (log_level, cdio_log (log_level,

View File

@@ -1,7 +1,8 @@
/* /*
$Id: util.c,v 1.6 2008/04/22 15:29:12 karl Exp $ $Id: util.c,v 1.6 2008/04/22 15:29:12 karl Exp $
Copyright (C) 2003, 2004, 2005, 2008 Rocky Bernstein <rocky@gnu.org> Copyright (C) 2003, 2004, 2005, 2008, 2009
Rocky Bernstein <rocky@gnu.org>
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@@ -40,6 +41,10 @@
#include <cdio/types.h> #include <cdio/types.h>
#include <cdio/util.h> #include <cdio/util.h>
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
static const char _rcsid[] = "$Id: util.c,v 1.6 2008/04/22 15:29:12 karl Exp $"; static const char _rcsid[] = "$Id: util.c,v 1.6 2008/04/22 15:29:12 karl Exp $";
size_t size_t

3
src/.gitignore vendored
View File

@@ -1,4 +1,6 @@
/*.o /*.o
/*.orig
/*.rej
/.deps /.deps
/.libs /.libs
/Makefile /Makefile
@@ -7,6 +9,7 @@
/cd-drive.1 /cd-drive.1
/cd-info /cd-info
/cd-info.1 /cd-info.1
/*~
/cd-read /cd-read
/cd-read.1 /cd-read.1
/cdda-player /cdda-player

View File

@@ -90,6 +90,9 @@ EXTRA_DIST = cd-drive.help2man cd-info.help2man cd-read.help2man \
iso-info.help2man iso-read.help2man $(GETOPT_C) getopt.h \ iso-info.help2man iso-read.help2man $(GETOPT_C) getopt.h \
$(man_MANS) $(man_MANS)
if MAINTAINER_MODE
$(man_MANS): %.1: %$(EXEEXT) %.help2man $(man_MANS): %.1: %$(EXEEXT) %.help2man
-$(HELP2MAN) --opt-include=$(srcdir)/$(<:.exe=).help2man --no-info --output=$@ ./$< -$(HELP2MAN) --opt-include=$(srcdir)/$(<:.exe=).help2man --no-info --output=$@ ./$<
endif
MAINTAINERCLEANFILES = $(man_MANS)
MOSTLYCLEANFILES = $(man_MANS) MOSTLYCLEANFILES = $(man_MANS)

View File

@@ -4,5 +4,8 @@
/Makefile /Makefile
/Makefile.in /Makefile.in
/cd-paranoia /cd-paranoia
/*.orig
/*~
/*.rej
/usage.h /usage.h
/usage.txt /usage.txt

File diff suppressed because it is too large Load Diff

View File

@@ -90,7 +90,7 @@ check_DATA = vcd_demo.right vcd_demo_vcdinfo.right \
EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \ EXTRA_DIST = $(check_SCRIPTS) $(check_DATA) \
check_common_fn check_cue.sh.in check_nrg.sh.in \ check_common_fn check_cue.sh.in check_nrg.sh.in \
testbincue.c.in testpregap.c.in testnrg.c.in \ testbincue.c.in testpregap.c.in testnrg.c.in \
check_iso.sh.in p1.bin p1.cue p1.nrg testgetdevices.c.in check_iso.sh.in p1.bin p1.cue p1.nrg
TESTS = $(check_PROGRAMS) $(check_SCRIPTS) TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
XFAIL_TESTS = testassert XFAIL_TESTS = testassert

View File

@@ -1,5 +1,5 @@
/* /*
Copyright (C) 2008 Rocky Bernstein <rocky@gnu.org> Copyright (C) 2008, 2009 Rocky Bernstein <rocky@gnu.org>
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 it under the terms of the GNU General Public License as published by
@@ -38,9 +38,17 @@
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h> #include <string.h>
#ifndef TEST_DIR
#define TEST_DIR "@srcdir@"
#endif
static void static void
log_handler (cdio_log_level_t level, const char message[]) log_handler (cdio_log_level_t level, const char message[])
{ {
@@ -146,34 +154,37 @@ main(int argc, const char *argv[])
exit(77); exit(77);
} }
nrg_images = cdio_get_devices(DRIVER_NRG);
for (imgs=nrg_images; *imgs != NULL; imgs++) {
printf("NRG image %s\n", *imgs);
}
if (!is_in(nrg_images, nrg_files[0])) {
cdio_free_device_list(nrg_images);
return 10;
}
bincue_images = cdio_get_devices(DRIVER_BINCUE); bincue_images = cdio_get_devices(DRIVER_BINCUE);
for (imgs=bincue_images; *imgs != NULL; imgs++) { for (imgs=bincue_images; *imgs != NULL; imgs++) {
printf("bincue image %s\n", *imgs); printf("bincue image %s\n", *imgs);
} }
for (i=0; i<2; i++) {
if (is_in(bincue_images, cue_files[i])) {
printf("%s parses as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
} else {
printf("%s doesn't parse as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
ret = i+1;
}
}
if (ret != 0) return ret; if (ret != 0) return ret;
if (0 == chdir(TEST_DIR)) {
nrg_images = cdio_get_devices(DRIVER_NRG);
for (imgs=nrg_images; *imgs != NULL; imgs++) {
printf("NRG image %s\n", *imgs);
}
if (!is_in(nrg_images, nrg_files[0])) {
cdio_free_device_list(nrg_images);
return 10;
}
for (i=0; i<2; i++) {
if (is_in(bincue_images, cue_files[i])) {
printf("%s parses as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
} else {
printf("%s doesn't parse as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
ret = i+1;
}
}
}
cdio_free_device_list(nrg_images); cdio_free_device_list(nrg_images);
cdio_free_device_list(bincue_images); cdio_free_device_list(bincue_images);
return 0; return 0;