Closed Bug 280193 Opened 20 years ago Closed 19 years ago

Round up places using data/ instead of $datadir

Categories

(Bugzilla :: Bugzilla-General, defect)

2.19.2
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: Wurblzap, Assigned: Wurblzap)

References

Details

Attachments

(1 file, 2 obsolete files)

There are rogue places not using Config.pm's $datadir variable.
Attached patch Patch (obsolete) — Splinter Review
Replaced data/ by $datadir/.

Of note: duplicates.js and template/en/default/reports/duplicates.rdf.tmpl were
not fixable any way I could think of; I added FIXME code comments.
Assignee: general → wurblzap
Status: NEW → ASSIGNED
Attachment #172668 - Flags: review?
Comment on attachment 172668 [details] [diff] [review]
Patch

>-    # If a writable data/errorlog exists, log error details there.
>-    if (-w "data/errorlog") {
>+    # If a writable $datadir/errorlog exists, log error details there.
>+    if (-w "$Bugzilla::Config::datadir/errorlog") {

You should write:

use Bugzilla::Config qw(:DEFAULT $datadir);

and then:

if (-w "$datadir/errorlog") {


>-        open(ERRORLOGFID, ">>data/errorlog");
>+        open(ERRORLOGFID, ">>$Bugzilla::Config::datadir/errorlog");

open(ERRORLOGFID, ">>$datadir/errorlog"); is better.


>-    unlink "data/versioncache";
>+    unlink "$Bugzilla::Config::datadir/versioncache";

>-    unlink "data/versioncache";
>+    unlink "$Bugzilla::Config::datadir/versioncache";

>-    unlink "data/versioncache";
>+    unlink "$Bugzilla::Config::datadir/versioncache";

Same remark here: unlink "$datadir/versioncache";


About duplicates.* files, you should drop them from your patch, IMHO. I don't
see a way to fix the problem and it may be part of another bug.
Attachment #172668 - Flags: review? → review-
Depends on: 282873
Depends on: 283019
Attached patch Patch 1.2 (obsolete) — Splinter Review
(In reply to comment #2)
> You should write:
> 
> use Bugzilla::Config qw(:DEFAULT $datadir);
> 
> and then:
> 
> if (-w "$datadir/errorlog") {

Ok, this is now possible after bug 283019. Did that.

> About duplicates.* files, you should drop them from your patch, IMHO. I don't

> see a way to fix the problem and it may be part of another bug.

Did that. It turns out that in these files, data/ is used in an URI, so
$datadir doesn't even apply: the way I see it, even if $datadir changes, the
URI should still use data/.
Attachment #172668 - Attachment is obsolete: true
Attachment #177598 - Flags: review?(LpSolit)
Blocks: 282873
No longer depends on: 282873
Comment on attachment 177598 [details] [diff] [review]
Patch 1.2

You missed some "data/" in testserver.pl:
168:		create_file('data/testgd-local.png', $image->png);
169:		check_image('data/testgd-local.png', 't/testgd.png', 'GD',
'PNG');
191:		$chart->$type("data/testchart-local.$type");
192:		check_image("data/testchart-local.$type", "t/testchart.$type",
261068	 12 -rwxr-xr-x	 1 root     root	 8402 mar 16 01:19
./testserver.pl
Attachment #177598 - Flags: review?(LpSolit) → review-
(In reply to comment #4)
> You missed some "data/" in testserver.pl:

Well, bug 275705 missed them, checked in yesterday :)
New patch coming up.
Attached patch Patch 1.3Splinter Review
I noticed that testserver.pl didn't use any Bugzilla modules before this patch.
Is there a reason for this other than it not being necessary? It still works,
anyway, even now use-ing Config.pm.
Attachment #177598 - Attachment is obsolete: true
Attachment #177746 - Flags: review?(LpSolit)
No longer blocks: 282873
*** Bug 282873 has been marked as a duplicate of this bug. ***
Comment on attachment 177746 [details] [diff] [review]
Patch 1.3

It sounds reasonable to me to use a configuration file, that is "Config.pm".

r=LpSolit
Attachment #177746 - Flags: review?(LpSolit) → review+
Flags: approval?
Target Milestone: --- → Bugzilla 2.20
Flags: approval? → approval+
Checking in editclassifications.cgi;
/cvsroot/mozilla/webtools/bugzilla/editclassifications.cgi,v  <-- 
editclassifications.cgi
new revision: 1.10; previous revision: 1.9
done
Checking in testserver.pl;
/cvsroot/mozilla/webtools/bugzilla/testserver.pl,v  <--  testserver.pl
new revision: 1.6; previous revision: 1.5
done
Checking in Bugzilla/Error.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Error.pm,v  <--  Error.pm
new revision: 1.13; previous revision: 1.12
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: