]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Remove the runtime dependency on lsb_release 11365/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 7 Oct 2016 04:51:41 +0000 (14:51 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 7 Oct 2016 04:54:06 +0000 (14:54 +1000)
With modern releases we should be able to make do with the call to
os_release_parse only which uses /etc/os-release which should be available on
most (all?) releases we currently support. this then allows us to remove the
runtime dependency which pulls in several other packages and would be nice to
avoid.

Fixes: http://tracker.ceph.com/issues/17425
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
ceph.spec.in
debian/control
src/common/util.cc

index b1391fa01e9903fbf01e3d7a91bdbd127ffa611b..4ef3fddbf656b09abf428bee20cd1ccee2f67a9c 100644 (file)
@@ -230,12 +230,8 @@ Requires:      cryptsetup
 Requires:      findutils
 Requires:      which
 %if 0%{?suse_version}
-Requires:      lsb-release
 Recommends:    ntp-daemon
 %endif
-%if 0%{?fedora} || 0%{?rhel}
-Requires:      redhat-lsb-core
-%endif
 %if 0%{with xio}
 Requires:      libxio
 %endif
index bc9f19aecb1deeb1e7ae5b484936447a67b75b74..3943e097defb6d1c701e1123e861d0ec45aa3b44 100644 (file)
@@ -89,7 +89,6 @@ Depends: binutils,
          gdisk,
          grep,
          logrotate,
-         lsb-release,
          ${python:Depends},
          xfsprogs,
          ${misc:Depends},
index 124b9b9c39e073a8c97ab510c3bdfa7b356a645d..ee4b84e87b517d82c50f42ccafbe4e4fe27f7dac 100644 (file)
@@ -150,33 +150,6 @@ static void file_values_parse(const map<string, string>& kvm, FILE *fp, map<stri
   }
 }
 
-static bool lsb_release_parse(map<string, string> *m, CephContext *cct)
-{
-  static const map<string, string> kvm = {
-      { "distro", "Distributor ID:" },
-      { "distro_description", "Description:" },
-      { "distro_codename", "Codename:", },
-      { "distro_version", "Release:" }
-  };
-
-  FILE *fp = popen("lsb_release -idrc", "r");
-  if (!fp) {
-    int ret = -errno;
-    lderr(cct) << "lsb_release_parse - failed to call lsb_release binary with error: " << cpp_strerror(ret) << dendl;
-    return false;
-  }
-
-  file_values_parse(kvm, fp, m, cct);
-
-  if (pclose(fp)) {
-    int ret = -errno;
-    lderr(cct) << "lsb_release_parse - pclose failed: " << cpp_strerror(ret) << dendl;
-    return false;
-  }
-
-  return true;
-}
-
 static bool os_release_parse(map<string, string> *m, CephContext *cct)
 {
   static const map<string, string> kvm = {
@@ -201,8 +174,8 @@ static bool os_release_parse(map<string, string> *m, CephContext *cct)
 
 static void distro_detect(map<string, string> *m, CephContext *cct)
 {
-  if (!lsb_release_parse(m, cct) && !os_release_parse(m, cct)) {
-    lderr(cct) << "distro_detect - lsb_release or /etc/os-release is required" << dendl;
+  if (!os_release_parse(m, cct)) {
+    lderr(cct) << "distro_detect - /etc/os-release is required" << dendl;
   }
 
   for (const char* rk: {"distro", "distro_version"}) {