- 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

54
nds2rm
View File

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