summaryrefslogtreecommitdiff
path: root/dh_elpa
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-08-21 10:11:54 +0200
committerDavid Bremner <david@tethera.net>2015-08-21 12:16:05 +0200
commitc67a5f69add8081335a6f140371a45c1321681d6 (patch)
treea60f1c74c35f17c3c8328142ee6f428eaf0469f1 /dh_elpa
parent9daadcf4edc129bba26358c69a47bc295374b067 (diff)
use temporary directory under debian/.debhelper
This is a suggestion of Nils Thykier, to avoid adding special handling for keeping temporary files. This is removed by dh_clean.
Diffstat (limited to 'dh_elpa')
-rwxr-xr-xdh_elpa14
1 files changed, 11 insertions, 3 deletions
diff --git a/dh_elpa b/dh_elpa
index 368c180..2b049d7 100755
--- a/dh_elpa
+++ b/dh_elpa
@@ -8,7 +8,7 @@ dh_elpa - install emacs lisp packages into package build directories
use strict;
use Cwd qw{ getcwd };
-use File::Temp qw{ tempdir tempfile};
+use File::Temp qw{tempfile};
use IO::Handle;
use Debian::Debhelper::Dh_Lib;
@@ -147,7 +147,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if (scalar(@files) == 1) {
$pkg_file=$files[0];
} else {
- my $tempdir = tempdir(CLEANUP => 1);
+ my $cwd = getcwd();
+ my $tempdir = "${cwd}/debian/.debhelper/elpa";
+ {
+ require File::Path;
+ File::Path::rmtree $tempdir ||
+ die "cleaning $tempdir";
+
+ File::Path::make_path $tempdir ||
+ die "creating $tempdir";
+ }
my $version = $dh{VERSION} or die "version not found!";
$version =~ s/-[^-]+//; # strip Debian version
my $pkg_dir = "$elpapkg-$version";
@@ -161,7 +170,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
doit("cp", "-a", $el_file, "$tempdir/$pkg_dir");
}
- my $cwd = getcwd();
chdir $tempdir or die "$!";
doit("tar","cf",$pkg_file,$pkg_dir);
chdir $cwd or die "$!";