[英]Install rpm and put file into symbolic link directory
I have made an rpm
package that install a program and one of the folders it needs to copy a file to is a symbolic link
since the program the symbolic link is pointing to may change over time so it is easier to maintain the building of the rpm
package by copying the file to the symbolic link
rather then to the hard coded path. 我已经制作了一个
rpm
软件包,用于安装程序,并且它需要将文件复制到其中的一个文件夹是一个symbolic link
因为该符号链接指向的程序可能会随时间变化,因此更易于维护rpm
的构建通过将文件复制到symbolic link
而不是硬编码路径来打包。 However, I get the error 但是,我得到了错误
cp: cannot overwrite directory with non-directory
when the rpm
package tried to copy the file to the symbolic link folder. rpm
软件包尝试将文件复制到符号链接文件夹时。 Why does this happen, and is there anything I can do to work around this error other then making the files to be copied to the folder the symbolic link
points to? 为什么会发生这种情况,并且除了将文件复制到
symbolic link
指向的文件夹之外,还可以采取其他措施来解决此错误吗? I am running RHEL 6.6
as of note. 注意,我正在运行
RHEL 6.6
。
That error generally means something like you having told cp to treat the target as a normal file (the -T
argument). 该错误通常表示您已经告诉cp将目标视为普通文件(
-T
参数)。
$ ls -lR
.:
total 16
drwxr-xr-x 2 root root 4096 Feb 6 09:46 dir
-rw-r--r-- 1 root root 0 Feb 6 09:45 file
lrwxrwxrwx 1 root root 3 Feb 6 09:45 symdir -> dir
./dir:
total 0
$ cp -T file symdir
cp: cannot overwrite non-directory `symdir' with non-directory
$ ls -lR
.:
total 16
drwxr-xr-x 2 root root 4096 Feb 6 09:46 dir
-rw-r--r-- 1 root root 0 Feb 6 09:45 file
lrwxrwxrwx 1 root root 3 Feb 6 09:45 symdir -> dir
./dir:
total 0
$ cp file symdir
$ ls -lR
.:
total 16
drwxr-xr-x 2 root root 4096 Feb 6 09:46 dir
-rw-r--r-- 1 root root 0 Feb 6 09:45 file
lrwxrwxrwx 1 root root 3 Feb 6 09:45 symdir -> dir
./dir:
total 4
-rw-r--r-- 1 root root 0 Feb 6 09:46 file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.