6 Star 1 Fork 6

BigSkySea/mkbshare

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getdate.sh 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
BigSkySea 提交于 2021-04-15 08:37 . update
cd obs_pkg_rpms
git fetch --all
git reset --hard origin
obspkgrpmsdir=`pwd`
sourcedir="/srv/cache/obs/tar_scm/repo/next/"
branch=$1
if [[ "$branch" == "master" ]];then
cd $sourcedir/openEuler
else
cd $sourcedir/$branch
fi
pkglist=`ls`
for pkg in $pkglist
do
cd $pkg
day=`git show -s --format=%ad | awk '{print $3}'`
year=`git show -s --format=%ad | awk '{print $5}'`
month=`git show -s --format=%ad | awk '{print $2}'`
timestr=`git show -s --format=%ad | awk '{print $4}'`
if [[ "$month" == "Jan" ]];then
month="01"
elif [[ "$month" == "Feb" ]];then
month="02"
elif [[ "$month" == "Mar" ]];then
month="03"
elif [[ "$month" == "Apr" ]];then
month="04"
elif [[ "$month" == "May" ]];then
month="05"
elif [[ "$month" == "Jun" ]];then
month="06"
elif [[ "$month" == "Jul" ]];then
month="07"
elif [[ "$month" == "Aug" ]];then
month="08"
elif [[ "$month" == "Sep" ]];then
month="09"
elif [[ "$month" == "Oct" ]];then
month="10"
elif [[ "$month" == "Nov" ]];then
month="11"
elif [[ "$month" == "Dec" ]];then
month="12"
fi
if [ ${day} -lt 10 ];then
day="0${day}"
fi
datestr="${year}${month}${day} ${timestr//:/-}"
echo $datestr > ${obspkgrpmsdir}/${branch}/${pkg}
if [[ "$branch" == "master" ]];then
cd $sourcedir/openEuler
else
cd $sourcedir/$branch
fi
done
cd ${obspkgrpmsdir}
git pull
git add *
git commit -m "update date for package"
git push
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/BigSkySea/mkbshare.git
git@gitee.com:BigSkySea/mkbshare.git
BigSkySea
mkbshare
mkbshare
master

搜索帮助