提交 2a36659e 编写于 作者: P plum-lihui

[Modify the use of sudo commands]

上级 ead54e4a
......@@ -19,18 +19,23 @@ echo "compile_dir: ${compile_dir}"
echo "pkg_dir: ${pkg_dir}"
echo "spec_file: ${spec_file}"
csudo=""
if command -v sudo > /dev/null; then
csudo="sudo"
fi
if [ -d ${pkg_dir} ]; then
rm -rf ${pkg_dir}
${csudo} rm -rf ${pkg_dir}
fi
mkdir -p ${pkg_dir}
${csudo} mkdir -p ${pkg_dir}
cd ${pkg_dir}
mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
${csudo} mkdir -p BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
rpmbuild --define="_version ${tdengine_ver}" --define="_topdir ${pkg_dir}" --define="_compiledir ${compile_dir}" -bb ${spec_file}
${csudo} rpmbuild --define="_version ${tdengine_ver}" --define="_topdir ${pkg_dir}" --define="_compiledir ${compile_dir}" -bb ${spec_file}
# copy rpm package to output_dir, then clean temp dir
#echo "rmpbuild end, cur_dir: $(pwd) "
cp -rf RPMS/* ${output_dir}
${csudo} cp -rf RPMS/* ${output_dir}
cd ..
rm -rf ${pkg_dir}
${csudo} rm -rf ${pkg_dir}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册