GNU bug report logs - #22091
[PATCH 1/2] * lisp/env.el: Add (whereis-command)

Previous Next

Package: emacs;

Reported by: lu4nx <lx <at> shellcodes.org>

Date: Fri, 4 Dec 2015 07:27:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: lu4nx <lx <at> shellcodes.org>
To: bug-gnu-emacs <at> gnu.org
Cc: lu4nx <lx <at> shellcodes.org>
Subject: [PATCH 2/2] * lisp/net/net-utils.el: (ifconfig) function support `ip`
 command.
Date: Fri,  4 Dec 2015 14:25:13 +0800
In some Linux distribution default not found `ifconfig` command, such as CentOS7.

- `ifconfig-program` and `ifconfig-program-options` add support `ip` command.
---
 lisp/net/net-utils.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index c6d40b6..74e832a 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -87,7 +87,9 @@ These options can be used to limit how many ICMP packets are emitted."
 (defcustom ifconfig-program
   (if (eq system-type 'windows-nt)
       "ipconfig"
-    "ifconfig")
+    (if (whereis-command "ifconfig")
+        "ifconfig"
+      "ip"))
   "Program to print network configuration information."
   :group 'net-utils
   :type  'string)
@@ -97,8 +99,10 @@ These options can be used to limit how many ICMP packets are emitted."
 
 (defcustom ifconfig-program-options
   (list
-   (if (eq system-type 'windows-nt)
-       "/all" "-a"))
+   (cond ((eq system-type 'windows-nt) "/all")
+         ((and (whereis-command "ip")
+               (not (whereis-command "ifconfig"))) "addr")
+         (t "-a")))
   "Options for the ifconfig program."
   :group 'net-utils
   :type  '(repeat string))
-- 
2.5.0





This bug report was last modified 9 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.