Subversion Repositories wimsdev

Rev

Rev 14627 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!read scripts/getindex.proc $mod
!if $title=$empty
  job=modname
  !changeto modname.proc
!endif
!if $fnewname=$fname
  error=nochange
!exit
!endif
allowchar=/.-_$alnum
fname=!word 1 of $fname
fname=!text select $allowchar in $fname
c=!char 1 of $fname
!if $c=. or $c=/ or .. isin $fname
  !goto badname
!endif
!read files.proc
!if $fname notitemof $files
  :badname
  error=bad_fname
  lastfname=$fname
  job=flist
  !changeto flist.proc
!endif
allowchar=/._$alnum
fnewname=!word 1 of $fnewname
fnewname=!text select $allowchar in $fnewname
c=!char 1 of $fnewname
!if $c=. or $c=/ or .. isin $fnewname
  !goto badname
!endif
!read files.proc
!if $fnewname isitemof $files
  error=bad_fname_already
  lastfname=$fname
  job=flist
  !changeto flist.proc
!endif
!if $fnewname=$empty
  job=flist
  !changeto $job.proc
!endif

moddir=modules/devel/$auth_login/$mod
!if ../src/ isin ../$fnewname
  mkdef=src2def 2>/dev/null
!else
  !reset mkdef
!endif
test=!sh cd $moddir; ls

!sh cd $moddir\
  mkdir -p .deleted\
  cp $fname .deleted\
  mv $fname $fnewname\
  $mkdef
!if .oef$ $ isin $(fname)$ $
  im=!replace internal src by images in $fname
  im=!replace internal .oef by in $im
  testim=yes
  im=!replace internal _src by images in _$fname
  im=!replace internal .oef by in $im
  fname_=!replace internal / by , in $fnewname
  imnew=!replace internal .oef by in images/$(fname_[2])
  !sh cd $moddir\
  if [ -d $im ]; then mv $im $imnew; fi;
!endif
wims_module_log=move $mod/$fname