• R/O
  • HTTP
  • SSH
  • HTTPS

current: Commit

This is for active development.
New funtionalities are to be added actively.


Commit MetaInfo

Revision9fa6c066751a3ea7af68a83651ce582a1056a8a1 (tree)
Time2018-09-13 01:41:43
AuthorMamoru Sakaue / MwGhennndo <glmwghennndo@user...>
CommiterMamoru Sakaue / MwGhennndo

Log Message

Changed portsreintsall-chroot to carry out portsnap and pkg update in full course to do at the host environment.

Changes to be committed:

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

Change Summary

Incremental Difference

--- a/lib/chroot/libcommand.sh
+++ b/lib/chroot/libcommand.sh
@@ -163,9 +163,10 @@ command_all_exec_main ()
163163 {
164164 case $COMMAND_MODE in
165165 do | auto )
166- command_do_pre
166+ command_do_chroot_cleanup
167167 command_do_starter_portsnap
168168 command_do_starter_pkg
169+ command_do_pre
169170 command_do_starter_clean
170171 command_do_main_init_resinst
171172 command_do_chroot_enter_if_incomplete "$@"
--- a/lib/chroot/libcommand_do.sh
+++ b/lib/chroot/libcommand_do.sh
@@ -206,25 +206,13 @@ command_do_starter_portsnap ()
206206 local mode stdout
207207 [ $opt_fullcourse = no ] && return
208208 message_section_title "Full course starter: Update the ports tree"
209- if [ -e "$opt_basedir/builder$PORTSNAP_WORKDIR/INDEX" ]
210- then
211- mode=update
212- else
213- mode=extract
214- fi
215- if [ $opt_batch_mode = no ]
216- then
217- stdout=/dev/stdout
218- else
219- stdout=/dev/null
220- fi
221- chroot "$opt_basedir"/builder /usr/bin/env portsnap fetch $mode > $stdout
209+ pkgsys_update_portstree
222210 message_echo
223211 }
224212 program_exec_and_record_completion STARTER_GUEST_PORTS_TREE
225213 }
226214
227-# ============= Starter process in the chroot environment: Update the package repository =============
215+# ============= Starter process of the full course: Update the package repository =============
228216 command_do_starter_pkg ()
229217 {
230218 local PROGRAM_DEPENDS
@@ -234,19 +222,13 @@ command_do_starter_pkg ()
234222 local opts
235223 [ $opt_fullcourse = no ] && return
236224 message_section_title "Full course starter: Update the package repository"
237- if [ $opt_batch_mode = no ]
238- then
239- opts=
240- else
241- opts='-q'
242- fi
243- chroot "$opt_basedir"/builder /usr/bin/env pkg update $opts
225+ pkg_update_pkgrepository
244226 message_echo
245227 }
246228 program_exec_and_record_completion STARTER_GUEST_PKG_REPO
247229 }
248230
249-# ============= Starter process in the chroot environment: Clean the temporary database =============
231+# ============= Starter process of the full course: Clean the temporary database =============
250232 command_do_starter_clean ()
251233 {
252234 local PROGRAM_DEPENDS
@@ -372,9 +354,6 @@ command_do_chroot_update_host_pkgs ()
372354 # ============= Main pre-operation of do/auto =============
373355 command_do_pre ()
374356 {
375- # Initial clean up
376- command_do_chroot_cleanup
377-
378357 # Build and mount of the chroot environment
379358 fs_build_chroot
380359 fs_mount
--- a/lib/libmain.sh
+++ b/lib/libmain.sh
@@ -12,7 +12,7 @@ main_set_version ()
1212 MYVERSION=4.1.0
1313 COMPATIBLE_VERSIONS='^(4\.[1]\.[0-9])$'
1414 # Template for development versions
15- MYVERSION=4.0.0+toward_4.1.0_20180913001823
15+ MYVERSION=4.0.0+toward_4.1.0_20180913004127
1616 COMPATIBLE_VERSIONS='^(4\.[0-1]\.[0-9]]|4\.[0]\.[0]+(|\+toward_4\.[0-1]\.[0-9]+_[0-9]+))$'
1717 }
1818
--- a/lib/libpkgsys.sh
+++ b/lib/libpkgsys.sh
@@ -19,6 +19,24 @@ pkgsys_get_timestamp_portstree ()
1919 stat -t %s -f %m "${PORTS_INDEX_DB}" 2> /dev/null || :
2020 }
2121
22+# ============= Update the ports tree =============
23+pkgsys_update_portstree ()
24+{
25+ if [ -e "$PORTSNAP_WORKDIR/INDEX" ]
26+ then
27+ mode=update
28+ else
29+ mode=extract
30+ fi
31+ if [ $opt_batch_mode = no ]
32+ then
33+ stdout=/dev/stdout
34+ else
35+ stdout=/dev/null
36+ fi
37+ portsnap fetch $mode > $stdout
38+}
39+
2240 # ============= Check implementation of the ports tree =============
2341 pkgsys_chk_ports_tree_implementation ()
2442 {
@@ -758,6 +776,18 @@ pkgsys_def_pkgtools ()
758776 pkg_is_tool_available
759777 }
760778 }
779+ pkg_update_pkgrepository ()
780+ {
781+ local opts
782+ pkg_is_tool_available || return 0
783+ if [ $opt_batch_mode = no ]
784+ then
785+ opts=
786+ else
787+ opts='-q'
788+ fi
789+ pkg update $opts
790+ }
761791 if ! pkg_rescue_tools
762792 then
763793 message_echo "WARNING: Pkgng is still missing, but continuing for the time being." >&2
@@ -1018,6 +1048,7 @@ pkgsys_def_pkgtools ()
10181048 }
10191049 pkg_loadconf () { :; }
10201050 pkg_rescue_tools () { :; }
1051+ pkg_update_pkgrepository () { :; }
10211052 fi
10221053 }
10231054
Show on old repository browser