[MacPorts] #38555: RFE: Move "rec_glob" proc from nodejs portfile into base
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base -------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Keywords: | Port: -------------------------+-------------------------------- I was looking through the nodejs portfile and came across this recursive glob function: {{{ proc rec_glob {basedir pattern} { set files [glob -directory $basedir -nocomplain -type f $pattern] foreach dir [glob -directory $basedir -nocomplain -type d *] { eval lappend files [rec_glob $dir $pattern] } return $files } }}} It would be useful to have this proc available in base so I wouldn't have to copy it from the nodejs portfile if I ever want to use it myself. -- Ticket URL: <https://trac.macports.org/ticket/38555> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by ryandesign@…): Isn't this kind of thing what `fs-traverse` is for? -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by egall@…): Replying to [comment:1 ryandesign@…]:
Isn't this kind of thing what `fs-traverse` is for?
I wouldn't know, `fs-traverse` isn't documented in the guide and I don't know where it's located in the code, so I can't tell if they work the same way. ' -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by larryv@…): Replying to [ticket:38555 egall@…]:
It would be useful to have this proc available in base so I wouldn't have to copy it from the nodejs portfile if I ever want to use it myself.
I wasn’t aware that MacPorts base was your personal code snippet repository. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:2 egall@…]:
I wouldn't know, `fs-traverse` isn't documented in the guide and I don't know where it's located in the code, so I can't tell if they work the same way.
{{{ $ man portfile }}} -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by egall@…): Replying to [comment:3 larryv@…]:
Replying to [ticket:38555 egall@…]:
It would be useful to have this proc available in base so I wouldn't have to copy it from the nodejs portfile if I ever want to use it myself.
I wasn’t aware that MacPorts base was your personal code snippet repository.
Well I didn't mean just me personally; I thought it could be useful as a library function generally. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:5 egall@…]:
Well I didn't mean just me personally; I thought it could be useful as a library function generally.
`fs-traverse` is a more general function than this `rec_glob`; it executes a body of code for every file or directory in the given directory hierarchy. Of course, a port maintainer is free to define and use any procs they wish. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by egall@…): So apparently `fs-traverse` is a pextlib function... in that case the issue for documenting it in the guide is #15623. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by egall@…): Replying to [comment:4 larryv@…]:
Replying to [comment:2 egall@…]:
I wouldn't know, `fs-traverse` isn't documented in the guide and I don't know where it's located in the code, so I can't tell if they work the same way.
{{{ $ man portfile }}}
Thanks, I will just use that in the meantime. However, in the longer term, it would make more sense for there to be a specific manpage for the proc itself that shared a name with it, so I could just do {{{ $ man n fs-traverse }}} instead of having to remember that it was in the `Portfile` manpage. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
#38555: RFE: Move "rec_glob" proc from nodejs portfile into base --------------------------+-------------------------------- Reporter: egall@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by larryv@…): Replying to [comment:8 egall@…]:
Thanks, I will just use that in the meantime. However, in the longer term, it would make more sense for there to be a specific manpage for the proc itself that shared a name with it, so I could just do {{{ $ man n fs-traverse }}} instead of having to remember that it was in the `Portfile` manpage, and then having to scroll down forever until I reach it.
The presence of such a manpage would imply that `fs-traverse` was a general Tcl proc intended for use outside of MacPorts, which it isn’t. -- Ticket URL: <https://trac.macports.org/ticket/38555#comment:9> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts