rust_uprev: refactor create_ebuild() to take strings instead of a path

create_ebuild() used to take a path to an ebuild file to copy and a
pkgatom which it would split and use to compute the new ebuild path
from. This change refactors create_ebuild() to take the ebuild's
category and name as separate strings (to avoid having to split
strings), and computes both the path to the source ebuild and the
path to the ebuild to be created (to avoid the inconsistency of
computing one but requiring the other to be passed in). This
refactor will be built upon by an upcoming refactor of
create_rust_uprev(), for which it is convenient not to have to
compute the source ebuild path before calling create_ebuild().

BUG=b:322348600
TEST=presubmit

Change-Id: I000e45423e7e33b110d60bd04a59c9f2863597b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5255378
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Bob Haarman <inglorion@chromium.org>
Commit-Queue: Bob Haarman <inglorion@chromium.org>
2 files changed