summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/package.tcl12
-rw-r--r--library/tclIndex2
-rw-r--r--tests/package.test66
3 files changed, 40 insertions, 40 deletions
diff --git a/library/package.tcl b/library/package.tcl
index c1f8415..f1bfc90 100644
--- a/library/package.tcl
+++ b/library/package.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl which can be loaded on demand
# for package management.
#
-# RCS: @(#) $Id: package.tcl,v 1.10 2000/02/01 01:14:01 ericm Exp $
+# RCS: @(#) $Id: package.tcl,v 1.11 2000/02/07 22:33:17 ericm Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -13,7 +13,7 @@
#
# Create the package namespace
-namespace eval ::package {
+namespace eval ::pkg {
}
# pkg_compareExtension --
@@ -360,7 +360,7 @@ proc pkg_mkIndex {args} {
foreach {name version} $pkg {
break
}
- lappend cmd ::package::create -name $name -version $version
+ lappend cmd ::pkg::create -name $name -version $version
foreach spec $files($pkg) {
foreach {file type procs} $spec {
if { $direct } {
@@ -488,7 +488,7 @@ proc tclPkgUnknown {name version {exact {}}} {
}
}
-# ::package::create --
+# ::pkg::create --
#
# Given a package specification generate a "package ifneeded" statement
# for the package, suitable for inclusion in a pkgIndex.tcl file.
@@ -514,8 +514,8 @@ proc tclPkgUnknown {name version {exact {}}} {
# Results:
# An appropriate "package ifneeded" statement for the package.
-proc ::package::create {args} {
- append err(usage) "::package::create "
+proc ::pkg::create {args} {
+ append err(usage) "[lindex [info level 0] 0] "
append err(usage) "-name packageName -version packageVersion"
append err(usage) "?-load {filename ?{procs}?}? ... "
append err(usage) "?-source {filename ?{procs}?}? ..."
diff --git a/library/tclIndex b/library/tclIndex
index 92500b2..c2da6be 100644
--- a/library/tclIndex
+++ b/library/tclIndex
@@ -33,7 +33,7 @@ set auto_index(pkg_mkIndex) [list source [file join $dir package.tcl]]
set auto_index(tclPkgSetup) [list source [file join $dir package.tcl]]
set auto_index(tclMacPkgSearch) [list source [file join $dir package.tcl]]
set auto_index(tclPkgUnknown) [list source [file join $dir package.tcl]]
-set auto_index(::package::create) [list source [file join $dir package.tcl]]
+set auto_index(::pkg::create) [list source [file join $dir package.tcl]]
set auto_index(parray) [list source [file join $dir parray.tcl]]
set auto_index(::safe::InterpStatics) [list source [file join $dir safe.tcl]]
set auto_index(::safe::InterpNested) [list source [file join $dir safe.tcl]]
diff --git a/tests/package.test b/tests/package.test
index 0262e31..2ca8c34 100644
--- a/tests/package.test
+++ b/tests/package.test
@@ -8,62 +8,62 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: package.test,v 1.1 2000/02/01 01:14:02 ericm Exp $
+# RCS: @(#) $Id: package.test,v 1.2 2000/02/07 22:33:18 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import ::tcltest::*
}
-test package-1.1 {package::create gives error on insufficient args} {
- catch {::package::create}
+test package-1.1 {pkg::create gives error on insufficient args} {
+ catch {::pkg::create}
} 1
-test package-1.2 {package::create gives error on bad args} {
- catch {::package::create -foo bar -bar baz -baz boo}
+test package-1.2 {pkg::create gives error on bad args} {
+ catch {::pkg::create -foo bar -bar baz -baz boo}
} 1
-test package-1.3 {package::create gives error on no value given} {
- catch {::package::create -name foo -version 1.0 -source test.tcl -load}
+test package-1.3 {pkg::create gives error on no value given} {
+ catch {::pkg::create -name foo -version 1.0 -source test.tcl -load}
} 1
-test package-1.4 {package::create gives error on no name given} {
- catch {::package::create -version 1.0 -source test.tcl -load foo.so}
+test package-1.4 {pkg::create gives error on no name given} {
+ catch {::pkg::create -version 1.0 -source test.tcl -load foo.so}
} 1
-test package-1.5 {package::create gives error on no version given} {
- catch {::package::create -name foo -source test.tcl -load foo.so}
+test package-1.5 {pkg::create gives error on no version given} {
+ catch {::pkg::create -name foo -source test.tcl -load foo.so}
} 1
-test package-1.6 {package::create gives error on no source or load options} {
- catch {::package::create -name foo -version 1.0 -version 2.0}
+test package-1.6 {pkg::create gives error on no source or load options} {
+ catch {::pkg::create -name foo -version 1.0 -version 2.0}
} 1
-test package-1.7 {package::create gives correct output for 1 direct source} {
- ::package::create -name foo -version 1.0 -source test.tcl
+test package-1.7 {pkg::create gives correct output for 1 direct source} {
+ ::pkg::create -name foo -version 1.0 -source test.tcl
} {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]}
-test package-1.8 {package::create gives correct output for 2 direct sources} {
- ::package::create -name foo -version 1.0 -source test.tcl -source test2.tcl
+test package-1.8 {pkg::create gives correct output for 2 direct sources} {
+ ::pkg::create -name foo -version 1.0 -source test.tcl -source test2.tcl
} {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]\n[list source [file join $dir test2.tcl]]}
-test package-1.9 {package::create gives correct output for 1 direct load} {
- ::package::create -name foo -version 1.0 -load test.so
+test package-1.9 {pkg::create gives correct output for 1 direct load} {
+ ::pkg::create -name foo -version 1.0 -load test.so
} {package ifneeded foo 1.0 [list load [file join $dir test.so]]}
-test package-1.10 {package::create gives correct output for 2 direct loads} {
- ::package::create -name foo -version 1.0 -load test.so -load test2.so
+test package-1.10 {pkg::create gives correct output for 2 direct loads} {
+ ::pkg::create -name foo -version 1.0 -load test.so -load test2.so
} {package ifneeded foo 1.0 [list load [file join $dir test.so]]\n[list load [file join $dir test2.so]]}
-test package-1.11 {package::create gives correct output for 1 lazy source} {
- ::package::create -name foo -version 1.0 -source {test.tcl {foo bar}}
+test package-1.11 {pkg::create gives correct output for 1 lazy source} {
+ ::pkg::create -name foo -version 1.0 -source {test.tcl {foo bar}}
} {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.tcl source {foo bar}}}]}
-test package-1.12 {package::create gives correct output for 2 lazy sources} {
- ::package::create -name foo -version 1.0 -source {test.tcl {foo bar}} \
+test package-1.12 {pkg::create gives correct output for 2 lazy sources} {
+ ::pkg::create -name foo -version 1.0 -source {test.tcl {foo bar}} \
-source {test2.tcl {baz boo}}
} {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.tcl source {foo bar}} {test2.tcl source {baz boo}}}]}
-test package-1.13 {package::create gives correct output for 1 lazy load} {
- ::package::create -name foo -version 1.0 -load {test.so {foo bar}}
+test package-1.13 {pkg::create gives correct output for 1 lazy load} {
+ ::pkg::create -name foo -version 1.0 -load {test.so {foo bar}}
} {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.so load {foo bar}}}]}
-test package-1.14 {package::create gives correct output for 2 lazy loads} {
- ::package::create -name foo -version 1.0 -load {test.so {foo bar}} \
+test package-1.14 {pkg::create gives correct output for 2 lazy loads} {
+ ::pkg::create -name foo -version 1.0 -load {test.so {foo bar}} \
-load {test2.so {baz boo}}
} {package ifneeded foo 1.0 [list tclPkgSetup $dir foo 1.0 {{test.so load {foo bar}} {test2.so load {baz boo}}}]}
-test package-1.15 {package::create gives correct output for 1 each, direct} {
- ::package::create -name foo -version 1.0 -source test.tcl -load test2.so
+test package-1.15 {pkg::create gives correct output for 1 each, direct} {
+ ::pkg::create -name foo -version 1.0 -source test.tcl -load test2.so
} {package ifneeded foo 1.0 [list load [file join $dir test2.so]]\n[list source [file join $dir test.tcl]]}
-test package-1.16 {package::create gives correct output for 1 direct, 1 lazy} {
- ::package::create -name foo -version 1.0 -source test.tcl \
+test package-1.16 {pkg::create gives correct output for 1 direct, 1 lazy} {
+ ::pkg::create -name foo -version 1.0 -source test.tcl \
-source {test2.tcl {foo bar}}
} {package ifneeded foo 1.0 [list source [file join $dir test.tcl]]\n[list tclPkgSetup $dir foo 1.0 {{test2.tcl source {foo bar}}}]}