PiDP-8/I SoftwareCheck-in [1860880163]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The configure script now detects whether Python 2 or 3 is installed, and what its binary is called. If both are installed, it prefers Python 3. This then substitutes the value found into all scripts and module shebang lines that previously hardcoded "/usr/bin/env python". With this move, several files got renamed to *.in, as they previously had no other reason to be treated as Autosetup templates.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | os8-run-python3
Files: files | file ages | folders
SHA3-256: 1860880163080b119eb0128f154d04561ad3a1ceeba811eca03b71f4dbf0f2ed
User & Date: tangent 2019-05-11 18:25:29
References
2019-05-11
18:35
Added all of the files renamed in [1860880163] to *.in to the Makefile's INFILES variable, so we autoreconf when any of them get touched. Leaf check-in: c67bd86630 user: tangent tags: os8-run-python3
Context
2019-05-11
18:32
Changed xrange() call to range() in class simh to be compatible with Python 3. check-in: 6d23ecf72c user: tangent tags: os8-run-python3
18:25
The configure script now detects whether Python 2 or 3 is installed, and what its binary is called. If both are installed, it prefers Python 3. This then substitutes the value found into all scripts and module shebang lines that previously hardcoded "/usr/bin/env python". With this move, several files got renamed to *.in, as they previously had no other reason to be treated as Autosetup templates. check-in: 1860880163 user: tangent tags: os8-run-python3
15:33
Merged in trunk changes check-in: 19490adbd4 user: tangent tags: os8-run-python3
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to auto.def.

443
444
445
446
447
448
449
450










451
452







453
454


455
456
457
458
459

460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
...
541
542
543
544
545
546
547



548
549
550
551
552
553
554
...
555
556
557
558
559
560
561

562
563
564

565
566
567
568
569
570
571
572
573
574

575
576




# Get host, user, and date info for use by media/os8/init.tx.
catch {exec hostname} host
set user $::env(USER)
define BUILDUSER "$user@$host"
define BUILDTS [clock format [clock seconds] -format "%Y.%m.%d at %T %Z"]

# The os8-run script requires Python and some non-core modules.










set status [catch {exec python -c exit} result]
if {$status != 0} {







    user-error "Python 2 does not appear to be installed here.  It is required."
}


msg-result "Python 2 is installed here."
set status [catch {exec python -c "import pexpect" 2> /dev/null} result]
if {$status != 0} {
    set msg "The Python pexpect module is not installed here.  Fix with\n\n"
    append msg "    sudo apt install python-pip\n"

    append msg "    sudo pip install pexpect\n"
    append msg "\nOR:\n"
    append msg "\n    sudo easy_install pexpect\n"
    append msg "\nOR:\n"
    append msg "\n    sudo apt install python-pexpect\n"
    user-error $msg
}
msg-result "Python module pexpect is installed here."
set status [catch {exec python -c "import pkg_resources" 2> /dev/null} result]
if {$status != 0} {
    set msg "The Python pkg_resources module is not installed here.  Fix with\n"
    append msg "\n    sudo pip install pkg_resources\n"
    append msg "\nOR:\n"
    append msg "\n    sudo easy_install pkg_resources\n"
    append msg "\nOR:\n"
    append msg "\n    sudo apt install python-pkg-resources\n"
    user-error $msg
}
msg-result "Python module pkg_resources is installed here."

# Check for Perl and that it can run the test corpus builder.  Not fatal
# if it can't, since only developers and deep testers need it.
set status [catch {exec perl -e exit} result]
................................................................................
# The boot/common.script must precede the rest of boot/*, because they
# @include the output version.
make-config-header src/config.h \
    -auto {ENABLE_* HAVE_* PACKAGE_* SIZEOF_*} \
    -bare {ILS_MODE PCB_*}
make-template bin/pidp8i.in
make-template bin/os8-cp.in



make-template boot/common.script.in
make-template boot/0.script.in
make-template boot/2.script.in
make-template boot/3.script.in
make-template boot/4.script.in
make-template boot/6.script.in
make-template boot/7.script.in
................................................................................
make-template boot/run.script.in
make-template boot/run-v3f.script.in
make-template boot/tss8.script.in
make-template etc/pidp8i.service.in
make-template etc/sudoers.in
make-template etc/usb-mount@.service.in
make-template examples/Makefile.in

