From 73a13467b7fd22d6235b8af6de018d707f8d2660 Mon Sep 17 00:00:00 2001 From: espie Date: Sat, 25 Aug 2001 11:19:25 +0000 Subject: [PATCH] Repair part of the library. Reroute find_cooked to find_scsi since OpenBSD always uses SCSI interface. Remove corresponding kludge :-P in main.c --- audio/cdparanoia/Makefile | 4 +- audio/cdparanoia/patches/patch-Makefile_in | 4 +- audio/cdparanoia/patches/patch-configure_in | 8 +-- .../patch-interface_common_interface_c | 8 +-- .../patches/patch-interface_scan_devices_c | 63 +++++++++---------- audio/cdparanoia/patches/patch-main_c | 18 +----- 6 files changed, 43 insertions(+), 62 deletions(-) diff --git a/audio/cdparanoia/Makefile b/audio/cdparanoia/Makefile index 45a02bcdba3..423c9032be9 100644 --- a/audio/cdparanoia/Makefile +++ b/audio/cdparanoia/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.4 2001/08/23 22:22:59 espie Exp $ +# $OpenBSD: Makefile,v 1.5 2001/08/25 11:19:25 espie Exp $ # $NetBSD: Makefile,v 1.1.1.1 2000/01/19 08:03:00 itohy Exp $ COMMENT= "CDDA reading utility with extra data verification features" DISTNAME= cdparanoia-III-alpha9.7 -PKGNAME= cdparanoia-3.a9.7p1 +PKGNAME= cdparanoia-3.a9.7p2 CATEGORIES= audio NEED_VERSION= 1.364 MASTER_SITES= http://www.xiph.org/paranoia/download/ diff --git a/audio/cdparanoia/patches/patch-Makefile_in b/audio/cdparanoia/patches/patch-Makefile_in index 487a6b5560c..c02b5ea8cc4 100644 --- a/audio/cdparanoia/patches/patch-Makefile_in +++ b/audio/cdparanoia/patches/patch-Makefile_in @@ -1,6 +1,6 @@ -$OpenBSD: patch-Makefile_in,v 1.2 2001/08/23 16:23:22 espie Exp $ +$OpenBSD: patch-Makefile_in,v 1.3 2001/08/25 11:19:25 espie Exp $ --- Makefile.in.orig Tue Dec 14 09:42:14 1999 -+++ Makefile.in Thu Aug 23 18:09:05 2001 ++++ Makefile.in Sat Aug 25 12:43:01 2001 @@ -8,7 +8,7 @@ VPATH=@srcdir@ srcdir=@srcdir@ diff --git a/audio/cdparanoia/patches/patch-configure_in b/audio/cdparanoia/patches/patch-configure_in index 75a37737a3f..b4afe666507 100644 --- a/audio/cdparanoia/patches/patch-configure_in +++ b/audio/cdparanoia/patches/patch-configure_in @@ -1,4 +1,4 @@ -$OpenBSD: patch-configure_in,v 1.1.1.1 2000/09/21 16:07:22 espie Exp $ +$OpenBSD: patch-configure_in,v 1.2 2001/08/25 11:19:25 espie Exp $ --- configure.in.orig Mon Aug 16 00:29:43 1999 +++ configure.in Tue Sep 19 16:29:30 2000 @@ -14,15 +14,15 @@ AC_CHECK_PROG(INSTALL,install,install) @@ -6,18 +6,18 @@ $OpenBSD: patch-configure_in,v 1.1.1.1 2000/09/21 16:07:22 espie Exp $ if test -z "$GCC"; then DEBUG="-g" - OPT="-O" -+ OPT="-O ${COPT}" ++ OPT="-O ${COPTS}" else case $host in - i?86-*-linux*) + i?86-*-*) DEBUG="-g -Wall -fsigned-char" - OPT="-O20 -ffast-math -fsigned-char -finline-functions";; -+ OPT="-O20 -ffast-math -fsigned-char -finline-functions ${COPT}";; ++ OPT="-O20 -ffast-math -fsigned-char -finline-functions ${COPTS}";; *) DEBUG="-g -Wall -fsigned-char" - OPT="-O20 -fsigned-char";; -+ OPT="-O20 -fsigned-char ${COPT}";; ++ OPT="-O20 -fsigned-char ${COPTS}";; esac fi diff --git a/audio/cdparanoia/patches/patch-interface_common_interface_c b/audio/cdparanoia/patches/patch-interface_common_interface_c index f45d3bfa9f2..3b0dffc6de4 100644 --- a/audio/cdparanoia/patches/patch-interface_common_interface_c +++ b/audio/cdparanoia/patches/patch-interface_common_interface_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-interface_common_interface_c,v 1.1.1.1 2000/09/21 16:07:20 espie Exp $ ---- interface/common_interface.c.orig Tue Sep 19 16:18:59 2000 -+++ interface/common_interface.c Tue Sep 19 16:16:35 2000 +$OpenBSD: patch-interface_common_interface_c,v 1.2 2001/08/25 11:19:25 espie Exp $ +--- interface/common_interface.c.orig Tue Dec 14 05:28:00 1999 ++++ interface/common_interface.c Sat Aug 25 02:10:36 2001 @@ -13,19 +13,29 @@ #include "utils.h" #include "smallft.h" @@ -16,7 +16,7 @@ $OpenBSD: patch-interface_common_interface_c,v 1.1.1.1 2000/09/21 16:07:20 espie if (ioctl(fd, CDROMVOLREAD, &volctl)) return(1); /* failure */ +#endif -+#ifdef __NetBSD__ ++#if defined(__NetBSD__) || defined(__OpenBSD__) + struct ioc_vol volctl; + if (ioctl(fd, CDIOCGETVOL, &volctl)) + return(1); /* failure */ diff --git a/audio/cdparanoia/patches/patch-interface_scan_devices_c b/audio/cdparanoia/patches/patch-interface_scan_devices_c index 6c1184fc6c2..86bd784ac84 100644 --- a/audio/cdparanoia/patches/patch-interface_scan_devices_c +++ b/audio/cdparanoia/patches/patch-interface_scan_devices_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp $ +$OpenBSD: patch-interface_scan_devices_c,v 1.2 2001/08/25 11:19:25 espie Exp $ --- interface/scan_devices.c.orig Tue Dec 14 08:30:23 1999 -+++ interface/scan_devices.c Thu Sep 21 17:19:18 2000 ++++ interface/scan_devices.c Sat Aug 25 13:02:45 2001 @@ -17,6 +17,8 @@ #include "common_interface.h" #include "utils.h" @@ -23,16 +23,22 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp /* Functions here look for a cdrom drive; full init of a drive type happens in interface.c */ -+#if defined(__linux__) /* not OpenBSD yet */ ++#if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages){ /* Brute force... */ -@@ -54,10 +62,12 @@ cdrom_drive *cdda_find_a_cdrom(int messa +@@ -50,14 +58,16 @@ cdrom_drive *cdda_find_a_cdrom(int messa + + /* number, then letter */ + +- buffer[pos-(cdrom_devices[i])]=j+48; ++ buffer[pos-(cdrom_devices[i])]=j+'0'; if((d=cdda_identify(buffer,messagedest,messages))) return(d); idmessage(messagedest,messages,"",NULL); +- buffer[pos-(cdrom_devices[i])]=j+97; +#ifdef __linux__ - buffer[pos-(cdrom_devices[i])]=j+97; ++ buffer[pos-(cdrom_devices[i])]=j+'a'; if((d=cdda_identify(buffer,messagedest,messages))) return(d); idmessage(messagedest,messages,"",NULL); @@ -40,44 +46,33 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp } }else{ /* Name. Go for it. */ -@@ -78,6 +88,15 @@ cdrom_drive *cdda_find_a_cdrom(int messa +@@ -78,6 +88,7 @@ cdrom_drive *cdda_find_a_cdrom(int messa } return(NULL); } +#endif /* __linux__ */ -+ -+#if defined(__NetBSD__) || defined(__OpenBSD__) -+cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages) -+{ -+ errx(1, "cdda_find_a_cdrom: not implemented"); -+ /* NOTREACHED */ -+} -+#endif /* __NetBSD__ || __OpenBSD__ */ cdrom_drive *cdda_identify(const char *device, int messagedest,char **messages){ struct stat st; -@@ -143,6 +162,7 @@ char *test_resolve_symlink(const char *f +@@ -143,6 +154,9 @@ char *test_resolve_symlink(const char *f cdrom_drive *cdda_identify_cooked(const char *dev, int messagedest, char **messages){ -+#ifdef __linux__ ++#ifdef __OpenBSD__ ++ return cdda_identify_scsi(dev, dev, messagedest, messages); ++#else cdrom_drive *d=NULL; struct stat st; int fd=-1; -@@ -270,6 +290,12 @@ cdrom_drive *cdda_identify_cooked(const +@@ -270,6 +284,7 @@ cdrom_drive *cdda_identify_cooked(const idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); return(d); -+#endif -+ -+#ifdef __NetBSD__ -+ /* no kernel support for CD-DA */ -+ return NULL; +#endif } struct sg_id { -@@ -289,12 +315,18 @@ typedef struct scsiid{ +@@ -289,12 +304,18 @@ typedef struct scsiid{ /* Even *this* isn't as simple as it bloody well should be :-P */ static int get_scsi_id(int fd, scsiid *id){ @@ -96,7 +91,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if(ioctl(fd,SCSI_IOCTL_GET_IDLUN,&argid))return(-1); id->bus=argid.l2; /* for now */ id->id=argid.l1&0xff; -@@ -302,6 +334,13 @@ static int get_scsi_id(int fd, scsiid *i +@@ -302,6 +323,13 @@ static int get_scsi_id(int fd, scsiid *i if(ioctl(fd,SCSI_IOCTL_GET_BUS_NUMBER,&busarg)==0) id->bus=busarg; @@ -110,7 +105,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp return(0); } -@@ -410,6 +449,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -410,6 +438,7 @@ cdrom_drive *cdda_identify_scsi(const ch generic_device); return(NULL); } @@ -118,7 +113,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if((int)(g_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ if((int)(g_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", -@@ -421,6 +461,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -421,6 +450,7 @@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device=temp; } } @@ -126,7 +121,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp } if(ioctl_device){ if(stat(ioctl_device,&i_st)){ -@@ -428,6 +469,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -428,6 +458,7 @@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device); return(NULL); } @@ -134,7 +129,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if((int)(i_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ if((int)(i_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", -@@ -439,6 +481,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -439,6 +470,7 @@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device=temp; } } @@ -142,7 +137,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp } /* we need to resolve any symlinks for the lookup code to work */ -@@ -455,6 +498,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -455,6 +487,7 @@ cdrom_drive *cdda_identify_scsi(const ch } if(!generic_device || !ioctl_device){ @@ -150,7 +145,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if(generic_device){ ioctl_device=scsi_match(generic_device,scsi_cdrom_prefixes,O_RDWR, O_RDONLY|O_NONBLOCK, -@@ -468,6 +512,9 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -468,6 +501,9 @@ cdrom_drive *cdda_identify_scsi(const ch if(!generic_device) goto cdda_identify_scsi_fail; } @@ -160,7 +155,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp } idmessage(messagedest,messages,"\t\tgeneric device: %s",generic_device); -@@ -504,6 +551,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -504,6 +540,7 @@ cdrom_drive *cdda_identify_scsi(const ch type=(int)(i_st.st_rdev>>8); @@ -168,7 +163,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if(type==SCSI_CDROM_MAJOR){ if (!S_ISBLK(i_st.st_mode)) { idmessage(messagedest,messages,"\t\tSCSI CDROM device %s not a " -@@ -515,8 +563,10 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -515,8 +552,10 @@ cdrom_drive *cdda_identify_scsi(const ch "major number",ioctl_device); goto cdda_identify_scsi_fail; } @@ -179,7 +174,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp if((int)(g_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){ if (!S_ISCHR(g_st.st_mode)) { idmessage(messagedest,messages,"\t\tGeneric SCSI device %s not a " -@@ -528,6 +578,7 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -528,6 +567,7 @@ cdrom_drive *cdda_identify_scsi(const ch "major number",generic_device); goto cdda_identify_scsi_fail; } @@ -187,7 +182,7 @@ $OpenBSD: patch-interface_scan_devices_c,v 1.1.1.1 2000/09/21 16:07:21 espie Exp d=calloc(1,sizeof(cdrom_drive)); -@@ -564,7 +615,16 @@ cdrom_drive *cdda_identify_scsi(const ch +@@ -564,7 +604,16 @@ cdrom_drive *cdda_identify_scsi(const ch /* It would seem some TOSHIBA CDROM gets things wrong */ diff --git a/audio/cdparanoia/patches/patch-main_c b/audio/cdparanoia/patches/patch-main_c index bea8fd28319..7393dd60a25 100644 --- a/audio/cdparanoia/patches/patch-main_c +++ b/audio/cdparanoia/patches/patch-main_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-main_c,v 1.1.1.1 2000/09/21 16:07:22 espie Exp $ +$OpenBSD: patch-main_c,v 1.2 2001/08/25 11:19:25 espie Exp $ --- main.c.orig Tue Dec 14 09:18:44 1999 -+++ main.c Tue Sep 19 16:45:23 2000 ++++ main.c Sat Aug 25 13:03:16 2001 @@ -49,7 +49,9 @@ #include #include @@ -105,17 +105,3 @@ $OpenBSD: patch-main_c,v 1.1.1.1 2000/09/21 16:07:22 espie Exp $ switch(c){ case 'B': batch=1; -@@ -797,6 +847,13 @@ int main(int argc,char *argv[]){ - report(VERSION); - - /* Query the cdrom/disc; we may need to override some settings */ -+ -+#if defined(__NetBSD__) || defined(__OpenBSD__) /* XXX */ -+ if (!force_generic_device) -+ force_generic_device = copystring("/dev/cd0c"); -+ if (!force_cdrom_device) -+ force_cdrom_device=copystring(force_generic_device); -+#endif - - if(force_generic_device) - d=cdda_identify_scsi(force_generic_device,force_cdrom_device,verbose,NULL);