|
56 | 56 | # * GZ_COMPRESS_PROGRAM: Select pigz to reduce build time |
57 | 57 | # * Default: gzip |
58 | 58 | # * Values: pigz,gzip |
| 59 | +# * UNATTENDED: Don't wait for interactive input from terminal, setting this |
| 60 | +# * value to anything will enable it |
| 61 | +# * Default: unset |
| 62 | +# * Value: y |
59 | 63 | # |
60 | 64 | ############################################################################### |
61 | 65 |
|
@@ -611,23 +615,28 @@ init : |
611 | 615 |
|
612 | 616 | .ONESHELL : reset |
613 | 617 | reset : |
614 | | - $(Q)echo && echo -n "Warning! All local changes will be lost. Proceed? [y/N]: " |
615 | | - $(Q)read ans && ( |
616 | | - if [ $$ans == y ]; then |
617 | | - echo "Resetting local repository. Please wait..."; |
618 | | - sudo rm -rf fsroot*; |
619 | | - if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then |
620 | | - echo "Stopping march $(CONFIGURED_ARCH) docker" |
621 | | - sudo kill -9 `sudo cat /var/run/march/docker.pid` || true |
622 | | - sudo rm -f /var/run/march/docker.pid || true |
623 | | - fi |
624 | | - git clean -xfdf; |
625 | | - git reset --hard; |
626 | | - git submodule foreach --recursive 'git clean -xfdf || true'; |
627 | | - git submodule foreach --recursive 'git reset --hard || true'; |
628 | | - git submodule foreach --recursive 'git remote update || true'; |
629 | | - git submodule update --init --recursive; |
630 | | - echo "Reset complete!"; |
631 | | - else |
632 | | - echo "Reset aborted"; |
633 | | - fi ) |
| 618 | + $(Q)echo && ( |
| 619 | + if [ -z "$(UNATTENDED)" ]; then |
| 620 | + echo -n "Warning! All local changes will be lost. Proceed? [y/N]: " |
| 621 | + @read ans |
| 622 | + else |
| 623 | + ans=y |
| 624 | + fi |
| 625 | + if [ $$ans == y ]; then |
| 626 | + echo "Resetting local repository. Please wait..."; |
| 627 | + sudo rm -rf fsroot*; |
| 628 | + if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then |
| 629 | + echo "Stopping march $(CONFIGURED_ARCH) docker" |
| 630 | + sudo kill -9 `sudo cat /var/run/march/docker.pid` || true |
| 631 | + sudo rm -f /var/run/march/docker.pid || true |
| 632 | + fi |
| 633 | + git clean -xfdf; |
| 634 | + git reset --hard; |
| 635 | + git submodule foreach --recursive 'git clean -xfdf || true'; |
| 636 | + git submodule foreach --recursive 'git reset --hard || true'; |
| 637 | + git submodule foreach --recursive 'git remote update || true'; |
| 638 | + git submodule update --init --recursive; |
| 639 | + echo "Reset complete!"; |
| 640 | + else |
| 641 | + echo "Reset aborted"; |
| 642 | + fi ) |
0 commit comments