pro mk_pubydb
;
;+
;   Name: mk_pubydb
;
;   Purpose: make the ydb mapping file (used by ydb_install)
;
;   Calling Sequence:
;      mk_pubydb
;
;   Generally called by cron job via software account
;
;   History:
;     S.L.Freeland
;-
infile=concat_dir('$DIR_GEN_SETUP','pubydb.config_temp')
outfile=str_replace(infile,'_temp','')

data=rd_tfile(infile,nocomment='#',2)
comments=(rd_tfile(infile,nocomment='#',delim=';',2))(1,*)
envs=reform(data(0,*))
trans=reform(get_logenv(envs))
distrib=reform(data(1,*))

delim=' ; '
outstr=strjustify(envs)     		+ delim + $
       strlowcase(strmid(envs,8,3))	+ delim + $
       strjustify(trans)    		+ delim + $
       strjustify(distrib)  		+ delim + $
       strjustify(comments)

pr_status,txt
file_append,outfile,$
   ['# Yohkoh YDB mapping file','', $
    '# ' + txt,'', strtrim(outstr,2)],/new
return
end
