aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-12-21 11:13:51 +0000
committermerakor <cem@ckyln.com>2020-12-21 11:13:51 +0000
commit440af4f3ebfecd68dabf8ce5524fd3f953e81c71 (patch)
treed7ceaf1d040bad60822c87ad78ca30de76df1342 /contrib
parent36308f68ddd95984c1909c5ca00a6ab70544d15b (diff)
downloadcpt-440af4f3ebfecd68dabf8ce5524fd3f953e81c71.tar.gz
cpt: remove cpt-stat and cpt-readlink, add _stat() and _readlinkf
cpt-readlink and cpt-stat were unnecessary additions for mundane tasks. Since they were binaries instead of scripts, they added an extra layer of complexity to the library. These functions are now included inside the package manager library with the names _readlinkf() and _stat(). FossilOrigin-Name: 7e15e2b57ddcb834c4286c8d1ac0a28031ae4f5d39f3c6a99f5b3aa0e9a83d43
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cpt-owns3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/cpt-owns b/contrib/cpt-owns
index 5f73674..9e3cccb 100755
--- a/contrib/cpt-owns
+++ b/contrib/cpt-owns
@@ -1,5 +1,6 @@
#!/bin/sh -e
# Check which package owns a file
+. cpt-lib
case "$1" in ''|--help|-h) printf '%s\n' "usage: ${0##*/} [file]" ; exit 0 ; esac
@@ -17,7 +18,7 @@ esac
# Strip 'CPT_ROOT' from the file path if passed and
# follow symlinks.
file="${1#$CPT_ROOT}"
-dirname=$(cpt-readlink "$CPT_ROOT/${file%/*}")
+dirname=$(_readlinkf "$CPT_ROOT/${file%/*}")
file="$dirname/${file##*/}"
# Check if the file exists and exit if it is not.