Your MacPorts ports need some love: the "cd" command is going away
Hi! You're receiving this email because a MacPorts port you maintain uses the Tcl command "cd" to change into a directory for some reason. The "cd" command has been deemed harmful for MacPorts, so a future version of MacPorts will hide it from portfiles [1]. (MacPorts trunk already does [2].) Therefore it's necessary to remove this command everywhere it occurs in your portfiles, so that your ports continue to function in future versions of MacPorts. To be clear: what's no longer ok is using something like this: cd ${worksrcdir} Instances of "cd" inside a "system" invocation, however, are still fine and do not need to be changed: system "cd ${worksrcdir} && whatever" If you need help figuring out how best to avoid using the Tcl "cd" command in your ports, you can post a message to the macports-dev mailing list, or just reply to this message. You can also check recent commits to the repository for ideas [3] (search the log for "cd"); I'm busy fixing this issue in various ports that don't have a maintainer. Note that for some of your ports, tickets may already have been filed in Trac, and for some of those tickets, patches may already be attached, such that all you have to do is test it and commit it. If you do not have commit access yourself, feel free to attach a tested patch to a ticket and let me know which ticket, or just send me the patch as an attachment in an email, and I'll be happy to commit it for you. To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)): port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]" If for any reason you no longer wish to maintain some or all of your ports, please let me know which ports I'll take you off the maintainer list. Thank you. Ryan Schmidt, for The MacPorts Project [1] http://trac.macports.org/projects/macports/ticket/12914 [2] http://trac.macports.org/projects/macports/changeset/28796 [3] http://trac.macports.org/projects/macports/log/trunk/dports
Ryan Schmidt wrote:
Hi! You're receiving this email because a MacPorts port you maintain uses the Tcl command "cd" to change into a directory for some reason. The "cd" command has been deemed harmful for MacPorts, so a future version of MacPorts will hide it from portfiles [1]. (MacPorts trunk already does [2].) Therefore it's necessary to remove this command everywhere it occurs in your portfiles, so that your ports continue to function in future versions of MacPorts.
I think I fixed my ports, so maybe there is a bug report in your grep/regexp ? Or maybe I missed one, in that case I'm thankful for an email or bug report... --anders
On Nov 12, 2007, at 03:58, Anders F Björklund wrote:
Ryan Schmidt wrote:
Hi! You're receiving this email because a MacPorts port you maintain uses the Tcl command "cd" to change into a directory for some reason. The "cd" command has been deemed harmful for MacPorts, so a future version of MacPorts will hide it from portfiles [1]. (MacPorts trunk already does [2].) Therefore it's necessary to remove this command everywhere it occurs in your portfiles, so that your ports continue to function in future versions of MacPorts.
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
I think I fixed my ports, so maybe there is a bug report in your grep/regexp ?
Or maybe I missed one, in that case I'm thankful for an email or bug report...
Anders, i386-mingw32-libunicows still uses "cd" in its post-destroot.
Ryan Schmidt wrote:
Or maybe I missed one, in that case I'm thankful for an email or bug report...
Anders, i386-mingw32-libunicows still uses "cd" in its post-destroot.
Not anymore it doesn't :-) http://trac.macports.org/projects/macports/changeset/30954 Thanks, --anders
On Nov 12, 2007, at 04:13, Anders F Björklund wrote:
Ryan Schmidt wrote:
Or maybe I missed one, in that case I'm thankful for an email or bug report...
Anders, i386-mingw32-libunicows still uses "cd" in its post-destroot.
Not anymore it doesn't :-) http://trac.macports.org/projects/macports/changeset/30954
Super! :)
- cd ${workpath}/libunicows-${version}/docs xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} - xinstall -m 644 license.txt readme.txt \ + xinstall -m 644 ${workpath}/libunicows-${version}/docs/license.txt \ + ${workpath}/libunicows-${version}/docs/readme.txt \ ${destroot}${prefix}/share/doc/${name}
Don't forget about the -W option to xinstall which can be used this way: xinstall -m 644 -W ${workpath}/libunicows-${version}/docs \ license.txt \ readme.txt \ ${destroot}${prefix}/share/doc/${name}
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
I'm getting the error "xargs: unterminated quote". And is "space" a literal or is it to be replaced by a space? Mark
MacPorts Development <macports-dev@lists.macosforge.org> writes:
Hi! You're receiving this email because a MacPorts port you maintain uses the Tcl command "cd" to change into a directory for some reason. The "cd" command has been deemed harmful for MacPorts, so a future version of MacPorts will hide it from portfiles [1]. (MacPorts trunk already does [2].) Therefore it's necessary to remove this command everywhere it occurs in your portfiles, so that your ports continue to function in future versions of MacPorts.
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
I just realized that a number of my ports use "cd ${somedir}" in the ui_msgs to instruct users. I hope none of my ports use the "cd" Tcl primitive, but I'm still having trouble getting this command right to know for sure. Mark
Hi Ryan, I checked the ports I maintain (py-supervisor, py-medusa, py-meld3) and don't see any use of the cd command. Please let me know if I missed something. Thanks, Roger On 11/12/07, Ryan Schmidt <ryandesign@macports.org> wrote:
Hi! You're receiving this email because a MacPorts port you maintain uses the Tcl command "cd" to change into a directory for some reason. The "cd" command has been deemed harmful for MacPorts, so a future version of MacPorts will hide it from portfiles [1]. (MacPorts trunk already does [2].) Therefore it's necessary to remove this command everywhere it occurs in your portfiles, so that your ports continue to function in future versions of MacPorts.
To be clear: what's no longer ok is using something like this:
cd ${worksrcdir}
Instances of "cd" inside a "system" invocation, however, are still fine and do not need to be changed:
system "cd ${worksrcdir} && whatever"
If you need help figuring out how best to avoid using the Tcl "cd" command in your ports, you can post a message to the macports-dev mailing list, or just reply to this message. You can also check recent commits to the repository for ideas [3] (search the log for "cd"); I'm busy fixing this issue in various ports that don't have a maintainer.
Note that for some of your ports, tickets may already have been filed in Trac, and for some of those tickets, patches may already be attached, such that all you have to do is test it and commit it. If you do not have commit access yourself, feel free to attach a tested patch to a ticket and let me know which ticket, or just send me the patch as an attachment in an email, and I'll be happy to commit it for you.
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
If for any reason you no longer wish to maintain some or all of your ports, please let me know which ports I'll take you off the maintainer list.
Thank you. Ryan Schmidt, for The MacPorts Project
[1] http://trac.macports.org/projects/macports/ticket/12914
[2] http://trac.macports.org/projects/macports/changeset/28796
[3] http://trac.macports.org/projects/macports/log/trunk/dports
_______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-dev
Hi Ryan, Apology for a stupid question, but I can't get your script to run: On Nov 12, 2007, at 1:37 AM, Ryan Schmidt wrote:
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
Am I doing something wrong? This is on Leopard with a fresh install of 1.5.0 -enp ernest$ port file maintainer:drernie@macosforge.org Can't map the URL 'file://.' to a port description file ("Could not find Portfile in /Users/ernest"). Please verify that the directory and portfile syntax are correct. To use the current port, you must be in a port's directory. (you might also see this message if a pseudo-port such as outdated or installed expands to no ports). Error: Port not found
On Nov 12, 2007, at 11:47, markd@macports.org wrote:
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
I'm getting the error "xargs: unterminated quote". And is "space" a literal or is it to be replaced by a space?
It should work as given, except for replacing "EMAIL" with your maintainer name. Here's the output I get for you: port file maintainer:markd \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]" \ | sed s%^/Users/rschmidt/macports/dports/%% net/argus-monitor/Portfile: cd ${prefix}/etc/postfix devel/expect/Portfile:post-destroot { cd ${destroot}$ {prefix}/lib net/monarch/Portfile: cd ${monarchdir} net/monarch/Portfile: cd ${monarchdir} net/nagios/Portfile: cd ${prefix}/etc/nagios net/nedi/Portfile: cd ${prefix}/apache2/conf net/nedi/Portfile: cd ${prefix}/share/${name} net/nedi/Portfile: cd ${nedidir}${name} net/nedi/Portfile:0 * * * * cd ${nedidir}${name} ; ./nedi.pl -c >> / dev/null 2>&1 net/netmrg/Portfile: cd ${prefix}/share/netmrg/db net/nrg/Portfile: cd ${prefix}/var/${name} www/php5-rrdtool/Portfile: cd ${worksrcpath} net/rancid/Portfile: cd <Apache-directory>/lg net/smokeping/Portfile: cd ${smokedata}/log net/smokeping/Portfile: cd ${smokeetc} mail/sympa/Portfile: cd ${prefix}/apache2/conf mail/vm-pop3d/Portfile: cd ${prefix}/etc/postfix mail/vm-pop3d/Portfile: cd ${prefix}/etc/${name} mail/vm-pop3d/Portfile: cd my-vdomain1.com net/zabbix/Portfile: cd ${prefix}/share/zabbix/schema net/zabbix/Portfile: cd ${prefix}/share/zabbix/data On Nov 12, 2007, at 12:41, markd@macports.org wrote:
I just realized that a number of my ports use "cd ${somedir}" in the ui_msgs to instruct users. I hope none of my ports use the "cd" Tcl primitive, but I'm still having trouble getting this command right to know for sure.
Good point! You're right, my search will erroneously flag occurrences of "cd" within ui_msgs. Not sure how to filter those out automatically.
Hi Ernie, On Nov 12, 2007, at 2:52 PM, Ernest Prabhakar wrote:
Hi Ryan,
Apology for a stupid question, but I can't get your script to run:
On Nov 12, 2007, at 1:37 AM, Ryan Schmidt wrote:
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
Am I doing something wrong? This is on Leopard with a fresh install of 1.5.0
-enp
ernest$ port file maintainer:drernie@macosforge.org
Can't map the URL 'file://.' to a port description file ("Could not find Portfile in /Users/ernest"). Please verify that the directory and portfile syntax are correct. To use the current port, you must be in a port's directory. (you might also see this message if a pseudo-port such as outdated or installed expands to no ports). Error: Port not found
It looks to me like there are no ports for which you are listed as maintainer. (Am I wrong?) Therefore, you get this result, which isn't, admittedly, the most beautiful thing in the world. James
_______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/macports-dev
Ryan Schmidt <ryandesign@macports.org> writes:
It should work as given, except for replacing "EMAIL" with your maintainer name.
Here's the output I get for you:
port file maintainer:markd \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]" \ | sed s%^/Users/rschmidt/macports/dports/%%
net/argus-monitor/Portfile: cd ${prefix}/etc/postfix devel/expect/Portfile:post-destroot { cd ${destroot}$ {prefix}/lib net/monarch/Portfile: cd ${monarchdir} net/monarch/Portfile: cd ${monarchdir} net/nagios/Portfile: cd ${prefix}/etc/nagios net/nedi/Portfile: cd ${prefix}/apache2/conf net/nedi/Portfile: cd ${prefix}/share/${name} net/nedi/Portfile: cd ${nedidir}${name} net/nedi/Portfile:0 * * * * cd ${nedidir}${name} ; ./nedi.pl -c >> / dev/null 2>&1 net/netmrg/Portfile: cd ${prefix}/share/netmrg/db net/nrg/Portfile: cd ${prefix}/var/${name} www/php5-rrdtool/Portfile: cd ${worksrcpath} net/rancid/Portfile: cd <Apache-directory>/lg net/smokeping/Portfile: cd ${smokedata}/log net/smokeping/Portfile: cd ${smokeetc} mail/sympa/Portfile: cd ${prefix}/apache2/conf mail/vm-pop3d/Portfile: cd ${prefix}/etc/postfix mail/vm-pop3d/Portfile: cd ${prefix}/etc/${name} mail/vm-pop3d/Portfile: cd my-vdomain1.com net/zabbix/Portfile: cd ${prefix}/share/zabbix/schema net/zabbix/Portfile: cd ${prefix}/share/zabbix/data
On Nov 12, 2007, at 12:41, markd@macports.org wrote:
I just realized that a number of my ports use "cd ${somedir}" in the ui_msgs to instruct users. I hope none of my ports use the "cd" Tcl primitive, but I'm still having trouble getting this command right to know for sure.
Good point! You're right, my search will erroneously flag occurrences of "cd" within ui_msgs. Not sure how to filter those out automatically.
Not sure what I'm doinbg wrong, but anyway only the expect port has an offending tcl "cd" in it. I'll fix that shortly. The others are all within a ui_msg. Mark
On Nov 12, 2007, at 6:52 PM, Ernest Prabhakar wrote:
Hi Ryan,
Apology for a stupid question, but I can't get your script to run:
On Nov 12, 2007, at 1:37 AM, Ryan Schmidt wrote:
To see everywhere in your ports where the "cd" command is currently being used, you can use a command like this in the Terminal (replacing "EMAIL" with your maintainer email address (to which this email was sent)):
port file maintainer:EMAIL \ | xargs grep "[[:space:]]cd[[:space:]]" \ | grep -v "system[[:space:]]"
Am I doing something wrong? This is on Leopard with a fresh install of 1.5.0
-enp
ernest$ port file maintainer:drernie@macosforge.org
Among other comments that have been made already, you also have to note that your address would be "drernie@macports.org", not @macosforge.org Just one of those things... ;-) -jmpp
participants (7)
-
Anders F Björklund
-
Ernest Prabhakar
-
James Berry
-
Juan Manuel Palacios
-
markd@macports.org
-
Roger Hoover
-
Ryan Schmidt