-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathportz_install
executable file
·100 lines (87 loc) · 2.39 KB
/
portz_install
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/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-install
export PNAME
set -e
#set -x
portz_libdir=${portz_libdir-`pwd`}
. ${portz_libdir}/scripts/runtime.sh
. ${portz_scripts}/functions.sh
#. ${portz_scripts}/build_defs.sh
. ${portz_scripts}/package_defs.sh
install_dependencies()
{
if [ -n "$depends" ] ; then
inform "DEPENDS: $depends"
for dep in $depends ; do
if portz_check_installed $dep ; then
inform "dependency '$dep' already installed"
else
inform "dependency '$dep' not met, installing"
(
$0 $dep
)
r=$?
if [ "$r" != 0 ] ; then
overall_result=$r
failed_packages="$failed_packages $dep"
else
successfull_installs="$successfull_installs $dep"
fi
fi
done
fi
}
overall_result=0
for p in $* ; do
if [ "$p" = --no-deps ] ; then
no_deps=1
shift
continue
elif [ "$p" = --quiet-steps ] ; then
quiet_steps=1
shift
continue
fi
(
if ! load_package $p ; then
exit 1
fi
PNAME="$PNAME[$package_name]"
SCRIPT_NAME="$PNAME"
if [ -z "$no_deps" ] ; then
install_dependencies
fi
log_quiet=1
. ${portz_scripts}/build_defs.sh
log_quiet=0
setup_package_build_defs
build_command="$0 $package_path"
export build_command
. ${portz_scripts}/install_staging.sh
portz_step ${staging_dir} deploy
)
r=$?
if [ "$r" != 0 ] ; then
overall_result=$r
failed_packages="$failed_packages $p"
else
successfull_installs="$successfull_installs $p"
fi
done
if [ -n "$successfull_installs" ]; then
log_info "successfully installed: $successfull_installs"
fi
if [ "$overall_result" != 0 ] ; then
log_info "failure, following packages failed to install: $failed_packages"
fi
exit $overall_result
# jedit: :tabSize=8:indentSize=4:noTabs=true:mode=shellscript: