X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-deb-build%2Fid-pbuild.sh;fp=id-deb-build%2Fid-pbuild.sh;h=0f3441e5c82607e3f76b13761cd299289fa577d2;hb=c30556622c5b983c4d1a9a3f3b65bf2d2bd746e1;hp=a8206a1068835c06e35d3273f62a5e6131482536;hpb=f93f2547e33dbf4216e110d2c2cc2fa2cf22bb3c;p=git-tools-moved-to-github.git diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh index a8206a1..0f3441e 100755 --- a/id-deb-build/id-pbuild.sh +++ b/id-deb-build/id-pbuild.sh @@ -13,7 +13,6 @@ Options: [--centos=distros] [--upload] [--concurrency=N] - [--product=X] EOF exit $1 } @@ -48,9 +47,6 @@ while test $# -gt 0; do --concurrency=*) concurrency=$optarg ;; - --product=*) - PRODUCT=$optarg - ;; -*) do_help=yes ;; @@ -82,14 +78,38 @@ if test ! -x $PBUILDROOT; then exit 1 fi -MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh -if test ! -x $MKDEBSRC; then - echo "$MKDEBSRC not found" - exit 1 +if test "$CENTOS_DIST"; then + RNAME=`rpm -q --specfile *.spec --queryformat "%{NAME};" | cut -d ";" -f1` + echo "RNAME=$RNAME" + if test "$NAME" -a "$NAME" != "$RNAME"; then + echo "NAME in IDMETA ($NAME) does not match RPM spec NAME ($RNAME)" + exit 1 + fi + PRODUCT=$RNAME fi - -if ! $upload; then - if $debian; then +if $debian; then + DNAME=`awk '/Source:/ {print $2}' debian/control` + if test "$NAME" -a "$NAME" != "$DNAME"; then + echo "NAME in IDMETA ($NAME) does not match debian/control ($DNAME)" + exit 1 + fi + PRODUCT=$DNAME + if ! $upload; then + MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh + if test ! -x $MKDEBSRC; then + echo "$MKDEBSRC not found" + exit 1 + fi + DCH=debian/changelog + if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then + rm -f $DCH + echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH + echo '' >>$DCH + echo ' * Upstream.' >>$DCH + echo '' >>$DCH + echo " -- `git config --get user.name` <`git config --get user.email`> `date -R`" >>$DCH + echo '' >>$DCH + fi if test "${SUDO_USER}"; then if test ! -d deb-src; then $MKDEBSRC @@ -104,9 +124,9 @@ if ! $upload; then fi $MKDEBSRC fi - else - mkdir -p deb-src fi +else + mkdir -p deb-src fi cd deb-src @@ -132,17 +152,7 @@ if $debian; then fi fi -if test -z "$PRODUCT"; then - PRODUCT=$NAME -fi -if test -z "$PRODUCT"; then - if $debian; then - PRODUCT=`echo *.dsc|sed 's/_.*//g'` - else - PRODUCT=`cd ..;rpm -q --specfile *.spec --queryformat "%{NAME};" | cut -d ";" -f1` - fi -fi -echo "Dsc $PKG . Product $PRODUCT" +echo "Product: $PRODUCT" echo "Ubuntu distros: $UBUNTU_DIST" echo "Debian distros: $DEBIAN_DIST" echo "Centos distros: $CENTOS_DIST"