diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-20 17:00:17 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-08-20 18:03:48 +0200 |
commit | 11849a320e4f522b97fcdf09ff0940496880475b (patch) | |
tree | 13548f1c1bb2e01590b31d66d9bb8f46534bc99f /perl/lib/Nix | |
parent | 373fad75e19a2f24db512621b8cedb627d03d49d (diff) |
Use proper quotes everywhere
Diffstat (limited to 'perl/lib/Nix')
-rw-r--r-- | perl/lib/Nix/Config.pm.in | 2 | ||||
-rw-r--r-- | perl/lib/Nix/CopyClosure.pm | 5 | ||||
-rw-r--r-- | perl/lib/Nix/Manifest.pm | 21 | ||||
-rw-r--r-- | perl/lib/Nix/Utils.pm | 5 |
4 files changed, 18 insertions, 15 deletions
diff --git a/perl/lib/Nix/Config.pm.in b/perl/lib/Nix/Config.pm.in index e07d4c08f..bc51310e5 100644 --- a/perl/lib/Nix/Config.pm.in +++ b/perl/lib/Nix/Config.pm.in @@ -31,7 +31,7 @@ sub readConfig { my $config = "$confDir/nix.conf"; return unless -f $config; - open CONFIG, "<$config" or die "cannot open `$config'"; + open CONFIG, "<$config" or die "cannot open ‘$config’"; while (<CONFIG>) { /^\s*([\w\-\.]+)\s*=\s*(.*)$/ or next; $config{$1} = $2; diff --git a/perl/lib/Nix/CopyClosure.pm b/perl/lib/Nix/CopyClosure.pm index d707158b5..10d26c3a7 100644 --- a/perl/lib/Nix/CopyClosure.pm +++ b/perl/lib/Nix/CopyClosure.pm @@ -1,5 +1,6 @@ package Nix::CopyClosure; +use utf8; use strict; use Nix::Config; use Nix::Store; @@ -41,7 +42,7 @@ sub copyToOpen { # Send the "import paths" command. syswrite($to, pack("L<x4", 4)) or die; exportPaths(fileno($to), $sign, @missing); - readInt($from) == 1 or die "remote machine \`$sshHost' failed to import closure\n"; + readInt($from) == 1 or die "remote machine ‘$sshHost’ failed to import closure\n"; } @@ -105,7 +106,7 @@ sub oldCopyTo { unless ($dryRun) { open SSH, "| ssh $sshHost @{$sshOpts} @globalSshOpts 'nix-store --import' > /dev/null" or die; exportPaths(fileno(SSH), $sign, @missing); - close SSH or die "copying store paths to remote machine `$sshHost' failed: $?"; + close SSH or die "copying store paths to remote machine ‘$sshHost’ failed: $?"; } } } diff --git a/perl/lib/Nix/Manifest.pm b/perl/lib/Nix/Manifest.pm index 015c92835..9b7e89fa4 100644 --- a/perl/lib/Nix/Manifest.pm +++ b/perl/lib/Nix/Manifest.pm @@ -1,5 +1,6 @@ package Nix::Manifest; +use utf8; use strict; use DBI; use DBD::SQLite; @@ -58,10 +59,10 @@ sub readManifest_ { # Decompress the manifest if necessary. if ($manifest =~ /\.bz2$/) { open MANIFEST, "$Nix::Config::bzip2 -d < $manifest |" - or die "cannot decompress `$manifest': $!"; + or die "cannot decompress ‘$manifest’: $!"; } else { open MANIFEST, "<$manifest" - or die "cannot open `$manifest': $!"; + or die "cannot open ‘$manifest’: $!"; } my $inside = 0; @@ -239,7 +240,7 @@ sub updateManifestDB { # Open/create the database. our $dbh = DBI->connect("dbi:SQLite:dbname=$dbPath", "", "") - or die "cannot open database `$dbPath'"; + or die "cannot open database ‘$dbPath’"; $dbh->{RaiseError} = 1; $dbh->{PrintError} = 0; @@ -354,10 +355,10 @@ EOF my $version = readManifest_($manifest, \&addNARToDB, \&addPatchToDB); if ($version < 3) { - die "you have an old-style or corrupt manifest `$manifestLink'; please delete it\n"; + die "you have an old-style or corrupt manifest ‘$manifestLink’; please delete it\n"; } if ($version >= 10) { - die "manifest `$manifestLink' is too new; please delete it or upgrade Nix\n"; + die "manifest ‘$manifestLink’ is too new; please delete it or upgrade Nix\n"; } } @@ -434,27 +435,27 @@ sub parseNARInfo { if ($requireValidSig) { if (!defined $sig) { - warn "NAR info file `$location' lacks a signature; ignoring\n"; + warn "NAR info file ‘$location’ lacks a signature; ignoring\n"; return undef; } my ($sigVersion, $keyName, $sig64) = split ";", $sig; $sigVersion //= 0; if ($sigVersion != 1) { - warn "NAR info file `$location' has unsupported version $sigVersion; ignoring\n"; + warn "NAR info file ‘$location’ has unsupported version $sigVersion; ignoring\n"; return undef; } return undef unless defined $keyName && defined $sig64; my $publicKeyFile = $Nix::Config::config{"binary-cache-public-key-$keyName"}; if (!defined $publicKeyFile) { - warn "NAR info file `$location' is signed by unknown key `$keyName'; ignoring\n"; + warn "NAR info file ‘$location’ is signed by unknown key ‘$keyName’; ignoring\n"; return undef; } if (! -f $publicKeyFile) { - die "binary cache public key file `$publicKeyFile' does not exist\n"; + die "binary cache public key file ‘$publicKeyFile’ does not exist\n"; return undef; } if (!isValidSignature($publicKeyFile, $sig64, $signedData)) { - warn "NAR info file `$location' has an invalid signature; ignoring\n"; + warn "NAR info file ‘$location’ has an invalid signature; ignoring\n"; return undef; } $res->{signedBy} = $keyName; diff --git a/perl/lib/Nix/Utils.pm b/perl/lib/Nix/Utils.pm index 05cd92b8e..32fb0aafb 100644 --- a/perl/lib/Nix/Utils.pm +++ b/perl/lib/Nix/Utils.pm @@ -1,5 +1,6 @@ package Nix::Utils; +use utf8; use File::Temp qw(tempdir); our @ISA = qw(Exporter); @@ -25,7 +26,7 @@ sub uniq { sub writeFile { my ($fn, $s) = @_; - open TMP, ">$fn" or die "cannot create file `$fn': $!"; + open TMP, ">$fn" or die "cannot create file ‘$fn’: $!"; print TMP "$s" or die; close TMP or die; } @@ -33,7 +34,7 @@ sub writeFile { sub readFile { local $/ = undef; my ($fn) = @_; - open TMP, "<$fn" or die "cannot open file `$fn': $!"; + open TMP, "<$fn" or die "cannot open file ‘$fn’: $!"; my $s = <TMP>; close TMP or die; return $s; |