diff -pruN 1:27.1+1-3/debian/changelog 1:27.1+1-3.1/debian/changelog
--- 1:27.1+1-3/debian/changelog	2020-11-07 22:16:23.000000000 +0000
+++ 1:27.1+1-3.1/debian/changelog	2021-03-20 21:41:44.000000000 +0000
@@ -1,3 +1,12 @@
+emacs (1:27.1+1-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * d/p/0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch:
+    Skip tests that require internet connection, fixing a FTBFS.
+    (Closes: #982969)
+
+ -- Sergio Durigan Junior <sergiodj@debian.org>  Sat, 20 Mar 2021 17:41:44 -0400
+
 emacs (1:27.1+1-3) unstable; urgency=medium
 
   * Strip parent path from package descriptions for reprodcibility.  Add
diff -pruN 1:27.1+1-3/debian/.git-dpm 1:27.1+1-3.1/debian/.git-dpm
--- 1:27.1+1-3/debian/.git-dpm	2020-11-07 22:14:00.000000000 +0000
+++ 1:27.1+1-3.1/debian/.git-dpm	2021-03-20 21:41:44.000000000 +0000
@@ -1,6 +1,6 @@
 # see git-dpm(1) from git-dpm package
-d1c7856ed466f639a9496c05a64d1b9f3af88c80
-d1c7856ed466f639a9496c05a64d1b9f3af88c80
+c49f9362b3861b208b629ee850574f83b848386f
+c49f9362b3861b208b629ee850574f83b848386f
 d429af9a70839a40bba83ebeaa33ad8d7219fbcd
 d429af9a70839a40bba83ebeaa33ad8d7219fbcd
 emacs_27.1+1.orig.tar.xz
diff -pruN 1:27.1+1-3/debian/patches/0001-Prefer-usr-share-info-emacs.patch 1:27.1+1-3.1/debian/patches/0001-Prefer-usr-share-info-emacs.patch
--- 1:27.1+1-3/debian/patches/0001-Prefer-usr-share-info-emacs.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0001-Prefer-usr-share-info-emacs.patch	2021-03-20 21:41:44.000000000 +0000
@@ -15,7 +15,7 @@ diff --git a/lisp/info.el b/lisp/info.el
 index 033a7a5cbb5..3bed743b9a6 100644
 --- a/lisp/info.el
 +++ b/lisp/info.el
-@@ -222,7 +222,8 @@ Info-default-directory-list
+@@ -222,7 +222,8 @@ A header-line does not scroll with the rest of the buffer."
  	      (nconc standard-info-dirs (list config-dir))
  	    (cons config-dir standard-info-dirs))))
      (if (not (eq system-type 'windows-nt))
diff -pruN 1:27.1+1-3/debian/patches/0002-Run-debian-startup-and-set-debian-emacs-flavor.patch 1:27.1+1-3.1/debian/patches/0002-Run-debian-startup-and-set-debian-emacs-flavor.patch
--- 1:27.1+1-3/debian/patches/0002-Run-debian-startup-and-set-debian-emacs-flavor.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0002-Run-debian-startup-and-set-debian-emacs-flavor.patch	2021-03-20 21:41:44.000000000 +0000
@@ -19,7 +19,7 @@ diff --git a/lisp/startup.el b/lisp/star
 index bff10003f84..78cd8dd0e3a 100644
 --- a/lisp/startup.el
 +++ b/lisp/startup.el
-@@ -436,6 +436,10 @@ tutorial-directory
+@@ -436,6 +436,10 @@ Warning Warning!!!  Pure space overflow    !!!Warning Warning
    :type 'directory
    :initialize #'custom-initialize-delay)
  
@@ -30,7 +30,7 @@ index bff10003f84..78cd8dd0e3a 100644
  (defun normal-top-level-add-subdirs-to-load-path ()
    "Recursively add all subdirectories of `default-directory' to `load-path'.
  More precisely, this uses only the subdirectories whose names
-@@ -1361,7 +1365,14 @@ command-line
+@@ -1361,7 +1365,14 @@ please check its value")
          ;; Sites should not disable the startup screen.
          ;; Only individuals should disable the startup screen.
          (let ((inhibit-startup-screen inhibit-startup-screen))
diff -pruN 1:27.1+1-3/debian/patches/0003-Remove-files-that-appear-to-be-incompatible-with-the.patch 1:27.1+1-3.1/debian/patches/0003-Remove-files-that-appear-to-be-incompatible-with-the.patch
--- 1:27.1+1-3/debian/patches/0003-Remove-files-that-appear-to-be-incompatible-with-the.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0003-Remove-files-that-appear-to-be-incompatible-with-the.patch	2021-03-20 21:41:44.000000000 +0000
@@ -253,7 +253,7 @@ diff --git a/lisp/help.el b/lisp/help.el
 index 0f1991e3185..775dd35cbb1 100644
 --- a/lisp/help.el
 +++ b/lisp/help.el
-@@ -296,6 +296,14 @@ view-help-file
+@@ -296,6 +296,14 @@ If that doesn't give a function, return nil."
    (goto-address-mode 1)
    (goto-char (point-min)))
  
diff -pruN 1:27.1+1-3/debian/patches/0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch 1:27.1+1-3.1/debian/patches/0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch
--- 1:27.1+1-3/debian/patches/0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch	2021-03-20 21:41:44.000000000 +0000
@@ -15,7 +15,7 @@ diff --git a/lisp/version.el b/lisp/vers
 index bf666cbff99..2c8f26de9e6 100644
 --- a/lisp/version.el
 +++ b/lisp/version.el
-@@ -62,7 +62,7 @@ emacs-version
+@@ -62,7 +62,7 @@ Don't use this function in programs to choose actions according
  to the system configuration; look at `system-configuration' instead."
    (interactive "P")
    (let ((version-string
diff -pruN 1:27.1+1-3/debian/patches/0007-Kill-gpg-agent-in-package-test.el-to-avoid-a-race.patch 1:27.1+1-3.1/debian/patches/0007-Kill-gpg-agent-in-package-test.el-to-avoid-a-race.patch
--- 1:27.1+1-3/debian/patches/0007-Kill-gpg-agent-in-package-test.el-to-avoid-a-race.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0007-Kill-gpg-agent-in-package-test.el-to-avoid-a-race.patch	2021-03-20 21:41:44.000000000 +0000
@@ -23,7 +23,7 @@ diff --git a/test/lisp/emacs-lisp/packag
 index 4fcaf0e84c2..4cf49752605 100644
 --- a/test/lisp/emacs-lisp/package-tests.el
 +++ b/test/lisp/emacs-lisp/package-tests.el
-@@ -155,7 +155,14 @@ package-test-fake-contents-file
+@@ -155,7 +155,14 @@
                 ,@body)))
  
         (when (file-directory-p package-test-user-dir)
diff -pruN 1:27.1+1-3/debian/patches/0008-Don-t-downcase-real-xref-in-elisp-mode-tests.patch 1:27.1+1-3.1/debian/patches/0008-Don-t-downcase-real-xref-in-elisp-mode-tests.patch
--- 1:27.1+1-3/debian/patches/0008-Don-t-downcase-real-xref-in-elisp-mode-tests.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0008-Don-t-downcase-real-xref-in-elisp-mode-tests.patch	2021-03-20 21:41:44.000000000 +0000
@@ -16,7 +16,7 @@ diff --git a/test/lisp/progmodes/elisp-m
 index 2ba00656862..f4076574a72 100644
 --- a/test/lisp/progmodes/elisp-mode-tests.el
 +++ b/test/lisp/progmodes/elisp-mode-tests.el
-@@ -311,11 +311,15 @@ xref--case-insensitive
+@@ -311,11 +311,15 @@
  (defun xref-elisp-test-run (xrefs expected-xrefs)
    (should (= (length xrefs) (length expected-xrefs)))
    (while xrefs
@@ -33,7 +33,7 @@ index 2ba00656862..f4076574a72 100644
        ;; Downcase the filenames for case-insensitive file systems.
        (when xref--case-insensitive
          (setf (xref-elisp-location-file (oref xref location))
-@@ -327,7 +331,7 @@ xref-elisp-test-run
+@@ -327,7 +331,7 @@
  
        (should (equal xref expected-xref))
  
diff -pruN 1:27.1+1-3/debian/patches/0010-Mark-echo-server-with-dns-test-as-unstable-for-now.patch 1:27.1+1-3.1/debian/patches/0010-Mark-echo-server-with-dns-test-as-unstable-for-now.patch
--- 1:27.1+1-3/debian/patches/0010-Mark-echo-server-with-dns-test-as-unstable-for-now.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0010-Mark-echo-server-with-dns-test-as-unstable-for-now.patch	2021-03-20 21:41:44.000000000 +0000
@@ -12,7 +12,7 @@ diff --git a/test/lisp/net/network-strea
 index 28686547a44..a0df0a26672 100644
 --- a/test/lisp/net/network-stream-tests.el
 +++ b/test/lisp/net/network-stream-tests.el
-@@ -137,6 +137,7 @@ server-process-filter
+@@ -137,6 +137,7 @@
        ))))
  
  (ert-deftest echo-server-with-dns ()
diff -pruN 1:27.1+1-3/debian/patches/0011-emacs-module-tests-fix-VPATH-builds.patch 1:27.1+1-3.1/debian/patches/0011-emacs-module-tests-fix-VPATH-builds.patch
--- 1:27.1+1-3/debian/patches/0011-emacs-module-tests-fix-VPATH-builds.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0011-emacs-module-tests-fix-VPATH-builds.patch	2021-03-20 21:41:44.000000000 +0000
@@ -31,7 +31,7 @@ diff --git a/test/src/emacs-module-tests
 index 91206156f85..1b512aff566 100644
 --- a/test/src/emacs-module-tests.el
 +++ b/test/src/emacs-module-tests.el
-@@ -318,14 +318,15 @@ module--test-assertion
+@@ -318,14 +318,15 @@ local reference."
    (with-temp-buffer
      (let ((standard-output (current-buffer)))
        (describe-function-1 #'mod-test-sum)
diff -pruN 1:27.1+1-3/debian/patches/0012-Strip-parent-path-from-package-descriptions-for-repr.patch 1:27.1+1-3.1/debian/patches/0012-Strip-parent-path-from-package-descriptions-for-repr.patch
--- 1:27.1+1-3/debian/patches/0012-Strip-parent-path-from-package-descriptions-for-repr.patch	2020-11-07 22:13:58.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0012-Strip-parent-path-from-package-descriptions-for-repr.patch	2021-03-20 21:41:44.000000000 +0000
@@ -19,7 +19,7 @@ diff --git a/lisp/emacs-lisp/package.el
 index 7d6be3cf4e2..60561fdb678 100644
 --- a/lisp/emacs-lisp/package.el
 +++ b/lisp/emacs-lisp/package.el
-@@ -963,7 +963,11 @@ package-generate-description-file
+@@ -963,7 +963,11 @@ untar into a directory named DIR; otherwise, signal an error."
        (write-region
         (concat
          ";;; Generated package description from "
diff -pruN 1:27.1+1-3/debian/patches/0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch 1:27.1+1-3.1/debian/patches/0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch
--- 1:27.1+1-3/debian/patches/0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch	2021-03-20 21:41:44.000000000 +0000
@@ -0,0 +1,165 @@
+From c49f9362b3861b208b629ee850574f83b848386f Mon Sep 17 00:00:00 2001
+From: Robert Pluim <rpluim@gmail.com>
+Date: Mon, 22 Feb 2021 15:48:06 +0100
+Subject: Skip tests that require Internet when there's no Internet
+
+Bug#46641
+
+The network-stream-tests actually work fine when the local machine has
+no IP at all, but cause a crash in the GnuTLS library when there is an
+IP configured but the interface is down.
+
+* test/lisp/net/network-stream-tests.el (internet-is-working): New
+defvar, checks if we can resolve "google.com".
+(connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait)
+(open-network-stream-tls-nowait, open-gnutls-stream-new-api-nowait)
+(open-gnutls-stream-old-api-nowait): Use it to check for working
+Internet access.
+
+* test/src/process-tests.el (internet-is-working): New defvar, checks
+if we can resolve "google.com".
+(lookup-family-specification, lookup-unicode-domains)
+(unibyte-domain-name, lookup-google, non-existent-lookup-failure): Use
+it to check for working Internet access.
+
+XXX DEBIAN: This patch was adjusted to always consider that we don't
+have internet available during tests.
+
+Origin: backport, https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a728135a2b551917588425d9758c6cc932cb591b
+Reviewed-By: Sergio Durigan Junior <sergiodj@debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982969
+Bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46641
+---
+ test/lisp/net/network-stream-tests.el | 20 ++++++++++++++++++++
+ test/src/process-tests.el             | 26 +++++++++++++++++++-------
+ 2 files changed, 39 insertions(+), 7 deletions(-)
+
+diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
+index a0df0a26672..699c2da97cf 100644
+--- a/test/lisp/net/network-stream-tests.el
++++ b/test/lisp/net/network-stream-tests.el
+@@ -30,6 +30,21 @@
+ ;; it pulls in nsm, which then makes the :nowait t' tests fail unless
+ ;; we disable the nsm, which we do by binding 'network-security-level'
+ 
++;; Check if the Internet seems to be working.  Mainly to pacify
++;; Debian's CI system.
++;;
++;; XXX DEBIAN COMMENT: We explicitly set this variable to nil because
++;; we know that there is no internet connection during build time.
++;; Also, our version of 'dns-query' does not properly return 'nil'
++;; when the interface is configured but there is no DNS configured.
++;; Although this has been fixed upstream (see commit 00f7744c1b0f), I
++;; chose not to backport the patch because it's a non-trivial change
++;; of behaviour.
++(defvar internet-is-working nil)
++;; (progn
++;;   (require 'dns)
++;;   (dns-query "google.com")))
++
+ (ert-deftest make-local-unix-server ()
+   (skip-unless (featurep 'make-network-process '(:family local)))
+   (let* ((file (make-temp-name "/tmp/server-test"))
+@@ -280,6 +295,7 @@
+ (ert-deftest connect-to-tls-ipv4-nowait ()
+   (skip-unless (executable-find "gnutls-serv"))
+   (skip-unless (gnutls-available-p))
++  (skip-unless internet-is-working)
+   (let ((server (make-tls-server 44331))
+         (times 0)
+         (network-security-level 'low)
+@@ -322,6 +338,7 @@
+ (ert-deftest connect-to-tls-ipv6-nowait ()
+   (skip-unless (executable-find "gnutls-serv"))
+   (skip-unless (gnutls-available-p))
++  (skip-unless internet-is-working)
+   (skip-unless (not (eq system-type 'windows-nt)))
+   (skip-unless (featurep 'make-network-process '(:family ipv6)))
+   (let ((server (make-tls-server 44333))
+@@ -406,6 +423,7 @@
+ (ert-deftest open-network-stream-tls-nowait ()
+   (skip-unless (executable-find "gnutls-serv"))
+   (skip-unless (gnutls-available-p))
++  (skip-unless internet-is-working)
+   (let ((server (make-tls-server 44335))
+         (times 0)
+         (network-security-level 'low)
+@@ -634,6 +652,7 @@
+ (ert-deftest open-gnutls-stream-new-api-nowait ()
+   (skip-unless (executable-find "gnutls-serv"))
+   (skip-unless (gnutls-available-p))
++  (skip-unless internet-is-working)
+   (let ((server (make-tls-server 44668))
+         (times 0)
+         (network-security-level 'low)
+@@ -672,6 +691,7 @@
+ (ert-deftest open-gnutls-stream-old-api-nowait ()
+   (skip-unless (executable-find "gnutls-serv"))
+   (skip-unless (gnutls-available-p))
++  (skip-unless internet-is-working)
+   (let ((server (make-tls-server 44669))
+         (times 0)
+         (network-security-level 'low)
+diff --git a/test/src/process-tests.el b/test/src/process-tests.el
+index 66a76fd33b8..f54bcf05047 100644
+--- a/test/src/process-tests.el
++++ b/test/src/process-tests.el
+@@ -329,12 +329,24 @@ See Bug#30460."
+                                                   invocation-directory))
+                  :stop t)))
+ 
+-;; All the following tests require working DNS, which appears not to
+-;; be the case for hydra.nixos.org, so disable them there for now.
++;; Check if the Internet seems to be working.  Mainly to pacify
++;; Debian's CI system.
++;;
++;; XXX DEBIAN COMMENT: We explicitly set this variable to nil because
++;; we know that there is no internet connection during build time.
++;; Also, our version of 'dns-query' does not properly return 'nil'
++;; when the interface is configured but there is no DNS configured.
++;; Although this has been fixed upstream (see commit 00f7744c1b0f), I
++;; chose not to backport the patch because it's a non-trivial change
++;; of behaviour.
++(defvar internet-is-working nil)
++;; (progn
++;;   (require 'dns)
++;;   (dns-query "google.com")))
+ 
+ (ert-deftest lookup-family-specification ()
+   "network-lookup-address-info should only accept valid family symbols."
+-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
++  (skip-unless internet-is-working)
+   (should-error (network-lookup-address-info "google.com" 'both))
+   (should (network-lookup-address-info "google.com" 'ipv4))
+   (when (featurep 'make-network-process '(:family ipv6))
+@@ -342,18 +354,18 @@ See Bug#30460."
+ 
+ (ert-deftest lookup-unicode-domains ()
+   "Unicode domains should fail"
+-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
++  (skip-unless internet-is-working)
+   (should-error (network-lookup-address-info "faß.de"))
+   (should (network-lookup-address-info (puny-encode-domain "faß.de"))))
+ 
+ (ert-deftest unibyte-domain-name ()
+   "Unibyte domain names should work"
+-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
++  (skip-unless internet-is-working)
+   (should (network-lookup-address-info (string-to-unibyte "google.com"))))
+ 
+ (ert-deftest lookup-google ()
+   "Check that we can look up google IP addresses"
+-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
++  (skip-unless internet-is-working)
+   (let ((addresses-both (network-lookup-address-info "google.com"))
+         (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)))
+     (should addresses-both)
+@@ -362,7 +374,7 @@ See Bug#30460."
+     (should (network-lookup-address-info "google.com" 'ipv6))))
+ 
+ (ert-deftest non-existent-lookup-failure ()
+-  (skip-unless (not (getenv "EMACS_HYDRA_CI")))
++  (skip-unless internet-is-working)
+   "Check that looking up non-existent domain returns nil"
+   (should (eq nil (network-lookup-address-info "emacs.invalid"))))
+ 
diff -pruN 1:27.1+1-3/debian/patches/series 1:27.1+1-3.1/debian/patches/series
--- 1:27.1+1-3/debian/patches/series	2020-11-07 22:14:00.000000000 +0000
+++ 1:27.1+1-3.1/debian/patches/series	2021-03-20 21:41:44.000000000 +0000
@@ -11,3 +11,4 @@
 0011-emacs-module-tests-fix-VPATH-builds.patch
 0012-Strip-parent-path-from-package-descriptions-for-repr.patch
 0013-Recover-the-contents-of-the-schemas.xml-file.patch
+0014-Skip-tests-that-require-Internet-when-there-s-no-Int.patch
