Opened 20 years ago

Closed 20 years ago

Last modified 8 years ago

#1570 closed defect (fixed)

port install fails with message: "Unable to execute port: Directory not found"

Reported by: rod_gilchrist@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

After upgrading to Panther I was no longer able to install ports.

The problem was that the directories in /usr/X11R6 including lib had gotten set to mode 700 somehow.

The effect was that readdir called by _dportsearchpath aborted its search for libraries when it was unable to read the directory /usr/X11R6/lib, and an unhelpful error message was returned.

The fix is to catch the error and handle it better in _dportsearchpath (the fix below prints a message and doesn't abort) and to improve the error message in readdir (which is likely a cut and paste error).

--- base/src/darwinports1.0/darwinports.tcl      Sat Feb 28 13:50:08 2004
+++ base/src/darwinports1.0/fixed_darwinports.tcl        Sat Feb 28 13:49:49 2004
@@ -332,7 +332,11 @@
        if {![file isdirectory $path]} {
            continue
        }
-       foreach filename [readdir $path] {
+       if {[catch {set filelist [readdir $path]} result]} {
+           puts "_dportsearchpath: $result : $path"
+           set filelist ""
+       }
+       foreach filename $filelist {
            if {[regexp $depregex $filename] == 1} {
                ui_debug "Found Dependency: path: $path filename: $filename regex: $depregex"
                set found 1
--- base/src/pextlib1.0/Pextlib.c   Sat Feb 28 14:00:35 2004
+++ base/src/pextlib1.0/fixed_Pextlib.c     Sat Feb 28 13:13:29 2004
@@ -496,7 +496,7 @@
        path = Tcl_GetString(objv[1]);
        dirp = opendir(path);
        if (!dirp) {
-               Tcl_SetResult(interp, "Directory not found", TCL_STATIC);
+               Tcl_SetResult(interp, "Can't read directory", TCL_STATIC);
                return TCL_ERROR;
        }
        tcl_result = Tcl_NewListObj(0, NULL);

Change History (2)

comment:1 Changed 20 years ago by toby@…

Resolution: fixed
Status: newclosed

Committed with a bit of modification. Thanks!

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Note: See TracTickets for help on using tickets.