Skip to content

Commit

Permalink
Revert "Get rid of unicode quotes (#1140)"
Browse files Browse the repository at this point in the history
This reverts commit f78126b. There
really is no need for such a massive change...
  • Loading branch information
edolstra committed Nov 25, 2016
1 parent f78126b commit 215b70f
Show file tree
Hide file tree
Showing 96 changed files with 670 additions and 670 deletions.
4 changes: 2 additions & 2 deletions corepkgs/derivation.nix
@@ -1,5 +1,5 @@
/* This is the implementation of the 'derivation' builtin function.
It's actually a wrapper around the 'derivationStrict' primop. */
/* This is the implementation of the derivation builtin function.
It's actually a wrapper around the derivationStrict primop. */

drvAttrs @ { outputs ? [ "out" ], ... }:

Expand Down
4 changes: 2 additions & 2 deletions mk/functions.mk
@@ -1,9 +1,9 @@
# Utility function for recursively finding files, e.g.
# '$(call rwildcard, path/to/dir, *.c *.h)'.
# $(call rwildcard, path/to/dir, *.c *.h).
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))

# Given a file name, produce the corresponding dependency file
# (e.g. 'foo/bar.o' becomes 'foo/.bar.o.dep').
# (e.g. foo/bar.o becomes foo/.bar.o.dep).
filename-to-dep = $(dir $1).$(notdir $1).dep

# Return the full path to a program by looking it up in $PATH, or the
Expand Down
6 changes: 3 additions & 3 deletions mk/libraries.mk
Expand Up @@ -11,9 +11,9 @@ else
endif

# Build a library with symbolic name $(1). The library is defined by
# various variables prefixed by '$(1)_':
# various variables prefixed by $(1)_:
#
# - $(1)_NAME: the name of the library (e.g. 'libfoo'); defaults to
# - $(1)_NAME: the name of the library (e.g. libfoo); defaults to
# $(1).
#
# - $(1)_DIR: the directory where the (non-installed) library will be
Expand Down Expand Up @@ -45,7 +45,7 @@ endif
# - $(1)_INSTALL_DIR: the directory where the library will be
# installed. Defaults to $(libdir).
#
# - BUILD_SHARED_LIBS: if equal to '1', a dynamic library will be
# - BUILD_SHARED_LIBS: if equal to ‘1’, a dynamic library will be
# built, otherwise a static library.
define build-library
$(1)_NAME ?= $(1)
Expand Down
2 changes: 1 addition & 1 deletion mk/programs.mk
@@ -1,7 +1,7 @@
programs-list :=

# Build a program with symbolic name $(1). The program is defined by
# various variables prefixed by '$(1)_':
# various variables prefixed by $(1)_:
#
# - $(1)_DIR: the directory where the (non-installed) program will be
# placed.
Expand Down
2 changes: 1 addition & 1 deletion mk/templates.mk
@@ -1,7 +1,7 @@
template-files :=

# Create the file $(1) from $(1).in by running config.status (which
# substitutes all '@var@' variables set by the configure script).
# substitutes all @var@ variables set by the configure script).
define instantiate-template

clean-files += $(1)
Expand Down
2 changes: 1 addition & 1 deletion mk/tests.mk
@@ -1,4 +1,4 @@
# Run program $1 as part of 'make installcheck'.
# Run program $1 as part of make installcheck.
define run-install-test

installcheck: $1
Expand Down
2 changes: 1 addition & 1 deletion perl/lib/Nix/Config.pm.in
Expand Up @@ -33,7 +33,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;
Expand Down
4 changes: 2 additions & 2 deletions perl/lib/Nix/CopyClosure.pm
Expand Up @@ -35,14 +35,14 @@ sub copyToOpen {
my $missingSize = 0;
$missingSize += (queryPathInfo($_, 1))[3] foreach @missing;

printf STDERR "copying %d missing paths (%.2f MiB) to '$sshHost'...\n",
printf STDERR "copying %d missing paths (%.2f MiB) to $sshHost...\n",
scalar(@missing), $missingSize / (1024**2);
return if $dryRun;

# Send the "import paths" command.
syswrite($to, pack("L<x4", 4)) or die;
exportPaths(fileno($to), @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";
}


Expand Down
12 changes: 6 additions & 6 deletions perl/lib/Nix/Manifest.pm
Expand Up @@ -60,10 +60,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;
Expand Down Expand Up @@ -287,15 +287,15 @@ sub parseNARInfo {
# FIXME: might be useful to support multiple signatures per .narinfo.

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 ($keyName, $sig64) = split ":", $sig;
return undef unless defined $keyName && defined $sig64;

my $publicKey = $Nix::Config::binaryCachePublicKeys{$keyName};
if (!defined $publicKey) {
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;
}

Expand All @@ -306,12 +306,12 @@ sub parseNARInfo {
[ map { "$Nix::Config::storeDir/$_" } @refs ]);
};
if ($@) {
warn "cannot compute fingerprint of '$location'; ignoring\n";
warn "cannot compute fingerprint of $location; ignoring\n";
return undef;
}

if (!checkSignature($publicKey, decode_base64($sig64), $fingerprint)) {
warn "NAR info file '$location' has an incorrect signature; ignoring\n";
warn "NAR info file $location has an incorrect signature; ignoring\n";
return undef;
}

Expand Down
4 changes: 2 additions & 2 deletions perl/lib/Nix/SSH.pm
Expand Up @@ -84,7 +84,7 @@ sub connectToRemoteNix {

$extraFlags ||= "";

# Start 'nix-store --serve' on the remote host.
# Start nix-store --serve on the remote host.
my ($from, $to);
# FIXME: don't start a shell, start ssh directly.
my $pid = open2($from, $to, "exec ssh -x -a $sshHost @globalSshOpts @{$sshOpts} nix-store --serve --write $extraFlags");
Expand All @@ -97,7 +97,7 @@ sub connectToRemoteNix {
syswrite($to, pack("L<x4L<x4", $SERVE_MAGIC_1, $clientVersion)) or die;
$magic = readInt($from);
};
die "unable to connect to '$sshHost'\n" if $@;
die "unable to connect to $sshHost\n" if $@;
die "did not get valid handshake from remote host\n" if $magic != 0x5452eecb;

my $serverVersion = readInt($from);
Expand Down
6 changes: 3 additions & 3 deletions perl/lib/Nix/Utils.pm
Expand Up @@ -10,7 +10,7 @@ $urlRE = "(?: [a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!

sub checkURL {
my ($url) = @_;
die "invalid URL '$url'\n" unless $url =~ /^ $urlRE $ /x;
die "invalid URL $url\n" unless $url =~ /^ $urlRE $ /x;
}

sub uniq {
Expand All @@ -26,15 +26,15 @@ 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;
}

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;
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-remote.pl.in
Expand Up @@ -209,7 +209,7 @@ REQ: while (1) {
};
last REQ unless $@;
print STDERR "$@";
warn "unable to open SSH connection to '$hostName', trying other available machines...\n";
warn "unable to open SSH connection to $hostName, trying other available machines...\n";
$from = undef;
$to = undef;
$machine->{enabled} = 0;
Expand Down Expand Up @@ -251,15 +251,15 @@ close UPLOADLOCK;


# Perform the build.
print STDERR "building '$drvPath' on '$hostName'\n";
print STDERR "building $drvPath on $hostName\n";
writeInt(6, $to) or die; # == cmdBuildPaths
writeStrings([$drvPath], $to);
writeInt($maxSilentTime, $to);
writeInt($buildTimeout, $to);
my $res = readInt($from);
if ($res != 0) {
my $msg = decode("utf-8", readString($from));
print STDERR "error: $msg on '$hostName'\n";
print STDERR "error: $msg on $hostName\n";
exit $res;
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/install-nix-from-closure.sh
Expand Up @@ -27,13 +27,13 @@ if ! [ -e $dest ]; then
cmd="mkdir -m 0755 $dest && chown $USER $dest"
echo "directory $dest does not exist; creating it by running '$cmd' using sudo" >&2
if ! sudo sh -c "$cmd"; then
echo "$0: please manually run '$cmd' as root to create $dest" >&2
echo "$0: please manually run $cmd as root to create $dest" >&2
exit 1
fi
fi

if ! [ -w $dest ]; then
echo "$0: directory $dest exists, but is not writable by you. This could indicate that another user has already performed a single-user installation of Nix on this system. If you wish to enable multi-user support see http://nixos.org/nix/manual/#ssec-multi-user. If you wish to continue with a single-user install for $USER please run 'chown -R $USER $dest' as root." >&2
echo "$0: directory $dest exists, but is not writable by you. This could indicate that another user has already performed a single-user installation of Nix on this system. If you wish to enable multi-user support see http://nixos.org/nix/manual/#ssec-multi-user. If you wish to continue with a single-user install for $USER please run chown -R $USER $dest as root." >&2
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions scripts/nix-copy-closure.in
Expand Up @@ -38,7 +38,7 @@ while (@ARGV) {
exec "man nix-copy-closure" or die;
}
elsif ($arg eq "--gzip" || $arg eq "--bzip2" || $arg eq "--xz") {
warn "$0: '$arg' is not implemented\n" if $arg ne "--gzip";
warn "$0: $arg is not implemented\n" if $arg ne "--gzip";
push @globalSshOpts, "-C";
}
elsif ($arg eq "--from") {
Expand All @@ -51,7 +51,7 @@ while (@ARGV) {
$includeOutputs = 1;
}
elsif ($arg eq "--show-progress") {
warn "$0: '$arg' is not implemented\n";
warn "$0: $arg is not implemented\n";
}
elsif ($arg eq "--dry-run") {
$dryRun = 1;
Expand Down Expand Up @@ -93,7 +93,7 @@ else { # Copy FROM the remote machine.

# Export the store paths on the remote machine and import them locally.
if (scalar @missing > 0) {
print STDERR "copying ", scalar @missing, " missing paths from '$sshHost'...\n";
print STDERR "copying ", scalar @missing, " missing paths from $sshHost...\n";
writeInt(5, $to); # == cmdExportPaths
writeInt(0, $to); # obsolete
writeStrings(\@missing, $to);
Expand Down
20 changes: 10 additions & 10 deletions src/buildenv/buildenv.cc
Expand Up @@ -12,7 +12,7 @@ static bool isDirectory (const Path & path)
{
struct stat st;
if (stat(path.c_str(), &st) == -1)
throw SysError(format("getting status of '%1%'") % path);
throw SysError(format("getting status of %1%") % path);
return S_ISDIR(st.st_mode);
}

Expand Down Expand Up @@ -53,18 +53,18 @@ static void createLinks(const Path & srcDir, const Path & dstDir, int priority)
} else if (S_ISLNK(dstSt.st_mode)) {
auto target = readLink(dstFile);
if (!isDirectory(target))
throw Error(format("collision between '%1%' and non-directory '%2%'")
throw Error(format("collision between %1% and non-directory %2%")
% srcFile % target);
if (unlink(dstFile.c_str()) == -1)
throw SysError(format("unlinking '%1%'") % dstFile);
throw SysError(format("unlinking %1%") % dstFile);
if (mkdir(dstFile.c_str(), 0755) == -1)
throw SysError(format("creating directory '%1%'"));
throw SysError(format("creating directory %1%"));
createLinks(target, dstFile, priorities[dstFile]);
createLinks(srcFile, dstFile, priority);
continue;
}
} else if (errno != ENOENT)
throw SysError(format("getting status of '%1%'") % dstFile);
throw SysError(format("getting status of %1%") % dstFile);
} else {
struct stat dstSt;
auto res = lstat(dstFile.c_str(), &dstSt);
Expand All @@ -74,17 +74,17 @@ static void createLinks(const Path & srcDir, const Path & dstDir, int priority)
auto prevPriority = priorities[dstFile];
if (prevPriority == priority)
throw Error(format(
"collision between '%1%' and '%2%'; "
"use 'nix-env --set-flag priority NUMBER PKGNAME' "
"collision between %1% and %2%; "
"use nix-env --set-flag priority NUMBER PKGNAME "
"to change the priority of one of the conflicting packages"
) % srcFile % target);
if (prevPriority < priority)
continue;
if (unlink(dstFile.c_str()) == -1)
throw SysError(format("unlinking '%1%'") % dstFile);
throw SysError(format("unlinking %1%") % dstFile);
}
} else if (errno != ENOENT)
throw SysError(format("getting status of '%1%'") % dstFile);
throw SysError(format("getting status of %1%") % dstFile);
}
createSymlink(srcFile, dstFile);
priorities[dstFile] = priority;
Expand Down Expand Up @@ -112,7 +112,7 @@ static void addPkg(const Path & pkgDir, int priority)
if (!fd) {
if (errno == ENOENT)
return;
throw SysError(format("opening '%1%'") % propagatedFN);
throw SysError(format("opening %1%") % propagatedFN);
}
propagated = readLine(fd.get());
}
Expand Down
6 changes: 3 additions & 3 deletions src/download-via-ssh/download-via-ssh.cc
Expand Up @@ -85,7 +85,7 @@ static void query(std::pair<FdSink, FdSource> & pipes)
std::cout << readLongLong(pipes.second) << std::endl;
}
} else
throw Error(format("unknown substituter query '%1%'") % cmd);
throw Error(format("unknown substituter query %1%") % cmd);
std::cout << std::endl;
}
}
Expand Down Expand Up @@ -132,10 +132,10 @@ int main(int argc, char * * argv)
throw UsageError("download-via-ssh: --substitute takes exactly two arguments");
Path storePath = argv[2];
Path destPath = argv[3];
printError(format("downloading '%1%' via SSH from '%2%'...") % storePath % host);
printError(format("downloading %1% via SSH from %2%...") % storePath % host);
substitute(pipes, storePath, destPath);
}
else
throw UsageError(format("download-via-ssh: unknown command '%1%'") % arg);
throw UsageError(format("download-via-ssh: unknown command %1%") % arg);
});
}
14 changes: 7 additions & 7 deletions src/libexpr/attr-path.cc
Expand Up @@ -19,7 +19,7 @@ static Strings parseAttrPath(const string & s)
++i;
while (1) {
if (i == s.end())
throw Error(format("missing closing quote in selection path '%1%'") % s);
throw Error(format("missing closing quote in selection path %1%") % s);
if (*i == '"') break;
cur.push_back(*i++);
}
Expand All @@ -38,7 +38,7 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath,
Strings tokens = parseAttrPath(attrPath);

