mktclindex, AIX and Linux

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf mktclindex, AIX and Linux

  • Creator
    Topic
  • #53325
    Richard Hart
    Participant

      We are in the process of migrating from AIX to Linux.

      Almost all of our translation code is written in TCL and we work on the *nix server at the ‘command line’.

      I use a Makefile in my Cloverleaf development site so I can simply issue a

         make

      to generate a tclIndex file similar to the applications environment.

      If I run the mktclindex command below, all is fine on AIX and the tclIndex is generated for the two files, but on Linux, there is a ‘No .tcl files found’ error

         ls fdw_xlate_top.tcl icm_xlate_top.tcl

         mktclindex {fdw_xlate_top.tcl,icm_xlate_top.tcl}

      Both AIX (5.3) and Linux (RH 5.7) are Cloverleaf 5.8 with hcitcl 8.4.12

      Has anyone else seen this?

    Viewing 3 reply threads
    • Author
      Replies
      • #77285
        Charlie Bursell
        Participant

          If this worked on AIX you must have hacked the mktclindex script.  mktclindex does not accept multiple files.

          It is a simple script which you can take a look at.  Put some echo statements in there if you like.

          I am curious what you gain by putting a wrapper sround mktclindex rather than run it directly?  You can mktclindex from anywhere with the -d option.  like:

          mktclindex -d $HCISITEDIR/tclprocs

        • #77286
          Richard Hart
          Participant

            Hi Charlie.

            I have not hacked mktclIndex!

            On AIX it has worked for years – I think back to 3.3.0 – like this

              mktclindex {fdw_xlate_top.tcl,icm_xlate_top.tcl}

            >Put some echo statements in there if you like

            I did and found an inconsistency with the ‘glob’ function that I could work around in  mktclindex but not the auto_mktclindex.

            This is a simple script – based on mktclindex –  with output from an execution on AIX and Linux for CL 5.8

            #!/apps/aise01t/cis5.8/integrator/bin/hcitcl

            if { [lempty $argv] } {

               set argv “*.tcl”

            }

            puts “Arg >$argv<"

            puts “Cmd >glob -nocomplain -directory . $argv<"

            puts “Exe       >[glob -nocomplain -directory . $argv]<"

            puts “Exe(eval) >[eval glob -nocomplain -directory . $argv]<"

            exit

            AIX

            [5.8] he00387> mX {fdw_xlate_top.tcl,icm_xlate_top.tcl}

            Arg >{{fdw_xlate_top.tcl,icm_xlate_top.tcl}}<

            Cmd >glob -nocomplain -directory . {{fdw_xlate_top.tcl,icm_xlate_top.tcl}}<

            Exe       >./fdw_xlate_top.tcl ./icm_xlate_top.tcl<

            Exe(eval) >./fdw_xlate_top.tcl ./icm_xlate_top.tcl<

            Linux

            [5.8] he00387> mX {fdw_xlate_top.tcl,icm_xlate_top.tcl}

            Arg >fdw_xlate_top.tcl icm_xlate_top.tcl<

            Cmd >glob -nocomplain -directory . fdw_xlate_top.tcl icm_xlate_top.tcl<

            Exe       ><

            Exe(eval) >./fdw_xlate_top.tcl ./icm_xlate_top.tcl<

            Perhaps this should never have worked! Although as it has done for many years on AIX!

            >I am curious what you gain by putting a wrappers around

            >mktclindex rather than run it directly?

            We have many TCL translation scripts, all using a translation package I wrote many years ago.

            To add a translate for an HL7 segment, all that is required is to add a (default prefix Xlate)  proc Xlate to a the translation script.

            As a result, there are many XlatePID procedures!

            We also have library code and packages.

            In an applications site, we use a Makefile to ensure that only the required scripts required are checked out of CVS and the standard mktclindex script is used (on all files in the directory).  For Cloverleaf versions that don’t have a master site, the tclIndex for the library and extra code  is added to the tclIndex file.  The tclIndex file looks like this

               # Tcl autoload index file, version 2.0

               …

               set auto_index(icm_xlate_top)

              ]

                 set auto_index(icm_xlate_ult)

                ]

                   …

                   set auto_index(gen_code_resend)

                  ]

                     set auto_index(Print)

                    ]

                       set auto_index(RetRepeat)

                      ]

                         …

                      In my development site, I have all the code and often  – we are under resourced – have many scripts with changes ‘in progress’, so I don’t want to delete them.  I use a Makefile to generate an appropriate tclIndex containing the library code and application code.

                      The only issue I have found is the Makefile in my development site.

                         

                      I hope this makes sense!

                    1. #77287
                      Richard Hart
                      Participant

                        I see the problem and have fixed it – an issue with *nix shells.

                        All is OK now and I have added quotes in my Makefile

                        ie

                        On Linux …

                        [5.8] he00387> mX “{fdw_xlate_top.tcl,icm_xlate_top.tcl}”

                        Arg >{{fdw_xlate_top.tcl,icm_xlate_top.tcl}}<

                        Cmd >glob -nocomplain -directory . {{fdw_xlate_top.tcl,icm_xlate_top.tcl}}<

                        Exe       >./fdw_xlate_top.tcl ./icm_xlate_top.tcl<

                        Exe(eval) >./fdw_xlate_top.tcl ./icm_xlate_top.tcl<

                      • #77288
                        Charlie Bursell
                        Participant

                          Richard:

                          They (R&D) have added a lot to this script.  The glob you see however is not really used with the auto_mkindex command so I would think it will still work the same way.

                          Perhaps this worked in earlier versions as you say.  I never tried it that way.  Perhaps the auto_mkindex command  changed with the new version of Tcl.  If so I don’t remember seeing anything.

                          Even with the old mktclindex with the way you are passing the arguments you would wind up with:

                          auto_mkindex .

                            If I put that in a script and execute it, I get

                            no files matched glob pattern “tpsSortOBX.tcl,tps_sample_odbc.tcl”

                               while executing

                            “glob — fdw_xlate_top.tcl,icm_xlate_top.tcl”

                               (“eval” body line 1)

                               invoked from within

                            “eval [linsert $args 0 glob –]”

                               (procedure “auto_mkindex” line 16)

                               invoked from within

                            “auto_mkindex .

                               (file “scr” line 1)

                            Perhaps the solution for you would be to write your own mktclindex and replace the one furnished with Cloverleaf.  I had to do this with the pkg_mkIndex in earlier versions.  My mkpkgindex script is now released as part of Cloverleaf

                            In fact, since I used the old mktclindex as the model for mkpkgindex you could use it as a model for your own mktclindex.  Change .pkg to .tcl and pkg_mkIndex to  auto_mkindex  see if that will work for you  

                            Good luck with it

                            Charlie

                      Viewing 3 reply threads
                      • The forum ‘Cloverleaf’ is closed to new topics and replies.