Skip to content

Commit

Permalink
Item14347: Remove useless files, improve the remainig
Browse files Browse the repository at this point in the history
fixTopicInfo.pl and fix_topic_timestamps.pl both address similar
issues to develop/git-fix-meta.pl.  Remove the two from the tools
directory and keep the develop version.

Also, figure out the root directory, so it can be run while in any
directory.
  • Loading branch information
gac410 committed Mar 25, 2017
1 parent 813cbd0 commit 8eb8a08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 219 deletions.
10 changes: 8 additions & 2 deletions core/tools/develop/git-fix-meta.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# - Removes comment, reprev and path args
# - Converts autoattached files to hidden attachments
# - Adds a user= when missing from attachments.
# - Removes stale stream and tempFilename attributes
#
# If run with one or more optional filenames, the git status command is omitted
# and the named files are updated.
Expand All @@ -30,6 +31,9 @@
$gitstatus = 1;
}

my $rootdir = `git rev-parse --show-toplevel`;
chomp $rootdir;

foreach my $f (@files) {
if ($gitstatus) {
chomp $f;
Expand All @@ -40,7 +44,7 @@
/data\/(?:System|Sandbox|TestCases|Main|_empty|_default|Trash|TWiki)\/.*?\.txt$/;
print "Fixing timestamp on: $f\n";
my $date = time;
open( F, "<", "$f" ) || die "Could not open $f for read";
open( F, "<", "$rootdir/$f" ) || die "Could not open $rootdir/$f for read";
my @lines;
while ( my $l = <F> ) {
chomp($l);
Expand All @@ -54,14 +58,16 @@
$l =~ s/[\s]+/ /;
$l =~ s/ attr="" autoattached="1"/ attr="h"/;
$l =~ s/ path="[^"]*"//;
$l =~ s/ stream="[^"]*"//;
$l =~ s/ tmpFilename="[^"]*"//;
}
if ( $l =~ /^%META:FILEATTACHMENT\{(.*)\}%$/ && $l !~ m/user=/ ) {
$l =~ s/date=/user="ProjectContributor" date=/;
}
push( @lines, $l );
}
close(F);
open( F, ">", "$f" ) || die "Could not open $f for write";
open( F, ">", "$rootdir/$f" ) || die "Could not open $rootdir/$f for write";
print F join( "\n", @lines ) . "\n";
close(F);
}
168 changes: 0 additions & 168 deletions core/tools/fixTopicInfo.pl

This file was deleted.

49 changes: 0 additions & 49 deletions core/tools/fix_topic_timestamps.pl

This file was deleted.

0 comments on commit 8eb8a08

Please sign in to comment.