pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: archivers/zoo: distfile unavailable, but poor replacement is



On Sat 19 Dec 2020 at 20:25:03 +0100, Rhialto wrote:
> I have set up https://gitlab.com/Rhialto/zoo with 2.10 and pl1.
> I could add the patches one by one, and check if FreeBSD has any extra
> patches, and use that as upstream...

https://gitlab.com/Rhialto/zoo/-/archive/zoo-2.10pl1/zoo-zoo-2.10pl1.tar.bz2
could be used as a new upstream, if desired.

I have now added the history of all pkgsrc patches to this repo.  I used
the git mirror of pkgsrc for this, because it has already nicely
detected the chronological order of the commits in the patches
directory. Then I basically used the script below to generate the
history.

I was looking for tools that would help me with detecting the changes of
a history of diff files (such as our pkgsrc diffs). I was pointed at
"interdiff" from devel/patchutils: "Interdiff generates an incremental
patch from two patches against a common source." Unfortunately, the
incremental diffs I got from interdiff didn't all apply cleanly (and the
process stopped when one failed completely). So I used a different, less
subtle approach.

https://gitlab.com/Rhialto/zoo/-/archive/zoo-2.10pl1+pkgsrc015/zoo-zoo-2.10pl1+pkgsrc015.tar.bz2
could be used as a "fresh" upstream that needs no patches.

#!/bin/sh

set -e -x

WORK=$PWD

ZOO_HIST=$WORK/zoo		# zoo repo that gets updated
ZOO_BASE=$WORK/zoo.base		# unchanging git clone of 2.10pl1
PKGSRC=$WORK/pkgsrc		# git clone of pkgsrc
PKGSRC_ZOO=$PKGSRC/archivers/zoo
BRANCH=HEAD

cd $PKGSRC_ZOO/patches

git checkout $BRANCH
git log --oneline . >$WORK/commit-ids.backward


cd $PKGSRC

cat $WORK/commit-ids.backward |
while read commitid rest
do
    authordate=$(git show --no-patch --format=format:%aI $commitid)
    author=$(git show --no-patch --format="format:%aN <%aE>" $commitid)
    message=$(git show --no-patch --format="format:%s" $commitid)

    git checkout $commitid

    file=version.${authordate}  # .${commitid}

    cp -r $PKGSRC_ZOO $WORK/${file}.dir

    echo $author    > $WORK/${file}.author
    echo $message   > $WORK/${file}.msg
done

cd $WORK

# Note that this goes forward through history due to the sorting of the dates.

prev=""

for d in version.*.dir
do
    cat $WORK/${d}/patches/patch-* > $WORK/${d}/patches-all

    date=$(echo $d | cut -d. -f 2)
    cd $ZOO_HIST

    rm -f *
    cp $ZOO_BASE/* .

    patch < $WORK/${d}/patches-all 2>&1 | tee $WORK/patch.out
    rm -f *.orig
    #echo "hit enter..."; read dummy

    git add .
    git commit \
	--author="$(cat $WORK/${d%.dir}.author)" \
	--date="$date" \
	--message="$(cat $WORK/${d%.dir}.msg)" \
	--message="$(cat $WORK/patch.out)" || true

    prev=$d

    #echo "hit enter..."; read dummy
done

-Olaf.
-- 
Olaf 'Rhialto' Seibert -- rhialto at falu dot nl
___  Anyone who is capable of getting themselves made President should on
\X/  no account be allowed to do the job.       --Douglas Adams, "THGTTG"

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index