Changing the =DATE= and =VERS= line in fhem.pl
git-svn-id: https://svn.fhem.de/fhem/trunk@1167 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -3,15 +3,29 @@
|
|||||||
# Server-Side script to check out the fhem SVN repository, and upload the
|
# Server-Side script to check out the fhem SVN repository, and upload the
|
||||||
# changed files to the server
|
# changed files to the server
|
||||||
|
|
||||||
|
$ENV{CVS_RSH}="/usr/bin/ssh";
|
||||||
|
|
||||||
|
print "\n\n";
|
||||||
print localtime() . "\n";
|
print localtime() . "\n";
|
||||||
|
|
||||||
|
chdir("/home/rudi/fhemupdate/culfw");
|
||||||
|
system("svn update .");
|
||||||
chdir("/home/rudi/fhemupdate/fhem");
|
chdir("/home/rudi/fhemupdate/fhem");
|
||||||
system("mkdir -p UPLOAD");
|
system("mkdir -p UPLOAD");
|
||||||
system("svn update . > /dev/null 2>&1");
|
system("svn update .");
|
||||||
die "SVN failed, exiting\n" if($?);
|
die "SVN failed, exiting\n" if($?);
|
||||||
|
|
||||||
|
my $ndiff = `diff fhem.pl fhem.pl.txt | wc -l`;
|
||||||
|
if($ndiff != 4) { # more than the standard stuff is different
|
||||||
|
print "Modifying fhem.pl: >$ndiff<\n";
|
||||||
|
system('perl -p -e "s/=DATE=/"`date +"%Y-%m-%d"`"/;'.
|
||||||
|
's/=VERS=/"`grep ^VERS= Makefile | '.
|
||||||
|
'sed -e s/VERS=//`"+SVN/" fhem.pl > fhem.pl.txt');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
my @filelist = (
|
my @filelist = (
|
||||||
"./fhem.pl",
|
"./fhem.pl.txt",
|
||||||
"FHEM/.*.pm",
|
"FHEM/.*.pm",
|
||||||
"webfrontend/pgm2/.*",
|
"webfrontend/pgm2/.*",
|
||||||
"docs/commandref.html",
|
"docs/commandref.html",
|
||||||
@@ -19,6 +33,7 @@ my @filelist = (
|
|||||||
"docs/HOWTO.html",
|
"docs/HOWTO.html",
|
||||||
"docs/fhem.*.png",
|
"docs/fhem.*.png",
|
||||||
"docs/.*.jpg",
|
"docs/.*.jpg",
|
||||||
|
"../culfw/Devices/CUL/.*.hex",
|
||||||
);
|
);
|
||||||
|
|
||||||
# Read in the file timestamps
|
# Read in the file timestamps
|
||||||
@@ -45,6 +60,7 @@ if(open FH, "UPLOAD/filetimes.txt") {
|
|||||||
while(my $l = <FH>) {
|
while(my $l = <FH>) {
|
||||||
chomp($l);
|
chomp($l);
|
||||||
my ($ts, $fs, $file) = split(" ", $l, 3);
|
my ($ts, $fs, $file) = split(" ", $l, 3);
|
||||||
|
$oldtime{"$file.txt"} = $ts if($file eq "fhem.pl");
|
||||||
$oldtime{$file} = $ts;
|
$oldtime{$file} = $ts;
|
||||||
}
|
}
|
||||||
close(FH);
|
close(FH);
|
||||||
@@ -58,12 +74,14 @@ print FTP "put filetimes.txt\n";
|
|||||||
print FTP "pas\n"; # Without passive only 28 files can be transferred
|
print FTP "pas\n"; # Without passive only 28 files can be transferred
|
||||||
my $cnt;
|
my $cnt;
|
||||||
foreach my $f (sort keys %filetime) {
|
foreach my $f (sort keys %filetime) {
|
||||||
print FH "$filetime{$f} $filesize{$f} $f\n";
|
my $fn = $f;
|
||||||
|
$fn =~ s/.txt$// if($fn =~ m/.pl.txt$/);
|
||||||
|
print FH "$filetime{$f} $filesize{$f} $fn\n";
|
||||||
|
|
||||||
my $newfname = $f;
|
my $newfname = $f;
|
||||||
$newfname .= ".txt" if($newfname =~ m/.pl$/); # Cant download .pl files
|
|
||||||
if(!$oldtime{$f} || $oldtime{$f} ne $filetime{$f}) {
|
if(!$oldtime{$f} || $oldtime{$f} ne $filetime{$f}) {
|
||||||
print FTP "put $newfname\n";
|
print FTP "put $f\n";
|
||||||
system("cp ../$filedir{$f}/$f $newfname");
|
system("cp ../$filedir{$f}/$f $f");
|
||||||
$cnt++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user