Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4490cfad6cda
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: eba1f794184f
Choose a head ref
  • 15 commits
  • 15 files changed
  • 14 contributors

Commits on Jan 14, 2020

  1. Copy the full SHA
    2becf7f View commit details
  2. diffoscope: enable on darwin

    LnL7 committed Jan 14, 2020
    Copy the full SHA
    ef09ceb View commit details
  3. doc: Make prompt unselectable

    Weirdly, no-one seems to have noticed this was broken.
    jtojnar committed Jan 14, 2020
    Copy the full SHA
    8334b83 View commit details
  4. doc: Make callout marks in code unselectable

    To make example copying easier.
    jtojnar committed Jan 14, 2020
    Copy the full SHA
    1e6265a View commit details
  5. glog: remove static flag

    tobim committed Jan 14, 2020
    Copy the full SHA
    d48a993 View commit details
  6. lib/types: prioritise coercedType in coercedTo

    This more intuitively matches `types.either` and allows paths to be
    coerced to submodules again, which was inhibited by #76861
    arcnmx committed Jan 14, 2020
    Copy the full SHA
    92b464d View commit details
  7. Merge pull request #77675 from taku0/flashplayer-32.0.0.314

    flashplayer: 32.0.0.303 -> 32.0.0.314
    7c6f434c authored Jan 14, 2020
    Copy the full SHA
    ad2289a View commit details
  8. Merge #77682: glog: remove static flag

    It was re-introduced by incorrect merge-conflict resolution.
    vcunat committed Jan 14, 2020
    Copy the full SHA
    018e297 View commit details
  9. pythonPackages.pynrrd: init at 0.4.2

    bcdarwin authored and Jon committed Jan 14, 2020
    Copy the full SHA
    8f1994c View commit details
  10. lib/types: prioritise coercedType in coercedTo (#77691)

    lib/types: prioritise coercedType in coercedTo
    infinisil authored Jan 14, 2020
    Copy the full SHA
    42cc5c2 View commit details
  11. Merge pull request #77683 from jtojnar/prompt-no-select

    doc: Make callout marks & prompts unselectable
    grahamc authored Jan 14, 2020
    Copy the full SHA
    6ed0b0a View commit details
  12. public-inbox: fix build

    This fixes some two-digit year rounding bugs that started triggering
    because 2020 is closer to 2070 than 1970.  Apparently two digits years
    are still a thing.
    alyssais committed Jan 14, 2020
    Copy the full SHA
    10b1ba0 View commit details
  13. openssl: fix build linux with clangStdenv

    Mic92 authored and teto committed Jan 14, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    netixx netixx
    Copy the full SHA
    00a2084 View commit details
  14. Merge pull request #77666 from LnL7/darwin-diffoscope

    diffoscope: enable on darwin
    teto authored Jan 14, 2020
    Copy the full SHA
    ece8290 View commit details
  15. pythonPackages.venvShellHook: init

    This is a hook that loads a virtualenv from the specified `venvDir`
    location. If the virtualenv does not exist, it is created.
    FRidh committed Jan 14, 2020
    Copy the full SHA
    eba1f79 View commit details
1 change: 1 addition & 0 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -833,6 +833,7 @@ used in `buildPythonPackage`.
- `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder.
- `setuptoolsBuildHook` to build a wheel using `setuptools`.
- `setuptoolsCheckHook` to run tests with `python setup.py test`.
- `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A `venv` is created if it does not yet exist.
- `wheelUnpackHook` to move a wheel to the correct folder so it can be installed with the `pipInstallHook`.

### Development mode
15 changes: 14 additions & 1 deletion doc/overrides.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
.docbook .xref img[src^=images\/callouts\/],
.screen img,
.programlisting img {
.programlisting img,
.literallayout img,
.synopsis img {
width: 1em;
}

.calloutlist img {
width: 1.5em;
}

.prompt,
.screen img,
.programlisting img,
.literallayout img,
.synopsis img {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
8 changes: 4 additions & 4 deletions lib/types.nix
Original file line number Diff line number Diff line change
@@ -590,7 +590,7 @@ rec {
tail' = tail ts;
in foldl' either head' tail';

# Either value of type `finalType` or `coercedType`, the latter is
# Either value of type `coercedType` or `finalType`, the former is
# converted to `finalType` using `coerceFunc`.
coercedTo = coercedType: coerceFunc: finalType:
assert lib.assertMsg (coercedType.getSubModules == null)
@@ -599,12 +599,12 @@ rec {
mkOptionType rec {
name = "coercedTo";
description = "${finalType.description} or ${coercedType.description} convertible to it";
check = x: finalType.check x || (coercedType.check x && finalType.check (coerceFunc x));
check = x: (coercedType.check x && finalType.check (coerceFunc x)) || finalType.check x;
merge = loc: defs:
let
coerceVal = val:
if finalType.check val then val
else coerceFunc val;
if coercedType.check val then coerceFunc val
else val;
in finalType.merge loc (map (def: def // { value = coerceVal def.value; }) defs);
emptyValue = finalType.emptyValue;
getSubOptions = finalType.getSubOptions;
4 changes: 2 additions & 2 deletions pkgs/applications/networking/browsers/chromium/plugins.nix
Original file line number Diff line number Diff line change
@@ -45,11 +45,11 @@ let

flash = stdenv.mkDerivation rec {
pname = "flashplayer-ppapi";
version = "32.0.0.303";
version = "32.0.0.314";

src = fetchzip {
url = "https://fpdownload.adobe.com/pub/flashplayer/pdc/${version}/flash_player_ppapi_linux.x86_64.tar.gz";
sha256 = "0b2cw8y9rif2p0lyy2ir1v5lchxlsh543b9c743a2p85c9p7q62b";
sha256 = "05xcscpzglpfpiiqc3ngs5snxli99irjk18g5vdhw91jk9808gnl";
stripRoot = false;
};

Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ let
in
stdenv.mkDerivation rec {
pname = "flashplayer";
version = "32.0.0.303";
version = "32.0.0.314";

src = fetchurl {
url =
@@ -85,14 +85,14 @@ stdenv.mkDerivation rec {
sha256 =
if debug then
if arch == "x86_64" then
"05hfc5ywmcvp6zf8aqmzjp3qy3byp0zdl0ssrv9gvzcskdqkhsj2"
"076l93wjcy15sic88cyq6msp87gdhcvbk4ym2vbvvjz2bav2z456"
else
"12hl8lvxz648ha70gi3v85mwf0nnayjiaslr669vjan3ww94jymv"
"0kxr8d6fh00akqgk3lwv0z6rk7xswislicsbh9b9p33f19mj7c8a"
else
if arch == "x86_64" then
"0x0mabgswly2v8z13832pkbjsv404aq61pback6sgmp2lyycdg6w"
"0a3hvp0qmqlann8k875ajf0i70cv0an1a3mr8kbgji46dxqvwjxz"
else
"16kbpf1i3aqlrfbfh5ncg1n46ncl9hp6qdp36s5j3ivbc68pj81z";
"0jyywas2z7ssgzng82qgnp01gy6nccqavkbx9529m07xrclvqbxn";
};

nativeBuildInputs = [ unzip ];
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@

stdenv.mkDerivation {
pname = "flashplayer-standalone";
version = "32.0.0.303";
version = "32.0.0.314";

src = fetchurl {
url =
@@ -60,9 +60,9 @@ stdenv.mkDerivation {
"https://fpdownload.macromedia.com/pub/flashplayer/updaters/32/flash_player_sa_linux.x86_64.tar.gz";
sha256 =
if debug then
"0xkzlv90lpyy54j6pllknrp1l9vjyh6dsl63l4c8cgh4i830gi14"
"0zlin94rip13rn58m7v5l6m20ylnw59l77rbg5j5qyxkr53zawdz"
else
"0mi3ggv6zhzmdd1h68cgl87n6izhp0pbkhnidd2gl2cp95f23c2d";
"0pfrm02iwa01pqx3adqj0sw27p1ddlz9knjky6x248ak8zywsqr2";
};

nativeBuildInputs = [ unzip ];
12 changes: 12 additions & 0 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
{ python
, callPackage
, makeSetupHook
, disabledIf
, isPy3k
, ensureNewerSourcesForZipFilesHook
}:

let
@@ -109,6 +112,15 @@ in rec {
};
} ./setuptools-check-hook.sh) {};

venvShellHook = disabledIf (!isPy3k) (callPackage ({ }:
makeSetupHook {
name = "venv-shell-hook";
deps = [ ensureNewerSourcesForZipFilesHook ];
substitutions = {
inherit pythonInterpreter;
};
} ./venv-shell-hook.sh) {});

wheelUnpackHook = callPackage ({ wheel }:
makeSetupHook {
name = "wheel-unpack-hook.sh";
26 changes: 26 additions & 0 deletions pkgs/development/interpreters/python/hooks/venv-shell-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
venvShellHook() {
echo "Executing venvHook"
runHook preShellHook

if [ -d "${venvDir}" ]; then
echo "Skipping venv creation, '${venvDir}' already exists"
else
echo "Creating new venv environment in path: '${venvDir}'"
@pythonInterpreter@ -m venv "${venvDir}"
fi

source "${venvDir}/bin/activate"

runHook postShellHook
echo "Finished executing venvShellHook"
}

if [ -z "${dontUseVenvShellHook:-}" ] && [ -z "${shellHook-}" ]; then
echo "Using venvShellHook"
if [ -z "${venvDir-}" ]; then
echo "Error: \`venvDir\` should be set when using \`venvShellHook\`."
exit 1
else
shellHook=venvShellHook
fi
fi
4 changes: 2 additions & 2 deletions pkgs/development/libraries/glog/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gflags, perl, static ? false }:
{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gflags, perl }:

stdenv.mkDerivation rec {
pname = "glog";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {

propagatedBuildInputs = [ gflags ];

cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];

checkInputs = [ perl ];
doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
2 changes: 1 addition & 1 deletion pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ let

outputs = [ "bin" "dev" "out" "man" ] ++ optional withDocs "doc";
setOutputFlags = false;
separateDebugInfo = stdenv.hostPlatform.isLinux;
separateDebugInfo = stdenv.cc.isGNU;

nativeBuildInputs = [ perl ];
buildInputs = stdenv.lib.optional withCryptodev cryptodev;
27 changes: 27 additions & 0 deletions pkgs/development/python-modules/pynrrd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, numpy
, pytest
}:

buildPythonPackage rec {
pname = "pynrrd";
version = "0.4.2";

src = fetchFromGitHub {
owner = "mhe";
repo = pname;
rev = "v${version}";
sha256 = "1wn3ara3i19fi1y9a5j4imyczpa6dkkzd5djggxg4kkl1ff9awrj";
};

propagatedBuildInputs = [ numpy ];

meta = with lib; {
homepage = https://github.com/mhe/pynrrd;
description = "Simple pure-Python reader for NRRD files";
license = licenses.mit;
maintainers = with maintainers; [ bcdarwin ];
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
From c9b5164c954cd0de80d971f1c4ced16bf41ea81b Mon Sep 17 00:00:00 2001
From: Eric Wong <e@80x24.org>
Date: Fri, 29 Nov 2019 12:25:07 +0000
Subject: [PATCH 2/2] msgtime: drop Date::Parse for RFC2822

Date::Parse is not optimized for RFC2822 dates and isn't
packaged on OpenBSD. It's still useful for historical
email when email clients were less conformant, but is
less relevant for new emails.
---
lib/PublicInbox/MsgTime.pm | 115 ++++++++++++++++++++++++++++++++-----
t/msgtime.t | 6 ++
2 files changed, 107 insertions(+), 14 deletions(-)

diff --git a/lib/PublicInbox/MsgTime.pm b/lib/PublicInbox/MsgTime.pm
index 58e11d72..e9b27a49 100644
--- a/lib/PublicInbox/MsgTime.pm
+++ b/lib/PublicInbox/MsgTime.pm
@@ -7,24 +7,114 @@ use strict;
use warnings;
use base qw(Exporter);
our @EXPORT_OK = qw(msg_timestamp msg_datestamp);
-use Date::Parse qw(str2time strptime);
+use Time::Local qw(timegm);
+my @MoY = qw(january february march april may june
+ july august september october november december);
+my %MoY;
+@MoY{@MoY} = (0..11);
+@MoY{map { substr($_, 0, 3) } @MoY} = (0..11);
+
+my %OBSOLETE_TZ = ( # RFC2822 4.3 (Obsolete Date and Time)
+ EST => '-0500', EDT => '-0400',
+ CST => '-0600', CDT => '-0500',
+ MST => '-0700', MDT => '-0600',
+ PST => '-0800', PDT => '-0700',
+ UT => '+0000', GMT => '+0000', Z => '+0000',
+
+ # RFC2822 states:
+ # The 1 character military time zones were defined in a non-standard
+ # way in [RFC822] and are therefore unpredictable in their meaning.
+);
+my $OBSOLETE_TZ = join('|', keys %OBSOLETE_TZ);

sub str2date_zone ($) {
my ($date) = @_;
+ my ($ts, $zone);
+
+ # RFC822 is most likely for email, but we can tolerate an extra comma
+ # or punctuation as long as all the data is there.
+ # We'll use '\s' since Unicode spaces won't affect our parsing.
+ # SpamAssassin ignores commas and redundant spaces, too.
+ if ($date =~ /(?:[A-Za-z]+,?\s+)? # day-of-week
+ ([0-9]+),?\s+ # dd
+ ([A-Za-z]+)\s+ # mon
+ ([0-9]{2,})\s+ # YYYY or YY (or YYY :P)
+ ([0-9]+)[:\.] # HH:
+ ((?:[0-9]{2})|(?:\s?[0-9])) # MM
+ (?:[:\.]((?:[0-9]{2})|(?:\s?[0-9])))? # :SS
+ \s+ # a TZ offset is required:
+ ([\+\-])? # TZ sign
+ [\+\-]* # I've seen extra "-" e.g. "--500"
+ ([0-9]+|$OBSOLETE_TZ)(?:\s|$) # TZ offset
+ /xo) {
+ my ($dd, $m, $yyyy, $hh, $mm, $ss, $sign, $tz) =
+ ($1, $2, $3, $4, $5, $6, $7, $8);
+ # don't accept non-English months
+ defined(my $mon = $MoY{lc($m)}) or return;
+
+ if (defined(my $off = $OBSOLETE_TZ{$tz})) {
+ $sign = substr($off, 0, 1);
+ $tz = substr($off, 1);
+ }
+
+ # Y2K problems: 3-digit years, follow RFC2822
+ if (length($yyyy) <= 3) {
+ $yyyy += 1900;
+
+ # and 2-digit years from '09 (2009) (0..49)
+ $yyyy += 100 if $yyyy < 1950;
+ }
+
+ $ts = timegm($ss // 0, $mm, $hh, $dd, $mon, $yyyy);

- my $ts = str2time($date);
- return undef unless(defined $ts);
+ # Compute the time offset from [+-]HHMM
+ $tz //= 0;
+ my ($tz_hh, $tz_mm);
+ if (length($tz) == 1) {
+ $tz_hh = $tz;
+ $tz_mm = 0;
+ } elsif (length($tz) == 2) {
+ $tz_hh = 0;
+ $tz_mm = $tz;
+ } else {
+ $tz_hh = $tz;
+ $tz_hh =~ s/([0-9]{2})\z//;
+ $tz_mm = $1;
+ }
+ while ($tz_mm >= 60) {
+ $tz_mm -= 60;
+ $tz_hh += 1;
+ }
+ $sign //= '+';
+ my $off = $sign . ($tz_mm * 60 + ($tz_hh * 60 * 60));
+ $ts -= $off;
+ $sign = '+' if $off == 0;
+ $zone = sprintf('%s%02d%02d', $sign, $tz_hh, $tz_mm);

- # off is the time zone offset in seconds from GMT
- my ($ss,$mm,$hh,$day,$month,$year,$off) = strptime($date);
- return undef unless(defined $off);
+ # Time::Zone and Date::Parse are part of the same distibution,
+ # and we need Time::Zone to deal with tz names like "EDT"
+ } elsif (eval { require Date::Parse }) {
+ $ts = Date::Parse::str2time($date);
+ return undef unless(defined $ts);

- # Compute the time zone from offset
- my $sign = ($off < 0) ? '-' : '+';
- my $hour = abs(int($off / 3600));
- my $min = ($off / 60) % 60;
- my $zone = sprintf('%s%02d%02d', $sign, $hour, $min);
+ # off is the time zone offset in seconds from GMT
+ my ($ss,$mm,$hh,$day,$month,$year,$off) =
+ Date::Parse::strptime($date);
+ return undef unless(defined $off);
+
+ # Compute the time zone from offset
+ my $sign = ($off < 0) ? '-' : '+';
+ my $hour = abs(int($off / 3600));
+ my $min = ($off / 60) % 60;
+
+ $zone = sprintf('%s%02d%02d', $sign, $hour, $min);
+ } else {
+ warn "Date::Parse missing for non-RFC822 date: $date\n";
+ return undef;
+ }

+ # Note: we've already applied the offset to $ts at this point,
+ # but we want to keep "git fsck" happy.
# "-1200" is the furthest westermost zone offset,
# but git fast-import is liberal so we use "-1400"
if ($zone >= 1400 || $zone <= -1400) {
@@ -59,9 +149,6 @@ sub msg_date_only ($) {
my @date = $hdr->header_raw('Date');
my ($ts);
foreach my $d (@date) {
- # Y2K problems: 3-digit years
- $d =~ s!([A-Za-z]{3}) ([0-9]{3}) ([0-9]{2}:[0-9]{2}:[0-9]{2})!
- my $yyyy = $2 + 1900; "$1 $yyyy $3"!e;
$ts = eval { str2date_zone($d) } and return $ts;
if ($@) {
my $mid = $hdr->header_raw('Message-ID');
diff --git a/t/msgtime.t b/t/msgtime.t
index 6b396602..d9643b65 100644
--- a/t/msgtime.t
+++ b/t/msgtime.t
@@ -84,4 +84,10 @@ is_deeply(datestamp('Fri, 28 Jun 2002 12:54:40 -700'), [1025294080, '-0700']);
is_deeply(datestamp('Sat, 12 Jan 2002 12:52:57 -200'), [1010847177, '-0200']);
is_deeply(datestamp('Mon, 05 Nov 2001 10:36:16 -800'), [1004985376, '-0800']);

+# obsolete formats described in RFC2822
+for (qw(UT GMT Z)) {
+ is_deeply(datestamp('Fri, 02 Oct 1993 00:00:00 '.$_), [ 749520000, '+0000']);
+}
+is_deeply(datestamp('Fri, 02 Oct 1993 00:00:00 EDT'), [ 749534400, '-0400']);
+
done_testing();
--
2.24.1

Loading