Skip to content

Commit

Permalink
lddtree.*: Disable auto-root feature by default
Browse files Browse the repository at this point in the history
It's counter-intuitive and doesn't play well with other programs that
expect path arguments to work normally.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
  • Loading branch information
chewi committed Aug 27, 2024
1 parent fe200cc commit 9994153
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions lddtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,12 +851,19 @@ def GetParser() -> argparse.ArgumentParser:
action=_NormalizePathAction,
help="Search for all files/dependencies in ROOT",
)
group.add_argument(
"--auto-root",
action="store_true",
help="Automatically prefix input ELFs with ROOT",
)
group.add_argument(
"--no-auto-root",
dest="auto_root",
action="store_false",
default=True,
help="Do not automatically prefix input ELFs with ROOT",
help=argparse.SUPPRESS,
)
group.set_defaults(
auto_root=False
)
group.add_argument(
"-C",
Expand Down
5 changes: 3 additions & 2 deletions lddtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ usage() {
-a Show all duplicated dependencies
-x Run with debugging
-R <root> Use this ROOT filesystem tree
--no-auto-root Do not automatically prefix input ELFs with ROOT
--auto-root Automatically prefix input ELFs with ROOT
-l Display output in a flat format
-h Show this help output
-V Show version information
Expand Down Expand Up @@ -226,7 +226,7 @@ if [[ $1 != "/../..source.lddtree" ]] ; then
SHOW_ALL=false
SET_X=false
LIST=false
AUTO_ROOT=true
AUTO_ROOT=false
LDD_MODE=false

[[ ${argv0} = *ldd ]] && LDD_MODE=true
Expand All @@ -241,6 +241,7 @@ while getopts haxVR:l-: OPT ; do
l) LIST=true LDD_MODE=false;;
-) # Long opts ftw.
case ${OPTARG} in
auto-root) AUTO_ROOT=true;;
no-auto-root) AUTO_ROOT=false;;
*) usage 1;;
esac
Expand Down

0 comments on commit 9994153

Please sign in to comment.