Closed Bug 98095 Opened 25 years ago Closed 25 years ago

importxml.pl fails perl -wc test

Categories

(Bugzilla :: Bug Import/Export & Moving, defect)

2.15
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: ddkilzer, Assigned: zach)

References

Details

Attachments

(2 files, 1 obsolete file)

Running 'perl -I. -wc importxml.pl' returns a warning or a failure. Attached patch will fix.
Target Milestone: --- → Bugzilla 2.16
Attached patch Patch v1 — — Splinter Review
Comment on attachment 48095 [details] [diff] [review] Patch v1 Unfortunately, when this patch is applied to Bugzilla running on perl 5.005 (our min version), it causes "perl -cwT importxml.pl" to fail with an "Insecure dependency in require while running with -T switch at importxml.pl line 54." error. We had this problem once before (bug 91903).
Attachment #48095 - Flags: review-
Attached patch Patch v2 (obsolete) — — Splinter Review
The changes to Attachment 48298 [details] [diff] (Patch v2) seem like so much silliness (compared to Patch v1), but it seems to work. This new patch works with perl-5.6.0 and 'perl -cwT'. The Patch v1 failed on 'perl -cwT' under perl-5.6.0 as well. I don't have a system with perl-5.005 on it to test the patch, though. Someone needs to test that this solution works under perl-5.005. Further discussion: a '/' should really appear before 'importxml.pl' in the regex (to prevent filename spoofing?), but we need to do this in a cross-platform-friendly way, such that the path separator character should not be hard-coded to '/'. Unfortunately, File::Spec doesn't seem to have a method that only returns the path separator character(s). Any one have ideas? Note that Makefile.PL patch for Bug 44659 also fixes this problem (IMHO the correct way) by providing pre-configured paths for all programs such that there is no need to add dirname($0) to @INC (with 'use lib') or chdir() to dirname($0). It (or a similar config-file patch) is a much more satisfactory solution, but apparently much further off.
Oops. 'perl -cwT' worked fine with Patch v1 under perl-5.6.0. Tested the wrong file (the original) when I reported that.
Attachment #48298 - Attachment is obsolete: true
Comment on attachment 48095 [details] [diff] [review] Patch v1 r1=zach@zachlipton.com. It passes the tests.
Attachment #48095 - Flags: review- → review+
Comment on attachment 48095 [details] [diff] [review] Patch v1 Taking that back until further testing is done on more perl versions.
Attachment #48095 - Flags: review+
Blocks: 97976
I know it's kinda ugly, but it does fix the compile time errors in both perl 5.005 (passes the current -cwT) and perl 5.006 (passes 1compile.t). It's also done in such a way that it'll have no effect on the script at runtime.
Blocks: 102032
Comment on attachment 49752 [details] [diff] [review] ugly, but functional This does not fix the error on 5.6 on landfill.
Attachment #49752 - Flags: review-
actually it does, r=zach@zachlipton.com, fix checked in
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Component: Installation & Upgrading → Testing Suite
Component: Testing Suite → Bug Import/Export & Moving
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: