Hi, On 2018-09-05 22:37:19 +0200, Johannes Kastl wrote:
today we stumbled upon a snag in osc copypac. The task was to copy a package, that is a link with a link diff, to another project within the same (private) buildservice instance. In our case the link was to a package on the openSUSE buildservice.
We found that using "osc copypac -e" works as expected, the resulting package is no longer a link.
Yes, that's the intended behavior.
We also found that using no options (no -e, no -K) copies the link, i.e. the new package is still a link with a link diff, pointing to the original target.
Yes, that's the intended behavior.
But we found that using -K, which is also called --keep-link, does not keep the link. Instead we had the same result as when calling osc copypac with -e.
Yes, that's the intended behavior if the new/target package is _not_ a link (see below).
Unfortunately, the man page is pretty confusing here.
-K, --keep-link keep the source link in target, this also expands the source
But this is also not consistent, we got the same state three times while copying another package, i.e. copying with "-e", "-K" or without options resulted in a package that was no link anymore. We found no consistent explanation for that behaviour.
I'll try to set up a reproducible example on the openSUSE build service tomorrow.
In the meantime, can someone please explain what "-K" aka "--keep-link" is supposed to do?
Let's assume we run "osc copypac -K sprj spkg tprj tpkg". This does the following: Case 1: tprj/tpkg is a link Case 1.1: tprj/tpkg is a branch That is, tpkg contains a _link file. Let's assume the _link points to the foo/bar package. After running the copypac, tprj/tpkg contains the _link file (*) and all files from sprj/spkg's "expanded" revision. The tprj/tpkg package is still a branch that points to the foo/bar package. (*) the _link file might have a different baserev (this is done so that we do not end up with a broken link) Case 1.2: tprj/tpkg is not a branch Again, it keeps/updates the _link file in the tprj/tpkg package. For the details have a look at sub keeplink in BSSrcServer/Link.pm :) Case 2: tprj/tpkg is not a link In this case, "osc copypac -K sprj spkg tprj tpkg" is the same as "osc copypac -e sprj spkg tprj tpkg". Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org