procvter
来自「proe5.0野火版下载(中文版免费下载)」· 代码 · 共 2,131 行 · 第 1/5 页
TXT
2,131 行
echo "# FILE DOES NOT EXIST" >> $logfile echo "# $convfullfile" >> $logfile echo "" >> $logfile continue endif set convfullfilev=`$ls_cmd $convfullfile* |& egrep '[a-z]*.[a-z]*[0-9]?$' | sort -t. +2n | tail -1` if ("$convfullfilev" == "") set convfullfilev="$convfullfile" set convfilev="$convfullfilev:t" # AT LEAST ONE FILE EXISTS set files_exist # CHECK FORMAT set noglob if ("$unixflavor" == "sys5" || "$mc_type" == "sun4_solaris") then set bott="`tail -100c $convfullfilev | od -c | cut -f2- -d' ' -s`" else set bott="`tail -100c $convfullfilev | od -c | colrm 1 8`" endif set bott=`echo $bott | sed s/' '/''/g` unset noglob echo "$bott" |& grep "$shorttypetag" >& /dev/null if ($status == 0) then set format="short" else echo "$bott" |& grep "$longtypetag" >& /dev/null if ($status == 0) then set format="long" else set format="unknown" endif endif if ("$forceconvert" == "no") then if ("$storemode" == "$format") then echo "# NO CONVERSION NECCESSARY" >> $logfile echo "# $convfullfile" >> $logfile echo "" >> $logfile continue endif endif if ($?full_mode && "$prjdir" == "no" && "$prj_name" == "") then set noglob set top2lines=`sed -n "1,2 p" $convfullfilev` unset noglob if (`echo "$top2lines" | grep "$rev8prjtag" | wc -l` != 0) then echo "# Pro/PROJECT FILE (REV. 8) IGNORED" >> $logfile echo "# $convfullfile" >> $logfile echo "" >> $logfile continue endif endif if ("$prjdir" == "no" && "$prj_name" == "") then set prjutil_status="$prjutil_noaction" # Assume no prj header if ($?prjutil_exists) then cd $convdir $prjutil split $convfilev $dumpdir >& /dev/null set prjutil_status="$status" endif if ("$prjutil_status" == "$prjutil_good") then echo "# Pro/PROJECT FILE IGNORED" >> $logfile echo "# $convfullfile" >> $logfile echo "" >> $logfile continue endif endif set size=`du -s $convfullfilev | awk '{print $1}'` if ("$format" == "short") then @ shortsize = ( $shortsize + $size ) else @ longsize = ( $longsize + $size ) endif echo "$convfullfile" >> $convlistend# CHECK LIST (STILL) HAS ENTRIESset num_lines="0"if (-e $convlist) set num_lines="`cat $convlist | wc -l | tr -d ' '`"if ($num_lines == "0") then if ($?files_exist) then echo "INFORMATION: All files are already '$storemode'" |& tee -a $logfile echo "Use the '-f' flag to force conversion" |& tee -a $logfile echo "" else echo "ERROR: No files found to convert." |& tee -a $logfile echo "" |& tee -a $logfile endif goto QUICK_EXITendifif ("$prj_name" != "") then cp $convlist $convlist.tmp sed s+$prjhomedir/++g $convlist.tmp > $convlist rm -f $convlist.tmpendif# WARN IF NOT ENOUGH DISK SPACE BASED ON THE ESTIMATIONset dfline=`$df_cmd $targetdir |& tail -1 |& sed s/'):'//g`set top=`echo "$dfline" | awk '{print $'$mcol'}'`set avail=`echo "$dfline" | awk '{print $'$fcol'}'`unset space_unknownif (`echo $avail | egrep -c '^[0-9]+$'` == 0) set space_unknownif ("$storemode" == "long") then if ("$geommode" == "nogeom") then set estexpr="($shortsize * $s_l) + $longsize" else set estexpr="($shortsize * $s_lg) + ($longsize * $l_lg)" endifelse if ("$geommode" == "nogeom") then set estexpr="($longsize * $l_s) + $shortsize" else set estexpr="($longsize * $l_sg) + ($shortsize * $s_sg)" endifendifset estsize=`echo "scale=3; $estexpr" | bc | awk -F. '{print $1}'`set origsize=`echo "$longsize + $shortsize" | bc`unset askcontif ($?space_unknown) then if (! $?remote_prjhomedir) then echo "" echo "" echo "WARNING: unable to determine free space in $targetdir" echo " Only continue if you are sure there is enough space." echo "" set askcont endifelse if ("$avail" < "$estsize") then echo "" echo "" echo "WARNING: available space (on $top) $avail $dfunits" echo " estimated conversion space $estsize $dfunits" echo " If you continue you risk filling the disk." echo "" set askcontendifif ($?askcont) then echo -n "Do you wish to continue [n] ?: " set ans="$<" if ("$ans" == "") set ans="n" if ("$ans" == "n" || "$ans" == "no") goto QUICK_EXIT echo "" echo ""endifecho ""if ("$prj_name" != "" && $?remote_prjhomedir) then echo "Cannot determine space requirements." |& tee -a $logfile echo "$name should be run on the project home machine ($prjhomemach)." |& tee -a $logfileelse echo "Total size of files to convert: $origsize ($dfunits)" echo "Total estimated size of converted files: $estsize ($dfunits)" echo "" |& tee -a $logfile echo "#" >> $logfile echo "# 1st pass size summary ($dfunits): Original=$origsize Estimated=$estsize" >> $logfile echo "#" >> $logfileendifecho "" |& tee -a $logfile##################################################################### Preserve some parametersset sv_convlist="$convlist"set sv_startdir="$startdir"set sv_targetdir="$targetdir"if ("$prjdir" == "yes") then set warnings set curline=1 while ($curline <= $num_lines) set convfullfile=`sed -n "$curline p" $convlist` @ curline++ set convfile="$convfullfile:t" set convdir="$convfullfile:h" cd $convdir set nonomatch set convfilev=`$ls_cmd $convfile* |& egrep '[a-z]*.[a-z]*[0-9]?$' | sort -t. +2n | tail -1` unset nonomatch if ("$convfilev" == "") set convfilev="$convfile" # get delta of $startdir, $convdir set delta=`echo "$startdir $convdir" | awk '{s=$1; c=$2; print substr(c,length(s)+2)}'` if ("$delta" != "") then set destdir="$prvstartdir/$delta" else set destdir="$prvstartdir" endif # make sure destdir exists set build="$prvstartdir" set numdirs=`echo $delta | tr '/' ' ' | wc -w` set i=1 while ("$i" <= "$numdirs") set newdir=`echo $delta | awk -F/ '{print $'$i'}'` @ i++ set build="$build/$newdir" if (! -d $build) mkdir $build end cd $convdir $prjutil split $convfilev $destdir >& /dev/null set prjutil_status="$status" switch ($prjutil_status) case $prjutil_noaction # This is ok but 'expensive' cp $convfilev $destdir echo "$dumheadstr" > $destdir/${convfilev}_h breaksw case $prjutil_good mv -f $destdir/${convfilev}_b $destdir/$convfilev breaksw case $prjutil_bad echo "# ERROR: $convdir/$convfilev - invalid Pro/ENGINEER file" >> $logfile continue # DO NOT PROCESS breaksw default echo "# ERROR: (internal error split $convfilev unknown status)" >> $logfile continue # DO NOT PROCESS breaksw endsw # copy the config.pro if not already done for this dir if (-e $convdir/config.pro) then if (! -e $destdir/config.pro) cp $convdir/config.pro $destdir/config.pro endif echo "$destdir/$convfile" >> $convlist.priv end # Modify some parameters for intermediate processing set convlist="${convlist}.priv" set startdir="$prvstartdir" if ("$sv_startdir" == "$sv_targetdir") then set targetdir="$prvstartdir" else set targetdir="$prvtargetdir" endifendif####################################################################echo ""set msg="2nd pass - Process the files (in $convlist)"set numchars=`echo "$msg" | wc -c`@ numchars--echo "$msg"repeat $numchars echo -n "-"echo ""echo ""# CONFIGURE FOR PROJECT MODULE TYPESset rstrprjfile=""if ("$prj_name" == "") then set lays=`cat $convlist | grep '\.lay' | wc -c` set prjs=`cat $convlist | grep '\.prj' | wc -c` if ("$lays" > 0 || "$prjs" > 0) then if ($?dms_env) then # Reqd Pro/PROJECT file. set rstrprjfile="$trlpprj" else set rstrprjfile="$trlprj" endif endifendif## CATCH INTERRUPTS AND CLEANUP## move the following with care - destination depends on vars being set.onintr CLEANUP# IF Pro/PROJECT - CREATE A DUMMY PROJECT FOR LAYOUT RETRIVAL.if ($?dms_env && "$rstrprjfile" != "") then cd $tmpdir set trailfile="$trlpprjcr:t" $procmd $runmode $gfxnum 1 $trailfile >& /dev/null # Allow time for server to create proj. echo "INFORMATION - waiting $dmsserv_delay secs for Pro/PROJECT server (create)." sleep $dmsserv_delayendif# CONSTRUCT CONFIG.PRO FOR 'NONE' OR A SPECIFIC FILENAMEunset test_cfgfilecp $my_cfgfile $realcfgif ("$user_cfgfile" != "existing" && "$user_cfgfile" != "none") then if (-e $user_cfgfile) then cat $user_cfgfile | egrep -v "($tabookeys)" >> $realcfg if (`diff $realcfg $my_cfgfile | wc -l` != 0) set test_cfgfile endifendif# WALK THRU THE CONVERSION LISTset last_convdir=""set convdir=""set num_lines="`cat $convlist | wc -l | tr -d ' '`"set curline=1while ($curline <= $num_lines) set convfullfile=`sed -n "$curline p" $convlist` set filenum="$curline" @ curline++ set convfile="$convfullfile:t" set convdir="$convfullfile:h" if ("$convdir" == "$convfile") set convdir="" # can only occur w/ -prj_name set convexten=`echo $convfile | awk -F. '{print $2}'` set convnameonly=`echo $convfile | awk -F. '{print $1}'` set disp_convdir="$convdir" if ("$prjdir" == "yes") set disp_convdir=`echo "$convdir" | sed s+$startdir+$sv_startdir+` # CONSTRUCT CONFIG.PRO FOR 'EXISTING' if ("$convdir" != "$last_convdir" && "$user_cfgfile" == "existing") then set last_convdir="$convdir" rm -f $realcfg cp $my_cfgfile $realcfg if (-e $convdir/config.pro) cat $convdir/config.pro | egrep -v "($tabookeys)" >> $realcfg unset test_cfgfile if (`diff $realcfg $my_cfgfile | wc -l` != 0) set test_cfgfile endif # CHECK CONFIG FILE WON'T HANG PROE if ($?test_cfgfile) then unset test_cfgfile cd $dumpdir cp $realcfg $dumpdir/config.pro cp $trlend $dumpdir/trlend.txt echo "" echo " --- CHECKING THE CONFIG FILE ---" setenv PCVT_KILLMSG "" $killer 60 & unsetenv PCVT_KILLMSG $procmd $runmode $gfxnum 1 trlend.txt >& /dev/null set prostatus="$status" # STOP KILLER PROCESS AND ITS SLEEP PROCESSES IF NECC. $ps_cmd >& $tmpdir/ps.$pid set killpid=`cat $tmpdir/ps.$pid | grep "$killer" | awk '{print $'$pidcol'}'` if ("$killpid" != "") then set sleeppid=`$ps_cmd | awk '$'$ppidcol' == "'$killpid'" {print $'$pidcol'}'` (kill -9 $killpid) # shell in case process non-existent (kill -9 $sleeppid) # shell in case process non-existent endif rm -f $tmpdir/ps.$pid if ($prostatus != 0 || ! -e trail.txt.1) then cp $my_cfgfile $realcfg # ignore everything from user's config.pro echo "# ERROR: check $convdir/config.pro for errors." >> $logfile echo "ERROR: check $convdir/config.pro for errors." echo "" |& tee -a $logfile else echo "CONFIG FILE OK." echo "" endif endif echo "" echo "PROCESSING FILE ${filenum} OF $num_lines - $prj_name $disp_convdir/$convfile" if ("$prj_name" == "") then cd $convdir set nonomatch set convfilev=`$ls_cmd $convfile* |& egrep '[a-z]*.[a-z]*[0-9]?$' | sort -t. +2n | tail -1` unset nonomatch if ("$convfilev" == "") set convfilev="$convfile" # CHECK FILE (STILL!) EXISTS if (`echo "$convfilev" | grep "$nonoline" | wc -c` > 0) then echo "# FILE DOES NOT EXIST" >> $logfile echo "# file ${filenum} - $convdir/$convfile" >> $logfile echo "" |& tee -a $logfile continue endif # CHECK IF FILE HAS ALREADY BEEN PROCESSED grep -v '#' $logfile | grep $convfullfile >& /dev/null if ($status == 0) then echo "# CONVERTED ABOVE" >> $logfile echo "# file ${filenum} - $convdir/$convfile" >> $logfile echo "" |& tee -a $logfile continue endif endif # CHECK MINIMUM DISK SPACE if ("$min_space" != "0" && ! $?space_unknown) then set kb_avail=`$df_cmd $targetdir |& tail -1 |& sed s/'):'//g |& awk '{print $'$fcol'}'` if ("$dfunits" == "blocks") set kb_avail=`echo $kb_avail/2 | bc` if ("$kb_avail" < "$min_space") then echo "" |& tee -a $logfile echo "# ABORTING: available space in $top = $kb_avail Kb" |& tee -a $logfile echo "# Space cutoff is $min_space Kb" |& tee -a $logfile goto QUICK_EXIT endif endif # CLEAN DUMP DIR set nonomatch rm -f $dumpdir/* $fetchdir/* >& /dev/null unset nonomatch if (! $?import_mode) then set i=1 set buttonnum=0 while ($i <= $#exts) if ($convexten == $exts[$i]) set buttonnum=$i @ i++ end if ($buttonnum == 0) then echo "ERROR:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?