summaryrefslogtreecommitdiff
path: root/src/backend/f_modeswitch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/f_modeswitch.sh')
-rw-r--r--src/backend/f_modeswitch.sh33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/backend/f_modeswitch.sh b/src/backend/f_modeswitch.sh
index b257daa..432aa7c 100644
--- a/src/backend/f_modeswitch.sh
+++ b/src/backend/f_modeswitch.sh
@@ -58,8 +58,8 @@ setjobs () {
einfo "I am setting portage to use $(getconf _NPROCESSORS_ONLN) jobs to compile packages"
# default MAKEOPTS value is -j64, but that's overkill for lower spec machines
# this will adjust MAKEOPTS to a value detected by $(getconf _NPROCESSORS_ONLN)
- sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/make.conf/00-makeopts.conf # global makeopts (exclude kernel)
- sed -i "s/\-j64/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/env/makenoise.conf # kernel makeopts
+ sed -i "s/\-j\([0-9]\+\)/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/make.conf/00-makeopts.conf # global makeopts (exclude kernel)
+ sed -i "s/\-j\([0-9]\+\)/\-j$(getconf _NPROCESSORS_ONLN)/g" "$jailportcfgtarget"/env/makenoise.conf # kernel makeopts
}
setprofile () {
@@ -68,22 +68,37 @@ setprofile () {
. /etc/profile
}
-reset () {
- checkifroot
+dopurge () {
delmainporttree
deladdonporttree
delportcfgtree
}
-setup () {
- checkifroot
- delmainporttree
- deladdonporttree
- delportcfgtree
+doinject () {
getmainporttree
getaddonporttree
getportcfgtree
+}
+
+dosetup () {
setportage
setjobs
setprofile
}
+
+adapt () {
+ checkifroot
+ setjobs
+}
+
+reset () {
+ checkifroot
+ dopurge
+}
+
+setup () {
+ checkifroot
+ dopurge
+ doinject
+ dosetup
+}