Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit cea859a

Browse files
author
Matthias Koeppe
committed
Merge branch 't/30865/sage_bootstrap__update_extend_system_package_tools' into t/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_
2 parents 1e2f79d + f33c363 commit cea859a

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

build/sage_bootstrap/cmdline.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232

3333
description = \
3434
"""
35-
Sage Bootstrap Library
35+
SageMath Bootstrap Library
36+
37+
Provides scripts to manage the packages of Sage-the-distribution,
38+
including SageMath's database of equivalent system packages,
39+
and to download and upload tarballs from/to SageMath servers.
40+
3641
"""
3742

3843

@@ -58,7 +63,7 @@
5863

5964
epilog_list = \
6065
"""
61-
Print a list of all available packages
66+
Print a list of packages known to Sage
6267
6368
EXAMPLE:
6469
@@ -197,15 +202,17 @@ def make_parser():
197202
parser_list = subparsers.add_parser(
198203
'list', epilog=epilog_list,
199204
formatter_class=argparse.RawDescriptionHelpFormatter,
200-
help='Print a list of all available packages')
205+
help='Print a list of packages known to Sage')
201206
parser_list.add_argument(
202-
'package_class',
207+
'package_class', metavar='[package_name|:package_type:]',
203208
type=str, default=[':all:'], nargs='*',
204-
help='Package class like :all: (default) or :standard:')
209+
help=('package name or designator for all packages of a given type '
210+
'(one of :all:, :standard:, :optional:, :experimental:, and :huge:); '
211+
'default: :all:'))
205212
parser_list.add_argument(
206213
'--has-file', action='append', default=[], metavar='FILENAME', dest='has_files',
207-
help='Only include packages that have this file')
208-
214+
help=('only include packages that have this file in their metadata directory'
215+
'(examples: SPKG.rst, spkg-configure.m4, distros/debian.txt)'))
209216
parser_name = subparsers.add_parser(
210217
'name', epilog=epilog_name,
211218
formatter_class=argparse.RawDescriptionHelpFormatter,

build/sage_bootstrap/expand_class.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Utility to specify classes of packages like `:all:`
3+
Utility to manage lists of packages
44
"""
55

66

@@ -44,10 +44,11 @@ def included_in_filter(pkg):
4444
elif package_name_or_class == ':huge:':
4545
self._init_huge(predicate=included_in_filter)
4646
else:
47-
if package_name_or_class.startswith(':'):
48-
raise ValueError('Package name cannot start with ":", got %s', package_name_or_class)
49-
if package_name_or_class.endswith(':'):
50-
raise ValueError('Package name cannot end with ":", got %s', package_name_or_class)
47+
if ':' in package_name_or_class:
48+
raise ValueError('a colon may only appear in designators of package types, '
49+
'which must be one of '
50+
':all:, :standard:, :optional:, :experimental:, or :huge:, '
51+
'got {}'.format(package_name_or_class))
5152
self.names.append(package_name_or_class)
5253

5354
def _init_all(self, predicate):

build/sage_bootstrap/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def tarball_filename(self):
148148
"""
149149
pattern = self.tarball_pattern
150150
if pattern:
151-
return self.tarball_pattern.replace('VERSION', self.version)
151+
return pattern.replace('VERSION', self.version)
152152
else:
153153
return None
154154

0 commit comments

Comments
 (0)