| Newsgroups |
gmane.linux.lfs.automated |
| Message-ID |
<[email protected]> |
On 6/14/22 05:48, Pierre Labastie ([email protected] via alfs-discuss Mailing
List) wrote:
> On Mon, 2022-06-13 at 13:05 -0500, Bruce Dubbs wrote:
>> When running jhalfs, I get:
>>
>> Are you happy with these optimization settings? yes/no (no): yes
>>
>> ------------------------------------------------------------------------------
>>
>> Using /home/bdubbs/lfs.git as book's sources ...
>> Extracting commands for <LFS> build... done
>> Creating chroot commands scripts from /home/bdubbs/lfs.git... done
>> Creating virtual kernel FS commands scripts from /home/bdubbs/lfs.git... done
>>
>>
>> ERROR: Error 1 at common/libs/func_book_parser line 133!
>>
>> <jhalfs> exit
>> make: *** [Makefile:11: all] Error 1
>>
>> ===========
>>
>> Looking at common/libs/func_book_parser line 133 it is
>>
>> # Done. Moving on...
>> get_sources
>>
>> Removing get_sources works for me. But I do have
>>
>> (Top) → General Settings
>> Main menu
>> (/mnt/lfs) Build Directory
>> [ ] Retrieve source files
>> [ ] Run the makefile
>> [ ] Rebuild files
>>
>> So it should never get there.
>
> Well, the first line in function get_sources is:
> [ "$GETPKG" = y ] || return
>
> so it should just return if "Retrieve source files" is not ticked. But I suspect
> some stupid behavior of bash like returning a non zero code because the last
> executed instructions is [ "$GETPKG" = y ], which of course exits with non
> zero... Yes, checking the bash man page, return exits with the exit value of the
> last command executed, unless return is given an argument.
>
> Personally, I do not like using || and && to replace "if ... then", but some
> people prefer it. With the way bash manages error codes, it should never be used
> in bash! On the other hand, in this case, maybe just replace return by "return
> 0" could do the job.
>
> Would you mind testing this? (change "return" to "return 0" in
> common/libs/func_download_pkgs). It works for me.
Yes, this works
$ git diff --nocolor
error: invalid option: --nocolor
bdubbs@pippin111 [ ~/jhalfs.git ]$ git diff --no-color
diff --git a/common/libs/func_download_pkgs b/common/libs/func_download_pkgs
index 09ec7e7..3d369d2 100644
--- a/common/libs/func_download_pkgs
+++ b/common/libs/func_download_pkgs
@@ -5,7 +5,7 @@ get_sources() { # Download file, write name to
MISSING_FILES.DMP if
#----------------------------#
# Test if the packages must be downloaded
- [ "$GETPKG" = y ] || return
+ [ "$GETPKG" = y ] || return 0
local URL FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE WGETPARAM MAYBEMORE
I tried to commit/push, but I don't have permissions.
-- Bruce
--
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page