---Sherlock, Ric wrote:
> So here is an updated, consolidated set of
> suggested revisions to pacman.ijs
>
> LINE 37 (definition of HTTPCMD & UNZIP)
> HTTPCMD=: jpath '~install/tools/ftp/wget.exe -O %O -o %L -t %T %U'
> becomes
> HTTPCMD=: '"',(jpath '~install/tools/ftp/wget.exe'),'" -O
> %O -o %L -t
> %T %U'
>
> LINE 345 (definition of shellcmd)
> shell y
> Becomes
> spawn y
>
> The unzip verb (starting LINE 368) is simplified to the following:
> unzip=: 3 : 0
> 'file dir'=. dquote each y
> e=. 'Unexpected error'
> if. IFUNIX do.
> e=. shellcmd 'tar -xzf ',file,' -C ',dir
> else.
> e=. shellcmd UNZIP,' ',file,' -d ',dir
> end.
> e
> )
The unzip verb above worked fine for installing addons from package
manager but needs an extra line to update the configuration because the
ADDCFG noun has a trailing path separator that the unzip tool doesn't
like. Updated version below seems to work fine.
unzip=: 3 : 0
'file dir'=. dquote each y
e=. 'Unexpected error'
if. IFUNIX do.
e=. shellcmd 'tar -xzf ',file,' -C ',dir
else.
dir=. (_2&}. , PATHSEP_j_ -.~ _2&{.) dir
e=. shellcmd UNZIP,' ',file,' -d ',dir
end.
e
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm