chiark / gitweb /
tmpfiles: copy/link /usr/share/factory/ files when the source argument is omitted
authorKay Sievers <kay@vrfy.org>
Fri, 20 Jun 2014 13:57:43 +0000 (15:57 +0200)
committerKay Sievers <kay@vrfy.org>
Fri, 20 Jun 2014 13:57:43 +0000 (15:57 +0200)
man/tmpfiles.d.xml
src/tmpfiles/tmpfiles.c

index f3cc2ea50cb56bc096a5067e4728ebe50a3b055b..5e0b5383412d7ef26b3e7be68f7ba62222d65096 100644 (file)
@@ -191,7 +191,11 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
                                         symlink is to be created it
                                         will be removed and be
                                         replaced by the
                                         symlink is to be created it
                                         will be removed and be
                                         replaced by the
-                                        symlink.</para></listitem>
+                                        symlink. If the argument is omitted,
+                                        symlinks to files with the same name
+                                        residing in the directory
+                                        <filename>/usr/share/factory/</filename>
+                                        are created.</para></listitem>
                                 </varlistentry>
 
                                 <varlistentry>
                                 </varlistentry>
 
                                 <varlistentry>
@@ -235,7 +239,10 @@ L    /tmp/foobar -    -    -    -   /dev/null</programlisting>
                                         destination directory already
                                         exists, instead the entire
                                         copy operation is
                                         destination directory already
                                         exists, instead the entire
                                         copy operation is
-                                        skipped.</para></listitem>
+                                        skipped. If the argument is omitted,
+                                        files from the source directory
+                                        <filename>/usr/share/factory/</filename>
+                                        with the same name are copied.</para></listitem>
                                 </varlistentry>
 
                                 <varlistentry>
                                 </varlistentry>
 
                                 <varlistentry>
index cbad78aea5dd145c097eede3569396bbbfb21a95..68cfa55ce9cee09e96985c76ac2390cfbe5140f7 100644 (file)
@@ -1249,10 +1249,10 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
 
         case CREATE_SYMLINK:
                 if (!i->argument) {
 
         case CREATE_SYMLINK:
                 if (!i->argument) {
-                        log_error("[%s:%u] Symlink file requires argument.", fname, line);
-                        return -EBADMSG;
+                        i->argument = strappend("/usr/share/factory", i->path);
+                        if (!i->argument)
+                                return log_oom();
                 }
                 }
-
                 break;
 
         case WRITE_FILE:
                 break;
 
         case WRITE_FILE:
@@ -1264,8 +1264,9 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
 
         case COPY_FILES:
                 if (!i->argument) {
 
         case COPY_FILES:
                 if (!i->argument) {
-                        log_error("[%s:%u] Copy files requires argument.", fname, line);
-                        return -EBADMSG;
+                        i->argument = strappend("/usr/share/factory", i->path);
+                        if (!i->argument)
+                                return log_oom();
                 }
 
                 if (!path_is_absolute(i->argument)) {
                 }
 
                 if (!path_is_absolute(i->argument)) {