summaryrefslogtreecommitdiffstats
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/build.sh92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/cmd/build.sh b/src/cmd/build.sh
index 273f76d..24aff29 100644
--- a/src/cmd/build.sh
+++ b/src/cmd/build.sh
@@ -22,6 +22,52 @@ cmd_build_root=
cmd_build_pkg_dir=
cmd_build_build_deps=
+cmd_build_make_deps_pkg()
+{
+ local pkg_dir=
+
+ pkg_dir="${cmd_build_root}$(session_dir)/builddeps"
+ mkdir -p "${pkg_dir}/control" "${pkg_dir}/data"
+ printf '2.0\n' >"${pkg_dir}/debian-binary"
+ cat >"${pkg_dir}/control/control" <<-EOF
+ Package: prokit-builddeps-$(session_id)
+ Source: prokit
+ Version: 1.0
+ Architecture: all
+ Platform: all
+ Depends: ${cmd_build_build_deps}
+ Description: Build dependencies metapackage generated by prokit
+ EOF
+ (cd "${pkg_dir}/data"; tar -czf ../data.tar.gz .)
+ (cd "${pkg_dir}/control"; tar -czf ../control.tar.gz .)
+ (cd "${pkg_dir}"; tar -czf ../builddeps.opk \
+ 'debian-binary' 'data.tar.gz' 'control.tar.gz')
+ rm -Rf "${pkg_dir}"
+}
+
+cmd_build_fini()
+{
+ local session_dir=
+ local f=
+
+ session_dir="$(session_dir)"
+
+ if [ "x${cmd_build_build_deps}" != 'x' ]; then
+ session_exec opkg --autoremove remove \
+ prokit-builddeps-$(session_id)
+ rm -f "${cmd_build_root}${session_dir}/builddeps.opk"
+ # Hack to avoid this code branch if the function is called again
+ # in response to a signal.
+ cmd_build_build_deps=''
+ fi
+
+ for f in "${cmd_build_root}${session_dir}/"*; do
+ [ -e "${f}" ] || continue
+ [ "x${f##*/}" = 'xwd' ] && continue
+ mv "${f}" "${cmd_build_pkg_dir}/.."
+ done
+}
+
cmd_build_main()
{
local root=
@@ -112,52 +158,6 @@ cmd_build_main()
return 0
}
-cmd_build_make_deps_pkg()
-{
- local pkg_dir=
-
- pkg_dir="${cmd_build_root}$(session_dir)/builddeps"
- mkdir -p "${pkg_dir}/control" "${pkg_dir}/data"
- printf '2.0\n' >"${pkg_dir}/debian-binary"
- cat >"${pkg_dir}/control/control" <<-EOF
- Package: prokit-builddeps-$(session_id)
- Source: prokit
- Version: 1.0
- Architecture: all
- Platform: all
- Depends: ${cmd_build_build_deps}
- Description: Build dependencies metapackage generated by prokit
- EOF
- (cd "${pkg_dir}/data"; tar -czf ../data.tar.gz .)
- (cd "${pkg_dir}/control"; tar -czf ../control.tar.gz .)
- (cd "${pkg_dir}"; tar -czf ../builddeps.opk \
- 'debian-binary' 'data.tar.gz' 'control.tar.gz')
- rm -Rf "${pkg_dir}"
-}
-
-cmd_build_fini()
-{
- local session_dir=
- local f=
-
- session_dir="$(session_dir)"
-
- if [ "x${cmd_build_build_deps}" != 'x' ]; then
- session_exec opkg --autoremove remove \
- prokit-builddeps-$(session_id)
- rm -f "${cmd_build_root}${session_dir}/builddeps.opk"
- # Hack to avoid this code branch if the function is called again
- # in response to a signal.
- cmd_build_build_deps=''
- fi
-
- for f in "${cmd_build_root}${session_dir}/"*; do
- [ -e "${f}" ] || continue
- [ "x${f##*/}" = 'xwd' ] && continue
- mv "${f}" "${cmd_build_pkg_dir}/.."
- done
-}
-
cmd_build_register()
{
register_cmd 'build'