Minor fixes (#316)
* Fixed typo and specify list order * Simplify code for jobs default value
This commit is contained in:
parent
5eb9b92e7b
commit
b41e75e662
|
@ -16,6 +16,7 @@ GNU General Public License for more details.
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -47,6 +48,7 @@ defaults = {
|
||||||
"config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg",
|
"config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg",
|
||||||
"device": "samsung-i9100",
|
"device": "samsung-i9100",
|
||||||
"extra_packages": "none",
|
"extra_packages": "none",
|
||||||
|
"jobs": str(multiprocessing.cpu_count() + 1),
|
||||||
"timestamp_based_rebuild": True,
|
"timestamp_based_rebuild": True,
|
||||||
"log": "$WORK/log.txt",
|
"log": "$WORK/log.txt",
|
||||||
"mirror_alpine": "https://nl.alpinelinux.org/alpine/",
|
"mirror_alpine": "https://nl.alpinelinux.org/alpine/",
|
||||||
|
|
|
@ -18,7 +18,6 @@ along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import multiprocessing
|
|
||||||
|
|
||||||
import pmb.config
|
import pmb.config
|
||||||
import pmb.helpers.cli
|
import pmb.helpers.cli
|
||||||
|
@ -76,13 +75,10 @@ def init(args):
|
||||||
cfg["pmbootstrap"]["work"] = ask_for_work_path(args)
|
cfg["pmbootstrap"]["work"] = ask_for_work_path(args)
|
||||||
|
|
||||||
# Parallel job count
|
# Parallel job count
|
||||||
default = args.jobs
|
|
||||||
if not default:
|
|
||||||
default = multiprocessing.cpu_count() + 1
|
|
||||||
logging.info("How many jobs should run parallel on this machine, when"
|
logging.info("How many jobs should run parallel on this machine, when"
|
||||||
" compiling?")
|
" compiling?")
|
||||||
cfg["pmbootstrap"]["jobs"] = pmb.helpers.cli.ask(args, "Jobs",
|
cfg["pmbootstrap"]["jobs"] = pmb.helpers.cli.ask(args, "Jobs",
|
||||||
None, default, validation_regex="[1-9][0-9]*")
|
None, args.jobs, validation_regex="[1-9][0-9]*")
|
||||||
|
|
||||||
# Timestamp based rebuilds
|
# Timestamp based rebuilds
|
||||||
logging.info("Rebuild packages, when the last modified timestamp changed,"
|
logging.info("Rebuild packages, when the last modified timestamp changed,"
|
||||||
|
|
|
@ -23,7 +23,7 @@ import glob
|
||||||
def list(args):
|
def list(args):
|
||||||
"""
|
"""
|
||||||
Get all UIs, for which aports are available
|
Get all UIs, for which aports are available
|
||||||
:returns: ["none", "postmarketos-ui-one", "psotmarketos-ui-two", ...]
|
:returns: ["postmarketos-ui-one", "postmarketos-ui-two", ..., "none"]
|
||||||
"""
|
"""
|
||||||
ret = []
|
ret = []
|
||||||
for path in glob.glob(args.aports + "/main/postmarketos-ui-*"):
|
for path in glob.glob(args.aports + "/main/postmarketos-ui-*"):
|
||||||
|
|
Loading…
Reference in New Issue