Skip to content

Commit

Permalink
Item13757: move SHORTDESC into Description formfield
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 26, 2015
1 parent 24def3c commit cc435b3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
14 changes: 6 additions & 8 deletions BuildContrib/data/System/BuildContrib.txt
@@ -1,9 +1,9 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1438970857" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1443271504" format="1.1" version="1"}%
%META:TOPICPARENT{name="Contribs"}%
---+!! Foswiki Developer Environment
<a href="http://wikiring.com" class="foswikiRight"><img src="%ATTACHURLPATH% \logo.gif" title="WikiRing: Professional Wiki Innovation and Support" /></a>

%SHORTDESCRIPTION%
%FORMFIELD{"Description"}%

%TOC%

Expand Down Expand Up @@ -643,10 +643,7 @@ histories are preserved.

If you want your installer to do anything else then you will need to write a [[#InstallScripts][POSTINSTALL script]].

<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
%JQREQUIRE{"chili"}%
-->
<!-- %JQREQUIRE{"chili"}% -->

---++ Installation Instructions
You are strongly recommended to use this Contrib to help split your code development away from your live Foswiki environment, as described [[#DevelopmentModel][above]].
Expand All @@ -663,10 +660,11 @@ See the repository for full change history.
%META:FIELD{name="Author" title="Author" value="[[http://c-dot.co.uk][Crawford Currie]]"}%
%META:FIELD{name="Version" title="Version" value="%25$VERSION%25"}%
%META:FIELD{name="Release" title="Release" value="%25$RELEASE%25"}%
%META:FIELD{name="Description" title="Release" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Copyright" value="Foswiki Contributors 2004-2015, All Rights Reserved"}%
%META:FIELD{name="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Repository" value="https://github.com/foswiki/distro"}%
%META:FIELD{name="Home" value="http://foswiki.org/Extensions/BuildContrib"}%
%META:FIELD{name="Support" value="http://foswiki.org/Support/BuildContrib"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1438970857" size="1343" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="logo.gif" attr="" comment="logo" date="1438970857" size="14169" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" date="1443271504" size="1343" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="logo.gif" attr="" comment="logo" date="1443271504" size="14169" user="ProjectContributor" version="1"}%
9 changes: 8 additions & 1 deletion BuildContrib/lib/Foswiki/Contrib/Build.pm
Expand Up @@ -988,12 +988,19 @@ sub filter_txt {

# Hack to support those who edit topics using Foswiki, where
# % gets encoded as %25 in field values
$text =~ s/%25\$(\w+)%25/&_expand($this,$1)/ge;
$text =~ s/%25\$(\w+)%25/&_encode(&_expand($this,$1))/ge;
return $text;
}
);
}

sub _encode {
my $datum = shift;

$datum =~ s/([%"\r\n{}])/'%'.sprintf('%02x',ord($1))/ge;
return $datum;
}

sub _expand {
my ( $this, $tok ) = @_;
if ( !$this->{$tok} && $tok eq 'POD' ) {
Expand Down
4 changes: 2 additions & 2 deletions BuildContrib/lib/Foswiki/Contrib/BuildContrib.pm
@@ -1,8 +1,8 @@
package Foswiki::Contrib::BuildContrib;
use strict;

our $VERSION = '1.85';
our $RELEASE = '08 Jul 2015';
our $VERSION = '1.90';
our $RELEASE = '25 Sep 2015';

our $SHORTDESCRIPTION =
'Automates build and packaging process, including installer generation, for extension modules.';
Expand Down
24 changes: 16 additions & 8 deletions BuildContrib/lib/Foswiki/Contrib/BuildContrib/Targets/stage.pm
Expand Up @@ -37,14 +37,15 @@ sub form_repair {

# Extract form data from text
my %data = (
Author => "ProjectContributor",
Release => '%$RELEASE%',
Version => '%$VERSION%',
Copyright => '',
License => '',
Home => 'http://foswiki.org/Extensions/%$ROOTMODULE%',
Support => 'http://foswiki.org/Support/%$ROOTMODULE%',
Repository => 'https://github.com/foswiki/%$ROOTMODULE%'
Author => "ProjectContributor",
Release => '%$RELEASE%',
Version => '%$VERSION%',
Description => '%$SHORTDESCRIPTION%',
Copyright => '',
License => '',
Home => 'http://foswiki.org/Extensions/%$ROOTMODULE%',
Support => 'http://foswiki.org/Support/%$ROOTMODULE%',
Repository => 'https://github.com/foswiki/%$ROOTMODULE%'
);
my $form = "\n\%META:FORM{name=\"PackageForm\"}%\n";
foreach my $field ( sort keys %data ) {
Expand All @@ -70,6 +71,13 @@ sub form_repair {
$data{$field} =~ s/(["\r\n])/'%'.sprintf('%02x',ord($1))/ge;
}

if ( $text =~ s/^ * Set SHORTDESCRIPTION = (.*)$//m ) {
$data{$field} = $1;
$data{$field} =~ s/(["\r\n])/'%'.sprintf('%02x',ord($1))/ge;
}

$text =~ s/\%SHORTDESCRIPTION%/%FORMFIELD{"Description"}%/g;

#print STDERR "FIELD $field DATA $data{$field}\n";
print STDERR "WARNING: no Copyright set in the PackageForm.\n"
if ( $field eq 'Copyright' && !$data{$field} );
Expand Down

0 comments on commit cc435b3

Please sign in to comment.