Package: vdr-dev Version: 2.2.0-6 Severity: minor Tags: patch The script debianize-vdrplugin expects the plugin's source directory to be named <PLUGIN-NAME>-<VERSION>. Many plugin authors and package maintainers don't follow that convention. Other directory names result in an invalid plugin name used when dh_make is run by the script.
The script also does not report an error when it can't identify an upstream tarball. A missing upstream tarball causes dh_make to fail. Since the call to dh_make is hardwired into the script, it is not possible to use dh_make's options -f or --createorig. The attached patch lets debianize-vdrplugin handle source directories named [vdr-][plugin-]<PLUGIN-NAME>-<VERSION> and exit with an explanation if the upstream tarball is not found. Cheers, Malte
--- /usr/bin/debianize-vdrplugin 2016-06-06 19:04:57.000000000 +0200 +++ debianize-vdrplugin 2017-09-08 10:42:43.126021000 +0200 @@ -2,20 +2,22 @@ detect_plugin_name() { - local PATTERN='.*\/\(.*\)-\([0-9][0-9a-zA-Z+.~-]*\)$' - if pwd | grep -q -E ".*\/.*-[0-9][0-9a-zA-Z+.~-]*$" ; then - PLUGIN=`pwd | sed "s/$PATTERN/\1/"` - VERSION=`pwd | sed "s/$PATTERN/\2/"` + local pattern='.*/(?:vdr-)?(?:plugin-)?([^/]*)-(\d[\da-zA-Z+.~-]*)$' + if pwd | grep -q -P "$pattern"; then + PLUGIN=`pwd | perl -lpe "s|$pattern|\1|"` + VERSION=`pwd | perl -lpe "s|$pattern|\2|"` else - echo "debianize-vdrplugin expects the upstream sources to be extracted in a" - echo "directory named: <PLUGIN-NAME>-<VERSION>" - echo - echo "e.g.: coolplugin-0.0.1" - echo - echo "The upsteam tarball should be named: vdr-<PLUGIN-NAME>-<VERSION>.tar.gz" - echo - echo "e.g.: vdr-coolplugin-0.0.1.tar.gz" + echo "debianize-vdrplugin expects to be executed in the directory containing" + echo "the upstream sources. That directory should be named" + echo " [vdr-][plugin-]<PLUGIN-NAME>-<VERSION>," + echo " e.g. vdr-plugin-coolplugin-0.0.1" + echo " or vdr-coolplugin-0.0.1" + echo " or plugin-coolplugin-0.0.1" + echo " or coolplugin-0.0.1" echo + echo "The upsteam tarball should be named" + echo " [vdr-][plugin-]<PLUGIN-NAME>-<VERSION>.tar.gz," + echo " e.g. vdr-coolplugin-0.0.1.tar.gz" exit 1 fi } @@ -34,6 +36,9 @@ ln -sf `basename $tarball` $ORIGTARBALL return done + + echo "The upstream tarball was not found!" + exit 1 } check_dh_make()