prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Installation issue: r-boot
  <!-- Thanks for taking the time to report this build failure. To proceed with the report please:
  
  1. Title the issue "Installation issue: <name-of-the-package>".
  2. Provide the information required below.
  
  We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->
  
  ### Steps to reproduce the issue
  
  <!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
  ```console
  $ spack install r-boot%fj
  ==> Error: ChecksumError: sha256 checksum failed for /home/users/ea01/ea0114/spack-stage/spack-stage-r-boot-1.3-23-mm6cmoaof62r5y527kz24snjifgwpir6/boot_1.3-23.tar.gz
      Expected 30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f but got 79236a5a770dc8bf5ce25d9aa303c5dc0574d94aa043fd00b8b4c8ccc877357f
  ```
  
  Build of `r-boot%fj` on 2020 Aug has a checksum error.
  This version added to spack at 31 Aug 2019. Please see https://github.com/spack/spack/commit/661a894c85f451a4ef868abcc9871653914361bd
  According to our log, same build succeeded on 2019 Oct. 
  
  https://cloud.r-project.org/src/contrib/boot_1.3-23.tar.gz seems to be changed between these attempts.
  We found old(30c89e19) boot_1.3-23.tar.gz from http://in.archive.ubuntu.com/pool/universe/b/boot/boot_1.3-23.orig.tar.gz
  and compared with new(79236a5a) one.
  Difference was tribial. ("Date/Publication" in boot/DESCRIPTION, and MD5 of the file in boot/MD5)
  So I would like to update checksum value.
  
  We have another question.
  In this case, we found "old" archive and proof the differnce is trivial.
  If we found checksum mismatch and could not find "old" archive to verify, 
  which is better in view of security?
  1. create issue and discuss
  2. directly make PR
  
  <!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->
  
  ### General information
  
  <!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
  - [ ] I have run `spack debug report` and reported the version of Spack/Python/Platform
  - [ ] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
  - [ ] I have uploaded the build log and environment files
  - [x] I have searched the issues of this repo and believe this is not a duplicate
  
  
  </issue>
  <code>
  [start of var/spack/repos/builtin/packages/r-boot/package.py]
  1 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
  2 # Spack Project Developers. See the top-level COPYRIGHT file for details.
  3 #
  4 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
  5 
  6 from spack import *
  7 
  8 
  9 class RBoot(RPackage):
  10     """Functions and datasets for bootstrapping from the book "Bootstrap
  11     Methods and Their Application" by A. C. Davison and D. V. Hinkley (1997,
  12     CUP), originally written by Angelo Canty for S."""
  13 
  14     homepage = "https://cloud.r-project.org/package=boot"
  15     url      = "https://cloud.r-project.org/src/contrib/boot_1.3-18.tar.gz"
  16     list_url = "https://cloud.r-project.org/src/contrib/Archive/boot"
  17 
  18     version('1.3-23', sha256='30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f')
  19     version('1.3-22', sha256='cf1f0cb1e0a7a36dcb6ae038f5d0211a0e7a009c149bc9d21acb9c58c38b4dfc')
  20     version('1.3-20', sha256='adcb90b72409705e3f9c69ea6c15673dcb649b464fed06723fe0930beac5212a')
  21     version('1.3-18', sha256='12fd237f810a69cc8d0a51a67c57eaf9506bf0341c764f8ab7c1feb73722235e')
  22 
  23     depends_on('r@3.0.0:', type=('build', 'run'))
  24
  [end of var/spack/repos/builtin/packages/r-boot/package.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/var/spack/repos/builtin/packages/r-boot/package.py b/var/spack/repos/builtin/packages/r-boot/package.py
  --- a/var/spack/repos/builtin/packages/r-boot/package.py
  +++ b/var/spack/repos/builtin/packages/r-boot/package.py
  @@ -15,7 +15,7 @@
       url      = "https://cloud.r-project.org/src/contrib/boot_1.3-18.tar.gz"
       list_url = "https://cloud.r-project.org/src/contrib/Archive/boot"
   
  -    version('1.3-23', sha256='30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f')
  +    version('1.3-23', sha256='79236a5a770dc8bf5ce25d9aa303c5dc0574d94aa043fd00b8b4c8ccc877357f')
       version('1.3-22', sha256='cf1f0cb1e0a7a36dcb6ae038f5d0211a0e7a009c149bc9d21acb9c58c38b4dfc')
       version('1.3-20', sha256='adcb90b72409705e3f9c69ea6c15673dcb649b464fed06723fe0930beac5212a')
       version('1.3-18', sha256='12fd237f810a69cc8d0a51a67c57eaf9506bf0341c764f8ab7c1feb73722235e')
  
verification_info: {"golden_diff": "diff --git a/var/spack/repos/builtin/packages/r-boot/package.py b/var/spack/repos/builtin/packages/r-boot/package.py\n--- a/var/spack/repos/builtin/packages/r-boot/package.py\n+++ b/var/spack/repos/builtin/packages/r-boot/package.py\n@@ -15,7 +15,7 @@\n     url      = \"https://cloud.r-project.org/src/contrib/boot_1.3-18.tar.gz\"\n     list_url = \"https://cloud.r-project.org/src/contrib/Archive/boot\"\n \n-    version('1.3-23', sha256='30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f')\n+    version('1.3-23', sha256='79236a5a770dc8bf5ce25d9aa303c5dc0574d94aa043fd00b8b4c8ccc877357f')\n     version('1.3-22', sha256='cf1f0cb1e0a7a36dcb6ae038f5d0211a0e7a009c149bc9d21acb9c58c38b4dfc')\n     version('1.3-20', sha256='adcb90b72409705e3f9c69ea6c15673dcb649b464fed06723fe0930beac5212a')\n     version('1.3-18', sha256='12fd237f810a69cc8d0a51a67c57eaf9506bf0341c764f8ab7c1feb73722235e')\n", "issue": "Installation issue: r-boot\n<!-- Thanks for taking the time to report this build failure. To proceed with the report please:\r\n\r\n1. Title the issue \"Installation issue: <name-of-the-package>\".\r\n2. Provide the information required below.\r\n\r\nWe encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->\r\n\r\n### Steps to reproduce the issue\r\n\r\n<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->\r\n```console\r\n$ spack install r-boot%fj\r\n==> Error: ChecksumError: sha256 checksum failed for /home/users/ea01/ea0114/spack-stage/spack-stage-r-boot-1.3-23-mm6cmoaof62r5y527kz24snjifgwpir6/boot_1.3-23.tar.gz\r\n    Expected 30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f but got 79236a5a770dc8bf5ce25d9aa303c5dc0574d94aa043fd00b8b4c8ccc877357f\r\n```\r\n\r\nBuild of `r-boot%fj` on 2020 Aug has a checksum error.\r\nThis version added to spack at 31 Aug 2019. Please see https://github.com/spack/spack/commit/661a894c85f451a4ef868abcc9871653914361bd\r\nAccording to our log, same build succeeded on 2019 Oct. \r\n\r\nhttps://cloud.r-project.org/src/contrib/boot_1.3-23.tar.gz seems to be changed between these attempts.\r\nWe found old(30c89e19) boot_1.3-23.tar.gz from http://in.archive.ubuntu.com/pool/universe/b/boot/boot_1.3-23.orig.tar.gz\r\nand compared with new(79236a5a) one.\r\nDifference was tribial. (\"Date/Publication\" in boot/DESCRIPTION, and MD5 of the file in boot/MD5)\r\nSo I would like to update checksum value.\r\n\r\nWe have another question.\r\nIn this case, we found \"old\" archive and proof the differnce is trivial.\r\nIf we found checksum mismatch and could not find \"old\" archive to verify, \r\nwhich is better in view of security?\r\n1. create issue and discuss\r\n2. directly make PR\r\n\r\n<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->\r\n\r\n### General information\r\n\r\n<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->\r\n- [ ] I have run `spack debug report` and reported the version of Spack/Python/Platform\r\n- [ ] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers\r\n- [ ] I have uploaded the build log and environment files\r\n- [x] I have searched the issues of this repo and believe this is not a duplicate\r\n\n", "before_files": [{"content": "# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other\n# Spack Project Developers. See the top-level COPYRIGHT file for details.\n#\n# SPDX-License-Identifier: (Apache-2.0 OR MIT)\n\nfrom spack import *\n\n\nclass RBoot(RPackage):\n    \"\"\"Functions and datasets for bootstrapping from the book \"Bootstrap\n    Methods and Their Application\" by A. C. Davison and D. V. Hinkley (1997,\n    CUP), originally written by Angelo Canty for S.\"\"\"\n\n    homepage = \"https://cloud.r-project.org/package=boot\"\n    url      = \"https://cloud.r-project.org/src/contrib/boot_1.3-18.tar.gz\"\n    list_url = \"https://cloud.r-project.org/src/contrib/Archive/boot\"\n\n    version('1.3-23', sha256='30c89e19dd6490b943233e87dfe422bfef92cfbb7a7dfb5c17dfd9b2d63fa02f')\n    version('1.3-22', sha256='cf1f0cb1e0a7a36dcb6ae038f5d0211a0e7a009c149bc9d21acb9c58c38b4dfc')\n    version('1.3-20', sha256='adcb90b72409705e3f9c69ea6c15673dcb649b464fed06723fe0930beac5212a')\n    version('1.3-18', sha256='12fd237f810a69cc8d0a51a67c57eaf9506bf0341c764f8ab7c1feb73722235e')\n\n    depends_on('r@3.0.0:', type=('build', 'run'))\n", "path": "var/spack/repos/builtin/packages/r-boot/package.py"}]}