#!/bin/bash # $HeadURL$ $LastChangedRevision$ # Modules . $(bs-config bs_share_prefix)/include/bssupport.sh || { echo "${0##*/}: INTERNAL ERROR: failed to load bssupport.sh" >&2; exit 3; } . $(miniade) || { echo "${0##*/}: ERROR: miniade failed (hint: run 'miniade' to see error)" >&2; exit 1; } # Configurable stuff # Other globals main() { local MY_ARGS local PROGRAM VERBOSELEVEL PROGNAME # Defaults for options # Process options miniade_process_options --help-handler=usage MY_ARGS "$@" && set -- "${MY_ARGS[@]}" # Process arguments # Sanity checks and derivations # bs sets PROGRAM, but passes it to us through environment as BS_PROGRAM, copy it back. PROGRAM=$BS_PROGRAM VERBOSELEVEL=$BS_VERBOSELEVEL PKGCTRL_SVNWC_DIR=$BS_PKGCTRL_SVNWC_DIR bssupport_checkset VERBOSELEVEL PROGRAM PKGCTRL_SVNWC_DIR # DEBEMAIL and DEBFULLNAME must be set in the developer's environment. They # are not bs-specific: they are used by dch and other deb-related commands. bssupport_checkset DEBEMAIL DEBFULLNAME miniade_get_progname PROGNAME miniade_set_verboselevel $VERBOSELEVEL bssupport_changestate --id=$PROGRAM.debian --from=released --to=unreleased --step=$PROGNAME bssupport_sandbox # Guts miniade_info "bumping changelog ..." ln -s $PKGCTRL_SVNWC_DIR debian bssupport_get_released_pkgctrl_version debian/changelog CHANGELOG_VERSION miniade_debug 10 "CHANGELOG_VERSION=$CHANGELOG_VERSION" get_latest_version_on_web TARBALL_VERSION || miniade_error "uscan output is not parsable (hint: see messages above)" miniade_debug 10 "VERSION=$VERSION" if [ "X$CHANGELOG_VERSION" = "X$TARBALL_VERSION" ]; then DCH_OPTS="--increment \"please change this text!\"" miniade_warning "don't forget to update the changelog (it's got dummy text in)" elif dpkg --compare-versions $CHANGELOG_VERSION lt $TARBALL_VERSION; then DCH_OPTS="--newversion=$TARBALL_VERSION-1 \"new upstream version ($TARBALL_VERSION)\"" else miniade_error "changelog references a version that is not available (hint: see messages above)" fi eval "dch --changelog=debian/changelog --distribution=UNRELEASED $DCH_OPTS" || miniade_error "dch failed (hint: see messages above)" } # uscan has a '--no-symlink' option which makes it not call mk_origtargz, but # even when explicitly instructed not to call mk_origtargz, uscan still warns: # # uscan warn: No upstream tarball downloaded. No further processing with mk_origtargz ... # # Hence not bothering to provide the option and redirecting stderr. get_latest_version_on_web() { local USCAN_OUTPUT VERSION_REF VERSION_REF=$1 USCAN_OUTPUT=$(uscan --no-download --destdir . --verbose) [[ $USCAN_OUTPUT =~ Newest\ version\ of\ .*\ on\ remote\ site\ is\ (.*),\ local\ version\ is ]] || miniade_error "couldn't parse uscan output (hint: see messages above)" eval "$VERSION_REF=\"\${BASH_REMATCH[1]}\"" } main "$@"