[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200401-10-g66ccbbe

Jon TURNEY via Cygwin-apps-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs.apps
Message-ID <[email protected]>


https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=66ccbbe56e49d4c92fafd28ba1ef42e4beea8712

commit 66ccbbe56e49d4c92fafd28ba1ef42e4beea8712
Author: Jon Turney <[email protected]>
Date:   Fri Jul 6 15:53:26 2018 +0100

    Prevent very old setup versions from being used
    
    When a setup version is specified, also use a lexer defect to prevent
    very old (>3 years) setup versions from being used.


Diff:
---
 calm/package.py                               | 11 ++++++-----
 test/testdata/inifile/setup.ini.expected      |  3 ++-
 test/testdata/process_arch/setup.ini.expected |  3 ++-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index 8628b28..ff30122 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -967,12 +967,13 @@ def write_setup_ini(args, packages, arch):
         print("setup-timestamp: %d" % tz, file=f)
 
         if args.setup_version:
+            # this token exists in the lexer, but not in the grammar up until
+            # 2.878 (when it was removed), so will cause a parse error with
+            # versions prior to that.
+            print("include-setup: setup <2.878 not supported", file=f)
+
             # not implemented until 2.890, ignored by earlier versions
-            #
-            # (versions prior to 2.844 only supported x86 installs, since x86_64
-            # wasn't available yet, and setup.ini was located at a different URL
-            # path)
-            print("setup-minimum-version: 2.844", file=f)
+            print("setup-minimum-version: 2.878", file=f)
 
             # for setup to check if a setup upgrade is possible
             print("setup-version: %s" % args.setup_version, file=f)
diff --git a/test/testdata/inifile/setup.ini.expected b/test/testdata/inifile/setup.ini.expected
index b4b34b5..f5b6501 100644
--- a/test/testdata/inifile/setup.ini.expected
+++ b/test/testdata/inifile/setup.ini.expected
@@ -8,7 +8,8 @@
  'release: testing\n'
  'arch: x86\n'
  'setup-timestamp: 1458221800\n'
- 'setup-minimum-version: 2.844\n'
+ 'include-setup: setup <2.878 not supported\n'
+ 'setup-minimum-version: 2.878\n'
  'setup-version: 4.321\n'
  '\n'
  '@ arc\n'
diff --git a/test/testdata/process_arch/setup.ini.expected b/test/testdata/process_arch/setup.ini.expected
index e150e61..ea487ef 100644
--- a/test/testdata/process_arch/setup.ini.expected
+++ b/test/testdata/process_arch/setup.ini.expected
@@ -8,7 +8,8 @@
  'release: trial\n'
  'arch: x86\n'
  'setup-timestamp: 1473797080\n'
- 'setup-minimum-version: 2.844\n'
+ 'include-setup: setup <2.878 not supported\n'
+ 'setup-minimum-version: 2.878\n'
  'setup-version: 3.1415\n'
  '\n'
  '@ arc\n'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.