You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/03 17:54:49 UTC

[nuttx-apps] branch master updated: ltp/makefile: nuttx on github download ltp code failed fix

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 1309990d6 ltp/makefile: nuttx on github download ltp code failed fix
1309990d6 is described below

commit 1309990d6c9d4b3b98adab4acb764814ea096d88
Author: yanghuatao <ya...@xiaomi.com>
AuthorDate: Thu Aug 3 15:23:35 2023 +0800

    ltp/makefile: nuttx on github download ltp code failed fix
    
    Fix github download ltp code error:
    Cloning into 'ltp'...
    *** Please tell me who you are.
    Run
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"
    to set your account's default identity.
    Omit --global to set the identity only in this repository.
    fatal: unable to auto-detect email address (got 'root@33ba2a4a6fc5.(none)')
    
    Signed-off-by: yanghuatao <ya...@xiaomi.com>
---
 ...002-Use-ifdef-instead-of-if-for-__linux__.patch |  6 +++---
 testing/ltp/Makefile                               | 22 ++++++++++++++--------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/testing/ltp/0002-Use-ifdef-instead-of-if-for-__linux__.patch b/testing/ltp/0002-Use-ifdef-instead-of-if-for-__linux__.patch
index 2cc59cf6e..47e092032 100644
--- a/testing/ltp/0002-Use-ifdef-instead-of-if-for-__linux__.patch
+++ b/testing/ltp/0002-Use-ifdef-instead-of-if-for-__linux__.patch
@@ -7,10 +7,10 @@ Subject: [PATCH 2/2] Use #ifdef instead of #if for __linux__
  .../conformance/interfaces/sem_timedwait/3-1.c                  | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
+diff --git a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
 index fb6f2e6cb..739fe86a5 100644
---- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
-+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
+--- a/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
++++ b/ltp/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
 @@ -15,7 +15,7 @@
  #include <sys/stat.h>
  #include <sys/types.h>
diff --git a/testing/ltp/Makefile b/testing/ltp/Makefile
index 19aa31d08..2f4e976c5 100644
--- a/testing/ltp/Makefile
+++ b/testing/ltp/Makefile
@@ -20,10 +20,12 @@
 
 include $(APPDIR)/Make.defs
 
-LTP_UNPACK   = ltp
-LTP_URL      = https://github.com/linux-test-project/ltp.git
+LTPS_VERSION     = 20230516
+LTP_DOWNLOAD_URL = https://github.com/linux-test-project/ltp/archive/refs/tags/
+LTP_UNPACK       = ltp
+LTP_URL          = https://github.com/linux-test-project/ltp.git
 
-TESTDIR      = $(LTP_UNPACK)/testcases/open_posix_testsuite
+TESTDIR          = $(LTP_UNPACK)/testcases/open_posix_testsuite
 
 ifneq ($(wildcard $(TESTDIR)),)
 ifeq ($(CONFIG_FS_AIO),)
@@ -274,11 +276,15 @@ CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable
 # Should be removed if possible in the future
 CFLAGS += -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-to-pointer-cast
 
-$(LTP_UNPACK):
-	$(Q) echo "git clone $(LTP_URL)"
-	$(Q) git clone $(LTP_URL)
-	$(Q) git -C $(LTP_UNPACK) am < 0001-Fix-static-struct-warning.patch
-	$(Q) git -C $(LTP_UNPACK) am < 0002-Use-ifdef-instead-of-if-for-__linux__.patch
+ltp-$(LTPS_VERSION).zip:
+	$(call DOWNLOAD,$(LTP_DOWNLOAD_URL),$(LTPS_VERSION).zip, ltp.zip)
+
+$(LTP_UNPACK): ltp-$(LTPS_VERSION).zip
+	$(Q) echo "dowload $(LTP_DOWNLOAD_URL)$(LTPS_VERSION).zip"
+	$(Q) unzip -o ltp.zip
+	$(Q) mv ltp-$(LTPS_VERSION) $(LTP_UNPACK)
+	$(Q) patch -p1 < 0001-pthread_rwlock_unlock-follow-linux.patch
+	$(Q) patch -p1 < 0002-Use-ifdef-instead-of-if-for-__linux__.patch
 
 # Download and unpack tarball if no git repo found
 ifeq ($(wildcard $(LTP_UNPACK)/.git),)