On Mon, Mar 31, 2025 at 12:35:39PM +0100, Daniel P. Berrangé wrote:
> On Mon, Mar 31, 2025 at 01:14:42PM +0200, Michael J Gruber wrote:
> 
> > Let me also mention the case where we have to clean sources (proprietary
> > material) before committing to the look-aside cache. We should document
> > how to do so in spec.
> > 
> > Ideally, one could:
> > - get original sources
> > - check upstream's signature
> > - apply the checked-in clean script (which creates a tarball)
> > - check that the results matches the look-aside hash in "sources".
> 
> This takes us down a slight tangent, but I wonder whether it actually
> makes sense to have every developer write their own "cleaning" script ?
> 
> Is there scope for standardizing on the repack process using 'fedpkg'
> tools perhaps ?
> 
> It feels like it ought to be possible to define a standard repack process
> that works from a text file that simply contains a list of filename globs
> to purge from a source archive. That gives us a declarative description
> of how the downstream tarball will differ from the upstream tarball,
> instead of an imperative description via countless custom shell scripts.

Yes, I think this would be nice. We used the following in calibre
(before switching to the upstream tarball):

---&<---------------------------------------------------------------
#!/bin/sh -e

# Usage: ./getsources.sh [version]
#     (this produces calibre-[version]-nofonts.tar.xz)
if [ -n "$1" ]; then
    version="$1"
else
    version="$(awk '/^Version:/{print $2}' *.spec)"
fi

fname="calibre-${version}-nofonts.tar.xz"
if [ -e "$fname" ]; then
    echo "$fname already exists, not downloading"
    exit 0
fi

echo "Downloading version ${version}"
[ -x /bin/pxz ] && xz=pxz || xz=xz

curl -sSL http://code.calibre-ebook.com/dist/src | \
    xzcat | \
    tar --delete --wildcards -f - '*/fonts/liberation/*' | \
    $xz -9v >"$fname"

echo "$fname is ready"
--->&---------------------------------------------------------------

It oportunistically does parallel xz compression and the download
and recompression happen in parallel too. We could make a variant
of this script available in redhat-rpm-config or one of the other
rpms…

Zbyszek
-- 
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to