OSDN Git Service

[NEW] Option -x is added.
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Tue, 3 Jul 2018 16:03:34 +0000 (00:03 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Tue, 3 Jul 2018 16:03:34 +0000 (00:03 +0800)
 Changes to be committed:
modified:   lib/libmain.sh
modified:   lib/libpkgsys.sh
modified:   lib/main/liboptions.sh
modified:   lib/main/libusage.sh
modified:   man/portsreinstall-chroot.8
modified:   man/portsreinstall.8

lib/libmain.sh
lib/libpkgsys.sh
lib/main/liboptions.sh
lib/main/libusage.sh
man/portsreinstall-chroot.8
man/portsreinstall.8

index c4659eb..ca4a1ba 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.0.0
        COMPATIBLE_VERSIONS='^(4\.[0]\.[0])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.0.1_20180703161959
+       MYVERSION=4.0.0+toward_4.0.1_20180703235816
        COMPATIBLE_VERSIONS='^(4\.[0]\.[0]|4\.[0]\.[0]+(|\+toward_4\.[0]\.[1]+_[0-9]+))$'
 }
 
index 1414cc8..10fd38a 100644 (file)
@@ -442,10 +442,13 @@ pkgsys_def_pkgtools ()
                }
                pkg_delete_f ()
                {
-                       pkg delete -fqy "$@"
+                       local opt_del
+                       opt_del=
+                       [ $no_exec_inst_script = yes ] && opt_del='-D'
+                       pkg delete -fqy $opt_del "$@"
                        pkg -N 2> /dev/null || return 0 # If pkg(8) is deinstalled successfully
                        pkg info -e "$@" || return 0    # Countermeasure for a bug found for pkg-1.3.4 (at least not until 1.2.7_4)
-                       pkg delete -fy "$@"
+                       pkg delete -fy $opt_del "$@"
                }
                pkg_add_tools ()
                {
@@ -466,7 +469,7 @@ pkgsys_def_pkgtools ()
                }
                pkg_add_f ()
                {
-                       local pkgarc pkg pkg_tool pkg_gen
+                       local pkgarc pkg pkg_tool pkg_gen opt_add
                        pkg_tool=
                        pkg_gen=
                        for pkgarc in "$@"
@@ -484,7 +487,9 @@ pkgsys_def_pkgtools ()
                        then
                                rm -rf "${TMPDIR}/pkg_add_f"
                                mkdir -p "${TMPDIR}/pkg_add_f"
-                               ( cd "${TMPDIR}/pkg_add_f" && ln -s $pkg_gen && env ASSUME_ALWAYS_YES=YES pkg add * )
+                               opt_add=
+                               [ $no_exec_inst_script = yes ] && opt_add='-I'
+                               ( cd "${TMPDIR}/pkg_add_f" && ln -s $pkg_gen && env ASSUME_ALWAYS_YES=YES pkg add $opt_add * )
                        fi
                }
                pkg_add_fF ()
