Commit 4b784f1d authored by Oskar Skog's avatar Oskar Skog

0.2.2: Makefile verbosity control; mkenginecfg bugfix (0 processors due to shell pipeline)

parent 4dcf9799
......@@ -101,6 +101,11 @@ BUG#7 2016-02-09
is not space (0x20).
Workaround in place.
SOLVED BUG#8 2016-07-07
mkenginecfg
`nonexistent-cpulister | wc -l` prints "0" and SUCCEEDS.
The bug was fixed immediately on discovery.
Problematic platforms
=====================
......
2016-07-07 Oskar Skog <oskar.skog.finland@gmail.com>
0.2.2
* mkenginecfg: Bugfix:
`nonexisting-cpulister | wc -l` returns 0 processors
and succeeds.
- Fixed the pipelines.
- Added a sanity check.
* configure.py: Fix verbosity setting for Makefile.
Give Makefile verbose=false as default and verbose=true
if the -v flag was used.
* Makefile.static (overwrite-cfg):
Use $(info) instead of echo.
* Makefile.static (dist, tarballs, zip):
Don't bother writing out the "Depends on tarballs and zip"
message as that itself depends on those two targets.
Messages are now printed by zip and tarballs.
0.2.1
* NEWS: Changes from 0.1.0 to 0.2.0
* Makefile.static: FILES gone; LICENSE back
......
......@@ -12,7 +12,7 @@
NAME := anonymine
NAME_C := Anonymine
DESCRIPTION = Minesweeper without guessing
VERSION := 0.2.1
VERSION := 0.2.2
# Three more variables are required: EXECUTABLES and MODULES
# and MODULES_OTHERVER (= "non-existent").
......@@ -152,8 +152,8 @@ check-install-cfg : FORCE
overwrite-cfg: FORCE
@$(INSTALL) -m 644 "$(srcdir)cursescfg" "$(CFG_DIR)/cursescfg"
@$(INSTALL) -m 644 "$(ENGINECFG_STAGE)" "$(CFG_DIR)/enginecfg"
@echo "Configuration has been overwritten"
@echo "All (if any) system-wide modifications are lost"
@$(info) "Configuration has been overwritten"
@$(info) "All (if any) system-wide modifications are lost"
install-dirs : FORCE
@$(info) 'Installing directories'
......@@ -317,7 +317,6 @@ check: FORCE
@$(srcdir)check.sh "$(srcdir)" "$(builddir)"
dist : tarballs zip
@echo Depends on '"'tarballs'"' and '"'zip'"'
@$(info) 'make check; This will take a while'
@make check >/dev/null
@$(info) 'make release'
......@@ -330,6 +329,7 @@ release : FORCE
|| echo You are not me.
tarballs : FORCE
@$(info) "Building tarballs"
@mkdir "$(PKG)"
@for subdir in $(PKG_SUBDIRS); do mkdir "$(PKG)/$$subdir"; done;
@: # Copy all files normally:
......@@ -345,6 +345,7 @@ tarballs : FORCE
@rm -r -- "$(PKG)"
zip : FORCE
@$(info) "Building zip for Windows version"
@mkdir "$(PKG)"
@for subdir in $(PKG_SUBDIRS); do mkdir "$(PKG)/$$subdir"; done;
@: # /(.*)$/ -> /\1.txt/
......
......@@ -63,7 +63,7 @@ except:
GAME_NAME = 'Anonymine'
GAME_FILENAME = GAME_NAME.lower().replace(' ', '-')
GAME_VERSION = (0, 2, 1)
GAME_VERSION = (0, 2, 2)
# GAME_VERSION MAY lag behind the version of the package when no change has
# been made to this file.
GAME_CRAPTEXT = """{0} version {1}.{2}.{3}
......
......@@ -11,7 +11,7 @@ if [ $# -eq 1 ]; then
done
for version_option in -V --version; do
if [ "$1" = $version_option ]; then
echo Anonymine 0.2.1
echo Anonymine 0.2.2
echo Handmade configure and configure.py
echo Version info from configure may lag behind.
exit
......
......@@ -392,6 +392,11 @@ def main():
#
error |= detect_desktop(Makefile, flags)
if flags['v']:
Makefile['verbose'] = 'true'
else:
Makefile['verbose'] = 'false'
v('')
if flags['v']:
of_interest = (
......
......@@ -28,7 +28,14 @@ import time
import sys
def main():
cpus = int(sys.argv[1])
try:
cpus = int(sys.argv[1])
assert cpus >= 1
except:
sys.stderr.write(
'Do you really have {} processors?\n'.format(sys.argv[1])
)
cpus = 1
procs = int(0.83 * cpus + 0.5)
cfg = {
......@@ -52,18 +59,20 @@ __EOF__
# Count the number of logical processors.
# v: Don't forget the semicolon!
_ncpus0 () { nproc --all; } # Debian
_ncpus1 () { lscpu -p | grep -v '#' | wc -l; } # (Linux)/Debian
_ncpus2 () { sysctl -n kern.smp.cpus; } # BSD (Should I use this?)
_ncpus3 () { sysctl -n hw.logicalcpu; } # BSD
_ncpus4 () { sysctl -n hw.ncpu; } # BSD (fallback)
_ncpus5 () { psrinfo | wc -l; } # (OpenSolaris)/openidiana
# WARNING: If the first command in a pipeline fails, the pipeline itself may
# succeed! (wc -l says there are zero processors.)
# NOTICE v: Don't forget the semicolon!
_n0 () { nproc --all; } # Debian
_n1 () { lscpu && lscpu -p | grep -v '#' | wc -l; } # (Linux)/Debian
_n2 () { sysctl -n kern.smp.cpus; } # BSD (Should I use this?)
_n3 () { sysctl -n hw.logicalcpu; } # BSD
_n4 () { sysctl -n hw.ncpu; } # BSD (fallback)
_n5 () { psrinfo && psrinfo | wc -l; } # (OpenSolaris)/openidiana
for n in `seq 0 5`; do
ncpus=`_ncpus$n` 2> /dev/null && break
ncpus=`_n$n` 2> /dev/null && break
done
oldpwd=`pwd`
cd "$srcdir"
python "$pyfile" $ncpus > "$outfile" || cp "$defaultfile" "$outfile"
cd "$oldpwd"
\ No newline at end of file
cd "$oldpwd"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment