You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#!/bin/bash
set -x
# 解压文件包函数 stage_name=$1 distfile_mask=$2
echo -ne "\033]0;${stage_name} stage\007" echo " * Cleaning and unpacking ${stage_name}"
if [ -d "${SHELLROOT}/tempDIR" ] then rm -rf ${SHELLROOT}/tempDIR/* else echo -e "\n!!! 错误, ${SHELLROOT}/tempDIR/目录不存在,无法清空此目录\n" fi
if echo $distfile_mask | grep -q '\.tgz$' then tar -xzf ${SHELLROOT}/distfiles/$distfile_mask -C ${SHELLROOT}/tempDIR
elif echo $distfile_mask | grep -q '\.tar\.gz$' then tar -xzf ${SHELLROOT}/distfiles/$distfile_mask -C ${SHELLROOT}/tempDIR
elif echo $distfile_mask | grep -q '\.tar\.bz2$' then tar -xjf ${SHELLROOT}/distfiles/$distfile_mask -C ${SHELLROOT}/tempDIR
elif echo $distfile_mask | grep -q '\.tar\.xz$' then tar --xz -xf ${SHELLROOT}/distfiles/$distfile_mask -C ${SHELLROOT}/tempDIR
elif echo $distfile_mask | grep -q '\.zip$' then unzip -d ${SHELLROOT}/tempDIR ${SHELLROOT}/distfiles/$distfile_mask fi
echo " * Compiling ${stage_name}" sleep 2
|