-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathportz_query
executable file
·51 lines (43 loc) · 1.3 KB
/
portz_query
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
#
# This file is part of 'portz'
#
# Copyright (C) Zbigniew Zagorski <z.zagorski@gmail.com> and others,
# licensed to the public under the terms of the GNU GPL (>= 2)
# see the file COPYING for details
#
# I.e., do what you like, but keep copyright and there's NO WARRANTY.
#
PNAME=portz-query
set -e
portz_libdir=${portz_libdir-`pwd`}
. ${portz_libdir}/scripts/runtime.sh
. ${portz_scripts}/functions.sh
log_quiet=1
. ${portz_scripts}/build_defs.sh
log_quiet=0
. ${portz_scripts}/package_defs.sh
action=$1
package_name=$2
if [ "$action" = "list" ] ; then
shopt -s nullglob
readonly asked_portz_libdir=${prefix}/lib/portz
if [ ! -d "$asked_portz_libdir" ] ; then
fail "${prefix} doesn't look like portz installation target ($asked_portz_libdir doesn't exist)"
fi
cd "$asked_portz_libdir"
ls -1 *.MANIFEST | sed -e 's@.MANIFEST@@'
elif [ "$action" = "files" ] ; then
package_name=$2
if [ -z ${package_name} ] ; then
fail "need package name"
fi
setup_package_build_defs
if [ ! -f ${manifest_file} ] ; then
fail "package '$package' not installed (failed to read ${manifest_file})"
fi
portz_list_files_from_manifest ${manifest_file}
else
fail "bad usage"
fi
# jedit: :tabSize=8:indentSize=4:noTabs=true:mode=shellscript: