Closed Bug 429378 Opened 17 years ago Closed 17 years ago

collectstats.pl fails if ./graphs is a symlink

Categories

(Bugzilla :: Administration, task)

3.0.3
task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: justdave, Assigned: justdave)

References

Details

(Whiteboard: [applied to b.m.o])

Attachments

(1 file)

Perl is too smart for its own good. Best shown by example: [root@mradm02 bugzilla.mozilla.org]# perl testpwd.pl pwd = /data/php5/www/bugzilla.mozilla.org system('ls','-l','graphs'); lrwxrwxrwx 1 root root 39 Jan 15 00:06 graphs -> /mnt/netapp/bugzilla.mozilla.org/graphs chdir graphs pwd = /mnt/netapp/bugzilla.mozilla.org/graphs chdir .. pwd = /mnt/netapp/bugzilla.mozilla.org This causes collectstats.pl to fail with: '' is not a valid choice for $db_driver in localconfig: Null filename used at (eval 30) line 2. because when it gets to the point of loading localconfig, it can't find it because the working directory is wrong. Instead of doing a chdir('..') we need to do a GetPwd first then chdir back to the full path isntead of to ..
Blocks: 426152
Attached patch Patch v1 (deleted) — Splinter Review
This adds a |use Cwd;|, but the Cwd module is part of the PathTools package, which we already require (and already make use of in checksetup.pl as well).
Assignee: administration → justdave
Status: NEW → ASSIGNED
Attachment #316095 - Flags: review?(mkanat)
Patch applies cleanly on both 3.0 and trunk.
Whiteboard: [applied to b.m.o]
Comment on attachment 316095 [details] [diff] [review] Patch v1 That looks fine to me, at least.
Attachment #316095 - Flags: review?(mkanat) → review+
It might be nice to have a concurrence from glob that this won't break on Windows or anything strange like that.
Flags: approval3.0+
Flags: approval+
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 3.0
trunk: Checking in collectstats.pl; /cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v <-- collectstats.pl new revision: 1.64; previous revision: 1.63 done 3.0 branch: Checking in collectstats.pl; /cvsroot/mozilla/webtools/bugzilla/collectstats.pl,v <-- collectstats.pl new revision: 1.58.2.4; previous revision: 1.58.2.3 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
(In reply to comment #4) > It might be nice to have a concurrence from glob that this won't break on > Windows or anything strange like that. looks fine to me.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: