› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Cloverleaf 6.0 – make package index issue
/cloverleaf/cis6.0/integrator/bin/mkpkgindex
for every package file we get something like this as an example:
warning: error while sourcing oth_fileset_delete.pkg: unknown namespace in import pattern “::msgcat::mcload”
and when done the file ( pkgIndex.tcl ) only contains header comments
# Tcl package index file, version 1.1
# This file is generated by the “pkg_mkIndex” command
# and sourced either when an application starts up or
# by a “package unknown” script. It invokes the
# “package ifneeded” command to set up package-related
# information so that packages will be loaded automatically
# in response to “package require” commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file’s directory.
When we do the hcirootcopy from cloverleaf 5.6 to cloverleaf 6.0 it does copy across the cloverleaf 5.6 file ( pkgIndex.tcl ) intact.
Even though we want to trouble shoot why we can’t do a make package successfully, I was wondering can the cloverleaf 5.6 pkgIndex.tcl file be used in cloverleaf 6.0?
Also, any advice from Infor or anyone that has done a successfull make package index in Cloverleaf 6.0 on how to succesfully do a make packages in Cloverleaf 6.0 is appreciated because following the same steps we use in cloverleaf 5.6 isn’t working for us.
Russ Ross
RussRoss318@gmail.com
Here is the source code for the example above in case that might be of interest in determing what the problem is:
######################################################################
# Name: oth_fileset_delete
# Purpose: Modify the Fileset deletion list to user specification
# NOTE – the actual FILESET/FTP Delete list is described as
# a list in the documentation and is treated as such
# in this proc.
# In point of fact, at the time of this proc’s
# construction, Cloverleaf(R) only has one element in
# this list each time the UPoC is entered.
# Moreover, the current implementation (Cloverleaf(R)
# 5.2.2) allows files to be extracted from only one
# directory and does not chase subdirectories.
# This proc is written with that assumption. If the
# behavior of the Fileset/FTP protocol changes
# such that multiple directories could be represented
# AND the provided list is a list of multiple entries,
# this proc may need to be rewritten.
# EVENTS EXPOSED:
# INIT – to initialize the package
# MODIFY – to Modify the list
# 20070313jrk Begin — UPoC Type changed from Tps to Other – Package
# UPoC type: Other – Package
# 20070313jrk End
# 20070313jrk Begin — Args modified to describe exposed properties
# Args:
# User-supplied Properties:
# All of the arguments used by this proc are contained
# in one exposed property. That property is a keyed list
# called ARGS. Here are the keys for that keyed list:
#
# DEBUG
# MODTYPE
# MATCH
# DELETE_LIST
# 20070313jrk End
#
#
#
# Author: James R. Kosloskey
# Date-written: 01/08/2007
#
# Returns: Sets properties which can be interrogated by the invoking proc
# Here are the properties set by this proc:
# return_code This is a list of two elements. The first element is
# The Event name which set the return code. The second
# element is the actual numeric return code. A value of
# all zeros means successful completion. Any other value
# indicates an error.
# error_lit This property is empty unless an error has been
# detected (return_code list element 2 not zeros)in which
# case this property will contain an error message.
#
#*******************************************************************************
#* C O D E A U D I T *
#*_____________________________________________________________________________*
#*Date I-Catcher Description *
#*———- ———- ——————————————————-*
#*01/08/2007 Procedure conceived
#*03/13/2007 20070313jrk Procedure converted from a Tcl proc to a Tcl Package
#*03/24/2010 20100324jrk Changed lappend to append so that retrieved list from
# would not be a list element but rather a list. This
# impacted the incl whether exact or glob/regexp.
# Version changed to 1.2.
#
#*******************************************************************************
#
######################################################################
package provide oth_fileset_delete 1.2
#20100324jrk Version changed to 1.2 was 1.1
namespace eval oth_fileset_delete {
# Declare Properties
variable modtype “”
variable match_type “”
variable debug 0
variable delete_list “”
#
# Check the HCI globals to see if they exist
# They won’t exist if we are not invoked while within Cloverleaf
# So we need to null them so they do exist and we can have a proc
# which works within Cloverleaf and outside Cloverleaf
#
if {![info exists HciConnName]} {
variable HciConnName “not Cloverleaf”
}
if {![info exists HciSite]} {
variable HciSite “not Cloverleaf”
}
variable date_time [clock format [clock seconds] -format “%m/%d/%Y %T”]
variable module “$date_time $HciSite $HciConnName OTH_FILESET_DELETE V1.2:”
#20100324jrk Version changed to 1.2 was 1.1
variable fileset_delete_args_kl “”
variable return_code “”
# Declare globals
global oth_fileset_delete::module
global oth_fileset_delete::debug
global oth_fileset_delete::fileset_delete_args_kl
global HciConnName
global HciSiteDir
# Make the procedures visible to invoking procs (via namespace import)
namespace export MODIFY INIT
# MODIFY Event – Modifies the Fileset Deletion List
proc MODIFY {} {
# Declare globals
global oth_fileset_delete::module
global oth_fileset_delete::debug
global oth_fileset_delete::modtype
global oth_fileset_delete::fileset_delete_args_kl
# Declare Properties
variable return_code [list MODIFY 000]
# Set Local variables
set val_modtype_list [list incl excl]
set match_list “”
set val_match_type [list exact glob regexp]
set curr_match_element “”
set match_elem_cnt 1
set ret_cd “”
set val_debug [list y Y Yes YES n N No NO]
set fatal_err 0
set delete_list_element “”
set delete_list_path “”
set delete_list_cnt 1
set wrk_delete_list “”
set wrk_delete_list_cnt 0
set wrk_file_del_list_elem “”
set incl_exact_match “”
set interim_incl_list “”
set glob_regexp_match_list “”
set invoker “”
# Get DEBUG (debug is optional but if not present the default is No”
keylget fileset_delete_args_kl DEBUG debug
# Check to see if it is a valid value, if it is not set to NO
set ret_cd [lsearch -exact $val_debug $debug]
if {[string match “-1” $ret_cd]} {
set debug “N”
}
# If it is a valid value, set the debug switch appropriately so we
# don’t need to do a literal check
string map -nocase “y 1 Y 1 yes 1 YES 1 n 0 No 0 NO 0” $debug
# Indicate we have control and who invoked us.
if {$debug} {
set invoker [uplevel {namespace current}]
echo “$module MODIFY Event Invoked by namespace >$invoker[lindex [info level -1] 0]$fileset_delete_args_kl$modtype$modtype$val_modtype_list$fileset_delete_args_kl$match_elem_cnt$curr_match_element$match_type$curr_match_element$val_match_typeinvoker$debug$modtype$match_listfileset_delete_args_klfileset_delete_args_kl$delete_list$delete_list_path$delete_list_cnt$delete_list_element$delete_list_file_name$delete_list_file_name$wrk_delete_list$wrk_delete_list$match_elem_cnt$curr_match_element[lindex $curr_match_element 1][lindex $curr_match_element 1]$interim_incl_list$interim_incl_list$wrk_delete_list$interim_incl_list$match_elem_cnt$curr_match_element[lindex $curr_match_element 1]$glob_regexp_match_list$wrk_delete_list$glob_regexp_match_list$wrk_delete_list$wrk_delete_list$interim_incl_list[lindex [intersect3 $wrk_delete_list $interim_incl_list] 1]$wrk_delete_list_cnt$wrk_delete_list$delete_list_path$delete_list_path$wrk_delete_list_elem$invoker[lindex [info level -1] 0].”
}
return
}
# INIT event
proc INIT {} {
return
}
}
Russ Ross
RussRoss318@gmail.com
In trying to answer our own question:
“Can the pkgIndex.tcl from Cloverleaf 5.6 be used in Cloverleaf 6.0 since we don’t yet know how to get it recreated in Cloverleaf 6.0?”
The answer might be yes becuase when using the Cloverleaf 5.6 pkgIndex.tcl file in Cloverleaf 6.0 we were able to do this simple test okay
(dotilhub1a:hci) /hcitest > hcitcl
hcitcl>package require oth_fileset_delete
1.2
hcitcl>
Russ Ross
RussRoss318@gmail.com
Short answer yes.
I ran mkpkgindex against a couple of our packages in 6.0 with no problem. I would assume something that the proc accesses is missing.
I would do a binary search. Split the proc in half and see if it works. Do this till you narrow it down
mkpkgindex is nothing more than a wrapper around the the Tcl command pkg_mkIndex similar to teh mktclindex script. In fact the first mkpkgindex I wrote I simply modified mktclindex and saved to mkpkgindex
If you post a package source that worked for you we can see if we have the same problem with something we know works in a proper cloverleaf 6.0 environment.
At this point we are working towards identifying concerns about the envirnoment not being set to what is expected even though we did all the prerequists we read about in the installation guide for a scratch AIX 6.1 install.
The one we are asking ourselves about right now is the LANG (language) environment system setting.
Can you do the following on the cloverleaf 6.0 environment that works for you and post the results from running
set | grep LANG
On our cloverleaf 5.6 LPAR we have
LANG=en_US
while on our cloverleaf 6.0 LPAR created from scratch have
LANG=C
Russ Ross
RussRoss318@gmail.com
I tried to idenitify a controlled test I could do to help determine if the problem is environmental or the source file.
I located a simple pacakage file to test with as a control in cloverleaf 6.0 called /cloverleaf/cis6.0/integrator/tcl/lib/tcllib1.14/csv/csv.tcl file and it worked as seen below
successful sourcing of csv.pkg
packages provided were {csv 0.7.3}
processed csv.pkg
This is cause for Jim Kosloskey and I to compare it to problematic source file to see what might be making the difference to cause mkpkgindex to stop working when going from cloverleaf 5.6 to cloverleaf 6.0.
Russ Ross
RussRoss318@gmail.com
At this point if you are still having problems, turn over to Support.
I haven’t tried it on AIX.
You do realize that you do not have to run mktclindex? You can run the Tcl command pkg_mkIndex directly.
pkg_mkIndex ?-direct? ?-lazy? ?-load pkgPat? ?-verbose? dir ?pattern pattern …?
Jim Koslosky determined that the packages he tested did seem to work as designed even though we are stuck making our cloverleaf 6.0 package entries manaully for the time being.
This lowers the urgency of getting this to work as we can work around it for the time being.
I also tried your pkg_mkIndex suggestion and it worked for the csv.tcl control file but not for our in-house TCL packages.
Jim Kosloskey will be looking into this concern more when he circles back around to it as we are being pushed to move forward with other parts of the upgrade.
We only have a handful of packages and can create the entries manually in the near term.
After Jim looks at the problem again in even more detail, and if he is unable to determine a cause, then I will likely call Infor support to create a ticket.
Russ Ross
RussRoss318@gmail.com
Here is a follow-up:
I have narrowed the offending Tcl code in the package to the use of the clock format command.
It appears that in our AIX 6.0 environment any use of the Tcl clock format command in a package will cause the pkg_mkIndex command to error with the error noted.
The clock format command functions properly in the package when it is executed and also within the tcl interpreter. It just casuse the identified error when making the package index.
I will present this to support and continue to do more research and troubleshooting.
At this point our Cloverleaf 6.0 environment seems to be functioning
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
Jim
Send me a copy of the package. If what you are saying is true it would be an issue for the keepers of Tcl
Got the package. Smae results on Windows 6.0 as well.
Asking the Tcl Gurus. Will get back with answers when I get them