On 2021/11/08 16:54, Theo Buehler wrote:
> One pain point with the cargo module is 'make update-patches'.  The
> problem is that crates.io normalizes the Cargo.toml files to maximize
> compatibility with all versions of Cargo and to use crates.io paths for
> dependencies.  All DISTFILES in ${DISTFILES}/cargo contain both a
> Cargo.toml and Cargo.toml.orig, which cripples 'make update-patches'
> unless PATCHORIG is set. For this reason, about a third of the Rust
> ports set the PATCHORIG variable (all of them unconditionally).
> 
> I suggest that we add a PATCHORIG ?= line to cargo.port.mk. This way,
> the user setting in /etc/mk.conf is respected and not overridden by the
> port Makefiles. The majority set PATCHORIG = .openbsd.orig, so I chose
> that as a default. The diff below also removes all PATCHORIG lines from
> the cargo ports.

OK sthen@, unless we can do similar in bsd.port.mk instead.

FWIW I'm unconditionally setting PATCHORIG=.orig.port in mk.conf
because I find it easier if all ports use the same suffix - I have
a helper function to edit files and generate the backup automatically:

function vibak {
        local i _files _orig=.orig.port
        for i; do i=${i%.rej}; [ -f "$i$_orig" ] || doas -u _pbuild cp "$i" 
"$i$_orig"; _files="${_files} $i"; done
        doas -u _pbuild $EDITOR ${_files}
}

Reply via email to