Compare commits

..

No commits in common. "master" and "nds2rm-1_1_0-1" have entirely different histories.

3 changed files with 45 additions and 64 deletions

View File

@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $ # $RCSfile: ReadMe.txt,v $
# $Revision: 1.5 $ # $Revision: 1.4 $
# $Name: $ # $Name: $
# $Date: 2009/12/07 11:32:06 $ # $Date: 2009/04/26 00:14:32 $
# $Author: agibert $ # $Author: agibert $
@ -29,37 +29,34 @@ There is three modes available
Repository structure Repository structure
-------------------- --------------------
The repository is minimally composed by two directory: roms and misc. The repository is minimally composed by two directory: roms and misc.
The rom directory is full of rom files. These file can be uncompressed (.nds) or compressed. Three compressors are supported: zip, rar and 7zip. Next to a nds2rm run, the rom file names and rom archive file names follow the RRFNFS 1.2 format. Before a nds2rn run, the rom file names must start with a number followed by a space. The rom directory is full of rom files. These file can be uncompressed (.nds) or compressed. Three compressors are supported: zip, rar and 7zip. Next to a nds2rm run, the rom file names and rom archive file names follow the RRFNFS 1.1 format. Before a nds2rn run, the rom file names must start with a number followed by a space.
In the misc directory, nds2rm is looking for the dat file: dsrom.xml. This file is comming from http://www.advanscene.com/offline/datas/ADVANsCEne_NDS.zip In the misc directory, nds2rm is looking for the dat file: dsrom.xml. This file is comming from http://www.advanscene.com/offline/datas/ADVANsCEne_NDS.zip
RRFNFS 1.2: Rx3 Rom File Name Format Standard version 1.2 RRFNFS 1.1: Rx3 Rom File Name Format Standard version 1.1
--------------------------------------------------------- ---------------------------------------------------------
nds2rm stores ROMs in a .nds file with a standardized file name format: nds2rm stores ROMs in a .nds file with a standardized file name format:
XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS].nds XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS].nds
with with
XXXX: id XXXX: id
NNNNNNNNN: name NNNNNNNNN: name
R: region R: Region
L1-...-Ln: language list L1-...-Ln: Language list
SS: status (OK,KO) SS: Status (OK,KO)
nds2rm compresses each ROM file in an archive file with a standardized file name format: nds2rm compresses each ROM file in an archive file with a standardized file name format:
XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS] {CCCCCCCC} _FFFF_.ccc XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS] {CCCCCCCC} <FFFF>.ccc
or this form for a duplicate archive:
XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS] {CCCCCCCC} _FFFF_-Y.ccc
with: with:
XXXX: id XXXX: id
NNNNNNNNN: name NNNNNNNNN: name
R: region R: Region
L1-...-Ln: language list L1-...-Ln: Language list
SS: status (OK,KO) SS: Status (OK,KO)
CCCCCCCC: checksum CCCCCCCC: CheckSum
FFFF: fingerprint FFFF: FingerPrint
Y: dup id ccc: Archive suffix (zip, rar, 7z)
ccc: archive suffix (zip, rar, 7z)

View File

@ -1,29 +1,13 @@
# $RCSfile: ReleaseNotes.txt,v $ # $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.7 $ # $Revision: 1.5 $
# $Name: $ # $Name: $
# $Date: 2009/12/07 11:32:07 $ # $Date: 2009/05/09 21:30:53 $
# $Author: agibert $ # $Author: agibert $
--------------------------------------------------------------------------------
nds2rm V 1.2.0-1 - A. Gibert - 2009/11/23
--------------------------------------------------------------------------------
- Update RRFNFS to 1.2: replace angle bracket by _ to enclose fingerprint, in order to be FAT/NTFS friendly !
--------------------------------------------------------------------------------
nds2rm V 1.1.1-1 - A. Gibert - 2009/10/27
--------------------------------------------------------------------------------
- Fix Rx3 archive renaming bug (during renumbering pass)...
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
nds2rm V 1.1.0-1 - A. Gibert - 2009/05/09 nds2rm V 1.1.0-1 - A. Gibert - 2009/05/09
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

40
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.21 $ # $Revision: 1.19 $
# $Name: $ # $Name: $
# $Date: 2009/12/07 11:32:07 $ # $Date: 2009/05/09 21:30:53 $
# $Author: agibert $ # $Author: agibert $
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
@ -251,7 +251,7 @@ function env_setup()
;; ;;
esac esac
rrfnfs_regex=".... - .* \(.*=.*\) \[..\] \{........} _...._[-]*[0-9]*\.${csfx}$" rrfnfs_regex=".... - .* \(.*=.*\) \[..\] \{........} <....>[-]*[0-9]*\.${csfx}$"
} }
@ -527,7 +527,7 @@ function rom_list_dump()
do do
if [[ ${dat_status[${i}]} == "${status}" ]] if [[ ${dat_status[${i}]} == "${status}" ]]
then then
echo "${dat_id[${i}]} - ${dat_title[${i}]} (${dat_region[${i}]}=${dat_lang[${i}]}) {${dat_crc[${i}]}} _${dat_fp[${i}]}_" echo "${dat_id[${i}]} - ${dat_title[${i}]} (${dat_region[${i}]}=${dat_lang[${i}]}) {${dat_crc[${i}]}} <${dat_fp[${i}]}>"
fi fi
i=$(( ${i} + 1 )) i=$(( ${i} + 1 ))
@ -658,7 +658,7 @@ function arc_mkfn()
dup_id=${9} dup_id=${9}
file_prefix="${id} - ${title} (${reg}=${lang}) [${status}] {${crc}} _${fp}_" file_prefix="${id} - ${title} (${reg}=${lang}) [${status}] {${crc}} <${fp}>"
if [[ ${dup_id} == "" ]] if [[ ${dup_id} == "" ]]
then then
@ -941,8 +941,8 @@ function arc_proceed()
crc2=$(check -n <"${rom}" 2>&1 | sed -e 's/,.*//' -e 's/.*= //' | tr [:lower:] [:upper:]) crc2=$(check -n <"${rom}" 2>&1 | sed -e 's/,.*//' -e 's/.*= //' | tr [:lower:] [:upper:])
fp=$(dd skip=12 count=4 bs=1 <"${rom}" 2>/dev/null) fp=$(dd skip=12 count=4 bs=1 <"${rom}" 2>/dev/null)
else else
crc2=${file/*\{/}; crc2=${crc2/\} _*/} crc2=${file/*\{/}; crc2=${crc2/\}*/}
fp=${file/*\} _/}; fp=${fp/_*/} fp=${file/*\} \</}; fp=${fp/\>*/}
fi fi
@ -1000,13 +1000,13 @@ function arc_proceed()
crc=${dat_crc[${idx}]} crc=${dat_crc[${idx}]}
status2="OK" status2="OK"
# Extract ROM file if not yet done # Rename the ROM file
if [[ "${rom}" == "" ]] rom2="${id} - ${title} (${reg}=${lang}) [${status2}].nds"
then
rom="${id} - ${title} (${reg}=${lang}).nds"
rom_extract "${rom}" "${file}" print_verbose "moving ${rom} to ${rom2}"
fi
mv "${rom}" "${rom2}"
rom=${rom2}
if [[ "${arc_type}" == "rx3" ]] if [[ "${arc_type}" == "rx3" ]]
then then
@ -1030,7 +1030,7 @@ function arc_proceed()
# Rename ROM if needed # Rename ROM if needed
if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ]] if [[ ( "${renumed}" != "yes") && ( ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ) ]]
then then
rom2="${id} - ${title} (${reg}=${lang}) [${status}].nds" rom2="${id} - ${title} (${reg}=${lang}) [${status}].nds"
@ -1050,7 +1050,7 @@ function arc_proceed()
# Make / Rename Archive # Make / Rename Archive
if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]] if [[ ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]]
then then
arc_build "${file_name}" "${rom}" "${file}" "${mode}" "${idx}" arc_build "${file_name}" "${rom}" "${file}" "${mode}" "${idx}"
else else
@ -1162,8 +1162,8 @@ function suffix_mng()
ignored_cnt=$((${ignored_cnt} + 1)) ignored_cnt=$((${ignored_cnt} + 1))
else else
status=${file/* \[/}; status=${status/\] \{*/} status=${file/* \[/}; status=${status/\] \{*/}
crc=${file/*\] \{/}; crc=${crc/\} _*/} crc=${file/*\] \{/}; crc=${crc/\} \<*/}
fp=${file/*\} _/}; fp=${fp/_*/} fp=${file/*\} \</}; fp=${fp/\>*/}
dat_dup[${idx}]="${dup_id}" dat_dup[${idx}]="${dup_id}"
@ -1176,7 +1176,7 @@ function suffix_mng()
idx_old=${idx} idx_old=${idx}
status_old=${status} status_old=${status}
dup_id=0 dup_id=0
file_name="${file/) \[*/}) [${status}] {${crc}} _${fp}_.${csfx}" file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>.${csfx}"
dat_fp[${idx}]="${fp}" dat_fp[${idx}]="${fp}"
dat_status[${idx}]="${status}" dat_status[${idx}]="${status}"
@ -1189,7 +1189,7 @@ function suffix_mng()
# Duplicate rom # 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}"
dup_cnt=$((${dup_cnt} + 1)) dup_cnt=$((${dup_cnt} + 1))
@ -1422,7 +1422,7 @@ function fp_scan()
if [[ ${file} =~ ${rrfnfs_regex} ]] if [[ ${file} =~ ${rrfnfs_regex} ]]
then then
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" ) ) ]] if [[ ( "${dat_fp[${idx}]}" == "????" ) || ( ( "${dat_status[${idx}]}" == "KO" ) && ( "${status}" == "OK" ) ) ]]