OSDN Git Service

Changed portsreintsall-chroot to carry out portsnap and pkg update in full course...
authorMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 16:41:43 +0000 (00:41 +0800)
committerMamoru Sakaue / MwGhennndo <glmwghennndo@users.sourceforge.jp>
Wed, 12 Sep 2018 16:41:43 +0000 (00:41 +0800)
 Changes to be committed:
modified:   lib/chroot/libcommand.sh
modified:   lib/chroot/libcommand_do.sh
modified:   lib/libmain.sh
modified:   lib/libpkgsys.sh

lib/chroot/libcommand.sh
lib/chroot/libcommand_do.sh
lib/libmain.sh
lib/libpkgsys.sh

index a077a55..9f7aa33 100644 (file)
@@ -163,9 +163,10 @@ command_all_exec_main ()
 {
        case $COMMAND_MODE in
        do | auto )
-               command_do_pre
+               command_do_chroot_cleanup
                command_do_starter_portsnap
                command_do_starter_pkg
+               command_do_pre
                command_do_starter_clean
                command_do_main_init_resinst
                command_do_chroot_enter_if_incomplete "$@"
index e5ec829..e38ef21 100644 (file)
@@ -206,25 +206,13 @@ command_do_starter_portsnap ()
                local mode stdout
                [ $opt_fullcourse = no ] && return
                message_section_title "Full course starter: Update the ports tree"
-               if [ -e "$opt_basedir/builder$PORTSNAP_WORKDIR/INDEX" ]
-               then
-                       mode=update
-               else
-                       mode=extract
-               fi
-               if [ $opt_batch_mode = no ]
-               then
-                       stdout=/dev/stdout
-               else
-                       stdout=/dev/null
-               fi
-               chroot "$opt_basedir"/builder /usr/bin/env portsnap fetch $mode > $stdout
+               pkgsys_update_portstree
                message_echo
        }
        program_exec_and_record_completion STARTER_GUEST_PORTS_TREE
 }
 
-# ============= Starter process in the chroot environment: Update the package repository =============
+# ============= Starter process of the full course: Update the package repository =============
 command_do_starter_pkg ()
 {
        local PROGRAM_DEPENDS
@@ -234,19 +222,13 @@ command_do_starter_pkg ()
                local opts
                [ $opt_fullcourse = no ] && return
                message_section_title "Full course starter: Update the package repository"
-               if [ $opt_batch_mode = no ]
-               then
-                       opts=
-               else
-                       opts='-q'
-               fi
-               chroot "$opt_basedir"/builder /usr/bin/env pkg update $opts
+               pkg_update_pkgrepository
                message_echo
        }
        program_exec_and_record_completion STARTER_GUEST_PKG_REPO
 }
 
-# ============= Starter process in the chroot environment: Clean the temporary database =============
+# ============= Starter process of the full course: Clean the temporary database =============
 command_do_starter_clean ()
 {
        local PROGRAM_DEPENDS
@@ -372,9 +354,6 @@ command_do_chroot_update_host_pkgs ()
 # ============= Main pre-operation of do/auto =============
 command_do_pre ()
 {
-       # Initial clean up
-       command_do_chroot_cleanup
-       
        # Build and mount of the chroot environment
        fs_build_chroot
        fs_mount
index ab43b0c..d8175e1 100644 (file)
@@ -12,7 +12,7 @@ main_set_version ()
        MYVERSION=4.1.0
        COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
        # Template for development versions
-       MYVERSION=4.0.0+toward_4.1.0_20180913001823
+       MYVERSION=4.0.0+toward_4.1.0_20180913004127
        COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
 }
 
index e24db5b..f985fb7 100644 (file)
@@ -19,6 +19,24 @@ pkgsys_get_timestamp_portstree ()
        stat -t %s -f %m "${PORTS_INDEX_DB}" 2> /dev/null || :
 }
 
+# ============= Update the ports tree =============
+pkgsys_update_portstree ()
+{
+               if [ -e "$PORTSNAP_WORKDIR/INDEX" ]
+               then
+                       mode=update
+               else
+                       mode=extract
+               fi
+               if [ $opt_batch_mode = no ]
+               then
+                       stdout=/dev/stdout
+               else
+                       stdout=/dev/null
+               fi
+               portsnap fetch $mode > $stdout
+}
+
 # ============= Check implementation of the ports tree =============
 pkgsys_chk_ports_tree_implementation ()
 {
@@ -758,6 +776,18 @@ pkgsys_def_pkgtools ()
                                pkg_is_tool_available
                        }
                }
+               pkg_update_pkgrepository ()
+               {
+                       local opts
+                       pkg_is_tool_available || return 0
+                       if [ $opt_batch_mode = no ]
+                       then
+                               opts=
+                       else
+                               opts='-q'
+                       fi
+                       pkg update $opts
+               }
                if ! pkg_rescue_tools
                then
                        message_echo "WARNING: Pkgng is still missing, but continuing for the time being." >&2
@@ -1018,6 +1048,7 @@ pkgsys_def_pkgtools ()
                }
                pkg_loadconf () { :; }
                pkg_rescue_tools () { :; }
+               pkg_update_pkgrepository () { :; }
        fi
 }