- Fix found_cnt and proceed_cnt statistics,

- make more robust dsrom.lst finger print computation.
This commit is contained in:
agibert 2009-04-11 21:12:28 +00:00
parent 6774f165e9
commit 209ce90b81

46
nds2rm
View File

@ -5,9 +5,9 @@
# (C) 2009 Arnaud G. Gibert # (C) 2009 Arnaud G. Gibert
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
# $RCSfile: nds2rm,v $ # $RCSfile: nds2rm,v $
# $Revision: 1.12 $ # $Revision: 1.13 $
# $Name: $ # $Name: $
# $Date: 2009/04/06 00:06:45 $ # $Date: 2009/04/11 21:12:28 $
# $Author: agibert $ # $Author: agibert $
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
@ -541,11 +541,13 @@ function mask_get()
function dsrom_dump() function dsrom_dump()
{ {
echo "dumping ds rom list..." 1>&2
i=1 i=1
while [[ ${i} -le ${loaded_cnt} ]] while [[ ${i} -le ${loaded_cnt} ]]
do do
if [[ ${dat_status[${i}]} != "?" ]] if [[ "${dat_status[${i}]}" != "?" ]]
then then
mask=$(mask_get "${dat_save_type[${i}]}") mask=$(mask_get "${dat_save_type[${i}]}")
@ -1133,8 +1135,12 @@ function suffix_mng()
dat_dup[${idx}]="${dup_id}" dat_dup[${idx}]="${dup_id}"
# Test if file is a new idx or different status
if [[ ( ${idx} != ${idx_old} ) || ( "${status}" != "${status_old}" ) ]] if [[ ( ${idx} != ${idx_old} ) || ( "${status}" != "${status_old}" ) ]]
then then
# Non duplicate rom
idx_old=${idx} idx_old=${idx}
status_old=${status} status_old=${status}
dup_id=0 dup_id=0
@ -1148,6 +1154,8 @@ function suffix_mng()
ko_cnt=$((${ko_cnt} + 1)) ko_cnt=$((${ko_cnt} + 1))
fi fi
else else
# Duplicate rom
dup_id=$((${dup_id} + 1)) dup_id=$((${dup_id} + 1))
file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>-${dup_id}.${CSFX}" file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>-${dup_id}.${CSFX}"
@ -1266,10 +1274,7 @@ function stats_proceed()
\rm -f "${STATS_FILE}" \rm -f "${STATS_FILE}"
found_cnt=$((${ok_cnt} + ${ko_cnt} + ${dup_cnt} + ${ignored_cnt})) # Compute ok, ko_nok and missing count
proceeded_cnt=$((${found_cnt} - ${ignored_cnt}))
# Compute ok ko_nok and missing count
i=1 i=1
@ -1293,6 +1298,8 @@ function stats_proceed()
i=$(( ${i} + 1 )) i=$(( ${i} + 1 ))
done done
found_cnt=$((${ok_cnt} + ${ko_cnt} + ${dup_cnt} + ${ignored_cnt}))
proceeded_cnt=$((${found_cnt} - ${ignored_cnt}))
ok_total_cnt=$((${ok_cnt} + ${ok_dup_cnt})) ok_total_cnt=$((${ok_cnt} + ${ok_dup_cnt}))
ko_total_cnt=$((${ko_cnt} + ${ko_dup_cnt})) ko_total_cnt=$((${ko_cnt} + ${ko_dup_cnt}))
} }
@ -1346,10 +1353,10 @@ function stats_print()
# DSROM Mode # FingerPrint Scan
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
function dsrom_mode() function fp_scan()
{ {
echo "scanning rom repository..." 1>&2 echo "scanning rom repository..." 1>&2
@ -1386,8 +1393,16 @@ function dsrom_mode()
fp=${file/*\} \</}; fp=${fp/\>*/} fp=${file/*\} \</}; fp=${fp/\>*/}
status=${file/* \[/}; status=${status/\] \{*/} status=${file/* \[/}; status=${status/\] \{*/}
if [[ ( "${dat_fp[${idx}]}" == "????" ) || ( ( "${dat_status[${idx}]}" == "KO" ) && ( "${status}" == "OK" ) ) ]]
then
dat_fp[${idx}]=${fp} dat_fp[${idx}]=${fp}
dat_status[${idx}]=${status} dat_status[${idx}]=${status}
else
if [[ "${dat_fp[${idx}]}" != "${fp}" ]]
then
echo "Skipping: (${idx}): [${dat_fp[${idx}]}]:[${dat_status[${idx}]}] ==> [${fp}]:[${status}] !!!" 1>&2
fi
fi
fi fi
found_cnt=$((${found_cnt} + 1)) found_cnt=$((${found_cnt} + 1))
@ -1396,6 +1411,19 @@ function dsrom_mode()
done < ${tmp_file} done < ${tmp_file}
\rm -f ${tmp_file} \rm -f ${tmp_file}
}
# DSROM Mode
#-----------------------------------------------------------------------------------------------------------------------------------
function dsrom_mode()
{
# Scan repository for fp
fp_scan
# Dump it ! # Dump it !
dsrom_dump dsrom_dump