From 911c74fda6a373d65b4d2c3307ea74722f9f07f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 6 May 2026 02:55:11 -0300 Subject: [PATCH] fix: use runtime require for xCAT::DHCP::Backend in dhcpop The xCAT-server build-readme script runs every tool in share/xcat/tools/ with --help during RPM packaging. At build time perl-xCAT is not installed, so the compile-time 'use xCAT::DHCP::Backend' aborts before --help can run. Switch to runtime require inside the remove-operation branch where the module is actually needed. --- xCAT-server/share/xcat/tools/dhcpop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/dhcpop b/xCAT-server/share/xcat/tools/dhcpop index 1af7cf3fa..814123447 100755 --- a/xCAT-server/share/xcat/tools/dhcpop +++ b/xCAT-server/share/xcat/tools/dhcpop @@ -11,7 +11,6 @@ use lib "$::XCATROOT/lib/perl"; use Getopt::Long; use Fcntl ':flock'; -use xCAT::DHCP::Backend; sub usage{ print "Usage: dhcphelper -h \n"; @@ -39,6 +38,7 @@ if($help){ &usage; exit 0; }elsif($rmop){ + require xCAT::DHCP::Backend; my $backend = xCAT::DHCP::Backend->new_backend(); if (ref($backend) ne 'HASH' && $backend->name eq 'kea') { if ($mac && $mac !~ /:/) {