RPM编译时遇到这个问题

xecuting(%build): /bin/sh -e /var/tmp/rpm-tmp.HDvAfF
+ umask 022
+ cd /tmp/csmp-build-TLlpXrJT/BUILD
+ cd csmp-2.0.3sp1
+ $'\r'
/var/tmp/rpm-tmp.HDvAfF: line 29: $'\r': command not found
error: Bad exit status from /var/tmp/rpm-tmp.HDvAfF (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.HDvAfF (%build)
make: *** [rpm] Error 1
make: Leaving directory `/root/rpms/xxx'

打开这个文件/var/tmp/rpm-tmp.HDvAfF时,会看到29号有个特殊的字符 ^M

这个其实是CLRF 没转成LF的问题, linux上用yum install dos2unix,修改相应的文件 即 dos2unix filename 即可

标签: shell, rpm

相关文章

添加新评论