#emc-devel | Logs for 2008-04-11

[00:42:16] <fenn_> fenn_ is now known as fenn
[03:04:18] <SWPadnos_> SWPadnos_ is now known as SWPadnos
[13:33:18] <SWPadnos> hmmm. the config picker doesn't like names with spaces in them
[13:34:47] <SWPadnos> I wonder if stepconf should either warn the user about that or convert spaces to '_'
[13:37:48] <jepler> somebody should file a bug against the config picker, then fix it
[13:38:49] <SWPadnos> that's the other option :)
[13:38:52] <skunkworks> * skunkworks is glad he isn't 'somebody'
[13:39:58] <cradek> it seems 'somebody' has a lot of bugs to fix lately
[13:39:59] <SWPadnos> this somebody will file the bug report. fixing it is a tcl problem (which is a big problem for me ;) )
[13:40:21] <SWPadnos> maybe we should add a "somebody" to the asignment drop-down
[13:40:24] <SWPadnos> instead of nobody
[13:40:26] <jepler> fwiw the emc run script also has problems with that
[13:40:32] <cradek> bah. to fix tcl: try adding quotes. if that doesn't work, try adding curly braces
[13:40:38] <jepler> but I'd rather they be fixed than ostriched
[13:40:39] <skunkworks> so - now there is a virus warning email going around that says it is confirmed by snopes. But the link to snopes say is it a spoof ;) funny.
[13:40:43] <SWPadnos> it looks like both are there
[13:41:25] <skunkworks> * it is
[13:42:34] <SWPadnos> hmm. should I add a category for "Other user utilities" or similar?
[13:42:47] <SWPadnos> or just stick it in the AXIS or tkemc category
[13:44:38] <cradek> I'm trying to fix emc.in
[13:45:03] <jepler> cradek: I have it mostly fixed already
[13:45:16] <SWPadnos> the problem I saw is in the config picker, though I didn't go beyond that
[13:45:23] <cradek> oh, ok
[13:48:38] <SWPLinux> I think the node names are the same as the dir/ini file names
[13:50:45] <jepler> [pid 25859] execve("/net/filesrv1/sd3a/users/jepler/emc2-src/bin/halcmd", ["halcmd", "loadusr", "-Wn", "iocontrol", "io", "-ini", "/net/filesrv1/sd3a/users/jepler/emc2/configs/Bad Idea/worse idea.ini"], [/* 62 vars */]) = 0
[13:50:50] <jepler> [pid 25860] execve("/net/filesrv1/sd3a/users/jepler/emc2-src/bin/io", ["io", "-ini", "/net/filesrv1/sd3a/users/jepler/emc2/configs/Bad", "Idea/worse", "idea.ini"], [/* 62 vars */]) = 0
[13:50:56] <jepler> crap, the broken extends down into halcmd :(
[13:51:10] <cradek> bleh
[13:51:35] <SWPLinux> tcl error messages here if it helps: http://pastebin.ca/981006
[13:51:42] <SWPLinux> but it looks like it may not help any more :)
[13:51:49] <SWPLinux> (damn you guys are fast)
[13:57:09] <SWPLinux> oh crap. gotta run. bbl
[14:02:49] <jepler> see you SWPLinux
[14:05:01] <CIA-30> EMC: 03jepler 07TRUNK * 10emc2/scripts/emc.in: (log message trimmed)
[14:05:01] <CIA-30> EMC: * Fix problems when various things contain spaces (but config paths with spaces
[14:05:01] <CIA-30> EMC: don't work yet due to other bugs in halcmd and pickconfig)
[14:05:01] <CIA-30> EMC: * Change print and debug redirection so that they go to stdout/stderr
[14:05:01] <CIA-30> EMC: instead of to the terminal and can be subject to further shell redirection
[14:05:04] <CIA-30> EMC: * "-" as an inifile name allows use of the last inifile but preserves
[14:05:06] <CIA-30> EMC: positional arguments. This allows you to open the last configuration *and*
[14:09:58] <jepler> In terms of an easy fix to halcmd, I think I have two choices: add \"...\" on the commandlines in the emc runscript (then the less common case of files with quotes in them will be broken) OR disable [INI]FILE substitution for 'halcmd cmd args' (command given on commandline, not from -f)
[14:10:48] <jepler> cradek: thoughts?
[14:12:30] <cradek> would you say what/where the problem is? I can't quite divine it from your two proposed solutions
[14:14:41] <jepler> halcmd joins its commandline with spaces, then performs its own built-in parsing which includes word splitting and [INI]VAR substitution
[14:15:25] <cradek> why does it join with spaces? I don't see how that's required for inivar sub
[14:15:40] <jepler> that's the way it's presently written.
[14:15:55] <cradek> isn't the fix then "don't do that"?
[14:16:02] <cradek> (note I haven't looked at it)
[14:24:11] <jepler> it would change the meaning of [FOO]ARGS=a b c / halcmd loaduser foo [FOO]ARGS
[14:31:35] <CIA-30> EMC: 03jepler 07TRUNK * 10emc2/src/hal/utils/halcmd_main.c:
[14:31:35] <CIA-30> EMC: make stuff like
[14:31:35] <CIA-30> EMC: halcmd loadusr io -ini "path with spaces"
[14:31:35] <CIA-30> EMC: work. this disables inivar substitution on commands given on the halcmd
[14:31:35] <CIA-30> EMC: commandline but that feature doesn't seem to be used.
[14:43:07] <CIA-30> EMC: 03jepler 07TRUNK * 10emc2/tcl/bin/pickconfig.tcl: fix configuration paths with embedded spaces
[18:23:41] <SWPadnos> I just hate it when I accidentally knock the power connector out of my laptop just before leaving the house for a few hours
[18:32:11] <alex_joni> heh
[18:32:51] <SWPadnos> I guess I should fix my code some day. the ini var replacement should take tokens from the command line rather than putting them into a string
[18:32:54] <SWPadnos> but then what to do?
[18:33:51] <SWPadnos> if an argument gets replaced by something that's intended to be multiple tokens, you can't just replace characters, you need to generate essentially a new set of tokens
[18:34:58] <cradek> well the root of the problem is that you don't know what an ini var with spaces is supposed to mean
[18:35:19] <cradek> shuffling argv around is just what makes it tedious to code, it's not a fundamental problem
[18:35:21] <SWPadnos> true
[18:35:49] <SWPadnos> as for spaces, the way things work now allows the command itself to be specified in the replaced text
[18:36:08] <SWPadnos> so you could have something like "loadusr -Wn fred pyvcp -c fred"
[18:36:15] <SWPadnos> as the replaced text
[18:43:50] <jepler> there's no reason that you can't fix the commandline problem I encountered but keep the present word-splitting property of substitutions
[18:43:53] <jepler> def expand(tokens):
[18:43:56] <jepler> result = []
[18:43:58] <jepler> for t in tokens:
[18:43:59] <jepler> ^^ something like the above logic, but written painfully in C
[18:44:01] <jepler> if simple(t): result = result + [t]
[18:44:04] <jepler> else: result = result + expand(t) # expand() returns a list
[18:44:06] <jepler> return result
[18:44:54] <jepler> when a word is simple (whatever that means) it's not subject to further expansion. when it's not, the result of the expansion is a list of zero or more tokens
[18:45:35] <SWPadnos> simple(x) = x.contains_any_of("substitution_delimiter_chars");
[18:45:45] <SWPadnos> ^^ the above written painfully in C :)
[18:45:46] <jepler> something like that
[18:47:12] <jepler> on the other hand, maybe things are fine after my modification, which just disables re-splitting and expansion for commandline commands and doesn't change anything about scripts run with halcmd -f.
[18:47:53] <jepler> ... because restoring the expansion (but not the re-splitting) still means that a commandline user of halcmd has to specially quote paths that contain [, $ or "
[18:47:54] <SWPadnos> it kind of depends on how [HAL]HALCMD=xxx lines are dealt with
[18:48:18] <SWPadnos> or (
[18:49:11] <cradek> emc emc2/configs/My $#@]%^(! Config/inch.ini
[18:49:12] <jepler> since it's a potentially incompatible change I don't plan to make it in 2.2 -- there we'll have to advise people not to use whitespace
[18:50:08] <SWPadnos> emc emc2/configs/My $#@]%^(! Config better work this time/inch.ini