aports/main/perl-sys-hostname-long/hostname-f.patch
Simon Frankenberger 78c2cfd070 main/perl-sys-hostname-long: Use hostname -f instead of -fqdn
The hostname bundled with busybox doesn't know the -fqdn switch. The
same functionality can be reached using the -f switch.
2019-05-27 06:25:27 +00:00

26 lines
699 B
Diff

When running with busybox "hostname", there is no "--fqdn" switch.
The same functionality is provided using the "-f" switch.
--- a/lib/Sys/Hostname/Long.pm
+++ b/lib/Sys/Hostname/Long.pm
@@ -69,7 +69,7 @@
},
'exec_hostname_fqdn' => {
- 'title' => 'Execute "hostname --fqdn"',
+ 'title' => 'Execute "hostname -f"',
'description' => '',
'exec' => sub {
# Skip for Solaris, and only run as non-root
@@ -77,9 +77,9 @@
my $tmp;
if ( $^O ne 'darwin' ) {
if ($< == 0) {
- $tmp = `su nobody -c "hostname --fqdn"`;
+ $tmp = `su nobody -c "hostname -f"`;
} else {
- $tmp = `hostname --fqdn`;
+ $tmp = `hostname -f`;
}
$tmp =~ tr/\0\r\n//d;
}