git.iko.soy/typeable/nixpkgs
on master help sign in
R: import upstream patch to fix broken "R CMD Sweave" command

The command "R CMD Sweave" always exits with error code "1", even if the command was successful. This upstream patch remedies this issue.

commit5e5d16f425397fd7cb1b42256a0dc25e76e1b4bc authorPeter Simons <simons@cryp.to> dateWed 3 May 2017, 14:04 (10 years ago) parenteacb230
2 files changed+54−2
pkgs/applications/science/math/R/default.nix+2−2 pkgs/applications/science/math/R/fix-sweave-exit-code.patch+52
pkgs/applications/science/math/R/default.nix+2−2
@@ -1,7 +1,7 @@
11{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
22, libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib
33, less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, openblas
4−, curl, Cocoa, Foundation, cf-private, libobjc, tzdata
4+, curl, Cocoa, Foundation, cf-private, libobjc, tzdata, fetchpatch
55, withRecommendedPackages ? true
66, enableStrictBarrier ? false
77}:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
2121 ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ tcl tk ]
2222 ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation cf-private libobjc ];
2323
24− patches = [ ./no-usr-local-search-paths.patch ];
24+ patches = [ ./no-usr-local-search-paths.patch ./fix-sweave-exit-code.patch ];
2525
2626 preConfigure = ''
2727 configureFlagsArray=(
pkgs/applications/science/math/R/fix-sweave-exit-code.patchnew file+52
@@ -0,0 +1,52 @@
1+From 0ff560ba912fad126576818519035c8d3c693bed Mon Sep 17 00:00:00 2001
2+From: maechler <maechler@00db46b3-68df-0310-9c12-caf00c1e9a41>
3+Date: Mon, 24 Apr 2017 14:24:11 +0000
4+Subject: [PATCH] R CMD Sweave status bug fix
5+
6+git-svn-id: https://svn.r-project.org/R/trunk@72612 00db46b3-68df-0310-9c12-caf00c1e9a41
7+
8+diff --git a/src/library/utils/R/Sweave.R b/src/library/utils/R/Sweave.R
9+index 2beb094..8d4950b 100644
10+--- a/src/library/utils/R/Sweave.R
11++++ b/src/library/utils/R/Sweave.R
12+@@ -1,7 +1,7 @@
13+ # File src/library/utils/R/Sweave.R
14+ # Part of the R package, https://www.R-project.org
15+ #
16+-# Copyright (C) 1995-2016 The R Core Team
17++# Copyright (C) 1995-2017 The R Core Team
18+ #
19+ # This program is free software; you can redistribute it and/or modify
20+ # it under the terms of the GNU General Public License as published by
21+@@ -452,10 +452,10 @@ SweaveHooks <- function(options, run = FALSE, envir = .GlobalEnv)
22+ }
23+ do_exit <-
24+ if(no.q)
25+- function(status = 1L) (if(status) stop else message)(
26++ function(status = 0L) (if(status) stop else message)(
27+ ".Sweave() exit status ", status)
28+ else
29+- function(status = 1L) q("no", status = status, runLast = FALSE)
30++ function(status = 0L) q("no", status = status, runLast = FALSE)
31+
32+ if (!length(args)) {
33+ Usage()
34+@@ -577,16 +577,15 @@ SweaveHooks <- function(options, run = FALSE, envir = .GlobalEnv)
35+ }
36+ do_exit <-
37+ if(no.q)
38+- function(status = 1L) (if(status) stop else message)(
39++ function(status = 0L) (if(status) stop else message)(
40+ ".Stangle() exit status ", status)
41+ else
42+- function(status = 1L) q("no", status = status, runLast = FALSE)
43++ function(status = 0L) q("no", status = status, runLast = FALSE)
44+
45+ if (!length(args)) {
46+ Usage()
47+ do_exit(1L)
48+ }
49+-
50+ file <- character()
51+ encoding <- options <- ""
52+ engine <- NULL