@@ -513,13 +518,15 @@ pkgsys_def_pkgtools ()
                }
                pkg_inst_remote ()
                {
-                       local pkg pkgarc
+                       local pkg pkgarc opt_add
                        pkg=$1
                        pkg_inst_remote_verify_fetch "$pkg" || return
                        pkgarc=`pkgsys_pkgname_to_pkgarc "${PKGNG_PKG_CACHEDIR}" "$pkg"` || return
                        rm -rf "${TMPDIR}/pkg_inst_remote"
                        mkdir -p "${TMPDIR}/pkg_inst_remote"
-                       ( cd "${TMPDIR}/pkg_inst_remote" && ln -s "$pkgarc" && env ASSUME_ALWAYS_YES=YES pkg add * )
+                       opt_add=
+                       [ $no_exec_inst_script = yes ] && opt_add='-I'
+                       ( cd "${TMPDIR}/pkg_inst_remote" && ln -s "$pkgarc" && env ASSUME_ALWAYS_YES=YES pkg add $opt_add * )
                }
                pkg_inst_wild_verify_pkg ()
                {
@@ -549,14 +556,16 @@ pkgsys_def_pkgtools ()
                }
                pkg_inst_remote_wild ()
                {
-                       local pkg pkgarc
+                       local pkg pkgarc opt_add
                        pkg=$1
                        if pkg_inst_remote_wild_verify_fetch "$pkg"
                        then
                                pkgarc=`pkgsys_fetch_legacy_remote__fetched_pkg`
                                rm -rf "${TMPDIR}/pkg_inst_remote_wild"
                                mkdir -p "${TMPDIR}/pkg_inst_remote_wild"
-                               ( cd "${TMPDIR}/pkg_inst_remote_wild" && ln -s "$pkgarc" && pkg_add -ifF * ) || return
+                               opt_add=
+                               [ $no_exec_inst_script = yes ] && opt_add='-I'
+                               ( cd "${TMPDIR}/pkg_inst_remote_wild" && ln -s "$pkgarc" && pkg_add -ifF $opt_add * ) || return
                                message_echo "INFO: Trying to convert the installed legacy package to pkgng."
                                pkg2ng || :
                                message_echo "INFO: Checking whether the conversion is successful."
@@ -565,7 +574,7 @@ pkgsys_def_pkgtools ()
                }
                pkg_inst_remote_repository_version ()
                {
-                       local origin origin_unflavored pkg pkgarc tmp_pkgcell
+                       local origin origin_unflavored pkg pkgarc tmp_pkgcell opt_add
                        origin=$1
                        origin_unflavored=`expr "$origin" : '\([^@]*\)'` || return
                        [ -n "$origin_unflavored" ] || return
@@ -576,7 +585,9 @@ pkgsys_def_pkgtools ()
                        tmp_pkgcell=${TMPDIR}/pkg_inst_remote_any_version:pkgcell
                        rm -rf "$tmp_pkgcell"
                        mkdir -p "$tmp_pkgcell"
-                       ( cd "$tmp_pkgcell" && ln -s "$pkgarc" && env ASSUME_ALWAYS_YES=YES pkg add * )
+                       opt_add=
+                       [ $no_exec_inst_script = yes ] && opt_add='-I'
+                       ( cd "$tmp_pkgcell" && ln -s "$pkgarc" && env ASSUME_ALWAYS_YES=YES pkg add $opt_add * )
                }
                pkg_get_pkgs_timestamps ()
                {
@@ -767,21 +778,30 @@ pkgsys_def_pkgtools ()
                }
                pkg_delete_f ()
                {
-                       pkg_delete -f "$@"
+                       local opt_del
+                       opt_del=
+                       [ $no_exec_inst_script = yes ] && opt_del='-D'
+                       pkg_delete -f $opt_del "$@"
                }
                pkg_add_f ()
                {
+                       local opt_add
                        rm -rf "${TMPDIR}/pkg_add_f"
                        mkdir -p "${TMPDIR}/pkg_add_f"
                        ln -s "$@" "${TMPDIR}/pkg_add_f"
-                       ( cd "${TMPDIR}/pkg_add_f" && pkg_add -if * )
+                       opt_add=
+                       [ $no_exec_inst_script = yes ] && opt_add='-I'
+                       ( cd "${TMPDIR}/pkg_add_f" && pkg_add -if $opt_add * )
                }
                pkg_add_fF ()
                {
+                       local opt_add
                        rm -rf "${TMPDIR}/pkg_add_f"
                        mkdir -p "${TMPDIR}/pkg_add_f"
                        ln -s "$@" "${TMPDIR}/pkg_add_f"
-                       ( cd "${TMPDIR}/pkg_add_f" && pkg_add -ifF * )
+                       opt_add=
+                       [ $no_exec_inst_script = yes ] && opt_add='-I'
+                       ( cd "${TMPDIR}/pkg_add_f" && pkg_add -ifF $opt_add * )
                }
                pkg_inst_verify_pkg ()
                {
@@ -805,7 +825,7 @@ pkgsys_def_pkgtools ()
                }
                pkg_inst_remote ()
                {
-                       local pkg pkgarc
+                       local pkg pkgarc opt_add
                        pkg=$1
                        if pkg_inst_remote_verify_fetch "$pkg"
                        then
@@ -813,7 +833,9 @@ pkgsys_def_pkgtools ()
                                rm -rf "${TMPDIR}/pkg_inst_remote"
                                mkdir -p "${TMPDIR}/pkg_inst_remote"
                                ln -s "$@" "${TMPDIR}/pkg_add_f"
-                               ( cd "${TMPDIR}/pkg_inst_remote" && ls -s "$pkgarc" && pkg_add -ifF * )
+                               opt_add=
+                               [ $no_exec_inst_script = yes ] && opt_add='-I'
+                               ( cd "${TMPDIR}/pkg_inst_remote" && ls -s "$pkgarc" && pkg_add -ifF $opt_add * )
                        fi
                }
                pkg_inst_wild_verify_pkg ()
