[Koha-cvs] CVS: koha/misc Install.pm,1.41,1.42

MJ Ray slef at users.sourceforge.net
Mon Jun 30 13:23:09 CEST 2003


Update of /cvsroot/koha/koha/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv6916

Modified Files:
	Install.pm 
Log Message:
File copying repair.  Fixes #489

Index: Install.pm
===================================================================
RCS file: /cvsroot/koha/koha/misc/Install.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** Install.pm	30 Jun 2003 10:06:18 -0000	1.41
--- Install.pm	30 Jun 2003 11:23:06 -0000	1.42
***************
*** 21,25 ****
  #
  # Recent Authors
! # MJR: my.cnf, etcdir, prefix, new display, apache conf
  
  use strict;
--- 21,25 ----
  #
  # Recent Authors
! # MJR: my.cnf, etcdir, prefix, new display, apache conf, copying fixups
  
  use strict;
***************
*** 784,789 ****
         mkdir_parents (dirname($intranetdir), 0775) || print getmessage('DirFailed','parents of '.$intranetdir);
         mkdir ($intranetdir,                  0770) || print getmessage('DirFailed',$intranetdir);
!        chown (oct(0), (getgrnam($httpduser))[2], "$intranetdir");
!        chmod (oct(770), "$intranetdir");
      }
      mkdir_parents ("$intranetdir/htdocs",    0750);
--- 784,789 ----
         mkdir_parents (dirname($intranetdir), 0775) || print getmessage('DirFailed','parents of '.$intranetdir);
         mkdir ($intranetdir,                  0770) || print getmessage('DirFailed',$intranetdir);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2], "$intranetdir"); }
!        chmod 0770, "$intranetdir";
      }
      mkdir_parents ("$intranetdir/htdocs",    0750);
***************
*** 794,798 ****
         mkdir_parents (dirname($opacdir),     0775) || print getmessage('DirFailed','parents of '.$opacdir);
         mkdir ($opacdir,                      0770) || print getmessage('DirFailed',$opacdir);
!        chown (oct(0), (getgrnam($httpduser))[2], "$opacdir");
         chmod (oct(770), "$opacdir");
      }
--- 794,798 ----
         mkdir_parents (dirname($opacdir),     0775) || print getmessage('DirFailed','parents of '.$opacdir);
         mkdir ($opacdir,                      0770) || print getmessage('DirFailed',$opacdir);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2], "$opacdir"); }
         chmod (oct(770), "$opacdir");
      }
***************
*** 804,808 ****
         mkdir_parents (dirname($kohalogdir),  0775) || print getmessage('DirFailed','parents of '.$kohalogdir);
         mkdir ($kohalogdir,                   0770) || print getmessage('DirFailed',$kohalogdir);
!        chown (oct(0), (getgrnam($httpduser))[2,3], "$kohalogdir");
         chmod (oct(770), "$kohalogdir");
      }
--- 804,808 ----
         mkdir_parents (dirname($kohalogdir),  0775) || print getmessage('DirFailed','parents of '.$kohalogdir);
         mkdir ($kohalogdir,                   0770) || print getmessage('DirFailed',$kohalogdir);
!        if ($>==0) { chown (oct(0), (getgrnam($httpduser))[2,3], "$kohalogdir"); }
         chmod (oct(770), "$kohalogdir");
      }
***************
*** 1336,1344 ****
      		print getmessage('CopyingFiles', ["old ".$desc,$tgt.".old"]);
  			system("mv ".$tgt." ".$tgt.".old");
! 			}
  
      	print getmessage('CopyingFiles', [$desc,$tgt]);
! 	    system("cp -R ".$src."/* ".$tgt);
! 		}
  
      showmessage(getmessage('InstallFiles'),'none');
--- 1336,1344 ----
      		print getmessage('CopyingFiles', ["old ".$desc,$tgt.".old"]);
  			system("mv ".$tgt." ".$tgt.".old");
! 		}
  
      	print getmessage('CopyingFiles', [$desc,$tgt]);
! 	    system("cp -R ".$src." ".$tgt);
! 	}
  
      showmessage(getmessage('InstallFiles'),'none');
***************
*** 1346,1357 ****
      neatcopy("admin templates", 'intranet-html', "$intranetdir/htdocs");
      neatcopy("admin interface", 'intranet-cgi', "$intranetdir/cgi-bin");
!     neatcopy("main scripts", 'scripts', "$intranetdir/scripts/");
!     neatcopy("perl modules", 'modules', "$intranetdir/modules/");
!     neatcopy("OPAC templates", 'opac-html', "$opacdir/htdocs/");
!     neatcopy("OPAC interface", 'opac-cgi', "$opacdir/cgi-bin/");
      system("touch $opacdir/cgi-bin/opac");
  
!     system("chown -R $httpduser:$httpduser $opacdir");
!     system("chown -R $httpduser:$httpduser $intranetdir");
  
      # Create /etc/koha.conf
--- 1346,1360 ----
      neatcopy("admin templates", 'intranet-html', "$intranetdir/htdocs");
      neatcopy("admin interface", 'intranet-cgi', "$intranetdir/cgi-bin");
!     neatcopy("main scripts", 'scripts', "$intranetdir/scripts");
!     neatcopy("perl modules", 'modules', "$intranetdir/modules");
!     neatcopy("OPAC templates", 'opac-html', "$opacdir/htdocs");
!     neatcopy("OPAC interface", 'opac-cgi', "$opacdir/cgi-bin");
      system("touch $opacdir/cgi-bin/opac");
  
! 	#MJR: is this necessary?
! 	if ($> == 0) {
! 	    system("chown -R $httpduser:$httpduser $opacdir $intranetdir");
!     }
! 	system("chmod -R a+rx $opacdir $intranetdir");
  
      # Create /etc/koha.conf
***************
*** 1376,1388 ****
      umask($old_umask);
  
!     chown((getpwnam($httpduser)) [2,3], "$etcdir/koha.conf.tmp") or warn "can't chown koha.conf: $!";
      chmod 0440, "$etcdir/koha.conf.tmp";
! 
!     chmod 0750, "$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh";
!     chmod 0750, "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh";
!     chmod 0750, "$intranetdir/scripts/z3950daemon/processz3950queue";
!     chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!";
!     chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/processz3950queue") or warn "can't chown $intranetdir/scripts/z3950daemon/processz3950queue: $!";
! 
  }
  
--- 1379,1393 ----
      umask($old_umask);
  
! 	#MJR: can't help but this be broken, can we?
      chmod 0440, "$etcdir/koha.conf.tmp";
! 	
! 	#MJR: does this contain any passwords?
!     chmod 0755, "$intranetdir/scripts/z3950daemon/z3950-daemon-launch.sh", "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh", "$intranetdir/scripts/z3950daemon/processz3950queue";
! 
! 	if ($> == 0) {
! 	    chown((getpwnam($httpduser)) [2,3], "$etcdir/koha.conf.tmp") or warn "can't chown koha.conf: $!";
!     	chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh") or warn "can't chown $intranetdir/scripts/z3950daemon/z3950-daemon-shell.sh: $!";
!     	chown(0, (getpwnam($httpduser)) [3], "$intranetdir/scripts/z3950daemon/processz3950queue") or warn "can't chown $intranetdir/scripts/z3950daemon/processz3950queue: $!";
! 	} #MJR: FIXME: Should report that we haven't chown()d.
  }
  





More information about the Koha-cvs mailing list