]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem.pm
In v8 mode, debhelper only ever acts on packages that can be built for the given...
[debhelper.git] / Debian / Debhelper / Buildsystem.pm
index 7f7465a42840171f1b73c34754da47d0a5376196..763baa9d1773d40957c87f11122fc094cf632034 100644 (file)
@@ -12,10 +12,6 @@ use Cwd ();
 use File::Spec;
 use Debian::Debhelper::Dh_Lib;
 
-# Cache DEB_BUILD_GNU_TYPE value. Performance hit of multiple
-# invocations is noticable when listing build systems.
-our $DEB_BUILD_GNU_TYPE = dpkg_architecture_value("DEB_BUILD_GNU_TYPE");
-
 # Build system name. Defaults to the last component of the class
 # name. Do not override this method unless you know what you are
 # doing.
@@ -38,7 +34,7 @@ sub DESCRIPTION {
 # Default build directory. Can be overriden in the derived
 # class if really needed.
 sub DEFAULT_BUILD_DIRECTORY {
-       "obj-" . $DEB_BUILD_GNU_TYPE;
+       "obj-" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE");
 }
 
 # Constructs a new build system object. Named parameters:
@@ -96,7 +92,7 @@ sub _set_builddir {
                        $builddir = File::Spec->catdir($this->{cwd}, $builddir);
                }
                elsif ($builddir =~ /\Q$this->{cwd}\E/) {
-                       $builddir = File::Spec::abs2rel($builddir, $this->{cwd});
+                       $builddir = File::Spec->abs2rel($builddir, $this->{cwd});
                }
 
                # If build directory ends up the same as source directory, drop it
@@ -109,16 +105,16 @@ sub _set_builddir {
 }
 
 # This instance method is called to check if the build system is able
-# to build a source package. It will be called during build
-# system auto-selection process inside the root directory of the debian
-# source package. Current build step will be passed as an additional
-# argument. The value returned must be 0 if the source is not buildable
-# or a positive integer otherwise.
+# to build a source package. It will be called during the build
+# system auto-selection process, inside the root directory of the debian
+# source package. The current build step is passed as an argument.
+# Return 0 if the source is not buildable, or a positive integer
+# otherwise.
 #
 # Generally, it is enough to look for invariant unique build system
 # files shipped with clean source to determine if the source might
-# be buildable or not. However, if the build system enhances (i.e.
-# derives) from the other auto-buildable build system, this method
+# be buildable or not. However, if the build system is derived from
+# another other auto-buildable build system, this method
 # may also check if the source has already been built with this build
 # system partitially by looking for temporary files or other common
 # results the build system produces during the build process. The
@@ -169,7 +165,7 @@ sub canonpath {
        my ($this, $path)=@_;
        my @canon;
        my $back=0;
-       for my $comp (split(m%/+%, $path)) {
+       foreach my $comp (split(m%/+%, $path)) {
                if ($comp eq '.') {
                        next;
                }