[DRE-commits] [pkg-ruby-extras] 02/02: change helper script logic:

Antonio Terceiro terceiro at moszumanska.debian.org
Wed Mar 2 17:15:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch quick-start
in repository pkg-ruby-extras.

commit 2687d72a488c569350e0fe7571a95af5e8df073a
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Wed Mar 2 14:13:19 2016 -0300

    change helper script logic:
    
    - build: only builds
    - upload: only uploads (assumes the build was done before)
    - build-and-upload: builds and uploads
---
 upload => build-and-upload |   8 +-
 upload                     | 217 +--------------------------------------------
 upload-no-build            |   1 -
 3 files changed, 5 insertions(+), 221 deletions(-)

diff --git a/upload b/build-and-upload
similarity index 99%
copy from upload
copy to build-and-upload
index e94d08b..c60a44b 100755
--- a/upload
+++ b/build-and-upload
@@ -6,15 +6,15 @@ BUILD=no
 UPLOAD=no
 PROGRAM_NAME=$(basename $0)
 case "$PROGRAM_NAME" in
+  build-and-upload)
+    BUILD=yes
+    UPLOAD=yes
+    ;;
   build)
     BUILD=yes
     UPLOAD=no
     ;;
   upload)
-    BUILD=yes
-    UPLOAD=yes
-    ;;
-  upload-no-build)
     BUILD=no
     UPLOAD=yes
     ;;
