r18481 - /tools/sbp-add-tags-support

lool at users.alioth.debian.org lool at users.alioth.debian.org
Thu Feb 19 21:35:56 UTC 2009


Author: lool
Date: Thu Feb 19 21:35:56 2009
New Revision: 18481

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=18481
Log:
Add script to add tags support for svn-buildpackage packages.

Added:
    tools/sbp-add-tags-support   (with props)

Added: tools/sbp-add-tags-support
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/sbp-add-tags-support?rev=18481&op=file
==============================================================================
--- tools/sbp-add-tags-support (added)
+++ tools/sbp-add-tags-support Thu Feb 19 21:35:56 2009
@@ -1,0 +1,81 @@
+#!/bin/sh
+# sbp-add-tags-support - add tags support for svn-buildpackage packages
+# Copyright (C) 2007, 2008, 2009 Loïc Minier <lool at dooz.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# SOFTWARE IN THE PUBLIC INTEREST, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the author shall not be used
+# in advertising or otherwise to promote the sale, use or other dealings in
+# this Software without prior written authorization from the author.
+#
+# depends: subversion (svn)
+
+set -e
+
+log() {
+    echo "$*" >&2
+}
+
+log_e() {
+    log "E:" "$@"
+}
+
+log_i() {
+    log "I:" "$@"
+}
+
+doit() {
+    log_i "Running command:" "$@"
+    "$@"
+}
+
+if ! dh_testdir; then
+    log_e "Not in a source directory"
+    exit 1
+fi
+
+svn_version=$(LC_ALL=C svn --version --quiet)
+svn_version_major=$(echo $svn_version | sed -r 's/^([0-9]+)\.([0-9]+).*/\1/')
+svn_version_minor=$(echo $svn_version | sed -r 's/^([0-9]+)\.([0-9]+).*/\2/')
+
+if [ $svn_version_major -lt 1 ] || ( [ $svn_version_major -eq 1 ] && [ $svn_version_minor -lt 4 ] ); then
+    log_e "svn version is too old, needs >= 1.4, but got $svn_version"
+    exit 1
+fi
+
+source=$(LC_ALL=C dpkg-parsechangelog | sed -n 's/^Source: //p')
+repo_root=$(LC_ALL=C svn info | sed -n 's/^Repository Root: //p')
+tags_url="$repo_root/tags/$source"
+
+if [ -z "$repo_root" ]; then
+    log_e "Internal error: repo_root is empty"
+    exit 1
+fi
+
+if LC_ALL=C svn proplist debian | grep -q '^ *svn-bp:tagsUrl$'; then
+    log_e "svn-bp:tagsUrl already set"
+    exit 1
+fi
+
+doit svn mkdir -m "* Create tags dir for $source." "$tags_url" || true
+doit svn up
+doit svn propset svn-bp:tagsUrl "$tags_url" debian
+doit svn commit -N debian -m "* Set svn-bp:tagsUrl to $tags_url."
+doit svn up
+

Propchange: tools/sbp-add-tags-support
------------------------------------------------------------------------------
    svn:executable = *




More information about the pkg-gnome-commits mailing list