On Tue, Dec 6, 2022 at 1:24 PM Ferruh Yigit <ferruh.yi...@amd.com> wrote:
>
> By default 'test-meson-builds.sh' script clones the repository which the
> script is in, and selects a configured branch ('DPDK_ABI_REF_VERSION')
> as a reference for ABI check.
>
> This patch enables selecting different repository to close for reference
> using 'DPDK_ABI_REF_SRC' environment variable.
>
> It is possible to put these variables to 'devel.config' config file, or
> provide via command line, like:
> `
>  DPDK_ABI_REF_SRC=~/dpdk-stable/   \

DPDK_ABI_REF_SRC could be passed as a remote repository.
This should remove the need for any "git remote" configuration.

$ DPDK_ABI_REF_SRC=https://dpdk.org/git/dpdk-stable
DPDK_ABI_REF_VERSION=v22.11.1 ./devtools/test-meson-builds.sh


diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 406bf4e184..48f4e52df3 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -18,8 +18,8 @@ srcdir=$(dirname $(readlink -f $0))/..
 #
 # - DPDK_MESON_OPTIONS
 #
-# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_DIR
+# - DPDK_ABI_REF_SRC
 # - DPDK_ABI_REF_VERSION
 #
 # - DPDK_BUILD_TEST_EXAMPLES
@@ -186,10 +186,14 @@ build () # <directory> <target cc | cross file>
<ABI check> [meson options]
        if [ -n "$DPDK_ABI_REF_VERSION" -a "$abicheck" = ABI ] ; then
                abirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION
                if [ ! -d $abirefdir/$targetdir ]; then
-                       abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
                        # clone current sources
                        if [ ! -d $abirefdir/src ]; then
-                               git clone --local --no-hardlinks \
+                               abirefsrc=${DPDK_ABI_REF_SRC:-$srcdir}
+                               abirefcloneopts=
+                               if [ -d $abirefsrc ]; then
+                                       abirefcloneopts="--local --no-hardlinks"
+                               fi
+                               git clone $abirefcloneopts \
                                        --single-branch \
                                        -b $DPDK_ABI_REF_VERSION \
                                        $abirefsrc $abirefdir/src


>  DPDK_ABI_REF_VERSION=v22.11.1     \
>  DPDK_ABI_REF_DIR=/tmp/dpdk-abiref \
>  ./devtools/test-meson-builds.sh
> `
>
> When 'DPDK_ABI_REF_SRC' is not defined, script behaves as it did
> previously.
>
> Other alternative to using 'DPDK_ABI_REF_SRC' variable is adding that
> other repo as a new 'remote' to the exiting git repository.



-- 
David Marchand

Reply via email to