From 76ee2a27947ffaf9d83ee689ca1c2db5a1ef1b69 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 3 Jun 2012 15:19:01 +0000 Subject: [PATCH] Forgotten changes... git-svn-id: https://svn.fhem.de/fhem/trunk@1600 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/FB7390/cleanAVMperl | 8 ++++++++ fhem/contrib/FB7390/install | 32 ++++++++++++++------------------ fhem/contrib/fhemupdate.pl | 10 ++++++++++ 3 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 fhem/contrib/FB7390/cleanAVMperl diff --git a/fhem/contrib/FB7390/cleanAVMperl b/fhem/contrib/FB7390/cleanAVMperl new file mode 100644 index 000000000..4488043fa --- /dev/null +++ b/fhem/contrib/FB7390/cleanAVMperl @@ -0,0 +1,8 @@ +rm -rf 5.12.2/unicore +rm -rf 5.12.2/Pod +rm -rf 5.12.2/CPAN* +rm -rf 5.12.2/perl5db.pl +rm -rf 5.12.2/mips-linux/Config.pod +rm -rf 5.12.2/mips-linux/CORE +rm -rf 5.12.2/mips-linux/auto/Encode/{CN,JP,KR,TW} +find . -name \*.pod | xargs rm diff --git a/fhem/contrib/FB7390/install b/fhem/contrib/FB7390/install index 6d4e8dfb3..c8a63476d 100755 --- a/fhem/contrib/FB7390/install +++ b/fhem/contrib/FB7390/install @@ -9,8 +9,10 @@ sleep 1 echo "########################### Extracting fhem.tar.gz ###################" cd $root + if test -d fhem; then - mv fhem fhem.OLD + odir=fhem.old.`date +%Y-%m-%d_%H:%M:%S` + mv fhem $odir fi gzip -cd /var/fhem.tar.gz | tar xf - @@ -18,35 +20,29 @@ gzip -cd /var/fhem.tar.gz | tar xf - cd $root # Save files from the AVM Style installation -if test -f fhem.OLD/opt/etc/fhem.cfg; then +if test -f $odir/etc/fhem.cfg; then echo "########################### Converting chroot style config ###########" export LD_LIBRARY_PATH=$home/lib export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2 - cp fhem.OLD/opt/etc/fhem.cfg fhem - fhem/perl -pi -e 's,/opt,$root,g; - s,fhem/share,fhem,; + cp $odir/etc/fhem.cfg fhem + fhem/perl -pi -e 's,/usr/share/fhem,'$home',g; + s,/var/log/fhem,'$home'/log,; s,^#define autocreate,define autocreate,; s,^#attr autocreate,attr autocreate,; s,ttyACM(.)(@\d+)?,ttyACM$1\@38400,;' fhem/fhem.cfg - mv fhem.OLD/opt/fhem/log/* fhem/log + mv $odir/var/log/fhem/* fhem/log fi # Save files from our old version -if test -f fhem.OLD/fhem.cfg; then - echo "########################### Copying non-chroot style config ##########" - mv fhem.OLD/FHEM/*.sh fhem/FHEM - mv fhem.OLD/FHEM/99.*Util.pm fhem/FHEM - mv fhem.OLD/FHEM/*.sh fhem/FHEM - mv fhem.OLD/log/* fhem/log - mv fhem.OLD/fhem.cfg fhem +if test -f $odir/fhem.cfg; then + mv $odir/FHEM/*.sh fhem/FHEM + mv $odir/FHEM/99.*Util.pm fhem/FHEM + mv $odir/FHEM/*.sh fhem/FHEM + mv $odir/log/* fhem/log + mv $odir/*.cfg fhem fi chown -R boxusr80:root $home -if test -d fhem.OLD; then - echo "########################### Deleting the old directory ###############" - rm -rf fhem.OLD -fi - cat /var/flash/debug.cfg > /var/nvi.tmp grep -q fhem /var/nvi.tmp r=$? diff --git a/fhem/contrib/fhemupdate.pl b/fhem/contrib/fhemupdate.pl index 803ce1fd9..3e9e6f32f 100755 --- a/fhem/contrib/fhemupdate.pl +++ b/fhem/contrib/fhemupdate.pl @@ -40,6 +40,7 @@ my @filelist = ( "docs/fhem.*.png", "docs/.*.jpg", "../culfw/Devices/CUL/.*.hex", + "./CHANGED", ); # Read in the file timestamps @@ -49,6 +50,7 @@ my %filedir; foreach my $fspec (@filelist) { $fspec =~ m,^(.+)/([^/]+)$,; my ($dir,$pattern) = ($1, $2); + opendir DH, $dir || die("Can't open $dir: $!\n"); foreach my $file (grep { /$pattern/ && -f "$dir/$_" } readdir(DH)) { my @st = stat("$dir/$file"); @@ -110,8 +112,10 @@ system("mkdir -p $uploaddir2"); my %filelist2 = ( "./fhem.pl.txt" => ".", + "./CHANGED" => ".", "FHEM/.*.pm" => "FHEM", "../culfw/Devices/CUL/.*.hex" => "FHEM", + "webfrontend/pgm2/.*.pm\$" => "FHEM", "webfrontend/pgm2/.*" => "www/pgm2", "docs/commandref.html" => "www/pgm2", "docs/faq.html" => "www/pgm2", @@ -120,6 +124,11 @@ my %filelist2 = ( "docs/.*.jpg" => "www/pgm2", ); +# Can't make negative regexp to work, so do it with extra logic +my %skiplist2 = ( + "www/pgm2" => ".pm\$", +); + # Read in the file timestamps my %filetime2; my %filesize2; @@ -131,6 +140,7 @@ foreach my $fspec (keys %filelist2) { my $tdir = $filelist2{$fspec}; opendir DH, $dir || die("Can't open $dir: $!\n"); foreach my $file (grep { /$pattern/ && -f "$dir/$_" } readdir(DH)) { + next if($skiplist2{$tdir} && $file =~ m/$skiplist2{$tdir}/); my @st = stat("$dir/$file"); my @mt = localtime($st[9]); $filetime2{"$tdir/$file"} = sprintf "%04d-%02d-%02d_%02d:%02d:%02d",