summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorbouyer <bouyer>2001-06-13 12:41:09 +0000
committerbouyer <bouyer>2001-06-13 12:41:09 +0000
commit9edbd0bf29ce00b7c125cbb4b41ba6a99ad144f0 (patch)
tree5bdae826ace2f433e5d0173000db0003ee185dbe /sysutils
parent196364a04b35ebe9af5a7756761854c2dfd4dd74 (diff)
downloadpkgsrc-9edbd0bf29ce00b7c125cbb4b41ba6a99ad144f0.tar.gz
Add patch from Nick Hudson to detect util.h and getrawpartition() in libutil.
Chnage patch to cddata.cpp to use getrawpartition(), and enclose NetBSD-specific changes in #ifdef __NetBSD/#endif so that it's easier to send back to KDE folks.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/koncd/patches/patch-aa143
-rw-r--r--sysutils/koncd/patches/patch-ab15
-rw-r--r--sysutils/koncd/patches/patch-ac13
3 files changed, 108 insertions, 63 deletions
diff --git a/sysutils/koncd/patches/patch-aa b/sysutils/koncd/patches/patch-aa
index b288897c855..cbac95a5f6e 100644
--- a/sysutils/koncd/patches/patch-aa
+++ b/sysutils/koncd/patches/patch-aa
@@ -1,37 +1,70 @@
-$NetBSD: patch-aa,v 1.2 2001/06/11 17:58:00 bouyer Exp $
+$NetBSD: patch-aa,v 1.3 2001/06/13 12:41:09 bouyer Exp $
---- koncd/cddata.cpp.orig Sun Mar 11 12:35:36 2001
-+++ koncd/cddata.cpp Mon Jun 11 19:50:12 2001
-@@ -17,14 +17,22 @@
+--- koncd/cddata.cpp.orig Wed Jun 13 12:04:10 2001
++++ koncd/cddata.cpp Wed Jun 13 13:32:12 2001
+@@ -13,10 +13,39 @@
+ #include <unistd.h>
+ #include "cddata.h"
+
++#include "config.h"
++
++#ifdef HAVE_GETRAWPARTITION
++# include <util.h>
++#endif
++
+ static int CurBus;
struct DEVICES *CurDev;
CDdata::CDdata( QObject * , const char * ) {
++#ifdef __NetBSD__
+ int i;
+ char prog2[128];
- Devices = NULL;
-- strncpy( prog, "cdrecord", sizeof( prog ) - 1);
-- proc << prog << "-scanbus";
-- connect( &proc, SIGNAL(receivedStderr (KProcess *, char *, int) ),
-- this, SLOT(slotOutput (KProcess *, char *, int) ));
-- connect( &proc, SIGNAL(receivedStdout (KProcess *, char *, int) ),
-+ strncpy( prog, "scsictl", sizeof( prog ) - 1);
++ int raw;
++
++ Devices = NULL;
++ strncpy( prog, "scsictl", sizeof( prog ) - 1);
+ connect( &proc, SIGNAL(receivedStdout (KProcess *, char *, int) ),
- this, SLOT(slotOutput (KProcess *, char *, int) ));
-- proc.start( KProcess::Block, KProcess::AllOutput );
-+ for (i = 0; i < 8; i++) {
-+ proc.clearArguments();
-+#ifdef __i386__
-+ snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%dd",i);
++ this, SLOT(slotOutput (KProcess *, char *, int) ));
++#ifdef HAVE_GETRAWPARTITION
++ raw = getrawpartition();
+#else
-+ snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%dc",i);
++ raw = 'c' - 'a';
+#endif
++ for (i = 0; i < 8; i++) {
++ proc.clearArguments();
++ snprintf(prog2, sizeof( prog2 ) - 1, "/dev/rcd%d%c",i,
++ 'a' + raw);
+ proc << prog << prog2 << "identify";
+ proc.start( KProcess::Block, KProcess::AllOutput );
+ }
++#else
++
+ Devices = NULL;
+ strncpy( prog, "cdrecord", sizeof( prog ) - 1);
+ proc << prog << "-scanbus";
+@@ -25,6 +54,7 @@
+ connect( &proc, SIGNAL(receivedStdout (KProcess *, char *, int) ),
+ this, SLOT(slotOutput (KProcess *, char *, int) ));
+ proc.start( KProcess::Block, KProcess::AllOutput );
++#endif /* __NetBSD__ */
sprintf( dummystr,"dev=unknown" );
struct DEVICES *d;
-@@ -105,40 +113,39 @@
+@@ -100,14 +130,53 @@
+ char *c, *b, buf[1024];
+ struct DEVICES *dev;
+ unsigned i;
++#ifdef __NetBSD__
++ int raw;
++
++#ifdef HAVE_GETRAWPARTITION
++ raw = getrawpartition();
++#else
++ raw = 'c' - 'a';
++#endif
++#endif /* __NetBSD__ */
+
+ if( !n ) {
return;
}
bzero( buf, sizeof( buf ) );
@@ -39,60 +72,44 @@ $NetBSD: patch-aa,v 1.2 2001/06/11 17:58:00 bouyer Exp $
+ strncpy( buf, s, n >= (int) sizeof( buf ) ? sizeof(buf) - 1 : n );
output += buf;
-- c = strtok( buf, "\n" );
-- while( c ) {
-- if( (b = strstr( c, "scsibus" )) ) {
-- CurBus = c[7] - 0x30;
-- }
-- if( (b = strstr( c, ") " )) ) {
-- if( b - 1 >= c && isdigit( *(b-1) ) && b[2] != '*' ) {
++#ifdef __NetBSD__
+ if (strncmp(buf, "/dev/rcd", 8) != 0)
+ return;
-+ if( (b = strstr( buf, "<" )) && (c = strstr( buf, ">" ))) {
- dev = (struct DEVICES *) calloc( sizeof( struct DEVICES ), 1 );
- dev -> next = Devices;
- Devices = dev;
-- dev -> bus = CurBus;
-- dev -> dev = *(b-1) - 0x30;
-- sprintf( dev -> devstr, "dev=%d,%d,0",
-- (CurBus < 32) ? CurBus:0, (dev -> dev < 32) ? dev -> dev:0 );
-- for( ; *b && *b != '\''; b++ ); // point to '
-+ dev -> dev = buf[8] - 0x30;
-+#ifdef __i386__
-+ sprintf( dev -> devstr, "dev=/dev/rcd%dd",
-+ (dev -> dev < 32) ? dev -> dev:0 );
-+#else
-+ sprintf( dev -> devstr, "dev=/dev/rcd%dc",
-+ (dev -> dev < 32) ? dev -> dev:0 );
-+#endif
- if( *b ) b++; // point to next character
-- for( i = 0; *b && *b != '\'' && i < sizeof(dev->vendor)-1; b++, i++ )
-+ for( i = 0; *b && *b != ',' && i < sizeof(dev->vendor)-1; b++, i++ )
- dev -> vendor[i] = *b;
-- for( i = 0; *b && i < 2; b++ ) if( *b == '\'' ) i++;
-- for( i = 0; *b && *b != '\'' && i < sizeof(dev->name)-1; b++, i++ )
++ if( (b = strstr( buf, "<" )) && (c = strstr( buf, ">" ))) {
++ dev = (struct DEVICES *) calloc( sizeof( struct DEVICES ), 1 );
++ dev -> next = Devices;
++ Devices = dev;
++ dev -> bus = 0;
++ dev -> dev = buf[8] - 0x30;
++ sprintf( dev -> devstr, "dev=/dev/rcd%d%c",
++ (dev -> dev < 32) ? dev -> dev:0, 'a' + raw);
++ if( *b ) b++; // point to next character
++ for( i = 0; *b && *b != ',' && i < sizeof(dev->vendor)-1;
++ b++, i++ )
++ dev -> vendor[i] = *b;
+ while(*b != ',' && *b != 0) // points to next ","
+ b++;
+ if (*b == ',') b++; // next char
-+ for( i = 0; *b && *b != ',' && i < sizeof(dev->name)-1;
++ for( i = 0; *b && *b != ',' && i < sizeof(dev->name)-1;
+ b++, i++ )
- dev -> name[i] = *b;
-- for( i = 0; *b && i < 2; b++ ) if( *b == '\'' ) i++;
-- for( i = 0; *b && *b != '\'' && i < sizeof(dev->version)-1; b++, i++ )
++ dev -> name[i] = *b;
+ while(*b != ',' && *b != 0) // points to next ","
+ b++;
+ if (*b == ',') b++; // next char
-+ for( i = 0; *b && *b != '>' && i < sizeof(dev->version)-1; b++, i++ )
- dev -> version[i] = *b;
-- for( i = 0; *b && i < 1; b++ ) if( *b == '\'' ) i++;
-- for( i = 0; *b && *b != '\'' && i < sizeof(dev->desc)-1; b++, i++ )
-- dev -> desc[i] = *b;
-- }
-- }
-- c = strtok( NULL, "\n" );
-- }
-+ dev -> desc[0] = 0;
++ for( i = 0; *b && *b != '>' && i < sizeof(dev->version)-1;
++ b++, i++ )
++ dev -> version[i] = *b;
++ dev -> desc[0] = 0;
+ }
++#else
+ c = strtok( buf, "\n" );
+ while( c ) {
+ if( (b = strstr( c, "scsibus" )) ) {
+@@ -139,6 +208,7 @@
+ }
+ c = strtok( NULL, "\n" );
+ }
++#endif /* __NetBSD__ */
}
void CDdata::slotOutput1(KProcess *, char *s, int n) {
diff --git a/sysutils/koncd/patches/patch-ab b/sysutils/koncd/patches/patch-ab
new file mode 100644
index 00000000000..a990de497aa
--- /dev/null
+++ b/sysutils/koncd/patches/patch-ab
@@ -0,0 +1,15 @@
+$NetBSD: patch-ab,v 1.1 2001/06/13 12:41:09 bouyer Exp $
+
+--- configure.in.in.orig Sat Mar 31 14:57:18 2001
++++ configure.in.in
+@@ -2,3 +2,10 @@
+
+ AM_INIT_AUTOMAKE(koncd,0.7.1)
+
++AC_CHECK_HEADER(util.h,
++ AC_CHECK_LIB(util, getrawpartition, [
++ AC_DEFINE(HAVE_GETRAWPARTITION, 1, [Define if getrawpartition exists])
++ LIBUTIL="-lutil"]
++ )
++)
++AC_SUBST(LIBUTIL)
diff --git a/sysutils/koncd/patches/patch-ac b/sysutils/koncd/patches/patch-ac
new file mode 100644
index 00000000000..af59ecb98a2
--- /dev/null
+++ b/sysutils/koncd/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.1 2001/06/13 12:41:09 bouyer Exp $
+
+--- koncd/Makefile.am.orig Tue Jun 12 19:29:02 2001
++++ koncd/Makefile.am
+@@ -45,7 +45,7 @@
+ METASOURCES = AUTO
+
+ # the library search path.
+-koncd_LDFLAGS = $(all_libraries) $(KDE_RPATH)
++koncd_LDFLAGS = $(all_libraries) $(KDE_RPATH) @LIBUTIL@
+
+ # Uncomment the following two lines if you add a ui.rc file for your application to make use of
+ # KDE´s XML GUI builing