Skip to content

Commit 3bd937b

Browse files
committed
xdrgen: Make the xdrgen script location-independent
The @pythondir@ placeholder is meant for build-time substitution, such as with autoconf. autoconf is not used in the kernel. Let's replace that mechanism with one that better enables the xdrgen script to be run from any directory. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 75a9b40 commit 3bd937b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tools/net/sunrpc/xdrgen/xdrgen

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ __license__ = "GPL-2.0 only"
1010
__version__ = "0.2"
1111

1212
import sys
13+
from pathlib import Path
1314
import argparse
1415

16+
_XDRGEN_DIR = Path(__file__).resolve().parent
17+
if str(_XDRGEN_DIR) not in sys.path:
18+
sys.path.insert(0, str(_XDRGEN_DIR))
19+
1520
from subcmds import definitions
1621
from subcmds import declarations
1722
from subcmds import lint

0 commit comments

Comments
 (0)