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: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: pkg/45047: pkgtools/pkg_install minix support
Date: Fri, 17 Jun 2011 19:05:14 +0200
On Fri, Jun 17, 2011 at 02:55:02PM +0000, Thomas Cort wrote:
> 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
Why aren't the checks here fatal?
Joerg
Home |
Main Index |
Thread Index |
Old Index