fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
21 stars 23 forks source link

deb rpm: quote target files #615

Closed kenhys closed 4 months ago

kenhys commented 5 months ago

There was a case that missing quote about file name causes migration failures.

Usually such files should not be generated, but need to care it in practical use case.

daipom commented 5 months ago

Thanks!

Are there file names that are not covered by this?

mv -f '/etc/<%= compat_package_dir %>/$d' '/etc/<%= package_dir %>/'
kenhys commented 4 months ago

mv -f '/etc/<%= compat_package_dir %>/$d' '/etc/<%= package_dir %>/'

It is not covered because of combination with for d in ... doesn't work as expected.

daipom commented 4 months ago

Oh, sorry. As you say, we can't use ' here. What about "?

mv -f "/etc/<%= compat_package_dir %>/$d" '/etc/<%= package_dir %>/'
kenhys commented 4 months ago

As #613 was merged, rebased with master.

kenhys commented 4 months ago

This looks good, but is there any reason you didn't use for d in $(ls /etc/<%= compat_package_dir %>)?

I've just overlooked that for d in "$(ls /etc/<%= compat_package_dir %>/)" would work.

daipom commented 4 months ago

We can omit more paths with for d in "$(ls /etc/<%= compat_package_dir %>/)", but I think the current codes are fine. Both would be fine.

kenhys commented 4 months ago

Thank you for reviewing!