Skip to content

Commit

Permalink
Merge branch 'Release02x01'
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Jan 26, 2017
2 parents e8716ea + d307965 commit 8e9d32b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MailerContrib/lib/Foswiki/Contrib/MailerContrib/MANIFEST
Expand Up @@ -15,5 +15,5 @@ data/System/MailerContribPlugin.txt 0644
tools/mailnotify 0555
templates/mailnotify.tmpl 0444
templates/newsletter.tmpl 0444
pub/System/MailerContrib/wikiringlogo20x20.png 0660
pub/System/MailerContrib/logo.gif 0660
pub/System/MailerContrib/wikiringlogo20x20.png 0644
pub/System/MailerContrib/logo.gif 0644
11 changes: 11 additions & 0 deletions UnitTestContrib/test/unit/DependencyTests.pm
Expand Up @@ -586,6 +586,17 @@ sub test_compare_extension_versions {
[ 1, '1.2.3', undef, '>', '7429' ],
[ 1, '1.2.3', undef, '<', '13213' ],

# svn installed, tuple requested - svn is obsolete, so always return true
# Except when the "tuple" is a simple integer.
[ 1, '2.4.1', '$Rev: 15237 (2012-07-31) $', '<', 2.50 ],
[ 1, '2.4.1', '$Rev: 15237 (2012-07-31) $', '>', 2.50 ],
[ 1, '2.4.1', '$Rev: 15237 (2012-07-31) $', '<', 16000 ],
[ 0, '2.4.1', '$Rev: 15237 (2012-07-31) $', '<', 13000 ],

# Special case, even though "Release" 2.4.1 is > 2.4.0
# the VERSION string is the authority.
[ 1, '2.4.1', '$Rev: 15237 (2012-07-31) $', '<', '2.4.0' ],

# Decimal rev installed, compared to svn rev requested
# Always true - assume migration from rev to triplet
[ 1, '1.2', '1.2', '>', '7429' ],
Expand Down
2 changes: 1 addition & 1 deletion WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/MANIFEST
Expand Up @@ -14,4 +14,4 @@ data/System/WysiwygPluginSettings.txt 0644 Documentation and settings
data/System/WysiwygPluginTopicLister.txt 0644 Special AJAX topic
tools/html2tml.pl 0555 Stand-alone convertor script
tools/tml2html.pl 0555 Stand-alone convertor script
pub/System/WysiwygPlugin/wikiringlogo20x20.png 0660
pub/System/WysiwygPlugin/wikiringlogo20x20.png 0644
23 changes: 21 additions & 2 deletions core/lib/Foswiki/Configure/Dependency.pm
Expand Up @@ -440,6 +440,8 @@ sub _compare_extension_versions {
# $b - what we are comparing to (from DEPENDENCIES or configure FastReport)
my ( $this, $op, $reqVer ) = @_;

#print STDERR "Requiring $op $reqVer\n";

my $aRELEASE = $this->{installedRelease};
my $aVERSION = $this->{installedVersion};

Expand Down Expand Up @@ -488,6 +490,8 @@ sub _compare_extension_versions {
}
}
if ( $reqType eq 'svn' ) {

#print STDERR "reqType is svn\n";
unless ( $baseType eq 'svn' ) {

#print STDERR "Try a different comparison\n";
Expand All @@ -501,6 +505,8 @@ sub _compare_extension_versions {
}

if ( $reqType eq 'date' ) {

#print STDERR "reqType is date\n";
unless ( $baseType eq 'date' ) {

# Inconsistent VERSION, so try RELEASE
Expand Down Expand Up @@ -568,11 +574,22 @@ sub _compare_extension_versions {
return 0 if ( $atuple[2] < 1 || $btuple[2] < 1 );
}

if ( $baseType eq 'svn' && $reqType ne 'svn' ) {

# Anything to SVN other than SVN or Integers needs to succeed.
return 1 unless $reqVer =~ m/^\d+$/; #keep going for integers
}

# We can't figure out the types, so just return false.
return 0 if ( $baseType eq 'unknown' || $reqType eq 'unknown' );

#print STDERR "have basetype $baseType reqType $reqType\n";

# Do the comparisons
( my $a, $b ) = _digitise_tuples( \@atuple, \@btuple );

#print STDERR "Doing the comparison $a $string_op $b\n";

my $comparison = "'$a' $string_op '$b'";
my $result = eval($comparison);

Expand Down Expand Up @@ -784,7 +801,8 @@ sub extractModuleVersion {
my $exp = $1;
$exp =~ s/\$RELEASE/\$mod_release/g;
eval("\$mod_version =~ $exp;");
die "1-Failed to eval $1 from $_ in $file at line $.: $@\n"
print STDERR
"Dependency.pm 1-Failed to eval $1 from $_ in $file at line $.: $@\n"
if ($@);
last;
}
Expand All @@ -800,7 +818,8 @@ sub extractModuleVersion {
)
{
eval( "\$mod_" . lc($1) . " = $2;" );
die "2-Failed to eval $2 from $_ in $file at line $.: $@\n"
print STDERR
"Dependency.pm 2-Failed to eval $2 from $_ in $file at line $.: $@\n"
if ($@);
next;
}
Expand Down

0 comments on commit 8e9d32b

Please sign in to comment.