[64998] trunk/base/src
raimue at macports.org
raimue at macports.org
Thu Mar 18 17:48:36 PDT 2010
Revision: 64998
http://trac.macports.org/changeset/64998
Author: raimue at macports.org
Date: 2010-03-18 17:48:35 -0700 (Thu, 18 Mar 2010)
Log Message:
-----------
Move realpath extension from macports1.0 to pextlib1.0
Modified Paths:
--------------
trunk/base/src/macports1.0/Makefile
trunk/base/src/macports1.0/macports.c
trunk/base/src/pextlib1.0/Makefile
trunk/base/src/pextlib1.0/Pextlib.c
Added Paths:
-----------
trunk/base/src/pextlib1.0/realpath.c
trunk/base/src/pextlib1.0/realpath.h
Removed Paths:
-------------
trunk/base/src/macports1.0/realpath.c
trunk/base/src/macports1.0/realpath.h
Modified: trunk/base/src/macports1.0/Makefile
===================================================================
--- trunk/base/src/macports1.0/Makefile 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/macports1.0/Makefile 2010-03-19 00:48:35 UTC (rev 64998)
@@ -1,6 +1,6 @@
SRCS= macports.tcl macports_dlist.tcl macports_util.tcl \
macports_autoconf.tcl macports_index.tcl macports_fastload.tcl
-OBJS= macports.o get_systemconfiguration_proxies.o realpath.o sysctl.o
+OBJS= macports.o get_systemconfiguration_proxies.o sysctl.o
SHLIB_NAME= MacPorts${SHLIB_SUFFIX}
INSTALLDIR= ${DESTDIR}${TCL_PACKAGE_DIR}/macports1.0
Modified: trunk/base/src/macports1.0/macports.c
===================================================================
--- trunk/base/src/macports1.0/macports.c 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/macports1.0/macports.c 2010-03-19 00:48:35 UTC (rev 64998)
@@ -38,7 +38,6 @@
#include <tcl.h>
#include "get_systemconfiguration_proxies.h"
-#include "realpath.h"
#include "sysctl.h"
static int
@@ -59,7 +58,6 @@
return TCL_ERROR;
Tcl_CreateObjCommand(interp, "macports::version", macports__version, NULL, NULL);
Tcl_CreateObjCommand(interp, "get_systemconfiguration_proxies", GetSystemConfigurationProxiesCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "realpath", RealpathCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "sysctl", SysctlCmd, NULL, NULL);
if (Tcl_PkgProvide(interp, "macports", "1.0") != TCL_OK)
return TCL_ERROR;
Deleted: trunk/base/src/macports1.0/realpath.c
===================================================================
--- trunk/base/src/macports1.0/realpath.c 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/macports1.0/realpath.c 2010-03-19 00:48:35 UTC (rev 64998)
@@ -1,80 +0,0 @@
-/*
- * realpath.c
- * $Id$
- *
- * Copyright (c) 2009 The MacPorts Project.
- * 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 MacPorts Team 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
- */
-
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <tcl.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "realpath.h"
-
-/**
- * realpath command entry point.
- *
- * @param interp current interpreter
- * @param objc number of parameters
- * @param objv parameters
- */
-int RealpathCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- const char error_message[] = "realpath failed: ";
- Tcl_Obj *tcl_result;
- char *path;
- char *rpath = malloc(PATH_MAX+1);
- char *res;
-
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "path");
- return TCL_ERROR;
- }
-
- path = Tcl_GetString(objv[1]);
- res = realpath(path, rpath);
- if (!res) {
- free(rpath);
- tcl_result = Tcl_NewStringObj(error_message, sizeof(error_message) - 1);
- Tcl_AppendObjToObj(tcl_result, Tcl_NewStringObj(strerror(errno), -1));
- Tcl_SetObjResult(interp, tcl_result);
- return TCL_ERROR;
- } else {
- tcl_result = Tcl_NewStringObj(rpath, -1);
- }
-
- Tcl_SetObjResult(interp, tcl_result);
- return TCL_OK;
-}
Deleted: trunk/base/src/macports1.0/realpath.h
===================================================================
--- trunk/base/src/macports1.0/realpath.h 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/macports1.0/realpath.h 2010-03-19 00:48:35 UTC (rev 64998)
@@ -1,49 +0,0 @@
-/*
- * realpath.h
- * $Id$
- *
- * Copyright (c) 2009 The MacPorts Project.
- * 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 MacPorts Team 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
- */
-
-#ifndef _REALPATH_H
-#define _REALPATH_H
-
-#include <tcl.h>
-
-/**
- * A native command to handle a limitation of old versions of Tcl.
- *
- * The syntax is:
- * realpath path
- * Normalize path like file normalize does.
- * Fixes a problem with Tcl installations affected by not defining HAVE_REALPATH (this is
- * the case with the Tcl in OS X shipped prior to 10.6)
- */
-int RealpathCmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
-
-#endif /* _REALPATH_H */
Modified: trunk/base/src/pextlib1.0/Makefile
===================================================================
--- trunk/base/src/pextlib1.0/Makefile 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/pextlib1.0/Makefile 2010-03-19 00:48:35 UTC (rev 64998)
@@ -3,7 +3,7 @@
fs-traverse.o strcasecmp.o vercomp.o filemap.o \
sha1cmd.o curl.o rmd160cmd.o sha256cmd.o readline.o uid.o \
tracelib.o tty.o readdir.o pipe.o flock.o \
- system.o mktemp.o
+ system.o mktemp.o realpath.o
SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/pextlib1.0
Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c 2010-03-19 00:48:18 UTC (rev 64997)
+++ trunk/base/src/pextlib1.0/Pextlib.c 2010-03-19 00:48:35 UTC (rev 64998)
@@ -76,6 +76,7 @@
#include "flock.h"
#include "system.h"
#include "mktemp.h"
+#include "realpath.h"
#if HAVE_CRT_EXTERNS_H
#include <crt_externs.h>
@@ -491,6 +492,7 @@
Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "unsetenv", UnsetEnvCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "lchown", lchownCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "realpath", RealpathCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "readline", ReadlineCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "rl_history", RLHistoryCmd, NULL, NULL);
Copied: trunk/base/src/pextlib1.0/realpath.c (from rev 64968, trunk/base/src/macports1.0/realpath.c)
===================================================================
--- trunk/base/src/pextlib1.0/realpath.c (rev 0)
+++ trunk/base/src/pextlib1.0/realpath.c 2010-03-19 00:48:35 UTC (rev 64998)
@@ -0,0 +1,80 @@
+/*
+ * realpath.c
+ * $Id$
+ *
+ * Copyright (c) 2009 The MacPorts Project.
+ * 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 MacPorts Team 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <tcl.h>
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "realpath.h"
+
+/**
+ * realpath command entry point.
+ *
+ * @param interp current interpreter
+ * @param objc number of parameters
+ * @param objv parameters
+ */
+int RealpathCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+ const char error_message[] = "realpath failed: ";
+ Tcl_Obj *tcl_result;
+ char *path;
+ char *rpath = malloc(PATH_MAX+1);
+ char *res;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "path");
+ return TCL_ERROR;
+ }
+
+ path = Tcl_GetString(objv[1]);
+ res = realpath(path, rpath);
+ if (!res) {
+ free(rpath);
+ tcl_result = Tcl_NewStringObj(error_message, sizeof(error_message) - 1);
+ Tcl_AppendObjToObj(tcl_result, Tcl_NewStringObj(strerror(errno), -1));
+ Tcl_SetObjResult(interp, tcl_result);
+ return TCL_ERROR;
+ } else {
+ tcl_result = Tcl_NewStringObj(rpath, -1);
+ }
+
+ Tcl_SetObjResult(interp, tcl_result);
+ return TCL_OK;
+}
Copied: trunk/base/src/pextlib1.0/realpath.h (from rev 64968, trunk/base/src/macports1.0/realpath.h)
===================================================================
--- trunk/base/src/pextlib1.0/realpath.h (rev 0)
+++ trunk/base/src/pextlib1.0/realpath.h 2010-03-19 00:48:35 UTC (rev 64998)
@@ -0,0 +1,49 @@
+/*
+ * realpath.h
+ * $Id$
+ *
+ * Copyright (c) 2009 The MacPorts Project.
+ * 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 MacPorts Team 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+ */
+
+#ifndef _REALPATH_H
+#define _REALPATH_H
+
+#include <tcl.h>
+
+/**
+ * A native command to handle a limitation of old versions of Tcl.
+ *
+ * The syntax is:
+ * realpath path
+ * Normalize path like file normalize does.
+ * Fixes a problem with Tcl installations affected by not defining HAVE_REALPATH (this is
+ * the case with the Tcl in OS X shipped prior to 10.6)
+ */
+int RealpathCmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]);
+
+#endif /* _REALPATH_H */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100318/09f1dab0/attachment-0001.html>
More information about the macports-changes
mailing list