Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2010-05-07:

[12:39] <kjeldahl> Anybody know how to set cpan config parameters from the command line (batch script)? I.e. "perl -MCPAN -e shell 'o conf unzip /usr/bin/unzip'"?
[12:41] <kjeldahl> I get: Illegal division by zero at -e line 1.
[12:47] <SamuraiJack> kjeldahl: `-e shell ` should start the shell, not update the config..
[12:47] <SamuraiJack> (IIRC)
[12:48] <kjeldahl> Tried without shell as well, just using the "e".
[12:48] <kjeldahl> That's what gave the error.
[12:48] <kjeldahl> perl -MCPAN -e 'o conf unzip /usr/bin/unzip'
[12:49] <SamuraiJack> "o conf" is the command which is valid only inside of shell
[12:49] <SamuraiJack> probably you need to update the config file
[12:49] <SamuraiJack> min
[12:49] <kjeldahl> Point is I need to automate it; pushing updates to virtual instances...
[12:51] <SamuraiJack> I see
[12:51] <SamuraiJack> take a look at: http://search.cpan.org/~andk/CPAN-1.9402/lib/CPAN.pm#CONFIGURATION
[12:51] <SamuraiJack> `Saves all config variables to the current config file (CPAN/Config.pm or CPAN/MyConfig.pm that was loaded at start).`
[12:52] <SamuraiJack> if that won't help, try to ask at #win32 or #perl
[12:52] <kjeldahl> I'm on linux.. :-)
[12:53] <kjeldahl> Oh, sorry, noticed now. Wrong window!
[12:53] <SamuraiJack> :)
[12:54] <kjeldahl> Thanks anyway!
[12:54] <SamuraiJack> no prob
[18:31] <kriskowal> dantman, please ban Paola09 from the wiki; link spam.
[18:32] <Dantman> Agh, T_T bad timing
[18:33] <Wes--> kriskowal: can you expand further on your proposal?
[18:34] <Wes--> I must admit, I read your email and was thoroughly confused w.r.t what you wanted to accomplish, in real-world goals/terms
[18:34] <Dantman> kriskowal ^_^ notice the use of a fun new MW feature
[18:35] <Wes--> Dantman: I won't be impressed until you can Tazer the spammers
[18:36] <Dantman> Wes--, GeoIP on a CheckUser good enough to target a warhead?
[18:36] <Wes--> Dantman: Don't be a wimp. Light up his cat 5
[18:39] <kriskowal> Wes-- the problem is tracking what portion of args are options for your command.
[18:41] <kriskowal> if you receive args like (just for example) ["node", "bootstrap.js", "foo.js", "--help"], and you're in foo.js, your command should be ["node", "bootstrap.js", "foo.js"] and args ["--help"], indicating that the options for your subcommand only include --help
[18:41] <kriskowal> Wes--^
[18:41] <Wes--> kriskowal: Ah, Hm. I guess I interepreted the original spec a little differently
[18:42] * Dantman is glad he didn't let mediawiki-hosting.com expire... ^_^ such a useful domain... but time to go...
[18:42] <Wes--> kriskowal: Basically, I followed the same model that the shell uses - the details to invoke the script are irrelevant, on the script name and it's arguments are passed along
[18:42] <kriskowal> there are variations among engines; i think we might need to be more specific.
[18:43] <kriskowal> yeah, that's what we do in narwhal, i think.
[18:43] <Wes--> kriskowal: I'm all for that, especially so that we can reduce differences between she-bang and non-she-bang invocations
[18:43] <kriskowal> the trouble is that you lose information useful for usage if there are subcommands handled in js
[18:43] <Wes--> Yeah, for example, in gpsee, if you invoke like this:
[18:44] <Wes--> gsr -F myprogram.js -- hello world
[18:44] <Wes--> you will get an arguments array that looks like
[18:44] <Wes--> [ "myprogram.js", "hello", "world" ]
[18:44] <Wes--> which would be the same as if you did
[18:44] <Wes--> ./myprogram.js hello world
[18:44] <kriskowal> in which case args[0] is not useful for usage information
[18:45] <Wes--> In the first case no, in the second case yes
[18:45] <Wes--> So I can totally see where you're going with this -- this is good thinking
[18:45] <Wes--> OTOH, we have to remember that $0 is often used for /configuration management/, too
[18:46] <Wes--> So maybe we need to add something like 'invocation' and 'identification'
[18:46] <Wes--> In my examples above, identification would be myprogram.js
[18:46] <kriskowal> i don't follow. do you mean "~/.$0rc"?
[18:46] <Wes--> but invocation in the top one would be 'gsr -F myprogram.js --'
[18:47] <Wes--> kriskowal: Yes, or require("config").open(basename(arguments[0]) + ".cfg")
[18:47] <Wes--> ^^^^ very common pattern around here
[18:47] <kriskowal> ergo .vimrc vs .viewrc?
[18:48] <Wes--> I don't know what .viewrc - is vim linked to view which causes it to behave differently?
[18:49] <kriskowal> yes
[18:49] <Wes--> yeah, we use it for that
[18:49] <Wes--> We also sometimes use it from a library, where lib behaviour can vary somewhat based on invoking program
[18:49] <kriskowal> it might be adequate to use .command[commands.length-1]
[18:49] <Wes--> PageMail does a LOT of dynamic configuration, some of our stuff has to be extremely reactive
[18:50] <Wes--> (hence, actually, our initial interest in JS -- config language!)
[18:50] <kriskowal> it is a different idiom, but it's still workable
[18:50] <kriskowal> and obviously we can't break backward compat, but system is a broken spec atm anyway
[18:50] <Wes--> kriskowal: Other idea, what about require.main.id or something? That would give 'myprogram' back, which fits the 'identification' bill
[18:50] <kriskowal> and it's my hope that we start using the common/ namespace for new specs
[18:51] <Wes--> kriskowal: I'll back you on both those initiatives
[18:51] <kriskowal> require.main.id would probably work most of the time.
[18:51] <kriskowal> but it wouldn't work for subcommands if subcommands have distinct configuration
[18:52] <kriskowal> and in narwhal at least, require.main.id is canonicalized
[18:52] <kriskowal> which means you lose the view/vim distinction
[18:53] <Wes--> Oh, right
[18:53] <Wes--> Hmm
[18:53] <Wes--> It's funny how even the simplest things can get tricky when you try and polish the corners. :)
[18:54] <Nathan__> is the code for the windows MSI installer availalbe? If so, where?
[19:05] <Wes--> nrstott: you can probably buy it at the street market in Hong Kong along with the source code to Windows XP ;)
[19:05] <nrstott> Wes--, the couchdb installer is that top secret? ;0
[19:06] <Wes--> nrstott: I thought you were looking for the windows MSI installer
[19:06] <Wes--> Not couchdb.msi :)
[19:06] <nrstott> i asked it in the wrong channel ^^
[20:58] <mikeal> anyone who lives in the bay area
[20:58] <mikeal> you are invited to my BBQ tomorrow :)
[20:58] <mikeal> http://plancast.com/a/30lz

 

 

Logs by date :