[med-svn] [Git][med-team/community/package_template][master] Sometimes (for instance on Github) it is convenient to specify the homepage of...

Andreas Tille gitlab at salsa.debian.org
Fri Mar 22 07:08:35 GMT 2019


Andreas Tille pushed to branch master at Debian Med / community / package_template


Commits:
9f81d4aa by Andreas Tille at 2019-03-22T07:07:35Z
Sometimes (for instance on Github) it is convenient to specify the homepage of the project and assume the last part is the future package name

- - - - -


1 changed file:

- personalise_template


Changes:

=====================================
personalise_template
=====================================
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -e
 # Replaces templates for developer name, source package and data for you
 
 if [ "$DEBEMAIL" = "" ] ; then
@@ -13,20 +13,33 @@ fi
 
 if [ $# -lt 1 ] ; then
   echo "usage: $0 <sourcepackagename>"
+  echo "       $0 <homepage>"
   exit
 fi
 
-if ! mkdir $1 2>/dev/null ; then
-  echo "Unable to create dir $1.  Is it just existing"
+if echo "$1" | grep -q '^http.*://' ; then
+  PHOMEPAGE="$1"
+  PKG=$(echo "$1" | sed 's#^.*/\([^/]\+\)$#\1#' | tr '[:upper:]' '[:lower:]')
+  echo PKG="$PKG"
+else
+  PHOMEPAGE=""
+  PKG=$1
+fi
+
+if ! mkdir "$PKG" 2>/dev/null ; then
+  echo "Unable to create dir $PKG.  Is it just existing"
   exit
 fi
 
 # FIXME: Check whether a package with this source name exists on salsa!
 
-cd $1
-cp -av `dirname $0`/debian .
+cd "$PKG"
+cp -av $(dirname "$0")/debian .
 cd debian
-sed -i "s/<your_ID>/${DEBFULLNAME} <${DEBEMAIL}>/" `find . -maxdepth 1 -type f`
-sed -i "s/<pkg>/$1/" `find . -maxdepth 1 -type f`
+sed -i "s/<your_ID>/${DEBFULLNAME} <${DEBEMAIL}>/" $(find . -maxdepth 1 -type f)
+sed -i "s/<pkg>/$PKG/" $(find . -maxdepth 1 -type f)
 CHDATE=$(date -R)
 sed -i "s/<timestamp_as_per_date_-R>/${CHDATE}/" changelog
+if [ "$PHOMEPAGE" != "" ] ; then
+  sed -i "s#<homepage>#$PHOMEPAGE#" control
+fi



View it on GitLab: https://salsa.debian.org/med-team/community/package_template/commit/9f81d4aa794093cb8a68d81eca6b8cdde41fbc1e

-- 
View it on GitLab: https://salsa.debian.org/med-team/community/package_template/commit/9f81d4aa794093cb8a68d81eca6b8cdde41fbc1e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20190322/787b3b7c/attachment-0001.html>


More information about the debian-med-commit mailing list