Update of /cvsroot/fink/experimental/thesin/finkinfo/test
In directory usw-pr-cvs1:/tmp/cvs-serv16778

Added Files:
        dpkg-1.9.20-4.info dpkg-1.9.20-4.patch 
Log Message:
got start-stop-daemon ported and compiled, for testing only, till I or someone adds 
most of the functions to daemonic

--- NEW FILE: dpkg-1.9.20-4.info ---
Package: dpkg
Version: 1.9.20
Revision: 4
GCC: 3.1
Depends: gettext, libiconv
Essential: yes
Maintainer: Max Horn <[EMAIL PROTECTED]>
Source: mirror:sourceforge:fink/%n-%v.tar.gz
Source-MD5: e87d4483ac21a7a56daacecd276efc29
PatchScript: sed 's|@ADMINPREFIX@|%P|g' <%a/%f.patch | patch -p1
SetCFLAGS: -no-cpp-precomp -I%p/include
ConfigureParams: --without-sgml-doc --with-admindir=%p/var/lib/dpkg 
--mandir=%p/share/man --infodir=%p/share/info
CompileScript: <<
 ./configure powerpc-apple-darwin %c
 make
<<
InstallScript: <<
 mkdir -p %i/share/doc/dpkg
 make install DESTDIR=%d
 install -c -p -m 644 origin.fink %i/etc/dpkg/origins/fink
 rm -rf %i/lib/dpkg/methods/*
<<
Description: The Debian package manager
DescDetail: <<
dpkg installs and removes binary packages; it is the base of the
distribution. This package also contains some helper programs and
dselect, a full-screen console frontend to dpkg.
<<
DescPackaging: <<
Needs fixes to use the right architecture, disable code that uses
unimplemented functions on Darwin and other stuff.

Added code to support the pseudo package 'macosx' and 'darwin'.

Fix to install-info script to prevent a certain problem with section titles.

Previous versions by Christoph Pfisterer.
<<
License: GPL
#
PostInstScript: <<
if [ ! -f %p/var/lib/dpkg/diversions ]; then
  touch %p/var/lib/dpkg/diversions
  chmod 644 %p/var/lib/dpkg/diversions
fi
<<

--- NEW FILE: dpkg-1.9.20-4.patch ---
diff -ruN dpkg-1.9.20.orig/Makefile.conf.in dpkg-1.9.20/Makefile.conf.in
--- dpkg-1.9.20.orig/Makefile.conf.in   2001-04-21 16:37:59.000000000 -0600
+++ dpkg-1.9.20/Makefile.conf.in        2002-10-15 23:21:26.000000000 -0600
@@ -51,13 +51,13 @@
 CXXFLAGS               = @CXXFLAGS@
 
 LD                     = @LD@
-LDFLAGS                        = @LDFLAGS@
+LDFLAGS                        = @LDFLAGS@ -framework CoreFoundation
 LIBS                   = @LIBS@
 
 RANLIB                 = @RANLIB@
 
 DEFS                   = @DEFS@ -D_GNU_SOURCE
-INCLUDE_CFLAGS         = -I$(top_srcdir)/include -I$(top_srcdir) -I$(srcdir) 
-I../include -I.. -I. -I$(top_srcdir)/optlib
+INCLUDE_CFLAGS         = -I$(top_srcdir)/include -I$(top_srcdir) -I$(srcdir) 
+-I../include -I.. -I. -I$(top_srcdir)/optlib 
+-F/System/Library/Frameworks/CoreFoundation.framework
 
 NLS_CFLAGS             = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl -I../intl
 NLS_LIBS               = @INTLLIBS@ 
diff -ruN dpkg-1.9.20.orig/archtable dpkg-1.9.20/archtable
--- dpkg-1.9.20.orig/archtable  2001-05-13 15:50:59.000000000 -0600
+++ dpkg-1.9.20/archtable       2002-10-15 23:21:26.000000000 -0600
@@ -51,3 +51,5 @@
 s390-ibm-linux-gnu     s390            s390
 s390-unknown-linux-gnu s390            s390
 i386-openbsd2.8                openbsd-i386    i386
+powerpc-darwin         darwin-powerpc  darwin-powerpc
+i386-darwin            darwin-i386     darwin-i386
diff -ruN dpkg-1.9.20.orig/dpkg-deb/extract.c dpkg-1.9.20/dpkg-deb/extract.c
--- dpkg-1.9.20.orig/dpkg-deb/extract.c 2001-04-23 14:42:17.000000000 -0600
+++ dpkg-1.9.20/dpkg-deb/extract.c      2002-10-15 23:21:26.000000000 -0600
@@ -122,7 +122,7 @@
       memberlen= parseheaderlength(arh.ar_size,sizeof(arh.ar_size),
                                    debar,"member length");
       if (memberlen<0)
-        ohshit(_("file `%.250s' is corrupt - negative member length 
%zi"),debar,memberlen);
+        ohshit(FIX_PERCENT_ZI(_("file `%.250s' is corrupt - negative member length 
+%zi")),debar,memberlen);
       if (!header_done) {
         if (memcmp(arh.ar_name,"debian-binary   ",sizeof(arh.ar_name)) &&
            memcmp(arh.ar_name,"debian-binary/   ",sizeof(arh.ar_name)))
@@ -173,8 +173,8 @@
     }
 
     if (admininfo >= 2)
-      if (printf(_(" new debian package, version %s.\n"
-                 " size %ld bytes: control archive= %zi bytes.\n"),
+      if (printf(FIX_PERCENT_ZI(_(" new debian package, version %s.\n"
+                 " size %ld bytes: control archive= %zi bytes.\n")),
                  versionbuf, (long)stab.st_size, ctrllennum) == EOF ||
           fflush(stdout)) werr("stdout");
     
@@ -186,12 +186,12 @@
     l= strlen(versionbuf); if (l && versionbuf[l-1]=='\n') versionbuf[l-1]=0;
     if (!fgets(ctrllenbuf,sizeof(ctrllenbuf),ar))
       readfail(ar,debar,_("ctrl information length"));
-    if (sscanf(ctrllenbuf,"%zi%c%d",&ctrllennum,&nlc,&dummy) !=2 || nlc != '\n')
+    if (sscanf(ctrllenbuf,"%ld%c%d",&ctrllennum,&nlc,&dummy) !=2 || nlc != '\n')
       ohshit(_("archive has malformatted ctrl len `%s'"),ctrllenbuf);
 
     if (admininfo >= 2)
-      if (printf(_(" old debian package, version %s.\n"
-                 " size %ld bytes: control archive= %ld, main archive= %zi.\n"),
+      if (printf(FIX_PERCENT_ZI(_(" old debian package, version %s.\n"
+                 " size %ld bytes: control archive= %ld, main archive= %zi.\n")),
                  versionbuf, (long)stab.st_size, ctrllennum,
                  (long) (stab.st_size - ctrllennum - strlen(ctrllenbuf) - l)) == EOF 
||
           fflush(stdout)) werr("stdout");
diff -ruN dpkg-1.9.20.orig/include/dpkg.h.in dpkg-1.9.20/include/dpkg.h.in
--- dpkg-1.9.20.orig/include/dpkg.h.in  2001-05-07 16:27:09.000000000 -0600
+++ dpkg-1.9.20/include/dpkg.h.in       2002-10-15 23:21:26.000000000 -0600
@@ -161,6 +161,15 @@
 extern const char thisname[]; /* defined separately in each program */
 extern const char printforhelp[];
 