index b25c75c..14afa8c 100644 (file)
@@ -50,6 +50,7 @@ G     use-prebuilt-package    opt_inst_by_pkg_if_can  no      yes
 l      use-legacy-package-for-missing-pkgng    opt_use_legacy_pkg_for_missing_pkgng    no      yes
 f      disallow-force-continuation-for-looped-dependency       opt_disallow_force_continuation_for_looped_dependency   no      yes
 F      fetch-only      opt_fetch_only  no      yes
+x      no-exec-inst-script     no_exec_inst_script     no      yes
 eof
 }
 
index 4713aea..dcf2e69 100644 (file)
@@ -44,6 +44,7 @@ USAGE: portsreinstall [OPTIONS] [--] [command]
  -q : Only new ports and their run-time requirements are reinstalled.
  -s : Build of vulnerable ports are avoided by triggering errors.
  -X : Deselect all deinstallation candidates.
+ -x : No execution of pre/post-(de)installation scripts
  -Y : Select all deinstallation candidates.
  <Group 5: Saved and transferred to restarted runs, renewable by -N option>
  -O glob1[:glob2[:...]] : Reinstall only target ports themselves.
index 0bdc2f6..095ccdb 100644 (file)
@@ -262,9 +262,10 @@ root@[host]#
 root@[chroot]#
 .RE
 4. In the chroot (builder) environment, upgrade the all pakages completely by \fBportsreinstall\fR (the command line options are just an example; muitiple redoing and reconfiguration of port options and other configuration files of ports management may be required).
+It is highly recommended to put \fB\-x\fR option.
 .RS
 root@[chroot]#
-.B portsreinstall -qC
+.B portsreinstall -qxC
 .RE
 5. Exit from the chroot (builder) environment.
 .RS
index d9b94f6..202da6c 100644 (file)
@@ -541,6 +541,13 @@ If you desire to uninstall them, do it manually.
 Automatically deselect all candidates for deinstallation of leaf or obsolete ports.
 This option conflicts with \fB\-Y\fR option.
 .PD
+.IP \fB\-x\fR
+.PD 0
+.TP
+\fB\-\-no\-exec\-inst\-script\fR
+Execution of scripts in pre-installation, post-installation and deinstallation defined for each package is skipped.
+This option is suitable for package build in \fBportsreinstall\-chroot\fR(8) or other change-rooted/jailed environment.
+.PD
 .IP \fB\-Y\fR
 .PD 0
 .TP
@@ -1068,6 +1075,8 @@ Configuration file of \fBportupgrade\fR(1).
 .TP
 4.0.1 (?? July 2018)
 .RS
+[NEW] Option \fB\-x\fR is added.
+.PP
 [IMPROVED] It is changed to show messages of reset ports at the stage of reloading ${LOCALBASE}/etc/portsreinstall.conf.
 .PP
 [BUG FIX] Changes made by commands or in ${LOCALBASE}/etc/portsreinstall.conf were not reflected to dependents of the specified ports in the redo runs with incorrect messages notifying as already inspected merged ports.