mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
tmpfiles: copy/link /usr/share/factory/ files when the source argument is omitted
This commit is contained in:
parent
351e57652a
commit
2f3b873a49
@ -191,7 +191,11 @@ L /tmp/foobar - - - - /dev/null</programlisting>
|
|||||||
symlink is to be created it
|
symlink is to be created it
|
||||||
will be removed and be
|
will be removed and be
|
||||||
replaced by the
|
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
|
destination directory already
|
||||||
exists, instead the entire
|
exists, instead the entire
|
||||||
copy operation is
|
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>
|
||||||
|
@ -1249,10 +1249,10 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
|||||||
|
|
||||||
case CREATE_SYMLINK:
|
case CREATE_SYMLINK:
|
||||||
if (!i->argument) {
|
if (!i->argument) {
|
||||||
log_error("[%s:%u] Symlink file requires argument.", fname, line);
|
i->argument = strappend("/usr/share/factory", i->path);
|
||||||
return -EBADMSG;
|
if (!i->argument)
|
||||||
|
return log_oom();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WRITE_FILE:
|
case WRITE_FILE:
|
||||||
@ -1264,8 +1264,9 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
|||||||
|
|
||||||
case COPY_FILES:
|
case COPY_FILES:
|
||||||
if (!i->argument) {
|
if (!i->argument) {
|
||||||
log_error("[%s:%u] Copy files requires argument.", fname, line);
|
i->argument = strappend("/usr/share/factory", i->path);
|
||||||
return -EBADMSG;
|
if (!i->argument)
|
||||||
|
return log_oom();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!path_is_absolute(i->argument)) {
|
if (!path_is_absolute(i->argument)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user