make.sh: Add OPTION to not clear screen

Message ID 20220529185158.3517499-1-jon.murphy@ipfire.org
State Superseded
Headers
Series make.sh: Add OPTION to not clear screen |

Commit Message

jon May 29, 2022, 6:51 p.m. UTC
  - minor changes to build and toolchain section
 - screen will not clear if option "--no-clear" is included
 - assists beginners (me!) view all steps in build process

Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
---
 doc/make.sh-usage |  3 +++
 make.sh           | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer May 30, 2022, 8:33 a.m. UTC | #1
Hello Jon,

I do not quite understand how the clear makes the build harder to read.

I am happy to drop the clear entirely, because it doesn’t add that much to the experience.

-Michael

> On 29 May 2022, at 19:51, Jon Murphy <jon.murphy@ipfire.org> wrote:
> 
> - minor changes to build and toolchain section
> - screen will not clear if option "--no-clear" is included
> - assists beginners (me!) view all steps in build process
> 
> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
> ---
> doc/make.sh-usage |  3 +++
> make.sh           | 10 ++++++++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/make.sh-usage b/doc/make.sh-usage
> index 5e1e3dd22..32e7fd862 100644
> --- a/doc/make.sh-usage
> +++ b/doc/make.sh-usage
> @@ -21,3 +21,6 @@ Options:
>                                        the desired target architecture.
>                                        Can be permanently set with TARGET_ARCH= in
>                                        .config.
> +
> +    --no-clear : do not clear screen when during command build or toolchain
> +
> diff --git a/make.sh b/make.sh
> index 3ed9190b9..1e22a513b 100755
> --- a/make.sh
> +++ b/make.sh
> @@ -1803,11 +1803,17 @@ ipfirepackages() {
>   rm -rf  $BASEDIR/build/install/packages/*
> }
> 
> +# Default setting
> +CLEAR_SCREEN=true
> +
> while [ $# -gt 0 ]; do
> 	case "${1}" in
> 		--target=*)
> 			configure_build "${1#--target=}"
> 			;;
> +		--no-clear)
> +			CLEAR_SCREEN=false
> +			;;
> 		-*)
> 			exiterror "Unknown configuration option: ${1}"
> 			;;
> @@ -1825,7 +1831,7 @@ build)
> 	START_TIME="${SECONDS}"
> 
> 	# Clear screen
> -	${INTERACTIVE} && clear
> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
> 
> 	PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
> 	#only restore on a clean disk
> @@ -1971,7 +1977,7 @@ downloadsrc)
> 	;;
> toolchain)
> 	# Clear screen
> -	${INTERACTIVE} && clear
> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
> 
> 	prepareenv
> 	print_build_stage "Toolchain compilation (${BUILD_ARCH})"
> -- 
> 2.30.2
>
  
Jon Murphy May 30, 2022, 1 p.m. UTC | #2
Michael,

When learning it makes it much easier when I can see the previous commands (the ones before `make build`) and their responses. Using the `history` command was not always helpful.  Make build clears the Terminal and wipes out my past commands.

Overly simple example of what I want to fix and view:


> On May 30, 2022, at 3:33 AM, Michael Tremer <michael.tremer@ipfire.org> wrote:
> 
> Hello Jon,
> 
> I do not quite understand how the clear makes the build harder to read.
> 
> I am happy to drop the clear entirely, because it doesn’t add that much to the experience.
> 
> -Michael
> 
>> On 29 May 2022, at 19:51, Jon Murphy <jon.murphy@ipfire.org> wrote:
>> 
>> - minor changes to build and toolchain section
>> - screen will not clear if option "--no-clear" is included
>> - assists beginners (me!) view all steps in build process
>> 
>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
>> ---
>> doc/make.sh-usage |  3 +++
>> make.sh           | 10 ++++++++--
>> 2 files changed, 11 insertions(+), 2 deletions(-)
>> 
>> diff --git a/doc/make.sh-usage b/doc/make.sh-usage
>> index 5e1e3dd22..32e7fd862 100644
>> --- a/doc/make.sh-usage
>> +++ b/doc/make.sh-usage
>> @@ -21,3 +21,6 @@ Options:
>>                                       the desired target architecture.
>>                                       Can be permanently set with TARGET_ARCH= in
>>                                       .config.
>> +
>> +    --no-clear : do not clear screen when during command build or toolchain
>> +
>> diff --git a/make.sh b/make.sh
>> index 3ed9190b9..1e22a513b 100755
>> --- a/make.sh
>> +++ b/make.sh
>> @@ -1803,11 +1803,17 @@ ipfirepackages() {
>>  rm -rf  $BASEDIR/build/install/packages/*
>> }
>> 
>> +# Default setting
>> +CLEAR_SCREEN=true
>> +
>> while [ $# -gt 0 ]; do
>> 	case "${1}" in
>> 		--target=*)
>> 			configure_build "${1#--target=}"
>> 			;;
>> +		--no-clear)
>> +			CLEAR_SCREEN=false
>> +			;;
>> 		-*)
>> 			exiterror "Unknown configuration option: ${1}"
>> 			;;
>> @@ -1825,7 +1831,7 @@ build)
>> 	START_TIME="${SECONDS}"
>> 
>> 	# Clear screen
>> -	${INTERACTIVE} && clear
>> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
>> 
>> 	PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
>> 	#only restore on a clean disk
>> @@ -1971,7 +1977,7 @@ downloadsrc)
>> 	;;
>> toolchain)
>> 	# Clear screen
>> -	${INTERACTIVE} && clear
>> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
>> 
>> 	prepareenv
>> 	print_build_stage "Toolchain compilation (${BUILD_ARCH})"
>> -- 
>> 2.30.2
>> 
>
  
Jon Murphy May 30, 2022, 3:31 p.m. UTC | #3
Michael,

If you are OK with dropping the clear:
```
	# Clear screen
	${INTERACTIVE} && clear
```

Then I’ll do that and I resubmit the patch.

I also went through to `make.sh-usage` file and corrected the TARGET and added missing commands.


Jon


> On May 30, 2022, at 8:00 AM, Jon Murphy <jcmurphy26@gmail.com> wrote:
> 
> Michael,
> 
> When learning it makes it much easier when I can see the previous commands (the ones before `make build`) and their responses. Using the `history` command was not always helpful.  Make build clears the Terminal and wipes out my past commands.
> 
> Overly simple example of what I want to fix and view:
> <Screen Shot 2022-05-30 at 7.52.51 AM.png>
> 
>> On May 30, 2022, at 3:33 AM, Michael Tremer <michael.tremer@ipfire.org <mailto:michael.tremer@ipfire.org>> wrote:
>> 
>> Hello Jon,
>> 
>> I do not quite understand how the clear makes the build harder to read.
>> 
>> I am happy to drop the clear entirely, because it doesn’t add that much to the experience.
>> 
>> -Michael
>> 
>>> On 29 May 2022, at 19:51, Jon Murphy <jon.murphy@ipfire.org <mailto:jon.murphy@ipfire.org>> wrote:
>>> 
>>> - minor changes to build and toolchain section
>>> - screen will not clear if option "--no-clear" is included
>>> - assists beginners (me!) view all steps in build process
>>> 
>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org <mailto:jon.murphy@ipfire.org>>
>>> ---
>>> doc/make.sh-usage |  3 +++
>>> make.sh           | 10 ++++++++--
>>> 2 files changed, 11 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/doc/make.sh-usage b/doc/make.sh-usage
>>> index 5e1e3dd22..32e7fd862 100644
>>> --- a/doc/make.sh-usage
>>> +++ b/doc/make.sh-usage
>>> @@ -21,3 +21,6 @@ Options:
>>>                                       the desired target architecture.
>>>                                       Can be permanently set with TARGET_ARCH= in
>>>                                       .config.
>>> +
>>> +    --no-clear : do not clear screen when during command build or toolchain
>>> +
>>> diff --git a/make.sh b/make.sh
>>> index 3ed9190b9..1e22a513b 100755
>>> --- a/make.sh
>>> +++ b/make.sh
>>> @@ -1803,11 +1803,17 @@ ipfirepackages() {
>>>  rm -rf  $BASEDIR/build/install/packages/*
>>> }
>>> 
>>> +# Default setting
>>> +CLEAR_SCREEN=true
>>> +
>>> while [ $# -gt 0 ]; do
>>> 	case "${1}" in
>>> 		--target=*)
>>> 			configure_build "${1#--target=}"
>>> 			;;
>>> +		--no-clear)
>>> +			CLEAR_SCREEN=false
>>> +			;;
>>> 		-*)
>>> 			exiterror "Unknown configuration option: ${1}"
>>> 			;;
>>> @@ -1825,7 +1831,7 @@ build)
>>> 	START_TIME="${SECONDS}"
>>> 
>>> 	# Clear screen
>>> -	${INTERACTIVE} && clear
>>> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
>>> 
>>> 	PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
>>> 	#only restore on a clean disk
>>> @@ -1971,7 +1977,7 @@ downloadsrc)
>>> 	;;
>>> toolchain)
>>> 	# Clear screen
>>> -	${INTERACTIVE} && clear
>>> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
>>> 
>>> 	prepareenv
>>> 	print_build_stage "Toolchain compilation (${BUILD_ARCH})"
>>> -- 
>>> 2.30.2
>>> 
>> 
>
  
Jon Murphy May 30, 2022, 11:54 p.m. UTC | #4
Please delete this patch.  

V2 already sent.

Jon


> On May 29, 2022, at 1:51 PM, Jon Murphy <jon.murphy@ipfire.org> wrote:
> 
> - minor changes to build and toolchain section
> - screen will not clear if option "--no-clear" is included
> - assists beginners (me!) view all steps in build process
> 
> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
> ---
> doc/make.sh-usage |  3 +++
> make.sh           | 10 ++++++++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/make.sh-usage b/doc/make.sh-usage
> index 5e1e3dd22..32e7fd862 100644
> --- a/doc/make.sh-usage
> +++ b/doc/make.sh-usage
> @@ -21,3 +21,6 @@ Options:
>                                        the desired target architecture.
>                                        Can be permanently set with TARGET_ARCH= in
>                                        .config.
> +
> +    --no-clear : do not clear screen when during command build or toolchain
> +
> diff --git a/make.sh b/make.sh
> index 3ed9190b9..1e22a513b 100755
> --- a/make.sh
> +++ b/make.sh
> @@ -1803,11 +1803,17 @@ ipfirepackages() {
>   rm -rf  $BASEDIR/build/install/packages/*
> }
> 
> +# Default setting
> +CLEAR_SCREEN=true
> +
> while [ $# -gt 0 ]; do
> 	case "${1}" in
> 		--target=*)
> 			configure_build "${1#--target=}"
> 			;;
> +		--no-clear)
> +			CLEAR_SCREEN=false
> +			;;
> 		-*)
> 			exiterror "Unknown configuration option: ${1}"
> 			;;
> @@ -1825,7 +1831,7 @@ build)
> 	START_TIME="${SECONDS}"
> 
> 	# Clear screen
> -	${INTERACTIVE} && clear
> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
> 
> 	PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
> 	#only restore on a clean disk
> @@ -1971,7 +1977,7 @@ downloadsrc)
> 	;;
> toolchain)
> 	# Clear screen
> -	${INTERACTIVE} && clear
> +	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
> 
> 	prepareenv
> 	print_build_stage "Toolchain compilation (${BUILD_ARCH})"
> -- 
> 2.30.2
>
  

Patch

diff --git a/doc/make.sh-usage b/doc/make.sh-usage
index 5e1e3dd22..32e7fd862 100644
--- a/doc/make.sh-usage
+++ b/doc/make.sh-usage
@@ -21,3 +21,6 @@  Options:
                                        the desired target architecture.
                                        Can be permanently set with TARGET_ARCH= in
                                        .config.
+
+    --no-clear : do not clear screen when during command build or toolchain
+
diff --git a/make.sh b/make.sh
index 3ed9190b9..1e22a513b 100755
--- a/make.sh
+++ b/make.sh
@@ -1803,11 +1803,17 @@  ipfirepackages() {
   rm -rf  $BASEDIR/build/install/packages/*
 }
 
+# Default setting
+CLEAR_SCREEN=true
+
 while [ $# -gt 0 ]; do
 	case "${1}" in
 		--target=*)
 			configure_build "${1#--target=}"
 			;;
+		--no-clear)
+			CLEAR_SCREEN=false
+			;;
 		-*)
 			exiterror "Unknown configuration option: ${1}"
 			;;
@@ -1825,7 +1831,7 @@  build)
 	START_TIME="${SECONDS}"
 
 	# Clear screen
-	${INTERACTIVE} && clear
+	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
 
 	PACKAGE="$BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.zst"
 	#only restore on a clean disk
@@ -1971,7 +1977,7 @@  downloadsrc)
 	;;
 toolchain)
 	# Clear screen
-	${INTERACTIVE} && clear
+	${INTERACTIVE} && ${CLEAR_SCREEN} && clear
 
 	prepareenv
 	print_build_stage "Toolchain compilation (${BUILD_ARCH})"