pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Thu May 21 18:48:43 UTC 2020

Modified Files:
        pkgsrc/mk/pkgformat/pkg: metadata.mk
        pkgsrc/regress/infra-unittests: pkgformat-pkg-metadata.sh

Log Message:
mk/pkgformat/metadata.mk: fix relative paths in PATCHDIR and FILESDIR

Before, relative paths had been stored as-is.  This affected those
packages that defined PATCHDIR or FILESDIR as relative directory instead
of prefixing it with ${.CURDIR}.

Since there are already several other paths that are interpreted relative
to the package directory (CONFLICTS, DEPENDS), allow PATCHDIR and
FILESDIR to be specified as relative paths, too.  This makes the package
Makefiles a bit shorter.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 pkgsrc/mk/pkgformat/pkg/metadata.mk
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/pkgformat/pkg/metadata.mk
diff -u pkgsrc/mk/pkgformat/pkg/metadata.mk:1.24 pkgsrc/mk/pkgformat/pkg/metadata.mk:1.25
--- pkgsrc/mk/pkgformat/pkg/metadata.mk:1.24    Fri May 15 22:13:39 2020
+++ pkgsrc/mk/pkgformat/pkg/metadata.mk Thu May 21 18:48:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.24 2020/05/15 22:13:39 maya Exp $
+# $NetBSD: metadata.mk,v 1.25 2020/05/21 18:48:43 rillig Exp $
 
 ######################################################################
 ### The targets below are all PRIVATE.
@@ -175,7 +175,7 @@ ${_BUILD_VERSION_FILE}:
        ${RUN}${RM} -f ${.TARGET}.tmp
        ${RUN}                                                          \
        exec 1>>${.TARGET}.tmp;                                         \
-       for f in ${.CURDIR}/Makefile ${FILESDIR}/* ${PKGDIR}/*; do      \
+       for f in ${.CURDIR}/Makefile ${FILESDIR:tA}/* ${PKGDIR:tA}/*; do \
                ${TEST} ! -f "$$f" || ${ECHO} "$$f";                    \
        done
        ${RUN}                                                          \
@@ -185,7 +185,7 @@ ${_BUILD_VERSION_FILE}:
        ${AWK} 'NF == 4 && $$3 == "=" { gsub("[()]", "", $$2); print $$2 }' | \
        while read file; do                                             \
                ${TEST} ! -f "${PATCHDIR}/$$file" ||                    \
-                       ${ECHO} "${PATCHDIR}/$$file";                   \
+                       ${ECHO} "${PATCHDIR:tA}/$$file";                \
        done
        ${RUN}                                                          \
        exec 1>>${.TARGET}.tmp;                                         \
@@ -193,7 +193,7 @@ ${_BUILD_VERSION_FILE}:
        cd ${PATCHDIR}; for f in *; do                                  \
                case "$$f" in                                           \
                "*"|*.orig|*.rej|*~)    ;;                              \
-               patch-*)                ${ECHO} "${PATCHDIR}/$$f" ;;    \
+               patch-*)                ${ECHO} "${PATCHDIR:tA}/$$f" ;; \
                esac;                                                   \
        done
        ${RUN}                                                          \

Index: pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh
diff -u pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh:1.1 pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh:1.2
--- pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh:1.1        Tue May 19 06:09:53 2020
+++ pkgsrc/regress/infra-unittests/pkgformat-pkg-metadata.sh    Thu May 21 18:48:43 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: pkgformat-pkg-metadata.sh,v 1.1 2020/05/19 06:09:53 rillig Exp $
+# $NetBSD: pkgformat-pkg-metadata.sh,v 1.2 2020/05/21 18:48:43 rillig Exp $
 #
 # Demonstrates how mk/pkgformat/pkg/metadata.mk creates the versioning
 # information in +BUILD_VERSION.
@@ -74,7 +74,8 @@ fi
 
 if test_case_begin 'relative paths'; then
 
-       # As of May 2020, the +BUILD_VERSION contains corrupt data.
+       # Up to 2020-05-21, relative paths were stored wrong in the
+       # +BUILD_VERSION file.
 
        wrkdir="$PWD"
        pkgdir="$mocked_pkgsrcdir/category/package"
@@ -104,13 +105,10 @@ if test_case_begin 'relative paths'; the
 
        assert_that "$exitcode" --equals '0'
        assert_that "$tmpdir/output" --file-is-empty
-       # FIXME: All files listed here are supposed to be relative to
-       # the pkgsrc root directory.
        assert_that "$wrkdir/.pkgdb/+BUILD_VERSION" --file-is-lines \
-               "./Makefile:    $cvsid" \
                "category/package/Makefile:     $cvsid" \
-               "files/README:  $cvsid" \
-               "patches/patch-aa:      $cvsid"
+               "category/package/files/README: $cvsid" \
+               "category/package/patches/patch-aa:     $cvsid"
 
        test_case_end
 fi



Home | Main Index | Thread Index | Old Index