OSDN Git Service

Added option -g to portsreinstall-chroot.
[portsreinstall/current.git] / lib / chroot / liboptions.sh
1 #!/bin/sh -e
2 # ==============================================================================
3 # portsreinstall library script
4 # Overlay onto lib/liboptions.sh for portsreinstall-chroot
5 # - Command line options -
6 # Copyright (C) 2018 Mamoru Sakaue, MwGhennndo, All Rights Reserved.
7 # This software is distributed under the 2-Clause BSD License.
8 # ==============================================================================
9
10 # ============= Database of options which are given at each run and not saved =============
11 # [Syntax of option databases]
12 # short_name, long_name, variable, defult_vaule, set_value
13 # Columns are delimited by tab characters.
14 options_db_onetime ()
15 {
16         cat << eof
17 h       help    opt_help_mode   0       1
18 h       short-help      opt_help_mode   0       1
19 H       long-help       opt_help_mode   0       2
20 V       show-version    opt_show_version        no      yes
21 a       batch-mode      opt_batch_mode  no      yes
22 E       extra-dirs-delim        opt_extra_dirs_delim    ,       :
23 J       just-save-options       opt_just_save_options   no      yes
24 M       reset-minor-options     opt_reset_minor_options no      yes
25 S       no-opening-message      opt_no_opening_message  no      yes
26 eof
27 }
28
29 # ============= Database of options which are saved and not renewable until the temporary database is cleaned =============
30 options_db_saved_and_non_renewable ()
31 {
32         cat << eof
33 b       basedir opt_basedir     /home/.${APPNAME}       :
34 c       suppress-clean-obsolete-database        opt_suppress_obsolete_db_clean  no      yes
35 d       invalidate-mount-privilege      opt_invalidate_mount_privilege  no      yes
36 e       extra-dirs      opt_extra_dirs  ''      :
37 f       fullcourse      opt_fullcourse  no      yes
38 g       upgraded-system opt_upgraded_system     no      yes
39 p       load-pkgtoolsconf-as-default    opt_load_pkgtoolsconf   undef   default
40 P       load-pkgtoolsconf-as-override   opt_load_pkgtoolsconf   undef   override
41 Q       ignore-pkgtoolsconf     opt_load_pkgtoolsconf   undef   no
42 s       share-port-pkgs-dirs    opt_share_port_pkgs_dirs        no      yes
43 eof
44 }
45
46 # ============= Regularize the option value =============
47 options_regularize ()
48 {
49         opt_basedir=`fs_global_path "$opt_basedir"`
50 }