背景
如题;
代码
python do_pycustomfunc() {
import time
print time.strftime('%Y%m%d', time.gmtime())
}
addtask pycustomfunc after do_fetch before do_install
do_customfunc() {
echo "hello" > /tmp/custom.log
}
addtask customfunc after do_fetch before do_install
python 代码注意,如果使用vi编辑器,注意TAB使用4个空格来代替,减少当需要合并代码的错误;
vi ~/.vimrc
# vi ~/.vimrc
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
去使能一个任务
do_build[noexec] = "1"