Sync source edition with VCC Plus 3.7.0 build 63
This commit is contained in:
1 parent
c652a5276d
commit
b2ecec4d87
86 files changed
+10519
-472
No files matched your search
@@ -105,8 +105,10 @@ def source_catalog(output):
|
||||
releases=0, assets=0, thumbnails=0, empty=True)
|
||||
|
||||
|
||||
def package(source, output, require_full=False, *, content_profile='normal'):
|
||||
def package(source, output, require_full=False, *, content_profile='normal', suppression_manifest=None, rights_cache=None):
|
||||
if resolve_content_profile(content_profile) == 'source':
|
||||
if suppression_manifest is not None:
|
||||
raise ValueError('A rights manifest applies to a full candidate, not the empty source-content profile')
|
||||
if require_full:
|
||||
raise ValueError('--require-full cannot be combined with the source content profile')
|
||||
return source_catalog(output)
|
||||
@@ -128,6 +130,16 @@ def package(source, output, require_full=False, *, content_profile='normal'):
|
||||
else:
|
||||
print('warning: Full Software Library catalog is absent; bundling an empty development catalog. See tools/catalog/README.md.')
|
||||
empty_catalog(temporary)
|
||||
# Derived metadata is prepared from tracked reviewed associations; the
|
||||
# source catalog remains unchanged. Retained rights exclusions never
|
||||
# expire during offline builds; a fresh LIVE gate governs publication.
|
||||
from related_archive import apply_curated
|
||||
from rights import apply_cached, read_json
|
||||
with closing(sqlite3.connect(temporary)) as candidate:
|
||||
apply_curated(candidate)
|
||||
manifest = read_json(suppression_manifest) if isinstance(suppression_manifest, (str, Path)) else suppression_manifest
|
||||
apply_cached(candidate, cache_path=rights_cache, extra=manifest)
|
||||
candidate.commit()
|
||||
counts = validate(temporary, require_full=require_full)
|
||||
digest = hashlib.sha256(temporary.read_bytes()).hexdigest()
|
||||
os.chmod(temporary, 0o444)
|
||||
@@ -250,12 +262,16 @@ def main():
|
||||
parser.add_argument('--output', type=Path)
|
||||
parser.add_argument('--check-only', action='store_true', help='Validate input without staging a resource')
|
||||
parser.add_argument('--require-full', action='store_true')
|
||||
parser.add_argument('--suppression-manifest', type=Path, help='Explicit fresh reviewed rights-withdrawal manifest for candidate preparation')
|
||||
parser.add_argument('--rights-cache', type=Path, help='Retained exclusion cache override; ordinary full preparation uses the persistent maintainer cache')
|
||||
args = parser.parse_args()
|
||||
if not args.check_only and args.output is None:
|
||||
parser.error('--output is required unless --check-only is used')
|
||||
try:
|
||||
profile = resolve_content_profile(args.content_profile)
|
||||
if profile == 'source':
|
||||
if args.suppression_manifest is not None:
|
||||
raise ValueError('A rights manifest applies to a full candidate, not the empty source-content profile')
|
||||
if args.require_full:
|
||||
raise ValueError('--require-full cannot be combined with the source content profile')
|
||||
if args.check_only:
|
||||
@@ -265,7 +281,14 @@ def main():
|
||||
result = source_catalog(args.output)
|
||||
else:
|
||||
source = args.source if args.source is not None else DEFAULT_SOURCE
|
||||
result = validate(source, args.require_full) if args.check_only else package(source, args.output, args.require_full)
|
||||
if args.check_only:
|
||||
validate(source, args.require_full)
|
||||
with tempfile.TemporaryDirectory(prefix='vcc-suppression-check-') as temporary:
|
||||
result = package(source, Path(temporary) / 'catalog.sqlite', args.require_full,
|
||||
suppression_manifest=args.suppression_manifest, rights_cache=args.rights_cache)
|
||||
result['suppression_checked'] = True
|
||||
else:
|
||||
result = package(source, args.output, args.require_full, suppression_manifest=args.suppression_manifest, rights_cache=args.rights_cache)
|
||||
if not args.check_only:
|
||||
artwork = args.output.parent / 'Artwork'
|
||||
if artwork.is_symlink(): raise ValueError('Artwork destination must not be a symlink')
|
||||
|
||||
Reference in new issue
Block a user