diff options
author | merakor <cem@ckyln.com> | 2020-11-24 22:50:48 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-11-24 22:50:48 +0000 |
commit | 95cd98b1fa8b993ab12c566083051287b33d8a77 (patch) | |
tree | 446c3cf670eed2996545038213f6c889122607cb /src | |
parent | 1ca8227e70d7cf24db45b7e4b35c66041bc14428 (diff) | |
download | cpt-95cd98b1fa8b993ab12c566083051287b33d8a77.tar.gz |
pkg_swap(): use pkg_owner()
FossilOrigin-Name: e37239871c297b73bf3c08d31fa0ec93d9581939e65771e970933adfcfad83a9
Diffstat (limited to 'src')
-rw-r--r-- | src/cpt-lib | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/cpt-lib b/src/cpt-lib index 742bf17..da6faa4 100644 --- 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'" |