Bug 469129 - "package require sqlite3" under tclsh or wish falsely reports an error
"package require sqlite3" under tclsh or wish falsely reports an error
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: sqlite (Show other bugs)
10
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-29 22:21 EDT by James Armstrong
Modified: 2009-06-12 12:14 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-06-12 06:30:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description James Armstrong 2008-10-29 22:21:52 EDT
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-25 23:28:54 EST
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 01:26:46 EST
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 02:44:48 EST
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 02:46:39 EST
Created attachment 326806 [details]
Patch to fix the bug in Makefile.in
Comment 5 Adam Williamson 2008-12-19 17:16:21 EST
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-28 21:05:28 EST
ping? this has a known and tested fix, couldn't someone please just apply it?
Comment 7 Panu Matilainen 2009-01-29 03:05:54 EST
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 06:38:34 EST
Fix submitted: https://admin.fedoraproject.org/updates/sqlite-3.5.9-4.fc10
Comment 9 Fedora Update System 2009-02-04 21:23:04 EST
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 13:23:21 EST
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 06:30:25 EDT
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.