pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel Remove libsetenv - obsoleted by USE_FEATURES+=se...
details: https://anonhg.NetBSD.org/pkgsrc/rev/65db0791a8ca
branches: trunk
changeset: 537721:65db0791a8ca
user: tnn <tnn%pkgsrc.org@localhost>
date: Mon Jan 14 23:08:27 2008 +0000
description:
Remove libsetenv - obsoleted by USE_FEATURES+=setenv
diffstat:
devel/Makefile | 3 +-
devel/libsetenv/DESCR | 2 -
devel/libsetenv/Makefile | 37 ---------
devel/libsetenv/PLIST | 3 -
devel/libsetenv/buildlink3.mk | 19 ----
devel/libsetenv/builtin.mk | 79 -------------------
devel/libsetenv/files/libsetenv.c | 154 --------------------------------------
devel/libsetenv/files/libsetenv.h | 4 -
8 files changed, 1 insertions(+), 300 deletions(-)
diffs (truncated from 343 to 300 lines):
diff -r 7ba22329763f -r 65db0791a8ca devel/Makefile
--- a/devel/Makefile Mon Jan 14 23:07:10 2008 +0000
+++ b/devel/Makefile Mon Jan 14 23:08:27 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.907 2008/01/06 23:51:39 wiz Exp $
+# $NetBSD: Makefile,v 1.908 2008/01/14 23:08:27 tnn Exp $
#
COMMENT= Development utilities
@@ -295,7 +295,6 @@
SUBDIR+= librsync
SUBDIR+= librxspencer
SUBDIR+= libscsi
-SUBDIR+= libsetenv
SUBDIR+= libsexy
SUBDIR+= libsexymm
SUBDIR+= libsigc++
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/DESCR
--- a/devel/libsetenv/DESCR Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-libsetenv provides implementations of setenv(3) and unsetenv(3) for
-platforms that lack them.
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/Makefile
--- a/devel/libsetenv/Makefile Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-# $NetBSD: Makefile,v 1.4 2007/09/02 10:37:04 joerg Exp $
-#
-
-DISTNAME= libsetenv-0.1
-CATEGORIES= devel
-MASTER_SITES= # empty
-DISTFILES= # empty
-
-MAINTAINER= tnn%NetBSD.org@localhost
-HOMEPAGE= http://www.pkgsrc.org/
-COMMENT= Library that provides setenv(3) and unsetenv(3) implementations
-
-NO_CHECKSUM= yes
-NO_CONFIGURE= yes
-USE_LIBTOOL= yes
-
-INSTALLATION_DIRS= include lib
-
-.include "../../mk/bsd.prefs.mk"
-
-.if ${OPSYS} == "DragonFly"
-CFLAGS+= -D_POSIX_SOURCE
-.endif
-
-do-extract:
- cp -R ${FILESDIR} ${WRKSRC}
-
-do-build:
- cd ${WRKSRC} && ${LIBTOOL} --mode=compile ${COMPILE.c} libsetenv.c
- cd ${WRKSRC} && ${LIBTOOL} --mode=link ${LINK.c} -o libsetenv.la \
- libsetenv.lo -rpath ${PREFIX}/lib
-
-do-install:
- ${INSTALL_DATA} ${WRKSRC}/libsetenv.h ${PREFIX}/include/
- ${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKSRC}/libsetenv.la ${PREFIX}/lib/
-
-.include "../../mk/bsd.pkg.mk"
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/PLIST
--- a/devel/libsetenv/PLIST Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2007/08/03 21:30:59 tnn Exp $
-include/libsetenv.h
-lib/libsetenv.la
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/buildlink3.mk
--- a/devel/libsetenv/buildlink3.mk Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-# $NetBSD: buildlink3.mk,v 1.1.1.1 2007/08/03 21:30:59 tnn Exp $
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
-LIBSETENV_BUILDLINK3_MK:= ${LIBSETENV_BUILDLINK3_MK}+
-
-.if ${BUILDLINK_DEPTH} == "+"
-BUILDLINK_DEPENDS+= libsetenv
-.endif
-
-BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nlibsetenv}
-BUILDLINK_PACKAGES+= libsetenv
-BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}libsetenv
-
-.if ${LIBSETENV_BUILDLINK3_MK} == "+"
-BUILDLINK_API_DEPENDS.libsetenv+= libsetenv>=0.1
-BUILDLINK_PKGSRCDIR.libsetenv?= ../../devel/libsetenv
-.endif # LIBSETENV_BUILDLINK3_MK
-
-BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/builtin.mk
--- a/devel/libsetenv/builtin.mk Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-# $NetBSD: builtin.mk,v 1.1.1.1 2007/08/03 21:30:59 tnn Exp $
-#
-
-BUILTIN_PKG:= libsetenv
-
-BUILTIN_FIND_FILES_VAR:= H_STDLIB
-BUILTIN_FIND_FILES.H_STDLIB= /usr/include/stdlib.h
-BUILTIN_FIND_GREP.H_STDLIB= setenv
-
-.include "../../mk/buildlink3/bsd.builtin.mk"
-
-#
-###
-### Determine if there is a built-in implementation of the package and
-### set IS_BUILTIN.<pkg> appropriately ("yes" or "no").
-###
-.if !defined(IS_BUILTIN.libsetenv)
-IS_BUILTIN.libsetenv= no
-. if empty(H_STDLIB:M__nonexistent__)
-IS_BUILTIN.libsetenv= yes
-. endif
-.endif
-MAKEVARS+= IS_BUILTIN.libsetenv
-#
-###
-### If there is a built-in implementation, then set BUILTIN_PKG.<pkg> to
-### a package name to represent the built-in package.
-###
-.if !defined(BUILTIN_PKG.libsetenv) && \
- !empty(IS_BUILTIN.libsetenv:M[yY][eE][sS])
-BUILTIN_PKG.libsetenv= libsetenv-0.1
-.endif
-MAKEVARS+= BUILTIN_PKG.libsetenv
-#
-###
-### Determine whether we should use the built-in implementation if it
-### exists, and set USE_BUILTIN.<pkg> appropriate ("yes" or "no").
-###
-.if !defined(USE_BUILTIN.libsetenv)
-. if ${PREFER.libsetenv} == "pkgsrc"
-USE_BUILTIN.libsetenv= no
-. else
-USE_BUILTIN.libsetenv= ${IS_BUILTIN.libsetenv}
-. if defined(BUILTIN_PKG.libsetenv) && \
- !empty(IS_BUILTIN.libsetenv:M[yY][eE][sS])
-USE_BUILTIN.libsetenv= yes
-. for _dep_ in ${BUILDLINK_API_DEPENDS.libsetenv}
-. if !empty(USE_BUILTIN.libsetenv:M[yY][eE][sS])
-USE_BUILTIN.libsetenv!= \
-if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libsetenv:Q}; then \
- ${ECHO} "yes"; \
-else \
- ${ECHO} "no"; \
-fi
-. endif
-. endfor
-. endif
-. endif
-.endif
-MAKEVARS+= USE_BUILTIN.libsetenv
-#
-###
-### The section below only applies if we are not including this file
-### solely to determine whether a built-in implementation exists.
-###
-CHECK_BUILTIN.libsetenv?= no
-.if !empty(CHECK_BUILTIN.libsetenv:M[nN][oO])
-
-. if !empty(USE_BUILTIN.libsetenv:M[nN][oO])
-_BLTN_LIBSETENV= -lsetenv
-. else
-_BLTN_LIBSETENV= # empty
-. endif
-BUILDLINK_LDADD.libsetenv?= ${_BLTN_LIBSETENV}
-
-CONFIGURE_ENV+= LIBSETENV=${BUILDLINK_LDADD.libsetenv:Q}
-MAKE_ENV+= LIBSETENV=${BUILDLINK_LDADD.libsetenv:Q}
-
-.endif # CHECK_BUILTIN.libsetenv
diff -r 7ba22329763f -r 65db0791a8ca devel/libsetenv/files/libsetenv.c
--- a/devel/libsetenv/files/libsetenv.c Mon Jan 14 23:07:10 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/* $NetBSD: libsetenv.c,v 1.1.1.1 2007/08/03 21:30:59 tnn Exp $ */
-
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-extern char **environ;
-
-/*
- * __findenv --
- * Returns pointer to value associated with name, if any, else NULL.
- * Sets offset to be the offset of the name/value combination in the
- * environmental array, for use by setenv(3) and unsetenv(3).
- * Explicitly removes '=' in argument name.
- *
- * This routine *should* be a static; don't use it.
- */
-static char *
-__findenv(const char *name, int *offset)
-{
- size_t len;
- const char *np;
- char **p, *c;
-
- if (name == NULL || environ == NULL)
- return NULL;
- for (np = name; *np && *np != '='; ++np)
- continue;
- len = np - name;
- for (p = environ; (c = *p) != NULL; ++p)
- if (strncmp(c, name, len) == 0 && c[len] == '=') {
- *offset = p - environ;
- return c + len + 1;
- }
- return NULL;
-}
-
-/*
- * setenv --
- * Set the value of the environmental variable "name" to be
- * "value". If rewrite is set, replace any current value.
- */
-int
-setenv(name, value, rewrite)
- const char *name;
- const char *value;
- int rewrite;
-{
- static char **saveenv; /* copy of previously allocated space */
- char *c, **newenv;
- const char *cc;
- size_t l_value, size;
- int offset;
-
- if (*value == '=') /* no `=' in value */
- ++value;
- l_value = strlen(value);
- /* find if already exists */
- if ((c = __findenv(name, &offset)) != NULL) {
- if (!rewrite)
- goto good;
- if (strlen(c) >= l_value) /* old larger; copy over */
- goto copy;
- } else { /* create new slot */
- size_t cnt;
-
- for (cnt = 0; environ[cnt]; ++cnt)
- continue;
- size = (size_t)(sizeof(char *) * (cnt + 2));
- if (saveenv == environ) { /* just increase size */
- if ((newenv = realloc(saveenv, size)) == NULL)
- goto bad;
- saveenv = newenv;
- } else { /* get new space */
- free(saveenv);
- if ((saveenv = malloc(size)) == NULL)
- goto bad;
- (void)memcpy(saveenv, environ, cnt * sizeof(char *));
- }
- environ = saveenv;
- environ[cnt + 1] = NULL;
- offset = (int)cnt;
- }
- for (cc = name; *cc && *cc != '='; ++cc) /* no `=' in name */
- continue;
- size = cc - name;
- /* name + `=' + value */
- if ((environ[offset] = malloc(size + l_value + 2)) == NULL)
- goto bad;
Home |
Main Index |
Thread Index |
Old Index