Bug 310084 - nsIXULAppInfo.platformVersion should use the new version format, not "1.7+" r=darin

This commit is contained in:
bsmedberg%covad.net 2005-09-29 19:57:21 +00:00
Родитель 566507ab4f
Коммит c7c15153ad
5 изменённых файлов: 91 добавлений и 44 удалений

Просмотреть файл

@ -42,7 +42,6 @@ use vars qw($officialMilestone
local $Moz::Milestone::milestone;
local $Moz::Milestone::officialMilestone;
local $Moz::Milestone::milestoneEM;
#
# Usage: getOfficialMilestone($milestoneFile)
@ -53,34 +52,19 @@ sub getOfficialMilestone($) {
open(FILE,"$mfile") ||
die ("Can't open $mfile for reading!");
while (defined(my $line = <FILE>)) {
if ($line =~ /^MILESTONE=(\S+)/) {
my $num = $1;
$Moz::Milestone::officialMilestone = $num;
$Moz::Milestone::milestone = &getMilestoneNum;
close FILE;
return $num;
}
my $num = <FILE>;
while($num =~ /^\s*#/ || $num !~ /^\d/) {
$num = <FILE>;
}
close FILE;
}
sub getEMMilestone($) {
my $mfile = $_[0];
open(FILE,"$mfile") ||
die ("Can't open $mfile for reading!");
while (defined(my $line = <FILE>)) {
if ($line =~ /^MILESTONE_EM=(\S+)/) {
my $num = $1;
$Moz::Milestone::milestoneEM = $num;
close FILE;
return $num;
}
}
close FILE;
close(FILE);
if ($num !~ /^\d/) { return; }
chomp($num);
# Remove extra ^M caused by using dos-mode line-endings
chop $num if (substr($num, -1, 1) eq "\r");
$Moz::Milestone::officialMilestone = $num;
$Moz::Milestone::milestone = &getMilestoneNum;
return $num;
}
#
@ -98,7 +82,9 @@ sub getMilestoneNum {
$Moz::Milestone::milestone = $_[0];
}
$Moz::Milestone::milestone =~ s/\+$//;
if ($Moz::Milestone::milestone =~ /\+$/) { # for x.x.x+, strip off the +
$Moz::Milestone::milestone =~ s/\+$//;
}
return $Moz::Milestone::milestone;
}
@ -120,6 +106,69 @@ sub getMilestoneQualifier {
}
}
sub getMilestoneMajor {
my $milestoneMajor;
if (defined($Moz::Milestone::milestone)) {
$milestoneMajor = $Moz::Milestone::milestone;
} else {
$milestoneMajor = $_[0];
}
my @parts = split(/\./,$milestoneMajor);
return $parts[0];
}
sub getMilestoneMinor {
my $milestoneMinor;
if (defined($Moz::Milestone::milestone)) {
$milestoneMinor = $Moz::Milestone::milestone;
} else {
$milestoneMinor = $_[0];
}
my @parts = split(/\./,$milestoneMinor);
if ($#parts < 1 ) { return 0; }
return $parts[1];
}
sub getMilestoneMini {
my $milestoneMini;
if (defined($Moz::Milestone::milestone)) {
$milestoneMini = $Moz::Milestone::milestone;
} else {
$milestoneMini = $_[0];
}
my @parts = split(/\./,$milestoneMini);
if ($#parts < 2 ) { return 0; }
return $parts[2];
}
sub getMilestoneMicro {
my $milestoneMicro;
if (defined($Moz::Milestone::milestone)) {
$milestoneMicro = $Moz::Milestone::milestone;
} else {
$milestoneMicro = $_[0];
}
my @parts = split(/\./,$milestoneMicro);
if ($#parts < 3 ) { return 0; }
return $parts[3];
}
sub getMilestoneAB {
my $milestoneAB;
if (defined($Moz::Milestone::milestone)) {
$milestoneAB = $Moz::Milestone::milestone;
} else {
$milestoneAB = $_[0];
}
if ($milestoneAB =~ /a/) { return "alpha"; }
if ($milestoneAB =~ /b/) { return "beta"; }
return "final";
}
#
# build_file($template_file,$output_file)
#

Просмотреть файл

@ -52,7 +52,6 @@ use vars qw(
$opt_debug
$opt_template
$opt_help
$emversion
);
$SCRIPTDIR = $0;
@ -61,7 +60,7 @@ push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'emversion' => \$emversion, 'debug', 'help', 'template');
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template');
if (defined($opt_help)) {
&usage();
@ -81,6 +80,11 @@ if (!defined($OBJDIR)) { $OBJDIR = '.'; }
$MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt";
@MILESTONE_PARTS = (0, 0, 0, 0);
#
# Grab milestone (top line of $MILESTONE_FILE that starts with a digit)
#
my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
if (defined(@TEMPLATE_FILE)) {
my $TFILE;
@ -97,16 +101,12 @@ if (defined(@TEMPLATE_FILE)) {
}
}
} else {
if ($emversion) {
print Moz::Milestone::getEMMilestone($MILESTONE_FILE)."\n";
} else {
print Moz::Milestone::getOfficialMilestone($MILESTONE_FILE)."\n";
}
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --emversion --template [file list]` # will build file list from .tmpl files
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files
END
;
}

Просмотреть файл

@ -10,5 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
MILESTONE=1.9a1
MILESTONE_EM=1.7+
1.9a1

Просмотреть файл

@ -204,7 +204,7 @@ DEFINES += \
$(NULL)
endif
DEFINES += -DTOOLKIT_EM_VERSION=\"$(shell $(PERL) $(topsrcdir)/config/milestone.pl --emversion --topsrcdir=$(topsrcdir))\"
DEFINES += -DTOOLKIT_EM_VERSION=\"$(shell $(PERL) $(topsrcdir)/config/milestone.pl --topsrcdir=$(topsrcdir))\"
export:: $(addprefix $(topsrcdir)/xpfe/bootstrap/, $(SHAREDCPPSRCS) $(SHAREDCMMSRCS)) $(STACKWALK_CPPSRCS)
$(INSTALL) $^ .

Просмотреть файл

@ -40,8 +40,8 @@
* A scriptable interface to the nsXULAppAPI structure. See nsXULAppAPI.h for
* a detailed description of each attribute.
*
* @status UNDER_REVIEW - This interface is under review to be frozen, but
* isn't frozen yet. Use with caution.
* @status FROZEN - This interface is frozen for use by embedders and will
* not change in the future.
*/
[scriptable, uuid(a61ede2a-ef09-11d9-a5ce-001124787b2e)]
@ -65,7 +65,7 @@ interface nsIXULAppInfo : nsISupports
readonly attribute ACString ID;
/**
* This is the version of the XUL application. It is different than the
* The version of the XUL application. It is different than the
* version of the XULRunner platform. Be careful about which one you want.
*
* @see nsXREAppData.version
@ -81,8 +81,7 @@ interface nsIXULAppInfo : nsISupports
readonly attribute ACString appBuildID;
/**
* The version of the XULRunner platform, in an extension-manager compatible
* format (1.7+, not 1.8b2).
* The version of the XULRunner platform.
*/
readonly attribute ACString platformVersion;