#!/bin/sh # Copyright for the Uniform Repository Service (c) 1995, 1996, 1997, # by Gerald Banon. All rights reserved. # Version 1.1 # freeze_repository na=$# a1=$1 umask 2 set `echo ../../../../..`; col=$1 cd .. # level 0 from not_sent if test ! -d library_service then echo "" echo improper current directory echo "" echo The current directory must be library_service. echo "" exit fi case $na in 0) echo "" echo The repository name must be entered as an argument for \ remove_repository. echo "" echo Example: if the retository is dpi.inpe.br/banon/1995/09.07.12.55 echo then enter echo "" echo freeze_repository dpi.inpe.br/banon/1995/09.07.12.55 echo "" exit ;; *) ;; esac if test -d .t then echo "" echo You are requesting a new process from the library service ls -ld .t | awk \ '{ printf "but there is an old one, requested by %s,\n", $3 }' echo which is still running or terminates abnormally. echo "" echo Do you want to cancel the old process? echo \(answer yes or no, default is no\) read answer echo $answer | sed 's/$/n/' | \ awk '{ printf "%s\n", substr($1,1,1) }' >.t1 set `cat .t1`; a=$1 if test $a = y then rm -r .t rm .t1 else rm .t1 exit fi fi mkdir .t ls -d $col/$a1 >.t/z1 2>.t/z2 if test ! -s .t/z1 then echo "" echo The $a1 repository does not exist in this echo local collection. echo "" rm -r .t exit fi #echo $a1 >.t/m1 #cat .t/m1 >.t/member_list #../doc/createlist $col #cat .t/member_list >.t/list # problem with absoluteLink and relativeLink # cat .t/member_list | sed '/Librarian::/d' >.t/list ? echo $a1 >.t/list if test -s .t/list then cat .t/list >.t/i1 while test -s .t/i1 do cat .t/i1 | sed -n '1p' >.t/rp ls -t $col/`cat .t/rp`/bib/*/a.bib | sed -n '1p' | \ awk -F/ '{ printf "%s\n", $11 }' >.t/ky1 set `date`; year=$6 cat .t/ky1 | sed 's/==/='$year'=/' >.t/ky2 # # cat .t/ky1 | sed 's/=....=/==/' >.t/ky2 # chmod -R +w $col/`cat .t/rp` if test `cat .t/ky1` != `cat .t/ky2` then mv $col/`cat .t/rp`/bib/`cat .t/ky1` \ $col/`cat .t/rp`/bib/`cat .t/ky2` fi cat $col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib | \ sed 's/^[ ]*year = .*$/ year = "'$year'",/' >.t/ax cat .t/ax >$col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib cat $col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib | \ sed -n '/^@/p' >.t/fl1 set `cat .t/fl1`; fl1=$1 cat .t/fl1 | sed 's/{.*$/{/' >.t/tp echo `cat .t/tp``cat .t/ky2`',' | sed 's/=/:/g' >.t/fl2 set `cat .t/fl2`; fl2=$1 cat $col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib | \ sed 's/'$fl1'/'$fl2'/' >.t/ax chmod -f +w $col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib # migration (March 25) cat .t/ax >$col/`cat .t/rp`/bib/`cat .t/ky2`/a.bib # rm -f $col/`cat .t/rp`/bib/`cat .t/ky2`/.[bh]/c.* # turn write permission off chmod -R -w $col/`cat .t/rp`/doc # cat .t/i1 | sed '1d' > .t/i2 cat .t/i2 >.t/i1 done fi set `wc -l .t/list`; nm=$1 case $nm in 0) echo "" echo no repository frozen echo "" rm -r .t exit ;; 1) echo "" cat .t/list echo "" echo repository frozen echo "" ;; *) echo "" cat .t/list echo "" echo repositories frozen echo "" ;; esac ../doc/setindicator rm -r .t