commit 12a670ccbcb21faf373c807c4970e2d9fc1f03c9 parent 28e9f874f80b1b6f4ef7ec921df43867ac24f5a4 Author: Cem Keylan <cem@ckyln.com> Date: Wed, 25 Nov 2020 01:50:49 +0300 pkg_swap(): use pkg_owner() Diffstat:
M | src/cpt-lib | | | 7 | +------ |
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/cpt-lib b/src/cpt-lib @@ -1270,13 +1270,8 @@ pkg_swap() { # # Print the full path to the manifest file which contains # the match to our search. - pkg_owns=$(set +f; "$grep" -lFx "$2" "$sys_db/"*/manifest) ||: - # Extract the package name from the path above. - pkg_owns=${pkg_owns%/*} - pkg_owns=${pkg_owns##*/} - - [ "$pkg_owns" ] || + pkg_owns=$(pkg_owner -lFx "$2") || die "File '$2' exists on filesystem but isn't owned" log "Swapping '$2' from '$pkg_owns' to '$1'"