This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=608131f29c191feeaa6e460f3ab2175bae971d79

commit 608131f29c191feeaa6e460f3ab2175bae971d79
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Sep 26 02:43:01 2023 +0200

    test: Add new DPKG_CWD m4 macro
    
    This new macro takes care of getting the realpath for the current
    working directory in a portable way, via perl.
---
 src/at/local.at    | 5 +++++
 src/at/realpath.at | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/at/local.at b/src/at/local.at
index c3c87763f..4db73fb9f 100644
--- a/src/at/local.at
+++ b/src/at/local.at
@@ -42,6 +42,11 @@ m4_define([DPKG_SEQ], [dnl
   m4_for([i], [1], [$1], [], [i ])dnl
 ])
 
+# DPKG_CWD()
+m4_define([DPKG_CWD], [dnl
+  $PERL -MCwd=realpath,getcwd -E 'say realpath(getcwd())'dnl
+])
+
 # DPKG_FILE_SIZE($filename)
 m4_define([DPKG_FILE_SIZE], [
   $PERL -E 'say -s shift' "$1" dnl
diff --git a/src/at/realpath.at b/src/at/realpath.at
index 2919c3eb0..a99d7b8be 100644
--- a/src/at/realpath.at
+++ b/src/at/realpath.at
@@ -18,7 +18,7 @@ ln -sfT /aa/bb/cc/file zz/yy/xx/symlink-abs
 AT_DATA([usr/bin/a-shell], [])
 ln -sfT /usr/bin/a-shell usr/bin/sh
 
-tmpdir="$(pwd)"
+tmpdir="$(DPKG_CWD)"
 export DPKG_ROOT=
 
 # Relative paths

-- 
Dpkg.Org's dpkg

Reply via email to