1587 / 1587.github.com

0 stars 0 forks source link

sed #213

Open 1587 opened 7 years ago

1587 commented 7 years ago

!/bin/bash

DPUT_SERVER=mini-buildd-ubuntu-pc if [ $# -lt 2 ];then echo "usage:" echo " $0 path-to-source-dir NOS_VERSION" exit 1 fi TOP_DIR=pwd NOS_VERSION=$2 WORK_DIR=$1 if [ ! -f ${WORK_DIR}/debian/changelog ];then echo "cant find $1/debian/changelog" exit 2 fi flag=cat ${WORK_DIR}/debian/changelog | grep "osc recompile it" if [ "X${flag}" != "X" ];then echo "please mod ${WORK_DIR}/debian/changelog" exit 3 fi cd ${WORK_DIR} TAR_DIR=pwd/../ LAST_LOG=head -1 debian/changelog PKGNAME=echo "${LAST_LOG}" | awk '{print $1}' VERSION=echo "${LAST_LOG}" | awk '{print $2}' | awk -F"[()]" -v NOS_VERSION="${NOS_VERSION}" '{print $2 "~nos+" NOS_VERSION }' DISTRIBUTION=echo "${LAST_LOG}" | awk '{print $3}' URGENCY=echo "${LAST_LOG}" | awk '{print $4}' CHANGES=${PKGNAME}_${VERSION}_source.changes DATE=date --rfc-2822 LOG_INFO="

cd ${WORK_DIR} dpkg-buildpackage -rfakeroot -S -d -sa -us -uc cd ${TAR_DIR} dput -U -u ${DPUT_SERVER} ${CHANGES} cd ${TOP_DIR}