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 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...
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

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.
could be used as a "fresh" upstream that needs no patches.


set -e -x


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

cd $PKGSRC_ZOO/patches

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


cat $WORK/commit-ids.backward |
while read commitid rest
    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

cd $WORK

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


for d in version.*.dir
    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


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

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