Item1079: Create foswiki2twiki

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release:
Applies To: Extension
Component: BuildContrib
Branches:
Reported By: CrawfordCurrie
Waiting For:
Last Change By: OlivierRaginel
Some of us are still cursed with having to support TWiki for clients. Because I find development easier in Foswiki, I prefer to have my extensions in that namespace; but I also need to be able to convert back to TWiki.

I have a script derived from twiki2foswiki that does the job - ish. It makes a copy of the relevant Foswiki files, converts them but does not add them to subversion. The intent is that the script should be useable as a build step e.g. perl build.pl twiki.

-- CrawfordCurrie - 14 Feb 2009

Done as a BuildContrib feature.

-- CrawfordCurrie - 15 Feb 2009

The fix in distro:7f6d173df819 bothered me, thus I looked into it. In fact the problem is that:
my $text = $this->$sub(<$fh>);
will evaluate the angle operator in list context, whereas
my $text = <$fh>;
will evaluate in scalar context.

The huge difference here is that in list context, undef is undef, whereas it's "" in scalar context. Therefore, if you want to avoid using a temporary variable, use scalar():
my $text = $this->$sub(scalar(<$fh>));

So if the file in $fh is empty, it will return undef (as it's eof()), and it will break.

Maybe the root cause of the issue is that the file shouldn't be empty?

The empty files are:
TinyMCEPlugin/pub/System/TinyMCEPlugin/tinymce/jscripts/tiny_mce/plugins/inlinepopups/readme.txt
core/data/_empty/WebPreferences.txt

-- OlivierRaginel - 23 Feb 2009

ItemTemplate edit

Summary Create foswiki2twiki
ReportedBy CrawfordCurrie
Codebase
SVN Range SVN 2501: Foswiki-1.0.0, Sat, 14 Feb 2009, build 2492
AppliesTo Extension
Component BuildContrib
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:ba9986950852 distro:7f6d173df819
ReleasedIn
Topic revision: r7 - 23 Feb 2009, OlivierRaginel
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy