pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/45047: pkgtools/pkg_install minix support



The following reply was made to PR pkg/45047; it has been noted by GNATS.

From: Thomas Cort <tcort%minix3.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/45047: pkgtools/pkg_install minix support
Date: Fri, 17 Jun 2011 10:50:48 -0400

 Based on the feedback, I've updated the patch. The assert() statements
 were removed, the code cleaned up slightly, and non-Minix specific
 changes were moved into their own problem reports.
 
 The circular dependency detection patch was moved to pkg/45077.
 The destdir patch was moved to pkg/45078.
 
 --- a/pkg_install/files/configure.ac   Thu Jun 16 19:34:17 2011
 +++ b/pkg_install/files/configure.ac   Thu Jun 16 19:34:31 2011
 @@ -16,7 +16,7 @@
  AC_PROG_INSTALL
  AC_PROG_LN_S
  AC_PROG_RANLIB
 -AC_CHECK_PROG(AR, ar, ar)
 +AC_CHECK_PROGS(AR, [gar ar])
  
  AC_PATH_PROG(CHMOD, chmod)
  AC_PATH_PROG(CMP, cmp)
 --- a/pkg_install/files/add/perform.c  Thu Jun 16 19:34:17 2011
 +++ b/pkg_install/files/add/perform.c  Thu Jun 16 19:34:31 2011
 @@ -858,18 +858,63 @@
        free(text);
  }
  
 +#ifdef __minix
 +static int
 +normalise_version(char *release, char *version)
 +{
 +      char actual_version[50];
 +      int l1, l2;
 +
 +      if (release == NULL || version == NULL) {
 +              warnx("release or version information not present");
 +              return -1;
 +      }
 +
 +      l1 = strlen(release);
 +      l2 = strlen(version);
 +
 +      if (l1 + l2 + 2 >= sizeof(actual_version)) {
 +              warnx("not enough space to normalise version");
 +              return -1;
 +      }
 +
 +      if (l1 > 0 && l2 > 0) {
 +              snprintf(actual_version, sizeof(actual_version),
 +                      "%s.%s", release, version);
 +      } else if (strlen(release) > 0) {
 +              strncpy(actual_version, release, sizeof(actual_version)-1);
 +      } else if (strlen(version) > 0) {
 +              strncpy(actual_version, version, sizeof(actual_version)-1);
 +      } else {
 +              warnx("cannot determine version information");
 +              return -1;
 +      }
 +
 +      strcpy(release, actual_version);
 +      version[0] = '\0';
 +
 +      return 0;
 +}
 +#endif
 +
  /*
   * Reduce the result from uname(3) to a canonical form.
   */
 -static void
 +static int
  normalise_platform(struct utsname *host_name)
  {
 +      int rc = 0;
 +
  #ifdef NUMERIC_VERSION_ONLY
        size_t span;
  
        span = strspn(host_name->release, "0123456789.");
        host_name->release[span] = '\0';
  #endif
 +#ifdef __minix
 +      rc = normalise_version(host_name->release, host_name->version);
 +#endif
 +      return rc;
  }
  
  /*
 @@ -892,7 +937,9 @@
                }
        }
  
 -      normalise_platform(&host_uname);
 +      if (normalise_platform(&host_uname)) {
 +              return -1;
 +      }
  
        if (OverrideMachine != NULL)
                effective_arch = OverrideMachine;
 --- a/pkg_install/Makefile     Thu Jun 16 19:34:17 2011
 +++ b/pkg_install/Makefile     Thu Jun 16 19:34:31 2011
 @@ -142,6 +142,10 @@
  CPPFLAGS+=    -I${WRKDIR}/libfetch
  LDFLAGS+=     -L${WRKDIR}/libfetch
  
 +.  if ${OPSYS} == "Minix"
 +LIBS+=                -larchive -lbz2 -lz
 +.  endif
 +
  CONFIGURE_ENV+=       LIBS=${LIBS:Q}
  
  do-extract:
 


Home | Main Index | Thread Index | Old Index