aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-lib
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-11-24 22:50:48 +0000
committermerakor <cem@ckyln.com>2020-11-24 22:50:48 +0000
commit95cd98b1fa8b993ab12c566083051287b33d8a77 (patch)
tree446c3cf670eed2996545038213f6c889122607cb /src/cpt-lib
parent1ca8227e70d7cf24db45b7e4b35c66041bc14428 (diff)
downloadcpt-95cd98b1fa8b993ab12c566083051287b33d8a77.tar.gz
pkg_swap(): use pkg_owner()
FossilOrigin-Name: e37239871c297b73bf3c08d31fa0ec93d9581939e65771e970933adfcfad83a9
Diffstat (limited to 'src/cpt-lib')
-rw-r--r--src/cpt-lib7
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'"