blob: 1da2e2fceab59c7255d6653dc90014e43c36dffd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/sh
list () {
find ${PACKAGES_DIR} -type f | sed "s,${PACKAGES_DIR}/,,"
}
list_installed () {
ls -1 ${INSTALLED_DIR}
}
search () {
list | grep $(echo $@ | sed "s/ /\\|/g")
}
files () {
for package in $@; do
local file="${INSTALLED_DIR}/$package/files"
[ -f $file ] && cat $file || >&2 printf "${RED}Package ${LIGHT_RED}$package${RED} is not installed\n"
done
}
file_info () {
for file in $@; do
[ ! -f ${SYSROOT}$file ] && file=$(realpath $file)
for list in ${INSTALLED_DIR}/*/files; do
package=$(dirname $list | xargs basename)
grep -q $file $list &&
printf "${LIGHT_BLUE}%s${BLUE} belongs to ${LIGHT_BLUE}%s${RESET}\n" $file $package
done
done
}
|