hsh-separate-sources(1)

HSH-SEPARATE-SOURCES(1) HSH-SEPARATE-SOURCES(1)

NAME

hsh-separate-sources - detect unused files in SRPM packages

SYNOPSIS

hsh-separate-sources [options] list | dir | *.src.rpm ...

hsh-separate-sources main options -H HOST [builder options] [-H HOST [builder options] ...] list | dir | *.src.rpm ...

DESCRIPTION

hsh-separate-sources is a tool to separate up the contents of an SRPM package into two following categories:

  • included (used) files that are read during the build;
  • skipped (unused) files.

The result can be used later with srpm-cleanp(1). hsh-separate-sources can also be used to verify the cleaned-up SRPMs.

Main options

  • -s[PATH], --skipped[=PATH]: Output or write down the list of skipped files. When investigating a number of SRPM files (or a number of architectures for each SRPM, see -a|--arch) the resulting list is written to a separate file in a directory PATH for each SRPM (and architecture). The directory is created if doesn´t exist and the output files are named after SRPM packages. If only a single SRPM is specified the result is written to file PATH if the PATH is not ended with / and is not an existing directory. Otherwise the result is written into a file in that directory as in the former case. If PATH is not specified the output goes to standard output --- this is the default mode if -s is not specified.
  • -i[PATH], --included[=PATH]: The same for the list of included files, but there is no output by default.
  • -E, --abort-on-error: Abort execution on first error. In parallel mode (see -n|--nums, -H|--host) it waits for the running builds to complete.
  • -f, --force: Oerwrite existing results (force rebuild packages).
  • -y, --verify: Rebuild and check that files already listted in the skiplist are really truncated. In this mode it reads the skiplist and -i is ignored.
  • -t PCENT, --toolerance=PCENT: When verifying the package, ignore PCENT non-truncated files relative to the number of files in the skiplist.
  • -x XLIST, --exceptions=XLIST: When verifying the skiplist ignore files matching the patterns listed in XLIST. See also -x option in srpm-cleanp(1).
  • --nodetect: Disable skipped files detection. This option is useful for mass rebuilds and for debugging purposes, -s and -i are ignored if verification mode is off.
  • -O OUTDIR, --outdir=OUTDIR: Copy the rebuilt RPMs to OUTDIR.
  • -l LDIR, --logdir=LOGDIR: Save Hasher logs into LOGDIR.
  • --disttag=TAG: Set %disttag TAG when building packages.
  • --disttag-index=INDEX: Set %disttag from INDEX when building packages.
  • -q, --quiet: Do not print any info while running.
  • -v, --verbose: Print more info while running.
  • --dry-run[-run]: Show Hasher or GNU Parallel´s dry run preview. With --dry-run in single slot/host mode outputs the Hasher command line instead of executing it. In parallel mode (see -n|--nums and -H|--host) the GNU Parallel´s preview is output on --dry-run and parallel execution is started with Hasher command line previews on --dry-run-run.
  • --check-args: Exit after checking the arguments.
  • -V, --version: Print program version and exit.
  • -h, --help: Output brief help and exit.
  • --with-srpms[=FROM]: Transfer SRPMs (from directory FROM) to remote builders. Turned on automatically in verification mode (-y|--verify).
  • --selfie: Copy this script to remote builders.
  • --remote-dir=DIR: GNU Parallel´s working home on the remote builders. See --workdir option of parallel(1).
  • --cleanup: Cleanup SRPMs, self and resulting lists on remote builders after transferring them back to the master. Use with caution! This option is known to make a race!
  • --joblog=JOBLOG: Keep job log JOBLOG in order to --retry and --resume.
  • --resume: Resume from the last unfinished job (requires --joblog, implies -f).
  • --resume-failed: Retry all failed and resume from the last unfinished job (requires --joblog, implies -f).
  • --retry-failed: Retry all failed jobs (requires --joblog).
  • --retries=N: Try each failing job N times.
  • --controlmaster: Use ssh´s ControlMaster option.
  • --sshdelay=SECS: Delay starting next remote job by SECS seconds (which can be a fraction of 1 s).
  • --parallel-opts=OPTS: Pass the specified options to GNU Parallel.

Builder configuration options

  • -C CONF, --apt-config=CONF: Pass --apt-config=CONF to hsh(1). In order to use this option with more than one architecture (see -a|--arches) the path should contain %s which is substituted with the name of the architecture.
  • -R ADDR, --repo=ADDR: Alternatively, configure Hasher to use the repository at ADDR. The sources configuration for APT is generated on the fly. This option can be used multiple times for the same host. Addresses without a protocol prefix are translated into file addresses (i.e. file://).
  • -B DIR, --base=DIR: Prepend paths of SRPMs with DIR. The option can be used multiple times for the same host. Attention! In order to verify the cleaned-up SRPMs (see -y|--verify) pass the proper path to them (i.e. the path to -O|--outdir directory used with srpm-cleanup(1)).
  • -n NUMS, --nums=NUMS: Allowed Hasher slot (subconfig) numbers (as in hsh --number). NUMS can be a single number, a number sequence (space or comma-separated), a N-M number range or a sequence of ranges. If this option is specified then the working directory path has to be also explicitly specified using -d|--dir. If path doesn´t contain %d the actual slot number is appended to the path after /. The resulting directory path is created on-demand.
If more than one slot is allowed using this option, the slots are run in parallel with the help of parallel(1) --- the GNU Parallel. This option can be used multiple times for the same host.
The special value :N is used internally in parallel execution to select a slot number by its ordinal number.
  • -a ARCHES, --arches=ARCHES: Switch architecture before package rebuild. Builds package for multiple architectures if more than one architecture is specified (comma and space serarated). It also passes --target=... to hsh(1). This option can be used multiple times for the same host.
  • -d DIR, --dir=DIR: Sets the working directory path to be used with hsh(1) command. If DIR contains %d template and -n|--nums opition is given the template is substituted with the actual slot number. The directory is created on-demand.
  • -m LIST, --mountpoints=LIST: Run Hasher with --mountpoints LIST instead of the default --- /proc,/dev/pts. However, if LIST is empty, the Hasher is run with no --mountpoints option.
  • -j N|<N:M>|<:M>|PROFILE, --nproc=N|<N:M>|<:M>|PROFILE: Limit the number of CPUs to be used by each Hasher slot by N or in accordance with a PROFILE file. If specified, M limits CPUs for the %check section only.
Each line of a PROFILE can be a single number, an N:M number combination or a package name followed by = and a number or N:M, or a name-version string followed by = and a number or N:M. The single number or N:M without package name is used as a default value. The numbers assigned to a package name without a version are used when building any version of that package.
  • --no-size: Don´t try to measure and output the size of Hasher workdir after a successful build.
  • --with-pre=PRESCRIPT: Run PRESCRIPT nvr.arch workdir slot before the Hasher run.
  • --with-post=POSTSCRIPT: Run POSTSCRIPT nvr.arch workdir slot after the Hasher run.
  • --without-check: Rebuild with RPM %check stage disabled.
  • --build-args=BARGS: Additional arguments to rpmbuild(1).
  • --no-query-repackage: Don´t pass --query-repackage to hsh(1);
  • --debug: Do not delete temporary directory and print its path on exit.
  • --id=NAME: Builder name to print in the log.
  • -e SSH, --ssh=SSH: Use SSH remote shell to reach remote builders (default is ssh).
  • -u USER, --user=USER: Name of a remote user to login with.
  • -H REMOTES, --host=REMOTES: Add given remote builder(s) and make any of the above builder configuration options specified after it specific to that remote(s). REMOTES is a comma or space-seprated sequence of ssh-like specifications: [username@]host. Alternatively, a single user name for all given remotes can be specified using -u|--user option. Use -e|--ssh to override the default remote shell command (ssh). And use : to refer to the local machine.

SEE ALSO

srpm-cleanp(1), hasher(1), hsh(1).

COPYRIGHT

Copyright (C) 2020 BaseALT /basealt.ru/. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AUTHOR

  • Anton V. Boyarshinov boyarsh@altlinux.org
  • Michael Shigorin mike@altlinux.org
  • Paul Wolneykien manowar@altlinux.org

REPORTING BUGS

Report bugs to https://bugzilla.altlinux.org/.

May 2021