prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  OpenSSL 1.0.2e outdated (replaced by 1.0.2f)
  A new version has been published today. The recipe no longer can download version 1.0.2e.
  
  Does `disable-solver.patch` still apply?
  
  
  </issue>
  <code>
  [start of pythonforandroid/recipes/openssl/__init__.py]
  1 from functools import partial
  2 
  3 from pythonforandroid.toolchain import Recipe, shprint, current_directory
  4 import sh
  5 
  6 
  7 class OpenSSLRecipe(Recipe):
  8     version = '1.0.2e'
  9     url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
  10 
  11     def should_build(self, arch):
  12         return not self.has_libs(arch, 'libssl.so', 'libcrypto.so')
  13 
  14     def check_symbol(self, env, sofile, symbol):
  15         nm = env.get('NM', 'nm')
  16         syms = sh.sh('-c', "{} -gp {} | cut -d' ' -f3".format(
  17                 nm, sofile), _env=env).splitlines()
  18         if symbol in syms:
  19             return True
  20         print('{} missing symbol {}; rebuilding'.format(sofile, symbol))
  21         return False
  22 
  23     def get_recipe_env(self, arch=None):
  24         env = super(OpenSSLRecipe, self).get_recipe_env(arch)
  25         env['CFLAGS'] += ' ' + env['LDFLAGS']
  26         env['CC'] += ' ' + env['LDFLAGS']
  27         return env
  28 
  29     def select_build_arch(self, arch):
  30         aname = arch.arch
  31         if 'arm64' in aname:
  32             return 'linux-aarch64'
  33         if 'v7a' in aname:
  34             return 'android-armv7'
  35         if 'arm' in aname:
  36             return 'android'
  37         return 'linux-armv4'
  38 
  39     def build_arch(self, arch):
  40         env = self.get_recipe_env(arch)
  41         with current_directory(self.get_build_dir(arch.arch)):
  42             # sh fails with code 255 trying to execute ./Configure
  43             # so instead we manually run perl passing in Configure
  44             perl = sh.Command('perl')
  45             buildarch = self.select_build_arch(arch)
  46             shprint(perl, 'Configure', 'shared', 'no-dso', 'no-krb5', buildarch, _env=env)
  47             self.apply_patch('disable-sover.patch', arch.arch)
  48 
  49             check_crypto = partial(self.check_symbol, env, 'libcrypto.so')
  50             # check_ssl = partial(self.check_symbol, env, 'libssl.so')
  51             while True:
  52                 shprint(sh.make, 'build_libs', _env=env)
  53                 if all(map(check_crypto, ('SSLeay', 'MD5_Transform', 'MD4_Init'))):
  54                     break
  55                 shprint(sh.make, 'clean', _env=env)
  56 
  57             self.install_libs(arch, 'libssl.so', 'libcrypto.so')
  58 
  59 recipe = OpenSSLRecipe()
  60
  [end of pythonforandroid/recipes/openssl/__init__.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/pythonforandroid/recipes/openssl/__init__.py b/pythonforandroid/recipes/openssl/__init__.py
  --- a/pythonforandroid/recipes/openssl/__init__.py
  +++ b/pythonforandroid/recipes/openssl/__init__.py
  @@ -5,7 +5,7 @@
   
   
   class OpenSSLRecipe(Recipe):
  -    version = '1.0.2e'
  +    version = '1.0.2f'
       url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
   
       def should_build(self, arch):
  
verification_info: {"golden_diff": "diff --git a/pythonforandroid/recipes/openssl/__init__.py b/pythonforandroid/recipes/openssl/__init__.py\n--- a/pythonforandroid/recipes/openssl/__init__.py\n+++ b/pythonforandroid/recipes/openssl/__init__.py\n@@ -5,7 +5,7 @@\n \n \n class OpenSSLRecipe(Recipe):\n-    version = '1.0.2e'\n+    version = '1.0.2f'\n     url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'\n \n     def should_build(self, arch):\n", "issue": "OpenSSL 1.0.2e outdated (replaced by 1.0.2f)\nA new version has been published today. The recipe no longer can download version 1.0.2e.\n\nDoes `disable-solver.patch` still apply?\n\n", "before_files": [{"content": "from functools import partial\n\nfrom pythonforandroid.toolchain import Recipe, shprint, current_directory\nimport sh\n\n\nclass OpenSSLRecipe(Recipe):\n    version = '1.0.2e'\n    url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'\n\n    def should_build(self, arch):\n        return not self.has_libs(arch, 'libssl.so', 'libcrypto.so')\n\n    def check_symbol(self, env, sofile, symbol):\n        nm = env.get('NM', 'nm')\n        syms = sh.sh('-c', \"{} -gp {} | cut -d' ' -f3\".format(\n                nm, sofile), _env=env).splitlines()\n        if symbol in syms:\n            return True\n        print('{} missing symbol {}; rebuilding'.format(sofile, symbol))\n        return False\n\n    def get_recipe_env(self, arch=None):\n        env = super(OpenSSLRecipe, self).get_recipe_env(arch)\n        env['CFLAGS'] += ' ' + env['LDFLAGS']\n        env['CC'] += ' ' + env['LDFLAGS']\n        return env\n\n    def select_build_arch(self, arch):\n        aname = arch.arch\n        if 'arm64' in aname:\n            return 'linux-aarch64'\n        if 'v7a' in aname:\n            return 'android-armv7'\n        if 'arm' in aname:\n            return 'android'\n        return 'linux-armv4'\n\n    def build_arch(self, arch):\n        env = self.get_recipe_env(arch)\n        with current_directory(self.get_build_dir(arch.arch)):\n            # sh fails with code 255 trying to execute ./Configure\n            # so instead we manually run perl passing in Configure\n            perl = sh.Command('perl')\n            buildarch = self.select_build_arch(arch)\n            shprint(perl, 'Configure', 'shared', 'no-dso', 'no-krb5', buildarch, _env=env)\n            self.apply_patch('disable-sover.patch', arch.arch)\n\n            check_crypto = partial(self.check_symbol, env, 'libcrypto.so')\n            # check_ssl = partial(self.check_symbol, env, 'libssl.so')\n            while True:\n                shprint(sh.make, 'build_libs', _env=env)\n                if all(map(check_crypto, ('SSLeay', 'MD5_Transform', 'MD4_Init'))):\n                    break\n                shprint(sh.make, 'clean', _env=env)\n\n            self.install_libs(arch, 'libssl.so', 'libcrypto.so')\n\nrecipe = OpenSSLRecipe()\n", "path": "pythonforandroid/recipes/openssl/__init__.py"}]}