RISC OS Build EnvironmentROBE

Reference guide26Archive and Packaging Tools

Introduction and Overview

This chapter groups the tools used to package, extract, and rebuild archives or manual containers while preserving RISC OS-specific metadata where possible. It covers both routine ZIP-style release packaging and the older or more specialised archive formats that still appear in existing source and release workflows.

Technical Details

Archive and packaging tools

The most common archive tools are riscos-zip and riscos-unzip, which preserve RISC OS filetype information when creating or extracting ZIP archives.

Older release and distribution formats are handled by riscos-nspark for Spark and ArcFS archives, riscos-sqsh for single Squash-compressed files, and riscos-tbafs for TBAFS ,b21 archives.

ALF (Acorn Library Format; see Glossary), the traditional RISC OS object-library archive format used by the linker, also has a more translation-oriented helper in riscos-makealf, which can combine ordinary object files and members extracted from existing libraries while applying naming rules.

Manual container tools

riscos-shextract and riscos-strongcopy are related in that they unpack and rebuild StrongHelp manual containers, but they are usually part of a documentation maintenance workflow rather than general archive packaging.

Commands

riscos-zip
Create ZIP archives with preserved RISC OS metadata
riscos-zip -h -0 | -1 | -6 | -9 -v -T default-filetype -C base-directory archive content ...
-h
or -help
-Display the command help.
-0
or -store
-Store files without compression.
-1
or -faster
-Use deflate level 1 compression.
-6
or -deflate
-Use deflate level 6 compression, which is the default.
-9
or -better
-Use deflate level 9 compression.
-v
or -verbose
-Report more progress information while creating the archive.
-T
or -default-filetype
-Default filetype to use for files which do not already carry one.
-C
or -chdir
-Base directory from which content paths are read.
<archive>-Archive file to create.
<content>-Files or directories to add to the archive.

Packages files so that their RISC OS filetypes, timestamps, attributes, and filename forms survive transfer and extraction. The wrapper drives the underlying rozipfile tool in archive-creation mode.

Pass files or directories after the archive name. Directory trees are traversed automatically, so a single application or source tree can be archived in one command.

The RISC OS-specific ZIP extra fields and the alternate NFS filename encoding are summarised in ../appendix/riscos-zip-file-format.

riscos-zip -v clitool.zip aif32/CLITool,ff8
riscos-unzip
Extract or list ZIP archives with preserved RISC OS metadata
riscos-unzip -h -l | -t -v -T default-filetype -C base-directory archive content ...
-h
or -help
-Display the command help.
-l
or -list
-List archive contents instead of extracting them.
-t
or -settypes
-Output SetType commands for restoring filetypes after an incorrect extraction.
-v
or -verbose
-Report more progress information.
-T
or -default-filetype
-Default filetype to use when an archive member has no explicit type information.
-C
or -chdir
-Base directory used for extracted output.
<archive>-Archive file to inspect or extract.
<content>-Optional archive members to extract selectively.

Lists or extracts ZIP archives while restoring RISC OS-aware filename and filetype information. The wrapper chooses the underlying mode from the first option supplied: -l lists, -t prints recovery SetType commands, and any other form extracts.

Any names after the archive limit extraction to selected members. Plain riscos-unzip archive.zip extracts the whole archive.

For the ZIP extension details understood by the wrapper, see ../appendix/riscos-zip-file-format.

riscos-unzip -l clitool.zip
riscos-nspark
List, test, or extract Spark and ArcFS archives
riscos-nspark -u | -x | -t | -l -q -f -s -v -V -R -L logfile -T -C -I -p password -c archive file ...
-u -Extract files from the archive.
-x -Extract files from the archive.
-t -Test archive integrity.
-l -List archive contents.
-q -Suppress normal progress output.
-f -Overwrite existing output files.
-s -Do not restore file timestamps when extracting.
-v -Report more detail while processing.
-V -Display the program version.
-R -Retry when the archive appears corrupt.
-L -Set the logfile name used for filetype information.
-T -Append a RISC OS filetype to extracted filenames.
-C -Force extracted filenames to lowercase.
-I -Extract with accompanying .inf files.
-p -Supply the password for an encrypted archive.
-c -Write extracted file data to standard output.
<archive>-Spark or ArcFS archive to inspect or extract.
<file>-Optional archive members to limit the operation to.

Works with Spark and ArcFS archives. In this environment it is most often used to extract files with -x or -u, list contents with -l, or test integrity with -t.

Any names after the archive limit the action to selected members.

If you omit -u, -x, -l, and -t, the underlying tool reports archiving not supported in this version and exits without writing anything. This build of riscos-nspark supports only extraction, listing, and testing of existing Spark and ArcFS archives; it cannot create or update one.

riscos-nspark -xT archive.arc
riscos-sqsh
Decompress a single Squash-compressed file
riscos-sqsh -c -f -s file
-c -Write the decompressed data to standard output.
-f -Overwrite the output file if it already exists.
-s -Do not restore the decompressed file timestamp.
<file>-Squash-compressed input file.

Decompresses a single Squash-compressed file rather than a multi-file archive. This is commonly used on older compressed resources, ROM images, or source files distributed as one compressed object.

The Squash wrapper format and its embedded compress-style LZW payload are summarised in Appendix L: Squash file format.

riscos-sqsh -c ROMImage,fca
riscos-tbafs
List, inspect, or extract TBAFS archives
riscos-tbafs command -v -o output-directory --adfsadfs-image archive
<command>-One of list (or its one-letter abbreviation l), extract (x), types (t), or info (i).
-v -Verbose listing output; used with the list command.
-o -Output directory for extracted files; used with the extract command.
--adfs -Write extracted content to an ADFS E-format floppy image instead of host files; used with the extract command.
<archive>-TBAFS archive, normally with host suffix ,b21.

