[53509] branches/gsoc09-logging/base
enl at macports.org
enl at macports.org
Tue Jul 7 01:21:01 PDT 2009
Revision: 53509
http://trac.macports.org/changeset/53509
Author: enl at macports.org
Date: 2009-07-07 01:20:59 -0700 (Tue, 07 Jul 2009)
Log Message:
-----------
Merge from trunc + little code cleanups
Modified Paths:
--------------
branches/gsoc09-logging/base/Makefile.in
branches/gsoc09-logging/base/Mk/macports.autoconf.mk.in
branches/gsoc09-logging/base/aclocal.m4
branches/gsoc09-logging/base/configure
branches/gsoc09-logging/base/configure.ac
branches/gsoc09-logging/base/doc/macports.conf.5
branches/gsoc09-logging/base/doc/macports.conf.in
branches/gsoc09-logging/base/doc/portfile.7
branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck
branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings
branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl
branches/gsoc09-logging/base/src/macports1.0/macports.tcl
branches/gsoc09-logging/base/src/package1.0/portpkg.tcl
branches/gsoc09-logging/base/src/pextlib1.0/Makefile
branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c
branches/gsoc09-logging/base/src/pextlib1.0/curl.c
branches/gsoc09-logging/base/src/pextlib1.0/filemap.c
branches/gsoc09-logging/base/src/pextlib1.0/md5cmd.c
branches/gsoc09-logging/base/src/pextlib1.0/md_wrappers.h
branches/gsoc09-logging/base/src/pextlib1.0/rmd160cmd.c
branches/gsoc09-logging/base/src/pextlib1.0/sha1cmd.c
branches/gsoc09-logging/base/src/pextlib1.0/strsed.c
branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
branches/gsoc09-logging/base/src/port/port.tcl
branches/gsoc09-logging/base/src/port1.0/portbuild.tcl
branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl
branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl
branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl
branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl
branches/gsoc09-logging/base/src/port1.0/portfetch.tcl
branches/gsoc09-logging/base/src/port1.0/portlint.tcl
branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl
branches/gsoc09-logging/base/src/port1.0/portmain.tcl
branches/gsoc09-logging/base/src/port1.0/porttrace.tcl
branches/gsoc09-logging/base/src/port1.0/portutil.tcl
branches/gsoc09-logging/base/src/registry1.0/portimage.tcl
branches/gsoc09-logging/base/src/registry1.0/receipt_flat.tcl
branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in
Added Paths:
-----------
branches/gsoc09-logging/base/src/pextlib1.0/pipe.c
branches/gsoc09-logging/base/src/pextlib1.0/pipe.h
branches/gsoc09-logging/base/src/pextlib1.0/readdir.c
branches/gsoc09-logging/base/src/pextlib1.0/readdir.h
branches/gsoc09-logging/base/src/pextlib1.0/strsed.h
branches/gsoc09-logging/base/src/pextlib1.0/sysctl.c
branches/gsoc09-logging/base/src/pextlib1.0/sysctl.h
Removed Paths:
-------------
branches/gsoc09-logging/base/Mk/macports.upgrade.mk
branches/gsoc09-logging/base/portmgr/bots/
branches/gsoc09-logging/base/portmgr/dmg/preflight
Property Changed:
----------------
branches/gsoc09-logging/base/
branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck
branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings
branches/gsoc09-logging/base/portmgr/jobs/mirror_macports.sh
branches/gsoc09-logging/base/portmgr/jobs/org.macports.PortIndexRegen.plist
branches/gsoc09-logging/base/portmgr/jobs/org.macports.mprsyncup.plist
branches/gsoc09-logging/base/portmgr/jobs/portfile_lint.pl
branches/gsoc09-logging/base/portmgr/jobs/portfile_mirror.pl
branches/gsoc09-logging/base/src/dep_map_clean.tcl
branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl
branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
branches/gsoc09-logging/base/src/pextlib1.0/tracelib.h
branches/gsoc09-logging/base/src/registry2.0/portimage.tcl
branches/gsoc09-logging/base/src/registry2.0/portuninstall.tcl
branches/gsoc09-logging/base/src/registry2.0/registry_util.tcl
branches/gsoc09-logging/base/src/tclobjc1.0/MPMethodSignatureExtensions.h
branches/gsoc09-logging/base/src/tclobjc1.0/MPMethodSignatureExtensions.m
branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in
branches/gsoc09-logging/base/src/tclobjc1.0/objc_encoding.h
branches/gsoc09-logging/base/src/tclobjc1.0/objc_encoding.m
branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc.h
branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc.m
branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc_types.h
branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc_types.m
branches/gsoc09-logging/base/src/thread2.6.diff
branches/gsoc09-logging/base/src/upgrade_sources_conf_default.tcl
Property changes on: branches/gsoc09-logging/base
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/gsoc08-privileges/base:37343-46937
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:51231-52216
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
+ /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:51231-53504
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
Modified: branches/gsoc09-logging/base/Makefile.in
===================================================================
--- branches/gsoc09-logging/base/Makefile.in 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/Makefile.in 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1,5 +1,6 @@
# $Id$
+PATH = @PATH_CLEANED@
SUBDIR = doc src
DISTDIR = dist
DISTVER =
@@ -28,15 +29,10 @@
echo "Source tree not configured. Use ./configure" ; \
fi
-
-include Mk/macports.upgrade.mk
-
-install:: upgrade
- [ ! -f ${sysconfdir}/macports/mp_version ] || rm -vf ${sysconfdir}/macports/mp_version
-
include Mk/macports.subdir.mk
install::
+ [ ! -f ${sysconfdir}/macports/mp_version ] || rm -vf ${sysconfdir}/macports/mp_version
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 setupenv.bash $(DESTDIR)${datadir}/macports/
# Only run these scripts when not building in a destroot
ifeq ($(DESTDIR),)
Modified: branches/gsoc09-logging/base/Mk/macports.autoconf.mk.in
===================================================================
--- branches/gsoc09-logging/base/Mk/macports.autoconf.mk.in 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/Mk/macports.autoconf.mk.in 2009-07-07 08:20:59 UTC (rev 53509)
@@ -32,7 +32,7 @@
TCL_CC = @TCL_CC@
SHLIB_LD = @SHLIB_LD@
STLIB_LD = @STLIB_LD@
-LDFLAGS = -L/usr/local/lib @LDFLAGS@
+LDFLAGS = @LDFLAGS@
SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ ${LDFLAGS}
SHLIB_SUFFIX = @SHLIB_SUFFIX@
TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
Deleted: branches/gsoc09-logging/base/Mk/macports.upgrade.mk
===================================================================
--- branches/gsoc09-logging/base/Mk/macports.upgrade.mk 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/Mk/macports.upgrade.mk 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1,115 +0,0 @@
-# $Id$
-
-UPGRADECHECK = $(DESTDIR)${localstatedir}/macports/.mprename
-
-
-upgrade::
- @echo ""; echo "Upgrading your existing MacPorts installation to the new namespace if necessary:"; echo ""
-
-# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now be installed onto
-# ${TCL_PACKAGE_DIR}/macports1.0 with new names:
- [ ! -d $(DESTDIR)${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -rf $(DESTDIR)${TCL_PACKAGE_DIR}/darwinports1.0
-
-# MacPorts base files in ${datadir} are also safely removed as new ones are always installed, and onto a their new location in this case too:
- [ ! -d $(DESTDIR)${datadir}/darwinports ] || rm -rf $(DESTDIR)${datadir}/darwinports
-
-# Old version file can be safely deleted, as it was already used to start this upgrade and a new one will be installed into the new location:
- [ ! -f $(DESTDIR)${sysconfdir}/ports/dp_version ] || rm -vf $(DESTDIR)${sysconfdir}/ports/dp_version
-
-# Old ports.conf(5) man page is removed:
- [ ! -f $(DESTDIR)${prefix}/share/man/man5/ports.conf.5 ] || rm -vf $(DESTDIR)${prefix}/share/man/man5/ports.conf.5
-
-# Conf files directory is renamed:
- [ ! -d $(DESTDIR)${sysconfdir}/ports ] || mv -v $(DESTDIR)${sysconfdir}/ports $(DESTDIR)${sysconfdir}/macports
-
-# Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first:
- [ -d $(DESTDIR)${localstatedir}/macports ] || mkdir -vp $(DESTDIR)${localstatedir}/macports
- for dir in distfiles packages receipts software; do \
- [ ! -d $(DESTDIR)${localstatedir}/db/dports/$${dir} ] || mv -v $(DESTDIR)${localstatedir}/db/dports/$${dir} $(DESTDIR)${localstatedir}/macports ; \
- done
-
-# Move the default ports tree to the new layout:
- [ ! -d $(DESTDIR)${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ] || { mkdir -vp \
- $(DESTDIR)${localstatedir}/macports/sources/rsync.macports.org/release && mv -v \
- $(DESTDIR)${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports $(DESTDIR)${localstatedir}/macports/sources/rsync.macports.org/release/ports ; \
- }
-
-# Open up receipts and upgrade any paths in them containing old conventions to the new namespace:
- for receipt in $(DESTDIR)${localstatedir}/macports/receipts/*/*/receipt.bz2 ; do [ ! \( -f $${receipt} -a ! -f $${receipt}.mpsaved \) ] || { \
- cp -v $${receipt} $${receipt}.mpsaved && { \
- $(BZIP2) -q -dc $${receipt} | sed 's/db\/dports/macports/g' | $(BZIP2) -q -zf > $${receipt}.new ; \
- } && mv -v $${receipt}.new $${receipt} ; \
- }; done
-
-# Check for existance of the main configuration file and perform a couple of replacements on it, backing it up first:
-## 1) new default path up to our configuration files (referenced through other variables);
-## 2) new default value for the portdbpath variable;
-## 3) new MacPorts rsync server;
-## 4) new default value for the base tree;
-## 5) new default value for trunk's base sources for users who have it (some do);
-## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
-## 7) useless --delete option is removed from the default rsync flags (--delete is implied by --delete-after);
-## 8) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
- [ ! \( -f $(DESTDIR)${sysconfdir}/macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || { \
- mv -v $(DESTDIR)${sysconfdir}/macports/ports.conf $(DESTDIR)${sysconfdir}/macports/macports.conf.mpsaved; \
- sed 's/etc\/ports/etc\/macports/g' $(DESTDIR)${sysconfdir}/macports/macports.conf.mpsaved > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/db\/dports/macports/g' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/darwinports/macports/g' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/dpupdate1\/base/release\/base/g' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed '/^rsync_options/s/"\(.*\)"/\1/' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/ --delete / /' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- sed 's/ ports.conf(5)/ macports.conf(5)/g' $(DESTDIR)${sysconfdir}/macports/macports.conf > $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/macports.conf.tmp $(DESTDIR)${sysconfdir}/macports/macports.conf; \
- }
-
-# Check for existance of the main sources file and perform a couple of replacements on it, backing it up first:
-## 1) new MacPorts rsync server;
-## 2) new default value for the ports tree.
- [ ! \( -f $(DESTDIR)${sysconfdir}/macports/sources.conf -a ! -f ${UPGRADECHECK} \) ] || { \
- cp -v $(DESTDIR)${sysconfdir}/macports/sources.conf $(DESTDIR)${sysconfdir}/macports/sources.conf.mpsaved; \
- sed 's/darwinports/macports/g' $(DESTDIR)${sysconfdir}/macports/sources.conf > $(DESTDIR)${sysconfdir}/macports/sources.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/sources.conf.tmp $(DESTDIR)${sysconfdir}/macports/sources.conf; \
- sed 's/dpupdate\/dports/release\/ports\//g' $(DESTDIR)${sysconfdir}/macports/sources.conf > $(DESTDIR)${sysconfdir}/macports/sources.conf.tmp && \
- mv -v $(DESTDIR)${sysconfdir}/macports/sources.conf.tmp $(DESTDIR)${sysconfdir}/macports/sources.conf; \
- }
-
-# Check for existance of a personal configuration file and perform a couple of replacements on it, backing it up first:
-## 1) new default path up to our configuration files (referenced through other variables);
-## 2) new default value for the portdbpath variable;
-## 3) new MacPorts rsync server;
-## 4) new default value for the base tree;
-## 5) new default value for trunk's base sources for users who have it (some do);
-## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
-## 7) useless --delete option is removed from the default rsync flags (--delete is implied by --delete-after);
-## 8) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
- [ ! \( -f "$(DESTDIR)$${HOME}/.macports/ports.conf" -a ! -f ${UPGRADECHECK} \) ] || { \
- mv -v "$(DESTDIR)$${HOME}/.macports/ports.conf" "$(DESTDIR)$${HOME}/.macports/macports.conf.mpsaved"; \
- sed 's/etc\/ports/etc\/macports/g' "$(DESTDIR)$${HOME}/.macports/macports.conf.mpsaved" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/db\/dports/macports/g' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/darwinports/macports/g' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/dpupdate1\/base/release\/base/g' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed '/^rsync_options/s/"\(.*\)"/\1/' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/ --delete / /' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- sed 's/ ports.conf(5)/ macports.conf(5)/g' "$(DESTDIR)$${HOME}/.macports/macports.conf" > "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" && \
- mv -v "$(DESTDIR)$${HOME}/.macports/macports.conf.tmp" "$(DESTDIR)$${HOME}/.macports/macports.conf"; \
- }
-
-# Upgrade success announcement (meaning we're done ;):
- @[ -f ${UPGRADECHECK} ] || { echo ""; echo "MacPorts installation successfully upgraded from the old DarwinPorts namespace!"; echo ""; \
- echo "MacPorts rename update done!" > ${UPGRADECHECK} ; }
Modified: branches/gsoc09-logging/base/aclocal.m4
===================================================================
--- branches/gsoc09-logging/base/aclocal.m4 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/aclocal.m4 2009-07-07 08:20:59 UTC (rev 53509)
@@ -288,7 +288,22 @@
])
+# MP_CHECK_OLDLAYOUT
+#---------------------------------------
+AC_DEFUN([MP_CHECK_OLDLAYOUT],[
+ dnl Bail if there is an existing install of DP/MP older than 1.5
+ AC_MSG_CHECKING([that any existing MacPorts install can be upgraded])
+
+ eval dpversionfile="${sysconfdir}/ports/dp_version"
+ if test -f $dpversionfile; then
+ AC_MSG_ERROR([Existing MacPorts or DarwinPorts install is too old to be upgraded. Install MacPorts 1.7.1 first.])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+
+ ])
+
# MP_CHECK_NOROOTPRIVILEGES
#-------------------------------------------------
AC_DEFUN([MP_CHECK_NOROOTPRIVILEGES],[
@@ -489,40 +504,22 @@
# MP_UNIVERSAL_OPTIONS
#---------------------------------------
AC_DEFUN([MP_UNIVERSAL_OPTIONS],[
+ AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
- AC_ARG_WITH(universal-target,[AS_HELP_STRING([--with-universal-target=MDT],[Universal MACOSX_DEPLOYMENT_TARGET version])], UNIVERSAL_TARGET=${withval})
- AC_ARG_WITH(universal-sysroot,[AS_HELP_STRING([--with-universal-sysroot=SDK],[Universal SDK sysroot (with complete path)])], UNIVERSAL_SYSROOT=${withval})
- AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
+ if test "x$UNIVERSAL_ARCHS" = "x"; then
+ case "$MACOSX_VERSION" in
+ 10.[[0-5]]*)
+ UNIVERSAL_ARCHS="i386 ppc"
+ ;;
+ *)
+ UNIVERSAL_ARCHS="x86_64 i386"
+ ;;
+ esac
+ fi
- MACOSX_MAJOR_VERSION=`$SW_VERS -productVersion | cut -f-2 -d.`
-
- if test "x$UNIVERSAL_TARGET" = "x"; then
- UNIVERSAL_TARGET=${MACOSX_MAJOR_VERSION}
- fi
-
- if test "x$UNIVERSAL_SYSROOT" = "x"; then
- if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
- UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
- else
- UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
- fi
- fi
-
- if test "x$UNIVERSAL_ARCHS" = "x"; then
- UNIVERSAL_ARCHS="ppc i386"
- fi
-
- AC_MSG_CHECKING([for Universal MDT version])
- AC_MSG_RESULT([$UNIVERSAL_TARGET])
- AC_SUBST(UNIVERSAL_TARGET)
-
- AC_MSG_CHECKING([for Universal SDK sysroot])
- AC_MSG_RESULT([$UNIVERSAL_SYSROOT])
- AC_SUBST(UNIVERSAL_SYSROOT)
-
- AC_MSG_CHECKING([for Universal CPU architectures])
- AC_MSG_RESULT([$UNIVERSAL_ARCHS])
- AC_SUBST(UNIVERSAL_ARCHS)
+ AC_MSG_CHECKING([for Universal CPU architectures])
+ AC_MSG_RESULT([$UNIVERSAL_ARCHS])
+ AC_SUBST(UNIVERSAL_ARCHS)
])
# MP_LIB_MD5
@@ -829,6 +826,7 @@
fi
done
PATH=$newPATH; export PATH
+ AC_SUBST(PATH_CLEANED,$newPATH)
prefix=$oldprefix
])
Modified: branches/gsoc09-logging/base/configure
===================================================================
--- branches/gsoc09-logging/base/configure 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/configure 2009-07-07 08:20:59 UTC (rev 53509)
@@ -676,8 +676,6 @@
READLINK_IS_NOT_P1003_1A
CPP
UNIVERSAL_ARCHS
-UNIVERSAL_SYSROOT
-UNIVERSAL_TARGET
MPFRAMEWORKSDIR
MPAPPLICATIONSDIR
DSTMODE
@@ -766,6 +764,7 @@
XCODE_SELECT
DEFAULTS
SW_VERS
+PATH_CLEANED
MACPORTS_VERSION
target_os
target_vendor
@@ -831,8 +830,6 @@
with_shared_directory
with_applications_dir
with_frameworks_dir
-with_universal_target
-with_universal_sysroot
with_universal_archs
enable_readline
with_tcl
@@ -863,6 +860,7 @@
TAR
MAKE
GNUTAR
+BSDMAKE
GNUMAKE
BZIP2
XAR
@@ -1522,10 +1520,6 @@
--with-shared-directory Use 0775 permissions for installed directories
--with-applications-dir Applications installation directory.
--with-frameworks-dir Frameworks installation directory.
- --with-universal-target=MDT
- Universal MACOSX_DEPLOYMENT_TARGET version
- --with-universal-sysroot=SDK
- Universal SDK sysroot (with complete path)
--with-universal-archs="CPU"
Universal CPU architectures (space separated)
--with-tcl directory containing tcl configuration (tclConfig.sh)
@@ -1557,6 +1551,7 @@
TAR path to tar command
MAKE path to make command
GNUTAR path to gnutar command
+ BSDMAKE path to bsdmake/pmake command
GNUMAKE path to gnumake command
BZIP2 path to bzip2 command
XAR path to xar command
@@ -2204,6 +2199,8 @@
fi
done
PATH=$newPATH; export PATH
+ PATH_CLEANED=$newPATH
+
prefix=$oldprefix
@@ -4606,8 +4603,10 @@
fi
-# Extract the first word of "bsdmake", so it can be a program name with args.
-set dummy bsdmake; ac_word=$2
+for ac_prog in bsdmake pmake
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if test "${ac_cv_path_BSDMAKE+set}" = set; then
@@ -4646,6 +4645,9 @@
fi
+ test -n "$BSDMAKE" && break
+done
+
# Extract the first word of "make", so it can be a program name with args.
set dummy make; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -5191,6 +5193,7 @@
+
# Extract the first word of "sed", so it can be a program name with args.
set dummy sed; ac_word=$2
{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8076,58 +8079,26 @@
# Check for universal options
-
-# Check whether --with-universal-target was given.
-if test "${with_universal_target+set}" = set; then
- withval=$with_universal_target; UNIVERSAL_TARGET=${withval}
-fi
-
-
-# Check whether --with-universal-sysroot was given.
-if test "${with_universal_sysroot+set}" = set; then
- withval=$with_universal_sysroot; UNIVERSAL_SYSROOT=${withval}
-fi
-
-
# Check whether --with-universal-archs was given.
if test "${with_universal_archs+set}" = set; then
withval=$with_universal_archs; UNIVERSAL_ARCHS=${withval}
fi
- MACOSX_MAJOR_VERSION=`$SW_VERS -productVersion | cut -f-2 -d.`
+ if test "x$UNIVERSAL_ARCHS" = "x"; then
+ case "$MACOSX_VERSION" in
+ 10.[0-5]*)
+ UNIVERSAL_ARCHS="i386 ppc"
+ ;;
+ *)
+ UNIVERSAL_ARCHS="x86_64 i386"
+ ;;
+ esac
+ fi
- if test "x$UNIVERSAL_TARGET" = "x"; then
- UNIVERSAL_TARGET=${MACOSX_MAJOR_VERSION}
- fi
-
- if test "x$UNIVERSAL_SYSROOT" = "x"; then
- if test "${MACOSX_MAJOR_VERSION}" = "10.4"; then
- UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}u.sdk
- else
- UNIVERSAL_SYSROOT=${DEVELOPER_DIR}/SDKs/MacOSX${MACOSX_MAJOR_VERSION}.sdk
- fi
- fi
-
- if test "x$UNIVERSAL_ARCHS" = "x"; then
- UNIVERSAL_ARCHS="ppc i386"
- fi
-
- { $as_echo "$as_me:$LINENO: checking for Universal MDT version" >&5
-$as_echo_n "checking for Universal MDT version... " >&6; }
- { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_TARGET" >&5
-$as_echo "$UNIVERSAL_TARGET" >&6; }
-
-
- { $as_echo "$as_me:$LINENO: checking for Universal SDK sysroot" >&5
-$as_echo_n "checking for Universal SDK sysroot... " >&6; }
- { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_SYSROOT" >&5
-$as_echo "$UNIVERSAL_SYSROOT" >&6; }
-
-
- { $as_echo "$as_me:$LINENO: checking for Universal CPU architectures" >&5
+ { $as_echo "$as_me:$LINENO: checking for Universal CPU architectures" >&5
$as_echo_n "checking for Universal CPU architectures... " >&6; }
- { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_ARCHS" >&5
+ { $as_echo "$as_me:$LINENO: result: $UNIVERSAL_ARCHS" >&5
$as_echo "$UNIVERSAL_ARCHS" >&6; }
@@ -11053,6 +11024,24 @@
prefix=$ac_default_prefix
fi
+# Check if there's an existing DP/MP install too old to upgrade
+
+
+ { $as_echo "$as_me:$LINENO: checking that any existing MacPorts install can be upgraded" >&5
+$as_echo_n "checking that any existing MacPorts install can be upgraded... " >&6; }
+
+ eval dpversionfile="${sysconfdir}/ports/dp_version"
+ if test -f $dpversionfile; then
+ { { $as_echo "$as_me:$LINENO: error: Existing MacPorts or DarwinPorts install is too old to be upgraded. Install MacPorts 1.7.1 first." >&5
+$as_echo "$as_me: error: Existing MacPorts or DarwinPorts install is too old to be upgraded. Install MacPorts 1.7.1 first." >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ fi
+
+
+
eval "prefix_expanded=$prefix"
# do this twice, since there is a nested variable of
Modified: branches/gsoc09-logging/base/configure.ac
===================================================================
--- branches/gsoc09-logging/base/configure.ac 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/configure.ac 2009-07-07 08:20:59 UTC (rev 53509)
@@ -108,7 +108,7 @@
AC_PATH_PROG(TAR, [tar])
AC_PATH_PROG(UNZIP, [unzip])
AC_PATH_PROG(ZIP, [zip])
-AC_PATH_PROG(BSDMAKE, [bsdmake])
+AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
AC_PATH_PROG(MAKE, [make])
AC_PATH_PROG(HDIUTIL, [hdiutil], [])
AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [])
@@ -132,6 +132,7 @@
AC_ARG_VAR(TAR, [path to tar command])
AC_ARG_VAR(MAKE, [path to make command])
AC_ARG_VAR(GNUTAR, [path to gnutar command])
+AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
AC_ARG_VAR(GNUMAKE, [path to gnumake command])
AC_ARG_VAR(BZIP2, [path to bzip2 command])
AC_ARG_VAR(XAR, [path to xar command])
@@ -361,6 +362,9 @@
prefix=$ac_default_prefix
fi
+# Check if there's an existing DP/MP install too old to upgrade
+MP_CHECK_OLDLAYOUT
+
eval "prefix_expanded=$prefix"
AC_SUBST(prefix_expanded)
# do this twice, since there is a nested variable of
Modified: branches/gsoc09-logging/base/doc/macports.conf.5
===================================================================
--- branches/gsoc09-logging/base/doc/macports.conf.5 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/doc/macports.conf.5 2009-07-07 08:20:59 UTC (rev 53509)
@@ -161,16 +161,6 @@
.br
.Ic Default:
yes
-.It Va universal_target
-The MACOSX_DEPLOYMENT_TARGET to use for +universal variant
-.br
-.Ic Example:
-10.4
-.It Va universal_sysroot
-The SDK "sysroot" full path to use for +universal variant
-.br
-.Ic Example:
-/Developer/SDKs/MacOSX10.4u.sdk
.It Va universal_archs
The machine architectures to use for +universal variant
(multiple architecture entries should be space separated)
@@ -178,7 +168,10 @@
Regular architectures include: ppc, i386, ppc64, x86_64
.br
.Ic Default:
-ppc i386
+x86_64 i386
+.br
+.Ic Default (10.5 and earlier):
+i386 ppc
.It Va startupitem_type
Set the default type of startupitems to be generated, overridable by Portfiles that explicitly state a
startupitem.type key. If set to "default", then a type will be selected that's appropriate to the OS.
Modified: branches/gsoc09-logging/base/doc/macports.conf.in
===================================================================
--- branches/gsoc09-logging/base/doc/macports.conf.in 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/doc/macports.conf.in 2009-07-07 08:20:59 UTC (rev 53509)
@@ -53,6 +53,11 @@
# Supported types: tgz (default), tar, tbz, tbz2, tlz, txz, xar, zip, cpgz, cpio
portarchivetype tgz
+# CPU architecture to compile for. Defaults to i386 or ppc on Mac OS X 10.5
+# and earlier, depending on the CPU type detected at runtime. On Mac OS X 10.6
+# the default is x86_64 if the CPU supports it, i386 otherwise.
+#build_arch i386
+
# Use ccache (C/C++ compiler cache) - see http://ccache.samba.org/
configureccache no
@@ -89,12 +94,6 @@
# Options for Universal Binaries (+universal variant)
-# MACOSX_DEPLOYMENT_TARGET
-universal_target @UNIVERSAL_TARGET@
-
-# the SDK "sysroot" to use
-universal_sysroot @UNIVERSAL_SYSROOT@
-
# machine architectures
universal_archs @UNIVERSAL_ARCHS@
Modified: branches/gsoc09-logging/base/doc/portfile.7
===================================================================
--- branches/gsoc09-logging/base/doc/portfile.7 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/doc/portfile.7 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1944,13 +1944,12 @@
.It Ic md5 Ar
Compute the MD5 hashes of the file(s).
.It Ic rpm-vercomp Ar versionA Ar versionB
-Compare two RPM-format versions for equality.
-.It Ic sudo Ar password Ar command Ar \&...
-Execute
-.Ar command
-using
-.Cm sudo
-with the provided password.
+Compare two RPM-format versions for equality. The return value is like
+strcmp(), returning -1, 0, or 1 when versionA is earlier, equal to, or
+later than versionB, respectively. Note that some comparisions featuring
+floating-point notation may compare incorrectly, eg, 2.101 is considered
+later than 2.2 (101 is larger than 2) which may be incorrect per some
+projects versioning methods (see ticket #11873).
.It Xo
.Ic lpush
.Ar varName
Modified: branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck
===================================================================
--- branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck 2009-07-07 08:20:59 UTC (rev 53509)
@@ -13,5 +13,11 @@
# like this script
exit 112
fi
+
+if [[ -f /opt/local/etc/ports/dp_version ]]; then
+ # message 17 in InstallationCheck.strings
+ exit 113
+fi
+
exit 0
Property changes on: branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings
===================================================================
--- branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1,2 +1,2 @@
"16" = "This package is meant to be installed on __XVERS__";
-
+"17" = "Your existing MacPorts or DarwinPorts install is too old to be upgraded by this installer. Please install MacPorts 1.7.1 first."
Property changes on: branches/gsoc09-logging/base/portmgr/dmg/InstallationCheck.strings
___________________________________________________________________
Added: svn:eol-style
+ native
Deleted: branches/gsoc09-logging/base/portmgr/dmg/preflight
===================================================================
--- branches/gsoc09-logging/base/portmgr/dmg/preflight 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/portmgr/dmg/preflight 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1,126 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2007 Juan Manuel Palacios <jmpp at macports.org>, 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.
-
-
-###
-# dp2mp-move upgrading facility for users installing MacPorts through the pkg installer in the dmg.
-# This script is meant to run as the preflight of the installer, to upgrade an existing MacPorts
-# installation to the MacPorts namespace in the same way the "upgrade" target in base/Makefile
-# does for users installing from source or selfupdate.
-# preflight
-# $Id$
-###
-
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-UPGRADECHECK=/opt/local/var/macports/.mprename
-
-
-[ ! -d /Library/Tcl/darwinports1.0 ] || rm -rf /Library/Tcl/darwinports1.0
-
-[ ! -d /opt/local/share/darwinports ] || rm -rf /opt/local/share/darwinports
-
-[ ! -f /opt/local/etc/ports/dp_version ] || rm -vf /opt/local/etc/ports/dp_version
-
-[ ! -f /opt/local/share/man/man5/ports.conf.5 ] || rm -vf /opt/local/share/man/man5/ports.conf.5
-
-[ ! -d /opt/local/etc/ports ] || mv -v /opt/local/etc/ports /opt/local/etc/macports
-
-[ -d /opt/local/var/macports ] || mkdir -vp /opt/local/var/macports
-for dir in distfiles packages receipts software; do
- [ ! -d /opt/local/var/db/dports/${dir} ] || mv -v /opt/local/var/db/dports/${dir} /opt/local/var/macports
-done
-
-[ ! -d /opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ] || {
- mkdir -vp /opt/local/var/macports/sources/rsync.macports.org/release && mv -v \
- /opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports /opt/local/var/macports/sources/rsync.macports.org/release/ports
-}
-
-for receipt in /opt/local/var/macports/receipts/*/*/receipt.bz2; do
- [ ! \( -f ${receipt} -a ! -f ${receipt}.mpsaved \) ] || { cp -v ${receipt} ${receipt}.mpsaved && {
- bzip2 -q -dc ${receipt} | sed 's/db\/dports/macports/g' | bzip2 -q -zf > ${receipt}.new
- } && mv -v ${receipt}.new ${receipt}
-}; done
-
-[ ! \( -f /opt/local/etc/macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || {
- mv -v /opt/local/etc/macports/ports.conf /opt/local/etc/macports/macports.conf.mpsaved
- sed 's/etc\/ports/etc\/macports/g' /opt/local/etc/macports/macports.conf.mpsaved > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/db\/dports/macports/g' /opt/local/etc/macports/macports.conf > /opt/local/etc//macports/macports.conf.tmp && \
- mv -v /opt/local/etc//macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/darwinports/macports/g' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/dpupdate1\/base/release\/base/g' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed '/^rsync_options/s/"\(.*\)"/\1/' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/ --delete / /' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
- sed 's/ ports.conf(5)/ macports.conf(5)/g' /opt/local/etc/macports/macports.conf > /opt/local/etc/macports/macports.conf.tmp && \
- mv -v /opt/local/etc/macports/macports.conf.tmp /opt/local/etc/macports/macports.conf
-}
-
-[ ! \( -f /opt/local/etc/macports/sources.conf -a ! -f ${UPGRADECHECK} \) ] || {
- cp -v /opt/local/etc/macports/sources.conf /opt/local/etc/macports/sources.conf.mpsaved
- sed 's/darwinports/macports/g' /opt/local/etc/macports/sources.conf > /opt/local/etc/macports/sources.conf.tmp && \
- mv -v /opt/local/etc/macports/sources.conf.tmp /opt/local/etc/macports/sources.conf
- sed 's/dpupdate\/dports/release\/ports\//g' /opt/local/etc/macports/sources.conf > /opt/local/etc/macports/sources.conf.tmp && \
- mv -v /opt/local/etc/macports/sources.conf.tmp /opt/local/etc/macports/sources.conf
-}
-
-[ ! \( -f "${HOME}/.macports/ports.conf" -a ! -f ${UPGRADECHECK} \) ] || {
- mv -v "${HOME}/.macports/ports.conf" "${HOME}/.macports/macports.conf.mpsaved"
- sed 's/etc\/ports/etc\/macports/g' "${HOME}/.macports/macports.conf.mpsaved" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/db\/dports/macports/g' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/darwinports/macports/g' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/dpupdate1\/base/release\/base/g' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed '/^rsync_options/s/"\(.*\)"/\1/' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/ --delete / /' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
- sed 's/ ports.conf(5)/ macports.conf(5)/g' "${HOME}/.macports/macports.conf" > "${HOME}/.macports/macports.conf.tmp" && \
- mv -v "${HOME}/.macports/macports.conf.tmp" "${HOME}/.macports/macports.conf"
-}
-
-
-[ ! -f /opt/local/etc/macports/mp_version ] || rm -vf /opt/local/etc/macports/mp_version
-
-
-[ -f ${UPGRADECHECK} ] || {
- echo -e "\nMacPorts installation successfully upgraded from the old DarwinPorts namespace!\n"
- echo "MacPorts rename update done!" > ${UPGRADECHECK}
-}
Modified: branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl
===================================================================
--- branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/portmgr/jobs/PortIndex2MySQL.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -48,7 +48,7 @@
# meaningful, which is accomplished simply by calling the 'mportsync' proc in macports1.0
# (which updates the ports tree in use) and by installing the script on cron/launchd to be
# run on a timely schedule (not any more frequent than the run of the PortIndexRegen.sh
-# script on that creates a new PortIndex file, which is every twelve hours).
+# script on that creates a new PortIndex file).
#
# Remaining requirement to successfully run this script is performing the necessary
# MySQL admin tasks on the host box to create the database in the first place and the
@@ -72,8 +72,13 @@
set FROM macports-mgr at lists.macosforge.org
set HEADERS "To: $SPAM_LOVERS\r\nFrom: $FROM\r\nSubject: $SUBJECT\r\n\r\n"
-# We first initialize the runlog with proper mail headers
-puts $runlog_fd $HEADERS
+# handle command line arguments
+set create_tables false
+if {[llength $argv]} {
+ if {[lindex $argv 0] == "--create-tables"} {
+ set create_tables true
+ }
+}
# House keeping on exit.
proc cleanup {args} {
@@ -97,29 +102,6 @@
exit $exit_status
}
-# Check if there are any stray sibling jobs before moving on, bail in such case.
-if {[file exists $lockfile]} {
- puts $runlog_fd "PortIndex2MySQL lock file found, is another job running?"
- terminate 1
-} else {
- set lockfile_fd [open $lockfile a]
-}
-
-
-# Load macports1.0 so that we can use some of its procs and the portinfo array.
-if {[catch { source [file join "@TCL_PACKAGE_DIR@" macports1.0 macports_fastload.tcl] } errstr]} {
- puts $runlog_fd "${::errorInfo}"
- puts $runlog_fd "Failed to locate the macports1.0 Tcl package file: $errstr"
- cleanup lockfile
- terminate 1
-}
-if {[catch { package require macports } errstr]} {
- puts $runlog_fd "${::errorInfo}"
- puts $runlog_fd "Failed to load the macports1.0 Tcl package: $errstr"
- cleanup lockfile
- terminate 1
-}
-
# macports1.0 UI instantiation to route information/error messages wherever we want.
# This is a custom ui_channels proc because we want to get reported information on
# channels other than the default stdout/stderr that the macports1.0 API provides,
@@ -157,18 +139,6 @@
}
}
-# Initialize macports1.0 and its UI, in order to find the sources.conf file
-# (which is what will point us to the PortIndex we're gonna use) and use
-# the runtime information.
-array set ui_options {ports_verbose yes}
-if {[catch {mportinit ui_options} errstr]} {
- puts $runlog_fd "${::errorInfo}"
- puts $runlog_fd "Failed to initialize MacPorts: $errstr"
- cleanup lockfile
- terminate 1
-}
-
-
# Procedure to catch the database password from a protected file.
proc getpasswd {passwdfile} {
if {[catch {open $passwdfile r} passwdfile_fd]} {
@@ -188,6 +158,51 @@
return $passwd
}
+# SQL string escaping.
+proc sql_escape {str} {
+ regsub -all -- {'} $str {\\'} str
+ regsub -all -- {"} $str {\\"} str
+ regsub -all -- {\n} $str {\\n} str
+ return $str
+}
+
+# We first initialize the runlog with proper mail headers
+puts $runlog_fd $HEADERS
+
+# Check if there are any stray sibling jobs before moving on, bail in such case.
+if {[file exists $lockfile]} {
+ puts $runlog_fd "PortIndex2MySQL lock file found, is another job running?"
+ terminate 1
+} else {
+ set lockfile_fd [open $lockfile a]
+}
+
+# Load macports1.0 so that we can use some of its procs and the portinfo array.
+if {[catch { source [file join "/Library/Tcl" macports1.0 macports_fastload.tcl] } errstr]} {
+ puts $runlog_fd "${::errorInfo}"
+ puts $runlog_fd "Failed to locate the macports1.0 Tcl package file: $errstr"
+ cleanup lockfile
+ terminate 1
+}
+if {[catch { package require macports } errstr]} {
+ puts $runlog_fd "${::errorInfo}"
+ puts $runlog_fd "Failed to load the macports1.0 Tcl package: $errstr"
+ cleanup lockfile
+ terminate 1
+}
+
+# Initialize macports1.0 and its UI, in order to find the sources.conf file
+# (which is what will point us to the PortIndex we're gonna use) and use
+# the runtime information.
+array set ui_options {ports_verbose yes}
+if {[catch {mportinit ui_options} errstr]} {
+ puts $runlog_fd "${::errorInfo}"
+ puts $runlog_fd "Failed to initialize MacPorts: $errstr"
+ cleanup lockfile
+ terminate 1
+}
+
+
# Database abstraction variables:
set sqlfile "/tmp/portsdb.sql"
set portsdb_host localhost
@@ -222,39 +237,40 @@
terminate 1
}
-
-# SQL string escaping.
-proc sql_escape {str} {
- regsub -all -- {'} $str {\\'} str
- regsub -all -- {"} $str {\\"} str
- regsub -all -- {\n} $str {\\n} str
- return $str
+if {$create_tables} {
+ # Initial creation of database tables: log, portfiles, categories, maintainers, dependencies, variants and platforms.
+ # Do we need any other?
+ puts $sqlfile_fd "DROP TABLE IF EXISTS log;"
+ puts $sqlfile_fd "CREATE TABLE log (activity VARCHAR(255), activity_time TIMESTAMP(14)) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS portfiles;"
+ puts $sqlfile_fd "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255), description TEXT) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS categories;"
+ puts $sqlfile_fd "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS maintainers;"
+ puts $sqlfile_fd "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS dependencies;"
+ puts $sqlfile_fd "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255)) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS variants;"
+ puts $sqlfile_fd "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255)) DEFAULT CHARSET=utf8;"
+
+ puts $sqlfile_fd "DROP TABLE IF EXISTS platforms;"
+ puts $sqlfile_fd "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255)) DEFAULT CHARSET=utf8;"
+} else {
+ # if we are not creating tables from scratch, remove the old data
+ puts $sqlfile_fd "TRUNCATE log;"
+ puts $sqlfile_fd "TRUNCATE portfiles;"
+ puts $sqlfile_fd "TRUNCATE categories;"
+ puts $sqlfile_fd "TRUNCATE maintainers;"
+ puts $sqlfile_fd "TRUNCATE dependencies;"
+ puts $sqlfile_fd "TRUNCATE variants;"
+ puts $sqlfile_fd "TRUNCATE platforms;"
}
-
-# Initial creation of database tables: log, portfiles, categories, maintainers, dependencies, variants and platforms.
-# Do we need any other?
-puts $sqlfile_fd "DROP TABLE IF EXISTS log;"
-puts $sqlfile_fd "CREATE TABLE log (activity VARCHAR(255), activity_time TIMESTAMP(14)) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS portfiles;"
-puts $sqlfile_fd "CREATE TABLE portfiles (name VARCHAR(255) PRIMARY KEY NOT NULL, path VARCHAR(255), version VARCHAR(255), description TEXT) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS categories;"
-puts $sqlfile_fd "CREATE TABLE categories (portfile VARCHAR(255), category VARCHAR(255), is_primary INTEGER) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS maintainers;"
-puts $sqlfile_fd "CREATE TABLE maintainers (portfile VARCHAR(255), maintainer VARCHAR(255), is_primary INTEGER) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS dependencies;"
-puts $sqlfile_fd "CREATE TABLE dependencies (portfile VARCHAR(255), library VARCHAR(255)) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS variants;"
-puts $sqlfile_fd "CREATE TABLE variants (portfile VARCHAR(255), variant VARCHAR(255)) DEFAULT CHARSET=utf8;"
-
-puts $sqlfile_fd "DROP TABLE IF EXISTS platforms;"
-puts $sqlfile_fd "CREATE TABLE platforms (portfile VARCHAR(255), platform VARCHAR(255)) DEFAULT CHARSET=utf8;"
-
-
+
# Iterate over each matching port, extracting its information from the
# portinfo array.
foreach {name array} $ports {
@@ -376,7 +392,6 @@
# Mark the db regen as done only once we're done processing all ports:
puts $sqlfile_fd "INSERT INTO log VALUES ('update', NOW());"
-
# Pipe the contents of the generated sql file to the database command,
# reading from the file descriptor for the raw sql file to assure completeness.
if {[catch {seek $sqlfile_fd 0 start} errstr]} {
@@ -384,13 +399,13 @@
cleanup sqlfile lockfile
terminate 1
}
+
if {[catch {exec -- $portsdb_cmd --host=$portsdb_host --user=$portsdb_user --password=$portsdb_passwd --database=$portsdb_name <@ $sqlfile_fd} errstr]} {
ui_error "${::errorCode}: $errstr"
cleanup sqlfile lockfile
terminate 1
}
-
-# And we're done regen'ing the MacPorts dabase! Cleanup and exit successfully.
+# done regenerating the database. Cleanup and exit successfully.
cleanup sqlfile lockfile
terminate 0
Property changes on: branches/gsoc09-logging/base/portmgr/jobs/mirror_macports.sh
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/portmgr/jobs/org.macports.PortIndexRegen.plist
___________________________________________________________________
Deleted: svn:eol-stype
- native
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/portmgr/jobs/org.macports.mprsyncup.plist
___________________________________________________________________
Deleted: svn:eol-stype
- native
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/portmgr/jobs/portfile_lint.pl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/portmgr/jobs/portfile_mirror.pl
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/dep_map_clean.tcl
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: branches/gsoc09-logging/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/macports1.0/macports.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -45,7 +45,7 @@
porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
- applications_dir frameworks_dir developer_dir universal_target universal_sysroot universal_archs \
+ applications_dir frameworks_dir developer_dir universal_archs build_arch \
macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
variable user_options "submitter_name submitter_email submitter_key"
variable portinterp_options "\
@@ -54,7 +54,7 @@
portarchivetype portautoclean porttrace keeplogs portverbose destroot_umask rsync_server \
rsync_options rsync_dir startupitem_type place_worksymlink \
mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
- applications_dir current_stage frameworks_dir developer_dir universal_target universal_sysroot universal_archs $user_options"
+ applications_dir current_stage frameworks_dir developer_dir universal_archs build_arch $user_options"
# deferred options are only computed when needed.
# they are not exported to the trace thread.
@@ -353,7 +353,7 @@
upvar $up_variations variations
}
- global auto_path env
+ global auto_path env tcl_platform
global macports::autoconf::macports_conf_path
global macports::macports_user_dir
global macports::bootstrap_options
@@ -384,9 +384,8 @@
global macports::configurepipe
global macports::buildnicevalue
global macports::buildmakejobs
- global macports::universal_target
- global macports::universal_sysroot
global macports::universal_archs
+ global macports::build_arch
# Set the system encoding to utf-8
encoding system utf-8
@@ -691,23 +690,34 @@
}
# Default mp universal options
- if {![info exists macports::universal_target]} {
- if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
- set macports::universal_target "10.5"
+ if {![info exists macports::universal_archs]} {
+ if {[lindex [split $tcl_platform(osVersion) .] 0] >= 10} {
+ set macports::universal_archs {x86_64 i386}
} else {
- set macports::universal_target "10.4"
+ set macports::universal_archs {i386 ppc}
}
}
- if {![info exists macports::universal_sysroot]} {
- if {[file exists ${macports::developer_dir}/SDKs/MacOSX10.5.sdk]} {
- set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.5.sdk"
+
+ # Default arch to build for
+ if {![info exists macports::build_arch]} {
+ if {$tcl_platform(os) == "Darwin"} {
+ if {[lindex [split $tcl_platform(osVersion) .] 0] >= 10} {
+ if {[sysctl hw.cpu64bit_capable] == 1} {
+ set macports::build_arch x86_64
+ } else {
+ set macports::build_arch i386
+ }
+ } else {
+ if {$tcl_platform(machine) == "Power Macintosh"} {
+ set macports::build_arch ppc
+ } else {
+ set macports::build_arch i386
+ }
+ }
} else {
- set macports::universal_sysroot "${macports::developer_dir}/SDKs/MacOSX10.4u.sdk"
+ set macports::build_arch ""
}
}
- if {![info exists macports::universal_archs]} {
- set macports::universal_archs {ppc i386}
- }
# ENV cleanup.
set keepenvkeys {
@@ -806,6 +816,14 @@
# load the quick index
_mports_load_quickindex
+
+ set default_source_url [lindex ${sources_default} 0]
+ if {[macports::getprotocol $default_source_url] == "file"} {
+ set default_portindex [macports::getindex $default_source_url]
+ if {[file exists $default_portindex] && [expr [clock seconds] - [file mtime $default_portindex]] > 1209600} {
+ ui_warn "port definitions are more than two weeks old, consider using selfupdate"
+ }
+ }
}
proc macports::worker_init {workername portpath porturl portbuildpath options variations} {
@@ -841,13 +859,12 @@
# instantiate the UI call-backs
foreach priority ${macports::ui_priorities} {
$workername alias ui_$priority ui_$priority
- }
- foreach priority ${macports::ui_priorities} {
foreach stage ${macports::port_stages} {
$workername alias ui_${priority}_${stage} ui_${priority}_${stage}
}
+
}
-
+
$workername alias ui_prefix ui_prefix
$workername alias ui_channels ui_channels
@@ -858,6 +875,8 @@
$workername alias getdefaultportresourcepath macports::getdefaultportresourcepath
$workername alias getprotocol macports::getprotocol
$workername alias getportdir macports::getportdir
+ $workername alias findBinary macports::findBinary
+ $workername alias binaryInPath macports::binaryInPath
# New Registry/Receipts stuff
$workername alias registry_new registry::new_entry
@@ -1060,6 +1079,38 @@
return $proposedpath
}
+
+# mport_filtervariants
+# returns the given list of variants with implicitly-set ones removed
+proc mport_filtervariants {variations {warn yes}} {
+ # Iterate through the variants, filtering out
+ # implicit ones. At the moment, the only implicit variants are
+ # platform variants.
+ set filteredvariations {}
+
+ foreach {variation value} $variations {
+ switch -regexp $variation {
+ ^(pure)?darwin -
+ ^(free|net|open){1}bsd -
+ ^i386 -
+ ^linux -
+ ^macosx -
+ ^powerpc -
+ ^solaris -
+ ^sunos {
+ if {$warn} {
+ ui_warn "Implicit variants should not be explicitly set or unset. $variation will be ignored."
+ }
+ }
+ default {
+ lappend filteredvariations $variation $value
+ }
+ }
+ }
+ return $filteredvariations
+}
+
+
# mportopen
# Opens a MacPorts portfile specified by a URL. The Portfile is
# opened with the given list of options and variations. The result
@@ -1098,29 +1149,6 @@
return -code error "Could not find Portfile in $portpath"
}
- # Iterate through the explicitly set/unset variants, filtering out
- # implicit variants. At the moment, the only implicit variants are
- # platform variants.
- set filteredvariations {}
-
- foreach {variation value} $variations {
- switch -regexp $variation {
- ^(pure)?darwin -
- ^(free|net|open){1}bsd -
- ^i386 -
- ^linux -
- ^macosx -
- ^powerpc -
- ^solaris -
- ^sunos {
- ui_debug "Implicit variants should not be explicitly set or unset. $variation will be ignored."
- }
- default {
- lappend filteredvariations $variation $value
- }
- }
- }
-
set workername [interp create]
set mport [ditem_create]
@@ -1129,10 +1157,10 @@
ditem_key $mport portpath $portpath
ditem_key $mport workername $workername
ditem_key $mport options $options
- ditem_key $mport variations $filteredvariations
+ ditem_key $mport variations $variations
ditem_key $mport refcnt 1
- macports::worker_init $workername $portpath $porturl [macports::getportbuildpath $portpath] $options $filteredvariations
+ macports::worker_init $workername $portpath $porturl [macports::getportbuildpath $portpath] $options $variations
$workername eval source Portfile
@@ -1683,7 +1711,8 @@
}
}
- if { [catch { system "cd $destdir/.. && tar ${verboseflag} ${extflag} -xf $filename" } error] } {
+ set tar [findBinary tar $macports::autoconf::tar_path]
+ if { [catch { system "cd $destdir/.. && $tar ${verboseflag} ${extflag} -xf $filename" } error] } {
ui_error "Extracting $source failed ($error)"
incr numfailed
continue
@@ -2420,21 +2449,28 @@
set porturl file://./
}
- # check if the variants is present in $version_in_tree
- set variant [split $oldvariant +]
+ # will break if we start recording negative variants (#2377)
+ set variant [lrange [split $oldvariant +] 1 end]
ui_debug "Merging existing variants $variant into variants"
+ set oldvariantlist [list]
+ foreach v $variant {
+ lappend oldvariantlist $v "+"
+ }
+ # remove implicit variants, without printing warnings
+ set oldvariantlist [mport_filtervariants $oldvariantlist no]
+
+ # check if the variants are present in $version_in_tree
if {[info exists portinfo(variants)]} {
set avariants $portinfo(variants)
} else {
set avariants {}
}
ui_debug "available variants are : $avariants"
- foreach v $variant {
- if {[lsearch $avariants $v] == -1} {
- } else {
- ui_debug "variant $v is present in $portname $version_in_tree"
- if { ![info exists variations($v)]} {
- set variations($v) "+"
+ foreach {variation value} $oldvariantlist {
+ if {[lsearch $avariants $variation] != -1} {
+ ui_debug "variant $variation is present in $portname $version_in_tree"
+ if { ![info exists variations($variation)]} {
+ set variations($variation) $value
}
}
}
Modified: branches/gsoc09-logging/base/src/package1.0/portpkg.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portpkg.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/package1.0/portpkg.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -161,28 +161,6 @@
close $infofd
}
-# XXX: deprecated
-proc portpkg::write_info_file {infofile portname portversion description} {
- set infofd [open ${infofile} w+]
- puts $infofd "Title ${portname}
-Version ${portversion}
-Description ${description}
-DefaultLocation /
-DeleteWarning
-
-### Package Flags
-
-NeedsAuthorization YES
-Required NO
-Relocatable NO
-RequiresReboot NO
-UseUserMask YES
-OverwritePermissions NO
-InstallFat NO
-RootVolumeOnly NO"
- close $infofd
-}
-
proc portpkg::xml_escape {s} {
regsub -all {&} $s {\&} s
regsub -all {<} $s {\<} s
@@ -228,7 +206,7 @@
<key>IFPkgFlagRestartAction</key>
<string>NoRestart</string>
<key>IFPkgFlagRootVolumeOnly</key>
- <false/>
+ <true/>
<key>IFPkgFlagUpdateInstalledLanguages</key>
<false/>
<key>IFPkgFormatVersion</key>
Property changes on: branches/gsoc09-logging/base/src/package1.0/portportpkg.tcl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: branches/gsoc09-logging/base/src/pextlib1.0/Makefile
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/Makefile 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/Makefile 2009-07-07 08:20:59 UTC (rev 53509)
@@ -1,7 +1,8 @@
OBJS= Pextlib.o strsed.o fgetln.o md5cmd.o setmode.o xinstall.o \
fs-traverse.o strcasecmp.o vercomp.o filemap.o \
sha1cmd.o curl.o rmd160cmd.o readline.o uid.o\
- tracelib.o tty.o get_systemconfiguration_proxies.o
+ tracelib.o tty.o get_systemconfiguration_proxies.o\
+ sysctl.o readdir.o pipe.o
SHLIB_NAME= Pextlib${SHLIB_SUFFIX}
INSTALLDIR= ${DESTDIR}${datadir}/macports/Tcl/pextlib1.0
Modified: branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/Pextlib.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -48,10 +48,6 @@
#include <strings.h>
#endif
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
#if HAVE_LIMITS_H
#include <limits.h>
#endif
@@ -74,10 +70,6 @@
#include <sys/types.h>
#endif
-#if HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -113,6 +105,10 @@
#include "tracelib.h"
#include "tty.h"
#include "get_systemconfiguration_proxies.h"
+#include "sysctl.h"
+#include "strsed.h"
+#include "readdir.h"
+#include "pipe.h"
#if HAVE_CRT_EXTERNS_H
#include <crt_externs.h>
@@ -379,151 +375,6 @@
return status;
}
-int SudoCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- char *buf;
- struct linebuf circbuf[CBUFSIZ];
- size_t linelen;
- char *args[4];
- char *cmdstring, *passwd;
- FILE *pdes;
- int fdset[2];
- int fline, pos, ret;
- pid_t pid;
- Tcl_Obj *errbuf;
- Tcl_Obj *tcl_result;
-
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 1, objv, "password command");
- return TCL_ERROR;
- }
- passwd = Tcl_GetString(objv[1]);
- cmdstring = Tcl_GetString(objv[2]);
-
- if (pipe(fdset) == -1)
- return TCL_ERROR;
-
- /*
- * Fork a child to run the command, in a popen() like fashion -
- * popen() itself is not used because stderr is also desired.
- */
- pid = fork();
- if (pid == -1)
- return TCL_ERROR;
- if (pid == 0) {
- dup2(fdset[0], STDIN_FILENO);
- dup2(fdset[1], STDOUT_FILENO);
- dup2(fdset[1], STDERR_FILENO);
- args[0] = "sudo";
- args[1] = "-S";
- args[2] = cmdstring;
- args[3] = NULL;
- execve("/usr/bin/sudo", args, environ);
- /* Now throw away the privs we just acquired */
- args[1] = "-k";
- args[2] = NULL;
- execve("/usr/bin/sudo", args, environ);
- _exit(1);
- } else {
- write(fdset[1], passwd, strlen(passwd));
- write(fdset[1], "\n", 1);
- close(fdset[1]);
- }
- pdes = fdopen(fdset[0], "r");
-
- /* read from simulated popen() pipe */
- pos = 0;
- bzero(circbuf, sizeof(circbuf));
- while ((buf = fgetln(pdes, &linelen)) != NULL) {
- char *sbuf;
- int slen;
-
- /*
- * Allocate enough space to insert a terminating
- * '\0' if the line is not terminated with a '\n'
- */
- if (buf[linelen - 1] == '\n')
- slen = linelen;
- else
- slen = linelen + 1;
-
- if (circbuf[pos].len == 0)
- sbuf = malloc(slen);
- else {
- sbuf = realloc(circbuf[pos].line, slen);
- }
-
- if (sbuf == NULL) {
- for (fline = pos; pos < fline + CBUFSIZ; pos++) {
- if (circbuf[pos % CBUFSIZ].len != 0)
- free(circbuf[pos % CBUFSIZ].line);
- }
- return TCL_ERROR;
- }
-
- memcpy(sbuf, buf, linelen);
- /* terminate line with '\0',replacing '\n' if it exists */
- sbuf[slen - 1] = '\0';
-
- circbuf[pos].line = sbuf;
- circbuf[pos].len = slen;
-
- if (pos++ == CBUFSIZ - 1)
- pos = 0;
- ret = ui_info(interp, sbuf);
- if (ret != TCL_OK) {
- for (fline = pos; pos < fline + CBUFSIZ; pos++) {
- if (circbuf[pos % CBUFSIZ].len != 0)
- free(circbuf[pos % CBUFSIZ].line);
- }
- return ret;
- }
- }
- fclose(pdes);
-
- if (wait(&ret) != pid)
- return TCL_ERROR;
- if (WIFEXITED(ret)) {
- if (WEXITSTATUS(ret) == 0)
- return TCL_OK;
- else {
- /* Copy the contents of the circular buffer to errbuf */
- Tcl_Obj* errorCode;
- errbuf = Tcl_NewStringObj(NULL, 0);
- for (fline = pos; pos < fline + CBUFSIZ; pos++) {
- if (circbuf[pos % CBUFSIZ].len == 0)
- continue; /* skip empty lines */
-
- /* Append line, minus trailing NULL */
- Tcl_AppendToObj(errbuf, circbuf[pos % CBUFSIZ].line,
- circbuf[pos % CBUFSIZ].len - 1);
-
- /* Re-add previously stripped newline */
- Tcl_AppendToObj(errbuf, "\n", 1);
- free(circbuf[pos % CBUFSIZ].line);
- }
-
- /* set errorCode [list CHILDSTATUS <pid> <code>] */
- errorCode = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, errorCode, Tcl_NewStringObj("CHILDSTATUS", -1));
- Tcl_ListObjAppendElement(interp, errorCode, Tcl_NewIntObj(pid));
- Tcl_ListObjAppendElement(interp, errorCode, Tcl_NewIntObj(WEXITSTATUS(ret)));
- Tcl_SetObjErrorCode(interp, errorCode);
-
- /* set result */
- tcl_result = Tcl_NewStringObj("sudo command \"", -1);
- Tcl_AppendToObj(tcl_result, cmdstring, -1);
- Tcl_AppendToObj(tcl_result, "\" returned error ", -1);
- Tcl_AppendObjToObj(tcl_result, Tcl_NewIntObj(WEXITSTATUS(ret)));
- Tcl_AppendToObj(tcl_result, "\nCommand output: ", -1);
- Tcl_AppendObjToObj(tcl_result, errbuf);
- Tcl_SetObjResult(interp, tcl_result);
- return TCL_ERROR;
- }
- } else
- return TCL_ERROR;
-}
-
int FlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
static const char errorstr[] = "use one of \"-shared\", \"-exclusive\", or \"-unlock\", and optionally \"-noblock\"";
@@ -661,52 +512,10 @@
return TCL_OK;
}
-/**
- *
- * Return the list of elements in a directory.
- * Since 1.60.4.2, the list doesn't include . and ..
- *
- * Synopsis: readdir directory
- */
-int ReaddirCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- DIR *dirp;
- struct dirent *mp;
- Tcl_Obj *tcl_result;
- char *path;
-
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "directory");
- return TCL_ERROR;
- }
-
- path = Tcl_GetString(objv[1]);
- dirp = opendir(path);
- if (!dirp) {
- Tcl_SetResult(interp, "Cannot read directory", TCL_STATIC);
- return TCL_ERROR;
- }
- tcl_result = Tcl_NewListObj(0, NULL);
- while ((mp = readdir(dirp))) {
- /* Skip . and .. */
- if ((mp->d_name[0] != '.') ||
- ((mp->d_name[1] != 0) /* "." */
- &&
- ((mp->d_name[1] != '.') || (mp->d_name[2] != 0)))) /* ".." */ {
- Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(mp->d_name, -1));
- }
- }
- closedir(dirp);
- Tcl_SetObjResult(interp, tcl_result);
-
- return TCL_OK;
-}
-
int StrsedCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
char *pattern, *string, *res;
int range[2];
- extern char *strsed(char *str, char *pat, int *range);
Tcl_Obj *tcl_result;
if (objc != 3) {
@@ -952,39 +761,6 @@
}
/**
- * Call pipe(2) to create a pipe.
- * Syntax is:
- * pipe
- *
- * Generate a Tcl error if something goes wrong.
- * Return a list with the file descriptors of the pipe. The first item is the
- * readable fd.
- */
-int PipeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
- Tcl_Obj* result;
- int fildes[2];
-
- if (objc != 1) {
- Tcl_WrongNumArgs(interp, 1, objv, NULL);
- return TCL_ERROR;
- }
-
- if (pipe(fildes) < 0) {
- Tcl_AppendResult(interp, "pipe failed: ", strerror(errno), NULL);
- return TCL_ERROR;
- }
-
- /* build a list out of the couple */
- result = Tcl_NewListObj(0, NULL);
- Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(fildes[0]));
- Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(fildes[1]));
- Tcl_SetObjResult(interp, result);
-
- return TCL_OK;
-}
-
-/**
* symlink value target
* Create a symbolic link at target pointing to value
* See symlink(2) for possible errors
@@ -1145,12 +921,12 @@
Tcl_CreateObjCommand(interp, "rmd160", RMD160Cmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "sha1", SHA1Cmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "umask", UmaskCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "sudo", SudoCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "pipe", PipeCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "curl", CurlCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "unsetenv", UnsetEnvCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "lchown", lchownCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "sysctl", SysctlCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "readline", ReadlineCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "rl_history", RLHistoryCmd, NULL, NULL);
Modified: branches/gsoc09-logging/base/src/pextlib1.0/curl.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/curl.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/curl.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -54,9 +54,9 @@
* Some compiled-in constants that we may wish to change later, given more
* empirical data. These represent "best guess" values for now.
*/
-#define _CURL_CONNECTION_TIMEOUT ((long)(5 * 60)) /* 5 minutes */
+#define _CURL_CONNECTION_TIMEOUT ((long)(30)) /* 30 seconds */
#define _CURL_MINIMUM_XFER_SPEED ((long)1024) /* 1Kb/sec */
-#define _CURL_MINIMUM_XFER_TIMEOUT ((long)(10 * 60)) /* 10 minutes */
+#define _CURL_MINIMUM_XFER_TIMEOUT ((long)(60)) /* 1 minute */
/* ========================================================================= **
* Definitions
Modified: branches/gsoc09-logging/base/src/pextlib1.0/filemap.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/filemap.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/filemap.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -34,76 +34,17 @@
#include <config.h>
#endif
-#include <ctype.h>
+#include <sys/stat.h>
#include <errno.h>
-#include <grp.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
-#if HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#if HAVE_PATHS_H
-#include <paths.h>
-#endif
-
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-#include <pwd.h>
-
-#if HAVE_SYS_FILE_H
-#include <sys/file.h>
-#endif
-
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-
-#if HAVE_FCNTL_H
#include <fcntl.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#if HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#if HAVE_UNISTD_H
+#include <limits.h>
#include <unistd.h>
-#endif
#include <tcl.h>
#include "filemap.h"
#include "strcasecmp.h"
-/* Avoid a warning with Tcl < 8.4, even if Tcl_GetIndexFromObj's tablePtr
-probably isn't modified. */
-#if (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION >= 4)
-typedef CONST char* tableEntryString;
-#else
-typedef char* tableEntryString;
-#endif
-
/* ========================================================================= **
* Definitions
* ========================================================================= */
@@ -2020,7 +1961,7 @@
kFilemapIsReadOnly
} EOption;
- static tableEntryString options[] = {
+ static const char *options[] = {
"close", "create", "exists", "get", "list", "open", "revert", "save",
"set", "unset", "isreadonly", NULL
};
Modified: branches/gsoc09-logging/base/src/pextlib1.0/md5cmd.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/md5cmd.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/md5cmd.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -38,6 +38,8 @@
#include <tcl.h>
+#include "md5cmd.h"
+
#if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
/* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
@@ -63,7 +65,6 @@
#include "md_wrappers.h"
CHECKSUMEnd(MD5, MD5_CTX, LENGTH)
CHECKSUMFile(MD5, MD5_CTX)
-CHECKSUMData(MD5, MD5_CTX)
#elif defined(HAVE_LIBMD)
#include <sys/types.h>
Modified: branches/gsoc09-logging/base/src/pextlib1.0/md_wrappers.h
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/md_wrappers.h 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/md_wrappers.h 2009-07-07 08:20:59 UTC (rev 53509)
@@ -34,13 +34,12 @@
#define _MD_WRAPPERS_H
/* wrappers for libmd-like functions:
- * char* ALGOData(const unsigned char* data, unsigned int len, char* buf)
* char* ALGOFile(const char* filename, char* buf)
* char* ALGOEnd(ALGO_CTX, char* buf)
*/
#define CHECKSUMEnd(algo, ctxtype, digest_length) \
-char * \
+static char * \
algo##End(ctxtype *ctx, char *buf) \
{ \
int i; \
@@ -61,7 +60,7 @@
}
#define CHECKSUMFile(algo, ctxtype) \
-char *algo##File(const char *filename, char *buf) \
+static char *algo##File(const char *filename, char *buf) \
{ \
unsigned char buffer[BUFSIZ]; \
ctxtype ctx; \
@@ -80,15 +79,5 @@
return algo##End(&ctx, buf); \
}
-#define CHECKSUMData(algo, ctxtype) \
-char *algo##Data(const unsigned char *data, unsigned int len, char *buf) \
-{ \
- ctxtype ctx; \
- algo##Init(&ctx); \
- algo##Update(&ctx, data, len); \
- return algo##End(&ctx, buf); \
-}
-
-
#endif
- /* _MD_WRAPPERS_H */
+/* _MD_WRAPPERS_H */
Copied: branches/gsoc09-logging/base/src/pextlib1.0/pipe.c (from rev 53504, trunk/base/src/pextlib1.0/pipe.c)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/pipe.c (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/pipe.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,76 @@
+/*
+ * pipe.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 The MacPorts Project 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 <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <tcl.h>
+
+#include "pipe.h"
+
+/**
+ * Call pipe(2) to create a pipe.
+ * Syntax is:
+ * pipe
+ *
+ * Generate a Tcl error if something goes wrong.
+ * Return a list with the file descriptors of the pipe. The first item is the
+ * readable fd.
+ */
+int PipeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+ Tcl_Obj* result;
+ int fildes[2];
+
+ if (objc != 1) {
+ Tcl_WrongNumArgs(interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
+
+ if (pipe(fildes) < 0) {
+ Tcl_AppendResult(interp, "pipe failed: ", strerror(errno), NULL);
+ return TCL_ERROR;
+ }
+
+ /* build a list out of the couple */
+ result = Tcl_NewListObj(0, NULL);
+ Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(fildes[0]));
+ Tcl_ListObjAppendElement(interp, result, Tcl_NewIntObj(fildes[1]));
+ Tcl_SetObjResult(interp, result);
+
+ return TCL_OK;
+}
Copied: branches/gsoc09-logging/base/src/pextlib1.0/pipe.h (from rev 53504, trunk/base/src/pextlib1.0/pipe.h)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/pipe.h (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/pipe.h 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,33 @@
+/*
+ * pipe.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 The MacPorts Project 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.
+ */
+
+int PipeCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
Copied: branches/gsoc09-logging/base/src/pextlib1.0/readdir.c (from rev 53504, trunk/base/src/pextlib1.0/readdir.c)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/readdir.c (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/readdir.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,82 @@
+/*
+ * readdir.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 The MacPorts Project 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 <dirent.h>
+
+#include <tcl.h>
+
+#include "readdir.h"
+
+/**
+ *
+ * Return the list of elements in a directory.
+ * Since 1.60.4.2, the list doesn't include . and ..
+ *
+ * Synopsis: readdir directory
+ */
+int ReaddirCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+ DIR *dirp;
+ struct dirent *mp;
+ Tcl_Obj *tcl_result;
+ char *path;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "directory");
+ return TCL_ERROR;
+ }
+
+ path = Tcl_GetString(objv[1]);
+ dirp = opendir(path);
+ if (!dirp) {
+ Tcl_SetResult(interp, "Cannot read directory", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ tcl_result = Tcl_NewListObj(0, NULL);
+ while ((mp = readdir(dirp))) {
+ /* Skip . and .. */
+ if ((mp->d_name[0] != '.') ||
+ ((mp->d_name[1] != 0) /* "." */
+ &&
+ ((mp->d_name[1] != '.') || (mp->d_name[2] != 0)))) /* ".." */ {
+ Tcl_ListObjAppendElement(interp, tcl_result, Tcl_NewStringObj(mp->d_name, -1));
+ }
+ }
+ closedir(dirp);
+ Tcl_SetObjResult(interp, tcl_result);
+
+ return TCL_OK;
+}
Copied: branches/gsoc09-logging/base/src/pextlib1.0/readdir.h (from rev 53504, trunk/base/src/pextlib1.0/readdir.h)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/readdir.h (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/readdir.h 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,33 @@
+/*
+ * readdir.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 The MacPorts Project 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.
+ */
+
+int ReaddirCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
Modified: branches/gsoc09-logging/base/src/pextlib1.0/rmd160cmd.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/rmd160cmd.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/rmd160cmd.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -38,6 +38,8 @@
#include <tcl.h>
+#include "rmd160cmd.h"
+
#if !defined(HAVE_LIBMD)
/* We do not have libmd.
@@ -57,7 +59,6 @@
#include "md_wrappers.h"
CHECKSUMEnd(RMD160, RMD160_CTX, RIPEMD160_DIGEST_LENGTH)
CHECKSUMFile(RMD160, RMD160_CTX)
-CHECKSUMData(RMD160, RMD160_CTX)
#elif defined(HAVE_LIBMD)
#include <sys/types.h>
Modified: branches/gsoc09-logging/base/src/pextlib1.0/sha1cmd.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/sha1cmd.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/sha1cmd.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -39,6 +39,8 @@
#include <tcl.h>
+#include "sha1cmd.h"
+
#if defined(HAVE_LIBCRYPTO) && !defined(HAVE_LIBMD)
/* Minimal wrapper around OpenSSL's libcrypto, as a compatibility
@@ -61,7 +63,6 @@
#include "md_wrappers.h"
CHECKSUMEnd(SHA1, SHA_CTX, SHA_DIGEST_LENGTH)
CHECKSUMFile(SHA1, SHA_CTX)
-CHECKSUMData(SHA1, SHA_CTX)
#elif defined(HAVE_LIBMD)
#include <sys/types.h>
Modified: branches/gsoc09-logging/base/src/pextlib1.0/strsed.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/strsed.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/strsed.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -129,6 +129,8 @@
#define HS_REGEX 1
+#include "strsed.h"
+
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
@@ -215,13 +217,14 @@
/* ------------------------------------------------------------------------- **
* Prototypes
* ------------------------------------------------------------------------- */
-static char *mem();
-static void mem_init();
-static void mem_free();
-static char *build_map();
-static char nextch();
-static void mem_save();
-static int mem_find();
+static char *mem(int, int);
+static void mem_init(void);
+static void mem_free(char *);
+static char *build_map(char *, char *);
+static char nextch(char *, int);
+static void mem_save(int);
+static int mem_find(int);
+char *backslash_eliminate(char *, int, int);
/* ------------------------------------------------------------------------- **
* strsed
@@ -245,8 +248,6 @@
static regmatch_t *exp_regs = NULL;
static regex_t exp;
#endif
-
- char *backslash_eliminate();
char *from;
char *new_str;
Copied: branches/gsoc09-logging/base/src/pextlib1.0/strsed.h (from rev 53504, trunk/base/src/pextlib1.0/strsed.h)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/strsed.h (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/strsed.h 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1 @@
+char *strsed(char *, char *, int *);
Copied: branches/gsoc09-logging/base/src/pextlib1.0/sysctl.c (from rev 53504, trunk/base/src/pextlib1.0/sysctl.c)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/sysctl.c (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/sysctl.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,75 @@
+/*
+ * sysctl.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 The MacPorts Project 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 <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+#include "sysctl.h"
+
+/*
+ * Read-only wrapper for sysctlbyname(3). Only works for values of type CTLTYPE_INT.
+ */
+int SysctlCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+{
+ const char error_message[] = "sysctl failed: ";
+ Tcl_Obj *tcl_result;
+ int res;
+ char *name;
+ int value;
+ size_t len = sizeof(value);
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "name");
+ return TCL_ERROR;
+ }
+
+ name = Tcl_GetString(objv[1]);
+ res = sysctlbyname(name, &value, &len, NULL, 0);
+ if (res == -1) {
+ 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;
+ }
+
+ tcl_result = Tcl_NewIntObj(value);
+ Tcl_SetObjResult(interp, tcl_result);
+ return TCL_OK;
+}
Copied: branches/gsoc09-logging/base/src/pextlib1.0/sysctl.h (from rev 53504, trunk/base/src/pextlib1.0/sysctl.h)
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/sysctl.h (rev 0)
+++ branches/gsoc09-logging/base/src/pextlib1.0/sysctl.h 2009-07-07 08:20:59 UTC (rev 53509)
@@ -0,0 +1,34 @@
+/*
+ * sysctl.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 The MacPorts Project 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.
+ */
+
+/* Read-only wrapper for sysctlbyname(3) */
+int SysctlCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
Modified: branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
===================================================================
--- branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c 2009-07-07 08:20:59 UTC (rev 53509)
@@ -82,6 +82,10 @@
}
name=strdup(Tcl_GetString(objv[2]));
+ if (!name) {
+ Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
return TCL_OK;
}
@@ -107,8 +111,12 @@
len=strlen(Tcl_GetString(objv[2]))+2;
sandbox=(char*)malloc(len);
+ if (!sandbox) {
+ Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
memset(sandbox, 0, len);
- strcpy(sandbox, Tcl_GetString(objv[2]));
+ strlcpy(sandbox, Tcl_GetString(objv[2]), len);
for(t=sandbox;(t=strchr(t+1, ':'));)
{
/* : -> \0 */
@@ -210,10 +218,23 @@
{
char * t, * _;
- filemap=(char*)malloc(1024);
+ size_t remaining = 1024;
+ filemap=(char*)malloc(remaining);
+ if (!filemap) {
+ ui_warn("send_file_map: memory allocation failed");
+ return;
+ }
t=filemap;
- #define append_allow(path, resolution) do{strcpy(t, path); t+=strlen(t)+1; *t++=resolution; *t++=0;}while(0);
+ #define append_allow(path, resolution) do { strlcpy(t, path, remaining); \
+ if (remaining < (strlen(t)+3)) \
+ remaining=0; \
+ else \
+ remaining-=strlen(t)+3; \
+ t+=strlen(t)+1; \
+ *t++=resolution; \
+ *t++=0; \
+ } while(0);
if(enable_fence)
{
for(_=sandbox; *_; _+=strlen(_)+1)
@@ -226,22 +247,25 @@
/* If there is no SDK we will allow everything in /usr /System/Library etc, else add binaries to allow, and redirect root to SDK. */
if(sdk&&*sdk)
{
- char buf[260]="/Developer/SDKs/";
- strcat(buf, sdk);
+ char buf[260];
+ buf[0] = '\0';
+ strlcat(buf, Tcl_GetVar(interp, "macports::developer_dir", TCL_GLOBAL_ONLY), 260);
+ strlcat(buf, "/SDKs/", 260);
+ strlcat(buf, sdk, 260);
append_allow("/usr/bin", 0);
append_allow("/usr/sbin", 0);
append_allow("/usr/libexec/gcc", 0);
append_allow("/System/Library/Perl", 0);
append_allow("/", 1);
- strcpy(t-1, buf);
+ strlcpy(t-1, buf, remaining);
t+=strlen(t)+1;
}else
{
append_allow("/usr", 0);
append_allow("/System/Library", 0);
append_allow("/Library", 0);
- append_allow("/Developer", 0);
+ append_allow(Tcl_GetVar(interp, "macports::developer_dir", TCL_GLOBAL_ONLY), 0);
}
}else
append_allow("/", 0);
@@ -267,42 +291,40 @@
{
char * port=0;
size_t len=1;
- char resolution;
+ char resolution='!';
+
+ Tcl_SetVar(interp, "path", path, 0);
+ Tcl_Eval(interp, "registry::file_registered $path");
+ port=strdup(Tcl_GetStringResult(interp));
+ if (!port) {
+ ui_warn("dep_check: memory allocation failed");
+ return;
+ }
+ Tcl_UnsetVar(interp, "path", 0);
- /* If there aren't deps then allow anything. (Useful for extract) */
- if(!depends)
- resolution='+';
- else
+ if(*port!='0'||port[1])
{
- resolution='!';
-
- Tcl_SetVar(interp, "path", path, 0);
- Tcl_Eval(interp, "registry::file_registered $path");
- port=strdup(Tcl_GetStringResult(interp));
- Tcl_UnsetVar(interp, "path", 0);
+ char * t;
- if(*port!='0'||port[1])
+ t=depends;
+ for(;*t;t+=strlen(t)+1)
{
- char * t;
-
- t=depends;
- for(;*t;t+=strlen(t)+1)
+ if(!strcmp(t, port))
{
- if(!strcmp(t, port))
- {
- resolution='+';
- break;
- }
+ resolution='+';
+ break;
}
- }else if(*port=='0'&&!port[1])
- strcpy(port, "*unknown*");
+ }
}
- if(resolution!='+')
- ui_info("trace: access denied to %s (%s)", path, port);
+ if(resolution!='+') {
+ if(*port=='0'&&!port[1])
+ ui_info("trace: access denied to %s (*unknown*)", path);
+ else
+ ui_info("trace: access denied to %s (%s)", path, port);
+ }
- if(port)
- free(port);
+ free(port);
if(send(sock, &len, sizeof(len), 0)==-1)
ui_warn("tracelib send failed");
@@ -374,7 +396,7 @@
sun.sun_family=AF_UNIX;
- strcpy(sun.sun_path, name);
+ strlcpy(sun.sun_path, name, sizeof(sun.sun_path));
if(bind(sock, (struct sockaddr*)&sun, sizeof(sun))==-1)
{
Tcl_SetResult(interp, "Cannot bind socket", TCL_STATIC);
@@ -518,8 +540,12 @@
d=Tcl_GetString(objv[2]);
l=strlen(d);
depends=malloc(l+2);
+ if (!depends) {
+ Tcl_SetResult(interp, "memory allocation failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
depends[l+1]=0;
- strcpy(depends, d);
+ strlcpy(depends, d, l+2);
for(t=depends;*t;++t)
if(*t==' ')
*t++=0;
Property changes on: branches/gsoc09-logging/base/src/pextlib1.0/tracelib.c
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/pextlib1.0/tracelib.h
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: branches/gsoc09-logging/base/src/port/port.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port/port.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port/port.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -2076,8 +2076,13 @@
if {![info exists depscache(port:$portname)]} {
# Global variations will have to be merged into the specified
# variations, but perhaps after the installed variations are
- # merged. So we pass them into upgrade:
- macports::upgrade $portname "port:$portname" [array get global_variations] [array get variations] [array get options] depscache
+ # merged. So we pass them into upgrade.
+
+ # First filter out implicit variants from the explicitly set/unset variants.
+ set global_variations_list [mport_filtervariants [array get global_variations] yes]
+ set variations_list [mport_filtervariants [array get variations] yes]
+
+ macports::upgrade $portname "port:$portname" $global_variations_list $variations_list [array get options] depscache
}
}
@@ -2948,6 +2953,17 @@
set variations($variation) $value
}
}
+ # Filter out implicit variants from the explicitly set/unset variants.
+ # Except we need to keep them for some targets to work right...
+ switch -exact $target {
+ distfiles -
+ mirror {}
+ default {
+ set variationslist [mport_filtervariants [array get variations] yes]
+ array unset variations
+ array set variations $variationslist
+ }
+ }
# If version was specified, save it as a version glob for use
# in port actions (e.g. clean).
Modified: branches/gsoc09-logging/base/src/port1.0/portbuild.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portbuild.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portbuild.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -53,7 +53,7 @@
default build.dir {${workpath}/${worksrcdir}}
default build.cmd {[portbuild::build_getmaketype]}
default build.nice {${buildnicevalue}}
-default build.jobs {${buildmakejobs}}
+default build.jobs {[portbuild::build_getjobs]}
default build.pre_args {${build.target}}
default build.target "all"
default use_parallel_build yes
@@ -69,18 +69,18 @@
if {[option os.platform] == "darwin"} {
return [findBinary bsdmake $portutil::autoconf::bsdmake_path]
} elseif {[option os.platform] == "freebsd"} {
- return [binaryInPath make]
+ return [findBinary make $portutil::autoconf::make_path]
} else {
- return [binaryInPath pmake]
+ return [findBinary pmake $portutil::autoconf::bsdmake_path]
}
}
gnu {
if {[option os.platform] == "darwin"} {
return [findBinary gnumake $portutil::autoconf::gnumake_path]
} elseif {[option os.platform] == "linux"} {
- return [binaryInPath make]
+ return [findBinary make $portutil::autoconf::make_path]
} else {
- return [binaryInPath gmake]
+ return [findBinary gmake $portutil::autoconf::gnumake_path]
}
}
pbx {
@@ -114,7 +114,24 @@
return "[findBinary nice $portutil::autoconf::nice_path] -n $nice "
}
-proc portbuild::build_getmakejobs {args} {
+proc portbuild::build_getjobs {args} {
+ global buildmakejobs
+ set jobs $buildmakejobs
+ # if set to '0', use the number of cores for the number of jobs
+ if {$jobs == 0} {
+ if {[catch {set jobs [sysctl hw.activecpu]}]} {
+ set jobs 2
+ ui_warn "failed to determine the number of available CPUs (probably not supported on this platform)"
+ ui_warn "defaulting to $jobs jobs, consider setting buildmakejobs to a nonzero value in macports.conf"
+ }
+ }
+ if {![string is integer -strict $jobs] || $jobs <= 1} {
+ set jobs 1
+ }
+ return $jobs
+}
+
+proc portbuild::build_getjobsarg {args} {
# check if port allows a parallel build
global use_parallel_build
if {![tbool use_parallel_build]} {
@@ -125,19 +142,7 @@
if {![exists build.jobs] || !([string match "*make*" [option build.cmd]] || [string match "*scons*" [option build.cmd]])} {
return ""
}
- set jobs [option build.jobs]
- # if set to '0', use the number of cores for the number of jobs
- if {$jobs == 0} {
- if {[catch {set jobs [exec "/usr/sbin/sysctl" "-n" "hw.availcpu"]}]} {
- set jobs 2
- ui_warn "failed to determine the number of available CPUs (probably not supported on this platform)"
- ui_warn "defaulting to $jobs jobs, consider setting buildmakejobs to a nonzero value in macports.conf"
- }
- }
- if {![string is integer -strict $jobs] || $jobs <= 1} {
- return ""
- }
- return " -j$jobs"
+ return " -j[option build.jobs]"
}
proc portbuild::build_start {args} {
@@ -150,7 +155,7 @@
global build.cmd
set nice_prefix [build_getnicevalue]
- set jobs_suffix [build_getmakejobs]
+ set jobs_suffix [build_getjobsarg]
set realcmd ${build.cmd}
set build.cmd "$nice_prefix${build.cmd}$jobs_suffix"
Modified: branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portconfigure.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -87,36 +87,17 @@
options configure.optflags configure.cflags configure.cppflags configure.cxxflags configure.objcflags configure.ldflags configure.libs configure.fflags configure.f90flags configure.fcflags configure.classpath
default configure.optflags {-O2}
# compiler flags section
-default configure.cflags {[portconfigure::configure_get_cflags]}
-default configure.cppflags {"-I${prefix}/include"}
-default configure.cxxflags {[portconfigure::configure_get_cflags]}
-default configure.objcflags {[portconfigure::configure_get_cflags]}
-default configure.ldflags {"-L${prefix}/lib"}
+default configure.cflags {${configure.optflags}}
+default configure.cppflags {-I${prefix}/include}
+default configure.cxxflags {${configure.optflags}}
+default configure.objcflags {${configure.optflags}}
+default configure.ldflags {-L${prefix}/lib}
default configure.libs {}
-default configure.fflags {[portconfigure::configure_get_cflags]}
-default configure.f90flags {[portconfigure::configure_get_cflags]}
-default configure.fcflags {[portconfigure::configure_get_cflags]}
+default configure.fflags {${configure.optflags}}
+default configure.f90flags {${configure.optflags}}
+default configure.fcflags {${configure.optflags}}
default configure.classpath {}
-# internal function to return the system value for CFLAGS/CXXFLAGS/etc
-proc portconfigure::configure_get_cflags {args} {
- global configure.optflags
- global configure.m32 configure.m64 configure.march configure.mtune
- set flags "${configure.optflags}"
- if {[tbool configure.m64]} {
- set flags "-m64 ${flags}"
- } elseif {[tbool configure.m32]} {
- set flags "-m32 ${flags}"
- }
- if {[info exists configure.march] && ${configure.march} != {}} {
- set flags "${flags} -march=${configure.march}"
- }
- if {[info exists configure.mtune] && ${configure.mtune} != {}} {
- set flags "${flags} -mtune=${configure.mtune}"
- }
- return $flags
-}
-
# tools section
options configure.perl configure.python configure.ruby configure.install configure.awk configure.bison configure.pkg_config configure.pkg_config_path
default configure.perl {}
@@ -128,9 +109,11 @@
default configure.pkg_config {}
default configure.pkg_config_path {}
-options configure.universal_target configure.universal_sysroot configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
-default configure.universal_target {${universal_target}}
-default configure.universal_sysroot {${universal_sysroot}}
+options configure.build_arch configure.archflags
+default configure.build_arch {${build_arch}}
+default configure.archflags {[portconfigure::configure_get_archflags]}
+
+options configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
default configure.universal_archs {${universal_archs}}
default configure.universal_args {--disable-dependency-tracking}
default configure.universal_cflags {[portconfigure::configure_get_universal_cflags]}
@@ -156,8 +139,10 @@
set_ui_prefix
proc portconfigure::configure_start {args} {
- global UI_PREFIX
- global configure.compiler
+ global UI_PREFIX configure.compiler configure.optflags configure.archflags
+ global configure.march configure.mtune configure.universal_cflags
+ global configure.universal_cxxflags configure.universal_cppflags
+ global configure.universal_ldflags configure.universal_args
ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option name]]"
@@ -182,52 +167,115 @@
default { return -code error "Invalid value for configure.compiler" }
}
ui_debug "Using compiler '$name'"
+
+ # add in extra CFLAGS etc
+ if {[variant_exists universal] && [variant_isset universal]} {
+ foreach flag {cflags objcflags fflags f90flags fcflags} {
+ eval configure.${flag}-append ${configure.universal_cflags}
+ }
+ eval configure.cxxflags-append ${configure.universal_cxxflags}
+ eval configure.cppflags-append ${configure.universal_cppflags}
+ eval configure.ldflags-append ${configure.universal_ldflags}
+ eval configure.pre_args-append ${configure.universal_args}
+ } else {
+ foreach flag {cflags cxxflags objcflags fflags f90flags fcflags} {
+ eval configure.${flag}-append ${configure.archflags}
+ if {${configure.march} != {}} {
+ configure.${flag}-append "-march=${configure.march}"
+ }
+ if {${configure.mtune} != {}} {
+ configure.${flag}-append "-mtune=${configure.mtune}"
+ }
+ }
+ eval configure.ldflags-append ${configure.archflags}
+ }
}
+# internal function to determine the compiler flags to select an arch
+proc portconfigure::configure_get_archflags {args} {
+ global configure.build_arch configure.m32 configure.m64 configure.compiler
+ set flags ""
+ if {[tbool configure.m64]} {
+ set flags "-m64"
+ } elseif {[tbool configure.m32]} {
+ set flags "-m32"
+ } elseif {${configure.build_arch} != ""} {
+ if {[arch_flag_supported]} {
+ set flags "-arch ${configure.build_arch}"
+ } elseif {${configure.build_arch} == "x86_64" || ${configure.build_arch} == "ppc64"} {
+ set flags "-m64"
+ } elseif {${configure.compiler} != "gcc-3.3"} {
+ set flags "-m32"
+ }
+ }
+ return $flags
+}
+
# internal function to determine the "-arch xy" flags for the compiler
proc portconfigure::configure_get_universal_archflags {args} {
global configure.universal_archs
set flags ""
foreach arch ${configure.universal_archs} {
- set flags "$flags -arch $arch"
+ if {$flags == ""} {
+ set flags "-arch $arch"
+ } else {
+ append flags " -arch $arch"
+ }
}
return $flags
}
# internal function to determine the CPPFLAGS for the compiler
proc portconfigure::configure_get_universal_cppflags {args} {
- global configure.universal_sysroot
+ global os.arch os.major developer_dir
set flags ""
# include sysroot in CPPFLAGS too (twice), for the benefit of autoconf
- if {[info exists configure.universal_sysroot]} {
- set flags "-isysroot ${configure.universal_sysroot}"
+ if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+ set flags "-isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk"
}
return $flags
}
# internal function to determine the CFLAGS for the compiler
proc portconfigure::configure_get_universal_cflags {args} {
- global configure.universal_sysroot configure.universal_target
+ global os.arch os.major developer_dir
set flags [configure_get_universal_archflags]
# these flags should be valid for C/C++ and similar compiler frontends
- if {[info exists configure.universal_sysroot]} {
- set flags "-isysroot ${configure.universal_sysroot} ${flags}"
+ if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+ set flags "-isysroot ${developer_dir}/SDKs/MacOSX10.4u.sdk ${flags}"
}
return $flags
}
# internal function to determine the LDFLAGS for the compiler
proc portconfigure::configure_get_universal_ldflags {args} {
- global configure.universal_sysroot configure.universal_target
- global os.arch
+ global os.arch os.major developer_dir
set flags [configure_get_universal_archflags]
# works around linking without using the CFLAGS, outside of automake
- if {${os.arch} == "powerpc"} {
- set flags "-Wl,-syslibroot,${configure.universal_sysroot} ${flags}"
+ if {${os.arch} == "powerpc" && ${os.major} == "8"} {
+ set flags "-Wl,-syslibroot,${developer_dir}/SDKs/MacOSX10.4u.sdk ${flags}"
}
return $flags
}
+# internal proc to determine if the compiler supports -arch
+proc portconfigure::arch_flag_supported {args} {
+ global configure.compiler
+ switch -exact ${configure.compiler} {
+ gcc-4.0 -
+ gcc-4.2 -
+ llvm-gcc-4.2 -
+ clang -
+ apple-gcc-4.0 -
+ apple-gcc-4.2 {
+ return yes
+ }
+ default {
+ return no
+ }
+ }
+}
+
# internal function to determine the default compiler
proc portconfigure::configure_get_default_compiler {args} {
global os.platform os.major
@@ -283,7 +331,6 @@
cc { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
objc { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 }
cxx { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-g++-4.2 }
- cpp { set ret ${developer_dir}/usr/llvm-gcc-4.2/bin/llvm-cpp-4.2 }
}
}
clang {
Modified: branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portdestroot.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -95,7 +95,7 @@
ui_msg "$UI_PREFIX [format [msgcat::mc "Staging %s into destroot"] ${name}]"
# start gsoc08-privileges
- if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
+ if { [getuid] == 0 && [geteuid] != 0 } {
# if started with sudo but have dropped the privileges
ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
ui_debug "Run destroot without sudo to avoid root privileges."
@@ -170,7 +170,7 @@
}
}
fs-traverse -depth dir ${destroot} {
- if {[file isdirectory $dir]} {
+ if {[file type $dir] == "directory"} {
catch {file delete $dir}
}
}
@@ -229,11 +229,6 @@
set manlinkpath [file join $manpath $manlink]
# if link destination is not gzipped, check it
set manlinksrc [file readlink $manlinkpath]
- # if link destination is an absolute path, convert it to a
- # relative path
- if {[file pathtype $manlinksrc] eq "absolute"} {
- set manlinksrc [file tail $manlinksrc]
- }
if {![regexp "\[.\]gz\$" ${manlinksrc}]} {
set mandir [file dirname $manlink]
set mandirpath [file join $manpath $mandir]
@@ -242,8 +237,13 @@
puts $err
return
}
+ # if link source is an absolute path, check for it under destroot
+ set mls_check "$manlinksrc"
+ if {[file pathtype $mls_check] eq "absolute"} {
+ set mls_check "${destroot}${mls_check}"
+ }
# if gzipped destination exists, fix link
- if {[file isfile ${manlinksrc}.gz]} {
+ if {[file isfile ${mls_check}.gz]} {
# if actual link name does not end with gz, rename it
if {![regexp "\[.\]gz\$" ${manlink}]} {
ui_debug "renaming link: $manlink to ${manlink}.gz"
Modified: branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portdistcheck.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -64,21 +64,20 @@
if {"${distcheck.check}" != "none"
&& "${fetch.type}" == "standard"} {
# portfetch 1.0::checkfiles sets fetch_urls list.
- global fetch_urls
- checkfiles
+ set fetch_urls {}
+ portfetch::checkfiles fetch_urls
set totalsize 0
# Check all the files.
foreach {url_var distfile} $fetch_urls {
- global portfetch::$url_var
- if {![info exists $url_var]} {
+ global portfetch::urlmap
+ if {![info exists urlmap($url_var)]} {
ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
- set url_var master_sites
- global portfetch::$url_var
+ set urlmap($url_var) $master_sites
}
if {${distcheck.check} == "moddate"} {
set count 0
- foreach site [set $url_var] {
+ foreach site $urlmap($url_var) {
ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
set file_url [portfetch::assemble_url $site $distfile]
if {[catch {set urlnewer [curl isnewer $file_url $port_moddate]} error]} {
@@ -95,7 +94,7 @@
}
} elseif {${distcheck.check} == "filesize"} {
set count 0
- foreach site [set $url_var] {
+ foreach site $urlmap($url_var) {
ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
set file_url [portfetch::assemble_url $site $distfile]
if {[catch {set urlsize [curl getsize $file_url]} error]} {
Modified: branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portdistfiles.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -53,7 +53,7 @@
}
proc portdistfiles::distfiles_main {args} {
- global UI_PREFIX master_sites fetch_urls url_var distfile checksums_array
+ global UI_PREFIX master_sites checksums_array
# give up on ports that do not provide URLs
if {$master_sites == "{}"} {
@@ -61,13 +61,15 @@
}
# from portfetch... process the sites, files and patches
- portfetch::checkfiles
+ set fetch_urls {}
+ portfetch::checkfiles fetch_urls
# get checksum data from the portfile and parse it
set checksums_str [option checksums]
set result [portchecksum::parse_checksums $checksums_str]
- foreach {url_var distfile} $portfetch::fetch_urls {
+ foreach {url_var distfile} $fetch_urls {
+ global portfetch::urlmap
ui_msg "\[$distfile\]"
@@ -79,13 +81,12 @@
}
# determine sites to download from
- namespace import ::portfetch::$url_var
- if {![info exists $url_var]} {
- set url_var master_sites
+ if {![info exists urlmap($url_var)]} {
+ set urlmap($url_var) $master_sites
}
# determine URLs to download
- foreach site [set $url_var] {
+ foreach site $urlmap($url_var) {
set file_url [portfetch::assemble_url $site $distfile]
ui_msg " $file_url"
}
Modified: branches/gsoc09-logging/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portfetch.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portfetch.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -43,6 +43,8 @@
namespace eval portfetch {
namespace export suffix
variable fetch_urls {}
+ variable urlmap
+ array set urlmap {}
}
# Name space for internal site lists storage
@@ -225,38 +227,39 @@
set ret [list]
foreach element $portfetch::mirror_sites::sites($mirrors) {
- # here we have the chance to take a look at tags, that possibly
- # have been assigned in mirror_sites.tcl
- set splitlist [split $element :]
- # every element is a URL, so we'll always have multiple elements. no need to check
- set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
- set mirror_tag "[lindex $splitlist 2]"
+ # here we have the chance to take a look at tags, that possibly
+ # have been assigned in mirror_sites.tcl
+ set splitlist [split $element :]
+ # every element is a URL, so we'll always have multiple elements. no need to check
+ set element "[lindex $splitlist 0]:[lindex $splitlist 1]"
+ set mirror_tag "[lindex $splitlist 2]"
- set name_re {\$(?:name\y|\{name\})}
- # if the URL has $name embedded, kill any mirror_tag that may have been added
- # since a mirror_tag and $name are incompatible
- if {[regexp $name_re $element]} {
- set mirror_tag ""
- }
+ set name_re {\$(?:name\y|\{name\})}
+ # if the URL has $name embedded, kill any mirror_tag that may have been added
+ # since a mirror_tag and $name are incompatible
+ if {[regexp $name_re $element]} {
+ set mirror_tag ""
+ }
- if {$mirror_tag == "mirror"} {
- set thesubdir ${dist_subdir}
- } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
- set thesubdir ${name}
- } else {
- set thesubdir ${subdir}
- }
+ if {$mirror_tag == "mirror"} {
+ set thesubdir ${dist_subdir}
+ } elseif {$subdir == "" && $mirror_tag != "nosubdir"} {
+ set thesubdir ${name}
+ } else {
+ set thesubdir ${subdir}
+ }
- # parse an embedded $name. if present, remove the subdir
- if {[regsub $name_re $element $thesubdir element] > 0} {
- set thesubdir ""
- }
+ # parse an embedded $name. if present, remove the subdir
+ if {[regsub $name_re $element $thesubdir element] > 0} {
+ set thesubdir ""
+ }
- if {"$tag" != ""} {
- eval append element "${thesubdir}:${tag}"
- } else {
- eval append element "${thesubdir}"
- }
+ if {"$tag" != ""} {
+ eval append element "${thesubdir}:${tag}"
+ } else {
+ eval append element "${thesubdir}"
+ }
+
eval lappend ret $element
}
@@ -271,6 +274,7 @@
proc portfetch::checksites {args} {
global patch_sites master_sites master_sites.mirror_subdir \
patch_sites.mirror_subdir fallback_mirror_site global_mirror_site env
+ variable urlmap
append master_sites " ${global_mirror_site} ${fallback_mirror_site}"
if {[info exists env(MASTER_SITE_LOCAL)]} {
@@ -324,18 +328,18 @@
foreach site $site_list {
if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
- lappend portfetch::$tag $site
+ lappend urlmap($tag) $site
} else {
- lappend portfetch::$list $site
+ lappend urlmap($list) $site
}
}
}
}
# Checks patch files and their tags to assemble url lists for later fetching
-proc portfetch::checkpatchfiles {args} {
+proc portfetch::checkpatchfiles {urls} {
global patchfiles all_dist_files patch_sites filespath
- variable fetch_urls
+ upvar $urls fetch_urls
if {[info exists patchfiles]} {
foreach file $patchfiles {
@@ -356,9 +360,9 @@
}
# Checks dist files and their tags to assemble url lists for later fetching
-proc portfetch::checkdistfiles {args} {
+proc portfetch::checkdistfiles {urls} {
global distfiles all_dist_files master_sites filespath
- variable fetch_urls
+ upvar $urls fetch_urls
if {[info exists distfiles]} {
foreach file $distfiles {
@@ -377,20 +381,19 @@
}
# sorts fetch_urls in order of ping time
-proc portfetch::sortsites {args} {
- global fallback_mirror_site
- variable fetch_urls
+proc portfetch::sortsites {urls} {
+ global fallback_mirror_site master_sites
+ upvar $urls fetch_urls
+ variable urlmap
set fallback_mirror_list [mirror_sites $fallback_mirror_site {} {}]
foreach {url_var distfile} $fetch_urls {
- variable portfetch::$url_var
- if {![info exists $url_var]} {
+ if {![info exists urlmap($url_var)]} {
ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
- set url_var master_sites
- variable portfetch::$url_var
+ set urlmap($url_var) $master_sites
}
- set urllist [set $url_var]
+ set urllist $urlmap($url_var)
set hosts {}
set hostregex {[a-zA-Z]+://([a-zA-Z0-9\.\-_]+)}
@@ -444,21 +447,21 @@
set pinglist [ lsort -real -index 1 $pinglist ]
- set $url_var {}
+ set urlmap($url_var) {}
foreach pair $pinglist {
- lappend $url_var [lindex $pair 0]
+ lappend urlmap($url_var) [lindex $pair 0]
}
}
}
# Perform the full checksites/checkpatchfiles/checkdistfiles sequence.
# This method is used by distcheck target.
-proc portfetch::checkfiles {args} {
- variable fetch_urls
+proc portfetch::checkfiles {urls} {
+ upvar $urls fetch_urls
checksites
- checkpatchfiles
- checkdistfiles
+ checkpatchfiles fetch_urls
+ checkdistfiles fetch_urls
}
@@ -586,6 +589,7 @@
global distfile site
global portverbose
variable fetch_urls
+ variable urlmap
if {![file isdirectory $distpath]} {
if {[catch {file mkdir $distpath} result]} {
@@ -627,17 +631,15 @@
return -code error [format [msgcat::mc "%s must be writable"] $distpath]
}
if {!$sorted} {
- sortsites
+ sortsites fetch_urls
set sorted yes
}
- variable portfetch::$url_var
- if {![info exists $url_var]} {
+ if {![info exists urlmap($url_var)]} {
ui_error [format [msgcat::mc "No defined site for tag: %s, using master_sites"] $url_var]
- set url_var master_sites
- variable portfetch::$url_var
+ set urlmap($url_var) $master_sites
}
unset -nocomplain fetched
- foreach site [set $url_var] {
+ foreach site $urlmap($url_var) {
ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]"
set file_url [portfetch::assemble_url $site $distfile]
set effectiveURL ""
@@ -702,6 +704,7 @@
proc portfetch::fetch_init {args} {
global distfiles distname distpath all_dist_files dist_subdir fetch.type fetch_init_done
global altprefix usealtworkpath
+ variable fetch_urls
if {[info exists distpath] && [info exists dist_subdir] && ![info exists fetch_init_done]} {
@@ -716,7 +719,7 @@
set distpath ${distpath}/${dist_subdir}
set fetch_init_done yes
}
- portfetch::checkfiles
+ portfetch::checkfiles fetch_urls
}
proc portfetch::fetch_start {args} {
Modified: branches/gsoc09-logging/base/src/port1.0/portlint.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portlint.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portlint.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -239,6 +239,14 @@
lappend local_variants $variantname
}
}
+
+ if {[string match "platform\[ \t\]*" $line]} {
+ regexp {platform\s+(?:\w+\s+(?:\w+\s+)?)?(\w+)} $line -> platform_arch
+ if {$platform_arch == "ppc"} {
+ ui_error "Arch 'ppc' in platform variant on line $lineno should be 'powerpc'"
+ incr errors
+ }
+ }
if {[regexp {(^|\s)configure\s+\{\s*\}} $line]} {
ui_warn "Line $lineno should say \"use_configure no\" instead of declaring an empty configure phase"
Modified: branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portlivecheck.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -122,10 +122,6 @@
set livecheck.type "fallback"
}
}
- # If livecheck.name is still "default", set it to $name.
- if {${livecheck.name} eq "default"} {
- set livecheck.name $name
- }
if {[lsearch -exact [split $available_types "|"] ${livecheck.type}] != -1} {
# Load the defaults from _resources/port1.0/livecheck/${livecheck.type}.tcl.
set defaults_file "$types_dir/${livecheck.type}.tcl"
Modified: branches/gsoc09-logging/base/src/port1.0/portmain.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portmain.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portmain.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -122,11 +122,6 @@
# the universal variant itself is now created in
# add_default_universal_variant, which is called from mportopen
option os.universal_supported yes
-
- if {[info exists variations(universal)] && $variations(universal) == "+"} {
- # cannot go into the variant, due to the amount of ports overriding it
- eval macosx_deployment_target ${universal_target}
- }
}
# Record initial euid/egid
Modified: branches/gsoc09-logging/base/src/port1.0/porttrace.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/porttrace.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/porttrace.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -44,7 +44,7 @@
if {[catch {package require Thread} error]} {
ui_warn "trace requires Tcl Thread package ($error)"
} else {
- global env trace_fifo trace_sandboxbounds portpath
+ global env trace_fifo trace_sandboxbounds portpath distpath
# Create a fifo.
# path in unix socket limited to 109 chars
# # set trace_fifo "$workpath/trace_fifo"
@@ -78,7 +78,7 @@
# /Library/Caches/com.apple.Xcode
# $CCACHE_DIR
# $HOMEDIR/.ccache
- set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:$portpath"
+ set trace_sandboxbounds "/tmp:/private/tmp:/var/tmp:/private/var/tmp:/dev/:/etc/passwd:/etc/groups:/etc/localtime:/Library/Caches/com.apple.Xcode:$env(HOME)/.ccache:${workpath}:${portpath}:${distpath}"
if {[info exists env(TMPDIR)]} {
set trace_sandboxbounds "${trace_sandboxbounds}:$env(TMPDIR)"
}
@@ -104,6 +104,7 @@
global env
if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
unset env(DARWINTRACE_SANDBOX_BOUNDS)
+ unsetenv DARWINTRACE_SANDBOX_BOUNDS
}
}
@@ -147,11 +148,9 @@
global os.platform
if {${os.platform} == "darwin"} {
global env trace_fifo
- unset env(DYLD_INSERT_LIBRARIES)
- unset env(DYLD_FORCE_FLAT_NAMESPACE)
- unset env(DARWINTRACE_LOG)
- if [info exists env(DARWINTRACE_SANDBOX_BOUNDS)] {
- unset env(DARWINTRACE_SANDBOX_BOUNDS)
+ foreach var {DYLD_INSERT_LIBRARIES DYLD_FORCE_FLAT_NAMESPACE DARWINTRACE_LOG DARWINTRACE_SANDBOX_BOUNDS} {
+ array unset env $var
+ unsetenv $var
}
#kill socket
@@ -213,7 +212,7 @@
# Private.
# Slave method to read a line from the trace.
-proc porttrace::lave_read_line {chan} {
+proc porttrace::slave_read_line {chan} {
global ports_list trace_filemap sandbox_violation_list workpath
global env
Modified: branches/gsoc09-logging/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portutil.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/port1.0/portutil.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -681,11 +681,11 @@
# Pick up a unique name.
if {[variant_exists $platform]} {
set suffix 1
- while {[variant_exists "$platform-$suffix"]} {
+ while {[variant_exists "${platform}_${suffix}"]} {
incr suffix
}
- set platform "$platform-$suffix"
+ set platform "${platform}_${suffix}"
}
variant $platform $code
@@ -1269,7 +1269,6 @@
# outside the sandbox.
if {$target != "activate"
&& $target != "archive"
- && $target != "fetch"
&& $target != "install"} {
porttrace::trace_enable_fence
}
@@ -1700,7 +1699,7 @@
# test for conflicting variants
foreach v [ditem_key $ditem conflicts] {
if {[variant_isset $v]} {
- ui_error "Variant $name conflicts with $v"
+ ui_error "[option name]: Variant $name conflicts with $v"
return 1
}
}
@@ -1709,7 +1708,7 @@
if {[catch "variant-${name}" result]} {
global errorInfo
ui_debug "$errorInfo"
- ui_error "Error executing $name: $result"
+ ui_error "[option name]: Error executing $name: $result"
return 1
}
return 0
@@ -1721,18 +1720,13 @@
# was turned on or off, a particular instance of the port is uniquely
# characterized by the set of variants that are *on*. Thus, record those
# variants in a string in a standard order as +var1+var2 etc.
- # We can skip the platform and architecture since those are always
- # requested. XXX: Is that really true? What if the user explicitly
- # overrides the platform and architecture variants? Will the registry get
- # bollixed? It would seem safer to me to just leave in all the variants that
- # are on, but for now I'm just leaving the skipping code as it was in the
- # previous version.
+ # XXX: this doesn't quite work because of default variants, see ticket #2377
proc canonicalize_variants {variants} {
array set vara $variants
set result ""
set vlist [lsort -ascii [array names vara]]
foreach v $vlist {
- if {$vara($v) == "+" && $v ne [option os.platform] && $v ne [option os.arch]} {
+ if {$vara($v) == "+"} {
append result +$v
}
}
@@ -1883,20 +1877,8 @@
}
proc add_default_universal_variant {args} {
- # Declare default universal variant if universal SDK is installed
- variant universal {
- pre-fetch {
- if {![file exists ${configure.universal_sysroot}]} {
- return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail"
- }
- }
-
- eval configure.args-append ${configure.universal_args}
- eval configure.cflags-append ${configure.universal_cflags}
- eval configure.cppflags-append ${configure.universal_cppflags}
- eval configure.cxxflags-append ${configure.universal_cxxflags}
- eval configure.ldflags-append ${configure.universal_ldflags}
- }
+ # Declare default universal variant (all the magic happens in portconfigure now)
+ variant universal {}
}
# Target class definition.
@@ -2132,33 +2114,6 @@
return $size;
}
-# check for a binary in the path
-# returns an error code if it cannot be found
-proc binaryInPath {binary} {
- global env
- foreach dir [split $env(PATH) :] {
- if {[file executable [file join $dir $binary]]} {
- return [file join $dir $binary]
- }
- }
-
- return -code error [format [msgcat::mc "Failed to locate '%s' in path: '%s'"] $binary $env(PATH)];
-}
-
-# find a binary either in a path defined at MacPorts' configuration time
-# or in the PATH environment variable through binaryInPath (fallback)
-proc findBinary {prog {autoconf_hint ""}} {
- if {${autoconf_hint} != "" && [file executable ${autoconf_hint}]} {
- return ${autoconf_hint}
- } else {
- if {[catch {set cmd_path [binaryInPath ${prog}]} result] == 0} {
- return ${cmd_path}
- } else {
- return -code error "${result} or at its MacPorts configuration time location, did you move it?"
- }
- }
-}
-
# Set the UI prefix to something standard (so it can be grepped for in output)
proc set_ui_prefix {} {
global UI_PREFIX env
@@ -2380,17 +2335,19 @@
proc chownAsRoot {path} {
global euid macportsuser
- if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
- # if started with sudo but have dropped the privileges
- seteuid $euid
- ui_debug "euid changed to: [geteuid]"
- chown ${path} ${macportsuser}
- ui_debug "chowned $path to $macportsuser"
- seteuid [name_to_uid "$macportsuser"]
- ui_debug "euid changed to: [geteuid]"
- } elseif { [getuid] == 0 } {
- # if started with sudo but have elevated back to root already
- chown ${path} ${macportsuser}
+ if { [getuid] == 0 } {
+ if {[geteuid] != 0} {
+ # if started with sudo but have dropped the privileges
+ seteuid $euid
+ ui_debug "euid changed to: [geteuid]"
+ chown ${path} ${macportsuser}
+ ui_debug "chowned $path to $macportsuser"
+ seteuid [name_to_uid "$macportsuser"]
+ ui_debug "euid changed to: [geteuid]"
+ } else {
+ # if started with sudo but have elevated back to root already
+ chown ${path} ${macportsuser}
+ }
}
}
@@ -2401,17 +2358,15 @@
proc elevateToRoot {action} {
global euid egid macportsuser
- if { [getuid] == 0 && [geteuid] == [name_to_uid "$macportsuser"] } {
+ if { [getuid] == 0 && [geteuid] != 0 } {
# if started with sudo but have dropped the privileges
ui_debug "Can't run $action on this port without elevated privileges. Escalating privileges back to root."
setegid $egid
seteuid $euid
ui_debug "euid changed to: [geteuid]. egid changed to: [getegid]."
+ } elseif { [getuid] != 0 } {
+ return -code error "MacPorts requires root privileges for this action"
}
-
- if { [getuid] != 0 } {
- return -code error "MacPorts requires root privileges for this action";
- }
}
##
@@ -2421,15 +2376,17 @@
global euid egid macportsuser workpath
if { [geteuid] == 0 } {
if { [catch {
- ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+ if {[name_to_uid "$macportsuser"] != 0} {
+ ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
- #seteuid [name_to_uid [file attributes $workpath -owner]]
- #setegid [name_to_gid [file attributes $workpath -group]]
+ #seteuid [name_to_uid [file attributes $workpath -owner]]
+ #setegid [name_to_gid [file attributes $workpath -group]]
- setegid [uname_to_gid "$macportsuser"]
- seteuid [name_to_uid "$macportsuser"]
- ui_debug "egid changed to: [getegid]"
- ui_debug "euid changed to: [geteuid]"
+ setegid [uname_to_gid "$macportsuser"]
+ seteuid [name_to_uid "$macportsuser"]
+ ui_debug "egid changed to: [getegid]"
+ ui_debug "euid changed to: [geteuid]"
+ }
}]
} {
ui_debug "$::errorInfo"
Modified: branches/gsoc09-logging/base/src/registry1.0/portimage.tcl
===================================================================
--- branches/gsoc09-logging/base/src/registry1.0/portimage.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/registry1.0/portimage.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -286,7 +286,7 @@
file mtime $dstfile [file mtime $srcfile]
}
} elseif { [file type $srcfile] == "link" } {
- file copy -force $srcfile $dstfile
+ file copy -force -- $srcfile $dstfile
} else {
# Try a hard link first and if that fails, a symlink
if {[catch {file link -hard $dstfile $srcfile}]} {
@@ -345,7 +345,7 @@
if {[file exists $file]} {
ui_warn "File $file already exists. Moving to: $bakfile."
- file rename -force $file $bakfile
+ file rename -force -- $file $bakfile
}
if { $port != 0 } {
Modified: branches/gsoc09-logging/base/src/registry1.0/receipt_flat.tcl
===================================================================
--- branches/gsoc09-logging/base/src/registry1.0/receipt_flat.tcl 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/registry1.0/receipt_flat.tcl 2009-07-07 08:20:59 UTC (rev 53509)
@@ -74,7 +74,7 @@
# regex match case
if {$portversion == 0} {
- set x [glob -nocomplain [file join ${macports::registry.path} receipts ${portname}-*]]
+ set x [glob -nocomplain -directory [file join ${macports::registry.path} receipts] -- ${portname}-*]
if {[string length $x]} {
set matchfile [lindex $x 0]
# Remove trailing .bz2, if any.
@@ -136,7 +136,7 @@
if { $version == "" } {
# xxx: If we're in image mode, we really should have had the
# version given to us. How should we handle this?
- set x [glob -nocomplain [file join ${receipt_path} *]]
+ set x [glob -nocomplain -directory ${receipt_path} *]
if { [string length $x] } {
set v [lindex [file split [lindex $x 0]] end]
regexp {([-_a-zA-Z0-9\.]+)_([0-9]*)([+-_a-zA-Z0-9]*)$} $v match version revision variants
@@ -180,7 +180,7 @@
# move the old receipt
set convertedDirPath [file join ${macports::registry.path} receipts_converted]
file mkdir $convertedDirPath
- file rename $receipt_file $convertedDirPath
+ file rename -- $receipt_file $convertedDirPath
} elseif {[string match "# Version: *" $receipt_contents]} {
# This is new format
if {![string match "# Version: 1.0*" $receipt_contents]} {
@@ -329,12 +329,12 @@
close $receipt_handle
if { [file exists ${receipt_file}] } {
- file delete -force "${receipt_file}"
+ file delete -force -- "${receipt_file}"
} elseif { [file exists ${receipt_file}.bz2] } {
- file delete -force "${receipt_file}.bz2"
+ file delete -force -- "${receipt_file}.bz2"
}
- file rename -force "${receipt_file}.tmp" "${receipt_file}"
+ file rename -force -- "${receipt_file}.tmp" "${receipt_file}"
if { [file exists ${receipt_file}] && [file exists ${registry::autoconf::bzip2_path}] && ![info exists registry.nobzip] } {
system "${registry::autoconf::bzip2_path} -f ${receipt_file}"
@@ -423,14 +423,14 @@
if { [file exists ${receipt_path}] } {
# remove port receipt directory
ui_debug "deleting directory: ${receipt_path}"
- file delete -force ${receipt_path}
+ file delete -force -- ${receipt_path}
# remove port receipt parent directory (if empty)
set receipt_dir [file join ${macports::registry.path} receipts ${name}]
if { [file isdirectory ${receipt_dir}] } {
# 0 item means empty.
if { [llength [readdir ${receipt_dir}]] == 0 } {
ui_debug "deleting directory: ${receipt_dir}"
- file delete -force ${receipt_dir}
+ file delete -force -- ${receipt_dir}
} else {
ui_debug "${receipt_dir} is not empty"
}
@@ -848,9 +848,9 @@
close $map_handle
# don't both checking for presence, file delete doesn't error if file doesn't exist
- file delete ${map_file} ${map_file}.bz2
+ file delete -- ${map_file} ${map_file}.bz2
- file rename ${map_file}.tmp ${map_file}
+ file rename -- ${map_file}.tmp ${map_file}
if { [file exists ${map_file}] && [file exists ${registry::autoconf::bzip2_path}] && ![info exists registry.nobzip] } {
system "${registry::autoconf::bzip2_path} -f ${map_file}"
Property changes on: branches/gsoc09-logging/base/src/registry2.0/portimage.tcl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/registry2.0/portuninstall.tcl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/registry2.0/registry_util.tcl
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/MPMethodSignatureExtensions.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/MPMethodSignatureExtensions.m
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in
===================================================================
--- branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in 2009-07-07 07:53:07 UTC (rev 53508)
+++ branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in 2009-07-07 08:20:59 UTC (rev 53509)
@@ -10,7 +10,7 @@
LIBS+= ${OBJC_FOUNDATION_LIBS}
clean::
- rm -f *.d
+ rm -f *.o
distclean::
rm -f Makefile
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/Makefile.in
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/objc_encoding.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/objc_encoding.m
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc.m
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc_types.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/tclobjc1.0/tclobjc_types.m
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: branches/gsoc09-logging/base/src/thread2.6.diff
___________________________________________________________________
Deleted: svn:keywords
- Id
Property changes on: branches/gsoc09-logging/base/src/upgrade_sources_conf_default.tcl
___________________________________________________________________
Added: svn:eol-style
+ native
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090707/bdc81377/attachment-0001.html>
More information about the macports-changes
mailing list