use vars qw(@ISA @EXPORT %dh);
@ISA=qw(Exporter);
@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
- &pkgfile &pkgext &isnative &autoscript &filearray &filedoublearray
- &GetPackages &basename &dirname &xargs %dh &compat &addsubstvar
- &delsubstvar &excludefile);
+ &pkgfile &pkgext &pkgfilename &isnative &autoscript &filearray
+ &filedoublearray &GetPackages &basename &dirname &xargs %dh
+ &compat &addsubstvar &delsubstvar &excludefile);
my $max_compat=4;
# * debian/package.filename.buildarch
# * debian/package.filename
# * debian/file (if the package is the main package)
+# If --name was specified then tonly the first two are tried, and they must
+# have the name after the pacage name:
+# * debian/package.name.filename.buildarch
+# * debian/package.name.filename
sub pkgfile {
my $package=shift;
my $filename=shift;
+ if (defined $dh{NAME}) {
+ $filename="$dh{NAME}.$filename";
+ }
+
if (-f "debian/$package.$filename.".buildarch()) {
return "debian/$package.$filename.".buildarch();
}
}
# Pass it a name of a binary package, it returns the name to prefix to files
-# in debian for this package.
+# in debian/ for this package.
sub pkgext {
my $package=shift;
return "$package.";
}
+# Pass it the name of a binary package, it returns the name to install
+# files by in eg, etc. Normally this is the same, but --name can override
+# it.
+sub pkgfilename {
+ my $package=shift;
+
+ if (defined $dh{NAME}) {
+ return $dh{NAME};
+ }
+ return $package;
+}
+
# Returns 1 if the package is a native debian package, null otherwise.
# As a side effect, sets $dh{VERSION} to the version of this package.
{