make-template lib/pidp8i/__init__.py.in
make-template lib/pidp8i/dirs.py.in
make-template lib/pidp8i/ips.py.in

make-template media/os8/init.tx.in
make-template media/os8/3finit.tx.in
make-template src/Makefile.in
make-template src/cc8/Makefile.in
make-template src/cc8/os8/Makefile.in
make-template src/pidp8i/gpio-common.c.in
make-template src/pidp8i/main.c.in
make-template src/SIMH/Makefile.in
make-template src/SIMH/PDP8/Makefile.in
make-template tools/simh-update.in

make-template Makefile.in
exec chmod +x "$builddir/bin/pidp8i" "$builddir/tools/simh-update" "$builddir/bin/os8-cp"










|
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
|

>
>
|
|


|
>
|



|



|


|



|







 







>
>
>







 







>



>










>

<
>
>
>
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
...
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
...
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601

602
603
604

# Get host, user, and date info for use by media/os8/init.tx.
catch {exec hostname} host
set user $::env(USER)
define BUILDUSER "$user@$host"
define BUILDTS [clock format [clock seconds] -format "%Y.%m.%d at %T %Z"]

# The os8-run script requires Python 2 or 3 and some non-core modules.
set status [catch {exec python3 -c exit} result]
if {$status == 0} {
    set pyver 3
    set pycmd "python3"
} else {
    set status [catch {exec python2 -c exit} result]
    if {$status == 0} {
        set pyver 2
        set pycmd "python2"
    } else {
        set status [catch {exec python -c exit} result]
        if {$status == 0} {
            set status [catch {exec python --version | grep -q 'Version 2'} result]
            set pyver [expr $status == 0 ? 2 : 3]
            set pycmd "python"
        }
    }
}
if {$pyver == ""} {
    user-error "Python does not appear to be installed here.  It is required."
}
define PYCMD $pycmd
define PYVER $pyver
msg-result "Python $pyver is installed here as '$pycmd'."
set status [catch {exec $pycmd -c "import pexpect" 2> /dev/null} result]
if {$status != 0} {
    set msg "The Python pexpect module is not installed here.  Fix with\n\n"
    append msg "    sudo apt install $pycmd-pip\n"
    append msg "\nTHEN:\n"
    append msg "    sudo pip$pyver install pexpect\n"
    append msg "\nOR:\n"
    append msg "\n    sudo easy_install pexpect\n"
    append msg "\nOR:\n"
    append msg "\n    sudo apt install $pycmd-pexpect\n"
    user-error $msg
}
msg-result "Python module pexpect is installed here."
set status [catch {exec $pycmd -c "import pkg_resources" 2> /dev/null} result]
if {$status != 0} {
    set msg "The Python pkg_resources module is not installed here.  Fix with\n"
    append msg "\n    sudo pip$pyver install pkg_resources\n"
    append msg "\nOR:\n"
    append msg "\n    sudo easy_install pkg_resources\n"
    append msg "\nOR:\n"
    append msg "\n    sudo apt install $pycmd-pkg-resources\n"
    user-error $msg
}
msg-result "Python module pkg_resources is installed here."

# Check for Perl and that it can run the test corpus builder.  Not fatal
# if it can't, since only developers and deep testers need it.
set status [catch {exec perl -e exit} result]
................................................................................
# The boot/common.script must precede the rest of boot/*, because they
# @include the output version.
make-config-header src/config.h \
    -auto {ENABLE_* HAVE_* PACKAGE_* SIZEOF_*} \
    -bare {ILS_MODE PCB_*}
make-template bin/pidp8i.in
make-template bin/os8-cp.in
make-template bin/os8-run.in
make-template bin/teco-pi-demo.in
make-template bin/txt2os8.in
make-template boot/common.script.in
make-template boot/0.script.in
make-template boot/2.script.in
make-template boot/3.script.in
make-template boot/4.script.in
make-template boot/6.script.in
make-template boot/7.script.in
................................................................................
make-template boot/run.script.in
make-template boot/run-v3f.script.in
make-template boot/tss8.script.in
make-template etc/pidp8i.service.in
make-template etc/sudoers.in
make-template etc/usb-mount@.service.in
make-template examples/Makefile.in
make-template lib/os8script.py.in
make-template lib/pidp8i/__init__.py.in
make-template lib/pidp8i/dirs.py.in
make-template lib/pidp8i/ips.py.in
make-template lib/simh.py.in
make-template media/os8/init.tx.in
make-template media/os8/3finit.tx.in
make-template src/Makefile.in
make-template src/cc8/Makefile.in
make-template src/cc8/os8/Makefile.in
make-template src/pidp8i/gpio-common.c.in
make-template src/pidp8i/main.c.in
make-template src/SIMH/Makefile.in
make-template src/SIMH/PDP8/Makefile.in
make-template tools/simh-update.in
make-template tools/test-os8-send-file.in
make-template Makefile.in

