Bug 469129 - "package require sqlite3" under tclsh or wish falsely reports an error
Summary: "package require sqlite3" under tclsh or wish falsely reports an error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sqlite
Version: 10
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-30 02:21 UTC by James Armstrong
Modified: 2009-06-12 16:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-12 10:30:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to fix the bug in Makefile.in (413 bytes, patch)
2008-12-13 07:46 UTC, Adam Williamson
no flags Details | Diff

Description James Armstrong 2008-10-30 02:21:52 UTC
Description of problem:

The command:

package require sqlite3

when issued to wish or tclsh reports the following as an error:

attempt to provide package sqlite3 3.5 failed: package sqlite3 3.5.9 provided instead

Version-Release number of selected component (if applicable):

RPM Package name: sqlite-tcl
RPM Package version: 3.5.9
RPM Package release: 2.fc9

(I am also using tcl 8.5.2)

How reproducible:

every time.

Steps to Reproduce:
1. yum install sqlite-tcl
2. tclsh
3. package require sqlite3
  
Actual results:

"attempt to provide package sqlite3 3.5 failed: package sqlite3 3.5.9 provided instead"

returned as an error.

Expected results:

3.5.9

returned as a return value

Additional info:

Oddly, the sqlite3 extension does get loaded and seems to be usable but
due to the error return, your wish script will not run.

Work-around:

In the single-line file "/usr/share/tcl8.5/sqlite3/pkgIndex.tcl"
change:
package ifneeded sqlite3 3.5 [list load /usr/share/tcl8.5/sqlite3/libtclsqlite3.so sqlite3]
to:
package ifneeded sqlite3 3.5.9 [list load /usr/share/tcl8.5/sqlite3/libtclsqlite3.so sqlite3]

then things work as expected.

a better test for the error might be:

if [catch {package require sqlite3} result] {
puts "failed: $result" } else { puts "worked: $result" }

that way you can see that what appears to be a warning is actually an error.
I think that the rules are to simply return the version that satisfied the
request.  In this case, '3.5.9'.

Comment 1 Bug Zapper 2008-11-26 04:28:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 James Armstrong 2008-12-01 06:26:46 UTC
Yes, It just happened on Fedora 10 too: sqlite-tcl-3.5.9-2.fc10.i386
(2.6.27.5-117.fc10.i686)

Comment 3 Adam Williamson 2008-12-13 07:44:48 UTC
I ran up against this bug doing some exploratory Fedora stuff today. I have identified the cause and the fix.

It was fixed upstream between 3.5.9 and 3.6.6.2, so it should work in current Rawhide.

The problem is in the way Makefile.in calls tclinstaller.tcl:

	$(TCLSH_CMD) $(TOP)/tclinstaller.tcl $(VERSION)

in 3.6.6.2, this is:

	$(TCLSH_CMD) $(TOP)/tclinstaller.tcl $(RELEASE)

which is the fix. VERSION and RELEASE are defined in configure.ac. VERSION is just major.minor - so for 3.5.9 it's 3.5, and for 3.6.6.2 it'd be 3.6 - while RELEASE is the whole thing.

tclinstaller.tcl passes the parameter into the pkgIndex.tcl file, and that's where we hit the bug: it's 3.5 instead of 3.5.9.

So, to fix this, just patch or sed Makefile.in to change ${VERSION} to ${RELEASE}. I'll attach the patch.

Comment 4 Adam Williamson 2008-12-13 07:46:39 UTC
Created attachment 326806 [details]
Patch to fix the bug in Makefile.in

Comment 5 Adam Williamson 2008-12-19 22:16:21 UTC
pmatilai, you appear to be 'really' the owner of this package, so I add you in CC. Could you please take a look at it and the other active sqlite bug for F10? https://bugzilla.redhat.com/show_bug.cgi?id=452591

Thanks.

Comment 6 Adam Williamson 2009-01-29 02:05:28 UTC
ping? this has a known and tested fix, couldn't someone please just apply it?

Comment 7 Panu Matilainen 2009-01-29 08:05:54 UTC
I'd need to to see a bug in order to fix it :) Sorry, sqlite3 component is some leftover whose owner email is long since invalid, need to do something about that...

Anyway, will fix.

Comment 8 Panu Matilainen 2009-02-01 11:38:34 UTC
Fix submitted: https://admin.fedoraproject.org/updates/sqlite-3.5.9-4.fc10

Comment 9 Fedora Update System 2009-02-05 02:23:04 UTC
sqlite-3.5.9-4.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update sqlite'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-1370

Comment 10 Adam Williamson 2009-02-19 18:23:21 UTC
According to bodhi, this has actually been pushed to updates.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 11 Panu Matilainen 2009-06-12 10:30:25 UTC
Yup, it's been fixed quite some time ago, dunno why bodhi didn't close this bug then...


Note You need to log in before you can comment on or make changes to this bug.