Implement a patch for jtoty/Libftest because nm -g libft.a on MacOS X return _ft_lstdelone (unlike Linux which returns ft_lstdelone with _ as prefix) so ./grademe.sh -u -ob does not work on MacOS X

This commit is contained in:
gbaconni
2021-10-28 21:49:45 +02:00
parent 1273f529e1
commit 37deef2589
2 changed files with 13 additions and 1 deletions

11
libft/Libftest.patch Normal file
View File

@@ -0,0 +1,11 @@
--- a/srcs/check_file.sh
+++ b/srcs/check_file.sh
@@ -148,7 +148,7 @@ check_turned_in_functions()
printf "\n${text}" >> ${PATH_DEEPTHOUGHT}/deepthought
printf "%.s=" $(seq 1 $(( 80 - ${#text} ))) >> ${PATH_DEEPTHOUGHT}/deepthought
printf "\n" >> ${PATH_DEEPTHOUGHT}/deepthought
- if [[ -n $(echo ${LIB_CONTENT} | grep -w $(echo ${1})) ]]
+ if [[ -n $(echo ${LIB_CONTENT} | grep -w $(echo ${1})) ]] || [[ -n $(echo ${LIB_CONTENT} | grep -w _$(echo ${1})) ]]
then
retvalue=1
return "$retvalue"

View File

@@ -6,7 +6,7 @@
# By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ # # By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2021/10/22 09:10:00 by gbaconni #+# #+# # # Created: 2021/10/22 09:10:00 by gbaconni #+# #+# #
# Updated: 2021/10/27 10:07:41 by gbaconni ### ########.fr # # Updated: 2021/10/28 21:45:43 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
# #
@@ -89,6 +89,7 @@ b: compile _libftTester
@make -C libftTester m || true @make -C libftTester m || true
_Libftest: _Libftest:
@patch -d Libftest -p1 --dry-run < Libftest.patch >/dev/null 2>&1 && patch -d Libftest -p1 < Libftest.patch || true
@test -f Libftest/my_config.sh || (cd Libftest && ./grademe.sh -u >/dev/null 2>&1) || true @test -f Libftest/my_config.sh || (cd Libftest && ./grademe.sh -u >/dev/null 2>&1) || true
@grep -q '^PATH_LIBFT=\.\./libft' Libftest/my_config.sh || sed -i'.orig' -e 's/^\(PATH_LIBFT\)=.*/\1=..\/libft/' Libftest/my_config.sh || true @grep -q '^PATH_LIBFT=\.\./libft' Libftest/my_config.sh || sed -i'.orig' -e 's/^\(PATH_LIBFT\)=.*/\1=..\/libft/' Libftest/my_config.sh || true
@grep -q "'ft_memccpy'" Libftest/srcs/variables/functions/part_1.sh && sed -i'.orig' -e "/'ft_memccpy'/d" Libftest/srcs/variables/functions/part_1.sh || true @grep -q "'ft_memccpy'" Libftest/srcs/variables/functions/part_1.sh && sed -i'.orig' -e "/'ft_memccpy'/d" Libftest/srcs/variables/functions/part_1.sh || true