[Cdd-commits] r1238 - blends/trunk/webtools
CDD Subversion Commit
noreply at alioth.debian.org
Thu Nov 13 08:52:36 UTC 2008
Author: tille
Date: Thu Nov 13 08:52:35 2008
New Revision: 1238
Added:
blends/trunk/webtools/blend-get-names
Modified:
blends/trunk/webtools/blendstasktools.py
Log:
As a temporary solution inject a copy of blend-get-names to webtools. Once blend-get-names is tagged stable in blends-dev package adapt deply-svn to obtain this file from there.
Added: blends/trunk/webtools/blend-get-names
==============================================================================
--- (empty file)
+++ blends/trunk/webtools/blend-get-names Thu Nov 13 08:52:35 2008
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# Read DIS specific names from debian/control.stub
+#
+# Copyright (C) Andreas Tille <tille at debian.org>
+# License: GPL
+
+# Return codes according to
+# http://epydoc.sourceforge.net/stdlib/posix-module.html
+
+CONTROLFILE=debian/control.stub
+
+GetShortName () {
+ grep '^Source:[[:space:]]*debian-' $CONTROLFILE | \
+ sed 's/^Source:[[:space:]]*debian-//'
+}
+
+if [ ! -e "$CONTROLFILE" ] ; then
+ echo "Missing control file $CONTROLFILE"
+ exit 72 # EX_OSFILE
+fi
+
+if [ "$#" -ne 1 ] ; then
+ echo "Missing argument"
+ echo "Usage: $0 disname|disshortname|metapackageprefix"
+ exit 64 # EX_USAGE
+fi
+
+case "$1" in
+ disname)
+ grep '^Source:[[:space:]]*debian-' "$CONTROLFILE" | \
+ sed 's/^Source:[[:space:]]*//'
+ exit 0
+ ;;
+ disshortname)
+ GetShortName
+ exit 0
+ ;;
+ metapackageprefix)
+ mprefix=`grep '^Package:[[:space:]]*' "$CONTROLFILE" |head -1| \
+ sed 's/^Package:[[:space:]]*\([[:alnum:]]\+\)-*.*/\1/'`
+ if [ -z $mprefix ] ; then
+ GetShortName
+ else
+ echo $mprefix
+ fi
+ exit 0
+ ;;
+ *)
+ echo "Unknown argument $1"
+ echo "Usage: $0 disname|disshortname|metapackageprefix"
+ exit 64 # EX_USAGE
+ ;;
+esac
Modified: blends/trunk/webtools/blendstasktools.py
==============================================================================
--- blends/trunk/webtools/blendstasktools.py (original)
+++ blends/trunk/webtools/blendstasktools.py Thu Nov 13 08:52:35 2008
@@ -257,10 +257,10 @@
self._GetMetapackages()
# Obtain the prefix of the meta packages of the Blend using blends-dev tools dis_get_names
- if os.access('/usr/share/dis-dev/dis-get-names', os.X_OK):
- dis_get_names = '/usr/share/dis-dev/dis-get-names'
- elif os.access(os.getcwd() + '/dis-get-names', os.X_OK):
- dis_get_names = os.getcwd() + '/dis-get-names'
+ if os.access('/usr/share/blends-dev/blend-get-names', os.X_OK):
+ dis_get_names = '/usr/share/blends-dev/blend-get-names'
+ elif os.access(os.getcwd() + '/blend-get-names', os.X_OK):
+ dis_get_names = os.getcwd() + '/blend-get-names'
else:
print >>stderr, "Please either install package Blends-dev or install a copy of devtools/blends-get-names in your working directory"
exit(-1)
More information about the Cdd-commits
mailing list