Little content search tool useful for migration

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Little content search tool useful for migration

Sebastián Sastre
Hi All,

 I've made this script to monitor some unwanted dependencys in the
packages of my own. This facilitates migration from D5 to D6.

        "Recorre un directorio (y sus subdirectorios) revisando el contenido
de los archivos para
        ver si encuentra el pedazo de texto que se le solicite."

        tokenDetector := [:file :token| | i fileStream answer|
                i := 0.
                answer := false.
                fileStream := FileStream read: file path text: true.
                [ [fileStream atEnd ] whileFalse: [|line|
                        line := fileStream nextLine.
                        i := i +1.
                        (token match: line) ifTrue:[
                                answer := true.
                                Transcript nextPutAll: 'Match in line ',i asString,' in ', file
path;cr]]
                ] ensure:[fileStream close].
                answer].

        dirFileContentsDetector := nil.
        dirFileContentsDetector := [:dirName :token|
                File for:'*.*' in: dirName do:[:file |
                        (file stem ~= '.' and:[file stem ~= '']) ifTrue:[
                                file isDirectory
                                        ifTrue:[dirFileContentsDetector value: file path value:token]
                                        ifFalse:[ ('*.pac' match:file path) ifTrue:[
                                                        (tokenDetector value: file value:token) ifTrue:[
                                                                Transcript tab;nextPutAll: 'Match in "',file stem,'"';cr]]].
                                ]
                ].
        ].

        path := SessionManager current imageBase,'\Herramientas'.
        find := '*CU ListTree.pac*'.
        dirFileContentsDetector value: path value: find.

Regards,

Sebastián Sastre


Reply | Threaded
Open this post in threaded view
|

Re: Little content search tool useful for migration

Chris Uppal-3
Sebastián,

>  I've made this script to monitor some unwanted dependencys [...]

> find := '*CU ListTree.pac*'.

Hmph!  Thanks a lot...

(Just joking ;-)

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Little content search tool useful for migration

Sebastián Sastre
He he, dear Chris, after posting the message I knew you would say
something he he. In fact I first used that script to get rid of "IDB
RadioButtonGroup" since I spoke to Ian what to do with that dependencys
and he show me D6 has built in the RadioButtonSetPresenter. I have it
in half a dozen pacs in a set of 100? 200? pacs. Really nice to have
this little tool to show exacly what to look at.

  Regads,

Sebastian
PD: I still using the "CU ListTree.pac" ;-)