diff --git a/upload b/upload
deleted file mode 100755
index e94d08b..0000000
--- a/upload
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/bin/sh
-
-set -e
-
-BUILD=no
-UPLOAD=no
-PROGRAM_NAME=$(basename $0)
-case "$PROGRAM_NAME" in
-  build)
-    BUILD=yes
-    UPLOAD=no
-    ;;
-  upload)
-    BUILD=yes
-    UPLOAD=yes
-    ;;
-  upload-no-build)
-    BUILD=no
-    UPLOAD=yes
-    ;;
-esac
-
-if ! [ -e debian/changelog ]; then
-  echo "Not inside a Debian package!"
-  exit 1
-fi
-
-if [ -x debian/release-check ]; then
-  if ! debian/release-check; then
-    echo "aborting release because debian/release-check failed"
-    exit 1
-  fi
-fi
-
-highlight() {
-  msg="$@"
-  printf "\033[01;33m${msg}\033[m\n"
-}
-
-banner() {
-  highlight "================================================="
-  highlight "= %s" "$@"
-  highlight "================================================="
-  echo # blank line
-}
-
-warning() {
-  msg="$@"
-  printf "\n"
-  printf "\033[0;37;41mWARNING: ${msg}\033[m\n"
-  printf "\n"
-}
-
-# check
-check_package() {
-  banner "Overall package contents"
-  debc "$changes"
-
-  banner "Changelog"
-  dpkg-parsechangelog
-
-  banner "Lintian checks"
-  if ! lintian -Ii; then
-    warning "Lintian reported ERRORS in the package!"
-  fi
-
-  if grep -q Build-Depends:.*gem2deb debian/control; then
-    banner "Rubygems integration"
-    debc | grep 'gemspec$' | sed 's/.*\s//'
-    echo
-  fi
-
-  if [ -f debian/tests/control ] || grep -q '^\(XS-\)\?Testsuite:' debian/control; then
-    banner "This package has a test suite!"
-    if confirm "Run the test suite now? [Y/n]" y; then
-      adt_dist="$distribution"
-      if [ "$adt_dist" = unstable ]; then
-        adt_dist=sid
-      fi
-      rc=0
-      adt-run --apt-upgrade --shell-fail "$changes" --- lxc --sudo adt-"$adt_dist"-"$arch" || rc=$?
-      if [ $rc -ne 0 ]; then
-        warning "Test suite failed! Please verify before uploading"
-      fi
-    else
-      echo "OK, but you should probably run the test suite before uploading!"
-    fi
-  fi
-}
-
-confirm() {
-  prompt="$1"
-  default="${2:-n}"
-  printf "$prompt"
-  read confirm
-  if [ -z "$confirm" ]; then
-    confirm="$default"
-  fi
-  [ "$confirm" = 'y' ] || [ "$confirm" = 'Y' ]
-}
-
-ask_to_proceed() {
-  if ! confirm "$@"; then
-    echo "Aborted upon your request."
-    exit 2
-  fi
-}
-
-source=$(dpkg-parsechangelog -SSource)
-version=$(dpkg-parsechangelog -SVersion | sed -e 's/^[0-9]\+://') # remove epoch
-arch=$(dpkg --print-architecture)
-
-# target distribution/host
-distribution=$(dpkg-parsechangelog -SDistribution)
-host=ftp-master
-git_builder=--git-builder=sbuild\ --arch-all\ --source
-case "$distribution" in
-  *-security)
-    git_builder="$git_builder"\ --git-ignore-branch
-    if confirm "Security upload detected; include orig source? [Y/n]" y; then
-      git_builder="$git_builder"\ --force-orig-source
-    fi
-    host=security-master
-    ;;
-  UNRELEASED)
-    git_builder="$git_builder"\ -c\ unstable-${arch}-sbuild
-    ;;
-  *)
-    git_builder="$git_builder"\ -d\ $distribution
-    true
-esac
-
-# check urgency for security upload
-if [ "$host" = 'security-master' ] || dpkg-parsechangelog | grep -q CVE; then
-  urgency=$(dpkg-parsechangelog -SUrgency)
-  if [ "$urgency" != 'high' ] && [ "$distribution" != "unstable" ] && [ "$distribution" != 'UNRELEASED' ]; then
-    echo "Security upload should have urgency=high"
-    exit 1
-  fi
-fi
-
-gbp_buildpackage=gbp\ buildpackage\ --git-ignore-branch\ --git-export-dir=../build-area
-
-# build
-if [ "$BUILD" = 'yes' ]; then
-  $gbp_buildpackage $git_builder "$@"
-fi
-
-changes=${source}_${version}_${arch}.changes
-if [ -e "../$changes" ]; then
-  changes="../$changes"
-else
-  if [ -e "../build-area/$changes" ]; then
-    changes="../build-area/$changes"
-  else
-    "echo E: $changes not found!"
-    exit 1
-  fi
-fi
-
-if [ "$UPLOAD" = 'no' ]; then
-  exit 0
-fi
-
-check_package 2>&1
-
-ask_to_proceed "Proceed with the upload to \033[38;1;1m${host}\033[m? [y/N] "
-
-# cleanup
-git checkout .
-git clean -dxf
-
-$gbp_buildpackage --git-tag-only --git-ignore-branch
-
-SOURCE=yes
-NEW=no
-
-case "$distribution" in
-  unstable|experimental)
-    # source only uploads are OK
-    SOURCE=yes
-    ;;
-  *)
-    # source only uploads not OK
-    SOURCE=no
-    ;;
-esac
-
-if [ $(grep -c "^${source}\s" debian/changelog) -eq 1 ]; then
-  NEW=yes
-  # must always upload binaries to NEW
-  SOURCE=no
-fi
-
-if [ $SOURCE = yes ]; then
-  $gbp_buildpackage -S "$@"
-  changes=${changes%%_${arch}.changes}_source.changes
-fi
-
-# sign
-debsign "$changes"
-
-# push
-if [ $NEW = yes ]; then
-  git push -u --all
-else
-  current_branch=$(git symbolic-ref HEAD | sed 's#refs/heads/##')
-  if [ "$current_branch" != master -a ! -f .git/refs/remotes/origin/$current_branch ]; then
-    git push -u origin "$current_branch"
-  fi
-  git push origin :
-fi
-git push --tags
-
-# upload
-dput "$host" "$changes"
diff --git a/upload b/upload
new file mode 120000
index 0000000..6a05e3d
--- /dev/null
+++ b/upload
@@ -0,0 +1 @@
+build-and-upload
\ No newline at end of file
diff --git a/upload-no-build b/upload-no-build
deleted file mode 120000
index 53c3962..0000000
--- a/upload-no-build
+++ /dev/null
@@ -1 +0,0 @@
-upload
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/pkg-ruby-extras.git



More information about the Pkg-ruby-extras-commits mailing list