pre-upload: start pushing people to EAPI=5

BUG=chromium:462099
TEST=precq passes

Change-Id: If9fdf5503b960be10fc46c790e66992fb89387e7
Reviewed-on: https://chromium-review.googlesource.com/897128
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index 9672431..3608d45 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -718,7 +718,7 @@
 
 
 def _check_ebuild_eapi(project, commit):
-  """Make sure we have people use EAPI=4 or newer with custom ebuilds.
+  """Make sure we have people use EAPI=5 or newer with custom ebuilds.
 
   We want to get away from older EAPI's as it makes life confusing and they
   have less builtin error checking.
@@ -739,7 +739,7 @@
   if project.name in whitelist:
     return None
 
-  BAD_EAPIS = ('0', '1', '2', '3')
+  BAD_EAPIS = ('0', '1', '2', '3', '4')
 
   get_eapi = re.compile(r'^\s*EAPI=[\'"]?([^\'"]+)')
 
@@ -777,7 +777,7 @@
     return HookFailure(
         'These ebuilds are using old EAPIs.  If these are imported from\n'
         'Gentoo, then you may ignore and upload once with the --no-verify\n'
-        'flag.  Otherwise, please update to 4 or newer.\n'
+        'flag.  Otherwise, please update to 5 or newer.\n'
         '\t%s\n'
         'See this guide for more details:\n%s\n' %
         ('\n\t'.join(['%s: EAPI=%s' % x for x in bad_ebuilds]), url))
diff --git a/pre-upload_unittest.py b/pre-upload_unittest.py
index 81bee92..b436771 100755
--- a/pre-upload_unittest.py
+++ b/pre-upload_unittest.py
@@ -444,7 +444,7 @@
 src_compile() { }
 """
     # Make sure we only check the first EAPI= setting.
-    self.content_mock.return_value = template % '1\nEAPI=4'
+    self.content_mock.return_value = template % '1\nEAPI=60'
     ret = pre_upload._check_ebuild_eapi(ProjectNamed('overlay'), 'HEAD')
     self.assertTrue(isinstance(ret, errors.HookFailure))
 
@@ -458,7 +458,7 @@
     ret = pre_upload._check_ebuild_eapi(ProjectNamed('overlay'), 'HEAD')
     self.assertTrue(isinstance(ret, errors.HookFailure))
 
-  def testAcceptExplicitEapi4Content(self):
+  def testAcceptExplicitNewEapiContent(self):
     """Accept ebuilds that do declare new EAPI explicitly."""
     self.file_mock.return_value = ['a.ebuild']
 
@@ -468,7 +468,7 @@
 src_compile() { }
 """
     # Make sure we only check the first EAPI= setting.
-    self.content_mock.return_value = template % '4\nEAPI=1'
+    self.content_mock.return_value = template % '6\nEAPI=1'
     ret = pre_upload._check_ebuild_eapi(ProjectNamed('overlay'), 'HEAD')
     self.assertEqual(ret, None)