foreach f [concat [glob "$builddir/bin/*"] [glob "$builddir/tools/*"]] {
    file attributes $f -permissions +x
}

Changes to bin/os8-cp.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# Generalized facility to manipulate os8 device images from the POSIX
# (host) side using OS/8 system programs under SIMH.
#
# See USAGE message below for details.
#
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# Generalized facility to manipulate os8 device images from the POSIX
# (host) side using OS/8 system programs under SIMH.
#
# See USAGE message below for details.
#

Name change from bin/os8-run to bin/os8-run.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# Script runner for OS/8 under SIMH.
# The library module os8script.py does the heavy lifting.
#
# See USAGE message below for details.
#
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# Script runner for OS/8 under SIMH.
# The library module os8script.py does the heavy lifting.
#
# See USAGE message below for details.
#

Name change from bin/teco-pi-demo to bin/teco-pi-demo.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# teco-pi-demo - Starts the simulator with the OS/8, sends one of the
#   famous TECO "calculate pi" program to it, and starts it running at
#   a very slow rate of speed to act as a blinkenlights demo.
#
# Copyright © 2017-2019 by Warren Young.
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# teco-pi-demo - Starts the simulator with the OS/8, sends one of the
#   famous TECO "calculate pi" program to it, and starts it running at
#   a very slow rate of speed to act as a blinkenlights demo.
#
# Copyright © 2017-2019 by Warren Young.

Name change from bin/txt2os8 to bin/txt2os8.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# Create a tu56 or rk05 image and fill it with ASCII files, i.e.  source code.
#
# It is intended to be be called manually when we have a POSIX
# directory full of ASCII files we want to bulk-copy into SIMH.
#
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# Create a tu56 or rk05 image and fill it with ASCII files, i.e.  source code.
#
# It is intended to be be called manually when we have a POSIX
# directory full of ASCII files we want to bulk-copy into SIMH.
#

Name change from lib/os8script.py to lib/os8script.py.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# simh-os8-script.py Library for scripting OS/8 under SIMH
# Contains validators and callers for os8 and simh commands to make
# it easier to create scripts.
#
# Copyright © 2017-2019 by Jonathan Trites, William Cattey, and
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# simh-os8-script.py Library for scripting OS/8 under SIMH
# Contains validators and callers for os8 and simh commands to make
# it easier to create scripts.
#
# Copyright © 2017-2019 by Jonathan Trites, William Cattey, and

Name change from lib/simh.py to lib/simh.py.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# simh/__init__.py - A wrapper class around pexpect for communicating
#   with an instance of the PiDP-8/I SIMH simulator running OS/8.
#
#   See ../doc/class-simh.md for a usage tutorial.
#
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# simh/__init__.py - A wrapper class around pexpect for communicating
#   with an instance of the PiDP-8/I SIMH simulator running OS/8.
#
#   See ../doc/class-simh.md for a usage tutorial.
#

Name change from tools/test-os8-send-file to tools/test-os8-send-file.in.

1
2
3
4
5
6
7
8
#!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
# test-os8-send-file - Repeatedly sends random files through class simh
#   method os8_send_file() and pulls it back through os8_get_file(),
#   then checks that the file is unchanged.
#
# Copyright © 2017-2019 by Warren Young.
|







1
2
3
4
5
6
7
8
#!/usr/bin/env @PYCMD@
# -*- coding: utf-8 -*-
########################################################################
# test-os8-send-file - Repeatedly sends random files through class simh
#   method os8_send_file() and pulls it back through os8_get_file(),
#   then checks that the file is unchanged.
#
# Copyright © 2017-2019 by Warren Young.