Skip to content

How to build and maintain packs

Frédéric Mahé edited this page Nov 5, 2018 · 2 revisions

(warning: command lines below use the Unix/Linux notation, not Windows')

auditing to check what is missing or extra in a ROM pack, the simplest way is to call parse_pack.py onto the pack to produce a text file, and then to compare that text file with the corresponding SMDB file. Comparing two text files is a very basic operation that can be performed by many tools, starting with the diff command on Unix/Linux and the diff-like graphical tools on Windows.

Builders willing to maintain up-to-date one or several packs will have to deal with five atomic modifications to the file organization:

  • add a file,
  • replace a file,
  • rename a file,
  • move a file,
  • remove a file

Packs are a mix of stable and fast evolving sub-sections (fan translations are updated more often than official ROMs for instance). Luckily, some modifications can be applied without having to rebuild the complete pack from scratch, hence saving computation time. Let's go through what can be done.

adding a file is easy. The less error-prone way is to place the file in a folder and to call the build_pack.py script using that folder as source and the pack folder as destination. The script will check that the file has the correct hash value, and add it to the pack with the proper name. Sub-folders are created in the pack if necessary. Of course, a bunch of new files can be added at once.

# build the pack (-o . means create the pack here)
build_pack.py -i all_files/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o . -m N8_missing.txt

# later, add two new files
build_pack.py -i new_files/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o .

# new_files/
# ├── new_file1
# └── new_file2

The new files will be added without altering the rest of the pack. Note that the -m (or --missing) option is not informative when adding new files (it reports that most files are missing).

replace a file (same name, different file). Place the file to rename in a folder, call the build_pack.py script using that folder as source and the pack folder as destination. The script will overwrite the older file in the pack. Of course, a bunch of files can be replaced at once:

# replace files
build_pack.py -i new_files/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o .

move a file. Remove the file from the pack, and place it in a folder. Call the build_pack.py script using that folder as source and the pack folder as destination. To move a bunch of files located in a sub-folder of the pack, cut the sub-folder and use it as a source:

# move files
build_pack.py -i subfolder/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o .

The script will copy the files to their new destination in the pack, creating intermediate folders if necessary. Cutting a complete sub-folder from the pack is OK, even if not all the files it contains were to be moved. The script will recreate the sub-folder in the pack and place back the files that were not supposed to move.

rename a file (same file, different name). Remove the file to rename from the pack, and place it in a folder. Call the build_pack.py script using that folder as source and the pack folder as destination. To rename a bunch of files located in a sub-folder of the pack, cut the sub-folder and use it as a source:

# remove some files in a sub-folder
build_pack.py -i subfolder/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o .

The script will recreate the subfolder in the pack and place again the files with their correct names.

remove a file. For a single file, just remove it from your pack. To remove a bunch of files from a sub-folder of the pack, cut the sub-folder and use it as a source:

# remove some files in a sub-folder
build_pack.py -i subfolder/ -d EverDrive\ N8\ \&\ PowerPak\ SMDB.txt -o .

The files that were not supposed to be removed will be placed back into the pack.

Clone this wiki locally