This is for active development.
New funtionalities are to be added actively.
修订版 | ce8aba506ffdb815119d60256a7c2fb53f4eb091 (tree) |
---|---|
时间 | 2018-09-18 21:30:23 |
作者 | Mamoru Sakaue / MwGhennndo <glmwghennndo@user...> |
Commiter | Mamoru Sakaue / MwGhennndo |
[NEW] Options -f is added to portsreinstall-chroot-mount(8).
modified: HISTORY
modified: Makefile
new file: lib/chroot-mount/libfs.sh
modified: lib/chroot-mount/liboptions.sh
modified: lib/chroot-mount/libusage.sh
modified: lib/chroot/libfs.sh
modified: lib/libmain.sh
modified: man/portsreinstall-chroot-mount.8
modified: share/bin/portsreinstall-chroot-mount
@@ -2,6 +2,7 @@ | ||
2 | 2 | [NEW] Options -j and -x are added. |
3 | 3 | [NEW] Option -J is added to the all utilities. |
4 | 4 | [NEW] Options -f, -g and -s are added to portsreinstall-chroot(8). |
5 | +[NEW] Options -f is added to portsreinstall-chroot-mount(8). | |
5 | 6 | [NEW] auto and destroy commands are added to portsreinstall-chroot(8). |
6 | 7 | [NEW] pkg, make, show build_conflict_pkgs, show inst_conflict_pkgs, show errormessage, show inst_by_pkg, show inst_built_default, show inst_built_custom, show fossil, show moved, show leaves and show obsolete commands are added. |
7 | 8 | [NEW] Command show status newly supports inst_by_pkg, inst_built_default, inst_built_custom and fossil. |
@@ -61,6 +61,7 @@ LIBS_CHROOT_MOUNT=\ | ||
61 | 61 | lib/chroot-mount/libcommand.sh \ |
62 | 62 | lib/chroot-mount/libconf.sh \ |
63 | 63 | lib/chroot-mount/libdatabase_maintain.sh \ |
64 | + lib/chroot-mount/libfs.sh \ | |
64 | 65 | lib/chroot-mount/libmain.sh \ |
65 | 66 | lib/chroot-mount/libmessage.sh \ |
66 | 67 | lib/chroot-mount/liboptions.sh \ |
@@ -0,0 +1,25 @@ | ||
1 | +#!/bin/sh -e | |
2 | +# ============================================================================== | |
3 | +# portsreinstall-chroot library script | |
4 | +# Overlay onto lib/libfs.sh for portsreinstall-chroot-mount | |
5 | +# - File system operations - | |
6 | +# Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved. | |
7 | +# This software is distributed under the 2-Clause BSD License. | |
8 | +# ============================================================================== | |
9 | + | |
10 | +# ============= Terminate when the file systems for the builder chroot environment cannot be mounted: For mounting at the grand host ============= | |
11 | +fs_terminate_if_mount_unavailable__mount_at_host () | |
12 | +{ | |
13 | + if [ $opt_forcible_operation = no ] | |
14 | + then | |
15 | + temp_terminate_process () | |
16 | + { | |
17 | + message_echo "ERROR: Cannot mount because the current file systems are being mounted from inside the virtual (chroot or jail) environment." >&2 | |
18 | + message_echo "INFO: Instead of this command, mount from inside the virtual (chroot or jail) environment." | |
19 | + message_echo "INFO: If the previous run of portsreinstall-chroot(8) was terminated accidentally, retry with -f option." | |
20 | + } | |
21 | + [ $TEMP_IN_TRAP = no ] || temp_terminate_process | |
22 | + exit 1 | |
23 | + fi | |
24 | + message_echo "WARNING: Forcibly operating file systems which should be mounted from inside the virtual (chroot or jail) environment." >&2 | |
25 | +} |
@@ -18,6 +18,7 @@ h help opt_help_mode 0 1 | ||
18 | 18 | h short-help opt_help_mode 0 1 |
19 | 19 | V show-version opt_show_version no yes |
20 | 20 | a batch-mode opt_batch_mode no yes |
21 | +f forcible-operation opt_forcible_operation no yes | |
21 | 22 | J just-save-options opt_just_save_options no yes |
22 | 23 | S no-opening-message opt_no_opening_message no yes |
23 | 24 | eof |
@@ -20,6 +20,7 @@ USAGE: ${APPNAME} [OPTIONS] [--] [command] | ||
20 | 20 | -V : Show the current version. |
21 | 21 | <Group 2: Effective anytime> |
22 | 22 | -a : Suppress messages to be batch-friendly. |
23 | + -f: Forcible operation to ignore the lock. | |
23 | 24 | -J : Exit by doing nothing but just saving the options and command mode |
24 | 25 | -S : Suppress the credit, opening and terminating messages. |
25 | 26 |
@@ -287,6 +287,9 @@ fs_chk_mount () | ||
287 | 287 | ! cat "$tmp_remains" 2> /dev/null |
288 | 288 | } |
289 | 289 | |
290 | +# ============= Terminate when the file systems for the builder chroot environment cannot be mounted: For mounting at the grand host ============= | |
291 | +fs_terminate_if_mount_unavailable__mount_at_host () { :; } | |
292 | + | |
290 | 293 | # ============= Terminate when the file systems for the builder chroot environment cannot be mounted ============= |
291 | 294 | fs_terminate_if_mount_unavailable () |
292 | 295 | { |
@@ -300,13 +303,7 @@ fs_terminate_if_mount_unavailable () | ||
300 | 303 | fs_chk_mount_privilege && return |
301 | 304 | elif [ -n "$systembase" ] |
302 | 305 | then |
303 | - temp_terminate_process () | |
304 | - { | |
305 | - message_echo "ERROR: Cannot mount because the current file systems are being mounted from inside the virtual (chroot or jail) environment." >&2 | |
306 | - message_echo "INFO: Instead of this command, mount from inside the virtual (chroot or jail) environment." | |
307 | - } | |
308 | - [ $TEMP_IN_TRAP = no ] || temp_terminate_process | |
309 | - exit 1 | |
306 | + fs_terminate_if_mount_unavailable__mount_at_host | |
310 | 307 | fi |
311 | 308 | elif fs_chk_mount_privilege |
312 | 309 | then |
@@ -12,7 +12,7 @@ main_set_version () | ||
12 | 12 | MYVERSION=4.1.0 |
13 | 13 | COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$' |
14 | 14 | # Template for development versions |
15 | - MYVERSION=4.0.0+toward_4.1.0_20180918012038 | |
15 | + MYVERSION=4.0.0+toward_4.1.0_20180918212945 | |
16 | 16 | COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$' |
17 | 17 | } |
18 | 18 |
@@ -68,6 +68,13 @@ Show the current version. | ||
68 | 68 | Suppress messages so as to be friendly for batch operations. |
69 | 69 | Comments are suppressed as much as possible. |
70 | 70 | .PD |
71 | +.IP \fB\-f\fR | |
72 | +.PD 0 | |
73 | +.TP | |
74 | +\fB\-\-forcible\-operation\fR | |
75 | +Forcibly carry out operations be ignoring the lock in case that file systems are set to be mounted/unmounted from inside the | |
76 | +virtual (chroot or jail) environment. | |
77 | +.PD | |
71 | 78 | .IP \fB\-S\fR |
72 | 79 | .PD 0 |
73 | 80 | .TP |
@@ -49,6 +49,7 @@ ETCDIR=${MYPREFIX}/etc | ||
49 | 49 | . ${LIBDIR}/chroot-mount/libcommand.sh |
50 | 50 | . ${LIBDIR}/chroot-mount/libconf.sh |
51 | 51 | . ${LIBDIR}/chroot-mount/libdatabase_maintain.sh |
52 | +. ${LIBDIR}/chroot-mount/libfs.sh | |
52 | 53 | . ${LIBDIR}/chroot-mount/libmain.sh |
53 | 54 | . ${LIBDIR}/chroot-mount/libmessage.sh |
54 | 55 | . ${LIBDIR}/chroot-mount/liboptions.sh |