+/*** work around prehistoric Darwin libc ***/
+
+#ifdef __APPLE__
+#define FIX_PERCENT_ZI(s) fix_percent_zi(s)
+const char *fix_percent_zi(const char *s);
+#else
+#define FIX_PERCENT_ZI(s) (s)
+#endif
+
 /*** from ehandle.c ***/
 
 void push_error_handler(jmp_buf *jbufp,
diff -ruN dpkg-1.9.20.orig/lib/Makefile.in dpkg-1.9.20/lib/Makefile.in
--- dpkg-1.9.20.orig/lib/Makefile.in    2001-03-04 07:39:06.000000000 -0700
+++ dpkg-1.9.20/lib/Makefile.in 2002-10-15 23:21:26.000000000 -0600
@@ -21,7 +21,9 @@
        set -e ; cd ../optlib ; $(MAKE) libopt.a
 
 libdpkg.a: $(OBJECTS) ../optlib/libopt.a
-       $(AR) r $@ $^
+       mkdir -p optlib
+       (cd optlib && ar x ../../optlib/libopt.a)
+       $(AR) r $@ $^ optlib/*.o
        $(RANLIB) $@
 
 .PHONY: install
diff -ruN dpkg-1.9.20.orig/lib/compat.c dpkg-1.9.20/lib/compat.c
--- dpkg-1.9.20.orig/lib/compat.c       2001-04-23 05:29:30.000000000 -0600
+++ dpkg-1.9.20/lib/compat.c    2002-10-15 23:21:26.000000000 -0600
@@ -189,3 +189,25 @@
   strcpy(q,p); strcat(q,"="); putenv(q);
 }
 #endif
+
+#ifdef __APPLE__
+const char *fix_percent_zi(const char *s) {
+  static char *buf = NULL;
+  char *p;
+  if (s == NULL)
+    return NULL;
+  if (buf)
+    free(buf);
+  buf = strdup(s);
+  if (buf == NULL)
+    return s;
+  for (p = buf; *p; p++) {
+    if (p[0] == '%' && p[1] == 'z' && p[2] == 'i') {
+      p[1] = 'l';
+      p[2] = 'd';
+      p += 2;
+    }
+  }
+  return buf;
+}
+#endif
diff -ruN dpkg-1.9.20.orig/lib/mlib.c dpkg-1.9.20/lib/mlib.c
--- dpkg-1.9.20.orig/lib/mlib.c 2001-05-07 16:27:09.000000000 -0600
+++ dpkg-1.9.20/lib/mlib.c      2002-10-15 23:21:26.000000000 -0600
@@ -196,7 +196,7 @@
       break;
     case BUFFER_WRITE_FD:
       if((ret= write(data->data.i, buf, length)) < 0 && errno != EINTR)
-       ohshite(_("failed in buffer_write(fd) (%i, ret=%zi %s)"), data->data.i, ret, 
desc);
+       ohshite(FIX_PERCENT_ZI(_("failed in buffer_write(fd) (%i, ret=%zi %s)")), 
+data->data.i, ret, desc);
       break;
     case BUFFER_WRITE_NULL:
       break;
diff -ruN dpkg-1.9.20.orig/main/archives.c dpkg-1.9.20/main/archives.c
--- dpkg-1.9.20.orig/main/archives.c    2002-03-11 22:36:45.000000000 -0700
+++ dpkg-1.9.20/main/archives.c 2002-10-15 23:21:26.000000000 -0600
@@ -547,12 +547,10 @@
     debug(dbg_eachfiledetail,"tarobject SymbolicLink creating");
 #ifdef HAVE_LCHOWN
     if (lchown(fnamenewvb.buf,
-#else
-    if (chown(fnamenewvb.buf,
-#endif
            nifd->namenode->statoverride ? nifd->namenode->statoverride->uid : 
ti->UserID,
            nifd->namenode->statoverride ? nifd->namenode->statoverride->gid : 
ti->GroupID))
       ohshite(_("error setting ownership of symlink `%.255s'"),ti->Name);
+#endif
     break;
   case Directory:
     /* We've already checked for an existing directory. */
@@ -608,10 +606,8 @@
         ohshite(_("unable to make backup symlink for `%.255s'"),ti->Name);
 #ifdef HAVE_LCHOWN
       if (lchown(fnametmpvb.buf,stab.st_uid,stab.st_gid))
-#else
-      if (chown(fnametmpvb.buf,stab.st_uid,stab.st_gid))
-#endif
         ohshite(_("unable to chown backup symlink for `%.255s'"),ti->Name);
+#endif
     } else {
       debug(dbg_eachfiledetail,"tarobject nondirectory, `link' backup");
       if (link(fnamevb.buf,fnametmpvb.buf))
diff -ruN dpkg-1.9.20.orig/main/configure.c dpkg-1.9.20/main/configure.c
--- dpkg-1.9.20.orig/main/configure.c   2001-04-26 12:48:49.000000000 -0600
+++ dpkg-1.9.20/main/configure.c        2002-10-15 23:21:26.000000000 -0600
@@ -340,8 +340,10 @@
           " I do not mess up your careful work.\n"),
                     cdr.buf, cdr2.buf);
 
+#ifndef __APPLE__
             s= getenv(NOJOBCTRLSTOPENV);
             if (s && *s) {
+#endif
               fputs(_("Type `exit' when you're done.\n"),stderr);
               if (!(c1= m_fork())) {
                 s= getenv(SHELLENV);
@@ -351,11 +353,13 @@
               }
               while ((r= waitpid(c1,&status,0)) == -1 && errno == EINTR);
               if (r != c1) { onerr_abort++; ohshite(_("wait for shell failed")); }
+#ifndef __APPLE__
             } else {
               fputs(_("Don't forget to foreground (`fg') this "
                     "process when you're done !\n"),stderr);
               kill(-getpgid(0),SIGTSTP);
             }
+#endif
           }
 
         } while (!strchr("yino",cc));
diff -ruN dpkg-1.9.20.orig/main/help.c dpkg-1.9.20/main/help.c
--- dpkg-1.9.20.orig/main/help.c        2002-03-11 22:55:21.000000000 -0700
+++ dpkg-1.9.20/main/help.c     2002-10-15 23:21:26.000000000 -0600
@@ -69,7 +69,10 @@
 
 void checkpath(void) {
 /* Verify that some programs can be found in the PATH. */
-  static const char *const checklist[]= { "ldconfig", 
+  static const char *const checklist[]= {
+#ifndef __APPLE__
+    "ldconfig",
+#endif
 #ifdef USE_START_STOP_DAEMON
     "start-stop-daemon",
 #endif    
diff -ruN dpkg-1.9.20.orig/main/main.c dpkg-1.9.20/main/main.c
--- dpkg-1.9.20.orig/main/main.c        2001-04-24 09:32:39.000000000 -0600
+++ dpkg-1.9.20/main/main.c     2002-10-15 23:21:26.000000000 -0600
@@ -38,6 +38,11 @@
 #include <version.h>
 #include <myopt.h>
 
+/* FINK LOCAL begin */
+#include <sys/utsname.h>
+#include <CoreFoundation/CoreFoundation.h>
+/* FINK LOCAL end */
+
 #include "main.h"
 
 static void printversion(void) {
@@ -524,6 +529,84 @@
   }
 }
 
+/* FINK LOCAL begin */
+struct versionrevision darwin_version = {0,NULL,NULL};
+struct versionrevision macosx_version = {0,NULL,NULL};
+
+static void finkinit()
+{
+  Boolean status;
+  SInt32 errorCode;
+  CFURLRef fileURL = NULL;
+  CFDataRef resourceData = NULL;
+  CFPropertyListRef propertyList = NULL;
+  CFStringRef string;
+  static char buffer[256];     // This is static, to ensure the buffer stays around
+
+  static struct utsname ver;   // This is static, to ensure the buffer stays around
+  
+  /* Determine system version */
+  /* TODO - should maybe check if this is really Darwin? */
+  if (!uname(&ver)) {
+    darwin_version.version = ver.release;
+  }
+
+  /* Check whether this is Mac OS X, and which version of it */
+
+  fileURL = CFURLCreateWithFileSystemPath( NULL,       
+               CFSTR("/System/Library/CoreServices/SystemVersion.plist"),
+               kCFURLPOSIXPathStyle,                           
+               false );
+  if (!fileURL)
+    goto BAIL;
+  
+  /* Read the XML */
+  status = CFURLCreateDataAndPropertiesFromResource(
+               NULL,
+               fileURL,
+               &resourceData,
+               NULL,           
+               NULL,
+               &errorCode);
+  if (!status || errorCode != 0)
+    goto BAIL;
+  
+  /* Reconstitute the dictionary using the XML data. */
+  propertyList = CFPropertyListCreateFromXMLData( NULL,
+               resourceData,
+               kCFPropertyListImmutable,
+               &string);
+  if (!propertyList)
+    goto BAIL;
+  
+  /* Try to read the system version from it. */
+  status = CFDictionaryGetValueIfPresent( propertyList,
+               CFSTR("ProductVersion"),
+               (void**)&string);
+  if (!status)
+    goto BAIL;
+  
+  /* Convert into a C string */
+  status = CFStringGetCString( string,
+               buffer,
+               sizeof(buffer),
+               kCFStringEncodingISOLatin1);
+  if (!status)
+    goto BAIL;
+  
+  /* Finally link the buffer into the macosx_version struct. */
+  macosx_version.version = buffer;
+  
+BAIL:
+  // Release all of the CF objects we're responsible for.
+  if (fileURL)
+    CFRelease(fileURL);
+  if (resourceData)
+    CFRelease(resourceData);
+  if (propertyList)
+    CFRelease(propertyList);
+}
+/* FINK LOCAL end */
 
 int main(int argc, const char *const *argv) {
   jmp_buf ejbuf;
@@ -563,6 +646,9 @@
 
   setvbuf(stdout,0,_IONBF,0);
   filesdbinit();
+  /* FINK LOCAL begin */
+  finkinit();
+  /* FINK LOCAL end */
 
   actionfunction= (void (*)(const char* const*))cipaction->farg;
 
diff -ruN dpkg-1.9.20.orig/main/main.h dpkg-1.9.20/main/main.h
--- dpkg-1.9.20.orig/main/main.h        2001-04-23 16:06:03.000000000 -0600
+++ dpkg-1.9.20/main/main.h     2002-10-15 23:21:26.000000000 -0600
@@ -94,6 +94,11 @@
 extern struct packageinlist *ignoredependss;
 extern const char architecture[];
 
+/* FINK LOCAL begin */
+extern struct versionrevision darwin_version;
+extern struct versionrevision macosx_version;
+/* FINK LOCAL end */
+
 /* from filesdb.c */
 
 void filesdbinit(void);
diff -ruN dpkg-1.9.20.orig/main/packages.c dpkg-1.9.20/main/packages.c
--- dpkg-1.9.20.orig/main/packages.c    2001-04-23 02:59:02.000000000 -0600
+++ dpkg-1.9.20/main/packages.c 2002-10-15 23:21:26.000000000 -0600
@@ -332,6 +332,24 @@
   }
 }
 
+/* FINK LOCAL begin */
+static int check_pseudo_package(const struct versionrevision *versrev, const struct 
+deppossi *possi,
+                                int *interestingwarnings, struct varbuf *oemsgs) {
+
+  if (versionsatisfied3(versrev,&possi->version,possi->verrel)) {
+    return 3;
+  } else {
+    varbufaddstr(oemsgs, _("  Version of "));
+    varbufaddstr(oemsgs, possi->ed->name);
+    varbufaddstr(oemsgs, _(" on system is "));
+    varbufaddstr(oemsgs, versiondescribe(versrev, vdew_nonambig));
+    varbufaddstr(oemsgs, ".\n");
+    (*interestingwarnings)++;
+    return 0;
+  }
+}
+/* FINK LOCAL end */
+
 int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
                     struct varbuf *aemsgs) {
   int ok, matched, found, thisf, interestingwarnings;
@@ -352,6 +370,18 @@
     found= 0; /* 0=none, 1=defer, 2=withwarning, 3=ok */
     for (possi= dep->list; found != 3 && possi; possi= possi->next) {
       debug(dbg_depcondetail,"    checking possibility  -> %s",possi->ed->name);
+      /* FINK LOCAL begin */
+      if (0==strcmp(possi->ed->name,"darwin") && darwin_version.version) {
+        debug(dbg_depcondetail,"        pseudo package darwin");
+        found= 
+check_pseudo_package(&darwin_version,possi,&interestingwarnings,&oemsgs);
+        break;
+      }
+      else if (0==strcmp(possi->ed->name,"macosx") && macosx_version.version) {
+        debug(dbg_depcondetail,"        pseudo package macosx");
+        found= 
+check_pseudo_package(&macosx_version,possi,&interestingwarnings,&oemsgs);
+        break;
+      }
+      /* FINK LOCAL end */
       if (possi->cyclebreak) {
         debug(dbg_depcondetail,"      break cycle so ok and found");
         found= 3; break;
diff -ruN dpkg-1.9.20.orig/optlib/Makefile.in dpkg-1.9.20/optlib/Makefile.in
--- dpkg-1.9.20.orig/optlib/Makefile.in 2001-03-04 07:39:06.000000000 -0700
+++ dpkg-1.9.20/optlib/Makefile.in      2002-10-15 23:21:26.000000000 -0600
@@ -11,9 +11,10 @@
 
 .PHONY: all
 all:: libopt.a
-       
+
 libopt.a: $(OBJECTS)
        $(AR) r $@ $^
+       $(RANLIB) $@
 
 .PHONY: install
 install:: all
diff -ruN dpkg-1.9.20.orig/origin.fink dpkg-1.9.20/origin.fink
--- dpkg-1.9.20.orig/origin.fink        1969-12-31 17:00:00.000000000 -0700
+++ dpkg-1.9.20/origin.fink     2002-10-15 23:21:26.000000000 -0600
@@ -0,0 +1,4 @@
+Vendor: Fink
+Vendor-URL: http://fink.sourceforge.net/
+Bugs: http://fink.sourceforge.net/
+
diff -ruN dpkg-1.9.20.orig/scripts/dpkg-architecture.pl 
dpkg-1.9.20/scripts/dpkg-architecture.pl
--- dpkg-1.9.20.orig/scripts/dpkg-architecture.pl       2001-06-19 18:39:27.000000000 
-0600
+++ dpkg-1.9.20/scripts/dpkg-architecture.pl    2002-10-15 23:21:26.000000000 -0600
@@ -63,7 +63,9 @@
            's390',      's390-linux',
            'ia64',      'ia64-linux',
            'openbsd-i386', 'i386-openbsd',
-           'freebsd-i386', 'i386-freebsd');
+           'freebsd-i386', 'i386-freebsd',
+           'darwin-powerpc', 'powerpc-darwin',
+           'darwin-i386', 'i386-darwin');
 
 sub usageversion {
     print STDERR
diff -ruN dpkg-1.9.20.orig/scripts/install-info.pl dpkg-1.9.20/scripts/install-info.pl
--- dpkg-1.9.20.orig/scripts/install-info.pl    2002-02-02 11:47:33.000000000 -0700
+++ dpkg-1.9.20/scripts/install-info.pl 2002-10-15 23:21:26.000000000 -0600
@@ -133,8 +133,8 @@
         while(<IF>) {
            m/^START-INFO-DIR-ENTRY$/ && last;
            m/^INFO-DIR-SECTION (.+)$/ && do {
-               $sectiontitle = $1              unless defined($sectiontitle);
-               $sectionre = '^'.quotemeta($1)  unless defined($sectionre);
+               $sectiontitle = $1              unless ($sectiontitle);
+               $sectionre = '^'.quotemeta($1)  unless ($sectionre);
            }
        }
         while(<IF>) { last if m/^END-INFO-DIR-ENTRY$/; $asread.= $_; }
diff -ruN dpkg-1.9.20.orig/scripts/update-alternatives.pl 
dpkg-1.9.20/scripts/update-alternatives.pl
--- dpkg-1.9.20.orig/scripts/update-alternatives.pl     2002-02-02 10:03:51.000000000 
-0700
+++ dpkg-1.9.20/scripts/update-alternatives.pl  2002-10-15 23:21:26.000000000 -0600
@@ -56,7 +56,7 @@
 sub quit { print STDERR "update-alternatives: @_\n"; exit(2); }
 sub badusage { print STDERR "update-alternatives: @_\n\n"; &usageversion; exit(2); }
 
-$altdir= '/etc/alternatives';
+$altdir= '@ADMINPREFIX@/etc/alternatives';
 $admindir= $admindir . '/alternatives';
 $testmode= 0;
 $verbosemode= 0;
diff -ruN dpkg-1.9.20.orig/split/info.c dpkg-1.9.20/split/info.c
--- dpkg-1.9.20.orig/split/info.c       2001-04-26 12:48:49.000000000 -0600
+++ dpkg-1.9.20/split/info.c    2002-10-15 23:21:26.000000000 -0600
@@ -185,7 +185,7 @@
 }
 
 void print_info(const struct partinfo *pi) {
-  printf(_("%s:\n"
+  printf(FIX_PERCENT_ZI(_("%s:\n"
          "    Part format version:            %s\n"
          "    Part of package:                %s\n"
          "        ... version:                %s\n"
@@ -195,7 +195,7 @@
          "    Part number:                    %d/%d\n"
          "    Part length:                    %lu bytes\n"
          "    Part offset:                    %lu bytes\n"
-         "    Part file size (used portion):  %zi bytes\n\n"),
+         "    Part file size (used portion):  %zi bytes\n\n")),
          pi->filename,
          pi->fmtversion,
          pi->package,
diff -ruN dpkg-1.9.20.orig/utils/start-stop-daemon.c 
dpkg-1.9.20/utils/start-stop-daemon.c
--- dpkg-1.9.20.orig/utils/start-stop-daemon.c  2001-05-13 16:01:28.000000000 -0600
+++ dpkg-1.9.20/utils/start-stop-daemon.c       2002-10-16 11:11:34.000000000 -0600
@@ -30,6 +30,9 @@
 #  define OSsunos
 #elif defined(OPENBSD)
 #  define OSOpenBSD
+#elif defined(__GNUC__) && defined(__APPLE__)
+#  define OSDarwin
+#  warning OS is Darwin, NOT COMPLETE!
 #else
 #  error Unknown architecture - cannot build start-stop-daemon
 #endif
@@ -41,7 +44,7 @@
 #  include <ps.h>
 #endif
 
-#if defined(OSOpenBSD)
+#if defined(OSOpenBSD) || defined(OSDarwin)
 #include <sys/param.h>
 #include <sys/user.h>
 #include <sys/proc.h>
@@ -112,7 +115,6 @@
 static struct proc_stat_list *procset;
 #endif
 
-
 struct pid_list {
        struct pid_list *next;
        pid_t pid;
@@ -134,7 +136,11 @@
 static void push(struct pid_list **list, pid_t pid);
 static void do_help(void);
 static void parse_options(int argc, char * const *argv);
-static int pid_is_user(pid_t pid, uid_t uid);
+#if defined(OSDarwin)
+  static int pid_is_user(pid_t pid, int uid);
+#else
+  static int pid_is_user(pid_t pid, uid_t uid);
+#endif /* OSDarwin */
 static int pid_is_cmd(pid_t pid, const char *name);
 static void check(pid_t pid);
 static void do_pidfile(const char *name);
@@ -744,7 +750,7 @@
 #endif /* OSHURD */
 
 
-#if defined(OSOpenBSD)
+#if defined(OSOpenBSD) || defined(OSDarwin)
 int
 pid_is_cmd(pid_t pid, const char *name)
 {
@@ -801,11 +807,17 @@
                errx(1, "%s", errbuf);
        if ((kp = kvm_getprocs(kd, KERN_PROC_PID, pid, &nentries)) == 0)
                errx(1, "%s", kvm_geterr(kd));
+
+#if defined(OSDarwin)
+       kvm_read(kd, (u_long)&(kp->kp_eproc.e_pcred.p_ruid),
+               &proc_uid, sizeof(uid_t));
+#else
        if ( kp->kp_proc.p_cred )
                kvm_read(kd, (u_long)&(kp->kp_proc.p_cred->p_ruid),
                        &proc_uid, sizeof(uid_t));
        else
                return 0;
+#endif /* OSDarwin */
        return (proc_uid == (uid_t)uid);
 }
 



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to