chiark / gitweb /
systemctl: do not show SourcePath when FragmentPath cannot be found
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 1 Dec 2013 03:29:33 +0000 (22:29 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 1 Dec 2013 03:36:08 +0000 (22:36 -0500)
Those files can be in a completely deferent format and also
arbitrarily long, and usually contain information about other
stuff. If we ever add SourceLine= or SourceLines= in addition
to SourcePath=, and can show the relevant information only, this
commit can be reverted.

man/systemctl.xml
src/systemctl/systemctl.c

index 5a15e5ca05042031b7a8f37abd8c65f7064a9968..a84a98338c5d9aac9985306014e3e31a9ddf6665 100644 (file)
@@ -737,10 +737,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
           <term><command>cat <replaceable>NAME</replaceable>...</command></term>
 
           <listitem>
-            <para>Show backing files of one or more units.
-            Prints the fragment, drop-ins, and source (sysvinit compat)
-            of units. Each file is preceded by a comment which includes the
-            file name.</para>
+            <para>Show backing files of one or more units. Prints the
+            "fragment" and "drop-ins" (source files) of units. Each
+            file is preceded by a comment which includes the file
+            name.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
index f7b2fb40190e61bc0ee73c3f36723e2d463a1450..5dcefd7f18590bfd56fcc6869c515fee49507f20 100644 (file)
@@ -3718,23 +3718,6 @@ static int cat(sd_bus *bus, char **args) {
                         continue;
                 }
 
-                if (isempty(fragment_path)) {
-                        free(fragment_path);
-                        fragment_path = NULL;
-
-                        if (sd_bus_get_property_string(
-                                        bus,
-                                        "org.freedesktop.systemd1",
-                                        unit,
-                                        "org.freedesktop.systemd1.Unit",
-                                        "SourcePath",
-                                        &error,
-                                        &fragment_path) < 0) {
-                                log_warning("Failed to get SourcePath: %s", bus_error_message(&error, r));
-                                continue;
-                        }
-                }
-
                 r = sd_bus_get_property_strv(
                                 bus,
                                 "org.freedesktop.systemd1",