Commit 51e9ad6e authored by Ben Wiederhake's avatar Ben Wiederhake Committed by Craig Small

Beautify error message.

parent 9d77708c
dh-make (1.20150913) UNRELEASED; urgency=medium
[ Craig Small ]
* Fixed LGPL comment
* Added custom copyright template option
[ Ben Wiederhake ]
* Explain why version couldn't be parsed Closes: #799714
-- Craig Small <csmall@debian.org> Mon, 07 Sep 2015 21:12:25 +1000
dh-make (1.20150601) unstable; urgency=medium
......
......@@ -399,11 +399,31 @@ sub get_package
my $pwd = &Cwd::cwd();
my $forced_package_version = "";
# May split the version out of the name
if ( ($main::forced_package_name) &&
($main::forced_package_name =~ /(.*)_([0-9][0-9a-zA-Z+.~-]*)$/))
{
$main::forced_package_name = $1;
$forced_package_version = $2;
if ($main::forced_package_name)
{
if ($main::forced_package_name =~ /(.*)_([0-9][0-9a-zA-Z+.~-]*)$/)
{
$main::forced_package_name = $1;
$forced_package_version = $2;
} elsif ($main::forced_package_name =~ /(.*)_(.*)$/)
{
print <<"EOF";
The directory name you have specified is invalid!
It seems the <packagename>_<version> format was attempted,
since underscores are illegal in both package-name and version.
Make sure that the version starts with a digit and contains only
digits, lower and uppercase letters, dashes, or the signs plus, dot, tilde.
Your current directory is $pwd, perhaps you could try going to
directory where the sources are?
Please note that this change is necessary ONLY during the initial
Debianization with dh_make. When building the package, dpkg-source
will gracefully handle almost any upstream tarball.
EOF
exit 1;
}
}
if ( ($forced_package_version ne "")
|| (
......@@ -445,7 +465,7 @@ Debianization with dh_make. When building the package, dpkg-source
will gracefully handle almost any upstream tarball.
EOF
exit 1;
exit 1;
}
if (! ($main::package_name =~ /^[a-z0-9+.-]+$/))
{
......
......@@ -24,8 +24,13 @@ is a tool to convert a regular source code package into one formatted
according to the requirements of the Debian Policy.
.B dh_make
must be invoked within a directory containing the source code, which must
be named <packagename>\-<version>. The <packagename> must be all lowercase,
digits and dashes. If the directory name does not conform to this scheme,
be named <packagename>\-<version>.
The <packagename> must be all lowercase,
The <packagename> and <version>
must be all lowercase,
digits and dashes. The <version> can also contain digits, and the symbols
plus, dot, tilde. The <version> must start with a digit.
If the directory name does not conform to this scheme,
you must rename it before using
.B dh_make.
Alternatively, you may be able to use the \fB\-\-packagename\fR option to force
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment