Skip to content

Commit d5dcc4f

Browse files
author
jan.nijtmans
committed
In case of version conflict (e.g. opening 9.0 pkgIndex in 8.6), ignore the file. Backported from 9.0
1 parent 888d1c6 commit d5dcc4f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

library/package.tcl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ proc tclPkgUnknown {name args} {
495495
} trap {POSIX EACCES} {} {
496496
# $file was not readable; silently ignore
497497
continue
498+
} trap {TCL PACKAGE VERSIONCONFLICT} {} {
499+
# In case of version conflict, silently ignore
500+
continue
498501
} on error msg {
499502
tclLog "error reading package index file $file: $msg"
500503
} on ok {} {
@@ -507,12 +510,15 @@ proc tclPkgUnknown {name args} {
507510
if {![info exists procdDirs($dir)]} {
508511
set file [file join $dir pkgIndex.tcl]
509512
# safe interps usually don't have "file exists",
510-
if {([interp issafe] || [file exists $file])} {
513+
if {[interp issafe] || [file exists $file]} {
511514
try {
512515
source -encoding utf-8 $file
513516
} trap {POSIX EACCES} {} {
514517
# $file was not readable; silently ignore
515518
continue
519+
} trap {TCL PACKAGE VERSIONCONFLICT} {} {
520+
# In case of version conflict, silently ignore
521+
continue
516522
} on error msg {
517523
tclLog "error reading package index file $file: $msg"
518524
} on ok {} {
@@ -598,6 +604,9 @@ proc tcl::MacOSXPkgUnknown {original name args} {
598604
} trap {POSIX EACCES} {} {
599605
# $file was not readable; silently ignore
600606
continue
607+
} trap {TCL PACKAGE VERSIONCONFLICT} {} {
608+
# In case of version conflict, silently ignore
609+
continue
601610
} on error msg {
602611
tclLog "error reading package index file $file: $msg"
603612
} on ok {} {

0 commit comments

Comments
 (0)