Ignore:
Timestamp:
Aug 22, 2011, 2:01:16 AM (9 years ago)
Author:
derek@…
Message:

Merge from trunk

Location:
branches/gsoc11-statistics/base
Files:
34 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-statistics/base

  • branches/gsoc11-statistics/base/src/cregistry/vercomp.c

    r65474 r82923  
    4848
    4949/**
    50  * RPM version comparison. Shamelessly copied from Pextlib, with some changes to
     50 * EVR version comparison. Shamelessly copied from Pextlib, with some changes to
    5151 * use string lengths instead of strlen by default. That's necessary to make it
    5252 * work with sqlite3 collations. It should be shared with Pextlib, rather than
     
    5959 * @return              -1 if A < B; 0 if A = B; 1 if A > B
    6060 */
    61 static int rpm_vercomp (const char *versionA, int lengthA, const char *versionB,
     61static int vercmp (const char *versionA, int lengthA, const char *versionB,
    6262        int lengthB) {
    6363    const char *endA, *endB;
     
    174174/**
    175175 * VERSION collation for sqlite3. This function collates text according to
    176  * pextlib's rpm-vercomp function. This allows direct comparison and sorting of
     176 * pextlib's vercmp function. This allows direct comparison and sorting of
    177177 * version columns, such as port.version and port.revision.
    178178 *
     
    186186int sql_version(void* userdata UNUSED, int alen, const void* a, int blen,
    187187        const void* b) {
    188     return rpm_vercomp((const char*)a, alen, (const char*)b, blen);
     188    return vercmp((const char*)a, alen, (const char*)b, blen);
    189189}
  • branches/gsoc11-statistics/base/src/darwintracelib1.0/Makefile

    r74369 r82923  
    77include ../../Mk/macports.autoconf.mk
    88
    9 CFLAGS+= -fPIC
     9CFLAGS+= -fPIC -Wno-deprecated-declarations
     10CFLAGS_PEDANTIC=
    1011
    1112all:: ${SHLIB_NAME}
  • branches/gsoc11-statistics/base/src/darwintracelib1.0/darwintrace.c

    r79672 r82923  
    164164#if __STDC_VERSION__>=199901L
    165165#if DARWINTRACE_DEBUG_OUTPUT
    166 #define dprintf(...) fprintf(stderr, __VA_ARGS__)
     166#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
    167167#else
    168 #define dprintf(...)
     168#define debug_printf(...)
    169169#endif
    170170#else
     
    172172__attribute__ ((format (printf, 1, 2)))
    173173static inline
    174 int dprintf(const char *format, ...) {
     174int debug_printf(const char *format, ...) {
    175175    int ret;
    176176    va_list args;
     
    181181}
    182182#else
    183 #define dprintf(format, param)
     183#define debug_printf(format, param)
    184184#endif
    185185#endif
     
    363363                        if(connect(sock, (struct sockaddr*)&sun, strlen(__env_darwintrace_log)+1+sizeof(sun.sun_family))!=-1)
    364364                        {
    365                                 dprintf("darwintrace: connect successful. socket %d\n", sock);
     365                                debug_printf("darwintrace: connect successful. socket %d\n", sock);
    366366                                __darwintrace_fd=sock;
    367367                                ask_for_filemap();
    368368                        } else {
    369                                 dprintf("connect failed: %s\n", strerror(errno));
     369                                debug_printf("connect failed: %s\n", strerror(errno));
    370370                                abort();
    371371                        }
     
    470470  }
    471471
    472   dprintf("darwintrace: cleanup resulted in %s\n", path);
     472  debug_printf("darwintrace: cleanup resulted in %s\n", path);
    473473}
    474474
     
    664664                isInSandbox = __darwintrace_is_in_sandbox(path, newpath);
    665665                if (isInSandbox == 0) {
    666                         dprintf("darwintrace: creation/writing was forbidden at %s\n", path);
     666                        debug_printf("darwintrace: creation/writing was forbidden at %s\n", path);
    667667                        errno = EACCES;
    668668                        result = -1;
     
    810810        int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
    811811        if (isInSandbox == 1) {
    812                 dprintf("darwintrace: unlink was allowed at %s\n", path);
     812                debug_printf("darwintrace: unlink was allowed at %s\n", path);
    813813        } else if (isInSandbox == 0) {
    814814                /* outside sandbox, but sandbox is defined: forbid */
    815                 dprintf("darwintrace: unlink was forbidden at %s\n", path);
     815                debug_printf("darwintrace: unlink was forbidden at %s\n", path);
    816816                errno = EACCES;
    817817                result = -1;
     
    832832        int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
    833833        if (isInSandbox == 1) {
    834                 dprintf("darwintrace: mkdir was allowed at %s\n", path);
     834                debug_printf("darwintrace: mkdir was allowed at %s\n", path);
    835835        } else if (isInSandbox == 0) {
    836836                /* outside sandbox, but sandbox is defined: forbid */
     
    841841                if ((err == -1) && (errno == ENOENT))
    842842                {
    843                         dprintf("darwintrace: mkdir was forbidden at %s\n", path);
     843                        debug_printf("darwintrace: mkdir was forbidden at %s\n", path);
    844844                        errno = EACCES;
    845845                        result = -1;
     
    862862        int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
    863863        if (isInSandbox == 1) {
    864                 dprintf("darwintrace: rmdir was allowed at %s\n", path);
     864                debug_printf("darwintrace: rmdir was allowed at %s\n", path);
    865865        } else if (isInSandbox == 0) {
    866866                /* outside sandbox, but sandbox is defined: forbid */
    867                 dprintf("darwintrace: removing directory %s was forbidden\n", path);
     867                debug_printf("darwintrace: removing directory %s was forbidden\n", path);
    868868                errno = EACCES;
    869869                result = -1;
     
    884884        int isInSandbox = __darwintrace_is_in_sandbox(from, 0);
    885885        if (isInSandbox == 1) {
    886                 dprintf("darwintrace: rename was allowed at %s\n", from);
     886                debug_printf("darwintrace: rename was allowed at %s\n", from);
    887887        } else if (isInSandbox == 0) {
    888888                /* outside sandbox, but sandbox is defined: forbid */
    889                 dprintf("darwintrace: renaming from %s was forbidden\n", from);
     889                debug_printf("darwintrace: renaming from %s was forbidden\n", from);
    890890                errno = EACCES;
    891891                result = -1;
     
    895895                isInSandbox = __darwintrace_is_in_sandbox(to, 0);
    896896                if (isInSandbox == 1) {
    897                         dprintf("darwintrace: rename was allowed at %s\n", to);
     897                        debug_printf("darwintrace: rename was allowed at %s\n", to);
    898898                } else if (isInSandbox == 0) {
    899899                        /* outside sandbox, but sandbox is defined: forbid */
    900                         dprintf("darwintrace: renaming to %s was forbidden\n", to);
     900                        debug_printf("darwintrace: renaming to %s was forbidden\n", to);
    901901                        errno = EACCES;
    902902                        result = -1;
  • branches/gsoc11-statistics/base/src/images_to_archives.tcl

    r79672 r82923  
    1414umask 022
    1515
    16 mportinit
     16array set ui_options {ports_verbose yes}
     17
     18mportinit ui_options
    1719
    1820# always converting to tbz2 should be fine as both these programs are
     
    3234# the registry only after we know all creation attempts were successful.
    3335set archived_list {}
     36set installed_len [llength $ilist]
     37set counter 0
    3438
    3539foreach installed $ilist {
     40    incr counter
    3641    set iname [lindex $installed 0]
    3742    set iversion [lindex $installed 1]
     
    8388        # compute new name and location of archive
    8489        set archivename "${iname}-${iversion}_${irevision}${ivariants}.${macports::os_platform}_${macports::os_major}.[join $archs -].${archivetype}"
     90        ui_msg "Processing ${counter} of ${installed_len}: ${archivename}"
    8591        if {$installtype == "image"} {
    8692            set targetdir [file dirname $location]
     
    114120}
    115121
     122set archived_len [llength $archived_list]
     123set counter 0
     124
    116125registry::write {
    117126    foreach archived $archived_list {
     127        incr counter
     128        ui_msg "Updating registry: ${counter} of ${archived_len}"
    118129        set installtype [lindex $archived 0]
    119130        set iref [lindex $archived 1]
     
    133144}
    134145
     146set counter 0
    135147foreach archived $archived_list {
     148    incr counter
    136149    set location [lindex $archived 2]
     150    ui_msg "Deleting ${counter} of ${archived_len}: ${location}"
    137151    if {$location != "" && [file isdirectory $location]} {
    138152        if {[catch {file delete -force $location} result]} {
  • branches/gsoc11-statistics/base/src/macports1.0/Makefile

    r79672 r82923  
    3434        echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
    3535        if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
    36                 if test ! -d "${TCL_PACKAGE_DIR}"; then \
    37                         $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
    38                 fi; \
    39                 if test -w "${TCL_PACKAGE_DIR}"; then \
    40                         if test ! -L "${INSTALLPKGLINK}" && test -d "${INSTALLPKGLINK}"; then \
    41                                 rm -rf "${INSTALLPKGLINK}" || true; \
    42                         fi; \
    43                         if test ! -e "${INSTALLPKGLINK}"; then \
    44                                 ln -s "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
    45                         fi; \
    46                 fi; \
     36                if test ! -L "${INSTALLPKGLINK}"; then \
     37            if test ! -e "${TCL_PACKAGE_DIR}"; then \
     38                $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
     39            fi; \
     40            if test -d "${INSTALLPKGLINK}"; then \
     41                rm -vrf "${INSTALLPKGLINK}" || true; \
     42            fi; \
     43            if test ! -e "${INSTALLPKGLINK}"; then \
     44                ln -vs "${INSTALLDIR}" "${INSTALLPKGLINK}" || true; \
     45            fi; \
     46        fi; \
    4747        fi
  • branches/gsoc11-statistics/base/src/macports1.0/macports.tcl

    r79672 r82923  
    4949        applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
    5050        macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip \
    51         master_site_local patch_site_local archive_site_local stats_participate stats_url stats_id"
     51        master_site_local patch_site_local archive_site_local buildfromsource stats_participate stats_url stats_id"
    5252    variable user_options "submitter_name submitter_email submitter_key"
    5353    variable portinterp_options "\
     
    375375                    } elseif {$devtoolscore_v >= 1204.0} {
    376376                        set macports::xcodeversion "3.1.4"
    377                     } elseif {$devtoolscore_v > 921.0} {
    378                         # XXX find actual version corresponding to 3.1
     377                    } elseif {$devtoolscore_v >= 1100.0} {
    379378                        set macports::xcodeversion "3.1"
    380379                    } elseif {$devtoolscore_v >= 921.0} {
     
    528527        # Otherwise define the user directory as a direcotory that will never exist
    529528        set macports::macports_user_dir "/dev/null/NO_HOME_DIR"
     529        # Tcl library code wants to do tilde expansion in various places
     530        set env(HOME) ${macports::macports_user_dir}
    530531    }
    531532
     
    722723        }
    723724    }
     725    # Check command line override for source/binary only mode
     726    if {![info exists macports::global_options(ports_binary_only)]
     727        && ![info exists macports::global_options(ports_source_only)]
     728        && [info exists macports::buildfromsource]} {
     729        if {${macports::buildfromsource} == "never"} {
     730            set macports::global_options(ports_binary_only) yes
     731        } elseif {${macports::buildfromsource} == "always"} {
     732            set macports::global_options(ports_source_only) yes
     733        } elseif {${macports::buildfromsource} != "ifneeded"} {
     734            ui_warn "'buildfromsource' set to unknown value '${macports::buildfromsource}', using 'ifneeded' instead"
     735        }
     736    }
    724737
    725738    # Duplicate prefix into prefix_frozen, so that port actions
     
    884897    }
    885898
     899    # make tools we run operate in UTF-8 mode
     900    set env(LANG) en_US.UTF-8
     901
    886902    if {![info exists xcodeversion] || ![info exists xcodebuildcmd]} {
    887903        # We'll resolve these later (if needed)
     
    9971013    set registry_open yes
    9981014    # convert any flat receipts if we just created a new db
    999     if {$db_exists == 0 && [file writable $db_path]} {
     1015    if {$db_exists == 0 && [file exists ${registry.path}/receipts] && [file writable $db_path]} {
    10001016        ui_warn "Converting your registry to sqlite format, this might take a while..."
    10011017        if {[catch {registry::convert_to_sqlite}]} {
     
    12111227    set tarflags [get_tar_flags [file extension $fetchfile]]
    12121228    set qflag ${macports::autoconf::tar_q}
    1213     set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +CONTENTS"
     1229    set cmdline "$tarcmd ${tarflags}${qflag}xOf \"$fetchfile\" +CONTENTS"
    12141230    ui_debug "$cmdline"
    1215     set contents [eval exec $cmdline]
    12161231    if {![catch {set contents [eval exec $cmdline]}]} {
    12171232        set binary 1
     
    12351250    ui_debug "extracting port archive to [pwd]"
    12361251    if {$binary} {
    1237         set cmdline "$tarcmd ${tarflags}${qflag}xOf {$fetchfile} +PORTFILE > Portfile"
    1238     } else {
    1239         set cmdline "$tarcmd ${tarflags}xf {$fetchfile}"
     1252        set cmdline "$tarcmd ${tarflags}${qflag}xOf \"$fetchfile\" +PORTFILE > Portfile"
     1253    } else {
     1254        set cmdline "$tarcmd ${tarflags}xf \"$fetchfile\""
    12401255    }
    12411256    ui_debug "$cmdline"
     
    12661281        file {
    12671282            set path [file normalize [string range $url [expr [string length $protocol] + 3] end]]
    1268             if {[file isdirectory $path]} {
     1283            if {![file isfile $path]} {
    12691284                return $path
    12701285            } else {
     
    16381653    # xxx: set the work path?
    16391654    set workername [ditem_key $mport workername]
     1655    $workername eval validate_macportsuser
    16401656    if {![catch {$workername eval check_variants $target} result] && $result == 0 &&
    16411657        ![catch {$workername eval check_supported_archs} result] && $result == 0 &&
     
    16731689    set workername [ditem_key $mport workername]
    16741690
     1691    # check for existence of macportsuser and use fallback if necessary
     1692    $workername eval validate_macportsuser
    16751693    # check variants
    16761694    if {[$workername eval check_variants $target] != 0} {
     
    26362654    set deptypes [macports::_deptypes_for_target $target $workername]
    26372655
    2638     set subPorts {}
     2656    set depPorts {}
    26392657    if {[llength $deptypes] > 0} {
    26402658        array set optionsarray [ditem_key $mport options]
     
    27072725                }
    27082726                lappend options subport $dep_portname
    2709                 # Figure out the subport. Check the open_mports list first, since
     2727                # Figure out the depport. Check the open_mports list first, since
    27102728                # we potentially leak mport references if we mportopen each time,
    27112729                # because mportexec only closes each open mport once.
    2712                 set subport [dlist_match_multi $macports::open_mports [list porturl $dep_portinfo(porturl) options $options variations $variations]]
     2730                set depport [dlist_match_multi $macports::open_mports [list porturl $dep_portinfo(porturl) options $options variations $variations]]
    27132731               
    2714                 if {$subport == {}} {
     2732                if {$depport == {}} {
    27152733                    # We haven't opened this one yet.
    2716                     set subport [mportopen $dep_portinfo(porturl) $options $variations]
     2734                    set depport [mportopen $dep_portinfo(porturl) $options $variations]
    27172735                }
    27182736            }
     
    27202738            # check archs
    27212739            if {$parse && $check_archs
    2722                 && ![macports::_mport_supports_archs $subport $required_archs]} {
    2723 
    2724                 set supported_archs [_mportkey $subport supported_archs]
    2725                 mportclose $subport
     2740                && ![macports::_mport_supports_archs $depport $required_archs]} {
     2741
     2742                set supported_archs [_mportkey $depport supported_archs]
     2743                mportclose $depport
    27262744                set arch_mismatch 1
    27272745                set has_universal 0
     
    27342752                        set variation_array(universal) +
    27352753                        # try again with +universal
    2736                         set subport [mportopen $dep_portinfo(porturl) $options [array get variation_array]]
    2737                         if {[macports::_mport_supports_archs $subport $required_archs]} {
     2754                        set depport [mportopen $dep_portinfo(porturl) $options [array get variation_array]]
     2755                        if {[macports::_mport_supports_archs $depport $required_archs]} {
    27382756                            set arch_mismatch 0
    27392757                        }
     
    27492767                if {$recurseDeps} {
    27502768                    # Add to the list we need to recurse on.
    2751                     lappend subPorts $subport
    2752                 }
    2753    
     2769                    lappend depPorts $depport
     2770                }
     2771
    27542772                # Append the sub-port's provides to the port's requirements list.
    2755                 set subport_provides "[ditem_key $subport provides]"
    2756                 ditem_append_unique $mport requires $subport_provides
    2757                 set depspec_seen($seenkey) $subport_provides
     2773                set depport_provides "[ditem_key $depport provides]"
     2774                ditem_append_unique $mport requires $depport_provides
     2775                set depspec_seen($seenkey) $depport_provides
    27582776            } else {
    27592777                set depspec_seen($seenkey) 0
     
    27622780    }
    27632781
    2764     # Loop on the subports.
     2782    # Loop on the depports.
    27652783    if {$recurseDeps} {
    2766         foreach subport $subPorts {
     2784        foreach depport $depPorts {
    27672785            # Sub ports should be installed (all dependencies must be satisfied).
    2768             set res [mportdepends $subport "" $recurseDeps $skipSatisfied 1]
     2786            set res [mportdepends $depport "" $recurseDeps $skipSatisfied 1]
    27692787            if {$res != 0} {
    27702788                return $res
     
    30283046
    30293047    # check if we we need to rebuild base
    3030     set comp [rpm-vercomp $macports_version_new $macports::autoconf::macports_version]
     3048    set comp [vercmp $macports_version_new $macports::autoconf::macports_version]
    30313049    if {$use_the_force_luke == "yes" || $comp > 0} {
    30323050        if {[info exists options(ports_dryrun)] && $options(ports_dryrun) == "yes"} {
     
    30633081            }
    30643082
    3065             if {$prefix == "/usr/local"} {
     3083            if {$prefix == "/usr/local" || $prefix == "/usr"} {
    30663084                append configure_args " --with-unsupported-prefix"
    30673085            }
    30683086
     3087            # Choose a sane compiler
    30693088            set cc_arg ""
    3070             switch -glob -- $::macports::macosx_version {
    3071                 10.[45] { set cc_arg "CC=/usr/bin/gcc-4.0 " }
    3072                 10.6     { set cc_arg "CC=/usr/bin/gcc-4.2 " }
    3073                 10.*     { set cc_arg "CC=/usr/bin/llvm-gcc-4.2 " }
     3089            if {$::macports::os_platform == "darwin"} {
     3090                set cc_arg "CC=/usr/bin/cc "
    30743091            }
    30753092
     
    32523269        set epoch [lindex $i 5]
    32533270        if { $version_installed == {} || ($epoch > $epoch_installed && $version != $version_installed) ||
    3254                 ($epoch >= $epoch_installed && [rpm-vercomp $version $version_installed] > 0)
     3271                ($epoch >= $epoch_installed && [vercmp $version $version_installed] > 0)
    32553272                || ($epoch >= $epoch_installed
    3256                     && [rpm-vercomp $version $version_installed] == 0
     3273                    && [vercmp $version $version_installed] == 0
    32573274                    && $revision > $revision_installed)} {
    32583275            set version_installed $version
     
    33863403    set will_install yes
    33873404    # check installed version against version in ports
    3388     if { ( [rpm-vercomp $version_installed $version_in_tree] > 0
    3389             || ([rpm-vercomp $version_installed $version_in_tree] == 0
    3390                 && [rpm-vercomp $revision_installed $revision_in_tree] >= 0 ))
     3405    if { ( [vercmp $version_installed $version_in_tree] > 0
     3406            || ([vercmp $version_installed $version_in_tree] == 0
     3407                && [vercmp $revision_installed $revision_in_tree] >= 0 ))
    33913408        && ![info exists options(ports_upgrade_force)] } {
    33923409        if {$portname != $newname} {
  • branches/gsoc11-statistics/base/src/package1.0/portarchivefetch.tcl

    r79672 r82923  
    6767proc portarchivefetch::filter_sites {} {
    6868    global prefix porturl
     69    set mirrorfile [get_full_archive_sites_path]
     70    if {[file exists $mirrorfile]} {
     71        source $mirrorfile
     72    }
    6973    set ret {}
    7074    foreach site [array names portfetch::mirror_sites::archive_prefix] {
     
    7579    if {[file rootname [file tail $porturl]] == [file rootname [file tail [get_portimage_path]]]} {
    7680        lappend ret [string range $porturl 0 end-[string length [file tail $porturl]]]
     81        archive.subdir
    7782    }
    7883    return $ret
     
    9499    archiveTypeIsSupported $portarchivetype
    95100
    96     if {[file isfile ${archive.path}]} {
    97         ui_debug "Found archive: ${archive.path}"
    98         set all_archive_files {}
    99         set fetch_urls {}
    100     } else {
    101         set archive.file [file tail ${archive.path}]
    102         lappend all_archive_files ${archive.file}
    103         if {[info exists archive_sites]} {
    104             lappend fetch_urls archive_sites ${archive.file}
    105         }
     101    set archive.file [file tail ${archive.path}]
     102    lappend all_archive_files ${archive.file}
     103    if {[info exists archive_sites]} {
     104        lappend fetch_urls archive_sites ${archive.file}
    106105    }
    107106}
  • branches/gsoc11-statistics/base/src/package1.0/portdpkg.tcl

    r79672 r82923  
    5454
    5555proc portdpkg::main {args} {
    56         global UI_PREFIX destpath os.arch os.platform
     56        global UI_PREFIX destpath os.arch os.platform supported_archs configure.build_arch
    5757   
    5858        ui_msg "$UI_PREFIX [format [msgcat::mc "Creating dpkg for %s-%s"] [option subport] [option version]]"
     
    132132        # freebsd and openbsd. Use of gnu in this string is reserved for the           
    133133        # GNU/Hurd operating system.
    134         switch -regex ${os.arch} {
     134        switch -regex ${configure.build_arch} {
    135135                i[3-9]86 { set pkg_arch "i386" }
     136                x86_64 { set pkg_arch "x86_64" }
    136137                default { set pkg_arch ${os.arch} }
    137138        }
     
    141142        if {${os.platform} != "linux"} {
    142143                set pkg_arch "${os.platform}-${pkg_arch}"
     144        } elseif {${pkg_arch} == "x86_64"} {
     145                set pkg_arch "amd64"
     146        }
     147       
     148        # An architecture-independent package
     149        if {$supported_archs == "noarch"} {
     150                set pkg_arch "all"
    143151        }
    144152
  • branches/gsoc11-statistics/base/src/package1.0/portpkg.tcl

    r79672 r82923  
    5656
    5757    ui_msg "$UI_PREFIX [format [msgcat::mc "Creating pkg for %s-%s"] ${subport} ${version}]"
     58
     59    if {[getuid] == 0 && [geteuid] != 0} {
     60        elevateToRoot "pkg"
     61    }
    5862
    5963    return [package_pkg $subport $version $revision]
  • branches/gsoc11-statistics/base/src/pextlib1.0/Makefile

    r72727 r82923  
    1717
    1818test:: ${SHLIB_NAME}
    19         ${TCLSH} tests/checksums.tcl ${SHLIB_NAME}
    20         ${TCLSH} tests/curl.tcl ${SHLIB_NAME}
    21         ${TCLSH} tests/filemap.tcl ${SHLIB_NAME}
    22         ${TCLSH} tests/fs-traverse.tcl ${SHLIB_NAME}
    23         ${TCLSH} tests/symlink.tcl ${SHLIB_NAME}
    24         ${TCLSH} tests/unsetenv.tcl ${SHLIB_NAME}
     19        ${TCLSH} tests/checksums.tcl ./${SHLIB_NAME}
     20        ${TCLSH} tests/curl.tcl ./${SHLIB_NAME}
     21        ${TCLSH} tests/filemap.tcl ./${SHLIB_NAME}
     22        ${TCLSH} tests/fs-traverse.tcl ./${SHLIB_NAME}
     23        ${TCLSH} tests/symlink.tcl ./${SHLIB_NAME}
     24        ${TCLSH} tests/unsetenv.tcl ./${SHLIB_NAME}
     25        ${TCLSH} tests/vercomp.tcl ./${SHLIB_NAME}
  • branches/gsoc11-statistics/base/src/pextlib1.0/Pextlib.c

    r79672 r82923  
    400400        /* Crashes on Linux without this. */
    401401        setenv("MACPORTS_DUMMY", "", 0);
     402        unsetenv("MACPORTS_DUMMY");
    402403#endif
    403404    } else {
     
    484485        Tcl_CreateObjCommand(interp, "fs-traverse", FsTraverseCmd, NULL, NULL);
    485486        Tcl_CreateObjCommand(interp, "filemap", FilemapCmd, NULL, NULL);
    486         Tcl_CreateObjCommand(interp, "rpm-vercomp", RPMVercompCmd, NULL, NULL);
     487#if 1
     488        /* the name "rpm-vercomp" is deprecated, use "vercmp" instead */
     489        Tcl_CreateObjCommand(interp, "rpm-vercomp", VercompCmd, NULL, NULL);
     490#endif
     491        Tcl_CreateObjCommand(interp, "vercmp", VercompCmd, NULL, NULL);
    487492        Tcl_CreateObjCommand(interp, "rmd160", RMD160Cmd, NULL, NULL);
    488493        Tcl_CreateObjCommand(interp, "sha256", SHA256Cmd, NULL, NULL);
  • branches/gsoc11-statistics/base/src/pextlib1.0/fs-traverse.c

    r79672 r82923  
    147147        } else if (*(xpath + tlen) == '/') {
    148148            xpath += tlen + 1;
     149        } else if (*(target + tlen - 1) == '/') {
     150            xpath += tlen;
    149151        }
    150152    }
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha2.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha2.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha256cmd.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/sha256cmd.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/gsoc11-statistics/base/src/pextlib1.0/tests/curl.tcl

    r64988 r82923  
    2525       
    2626        # use --disable-epsv
    27         curl fetch --disable-epsv ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/archive/netperf-2.2pl5.tar.gz $tempfile
    28         test {[md5 file $tempfile] == "a4b0f4a5fbd8bec23002ad8023e01729"}
     27        #curl fetch --disable-epsv ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/archive/netperf-2.2pl5.tar.gz $tempfile
     28        #test {[md5 file $tempfile] == "a4b0f4a5fbd8bec23002ad8023e01729"}
    2929       
    3030        # use -u
  • branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.c

    r79672 r82923  
    22 * vercomp.c
    33 * $Id$
    4  * RPM compatible version comparison
     4 * version comparison
    55 *
    66 * Author: Landon Fuller <landonf@macports.org>
     
    4949 * If A is newer than B, return an integer > 0
    5050 * If A and B are equal, return 0
    51  * If B is newer than A, retun an integer < 0
     51 * If B is newer than A, return an integer < 0
    5252 */
    5353
    54 static int rpm_vercomp (const char *versionA, const char *versionB) {
     54static int vercmp (const char *versionA, const char *versionB) {
    5555        const char *ptrA, *ptrB;
    5656        const char *eptrA, *eptrB;
     
    156156}
    157157
    158 int RPMVercompCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
     158int VercompCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
    159159{
    160160        Tcl_Obj *tcl_result;
     
    170170        versionB = Tcl_GetString(objv[2]);
    171171
    172         rval = rpm_vercomp(versionA, versionB);
     172        rval = vercmp(versionA, versionB);
    173173
    174174        tcl_result = Tcl_NewIntObj(rval);
  • branches/gsoc11-statistics/base/src/pextlib1.0/vercomp.h

    r79672 r82923  
    3333 */
    3434
    35 int RPMVercompCmd(ClientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
     35int VercompCmd(ClientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
  • branches/gsoc11-statistics/base/src/port/port.tcl

    r82920 r82923  
    237237# show the URL for the ticket reporting instructions
    238238proc print_tickets_url {args} {
    239     ui_notice "To report a bug, see <http://guide.macports.org/#project.tickets>"
     239    if {${macports::prefix} != "/usr/local" && ${macports::prefix} != "/usr"} {
     240        ui_notice "To report a bug, see <http://guide.macports.org/#project.tickets>"
     241    }
    240242}
    241243
     
    481483    set avr_ [split $a_(version) "_"]
    482484    set bvr_ [split $b_(version) "_"]
    483     set vercmp [rpm-vercomp [lindex $avr_ 0] [lindex $bvr_ 0]]
    484     if {$vercmp != 0} {
    485         return $vercmp
     485    set versioncmp [vercmp [lindex $avr_ 0] [lindex $bvr_ 0]]
     486    if {$versioncmp != 0} {
     487        return $versioncmp
    486488    }
    487489    set ar_ [lindex $avr_ 1]
     
    854856                set comp_result [expr $installed_epoch - $latest_epoch]
    855857                if { $comp_result == 0 } {
    856                     set comp_result [rpm-vercomp $installed_version $latest_version]
     858                    set comp_result [vercmp $installed_version $latest_version]
    857859                }
    858860            }
     
    12811283        ^depends_extract:   -
    12821284        ^depends_fetch:     -
     1285        ^replaced_by:       -
    12831286        ^revision:          -
    12841287        ^license:           { # Handle special port selectors
     
    20912094                            array set variant $vinfo($v)
    20922095                            if {[info exists variant(is_default)]} {
    2093                                 set varmodifier "\[+]"
     2096                                set varmodifier "\[$variant(is_default)]"
    20942097                            }
    20952098                        }
     
    32703273            # Compare versions, first checking epoch, then version, then revision
    32713274            set epoch_comp_result [expr $installed_epoch - $latest_epoch]
    3272             set comp_result [rpm-vercomp $installed_version $latest_version]
     3275            set comp_result [vercmp $installed_version $latest_version]
    32733276            if { $comp_result == 0 } {
    32743277                set comp_result [expr $installed_revision - $latest_revision]
     
    34923495            foreach v [lsort $portinfo(variants)] {
    34933496                unset -nocomplain vconflicts vdescription vrequires
     3497                set varmodifier "   "
    34943498                # Retrieve variants' information from the new format.
    34953499                if {[info exists vinfo]} {
     
    35133517                        set varmodifier "($global_variations($v))"
    35143518                    } elseif {[info exists variant(is_default)]} {
    3515                         set varmodifier "\[+]"
    3516                     } else {
    3517                         set varmodifier "   "
     3519                        set varmodifier "\[$variant(is_default)\]"
    35183520                    }
    35193521                    if {[info exists variant(requires)]} {
     
    42534255                 line long_description
    42544256                 maintainer maintainers name platform platforms portdir pretty
    4255                  replaced_by revision variant variants version}
     4257                 replaced_by revision subports variant variants version}
    42564258    contents    {size {units 1}}
    42574259    deps        {index no-build}
     
    43494351                            lappend errlst "--[lindex $e 0]"
    43504352                        }
    4351                         return -code error "${action} --${key} is ambiguous: \n  [join $errlst "\n "]"
     4353                        return -code error "\"port ${action} --${key}\" is ambiguous: \n  port ${action} [join $errlst "\n  port ${action} "]"
    43524354                    }
    43534355                    set key   [lindex [lindex $kopts 0] 0]
     
    45064508        } else {
    45074509            if {[llength $actions] > 1} {
    4508                 puts "Ambiguous action \"$action\": could be any of {$actions}."
     4510                ui_error "\"port ${action}\" is ambiguous: \n  port [join $actions "\n  port "]"
    45094511            } else {
    4510                 puts "Unrecognized action \"$action\""
     4512                ui_error "Unrecognized action \"port $action\""
    45114513            }
    45124514            set action_status 1
     
    48664868    set exit_status [process_command_files $ui_options(ports_commandfiles)]
    48674869}
     4870if {$exit_status == -999} {
     4871    set exit_status 0
     4872}
    48684873
    48694874# shut down macports1.0
  • branches/gsoc11-statistics/base/src/port/portindex.tcl

    r79672 r82923  
    147147            } else {
    148148                set prefix $save_prefix
     149                array unset portinfo
    149150                array set portinfo [mportinfo $interp]
    150151                mportclose $interp
  • branches/gsoc11-statistics/base/src/port1.0/port_autoconf.tcl.in

    r79672 r82923  
    3434namespace eval portutil::autoconf {
    3535        variable bzip2_path "@BZIP2@"
     36        variable lzma_path "@LZMA@"
     37        variable xz_path "@XZ@"
    3638        variable cp_path "@CP@"
    3739        variable cpio_path "@CPIO@"
  • branches/gsoc11-statistics/base/src/port1.0/portclean.tcl

    r79672 r82923  
    5656    ui_notice "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option subport]]"
    5757
    58     if {![file writable $prefix] || ([getuid] == 0 && [geteuid] != 0)} {
     58    if {[getuid] == 0 && [geteuid] != 0} {
    5959        elevateToRoot "clean"
    6060    }
  • branches/gsoc11-statistics/base/src/port1.0/portconfigure.tcl

    r79672 r82923  
    195195    set name ""
    196196    switch -exact ${configure.compiler} {
     197        cc { set name "System cc" }
    197198        gcc { set name "System gcc" }
    198199        gcc-3.3 { set name "Mac OS X gcc 3.3" }
     
    353354# internal function to determine the default compiler
    354355proc portconfigure::configure_get_default_compiler {args} {
    355     global macosx_deployment_target
    356     switch -exact ${macosx_deployment_target} {
    357         "10.4"      -
    358         "10.5"      { return gcc-4.0 }
    359         "10.6"      { return gcc-4.2 }
    360         "10.7"      { return llvm-gcc-4.2 }
    361         default     { return gcc }
     356    global xcodeversion macosx_deployment_target
     357    if {$xcodeversion == "none" || $xcodeversion == ""} {
     358        return cc
     359    } elseif {[vercmp $xcodeversion 4.2] >= 0} {
     360        return clang
     361    } elseif {[vercmp $xcodeversion 4.0] >= 0} {
     362        return llvm-gcc-4.2
     363    } elseif {[vercmp $xcodeversion 3.2] >= 0 && $macosx_deployment_target != "10.4"} {
     364        return gcc-4.2
     365    } else {
     366        return gcc-4.0
    362367    }
    363368}
     
    368373    set ret ""
    369374    switch -exact ${configure.compiler} {
     375        cc {
     376            switch -exact ${type} {
     377                cc   { set ret /usr/bin/cc }
     378                objc { set ret /usr/bin/cc }
     379                cxx  { set ret /usr/bin/c++ }
     380                cpp  { set ret /usr/bin/cpp }
     381            }
     382        }
    370383        gcc {
    371384            switch -exact ${type} {
     
    439452                objc { set ret ${prefix}/bin/gcc-apple-4.2 }
    440453                cpp  { set ret ${prefix}/bin/cpp-apple-4.2 }
     454                cxx  { set ret ${prefix}/bin/g++-apple-4.2 }
    441455            }
    442456        }
  • branches/gsoc11-statistics/base/src/port1.0/portdistcheck.tcl

    r79672 r82923  
    4848
    4949# define options
    50 options distcheck.type distcheck.check
     50options distcheck.type
    5151
    5252# defaults
    5353default distcheck.type moddate
    54 default distcheck.check moddate
    55 
    56 # Deprecation
    57 option_deprecate distcheck.check distcheck.type
    5854
    5955proc portdistcheck::distcheck_main {args} {
  • branches/gsoc11-statistics/base/src/port1.0/portextract.tcl

    r79672 r82923  
    9393        option extract.cmd [findBinary bzip2 ${portutil::autoconf::bzip2_path}]
    9494    } elseif {[tbool use_lzma]} {
    95         option extract.cmd [binaryInPath "lzma"]
     95        option extract.cmd [findBinary lzma ${portutil::autoconf::lzma_path}]
    9696    } elseif {[tbool use_xz]} {
    97         option extract.cmd [binaryInPath "xz"]
     97        option extract.cmd [findBinary xz ${portutil::autoconf::xz_path}]
    9898    } elseif {[tbool use_zip]} {
    9999        option extract.cmd [findBinary unzip ${portutil::autoconf::unzip_path}]
  • branches/gsoc11-statistics/base/src/port1.0/portfetch.tcl

    r79672 r82923  
    123123default mirror_sites.listpath {"port1.0/fetch"}
    124124
    125 # Deprecation
    126 option_deprecate svn.tag svn.revision
    127 
    128125# Option-executed procedures
    129126option_proc use_bzip2 portfetch::set_extract_type
  • branches/gsoc11-statistics/base/src/port1.0/portlivecheck.tcl

    r79672 r82923  
    4848
    4949# define options
    50 options livecheck.url livecheck.type livecheck.check livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert
     50options livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert
    5151
    5252# defaults
    5353default livecheck.url {$homepage}
    54 default livecheck.check default
    5554default livecheck.type default
    5655default livecheck.md5 ""
     
    6160default livecheck.ignore_sslcert yes
    6261
    63 # Deprecation
    64 option_deprecate livecheck.check livecheck.type
    65 
    6662proc portlivecheck::livecheck_main {args} {
    6763    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version
     
    10298            foreach {master_site} ${master_sites} {
    10399                if {[regexp "^($available_types)(?::(\[^:\]+))?" ${master_site} _ site subdir]} {
     100                    set subdirs [split $subdir /]
     101                    if {[llength $subdirs] > 1} {
     102                        if {[lindex $subdirs 0] == "project"} {
     103                            set subdir [lindex $subdirs 1]
     104                        } else {
     105                            set subdir ""
     106                        }
     107                    }
    104108                    if {${subdir} ne "" && ${livecheck.name} eq "default"} {
    105109                        set livecheck.name ${subdir}
     
    168172                        if {[regexp $the_re $line matched upver]} {
    169173                            set foundmatch 1
    170                             if {$updated_version == 0 || [rpm-vercomp $upver $updated_version] > 0} {
     174                            if {$updated_version == 0 || [vercmp $upver $updated_version] > 0} {
    171175                                set updated_version $upver
    172176                            }
  • branches/gsoc11-statistics/base/src/port1.0/portutil.tcl

    r79672 r82923  
    133133
    134134##
     135# Handle option-strsed
     136#
     137# @param option name of the option
     138# @param args arguments
     139proc handle_option-strsed {option args} {
     140    global $option user_options option_procs
     141
     142    if {![info exists user_options($option)] && [info exists $option]} {
     143        set temp [set $option]
     144        foreach val $args {
     145            set temp [strsed $temp $val]
     146        }
     147        set $option $temp
     148    }
     149}
     150
     151##
    135152# Handle option-replace
    136153#
     
    138155# @param args arguments
    139156proc handle_option-replace {option args} {
    140     global $option user_options option_procs
     157    global $option user_options option_procs deprecated_options
     158
     159    # Deprecate -replace with only one argument, for backwards compatibility call -strsed
     160    # XXX: Remove this in 2.2.0
     161    if {[llength $args] == 1} {
     162        if {![info exists deprecated_options(${option}-replace)]} {
     163            set deprecated_options(${option}-replace) [list ${option}-strsed 0]
     164        }
     165        set refcount [lindex $deprecated_options(${option}-replace) 1]
     166        lset deprecated_options(${option}-replace) 1 [expr $refcount + 1]
     167        return [eval handle_option-strsed $option $args]
     168    }
    141169
    142170    if {![info exists user_options($option)] && [info exists $option]} {
    143         set temp [set $option]
    144         foreach val $args {
    145             set temp [strsed $temp $val]
    146         }
    147         set $option $temp
     171        foreach {old new} $args {
     172            set index [lsearch -exact [set $option] $old]
     173            if {$index == -1} {
     174                continue
     175            }
     176            set $option [lreplace [set $option] $index $index $new]
     177        }
    148178    }
    149179}
     
    161191        interp alias {} $option-append {} handle_option-append $option
    162192        interp alias {} $option-delete {} handle_option-delete $option
     193        interp alias {} $option-strsed {} handle_option-strsed $option
    163194        interp alias {} $option-replace {} handle_option-replace $option
    164195    }
     
    20212052
    20222053            foreach v $value {
    2023                 if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant]} {
     2054                if {[regexp {([-+])([-A-Za-z0-9_]+)} $v whole val variant] && ![info exists variations($variant)]} {
    20242055                    # Retrieve the information associated with this variant.
    20252056                    if {![info exists vinfo($variant)]} {
    20262057                        set vinfo($variant) {}
    20272058                    }
     2059                    array unset info
    20282060                    array set info $vinfo($variant)
    2029 
    2030                     if {![info exists variations($variant)]} {
    2031                         # Set is_default and update vinfo.
    2032                         array set info [list is_default val]
    2033                         array set vinfo [list $variant [array get info]]
    2034 
    2035                         set variations($variant) $val
    2036                     }
     2061                    # Set is_default and update vinfo.
     2062                    set info(is_default) $val
     2063                    array set vinfo [list $variant [array get info]]
     2064
     2065                    set variations($variant) $val
    20372066                }
    20382067            }
     
    20782107    } elseif {[geteuid] != 0} {
    20792108        seteuid 0; setegid 0
     2109        set escalated 1
    20802110    }
    20812111
     
    20842114    set gid [existsgroup nogroup]
    20852115    set realname ${name}
    2086     set home /dev/null
    2087     set shell /dev/null
     2116    set home /var/empty
     2117    set shell /usr/bin/false
    20882118
    20892119    foreach arg $args {
     
    20992129    if {${os.platform} eq "darwin"} {
    21002130        set dscl [findBinary dscl $portutil::autoconf::dscl_path]
     2131        exec $dscl . -create /Users/${name} UniqueID ${uid}
     2132
     2133        # These are implicitly added on Mac OSX Lion.  AuthenticationAuthority
     2134        # causes the user to be visible in the Users & Groups Preference Pane,
     2135        # and the others are just noise, so delete them.
     2136        # https://trac.macports.org/ticket/30168
     2137        exec $dscl . -delete /Users/${name} AuthenticationAuthority
     2138        exec $dscl . -delete /Users/${name} PasswordPolicyOptions
     2139        exec $dscl . -delete /Users/${name} dsAttrTypeNative:KerberosKeys
     2140        exec $dscl . -delete /Users/${name} dsAttrTypeNative:ShadowHashData
     2141
     2142        exec $dscl . -create /Users/${name} RealName ${realname}
    21012143        exec $dscl . -create /Users/${name} Password ${passwd}
    2102         exec $dscl . -create /Users/${name} UniqueID ${uid}
    21032144        exec $dscl . -create /Users/${name} PrimaryGroupID ${gid}
    2104         exec $dscl . -create /Users/${name} RealName ${realname}
    21052145        exec $dscl . -create /Users/${name} NFSHomeDirectory ${home}
    21062146        exec $dscl . -create /Users/${name} UserShell ${shell}
     
    21102150        ui_warn "The requested user '$name' was not created."
    21112151    }
     2152
     2153    if {[info exists escalated]} {
     2154        dropPrivileges
     2155    }
    21122156}
    21132157
     
    21212165    } elseif {[geteuid] != 0} {
    21222166        seteuid 0; setegid 0
     2167        set escalated 1
    21232168    }
    21242169
     
    21502195        ui_warn "addgroup is not implemented on ${os.platform}."
    21512196        ui_warn "The requested group was not created."
     2197    }
     2198
     2199    if {[info exists escalated]} {
     2200        dropPrivileges
    21522201    }
    21532202}
     
    25092558}
    25102559
     2560proc validate_macportsuser {} {
     2561    global macportsuser
     2562    if {[getuid] == 0 && $macportsuser != "root" &&
     2563        ([existsuser $macportsuser] == 0 || [existsgroup $macportsuser] == 0 )} {
     2564        ui_warn "configured user/group $macportsuser does not exist, will build as root"
     2565        set macportsuser "root"
     2566    }
     2567}
     2568
    25112569# dependency analysis helpers
    25122570
     
    26362694}
    26372695
     2696# returns the flags that should be passed to the compiler to choose arch(s)
     2697proc get_canonical_archflags {{tool cc}} {
     2698    if {![variant_exists universal] || ![variant_isset universal]} {
     2699        return [option configure.${tool}_archflags]
     2700    } else {
     2701        if {$tool == "cc" || $tool == "objc"} {
     2702            set tool c
     2703        }
     2704        return [option configure.universal_${tool}flags]
     2705    }
     2706}
     2707
    26382708# check that the selected archs are supported
    26392709proc check_supported_archs {} {
     
    26712741                set rec 3.1.4
    26722742            }
    2673             default {
     2743            10.6 {
    26742744                set min 3.2
    26752745                set ok 3.2
    26762746                set rec 3.2.6
    26772747            }
     2748            default {
     2749                set min 4.1
     2750                set ok 4.1
     2751                set rec 4.1
     2752            }
    26782753        }
    26792754        if {$xcodeversion == "none"} {
    26802755            ui_warn "Xcode does not appear to be installed; most ports will likely fail to build."
    2681         } elseif {[rpm-vercomp $xcodeversion $min] < 0} {
     2756        } elseif {[vercmp $xcodeversion $min] < 0} {
    26822757            ui_error "The installed version of Xcode (${xcodeversion}) is too old to use on the installed OS version. Version $rec or later is recommended on Mac OS X ${macosx_version}."
    26832758            return 1
    2684         } elseif {[rpm-vercomp $xcodeversion $ok] < 0} {
     2759        } elseif {[vercmp $xcodeversion $ok] < 0} {
    26852760            ui_warn "The installed version of Xcode (${xcodeversion}) is known to cause problems. Version $rec or later is recommended on Mac OS X ${macosx_version}."
    26862761        }
  • branches/gsoc11-statistics/base/src/programs/daemondo/Makefile.in

    r54794 r82923  
    99mandircat8=     ${mandir}/cat8
    1010
    11 CFLAGS_QUICHEEATERS     = -W -Wall
     11CFLAGS_PEDANTIC =
    1212CPPFLAGS        += -I../..
    1313SRCS            = main.c
  • branches/gsoc11-statistics/base/src/registry2.0/Makefile

    r66844 r82923  
    2121
    2222test:: ${SHLIB_NAME}
    23         ${TCLSH} tests/entry.tcl ${SHLIB_NAME}
    24         ${TCLSH} tests/depends.tcl ${SHLIB_NAME}
     23        ${TCLSH} tests/entry.tcl ./${SHLIB_NAME}
     24        ${TCLSH} tests/depends.tcl ./${SHLIB_NAME}
    2525
    2626distclean:: clean
  • branches/gsoc11-statistics/base/src/registry2.0/portimage.tcl

    r79672 r82923  
    250250## @return 1 if file needs to be explicitly deleted if we have to roll back, 0 otherwise
    251251proc _activate_file {srcfile dstfile} {
    252     switch [file type $srcfile] {
     252    if {[catch {set filetype [file type $srcfile]} result]} {
     253        # this can happen if the archive was built on case-sensitive and we're case-insensitive
     254        # we know any existing dstfile is ours because we checked for conflicts earlier
     255        if {![catch {file type $dstfile}]} {
     256            ui_debug "skipping case-conflicting file: $srcfile"
     257            return 0
     258        } else {
     259            error $result
     260        }
     261    }
     262    switch $filetype {
    253263        directory {
    254264            # Don't recursively copy directories
     
    280290# returns: path to the extracted directory
    281291proc extract_archive_to_tmpdir {location} {
    282     set extractdir [mkdtemp [file join [macports::gettmpdir] mpextractXXXXXXXX]]
     292    global macports::registry.path
     293    set extractdir [mkdtemp [file dirname $location]/mpextractXXXXXXXX]
     294    set startpwd [pwd]
    283295
    284296    try {
    285         set startpwd [pwd]
    286297        if {[catch {cd $extractdir} err]} {
    287298            throw MACPORTS $err
     
    295306        set unarchive.args {}
    296307        set unarchive.pipe_cmd ""
    297         set unarchive.type [file tail $location]
     308        set unarchive.type [file extension $location]
    298309        switch -regex ${unarchive.type} {
    299310            cp(io|gz) {
     
    464475                        # files to a backup file, both in the filesystem and in the
    465476                        # registry
    466                         if { [file exists $file] } {
     477                        if { ![catch {file type $file}] } {
    467478                            set bakfile "${file}${baksuffix}"
    468479                            ui_warn "File $file already exists.  Moving to: $bakfile."
  • branches/gsoc11-statistics/base/src/registry2.0/receipt_sqlite.tcl

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.