Wraps the Python TBAFS extractor included in the environment. list reports contents, extract restores files to the host filesystem or to an ADFS image, types prints SetType recovery commands, and info reports header-level archive information.

The types and info forms take just the command name and archive path. The documented command-specific options belong to the list and extract forms.

The TBAFS archive structure and compression records are summarised in ../appendix/tbafs-file-format.

riscos-tbafs list -v archive,b21
riscos-makealf
Create or unpack ALF object libraries with explicit member-name translation
riscos-makealf -q -s -l -b -n -u -i listfile -x fromto -X translationfile -v +libfile+ object-or-library-member ... -o output
-q
or -quiet
-Suppress progress messages.
-s
or -swap
-Translate Unix-style object names such as foo.o to RISC OS-style o.foo.
-l
or -unixlib
-Apply UnixLib-style filename translation. If this is present, -s is ignored.
-b
or -brief
-Remove the leading library| part from extracted member names.
-n
or -null-timestamp
-Write all timestamps as zero bytes.
-u
or -unique
-Refuse to create two outputs with the same final name.
-i
or -input
-Read additional object names from a list file.
-x
or -translation
-Add one translation rule from a source prefix to a destination prefix.
-X
or -translation-file
-Read multiple translation rules from a file.
-v
or -version
-Display the version; when given with no other arguments the tool also shows usage information.
+libfile+ -Interpret the remaining command line using the partial libfile-compatibility mode.
<object-or-library-member>-Input object file, wildcard, or a library member written as library|member.
-o -Output library file or output directory. If omitted, the default output library name is alf.

riscos-makealf creates new ALF object libraries, unpacks members from existing libraries, and renames members as it does so. It is most useful when you need more control over member naming than riscos-libfile provides, or when you want to combine ordinary object files and members extracted from existing libraries in a single operation.

Inputs are not limited to plain files. A member inside an existing library is written as library|member. Member wildcards are richer than normal filesystem wildcards: # matches one non-directory character, * matches a run of non-directory characters, and ** matches any sequence of characters. A common pattern such as mylib|** means every member in the library.

-i listfile reads more object names from a file, one per line, with blank lines and lines beginning with # ignored as comments. This is the practical way to handle long object lists. The output is normally a new ALF library, but if -o names a directory then the selected objects are written out as ordinary files in that directory instead. The warning text printed on failure mentions "with directory creation", but the tool does not actually create the intermediate subdirectories implied by a member's own path (such as o32.main); pre-create that subdirectory structure under the -o directory yourself, or the copy fails with couldn't open output object file.

Name control is one of the tool's main features. -b strips the leading library| part from extracted member names. -x from to defines one translation rule, and -X file reads multiple translation rules from a file. If several rules match, the one with the longer from string wins. -u makes the command fail rather than writing two outputs with the same final name.

-s translates Unix-style names such as foo.o to RISC OS-style o.foo. -l applies UnixLib-style filename translation instead, and takes precedence over -s. -n writes all timestamps as zero bytes, which is useful for reproducible output or convergence testing. -q suppresses progress output.

If the first command-line argument is +libfile+, or if the tool is invoked under a name ending in libfile, it attempts to interpret the rest of the command line using a partial libfile-compatible syntax. This compatibility mode is useful when a build expects libfile-style arguments, but it does not implement every original libfile operation.

riscos-makealf o.mylib|** o.hislib|** o.version -b -o ^.foo.biglib
riscos-shextract
List or extract files from a StrongHelp manual
riscos-shextract -h --extract-dirdirectory --list manual-file
-h
or -help
-Display the command help.
--extract-dir -Directory into which the manual contents will be extracted.
--list -List the files in the manual without extracting them.
<manual-file>-StrongHelp manual file, normally with host suffix ,3d6.

Reads a StrongHelp manual container and either lists the files it contains or extracts them into a host-side source tree. Extracted files keep RISC OS filetype suffixes where relevant.

If --extract-dir is omitted, the current directory is used for extraction.

For the underlying manual format, see ../appendix/stronghelp-file-format.

riscos-shextract --extract-dir Manual-src Manual,3d6
riscos-strongcopy
Create a StrongHelp manual from a source directory
riscos-strongcopy -h -v -o manual-file inputdir
-h -Display the command help.
-v -Report progress while the source tree is being processed.
-o -Output StrongHelp manual file. If it has no comma suffix, ,3d6 is appended automatically.
<inputdir>-Directory tree containing StrongHelp pages and resources.

Packages a directory tree into a StrongHelp manual file. If no input directory is supplied, the current directory is used. If -o is omitted, the output file defaults to Manual.

The command is intended for rebuilding an extracted or hand-maintained StrongHelp source tree rather than editing a manual directly.

For non-RISC OS use, note these implementation caveats: generated files receive a datestamp of 1/1/1900, and the implementation assumes little-endian layout plus the expected structure packing.

riscos-strongcopy -o Manual,3d6 Sources

Examples

Packaging a command for transfer to RISC OS

This preserves the output filetype when the archive is extracted later.

riscos-zip -v clitool.zip aif32/CLITool,ff8

Working with older archive formats

These commands inspect or extract legacy archive formats that still appear in older software distributions.

riscos-nspark -lv archive.arc
riscos-sqsh file,fca
riscos-tbafs extract -o restored archive,b21

Extracting and rebuilding StrongHelp manuals

These commands unpack a manual into an editable tree and then rebuild it.

riscos-shextract --list Manual,3d6
riscos-shextract --extract-dir Manual-src Manual,3d6
riscos-strongcopy -o Manual,3d6 Manual-src