Source layout of rust-coreutils
===============================

The source package is built from three pieces, on purpose kept identical to
what the Ubuntu package does so that both distributions stay easy to merge:

 1. the *pristine* upstream tarball, i.e. the GitHub tag of uutils/coreutils,
 2. the l10n component tarball (uutils/coreutils-l10n), unpacked into l10n/,
 3. the vendored crates, in debian/rust-vendor/, shipped in the .debian.tar.

Nothing is repacked; debian/repack.sh is gone.


Importing a new upstream release
--------------------------------

    uscan --verbose --destdir ..

downloads both tarballs (rust-coreutils_<version>.orig.tar.gz and
rust-coreutils_<version>.orig-l10n.tar.gz). Unpack the first one over the
tree, the second one into l10n/, then refresh debian/patches and update
debian/changelog.


Refreshing the vendored crates
------------------------------

    cargo install cargo-vendor-filterer     # once; not packaged in Debian
    debian/rules vendor

That target regenerates debian/rust-vendor/ (filtered down to the tier-1/2
*-*-linux-gnu* targets, which is why no Windows/macOS/BSD-only crate is
vendored), blanks the per-crate checksum files so the crates can be patched,
regenerates debian/source/include-binaries and the XS-Vendored-Sources-Rust
field of debian/control, and commits the result.

Crates cannot be patched through debian/patches (dpkg-source would then also
carry the vendored copies in the diff), so vendor patches live in their own
quilt series, debian/patches/rust-vendor/, applied at build time by
dh_quilt_patch via QUILT_PATCH_DIR/QUILT_PC (see debian/rules).


tldr examples
-------------

improve-man.diff adds an EXAMPLES section to every manpage, taken from the
tldr-pages project. Upstream downloads that archive at documentation build
time, which a Debian build cannot do, so a copy trimmed down to the English
pages (pages/common and pages/linux) is shipped as debian/tldr.zip and copied
into docs/ by override_dh_auto_configure. Refresh it with:

    curl -L https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip \
        -o /tmp/tldr.zip
    rm -rf /tmp/tldr && mkdir /tmp/tldr && cd /tmp/tldr && \
        unzip -q /tmp/tldr.zip 'pages/common/*' 'pages/linux/*' 'LICENSE*' && \
        zip -qr9 debian/tldr.zip .
