#!/bin/sh # Copyright for the Uniform Repository Service (c) 1995, 1996, 1997 # by Gerald Banon. All rights reserved. # Version 1.1 # make_repository (mr) pid=$$ na=$# a1=$1 #a2=$2 umask 2 set `echo ../../../../..`; col=$1 set `echo dpi.inpe.br/banon/1995/08.08.00.00`; serv=$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 mkdir .t$pid cat ../../../../../../col/dpi.inpe.br/banon/1995/08.25.00.00/doc/BFF | \ sed -n '/The possible entry types are:/,/list end/p' | sed '$d' >.t$pid/l1 cat >.t$pid/help <.t$pid/z1 2>.t$pid/z2 if test -s .t$pid/z1 then set 95; th=$1 # set echo $th | awk '{ print $1 + 5 }' >.t$pid/mn cat .t$pid/z1 | wc -l >.t$pid/nb set `cat .t$pid/nb`; nb=$1 if test $nb -gt `cat .t$pid/mn` then echo "" echo no repository made echo "" echo You have reached the maximum number of `cat .t$pid/mn` repositories. echo "" echo Please request a new quota from banon@dpi.inpe.br echo "" rm -r .t$pid exit fi fi echo "" echo entry: $a1 #echo citation key: $a2 # file name should be less than or equal to 99 (limit imposed by tar) # This maximum can be acheived in update_index. # The c.* file is created in update@z if test -f domainname then dom=`cat domainname` # dom (domain name) else dom=`domainname` # dom (domain name) fi #echo $a2 | sed 's/::/:xxxx:/' >.t/ct #echo col/$dom/`whoami`/xxxx/xx.xx.xx.xx.xx/bib/`cat .t/ct`/.b/c. | \ #awk '{ print length($0) }' >.t/lg #set `cat .t/lg`; lg=$1 #if test $lg -gt 99 #then # echo "" # echo no repository made # echo "" # echo The citation key is too long. # echo "" # rm -r .t # exit #fi rm -f .t$pid/x1 # default reference echo $a1 | grep clipboard >.t$pid/filename if test -s .t$pid/filename then # isis case at INPE; $a1 directory must contain a.isis pwd=`pwd` if test -d $col/sid.inpe.br/banon/1997/04.23.09.22 || \ test -d $col/sid.inpe.br/banon/1999/01.11.11.33 then rm -f $a1/a.isis ls $a1/*.* >.t$pid/fileList 2>.t$pid/bx /usr/local/samba/bin/smbclient "\\\isis\work" "carrea17" </dev/null get A.txt $pwd/$a1/a.isis quit FIM # > ls $a1/a.isis >.t$pid/ax 2>.t$pid/bx if test -s .t$pid/ax then if test -d $col/dpi.inpe.br/banon/1997/12.04.12.04 then ../doc/isis2bib.tcl \ $a1/a.isis .t$pid/x1 bb2=`cat .t$pid/x1 | egrep '^@' | sed 's/.*{//' | \ sed 's/,$//' | sed 's/:/=/g'` if test -d $col/sid.inpe.br/banon/1997/04.23.09.22 then cat .t$pid/x1 | egrep -v '^$' | \ sed 's/^}$/ targetfile = "homepage.pdf",/' >.t$pid/ax fi # if test -d $col/sid.inpe.br/banon/1999/01.11.11.33 # then # targetfile=`cat .t$pid/fileList | \ #sed -n '1p' | sed 's!^.*/!!'` # takes the first # cat .t$pid/x1 | egrep -v '^$' | \ #sed 's/^}$/ targetfile = "'$targetfile'",/' >.t$pid/ax # fi echo '}' >>.t$pid/ax cat .t$pid/ax >.t$pid/x1 echo 'a.isis' >.t$pid/ex cd $a1 tar cfX $pwd/.t$pid/tmp.tar $pwd/.t$pid/ex * rm -f * cd $pwd fi else echo "" echo a.isis file missing in $a1 echo "" rm -r .t$pid exit fi # < fi # isis case - end # BibTeX case; $a1 disrectory must contain a.bib and *.pdf ls $a1/a.bib >.t$pid/ax 2>.t$pid/bx if test -s .t$pid/ax then cp $a1/a.bib .t$pid/x1 bb2=`cat .t$pid/x1 | egrep '^@' | sed 's/.*{//' | \ sed 's/,$//' | sed 's/:/=/g'` ls $a1/*.pdf >.t$pid/ax 2>.t$pid/bx if test -s .t$pid/ax then cd $a1 tar cf ../../.t$pid/tmp.tar *.pdf rm *.pdf cd ../.. else echo "" echo *.pdf file missing in $a1 echo "" rm -r .t$pid exit fi fi # BibTeX case - end if test ! -f .t$pid/x1 then echo "" echo improper entry type echo "" rm -r .t$pid exit fi fi # default reference - end if test ! -f .t$pid/x1 then b2=XxxxxxYyyyZzzz::ABC bb2='XxxxxxYyyyZzzz==ABC' cat ../../../../../../col/dpi.inpe.br/banon/1995/08.25.00.00/doc/BFF | \ sed -n '1,/^EXAMPLE$/p' | sed -n '/@'$a1'{/,/}/p' | \ sed 's/{,/{'$b2',/' >.t$pid/x1 if test ! -s .t$pid/x1 then echo "" echo improper entry type echo "" rm -r .t$pid exit fi fi cd $col # level 1 from URLib set `echo $dom`; dn1=$1 if test ! -d $dn1 then chmod -f 775 . # migration (March 25) mkdir $dn1 # chmod -w . # col fi cd $dn1 # level 2 from URLib set `whoami`; dn2=$1 if test ! -d $dn2 then chmod -f 775 . # migration (March 25) mkdir $dn2 # chmod -w . # col/* fi cd $dn2 # level 3 from URLib set `date | awk '{ print aux, $6 }'`; dn3=$1 set `date '+%m.%d.%H.%M.%S'`; se=$1 set `echo $se | sed 's/\...$//'`; mn=$1 if test ! -d $dn3 then chmod -f 775 . # migration (March 25) mkdir $dn3 # chmod -w . # col/*/* fi cd $dn3 # level 4 from URLib set `echo $mn`; dn4=$1 if test -d $dn4 then set `echo $se`; dn4=$1 if test -d $dn4 then sleep 1 cd .. # level 3 from URLib set `date | awk '{ print aux, $6 }'`; dn3=$1 set `date '+%m.%d.%H.%M.%S'`; se=$1 set `echo $se | sed 's/\...$//'`; mn=$1 if test ! -d $dn3 then chmod -f 775 . # migration (March 25) mkdir $dn3 # chmod -w . # col/*/* fi cd $dn3 # level 4 from URLib if test -d $mn then set `echo $se`; dn4=$1 else set `echo $mn`; dn4=$1 fi fi fi chmod -f 775 . # migration (March 25) mkdir $dn4 # chmod -w . # col/*/*/* cd $dn4 # level 5 from URLib mkdir bib mkdir doc mkdir not_sent chmod 770 not_sent mkdir .reserved cd .reserved echo x | sed '$d' >ref echo x | sed '$d' >link echo x >last_change echo 'The files in this directory must not be edited.' >Readme #chmod 666 ref #chmod 666 link #chmod 666 last_change cd .. # chmod -w . # col/*/*/*/* cd bib # level 6 from URLib #set `echo $a2 | sed 's/:/=/g'`; b2=$1 mkdir $bb2 chmod 775 $bb2 # chmod -w . # col/*/*/*/*/bib cd $bb2 # level 7 from URLib # place the INPE's icon if test -d ../$col/sid.inpe.br/banon/1997/04.23.09.22 then cp ../$col/dpi.inpe.br/banon/1999/08.31.16.25/doc/inpe.gif inpe.gif fi #echo \ #'<----------------------- maximum line lenght ------------------------->' \ #>a.bib echo "" >a.bib cat ../$col/$serv/not_sent/.t$pid/x1 >>a.bib cd ../$col/$serv/not_sent # level 0 from not_sent echo "" echo $dn1/$dn2/$dn3/$dn4 repository made echo "" ../doc/setindicator if test -f .t$pid/tmp.tar then cd $col/$dn1/$dn2/$dn3/$dn4/doc tar xf $col/$serv/not_sent/.t$pid/tmp.tar cd $col/$serv/not_sent # level 0 from not_sent echo $a1 document deposited echo "" rm -r .t$pid else cd $col/$dn1/$dn2/$dn3/$dn4/doc echo "" >.www_browsable cat >target.html < Target file

Target file

current directory end_target.html cd $col/$serv/not_sent # level 0 from not_sent rm -r .t$pid echo Please echo "" echo 1. deposit or link your document from: echo " "col/$dn1/$dn2/$dn3/$dn4/doc echo "" echo 2. edit the bibliographic reference file: echo " "col/$dn1/$dn2/$dn3/$dn4/bib/$bb2/a.bib echo " "by executing the er command echo "" echo 3. update the index by executing the ui command echo "" echo For any additional information, see the Readme/make_repository echo ascii file. echo "" fi