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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=62fb1c5e631516cbaf8d5a3578e3b68d19379134

commit 62fb1c5e631516cbaf8d5a3578e3b68d19379134
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Jun 2 05:43:24 2020 +0200

    dpkg-realpath: Add support for --root and --instdir options
---
 debian/changelog         |  1 +
 man/dpkg-realpath.pod    | 13 ++++++++++++-
 scripts/dpkg-realpath.sh | 16 ++++++++++++++--
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 120f3b23a..e6df5a20d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,7 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
     relative to the dpkg root directory.
   * dpkg-realpath: Add support for DPKG_ROOT.
     Thanks to Helmut Grohne <[email protected]>.
+  * dpkg-realpath: Add support for --root and --instdir options.
   * Portability:
     - libdpkg: When using uselocale(), include <xlocale.h> for locale_t if
       the header is available. Needed on BSDs.
diff --git a/man/dpkg-realpath.pod b/man/dpkg-realpath.pod
index 4ee3e6745..f48ce1279 100644
--- a/man/dpkg-realpath.pod
+++ b/man/dpkg-realpath.pod
@@ -33,6 +33,16 @@ B<dpkg-realpath> is a tool to resolve a pathname.
 
 =over
 
+=item B<--instdir> I<directory>
+
+Set the installation directory, which refers to the directory where
+packages get installed. Defaults to «I</>».
+
+=item B<--root> I<directory>
+
+Set the root directory to B<directory>, which sets the installation
+directory to «I<directory>».
+
 =item B<-?>, B<--help>
 
 Show the usage message and exit.
@@ -49,7 +59,8 @@ Show the version and exit.
 
 =item B<DPKG_ROOT>
 
-If set, it will be used as the filesystem root directory.
+If set and the B<--instdir> or B<--root> options have not been
+specified, it will be used as the filesystem root directory.
 
 =item B<DPKG_COLORS>
 
diff --git a/scripts/dpkg-realpath.sh b/scripts/dpkg-realpath.sh
index f2747c8fe..0f7231488 100755
--- a/scripts/dpkg-realpath.sh
+++ b/scripts/dpkg-realpath.sh
@@ -41,8 +41,10 @@ show_usage()
 Usage: $PROGNAME [<option>...] <pathname>
 
 Options:
-       --version      Show the version.
-  -?,  --help         Show this help message.
+       --instdir <directory>    set the root directory.
+       --root <directory>       set the root directory.
+       --version                show the version.
+  -?,  --help                   show this help message.
 END
 }
 
@@ -119,6 +121,16 @@ setup_colors
 
 while [ $# -ne 0 ]; do
   case "$1" in
+  --instdir|--root)
+    shift
+    DPKG_ROOT=$1
+    ;;
+  --instdir=*)
+    DPKG_ROOT="${1#--instdir=}"
+    ;;
+  --root=*)
+    DPKG_ROOT="${1#--root=}"
+    ;;
   --version)
     show_version
     exit 0

-- 
Dpkg.Org's dpkg

Reply via email to