Error attrError =
Error(format("attribute selection path '%1%' does not match expression") % attrPath);
Error(format("attribute selection path %1% does not match expression") % attrPath);

Value * v = &vIn;

Expand All @@ -62,27 +62,27 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath,

if (v->type != tAttrs)
throw TypeError(
format("the expression selected by the selection path '%1%' should be a set but is %2%")
format("the expression selected by the selection path %1% should be a set but is %2%")
% attrPath % showType(*v));

if (attr.empty())
throw Error(format("empty attribute name in selection path '%1%'") % attrPath);
throw Error(format("empty attribute name in selection path %1%") % attrPath);

Bindings::iterator a = v->attrs->find(state.symbols.create(attr));
if (a == v->attrs->end())
throw Error(format("attribute '%1%' in selection path '%2%' not found") % attr % attrPath);
throw Error(format("attribute %1% in selection path %2% not found") % attr % attrPath);
v = &*a->value;
}

else if (apType == apIndex) {

if (!v->isList())
throw TypeError(
format("the expression selected by the selection path '%1%' should be a list but is %2%")
format("the expression selected by the selection path %1% should be a list but is %2%")
% attrPath % showType(*v));

if (attrIndex >= v->listSize())
throw Error(format("list index %1% in selection path '%2%' is out of range") % attrIndex % attrPath);
throw Error(format("list index %1% in selection path %2% is out of range") % attrIndex % attrPath);

v = v->listElems()[attrIndex];
}
Expand Down

1 comment on commit 215b70f

@layus
Copy link
Member

@layus layus commented on 215b70f Feb 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edolstra Would you mind commenting on this decision ? Should we open a thread on the ML to get this properly discussed ? Surely you are aware that these unicode quotes are a pain when copy-paste from the terminal ? We are still puzzled about your decision in #1140

Please sign in to comment.