I am currently in the process of evaluating automateid as a
replacement for cfengine. A significant number of our cfengine rules
are of the form
copy:
any::
/path/to/sourcedir dest=/etc/otherdir recurse=inf
The basic idea is that it copies all files in /path/to/sourcedir to /
etc/otherdir. It seems like the automateit analog is
cp("/path/to/sourcedir", "/etc/otherdir")
However, when this runs, what I get is
/etc/otherdir/sourcedir/file1
/etc/otherdir/sourcedir/file2
/etc/otherdir/file1
/etc/otherdir/file2
In other words, it is copying the sourcedir directory (and everything
under it), and then copying each of the files in the sourcedir
directory.
I worked around it by putting a trailing . on the source.
cp("/path/to/sourcedir/.", "/etc/otherdir")
The former behavior seems like a bug to me. It should either copy only
the files in sourcedir, or make a copy of sourcedir, but shouldn't be
doing both.