Closed Bug 346265 Opened 18 years ago Closed 18 years ago

checksetup.pl should use Getopt::Long instead of its current hack

Categories

(Bugzilla :: Installation & Upgrading, enhancement)

2.23
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

Getopt::Long is part of the standard perl distribution. Right now, instead of Getopt::Long, we're using a hacky way of calling grep() on @ARGV to get the switches.

Instead, we should use Getopt::Long!
Attached patch v1 (obsolete) — Splinter Review
This patch depends on the patch for bug 346212 being checked in first.

I tested, and this behaves exactly the same as checksetup used to, except that you can now specify the "answers" file at any part of the argument list you'd like. (Previously you *had* to specify it as the very first argument.)

It's true that the patch looks kind of funky with how it creates the BEGIN block and all that. Eventually that will get fixed in a future patch where I eliminate as many BEGIN blocks from checksetup.pl as possible.

I added the $VERSION variable so that I could have the automatic --version output from Getopt::Long.
Requesting approval directly, as module owner.
Status: NEW → ASSIGNED
Flags: approval?
Depends on: 346212
Blocks: 346270
Attached patch v2Splinter Review
Turns out that perl 5.8.0 doesn't support the auto_version option for Getopt::Long. This patch removes that, and the $VERSION var that I created.
Attachment #231080 - Attachment is obsolete: true
Flags: approval? → approval+
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.517; previous revision: 1.516
done
Status: ASSIGNED → RESOLVED
Closed: 18 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: