From 78cfa1bd32f84c633da4a37c416c56ac9f79964c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 8 Oct 2021 23:30:04 +0200 Subject: [PATCH 003/105] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..225fc6f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/__pycache__ From b9ed49733e10e3d7ac3b5560418a705119f31fcb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 8 Oct 2021 23:31:53 +0200 Subject: [PATCH 004/105] main --- __init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100755 index 0000000..7ab6c71 --- /dev/null +++ b/__init__.py @@ -0,0 +1,12 @@ +#! /usr/bin/python3 + +import arguments + + +def main(): + args = arguments.parse() + print(args) + + +if __name__ == '__main__': + main() From ee5b1a4309b3021aeab0e2c313cbd65e4deb32bc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 12:25:45 +0200 Subject: [PATCH 005/105] todo --- __init__.py | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 7ab6c71..5b2151a 100755 --- a/__init__.py +++ b/__init__.py @@ -1,11 +1,53 @@ #! /usr/bin/python3 import arguments +import repository +import sys + + +def build(repository, arguments): + print('Build:') + # TODO identify + print('TODO identify') + # TODO extract + print('TODO extract') + # TODO apply + print('TODO apply') + # TODO archive + print('TODO archive') + + +def check(repository, arguments): + print('Check:') + # TODO prepare threads + print('TODO prepare threads') + # TODO run threads + print('TODO run threads') + # TODO watch threads + print('TODO watch threads') + + +def info(repository, arguments): + print(repository) + + +def sync(repository, arguments): + print('Sync:') + # TODO prepare temporary directory + print('prepare…') + # TODO fetch + print('fetch…') + # TODO purge useless files + print('purge…') + # TODO clean temporary directory + print('clean…') def main(): args = arguments.parse() - print(args) + repo = repository.Repository(args) + func = getattr(sys.modules[__name__], args[arguments.ACTION]) + func(repo, args) if __name__ == '__main__': From d28883d3d4cfa6d118c62e72d260bafa679af4d4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 12:26:08 +0200 Subject: [PATCH 006/105] arguments --- arguments.py | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 arguments.py diff --git a/arguments.py b/arguments.py new file mode 100644 index 0000000..fa40f7e --- /dev/null +++ b/arguments.py @@ -0,0 +1,82 @@ +import argparse +import os + + +ACTION = 'action' +ARCHITECTURES = 'architectures' +COMPRESSION = 'compression' +DIRECTORY = 'directory' +FILESYSTEM = 'filesystem' +REMOTE = 'remote' +SUBSYSTEMS = 'subsystems' +TEMPORARY = 'temporary' +THREADS = 'threads' +VERBOSE = 'verbose' + + +class Formatter(argparse.RawTextHelpFormatter, + argparse.ArgumentDefaultsHelpFormatter): + pass + + +def parse(): + parser = argparse.ArgumentParser(formatter_class=Formatter) + + parser.add_argument(f'-{VERBOSE[0]}', f'--{VERBOSE}', type=bool, help='''\ +verbose output +''') + + parser.add_argument(f'-{DIRECTORY[0]}', f'--{DIRECTORY}', type=str, + help='''\ +msys repository's directory +''') + parser.add_argument(f'--{TEMPORARY}', type=str, help='''\ +msys repository's temporary directory +''') + parser.add_argument(f'-{THREADS[0]}', f'--{THREADS}', type=int, help='''\ +number of threads to use +''') + parser.add_argument(f'{ACTION}', type=str, nargs='?', + choices=['build', 'check', 'info', 'sync'], help='''\ +action to perform onto msys repository +''') + + sync = parser.add_argument_group('sync') + sync.add_argument(f'-{REMOTE[0]}', f'--{REMOTE}', type=str, help='''\ +msys remote repository's location +''') + sync.add_argument(f'-{ARCHITECTURES[0]}', f'--{ARCHITECTURES}', type=str, + nargs='+', choices=['x86_64', 'i686'], help='''\ +list of architectures to sync +''') + sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, + nargs='+', choices=['msys', 'mingw'], help='''\ +list of subsystems to sync +''') + + build = parser.add_argument_group('build') + parser.add_argument(f'-{FILESYSTEM[0]}', f'--{FILESYSTEM}', type=str, + help='''\ +directory containing modifications applying to filesystem +''') + build.add_argument(f'-{COMPRESSION[0]}', f'--{COMPRESSION}', type=str, + choices=['7z', 'gz', 'xz', 'zst'], help='''\ +compression applying to archive +''') + + parser.set_defaults( + directory=os.curdir, + temporary='tmp', + threads=2, + + action='info', + + remote='https://repo.msys2.org', + architectures=['x86_64'], + subsystems=['msys', 'mingw'], + + filesystem='fs', + compression='7z', + ) + + return vars(parser.parse_args()) From 9e1e6238fbe918b7985fb84d913ebff2b2acf3bd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 12:26:53 +0200 Subject: [PATCH 007/105] repository --- repository.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 repository.py diff --git a/repository.py b/repository.py new file mode 100644 index 0000000..2021487 --- /dev/null +++ b/repository.py @@ -0,0 +1,19 @@ +import arguments +import datetime +import os + + +class Repository: + def __init__(self, args): + self.directory = args[arguments.DIRECTORY] + self.temporary = args[arguments.TEMPORARY] + self.tmp = os.path.join(self.temporary, + datetime.datetime.now() + .strftime('%Y%m%d%H%M%S')) + + def __str__(self): + return f'''\ +Directory: {self.directory} + → {os.path.realpath(self.directory)} +Temporary: {self.tmp} +''' From 839bfc0f9d0b93ff34bddb5d9b51ebb761edb9f4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 12:29:37 +0200 Subject: [PATCH 008/105] env --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 5b2151a..66975c6 100755 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,4 @@ -#! /usr/bin/python3 +#! /usr/bin/env python3 import arguments import repository From 523c5eca8193342bbf1b69387b36c44af1a202ee Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:01:50 +0200 Subject: [PATCH 009/105] remote --- __init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index 66975c6..b006207 100755 --- a/__init__.py +++ b/__init__.py @@ -1,9 +1,11 @@ #! /usr/bin/env python3 -import arguments -import repository import sys +import arguments +import remote +import repository + def build(repository, arguments): print('Build:') @@ -31,8 +33,12 @@ def info(repository, arguments): print(repository) -def sync(repository, arguments): +def sync(repository, args): print('Sync:') + r = remote.Remote(args) + print(r) + for architecture in args[arguments.ARCHITECTURES]: + print(r.fetch_latest_distribution(architecture)) # TODO prepare temporary directory print('prepare…') # TODO fetch From ec871e108179363f8e4687c5fe764545156ee639 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:02:10 +0200 Subject: [PATCH 010/105] remote --- remote.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 remote.py diff --git a/remote.py b/remote.py new file mode 100644 index 0000000..6c70a00 --- /dev/null +++ b/remote.py @@ -0,0 +1,25 @@ +import os +import requests + +import arguments +import hypertext + + +CHARSET = 'u8' +DISTRIBUTION = 'distrib' + + +class Remote: + def __init__(self, args): + self.location = args[arguments.REMOTE] + + def fetch_latest_distribution(self, architecture): + url = os.path.join(self.location, DISTRIBUTION, architecture) + html = requests.get(url).content.decode(CHARSET) + links = hypertext.get_links(html) + print(links) + + def __str__(self): + return f'''\ +Location: {self.location} +''' From c70cab386df2d91a1f7c64d85e5b3f1d2198dcd2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:02:20 +0200 Subject: [PATCH 011/105] hypertext --- hypertext.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 hypertext.py diff --git a/hypertext.py b/hypertext.py new file mode 100644 index 0000000..44abffd --- /dev/null +++ b/hypertext.py @@ -0,0 +1,18 @@ +import html.parser + + +class Parser(html.parser.HTMLParser): + def __init__(self): + self.links = [] + super().__init__() + + def handle_starttag(self, tag, attributes): + if tag == 'a': + self.links.extend( + [v for k, v in attributes if k == 'href']) + + +def get_links(hypertext): + parser = Parser() + parser.feed(hypertext) + return parser.links From 7bf3676bfde764b8852e1272771e76d1ed67038b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:35:35 +0200 Subject: [PATCH 012/105] =?UTF-8?q?=E2=88=92fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/__init__.py b/__init__.py index b006207..f91fa2f 100755 --- a/__init__.py +++ b/__init__.py @@ -37,8 +37,6 @@ def sync(repository, args): print('Sync:') r = remote.Remote(args) print(r) - for architecture in args[arguments.ARCHITECTURES]: - print(r.fetch_latest_distribution(architecture)) # TODO prepare temporary directory print('prepare…') # TODO fetch From 3237ea410e5f9acdb6b0a53fdcb22847cd594b26 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:36:12 +0200 Subject: [PATCH 013/105] arch,args --- arguments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arguments.py b/arguments.py index fa40f7e..a56a96e 100644 --- a/arguments.py +++ b/arguments.py @@ -1,6 +1,7 @@ import argparse import os +import remote ACTION = 'action' ARCHITECTURES = 'architectures' @@ -46,7 +47,7 @@ action to perform onto msys repository msys remote repository's location ''') sync.add_argument(f'-{ARCHITECTURES[0]}', f'--{ARCHITECTURES}', type=str, - nargs='+', choices=['x86_64', 'i686'], help='''\ + nargs='+', choices=remote.ARCHITECTURES, help='''\ list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, From a6f125c8c3f766edaeb5eed383e99cdfd62e8ab0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:36:53 +0200 Subject: [PATCH 014/105] load --- remote.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/remote.py b/remote.py index 6c70a00..c6740b9 100644 --- a/remote.py +++ b/remote.py @@ -5,21 +5,35 @@ import arguments import hypertext +ARCHIVE = '.tar.xz' +ARCHITECTURES = ['x86_64', 'i686'] CHARSET = 'u8' DISTRIBUTION = 'distrib' +SIGNATURE = '.sig' class Remote: def __init__(self, args): self.location = args[arguments.REMOTE] + self.load() - def fetch_latest_distribution(self, architecture): - url = os.path.join(self.location, DISTRIBUTION, architecture) - html = requests.get(url).content.decode(CHARSET) - links = hypertext.get_links(html) - print(links) + def load(self): + d = {} + for architecture in ARCHITECTURES: + url = os.path.join(self.location, DISTRIBUTION, architecture) + html = requests.get(url).content.decode(CHARSET) + links = sorted(hypertext.get_links(html)) + archives = [link for link in links + if link.endswith(ARCHIVE)] + signatures = [link for link in links + if link.endswith(SIGNATURE)] + archive = archives[-1] + d[architecture] = archive + self.archives = d def __str__(self): return f'''\ Location: {self.location} +Archives: +{self.archives} ''' From 1c6a28d7c691e0eaeefe4342f691e3f2120e8541 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:54:50 +0200 Subject: [PATCH 015/105] repository --- repository.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/repository.py b/repository.py index 2021487..6950843 100644 --- a/repository.py +++ b/repository.py @@ -12,8 +12,9 @@ class Repository: .strftime('%Y%m%d%H%M%S')) def __str__(self): - return f'''\ -Directory: {self.directory} - → {os.path.realpath(self.directory)} -Temporary: {self.tmp} -''' + lines = [ + f'Directory: {self.directory}', + f' → {os.path.realpath(self.directory)}', + f'Temporary: {self.tmp}', + ] + return os.linesep.join(lines) From e10e33ace2a5e0e36e4791f2bb41dc80a545a2e6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:55:05 +0200 Subject: [PATCH 016/105] remote --- remote.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/remote.py b/remote.py index c6740b9..ccb8fbb 100644 --- a/remote.py +++ b/remote.py @@ -32,8 +32,8 @@ class Remote: self.archives = d def __str__(self): - return f'''\ -Location: {self.location} -Archives: -{self.archives} -''' + lines = [f'Location: {self.location}', + 'Archives:'] + for architecture, archive in sorted(self.archives.items()): + lines.append(f'{architecture} → {archive}') + return os.linesep.join(lines) From 045b469e4aa17071488353d007ba2ae984a4b7b8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 14:59:07 +0200 Subject: [PATCH 017/105] reversed --- remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote.py b/remote.py index ccb8fbb..6743da7 100644 --- a/remote.py +++ b/remote.py @@ -34,6 +34,6 @@ class Remote: def __str__(self): lines = [f'Location: {self.location}', 'Archives:'] - for architecture, archive in sorted(self.archives.items()): + for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') return os.linesep.join(lines) From e52047d1fdcd9eab02e5ea9357f1a2e54c669b57 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 15:58:44 +0200 Subject: [PATCH 018/105] repository.load --- repository.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/repository.py b/repository.py index 6950843..20c11f8 100644 --- a/repository.py +++ b/repository.py @@ -2,6 +2,8 @@ import arguments import datetime import os +import remote + class Repository: def __init__(self, args): @@ -10,11 +12,30 @@ class Repository: self.tmp = os.path.join(self.temporary, datetime.datetime.now() .strftime('%Y%m%d%H%M%S')) + self.load() + + def load(self): + distribution = os.path.join( + self.directory, remote.DISTRIBUTION) + d = {} + _, architectures, _ = next(os.walk(distribution)) + for architecture in [a for a in architectures + if a in remote.ARCHITECTURES]: + directory = os.path.join(distribution, architecture) + _, _, files = next(os.walk(directory)) + archives = sorted([file for file in files + if file.endswith(remote.ARCHIVE)]) + archive = archives[-1] + d[architecture] = archive + self.archives = d def __str__(self): lines = [ f'Directory: {self.directory}', f' → {os.path.realpath(self.directory)}', - f'Temporary: {self.tmp}', + f'Archives:', ] + for architecture, archive in reversed(sorted(self.archives.items())): + lines.append(f'{architecture} → {archive}') + lines.append(f'Temporary: {self.tmp}') return os.linesep.join(lines) From 960f6303fdea4d4aefd281bcb4fd5fda60fce39a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 18:16:40 +0200 Subject: [PATCH 019/105] subsystems --- arguments.py | 2 +- remote.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arguments.py b/arguments.py index a56a96e..8ebc916 100644 --- a/arguments.py +++ b/arguments.py @@ -51,7 +51,7 @@ msys remote repository's location list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, - nargs='+', choices=['msys', 'mingw'], help='''\ + nargs='+', choices=remote.SUBSYSTEMS, help='''\ list of subsystems to sync ''') diff --git a/remote.py b/remote.py index 6743da7..4fd2e5f 100644 --- a/remote.py +++ b/remote.py @@ -10,6 +10,7 @@ ARCHITECTURES = ['x86_64', 'i686'] CHARSET = 'u8' DISTRIBUTION = 'distrib' SIGNATURE = '.sig' +SUBSYSTEMS = ['msys', 'mingw'] class Remote: From 47120adeb5f8f6312780e2e8181c5c77c9ba9169 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 18:19:58 +0200 Subject: [PATCH 020/105] temporary --- repository.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/repository.py b/repository.py index 20c11f8..315dd3d 100644 --- a/repository.py +++ b/repository.py @@ -9,9 +9,6 @@ class Repository: def __init__(self, args): self.directory = args[arguments.DIRECTORY] self.temporary = args[arguments.TEMPORARY] - self.tmp = os.path.join(self.temporary, - datetime.datetime.now() - .strftime('%Y%m%d%H%M%S')) self.load() def load(self): @@ -29,6 +26,11 @@ class Repository: d[architecture] = archive self.archives = d + def get_temporary(): + return os.path.join(self.temporary, + datetime.datetime.now() + .strftime('%Y%m%d%H%M%S')) + def __str__(self): lines = [ f'Directory: {self.directory}', @@ -37,5 +39,4 @@ class Repository: ] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') - lines.append(f'Temporary: {self.tmp}') return os.linesep.join(lines) From 4397a20bfdb33c9312c3219d2fa6897e1cb2e242 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 19:46:11 +0200 Subject: [PATCH 021/105] synchronization --- __init__.py | 24 ++++++++++-------------- remote.py | 3 ++- repository.py | 4 ++-- synchronization.py | 19 +++++++++++++++++++ 4 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 synchronization.py diff --git a/__init__.py b/__init__.py index f91fa2f..48a2aa5 100755 --- a/__init__.py +++ b/__init__.py @@ -3,12 +3,11 @@ import sys import arguments -import remote import repository +import synchronization -def build(repository, arguments): - print('Build:') +def build(args): # TODO identify print('TODO identify') # TODO extract @@ -19,8 +18,7 @@ def build(repository, arguments): print('TODO archive') -def check(repository, arguments): - print('Check:') +def check(args): # TODO prepare threads print('TODO prepare threads') # TODO run threads @@ -29,14 +27,13 @@ def check(repository, arguments): print('TODO watch threads') -def info(repository, arguments): - print(repository) +def info(args): + print(repository.Repository(args)) -def sync(repository, args): - print('Sync:') - r = remote.Remote(args) - print(r) +def sync(args): + sync = synchronization.Synchronization(args) + print(sync) # TODO prepare temporary directory print('prepare…') # TODO fetch @@ -49,9 +46,8 @@ def sync(repository, args): def main(): args = arguments.parse() - repo = repository.Repository(args) - func = getattr(sys.modules[__name__], args[arguments.ACTION]) - func(repo, args) + function = getattr(sys.modules[__name__], args[arguments.ACTION]) + function(args) if __name__ == '__main__': diff --git a/remote.py b/remote.py index 4fd2e5f..a8d8972 100644 --- a/remote.py +++ b/remote.py @@ -16,11 +16,12 @@ SUBSYSTEMS = ['msys', 'mingw'] class Remote: def __init__(self, args): self.location = args[arguments.REMOTE] + self.architectures = args[arguments.ARCHITECTURES] self.load() def load(self): d = {} - for architecture in ARCHITECTURES: + for architecture in self.architectures: url = os.path.join(self.location, DISTRIBUTION, architecture) html = requests.get(url).content.decode(CHARSET) links = sorted(hypertext.get_links(html)) diff --git a/repository.py b/repository.py index 315dd3d..7bf0a56 100644 --- a/repository.py +++ b/repository.py @@ -26,7 +26,7 @@ class Repository: d[architecture] = archive self.archives = d - def get_temporary(): + def get_temporary(self): return os.path.join(self.temporary, datetime.datetime.now() .strftime('%Y%m%d%H%M%S')) @@ -35,7 +35,7 @@ class Repository: lines = [ f'Directory: {self.directory}', f' → {os.path.realpath(self.directory)}', - f'Archives:', + 'Archives:', ] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') diff --git a/synchronization.py b/synchronization.py new file mode 100644 index 0000000..0a268ac --- /dev/null +++ b/synchronization.py @@ -0,0 +1,19 @@ +import os + +import remote +import repository + + +class Synchronization: + def __init__(self, args): + self.remote = remote.Remote(args) + self.repository = repository.Repository(args) + self.temporary = self.repository.get_temporary() + + def __str__(self): + lines = [ + str(self.remote), str(), + str(self.repository), str(), + f'Temporary: {self.temporary}', + ] + return os.linesep.join(lines) From 71373024615c51b23fa7813224136e852a5bacc4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 20:01:02 +0200 Subject: [PATCH 022/105] subsystems --- remote.py | 1 + 1 file changed, 1 insertion(+) diff --git a/remote.py b/remote.py index a8d8972..216fa9e 100644 --- a/remote.py +++ b/remote.py @@ -17,6 +17,7 @@ class Remote: def __init__(self, args): self.location = args[arguments.REMOTE] self.architectures = args[arguments.ARCHITECTURES] + self.subsystems = args[arguments.SUBSYSTEMS] self.load() def load(self): From 8164f165b03d477828d683925e15efb09c997c91 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 20:03:12 +0200 Subject: [PATCH 023/105] lint --- remote.py | 2 -- repository.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/remote.py b/remote.py index 216fa9e..f1a4683 100644 --- a/remote.py +++ b/remote.py @@ -28,8 +28,6 @@ class Remote: links = sorted(hypertext.get_links(html)) archives = [link for link in links if link.endswith(ARCHIVE)] - signatures = [link for link in links - if link.endswith(SIGNATURE)] archive = archives[-1] d[architecture] = archive self.archives = d diff --git a/repository.py b/repository.py index 7bf0a56..5d46fa5 100644 --- a/repository.py +++ b/repository.py @@ -21,7 +21,7 @@ class Repository: directory = os.path.join(distribution, architecture) _, _, files = next(os.walk(directory)) archives = sorted([file for file in files - if file.endswith(remote.ARCHIVE)]) + if file.endswith(remote.ARCHIVE)]) archive = archives[-1] d[architecture] = archive self.archives = d From a4ea2c561c4b11c30082f685d6bb4c05205a7a73 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 20:04:49 +0200 Subject: [PATCH 024/105] package --- package.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 package.py diff --git a/package.py b/package.py new file mode 100644 index 0000000..d85967f --- /dev/null +++ b/package.py @@ -0,0 +1,3 @@ +class Package: + def __init__(self): + pass From abb94102ba96f5fd2b2f6cb53b6542c0182808fe Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 20:07:29 +0200 Subject: [PATCH 025/105] subsystems --- remote.py | 1 + 1 file changed, 1 insertion(+) diff --git a/remote.py b/remote.py index f1a4683..35236b1 100644 --- a/remote.py +++ b/remote.py @@ -37,4 +37,5 @@ class Remote: 'Archives:'] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') + lines.append(f'Subsystems: {self.subsystems}') return os.linesep.join(lines) From a2b3951e63e37185869bc1a177fe40226601b8d2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 20:45:16 +0200 Subject: [PATCH 026/105] binary --- arguments.py | 4 ++-- remote.py | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/arguments.py b/arguments.py index 8ebc916..4e99419 100644 --- a/arguments.py +++ b/arguments.py @@ -74,10 +74,10 @@ compression applying to archive remote='https://repo.msys2.org', architectures=['x86_64'], - subsystems=['msys', 'mingw'], + subsystems=['msys', 'mingw64'], filesystem='fs', - compression='7z', + compression='zst', ) return vars(parser.parse_args()) diff --git a/remote.py b/remote.py index 35236b1..eeecb37 100644 --- a/remote.py +++ b/remote.py @@ -9,8 +9,10 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] CHARSET = 'u8' DISTRIBUTION = 'distrib' +FILES = '.files' +MINGW = 'mingw' SIGNATURE = '.sig' -SUBSYSTEMS = ['msys', 'mingw'] +SUBSYSTEMS = ['msys', 'mingw64'] class Remote: @@ -21,7 +23,8 @@ class Remote: self.load() def load(self): - d = {} + a = {} + c = {} for architecture in self.architectures: url = os.path.join(self.location, DISTRIBUTION, architecture) html = requests.get(url).content.decode(CHARSET) @@ -29,8 +32,18 @@ class Remote: archives = [link for link in links if link.endswith(ARCHIVE)] archive = archives[-1] - d[architecture] = archive - self.archives = d + a[architecture] = archive + # + for subsystem in self.subsystems: + location = [self.location] + if subsystem != SUBSYSTEMS[0]: + location.append(MINGW) + location = os.path.join(*location, subsystem, architecture, + f'{subsystem}{FILES}') + binary = requests.get(url).content + c[architecture] = binary + self.archives = a + self.catalogs = c def __str__(self): lines = [f'Location: {self.location}', From 7d3c4828fd27db8aad1ef28ddfb55af7c2055fc8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 21:39:10 +0200 Subject: [PATCH 027/105] architectures/subsystems --- arguments.py | 2 +- remote.py | 31 +++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/arguments.py b/arguments.py index 4e99419..12aaafe 100644 --- a/arguments.py +++ b/arguments.py @@ -74,7 +74,7 @@ compression applying to archive remote='https://repo.msys2.org', architectures=['x86_64'], - subsystems=['msys', 'mingw64'], + subsystems=['msys', 'mingw'], filesystem='fs', compression='zst', diff --git a/remote.py b/remote.py index eeecb37..f9e525c 100644 --- a/remote.py +++ b/remote.py @@ -7,12 +7,20 @@ import hypertext ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] +ARCHITECTURES_BITS = { +'x86_64': 64, +'i686': 32, +} +ARCHITECTURES_SUBSYSTEMS = { +'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], +'i686': ['msys', 'clang32', 'mingw32'], +} CHARSET = 'u8' DISTRIBUTION = 'distrib' FILES = '.files' MINGW = 'mingw' SIGNATURE = '.sig' -SUBSYSTEMS = ['msys', 'mingw64'] +SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] class Remote: @@ -34,14 +42,18 @@ class Remote: archive = archives[-1] a[architecture] = archive # - for subsystem in self.subsystems: - location = [self.location] - if subsystem != SUBSYSTEMS[0]: - location.append(MINGW) - location = os.path.join(*location, subsystem, architecture, - f'{subsystem}{FILES}') - binary = requests.get(url).content - c[architecture] = binary + for ss in self.subsystems: + location = self.location + if ss == SUBSYSTEMS[0]: + subsystem = ss + location = os.path.join(location, subsystem, architecture) + else: + subsystem = f'{ss}{ARCHITECTURES_BITS[architecture]}' + location = os.path.join(location, MINGW, subsystem) + if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: + location = os.path.join(location, f'{subsystem}{FILES}') + binary = requests.get(url).content + c[architecture] = binary self.archives = a self.catalogs = c @@ -50,5 +62,4 @@ class Remote: 'Archives:'] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') - lines.append(f'Subsystems: {self.subsystems}') return os.linesep.join(lines) From 6376f22cdbdd72b3846f02253b84448e9c7a42dd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 21:59:07 +0200 Subject: [PATCH 028/105] architecture/subsystem --- remote.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/remote.py b/remote.py index f9e525c..e87f452 100644 --- a/remote.py +++ b/remote.py @@ -42,6 +42,7 @@ class Remote: archive = archives[-1] a[architecture] = archive # + c[architecture] = {} for ss in self.subsystems: location = self.location if ss == SUBSYSTEMS[0]: @@ -53,7 +54,7 @@ class Remote: if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: location = os.path.join(location, f'{subsystem}{FILES}') binary = requests.get(url).content - c[architecture] = binary + c[architecture][subsystem] = binary self.archives = a self.catalogs = c @@ -62,4 +63,7 @@ class Remote: 'Archives:'] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') + lines.append('Subsystems:') + for architecture, subsystems in reversed(sorted(self.catalogs.items())): + lines.append(f'{architecture} → {list(subsystems.keys())}') return os.linesep.join(lines) From 1a873b5ea20ff5385d07487c71b9c6fe081c339c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 22:26:39 +0200 Subject: [PATCH 029/105] lint --- remote.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/remote.py b/remote.py index e87f452..09b5be7 100644 --- a/remote.py +++ b/remote.py @@ -8,12 +8,12 @@ import hypertext ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] ARCHITECTURES_BITS = { -'x86_64': 64, -'i686': 32, + 'x86_64': 64, + 'i686': 32, } ARCHITECTURES_SUBSYSTEMS = { -'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], -'i686': ['msys', 'clang32', 'mingw32'], + 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], + 'i686': ['msys', 'clang32', 'mingw32'], } CHARSET = 'u8' DISTRIBUTION = 'distrib' @@ -64,6 +64,6 @@ class Remote: for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') lines.append('Subsystems:') - for architecture, subsystems in reversed(sorted(self.catalogs.items())): - lines.append(f'{architecture} → {list(subsystems.keys())}') + for arch, ss in reversed(sorted(self.catalogs.items())): + lines.append(f'{arch} → {list(ss.keys())}') return os.linesep.join(lines) From fc17992b204465cc03320c57bd989b19ea63d539 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 23:39:16 +0200 Subject: [PATCH 030/105] catalog --- catalog.py | 17 +++++++++++++++++ remote.py | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 catalog.py diff --git a/catalog.py b/catalog.py new file mode 100644 index 0000000..1274087 --- /dev/null +++ b/catalog.py @@ -0,0 +1,17 @@ +import io +import tarfile + +import package + + +class Catalog: + def __init__(self, binary): + self.binary = binary + self.load() + + def load(self): + f = io.BytesIO(self.binary) + archive = tarfile.open(fileobj=f) + for member in archive.getmembers(): + print(member) + archive.close() diff --git a/remote.py b/remote.py index 09b5be7..37fb80d 100644 --- a/remote.py +++ b/remote.py @@ -2,6 +2,7 @@ import os import requests import arguments +import catalog import hypertext @@ -34,8 +35,8 @@ class Remote: a = {} c = {} for architecture in self.architectures: - url = os.path.join(self.location, DISTRIBUTION, architecture) - html = requests.get(url).content.decode(CHARSET) + location = os.path.join(self.location, DISTRIBUTION, architecture) + html = requests.get(location).content.decode(CHARSET) links = sorted(hypertext.get_links(html)) archives = [link for link in links if link.endswith(ARCHIVE)] @@ -53,8 +54,8 @@ class Remote: location = os.path.join(location, MINGW, subsystem) if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: location = os.path.join(location, f'{subsystem}{FILES}') - binary = requests.get(url).content - c[architecture][subsystem] = binary + binary = requests.get(location).content + c[architecture][subsystem] = catalog.Catalog(binary) self.archives = a self.catalogs = c From 82f5290c18eaea1c037013c03e9dbde31e478974 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 9 Oct 2021 23:52:19 +0200 Subject: [PATCH 031/105] catalog --- remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote.py b/remote.py index 37fb80d..cb73ed0 100644 --- a/remote.py +++ b/remote.py @@ -16,9 +16,9 @@ ARCHITECTURES_SUBSYSTEMS = { 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], 'i686': ['msys', 'clang32', 'mingw32'], } +CATALOG = '.files' CHARSET = 'u8' DISTRIBUTION = 'distrib' -FILES = '.files' MINGW = 'mingw' SIGNATURE = '.sig' SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] @@ -53,7 +53,7 @@ class Remote: subsystem = f'{ss}{ARCHITECTURES_BITS[architecture]}' location = os.path.join(location, MINGW, subsystem) if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: - location = os.path.join(location, f'{subsystem}{FILES}') + location = os.path.join(location, f'{subsystem}{CATALOG}') binary = requests.get(location).content c[architecture][subsystem] = catalog.Catalog(binary) self.archives = a From 6afb15d260a5d1e6299b89c9ce493fd91f2b220a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 01:18:03 +0200 Subject: [PATCH 032/105] package --- catalog.py | 17 ++++++++++++++++- package.py | 24 ++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/catalog.py b/catalog.py index 1274087..12ce4c1 100644 --- a/catalog.py +++ b/catalog.py @@ -1,8 +1,12 @@ import io +import os import tarfile import package +FILES = 'files' +PACKAGE = 'desc' + class Catalog: def __init__(self, binary): @@ -12,6 +16,17 @@ class Catalog: def load(self): f = io.BytesIO(self.binary) archive = tarfile.open(fileobj=f) + m = {} + packages = {} for member in archive.getmembers(): - print(member) + directory, *file = member.name.split(os.sep) + if file: + d = m[directory] + d[file[0]] = archive.extractfile(member).read() + if len(d) == 2: + p = package.Package(d[PACKAGE], d[FILES]) + packages[p.name] = p + else: + m[directory] = {} archive.close() + self.packages = packages diff --git a/package.py b/package.py index d85967f..2500fa9 100644 --- a/package.py +++ b/package.py @@ -1,3 +1,23 @@ +import os + +CHARSET = 'u8' +KEY = '%' +SEPARATOR = f'{os.linesep}{os.linesep}' + + class Package: - def __init__(self): - pass + def __init__(self, package, files): + p = package.decode(CHARSET).strip() + f = files.decode(CHARSET).strip() + text = f'{p}{SEPARATOR}{f}' + for item in text.split(SEPARATOR): + line, *lines = item.split(os.linesep) + key = line.split(KEY)[1].lower() + if len(lines) == 1: + value = lines[0] + else: + value = lines + setattr(self, key, value) + print() + print(key) + print(value) From e45e9cb4080aa1908636fe113ad9786d63889aa1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 01:27:34 +0200 Subject: [PATCH 033/105] loop --- package.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/package.py b/package.py index 2500fa9..2c43295 100644 --- a/package.py +++ b/package.py @@ -7,17 +7,13 @@ SEPARATOR = f'{os.linesep}{os.linesep}' class Package: def __init__(self, package, files): - p = package.decode(CHARSET).strip() - f = files.decode(CHARSET).strip() - text = f'{p}{SEPARATOR}{f}' - for item in text.split(SEPARATOR): - line, *lines = item.split(os.linesep) - key = line.split(KEY)[1].lower() - if len(lines) == 1: - value = lines[0] - else: - value = lines - setattr(self, key, value) - print() - print(key) - print(value) + for binary in [package, files]: + text = binary.decode(CHARSET).strip() + for item in text.split(SEPARATOR): + line, *lines = item.split(os.linesep) + key = line.split(KEY)[1].lower() + if len(lines) == 1: + value = lines[0] + else: + value = lines + setattr(self, key, value) From c79ec3007843bf263c3a89bd9ec4191afa5cdce8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 02:40:21 +0200 Subject: [PATCH 034/105] links --- hypertext.py | 6 +++++- remote.py | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hypertext.py b/hypertext.py index 44abffd..42c5e49 100644 --- a/hypertext.py +++ b/hypertext.py @@ -1,4 +1,7 @@ import html.parser +import requests + +CHARSET = 'u8' class Parser(html.parser.HTMLParser): @@ -12,7 +15,8 @@ class Parser(html.parser.HTMLParser): [v for k, v in attributes if k == 'href']) -def get_links(hypertext): +def get_links(location): + hypertext = requests.get(location).content.decode(CHARSET) parser = Parser() parser.feed(hypertext) return parser.links diff --git a/remote.py b/remote.py index cb73ed0..27b28c0 100644 --- a/remote.py +++ b/remote.py @@ -36,8 +36,7 @@ class Remote: c = {} for architecture in self.architectures: location = os.path.join(self.location, DISTRIBUTION, architecture) - html = requests.get(location).content.decode(CHARSET) - links = sorted(hypertext.get_links(html)) + links = sorted(hypertext.get_links(location)) archives = [link for link in links if link.endswith(ARCHIVE)] archive = archives[-1] From 4a106b9c7d00dbf86ac999a2ca03fbe01eaedd3b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:00:43 +0200 Subject: [PATCH 035/105] hypertext,msys --- hypertext.py | 20 ++++++++++++++------ msys.py | 2 ++ remote.py | 6 +----- repository.py | 3 ++- 4 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 msys.py diff --git a/hypertext.py b/hypertext.py index 42c5e49..9252081 100644 --- a/hypertext.py +++ b/hypertext.py @@ -1,7 +1,7 @@ import html.parser import requests -CHARSET = 'u8' +import msys class Parser(html.parser.HTMLParser): @@ -15,8 +15,16 @@ class Parser(html.parser.HTMLParser): [v for k, v in attributes if k == 'href']) -def get_links(location): - hypertext = requests.get(location).content.decode(CHARSET) - parser = Parser() - parser.feed(hypertext) - return parser.links +class HyperText: + def __init__(self, location): + self.location = location + self.load() + + def load(self): + hypertext = requests.get(self.location).content.decode(msys.CHARSET) + parser = Parser() + parser.feed(hypertext) + self.links = parser.links + self.archives = [link for link in self.links + if link.endswith(msys.ARCHIVE)] + self.archive = sorted(self.archives)[-1] diff --git a/msys.py b/msys.py new file mode 100644 index 0000000..b70d268 --- /dev/null +++ b/msys.py @@ -0,0 +1,2 @@ +ARCHIVE = '.tar.xz' +CHARSET = 'u8' diff --git a/remote.py b/remote.py index 27b28c0..eacfe5c 100644 --- a/remote.py +++ b/remote.py @@ -6,7 +6,6 @@ import catalog import hypertext -ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] ARCHITECTURES_BITS = { 'x86_64': 64, @@ -36,10 +35,7 @@ class Remote: c = {} for architecture in self.architectures: location = os.path.join(self.location, DISTRIBUTION, architecture) - links = sorted(hypertext.get_links(location)) - archives = [link for link in links - if link.endswith(ARCHIVE)] - archive = archives[-1] + archive = hypertext.HyperText(location).archive a[architecture] = archive # c[architecture] = {} diff --git a/repository.py b/repository.py index 5d46fa5..3926ac1 100644 --- a/repository.py +++ b/repository.py @@ -2,6 +2,7 @@ import arguments import datetime import os +import msys import remote @@ -21,7 +22,7 @@ class Repository: directory = os.path.join(distribution, architecture) _, _, files = next(os.walk(directory)) archives = sorted([file for file in files - if file.endswith(remote.ARCHIVE)]) + if file.endswith(msys.ARCHIVE)]) archive = archives[-1] d[architecture] = archive self.archives = d From 121441077a13c731f4e288da50cde8f5d423572e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:46:44 +0200 Subject: [PATCH 036/105] archive --- remote.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/remote.py b/remote.py index eacfe5c..02e0052 100644 --- a/remote.py +++ b/remote.py @@ -35,8 +35,7 @@ class Remote: c = {} for architecture in self.architectures: location = os.path.join(self.location, DISTRIBUTION, architecture) - archive = hypertext.HyperText(location).archive - a[architecture] = archive + a[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} for ss in self.subsystems: From 0eafef2c35577f99f7f1de59f49abb87d5bc9423 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:52:31 +0200 Subject: [PATCH 037/105] subsystems --- arguments.py | 5 +++-- msys.py | 1 + remote.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arguments.py b/arguments.py index 12aaafe..f9160ee 100644 --- a/arguments.py +++ b/arguments.py @@ -1,6 +1,7 @@ import argparse import os +import msys import remote ACTION = 'action' @@ -51,7 +52,7 @@ msys remote repository's location list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, - nargs='+', choices=remote.SUBSYSTEMS, help='''\ + nargs='+', choices=msys.SUBSYSTEMS, help='''\ list of subsystems to sync ''') @@ -61,7 +62,7 @@ list of subsystems to sync directory containing modifications applying to filesystem ''') build.add_argument(f'-{COMPRESSION[0]}', f'--{COMPRESSION}', type=str, - choices=['7z', 'gz', 'xz', 'zst'], help='''\ + choices=['gz', 'xz', 'zst'], help='''\ compression applying to archive ''') diff --git a/msys.py b/msys.py index b70d268..be34410 100644 --- a/msys.py +++ b/msys.py @@ -1,2 +1,3 @@ ARCHIVE = '.tar.xz' CHARSET = 'u8' +SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index 02e0052..af5468b 100644 --- a/remote.py +++ b/remote.py @@ -4,6 +4,7 @@ import requests import arguments import catalog import hypertext +import msys ARCHITECTURES = ['x86_64', 'i686'] @@ -20,7 +21,6 @@ CHARSET = 'u8' DISTRIBUTION = 'distrib' MINGW = 'mingw' SIGNATURE = '.sig' -SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] class Remote: @@ -40,7 +40,7 @@ class Remote: c[architecture] = {} for ss in self.subsystems: location = self.location - if ss == SUBSYSTEMS[0]: + if ss == msys.SUBSYSTEMS[0]: subsystem = ss location = os.path.join(location, subsystem, architecture) else: From efb590b72e301b600ed7d570b16edbd098961400 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:53:20 +0200 Subject: [PATCH 038/105] charset --- remote.py | 1 - 1 file changed, 1 deletion(-) diff --git a/remote.py b/remote.py index af5468b..a7cc406 100644 --- a/remote.py +++ b/remote.py @@ -17,7 +17,6 @@ ARCHITECTURES_SUBSYSTEMS = { 'i686': ['msys', 'clang32', 'mingw32'], } CATALOG = '.files' -CHARSET = 'u8' DISTRIBUTION = 'distrib' MINGW = 'mingw' SIGNATURE = '.sig' From 5fe26606e09253c419b09565e40cbcad91938d17 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:55:22 +0200 Subject: [PATCH 039/105] architectures --- arguments.py | 2 +- msys.py | 1 + remote.py | 1 - repository.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arguments.py b/arguments.py index f9160ee..1d65880 100644 --- a/arguments.py +++ b/arguments.py @@ -48,7 +48,7 @@ action to perform onto msys repository msys remote repository's location ''') sync.add_argument(f'-{ARCHITECTURES[0]}', f'--{ARCHITECTURES}', type=str, - nargs='+', choices=remote.ARCHITECTURES, help='''\ + nargs='+', choices=msys.ARCHITECTURES, help='''\ list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, diff --git a/msys.py b/msys.py index be34410..6cf8c2c 100644 --- a/msys.py +++ b/msys.py @@ -1,3 +1,4 @@ ARCHIVE = '.tar.xz' +ARCHITECTURES = ['x86_64', 'i686'] CHARSET = 'u8' SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index a7cc406..d3a1912 100644 --- a/remote.py +++ b/remote.py @@ -7,7 +7,6 @@ import hypertext import msys -ARCHITECTURES = ['x86_64', 'i686'] ARCHITECTURES_BITS = { 'x86_64': 64, 'i686': 32, diff --git a/repository.py b/repository.py index 3926ac1..61b8e1d 100644 --- a/repository.py +++ b/repository.py @@ -18,7 +18,7 @@ class Repository: d = {} _, architectures, _ = next(os.walk(distribution)) for architecture in [a for a in architectures - if a in remote.ARCHITECTURES]: + if a in msys.ARCHITECTURES]: directory = os.path.join(distribution, architecture) _, _, files = next(os.walk(directory)) archives = sorted([file for file in files From a0b1a1ea940356edc4aaebc326322eb3c64bcb47 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:56:20 +0200 Subject: [PATCH 040/105] signature --- msys.py | 1 + remote.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/msys.py b/msys.py index 6cf8c2c..905c5ef 100644 --- a/msys.py +++ b/msys.py @@ -1,4 +1,5 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] CHARSET = 'u8' +SIGNATURE = '.sig' SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index d3a1912..3e09ad1 100644 --- a/remote.py +++ b/remote.py @@ -18,7 +18,6 @@ ARCHITECTURES_SUBSYSTEMS = { CATALOG = '.files' DISTRIBUTION = 'distrib' MINGW = 'mingw' -SIGNATURE = '.sig' class Remote: From 74e9b15378b850e054f5d0b852b9940896dd1940 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 03:57:52 +0200 Subject: [PATCH 041/105] catalog --- arguments.py | 1 - msys.py | 1 + remote.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arguments.py b/arguments.py index 1d65880..462a1a9 100644 --- a/arguments.py +++ b/arguments.py @@ -2,7 +2,6 @@ import argparse import os import msys -import remote ACTION = 'action' ARCHITECTURES = 'architectures' diff --git a/msys.py b/msys.py index 905c5ef..ca6533a 100644 --- a/msys.py +++ b/msys.py @@ -1,5 +1,6 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] +CATALOG = '.files' CHARSET = 'u8' SIGNATURE = '.sig' SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index 3e09ad1..b5b3370 100644 --- a/remote.py +++ b/remote.py @@ -15,7 +15,6 @@ ARCHITECTURES_SUBSYSTEMS = { 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], 'i686': ['msys', 'clang32', 'mingw32'], } -CATALOG = '.files' DISTRIBUTION = 'distrib' MINGW = 'mingw' @@ -44,7 +43,8 @@ class Remote: subsystem = f'{ss}{ARCHITECTURES_BITS[architecture]}' location = os.path.join(location, MINGW, subsystem) if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: - location = os.path.join(location, f'{subsystem}{CATALOG}') + location = os.path.join(location, + f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content c[architecture][subsystem] = catalog.Catalog(binary) self.archives = a From c09a71b3222e7d7e2b3956f6639b5ad96fa2027c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:01:32 +0200 Subject: [PATCH 042/105] distribution --- msys.py | 1 + remote.py | 4 ++-- repository.py | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/msys.py b/msys.py index ca6533a..f88c6a1 100644 --- a/msys.py +++ b/msys.py @@ -2,5 +2,6 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] CATALOG = '.files' CHARSET = 'u8' +DISTRIBUTION = 'distrib' SIGNATURE = '.sig' SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index b5b3370..e90fe6e 100644 --- a/remote.py +++ b/remote.py @@ -15,7 +15,6 @@ ARCHITECTURES_SUBSYSTEMS = { 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], 'i686': ['msys', 'clang32', 'mingw32'], } -DISTRIBUTION = 'distrib' MINGW = 'mingw' @@ -30,7 +29,8 @@ class Remote: a = {} c = {} for architecture in self.architectures: - location = os.path.join(self.location, DISTRIBUTION, architecture) + location = os.path.join(self.location, + msys.DISTRIBUTION, architecture) a[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} diff --git a/repository.py b/repository.py index 61b8e1d..998739b 100644 --- a/repository.py +++ b/repository.py @@ -3,7 +3,6 @@ import datetime import os import msys -import remote class Repository: @@ -14,7 +13,7 @@ class Repository: def load(self): distribution = os.path.join( - self.directory, remote.DISTRIBUTION) + self.directory, msys.DISTRIBUTION) d = {} _, architectures, _ = next(os.walk(distribution)) for architecture in [a for a in architectures From 21464b003586853bdff4d14b02da8fccb19e652b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:19:14 +0200 Subject: [PATCH 043/105] subsystems,bits --- msys.py | 11 ++++++++++- remote.py | 12 ++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/msys.py b/msys.py index f88c6a1..91a942e 100644 --- a/msys.py +++ b/msys.py @@ -1,7 +1,16 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] +ARCHITECTURES_BITS = { + 'x86_64': 64, + 'i686': 32, +} +ARCHITECTURES_SUBSYSTEMS = { + 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], + 'i686': ['msys', 'clang32', 'mingw32'], +} CATALOG = '.files' CHARSET = 'u8' DISTRIBUTION = 'distrib' SIGNATURE = '.sig' -SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] +SUBSYSTEM = 'msys' +SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index e90fe6e..d90ad91 100644 --- a/remote.py +++ b/remote.py @@ -7,14 +7,6 @@ import hypertext import msys -ARCHITECTURES_BITS = { - 'x86_64': 64, - 'i686': 32, -} -ARCHITECTURES_SUBSYSTEMS = { - 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], - 'i686': ['msys', 'clang32', 'mingw32'], -} MINGW = 'mingw' @@ -40,9 +32,9 @@ class Remote: subsystem = ss location = os.path.join(location, subsystem, architecture) else: - subsystem = f'{ss}{ARCHITECTURES_BITS[architecture]}' + subsystem = f'{ss}{msys.ARCHITECTURES_BITS[architecture]}' location = os.path.join(location, MINGW, subsystem) - if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: + if subsystem in msys.ARCHITECTURES_SUBSYSTEMS[architecture]: location = os.path.join(location, f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content From b155d8ad838f57e7f5fd6131c8b6a0bcba727c95 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:22:32 +0200 Subject: [PATCH 044/105] crt --- msys.py | 1 + remote.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/msys.py b/msys.py index 91a942e..b0a5db0 100644 --- a/msys.py +++ b/msys.py @@ -10,6 +10,7 @@ ARCHITECTURES_SUBSYSTEMS = { } CATALOG = '.files' CHARSET = 'u8' +CRT = 'mingw' DISTRIBUTION = 'distrib' SIGNATURE = '.sig' SUBSYSTEM = 'msys' diff --git a/remote.py b/remote.py index d90ad91..0adb8de 100644 --- a/remote.py +++ b/remote.py @@ -7,9 +7,6 @@ import hypertext import msys -MINGW = 'mingw' - - class Remote: def __init__(self, args): self.location = args[arguments.REMOTE] @@ -33,7 +30,7 @@ class Remote: location = os.path.join(location, subsystem, architecture) else: subsystem = f'{ss}{msys.ARCHITECTURES_BITS[architecture]}' - location = os.path.join(location, MINGW, subsystem) + location = os.path.join(location, msys.CRT, subsystem) if subsystem in msys.ARCHITECTURES_SUBSYSTEMS[architecture]: location = os.path.join(location, f'{subsystem}{msys.CATALOG}') From d03d9ebcbfe5db44e338627ee247f0fb03bab5ff Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:43:33 +0200 Subject: [PATCH 045/105] get_subsystems --- msys.py | 22 ++++++++++++++++++---- remote.py | 16 +++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/msys.py b/msys.py index b0a5db0..eac4de7 100644 --- a/msys.py +++ b/msys.py @@ -4,14 +4,28 @@ ARCHITECTURES_BITS = { 'x86_64': 64, 'i686': 32, } -ARCHITECTURES_SUBSYSTEMS = { - 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], - 'i686': ['msys', 'clang32', 'mingw32'], -} CATALOG = '.files' CHARSET = 'u8' CRT = 'mingw' DISTRIBUTION = 'distrib' SIGNATURE = '.sig' SUBSYSTEM = 'msys' + +ARCHITECTURES_SUBSYSTEMS = { + 'x86_64': [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'], + 'i686': [SUBSYSTEM, 'clang32', 'mingw32'], +} SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] + + +def get_subsystems(architecture, families): + list = [] + bits = ARCHITECTURES_BITS[architecture] + for family in families: + if family == SUBSYSTEM: + subsystem = family + else: + subsystem = f'{family}{bits}' + if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: + list.append(subsystem) + return list diff --git a/remote.py b/remote.py index 0adb8de..11d04e4 100644 --- a/remote.py +++ b/remote.py @@ -18,24 +18,22 @@ class Remote: a = {} c = {} for architecture in self.architectures: + subsystems = msys.get_subsystems(architecture, self.subsystems) location = os.path.join(self.location, msys.DISTRIBUTION, architecture) a[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} - for ss in self.subsystems: + for subsystem in subsystems: location = self.location - if ss == msys.SUBSYSTEMS[0]: - subsystem = ss + if subsystem == msys.SUBSYSTEM: location = os.path.join(location, subsystem, architecture) else: - subsystem = f'{ss}{msys.ARCHITECTURES_BITS[architecture]}' location = os.path.join(location, msys.CRT, subsystem) - if subsystem in msys.ARCHITECTURES_SUBSYSTEMS[architecture]: - location = os.path.join(location, - f'{subsystem}{msys.CATALOG}') - binary = requests.get(location).content - c[architecture][subsystem] = catalog.Catalog(binary) + location = os.path.join(location, + f'{subsystem}{msys.CATALOG}') + binary = requests.get(location).content + c[architecture][subsystem] = catalog.Catalog(binary) self.archives = a self.catalogs = c From 44e6cedaa4b55a96cb4c26e01ec64b5d0aa41af1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:50:28 +0200 Subject: [PATCH 046/105] architecture,repository --- arguments.py | 6 +++--- msys.py | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/arguments.py b/arguments.py index 462a1a9..aa098c0 100644 --- a/arguments.py +++ b/arguments.py @@ -72,9 +72,9 @@ compression applying to archive action='info', - remote='https://repo.msys2.org', - architectures=['x86_64'], - subsystems=['msys', 'mingw'], + remote=msys.REPOSITORY, + architectures=[msys.ARCHITECTURE], + subsystems=[msys.SUBSYSTEM, 'mingw'], filesystem='fs', compression='zst', diff --git a/msys.py b/msys.py index eac4de7..aaf6a0d 100644 --- a/msys.py +++ b/msys.py @@ -1,18 +1,20 @@ ARCHIVE = '.tar.xz' -ARCHITECTURES = ['x86_64', 'i686'] -ARCHITECTURES_BITS = { - 'x86_64': 64, - 'i686': 32, -} +ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' CRT = 'mingw' DISTRIBUTION = 'distrib' +REPOSITORY = 'https://repo.msys2.org' SIGNATURE = '.sig' SUBSYSTEM = 'msys' +ARCHITECTURES = [ARCHITECTURE, 'i686'] +ARCHITECTURES_BITS = { + ARCHITECTURE: 64, + 'i686': 32, +} ARCHITECTURES_SUBSYSTEMS = { - 'x86_64': [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'], + ARCHITECTURE: [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'], 'i686': [SUBSYSTEM, 'clang32', 'mingw32'], } SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] From b0ecc439614250f2adf8cc52fa0b35b2a5f99395 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 05:01:21 +0200 Subject: [PATCH 047/105] get_subsystem --- msys.py | 12 ++++++++++++ remote.py | 9 +++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/msys.py b/msys.py index aaf6a0d..a55fdbc 100644 --- a/msys.py +++ b/msys.py @@ -1,3 +1,5 @@ +import os + ARCHIVE = '.tar.xz' ARCHITECTURE = 'x86_64' CATALOG = '.files' @@ -31,3 +33,13 @@ def get_subsystems(architecture, families): if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: list.append(subsystem) return list + + +def get_subsystem(architecture, subsystem): + list = [] + if subsystem != SUBSYSTEM: + list.append(CRT) + list.append(subsystem) + if subsystem == SUBSYSTEM: + list.append(architecture) + return os.sep.join(list) diff --git a/remote.py b/remote.py index 11d04e4..a1aba9f 100644 --- a/remote.py +++ b/remote.py @@ -25,12 +25,9 @@ class Remote: # c[architecture] = {} for subsystem in subsystems: - location = self.location - if subsystem == msys.SUBSYSTEM: - location = os.path.join(location, subsystem, architecture) - else: - location = os.path.join(location, msys.CRT, subsystem) - location = os.path.join(location, + location = os.path.join(self.location, + msys.get_subsystem(architecture, + subsystem), f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content c[architecture][subsystem] = catalog.Catalog(binary) From 279cab318aab7dc89d788ed43156f2af440d7aa4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 05:04:35 +0200 Subject: [PATCH 048/105] archives --- msys.py | 24 ++++++++++++++---------- remote.py | 8 ++++---- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/msys.py b/msys.py index a55fdbc..9af1038 100644 --- a/msys.py +++ b/msys.py @@ -22,6 +22,20 @@ ARCHITECTURES_SUBSYSTEMS = { SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] +def get_distribution(architecture): + return os.path.join(DISTRIBUTION, architecture) + + +def get_subsystem(architecture, subsystem): + list = [] + if subsystem != SUBSYSTEM: + list.append(CRT) + list.append(subsystem) + if subsystem == SUBSYSTEM: + list.append(architecture) + return os.sep.join(list) + + def get_subsystems(architecture, families): list = [] bits = ARCHITECTURES_BITS[architecture] @@ -33,13 +47,3 @@ def get_subsystems(architecture, families): if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: list.append(subsystem) return list - - -def get_subsystem(architecture, subsystem): - list = [] - if subsystem != SUBSYSTEM: - list.append(CRT) - list.append(subsystem) - if subsystem == SUBSYSTEM: - list.append(architecture) - return os.sep.join(list) diff --git a/remote.py b/remote.py index a1aba9f..726cda6 100644 --- a/remote.py +++ b/remote.py @@ -15,13 +15,13 @@ class Remote: self.load() def load(self): - a = {} + archives = {} c = {} for architecture in self.architectures: subsystems = msys.get_subsystems(architecture, self.subsystems) location = os.path.join(self.location, - msys.DISTRIBUTION, architecture) - a[architecture] = hypertext.HyperText(location).archive + msys.get_distribution(architecture)) + archives[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} for subsystem in subsystems: @@ -31,7 +31,7 @@ class Remote: f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content c[architecture][subsystem] = catalog.Catalog(binary) - self.archives = a + self.archives = archives self.catalogs = c def __str__(self): From e90a4396fa8d8d5bd78af14a7196efa4939abd93 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 13:45:02 +0200 Subject: [PATCH 049/105] packages --- __init__.py | 9 +-------- package.py | 13 +++++++++++-- synchronization.py | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/__init__.py b/__init__.py index 48a2aa5..f0cd852 100755 --- a/__init__.py +++ b/__init__.py @@ -34,14 +34,7 @@ def info(args): def sync(args): sync = synchronization.Synchronization(args) print(sync) - # TODO prepare temporary directory - print('prepare…') - # TODO fetch - print('fetch…') - # TODO purge useless files - print('purge…') - # TODO clean temporary directory - print('clean…') + sync.run() def main(): diff --git a/package.py b/package.py index 2c43295..f8f0b9c 100644 --- a/package.py +++ b/package.py @@ -1,6 +1,7 @@ import os -CHARSET = 'u8' +import msys + KEY = '%' SEPARATOR = f'{os.linesep}{os.linesep}' @@ -8,7 +9,7 @@ SEPARATOR = f'{os.linesep}{os.linesep}' class Package: def __init__(self, package, files): for binary in [package, files]: - text = binary.decode(CHARSET).strip() + text = binary.decode(msys.CHARSET).strip() for item in text.split(SEPARATOR): line, *lines = item.split(os.linesep) key = line.split(KEY)[1].lower() @@ -17,3 +18,11 @@ class Package: else: value = lines setattr(self, key, value) + + def __str__(self): + lines = [ + f'Name: {self.name}', + f'Size: {self.csize}', + f'Hash: {self.sha256sum}', + ] + return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index 0a268ac..f824470 100644 --- a/synchronization.py +++ b/synchronization.py @@ -1,5 +1,8 @@ import os +import shutil +import arguments +import msys import remote import repository @@ -9,6 +12,21 @@ class Synchronization: self.remote = remote.Remote(args) self.repository = repository.Repository(args) self.temporary = self.repository.get_temporary() + self.threads = args[arguments.THREADS] + + def run(self): + for architecture in self.remote.architectures: + for subsystem in msys.get_subsystems(architecture, + self.remote.subsystems): + catalog = self.remote.catalogs[architecture][subsystem] + for _, package in sorted(catalog.packages.items()): + print() + print(package) + tmp = os.path.join(self.repository.directory, + self.repository.get_temporary()) + os.makedirs(tmp) + # clean temporary directory + shutil.rmtree(tmp) def __str__(self): lines = [ From ec6a6e07e1beb4f9961b578065039b9cd906ace9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 14:07:15 +0200 Subject: [PATCH 050/105] file --- file.py | 20 ++++++++++++++++++++ synchronization.py | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 file.py diff --git a/file.py b/file.py new file mode 100644 index 0000000..8100b1e --- /dev/null +++ b/file.py @@ -0,0 +1,20 @@ +import os + + +class File: + def __init__(self, remote, name, size, local, hash): + self.remote = remote + self.name = name + self.size = size + self.local = local + self.hash = hash + + def __str__(self): + lines = [ + f'Remote: {self.remote}', + f' Name: {self.name}', + f' Size: {self.size}', + f' Local: {self.local}', + f' Hash: {self.hash}', + ] + return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index f824470..2b55874 100644 --- a/synchronization.py +++ b/synchronization.py @@ -2,6 +2,7 @@ import os import shutil import arguments +import file import msys import remote import repository @@ -19,9 +20,17 @@ class Synchronization: for subsystem in msys.get_subsystems(architecture, self.remote.subsystems): catalog = self.remote.catalogs[architecture][subsystem] + path = msys.get_subsystem(architecture, subsystem) for _, package in sorted(catalog.packages.items()): + f = file.File( + os.path.join(self.remote.location, path), + package.name, + package.csize, + os.path.join(self.repository.directory, path), + package.sha256sum, + ) print() - print(package) + print(f) tmp = os.path.join(self.repository.directory, self.repository.get_temporary()) os.makedirs(tmp) From d0323aee9f0016113151a2d81d4666d2553da938 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 14:44:22 +0200 Subject: [PATCH 051/105] local --- __init__.py | 4 ++-- repository.py => local.py | 0 synchronization.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename repository.py => local.py (100%) diff --git a/__init__.py b/__init__.py index f0cd852..69155b6 100755 --- a/__init__.py +++ b/__init__.py @@ -3,7 +3,7 @@ import sys import arguments -import repository +import local import synchronization @@ -28,7 +28,7 @@ def check(args): def info(args): - print(repository.Repository(args)) + print(local.Repository(args)) def sync(args): diff --git a/repository.py b/local.py similarity index 100% rename from repository.py rename to local.py diff --git a/synchronization.py b/synchronization.py index 2b55874..0e46f0e 100644 --- a/synchronization.py +++ b/synchronization.py @@ -3,15 +3,15 @@ import shutil import arguments import file +import local import msys import remote -import repository class Synchronization: def __init__(self, args): self.remote = remote.Remote(args) - self.repository = repository.Repository(args) + self.repository = local.Repository(args) self.temporary = self.repository.get_temporary() self.threads = args[arguments.THREADS] From 0afc9d897c0f9beb1631ee90e7ed528dc03fb5b0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 14:45:28 +0200 Subject: [PATCH 052/105] Local --- __init__.py | 2 +- local.py | 2 +- synchronization.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index 69155b6..a895768 100755 --- a/__init__.py +++ b/__init__.py @@ -28,7 +28,7 @@ def check(args): def info(args): - print(local.Repository(args)) + print(local.Local(args)) def sync(args): diff --git a/local.py b/local.py index 998739b..c091509 100644 --- a/local.py +++ b/local.py @@ -5,7 +5,7 @@ import os import msys -class Repository: +class Local: def __init__(self, args): self.directory = args[arguments.DIRECTORY] self.temporary = args[arguments.TEMPORARY] diff --git a/synchronization.py b/synchronization.py index 0e46f0e..4c95d55 100644 --- a/synchronization.py +++ b/synchronization.py @@ -11,7 +11,7 @@ import remote class Synchronization: def __init__(self, args): self.remote = remote.Remote(args) - self.repository = local.Repository(args) + self.repository = local.Local(args) self.temporary = self.repository.get_temporary() self.threads = args[arguments.THREADS] From 3707f42b77a872af596550f45de335ddc8086c4b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 14:48:12 +0200 Subject: [PATCH 053/105] repository --- local.py | 3 ++- remote.py | 3 ++- repository.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 repository.py diff --git a/local.py b/local.py index c091509..36595c2 100644 --- a/local.py +++ b/local.py @@ -3,9 +3,10 @@ import datetime import os import msys +import repository -class Local: +class Local(repository.Repository): def __init__(self, args): self.directory = args[arguments.DIRECTORY] self.temporary = args[arguments.TEMPORARY] diff --git a/remote.py b/remote.py index 726cda6..da8d24e 100644 --- a/remote.py +++ b/remote.py @@ -5,9 +5,10 @@ import arguments import catalog import hypertext import msys +import repository -class Remote: +class Remote(repository.Repository): def __init__(self, args): self.location = args[arguments.REMOTE] self.architectures = args[arguments.ARCHITECTURES] diff --git a/repository.py b/repository.py new file mode 100644 index 0000000..45c195b --- /dev/null +++ b/repository.py @@ -0,0 +1,3 @@ +class Repository: + def __init__(self): + pass From 9cd6155f8c07dd81f347ef7546345554d1321a37 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 15:01:24 +0200 Subject: [PATCH 054/105] location,str --- local.py | 7 +++---- remote.py | 8 +++++--- repository.py | 13 +++++++++++-- synchronization.py | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/local.py b/local.py index 36595c2..836ee7c 100644 --- a/local.py +++ b/local.py @@ -8,13 +8,13 @@ import repository class Local(repository.Repository): def __init__(self, args): - self.directory = args[arguments.DIRECTORY] + super().__init__(args[arguments.DIRECTORY]) self.temporary = args[arguments.TEMPORARY] self.load() def load(self): distribution = os.path.join( - self.directory, msys.DISTRIBUTION) + self.location, msys.DISTRIBUTION) d = {} _, architectures, _ = next(os.walk(distribution)) for architecture in [a for a in architectures @@ -34,8 +34,7 @@ class Local(repository.Repository): def __str__(self): lines = [ - f'Directory: {self.directory}', - f' → {os.path.realpath(self.directory)}', + super().__str__(), 'Archives:', ] for architecture, archive in reversed(sorted(self.archives.items())): diff --git a/remote.py b/remote.py index da8d24e..94703fc 100644 --- a/remote.py +++ b/remote.py @@ -10,7 +10,7 @@ import repository class Remote(repository.Repository): def __init__(self, args): - self.location = args[arguments.REMOTE] + super().__init__(args[arguments.REMOTE]) self.architectures = args[arguments.ARCHITECTURES] self.subsystems = args[arguments.SUBSYSTEMS] self.load() @@ -36,8 +36,10 @@ class Remote(repository.Repository): self.catalogs = c def __str__(self): - lines = [f'Location: {self.location}', - 'Archives:'] + lines = [ + super().__str__(), + 'Archives:', + ] for architecture, archive in reversed(sorted(self.archives.items())): lines.append(f'{architecture} → {archive}') lines.append('Subsystems:') diff --git a/repository.py b/repository.py index 45c195b..e6a69e4 100644 --- a/repository.py +++ b/repository.py @@ -1,3 +1,12 @@ +import os + + class Repository: - def __init__(self): - pass + def __init__(self, location): + self.location = location + + def __str__(self): + lines = [ + f'Location: {self.location}', + ] + return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index 4c95d55..27956e0 100644 --- a/synchronization.py +++ b/synchronization.py @@ -26,12 +26,12 @@ class Synchronization: os.path.join(self.remote.location, path), package.name, package.csize, - os.path.join(self.repository.directory, path), + os.path.join(self.repository.location, path), package.sha256sum, ) print() print(f) - tmp = os.path.join(self.repository.directory, + tmp = os.path.join(self.repository.location, self.repository.get_temporary()) os.makedirs(tmp) # clean temporary directory From f849bca87cb5f06e3136872e30cb10254cbe1cbc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 15:22:02 +0200 Subject: [PATCH 055/105] architecture,distribution,subsystem --- architecture.py | 20 ++++++++++++++++++++ distribution.py | 12 ++++++++++++ subsystem.py | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 architecture.py create mode 100644 distribution.py create mode 100644 subsystem.py diff --git a/architecture.py b/architecture.py new file mode 100644 index 0000000..38e1317 --- /dev/null +++ b/architecture.py @@ -0,0 +1,20 @@ +import os + +import distribution + + +class Architecture: + def __init__(self, name): + self.name = name + self.distribution = distribution.Distribution(self) + # TODO subsystems + self.subsystems = {} + + def __str__(self): + lines = [ + f'Name: {self.name}', + ] + return os.linesep.join(lines) + +X86 = Architecture('x86_64') +I86 = Architecture('i686') diff --git a/distribution.py b/distribution.py new file mode 100644 index 0000000..4b9303d --- /dev/null +++ b/distribution.py @@ -0,0 +1,12 @@ +import os + + +class Distribution: + def __init__(self, architecture): + self.architecture = architecture + + def __str__(self): + lines = [ + f'Architecture: {self.architecture.name}', + ] + return os.linesep.join(lines) diff --git a/subsystem.py b/subsystem.py new file mode 100644 index 0000000..90421e7 --- /dev/null +++ b/subsystem.py @@ -0,0 +1,16 @@ +import os + +MAIN = 'msys' + + +class SubSystem: + def __init__(self, architecture): + self.architecture = architecture + self.name = name + + def __str__(self): + lines = [ + f'Architecture: {self.architecture.name}', + f' Name: {self.name}', + ] + return os.linesep.join(lines) From bb230e0c6d85dfc04fb011027eba136e29130053 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 15:44:03 +0200 Subject: [PATCH 056/105] architectures --- architecture.py | 12 +++++++++--- arguments.py | 4 ++++ msys.py | 9 ++++----- remote.py | 1 - repository.py | 8 +++++++- subsystem.py | 2 ++ 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/architecture.py b/architecture.py index 38e1317..b7609ba 100644 --- a/architecture.py +++ b/architecture.py @@ -2,10 +2,14 @@ import os import distribution +X86 = 'x86_64' +I86 = 'i686' + class Architecture: - def __init__(self, name): + def __init__(self, name, bits): self.name = name + self.bits = bits self.distribution = distribution.Distribution(self) # TODO subsystems self.subsystems = {} @@ -16,5 +20,7 @@ class Architecture: ] return os.linesep.join(lines) -X86 = Architecture('x86_64') -I86 = Architecture('i686') +ARCHITECTURES = { + X86: Architecture(X86, 64), + I86: Architecture(I86, 32), +} diff --git a/arguments.py b/arguments.py index aa098c0..bf19175 100644 --- a/arguments.py +++ b/arguments.py @@ -81,3 +81,7 @@ compression applying to archive ) return vars(parser.parse_args()) + +D = parse() + +architectures = D[ARCHITECTURES] diff --git a/msys.py b/msys.py index 9af1038..7369b4f 100644 --- a/msys.py +++ b/msys.py @@ -23,7 +23,7 @@ SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] def get_distribution(architecture): - return os.path.join(DISTRIBUTION, architecture) + return os.path.join(DISTRIBUTION, architecture.name) def get_subsystem(architecture, subsystem): @@ -32,18 +32,17 @@ def get_subsystem(architecture, subsystem): list.append(CRT) list.append(subsystem) if subsystem == SUBSYSTEM: - list.append(architecture) + list.append(architecture.name) return os.sep.join(list) def get_subsystems(architecture, families): list = [] - bits = ARCHITECTURES_BITS[architecture] for family in families: if family == SUBSYSTEM: subsystem = family else: - subsystem = f'{family}{bits}' - if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: + subsystem = f'{family}{architecture.bits}' + if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture.name]: list.append(subsystem) return list diff --git a/remote.py b/remote.py index 94703fc..1886111 100644 --- a/remote.py +++ b/remote.py @@ -11,7 +11,6 @@ import repository class Remote(repository.Repository): def __init__(self, args): super().__init__(args[arguments.REMOTE]) - self.architectures = args[arguments.ARCHITECTURES] self.subsystems = args[arguments.SUBSYSTEMS] self.load() diff --git a/repository.py b/repository.py index e6a69e4..93d0928 100644 --- a/repository.py +++ b/repository.py @@ -1,12 +1,18 @@ import os +import architecture +import arguments + class Repository: def __init__(self, location): self.location = location + self.architectures = [architecture.ARCHITECTURES[a] + for a in arguments.architectures] def __str__(self): lines = [ - f'Location: {self.location}', + f' Location: {self.location}', + f'Architectures: {[a.name for a in self.architectures]}', ] return os.linesep.join(lines) diff --git a/subsystem.py b/subsystem.py index 90421e7..d2bbf77 100644 --- a/subsystem.py +++ b/subsystem.py @@ -2,6 +2,8 @@ import os MAIN = 'msys' +FAMILIES = [MAIN, 'clang', 'mingw', 'ucrt'] + class SubSystem: def __init__(self, architecture): From 7033a6189e135b542eced3da253df3cd90d8e8fd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 15:46:37 +0200 Subject: [PATCH 057/105] lint --- architecture.py | 1 + arguments.py | 1 + subsystem.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/architecture.py b/architecture.py index b7609ba..61f0d84 100644 --- a/architecture.py +++ b/architecture.py @@ -20,6 +20,7 @@ class Architecture: ] return os.linesep.join(lines) + ARCHITECTURES = { X86: Architecture(X86, 64), I86: Architecture(I86, 32), diff --git a/arguments.py b/arguments.py index bf19175..768a5e2 100644 --- a/arguments.py +++ b/arguments.py @@ -82,6 +82,7 @@ compression applying to archive return vars(parser.parse_args()) + D = parse() architectures = D[ARCHITECTURES] diff --git a/subsystem.py b/subsystem.py index d2bbf77..3f34b71 100644 --- a/subsystem.py +++ b/subsystem.py @@ -6,7 +6,7 @@ FAMILIES = [MAIN, 'clang', 'mingw', 'ucrt'] class SubSystem: - def __init__(self, architecture): + def __init__(self, architecture, name): self.architecture = architecture self.name = name From e9e6994c625df58aa90e117254deef1138c617ab Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 16:27:52 +0200 Subject: [PATCH 058/105] subsystems --- architecture.py | 15 ++++++++++----- arguments.py | 1 + remote.py | 3 +-- synchronization.py | 3 +-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/architecture.py b/architecture.py index 61f0d84..c8565fe 100644 --- a/architecture.py +++ b/architecture.py @@ -1,18 +1,18 @@ import os import distribution +import subsystem X86 = 'x86_64' I86 = 'i686' class Architecture: - def __init__(self, name, bits): + def __init__(self, name, bits, subsystems): self.name = name self.bits = bits self.distribution = distribution.Distribution(self) - # TODO subsystems - self.subsystems = {} + self.subsystems = {s: subsystem.SubSystem(self, s) for s in subsystems} def __str__(self): lines = [ @@ -21,7 +21,12 @@ class Architecture: return os.linesep.join(lines) +x86 = Architecture(X86, 64, [subsystem.MAIN, + 'clang64', 'mingw64', 'ucrt64']) +i86 = Architecture(I86, 32, [subsystem.MAIN, + 'clang32', 'mingw32']) + ARCHITECTURES = { - X86: Architecture(X86, 64), - I86: Architecture(I86, 32), + X86: x86, + I86: i86, } diff --git a/arguments.py b/arguments.py index 768a5e2..482a885 100644 --- a/arguments.py +++ b/arguments.py @@ -86,3 +86,4 @@ compression applying to archive D = parse() architectures = D[ARCHITECTURES] +subsystems = D[SUBSYSTEMS] diff --git a/remote.py b/remote.py index 1886111..68e9f5e 100644 --- a/remote.py +++ b/remote.py @@ -11,14 +11,13 @@ import repository class Remote(repository.Repository): def __init__(self, args): super().__init__(args[arguments.REMOTE]) - self.subsystems = args[arguments.SUBSYSTEMS] self.load() def load(self): archives = {} c = {} for architecture in self.architectures: - subsystems = msys.get_subsystems(architecture, self.subsystems) + subsystems = architecture.subsystems.keys() location = os.path.join(self.location, msys.get_distribution(architecture)) archives[architecture] = hypertext.HyperText(location).archive diff --git a/synchronization.py b/synchronization.py index 27956e0..3899624 100644 --- a/synchronization.py +++ b/synchronization.py @@ -17,8 +17,7 @@ class Synchronization: def run(self): for architecture in self.remote.architectures: - for subsystem in msys.get_subsystems(architecture, - self.remote.subsystems): + for subsystem in architecture.subsystems.keys(): catalog = self.remote.catalogs[architecture][subsystem] path = msys.get_subsystem(architecture, subsystem) for _, package in sorted(catalog.packages.items()): From bb36a79cbf526f7d3ef01d58ec5328bb8040c262 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 16:42:35 +0200 Subject: [PATCH 059/105] path/subsystem --- msys.py | 11 ----------- remote.py | 4 ++-- subsystem.py | 10 ++++++++++ synchronization.py | 3 +-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/msys.py b/msys.py index 7369b4f..6f5c0b4 100644 --- a/msys.py +++ b/msys.py @@ -4,7 +4,6 @@ ARCHIVE = '.tar.xz' ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' -CRT = 'mingw' DISTRIBUTION = 'distrib' REPOSITORY = 'https://repo.msys2.org' SIGNATURE = '.sig' @@ -26,16 +25,6 @@ def get_distribution(architecture): return os.path.join(DISTRIBUTION, architecture.name) -def get_subsystem(architecture, subsystem): - list = [] - if subsystem != SUBSYSTEM: - list.append(CRT) - list.append(subsystem) - if subsystem == SUBSYSTEM: - list.append(architecture.name) - return os.sep.join(list) - - def get_subsystems(architecture, families): list = [] for family in families: diff --git a/remote.py b/remote.py index 68e9f5e..7a8d865 100644 --- a/remote.py +++ b/remote.py @@ -25,8 +25,8 @@ class Remote(repository.Repository): c[architecture] = {} for subsystem in subsystems: location = os.path.join(self.location, - msys.get_subsystem(architecture, - subsystem), + architecture.subsystems[subsystem] + .path, f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content c[architecture][subsystem] = catalog.Catalog(binary) diff --git a/subsystem.py b/subsystem.py index 3f34b71..cae4ed0 100644 --- a/subsystem.py +++ b/subsystem.py @@ -1,5 +1,6 @@ import os +CRT = 'mingw' MAIN = 'msys' FAMILIES = [MAIN, 'clang', 'mingw', 'ucrt'] @@ -9,10 +10,19 @@ class SubSystem: def __init__(self, architecture, name): self.architecture = architecture self.name = name + # path + list = [] + if self.name != MAIN: + list.append(CRT) + list.append(self.name) + if self.name == MAIN: + list.append(self.architecture.name) + self.path = os.sep.join(list) def __str__(self): lines = [ f'Architecture: {self.architecture.name}', f' Name: {self.name}', + f' Path: {self.path}', ] return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index 3899624..85be065 100644 --- a/synchronization.py +++ b/synchronization.py @@ -4,7 +4,6 @@ import shutil import arguments import file import local -import msys import remote @@ -19,7 +18,7 @@ class Synchronization: for architecture in self.remote.architectures: for subsystem in architecture.subsystems.keys(): catalog = self.remote.catalogs[architecture][subsystem] - path = msys.get_subsystem(architecture, subsystem) + path = architecture.subsystems[subsystem].path for _, package in sorted(catalog.packages.items()): f = file.File( os.path.join(self.remote.location, path), From 27ce3ca25c5b4afc88e6b4770e355bec4b8c0f63 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 16:50:15 +0200 Subject: [PATCH 060/105] path/distribution --- distribution.py | 4 ++++ local.py | 9 +++++---- msys.py | 7 ------- remote.py | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/distribution.py b/distribution.py index 4b9303d..9fad6cf 100644 --- a/distribution.py +++ b/distribution.py @@ -1,12 +1,16 @@ import os +DISTRIBUTION = 'distrib' + class Distribution: def __init__(self, architecture): self.architecture = architecture + self.path = os.sep.join([DISTRIBUTION, self.architecture.name]) def __str__(self): lines = [ f'Architecture: {self.architecture.name}', + f' Path: {self.path}', ] return os.linesep.join(lines) diff --git a/local.py b/local.py index 836ee7c..cbadd54 100644 --- a/local.py +++ b/local.py @@ -2,6 +2,7 @@ import arguments import datetime import os +import distribution import msys import repository @@ -13,13 +14,13 @@ class Local(repository.Repository): self.load() def load(self): - distribution = os.path.join( - self.location, msys.DISTRIBUTION) + distro = os.path.join( + self.location, distribution.DISTRIBUTION) d = {} - _, architectures, _ = next(os.walk(distribution)) + _, architectures, _ = next(os.walk(distro)) for architecture in [a for a in architectures if a in msys.ARCHITECTURES]: - directory = os.path.join(distribution, architecture) + directory = os.path.join(distro, architecture) _, _, files = next(os.walk(directory)) archives = sorted([file for file in files if file.endswith(msys.ARCHIVE)]) diff --git a/msys.py b/msys.py index 6f5c0b4..a01b57f 100644 --- a/msys.py +++ b/msys.py @@ -1,10 +1,7 @@ -import os - ARCHIVE = '.tar.xz' ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' -DISTRIBUTION = 'distrib' REPOSITORY = 'https://repo.msys2.org' SIGNATURE = '.sig' SUBSYSTEM = 'msys' @@ -21,10 +18,6 @@ ARCHITECTURES_SUBSYSTEMS = { SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] -def get_distribution(architecture): - return os.path.join(DISTRIBUTION, architecture.name) - - def get_subsystems(architecture, families): list = [] for family in families: diff --git a/remote.py b/remote.py index 7a8d865..c32ca56 100644 --- a/remote.py +++ b/remote.py @@ -19,7 +19,7 @@ class Remote(repository.Repository): for architecture in self.architectures: subsystems = architecture.subsystems.keys() location = os.path.join(self.location, - msys.get_distribution(architecture)) + architecture.distribution.path) archives[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} From 1857f0e1b003b04ee8fe632e705e8a9f79c8955b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 18:07:20 +0200 Subject: [PATCH 061/105] architecture/subsystems --- architecture.py | 8 +++++++- msys.py | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/architecture.py b/architecture.py index c8565fe..7323109 100644 --- a/architecture.py +++ b/architecture.py @@ -1,5 +1,6 @@ import os +import arguments import distribution import subsystem @@ -12,11 +13,16 @@ class Architecture: self.name = name self.bits = bits self.distribution = distribution.Distribution(self) - self.subsystems = {s: subsystem.SubSystem(self, s) for s in subsystems} + self.subsystems = {s: subsystem.SubSystem(self, s) + for s in [f if f == subsystem.MAIN + else f'{f}{self.bits}' + for f in arguments.subsystems] + if s in subsystems} def __str__(self): lines = [ f'Name: {self.name}', + f'Bits: {self.bits}', ] return os.linesep.join(lines) diff --git a/msys.py b/msys.py index a01b57f..8199705 100644 --- a/msys.py +++ b/msys.py @@ -16,15 +16,3 @@ ARCHITECTURES_SUBSYSTEMS = { 'i686': [SUBSYSTEM, 'clang32', 'mingw32'], } SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] - - -def get_subsystems(architecture, families): - list = [] - for family in families: - if family == SUBSYSTEM: - subsystem = family - else: - subsystem = f'{family}{architecture.bits}' - if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture.name]: - list.append(subsystem) - return list From 80e76995a5c97f5c676ea06d608f232a642cd08b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:02:34 +0200 Subject: [PATCH 062/105] arguments --- __init__.py | 16 +++++++--------- arguments.py | 5 +++++ local.py | 6 +++--- remote.py | 4 ++-- synchronization.py | 8 ++++---- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/__init__.py b/__init__.py index a895768..1390fa7 100755 --- a/__init__.py +++ b/__init__.py @@ -7,7 +7,7 @@ import local import synchronization -def build(args): +def build(): # TODO identify print('TODO identify') # TODO extract @@ -18,7 +18,7 @@ def build(args): print('TODO archive') -def check(args): +def check(): # TODO prepare threads print('TODO prepare threads') # TODO run threads @@ -27,20 +27,18 @@ def check(args): print('TODO watch threads') -def info(args): - print(local.Local(args)) +def info(): + print(local.Local()) -def sync(args): - sync = synchronization.Synchronization(args) +def sync(): + sync = synchronization.Synchronization() print(sync) sync.run() def main(): - args = arguments.parse() - function = getattr(sys.modules[__name__], args[arguments.ACTION]) - function(args) + getattr(sys.modules[__name__], arguments.action)() if __name__ == '__main__': diff --git a/arguments.py b/arguments.py index 482a885..fe93f23 100644 --- a/arguments.py +++ b/arguments.py @@ -85,5 +85,10 @@ compression applying to archive D = parse() +action = D[ACTION] architectures = D[ARCHITECTURES] +directory = D[DIRECTORY] +remote = D[REMOTE] subsystems = D[SUBSYSTEMS] +temporary = D[TEMPORARY] +threads = D[THREADS] diff --git a/local.py b/local.py index cbadd54..0f96b78 100644 --- a/local.py +++ b/local.py @@ -8,9 +8,9 @@ import repository class Local(repository.Repository): - def __init__(self, args): - super().__init__(args[arguments.DIRECTORY]) - self.temporary = args[arguments.TEMPORARY] + def __init__(self): + super().__init__(arguments.directory) + self.temporary = arguments.temporary self.load() def load(self): diff --git a/remote.py b/remote.py index c32ca56..36297cc 100644 --- a/remote.py +++ b/remote.py @@ -9,8 +9,8 @@ import repository class Remote(repository.Repository): - def __init__(self, args): - super().__init__(args[arguments.REMOTE]) + def __init__(self): + super().__init__(arguments.remote) self.load() def load(self): diff --git a/synchronization.py b/synchronization.py index 85be065..c4fa2b8 100644 --- a/synchronization.py +++ b/synchronization.py @@ -8,11 +8,11 @@ import remote class Synchronization: - def __init__(self, args): - self.remote = remote.Remote(args) - self.repository = local.Local(args) + def __init__(self): + self.remote = remote.Remote() + self.repository = local.Local() self.temporary = self.repository.get_temporary() - self.threads = args[arguments.THREADS] + self.threads = arguments.threads def run(self): for architecture in self.remote.architectures: From c2e9034ce0a3cfacb7b6878e58b0ddebb0bae095 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:04:03 +0200 Subject: [PATCH 063/105] bits --- msys.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/msys.py b/msys.py index 8199705..7578df0 100644 --- a/msys.py +++ b/msys.py @@ -7,10 +7,6 @@ SIGNATURE = '.sig' SUBSYSTEM = 'msys' ARCHITECTURES = [ARCHITECTURE, 'i686'] -ARCHITECTURES_BITS = { - ARCHITECTURE: 64, - 'i686': 32, -} ARCHITECTURES_SUBSYSTEMS = { ARCHITECTURE: [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'], 'i686': [SUBSYSTEM, 'clang32', 'mingw32'], From 9b24cc0c718eed15248b06c204828b4597519263 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:05:11 +0200 Subject: [PATCH 064/105] subsystems --- msys.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/msys.py b/msys.py index 7578df0..2dd581e 100644 --- a/msys.py +++ b/msys.py @@ -7,8 +7,4 @@ SIGNATURE = '.sig' SUBSYSTEM = 'msys' ARCHITECTURES = [ARCHITECTURE, 'i686'] -ARCHITECTURES_SUBSYSTEMS = { - ARCHITECTURE: [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'], - 'i686': [SUBSYSTEM, 'clang32', 'mingw32'], -} SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] From 5812aae871adcb5eb3b1f704b586dd582f2a4a45 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:08:47 +0200 Subject: [PATCH 065/105] families --- arguments.py | 3 ++- msys.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arguments.py b/arguments.py index fe93f23..527c6f7 100644 --- a/arguments.py +++ b/arguments.py @@ -2,6 +2,7 @@ import argparse import os import msys +import subsystem ACTION = 'action' ARCHITECTURES = 'architectures' @@ -51,7 +52,7 @@ msys remote repository's location list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, - nargs='+', choices=msys.SUBSYSTEMS, help='''\ + nargs='+', choices=subsystem.FAMILIES, help='''\ list of subsystems to sync ''') diff --git a/msys.py b/msys.py index 2dd581e..6c2d1a1 100644 --- a/msys.py +++ b/msys.py @@ -7,4 +7,3 @@ SIGNATURE = '.sig' SUBSYSTEM = 'msys' ARCHITECTURES = [ARCHITECTURE, 'i686'] -SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] From 7384440b72188e4bb79a8c4c7b97ba46a23ee645 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:10:13 +0200 Subject: [PATCH 066/105] subsystem --- arguments.py | 2 +- msys.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arguments.py b/arguments.py index 527c6f7..1ec5cc6 100644 --- a/arguments.py +++ b/arguments.py @@ -75,7 +75,7 @@ compression applying to archive remote=msys.REPOSITORY, architectures=[msys.ARCHITECTURE], - subsystems=[msys.SUBSYSTEM, 'mingw'], + subsystems=[subsystem.MAIN, 'mingw'], filesystem='fs', compression='zst', diff --git a/msys.py b/msys.py index 6c2d1a1..a5054a1 100644 --- a/msys.py +++ b/msys.py @@ -4,6 +4,5 @@ CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' SIGNATURE = '.sig' -SUBSYSTEM = 'msys' ARCHITECTURES = [ARCHITECTURE, 'i686'] From 6738c1752200ba52ae478e3fe65b814cc69b780e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:17:46 +0200 Subject: [PATCH 067/105] signature --- msys.py | 1 - 1 file changed, 1 deletion(-) diff --git a/msys.py b/msys.py index a5054a1..fb810d1 100644 --- a/msys.py +++ b/msys.py @@ -3,6 +3,5 @@ ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' -SIGNATURE = '.sig' ARCHITECTURES = [ARCHITECTURE, 'i686'] From 7800bb9175aa1ed801255c37df1d1bf2d8114dfa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:56:24 +0200 Subject: [PATCH 068/105] architectures --- architecture.py | 22 +++++++--------------- repository.py | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/architecture.py b/architecture.py index 7323109..9398e4d 100644 --- a/architecture.py +++ b/architecture.py @@ -4,14 +4,17 @@ import arguments import distribution import subsystem -X86 = 'x86_64' -I86 = 'i686' +ARCHITECTURES = { + 'x86_64': (64, [subsystem.MAIN, 'clang64', 'mingw64', 'ucrt64']), + 'i686' : (32, [subsystem.MAIN, 'clang32', 'mingw32']), +} class Architecture: - def __init__(self, name, bits, subsystems): + def __init__(self, repository, name): + self.repository = repository self.name = name - self.bits = bits + self.bits, subsystems = ARCHITECTURES[self.name] self.distribution = distribution.Distribution(self) self.subsystems = {s: subsystem.SubSystem(self, s) for s in [f if f == subsystem.MAIN @@ -25,14 +28,3 @@ class Architecture: f'Bits: {self.bits}', ] return os.linesep.join(lines) - - -x86 = Architecture(X86, 64, [subsystem.MAIN, - 'clang64', 'mingw64', 'ucrt64']) -i86 = Architecture(I86, 32, [subsystem.MAIN, - 'clang32', 'mingw32']) - -ARCHITECTURES = { - X86: x86, - I86: i86, -} diff --git a/repository.py b/repository.py index 93d0928..77de2b2 100644 --- a/repository.py +++ b/repository.py @@ -7,7 +7,7 @@ import arguments class Repository: def __init__(self, location): self.location = location - self.architectures = [architecture.ARCHITECTURES[a] + self.architectures = [architecture.Architecture(self, a) for a in arguments.architectures] def __str__(self): From 28369f58138789b318a3786cc65f69911c832afa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 19:57:15 +0200 Subject: [PATCH 069/105] lint --- architecture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/architecture.py b/architecture.py index 9398e4d..6549e1c 100644 --- a/architecture.py +++ b/architecture.py @@ -6,7 +6,7 @@ import subsystem ARCHITECTURES = { 'x86_64': (64, [subsystem.MAIN, 'clang64', 'mingw64', 'ucrt64']), - 'i686' : (32, [subsystem.MAIN, 'clang32', 'mingw32']), + 'i686': (32, [subsystem.MAIN, 'clang32', 'mingw32']), } From 68c15d9c39650fd342c03cd4f022509ac81150cc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 20:04:45 +0200 Subject: [PATCH 070/105] architectures --- arguments.py | 4 +++- local.py | 15 ++++++++------- msys.py | 2 -- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arguments.py b/arguments.py index 1ec5cc6..e1d4230 100644 --- a/arguments.py +++ b/arguments.py @@ -1,6 +1,7 @@ import argparse import os +import architecture import msys import subsystem @@ -48,7 +49,8 @@ action to perform onto msys repository msys remote repository's location ''') sync.add_argument(f'-{ARCHITECTURES[0]}', f'--{ARCHITECTURES}', type=str, - nargs='+', choices=msys.ARCHITECTURES, help='''\ + nargs='+', choices=architecture.ARCHITECTURES.keys(), + help='''\ list of architectures to sync ''') sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str, diff --git a/local.py b/local.py index 0f96b78..fff0061 100644 --- a/local.py +++ b/local.py @@ -1,7 +1,8 @@ -import arguments import datetime import os +import architecture +import arguments import distribution import msys import repository @@ -18,14 +19,14 @@ class Local(repository.Repository): self.location, distribution.DISTRIBUTION) d = {} _, architectures, _ = next(os.walk(distro)) - for architecture in [a for a in architectures - if a in msys.ARCHITECTURES]: - directory = os.path.join(distro, architecture) + for arch in [a for a in architectures + if a in architecture.ARCHITECTURES.keys()]: + directory = os.path.join(distro, arch) _, _, files = next(os.walk(directory)) archives = sorted([file for file in files if file.endswith(msys.ARCHIVE)]) archive = archives[-1] - d[architecture] = archive + d[arch] = archive self.archives = d def get_temporary(self): @@ -38,6 +39,6 @@ class Local(repository.Repository): super().__str__(), 'Archives:', ] - for architecture, archive in reversed(sorted(self.archives.items())): - lines.append(f'{architecture} → {archive}') + for arch, archive in reversed(sorted(self.archives.items())): + lines.append(f'{arch} → {archive}') return os.linesep.join(lines) diff --git a/msys.py b/msys.py index fb810d1..76749bb 100644 --- a/msys.py +++ b/msys.py @@ -3,5 +3,3 @@ ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' - -ARCHITECTURES = [ARCHITECTURE, 'i686'] From f2a7490652e4af1eb5de47f2933bbf900007941b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 20:11:36 +0200 Subject: [PATCH 071/105] architecture --- architecture.py | 6 ++++-- arguments.py | 2 +- msys.py | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/architecture.py b/architecture.py index 6549e1c..25c74f0 100644 --- a/architecture.py +++ b/architecture.py @@ -4,9 +4,11 @@ import arguments import distribution import subsystem +MAIN = 'x86_64' + ARCHITECTURES = { - 'x86_64': (64, [subsystem.MAIN, 'clang64', 'mingw64', 'ucrt64']), - 'i686': (32, [subsystem.MAIN, 'clang32', 'mingw32']), + MAIN: (64, [subsystem.MAIN, 'clang64', 'mingw64', 'ucrt64']), + 'i686': (32, [subsystem.MAIN, 'clang32', 'mingw32']), } diff --git a/arguments.py b/arguments.py index e1d4230..8f41486 100644 --- a/arguments.py +++ b/arguments.py @@ -76,7 +76,7 @@ compression applying to archive action='info', remote=msys.REPOSITORY, - architectures=[msys.ARCHITECTURE], + architectures=[architecture.MAIN], subsystems=[subsystem.MAIN, 'mingw'], filesystem='fs', diff --git a/msys.py b/msys.py index 76749bb..8ebbe8c 100644 --- a/msys.py +++ b/msys.py @@ -1,5 +1,4 @@ ARCHIVE = '.tar.xz' -ARCHITECTURE = 'x86_64' CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' From 1db8c559a2cfa970e6801578b5bd1bb204286454 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 20:27:48 +0200 Subject: [PATCH 072/105] files --- distribution.py | 4 ++++ local.py | 4 ++++ remote.py | 3 +++ 3 files changed, 11 insertions(+) diff --git a/distribution.py b/distribution.py index 9fad6cf..61a4b97 100644 --- a/distribution.py +++ b/distribution.py @@ -7,6 +7,10 @@ class Distribution: def __init__(self, architecture): self.architecture = architecture self.path = os.sep.join([DISTRIBUTION, self.architecture.name]) + self.load() + + def load(self): + files = self.architecture.repository.get_files(self.path) def __str__(self): lines = [ diff --git a/local.py b/local.py index fff0061..3a5622f 100644 --- a/local.py +++ b/local.py @@ -29,6 +29,10 @@ class Local(repository.Repository): d[arch] = archive self.archives = d + def get_files(self, path): + *_, files = next(os.walk(os.path.join(self.location, path))) + return files + def get_temporary(self): return os.path.join(self.temporary, datetime.datetime.now() diff --git a/remote.py b/remote.py index 36297cc..af14821 100644 --- a/remote.py +++ b/remote.py @@ -33,6 +33,9 @@ class Remote(repository.Repository): self.archives = archives self.catalogs = c + def get_files(self, path): + return hypertext.HyperText(os.path.join(self.location, path)).links + def __str__(self): lines = [ super().__str__(), From 3763dce133ffc43d6fd55b127bcad3b30eab21f7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 20:40:14 +0200 Subject: [PATCH 073/105] local --- distribution.py | 3 +++ hypertext.py | 3 --- local.py | 23 +---------------------- msys.py | 1 - remote.py | 3 --- 5 files changed, 4 insertions(+), 29 deletions(-) diff --git a/distribution.py b/distribution.py index 61a4b97..9f23682 100644 --- a/distribution.py +++ b/distribution.py @@ -1,5 +1,6 @@ import os +ARCHIVE = '.tar.xz' DISTRIBUTION = 'distrib' @@ -11,6 +12,8 @@ class Distribution: def load(self): files = self.architecture.repository.get_files(self.path) + self.archives = [f for f in files if f.endswith(ARCHIVE)] + self.archive = self.archives[-1] def __str__(self): lines = [ diff --git a/hypertext.py b/hypertext.py index 9252081..344d3a1 100644 --- a/hypertext.py +++ b/hypertext.py @@ -25,6 +25,3 @@ class HyperText: parser = Parser() parser.feed(hypertext) self.links = parser.links - self.archives = [link for link in self.links - if link.endswith(msys.ARCHIVE)] - self.archive = sorted(self.archives)[-1] diff --git a/local.py b/local.py index 3a5622f..2a53b80 100644 --- a/local.py +++ b/local.py @@ -1,10 +1,7 @@ import datetime import os -import architecture import arguments -import distribution -import msys import repository @@ -12,22 +9,6 @@ class Local(repository.Repository): def __init__(self): super().__init__(arguments.directory) self.temporary = arguments.temporary - self.load() - - def load(self): - distro = os.path.join( - self.location, distribution.DISTRIBUTION) - d = {} - _, architectures, _ = next(os.walk(distro)) - for arch in [a for a in architectures - if a in architecture.ARCHITECTURES.keys()]: - directory = os.path.join(distro, arch) - _, _, files = next(os.walk(directory)) - archives = sorted([file for file in files - if file.endswith(msys.ARCHIVE)]) - archive = archives[-1] - d[arch] = archive - self.archives = d def get_files(self, path): *_, files = next(os.walk(os.path.join(self.location, path))) @@ -41,8 +22,6 @@ class Local(repository.Repository): def __str__(self): lines = [ super().__str__(), - 'Archives:', + f'Temporary: {self.temporary}', ] - for arch, archive in reversed(sorted(self.archives.items())): - lines.append(f'{arch} → {archive}') return os.linesep.join(lines) diff --git a/msys.py b/msys.py index 8ebbe8c..87eb923 100644 --- a/msys.py +++ b/msys.py @@ -1,4 +1,3 @@ -ARCHIVE = '.tar.xz' CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' diff --git a/remote.py b/remote.py index af14821..71ae923 100644 --- a/remote.py +++ b/remote.py @@ -18,9 +18,6 @@ class Remote(repository.Repository): c = {} for architecture in self.architectures: subsystems = architecture.subsystems.keys() - location = os.path.join(self.location, - architecture.distribution.path) - archives[architecture] = hypertext.HyperText(location).archive # c[architecture] = {} for subsystem in subsystems: From 2e366f71f1ed021f2539c2947d049ac6a977acff Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 21:30:40 +0200 Subject: [PATCH 074/105] catalog --- catalog.py | 10 +++++++--- local.py | 4 ++++ msys.py | 1 - remote.py | 27 ++------------------------- subsystem.py | 4 ++++ synchronization.py | 16 ++++++++-------- 6 files changed, 25 insertions(+), 37 deletions(-) diff --git a/catalog.py b/catalog.py index 12ce4c1..a096d34 100644 --- a/catalog.py +++ b/catalog.py @@ -4,17 +4,21 @@ import tarfile import package +CATALOG = '.files' FILES = 'files' PACKAGE = 'desc' class Catalog: - def __init__(self, binary): - self.binary = binary + def __init__(self, subsystem): + self.subsystem = subsystem + self.path = os.path.join(self.subsystem.path, + f'{self.subsystem.name}{CATALOG}') self.load() def load(self): - f = io.BytesIO(self.binary) + binary = self.subsystem.architecture.repository.get_file(self.path) + f = io.BytesIO(binary) archive = tarfile.open(fileobj=f) m = {} packages = {} diff --git a/local.py b/local.py index 2a53b80..d1af64f 100644 --- a/local.py +++ b/local.py @@ -10,6 +10,10 @@ class Local(repository.Repository): super().__init__(arguments.directory) self.temporary = arguments.temporary + def get_file(self, path): + with open(os.path.join(self.location, path), 'br') as f: + return f.read() + def get_files(self, path): *_, files = next(os.walk(os.path.join(self.location, path))) return files diff --git a/msys.py b/msys.py index 87eb923..b93f9a4 100644 --- a/msys.py +++ b/msys.py @@ -1,3 +1,2 @@ -CATALOG = '.files' CHARSET = 'u8' REPOSITORY = 'https://repo.msys2.org' diff --git a/remote.py b/remote.py index 71ae923..2939717 100644 --- a/remote.py +++ b/remote.py @@ -2,33 +2,16 @@ import os import requests import arguments -import catalog import hypertext -import msys import repository class Remote(repository.Repository): def __init__(self): super().__init__(arguments.remote) - self.load() - def load(self): - archives = {} - c = {} - for architecture in self.architectures: - subsystems = architecture.subsystems.keys() - # - c[architecture] = {} - for subsystem in subsystems: - location = os.path.join(self.location, - architecture.subsystems[subsystem] - .path, - f'{subsystem}{msys.CATALOG}') - binary = requests.get(location).content - c[architecture][subsystem] = catalog.Catalog(binary) - self.archives = archives - self.catalogs = c + def get_file(self, path): + return requests.get(os.path.join(self.location, path)).content def get_files(self, path): return hypertext.HyperText(os.path.join(self.location, path)).links @@ -36,11 +19,5 @@ class Remote(repository.Repository): def __str__(self): lines = [ super().__str__(), - 'Archives:', ] - for architecture, archive in reversed(sorted(self.archives.items())): - lines.append(f'{architecture} → {archive}') - lines.append('Subsystems:') - for arch, ss in reversed(sorted(self.catalogs.items())): - lines.append(f'{arch} → {list(ss.keys())}') return os.linesep.join(lines) diff --git a/subsystem.py b/subsystem.py index cae4ed0..765c344 100644 --- a/subsystem.py +++ b/subsystem.py @@ -1,5 +1,7 @@ import os +import catalog + CRT = 'mingw' MAIN = 'msys' @@ -18,6 +20,8 @@ class SubSystem: if self.name == MAIN: list.append(self.architecture.name) self.path = os.sep.join(list) + # catalog + self.catalog = catalog.Catalog(self) def __str__(self): lines = [ diff --git a/synchronization.py b/synchronization.py index c4fa2b8..9e28832 100644 --- a/synchronization.py +++ b/synchronization.py @@ -16,15 +16,13 @@ class Synchronization: def run(self): for architecture in self.remote.architectures: - for subsystem in architecture.subsystems.keys(): - catalog = self.remote.catalogs[architecture][subsystem] - path = architecture.subsystems[subsystem].path - for _, package in sorted(catalog.packages.items()): + for subsystem in architecture.subsystems.values(): + for _, package in sorted(subsystem.catalog.packages.items()): f = file.File( - os.path.join(self.remote.location, path), + os.path.join(self.remote.location, subsystem.path), package.name, package.csize, - os.path.join(self.repository.location, path), + os.path.join(self.repository.location, subsystem.path), package.sha256sum, ) print() @@ -37,8 +35,10 @@ class Synchronization: def __str__(self): lines = [ - str(self.remote), str(), - str(self.repository), str(), + str(self.remote), + str(), + str(self.repository), + str(), f'Temporary: {self.temporary}', ] return os.linesep.join(lines) From f9584f44587131acd5017d233b835fd5ef7575db Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 21:34:35 +0200 Subject: [PATCH 075/105] remote --- arguments.py | 4 ++-- msys.py | 1 - remote.py | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arguments.py b/arguments.py index 8f41486..84fd24b 100644 --- a/arguments.py +++ b/arguments.py @@ -2,7 +2,7 @@ import argparse import os import architecture -import msys +import remote as r import subsystem ACTION = 'action' @@ -75,7 +75,7 @@ compression applying to archive action='info', - remote=msys.REPOSITORY, + remote=r.MAIN, architectures=[architecture.MAIN], subsystems=[subsystem.MAIN, 'mingw'], diff --git a/msys.py b/msys.py index b93f9a4..3314e45 100644 --- a/msys.py +++ b/msys.py @@ -1,2 +1 @@ CHARSET = 'u8' -REPOSITORY = 'https://repo.msys2.org' diff --git a/remote.py b/remote.py index 2939717..47bb8ce 100644 --- a/remote.py +++ b/remote.py @@ -5,6 +5,8 @@ import arguments import hypertext import repository +MAIN = 'https://repo.msys2.org' + class Remote(repository.Repository): def __init__(self): From a5c887343652fb3f211dc583919628bf810a102d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 21:37:22 +0200 Subject: [PATCH 076/105] charset --- hypertext.py | 4 ++-- msys.py | 1 - package.py | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 msys.py diff --git a/hypertext.py b/hypertext.py index 344d3a1..fad9918 100644 --- a/hypertext.py +++ b/hypertext.py @@ -1,7 +1,7 @@ import html.parser import requests -import msys +CHARSET = 'u8' class Parser(html.parser.HTMLParser): @@ -21,7 +21,7 @@ class HyperText: self.load() def load(self): - hypertext = requests.get(self.location).content.decode(msys.CHARSET) + hypertext = requests.get(self.location).content.decode(CHARSET) parser = Parser() parser.feed(hypertext) self.links = parser.links diff --git a/msys.py b/msys.py deleted file mode 100644 index 3314e45..0000000 --- a/msys.py +++ /dev/null @@ -1 +0,0 @@ -CHARSET = 'u8' diff --git a/package.py b/package.py index f8f0b9c..7b16b84 100644 --- a/package.py +++ b/package.py @@ -1,7 +1,6 @@ import os -import msys - +CHARSET = 'u8' KEY = '%' SEPARATOR = f'{os.linesep}{os.linesep}' @@ -9,7 +8,7 @@ SEPARATOR = f'{os.linesep}{os.linesep}' class Package: def __init__(self, package, files): for binary in [package, files]: - text = binary.decode(msys.CHARSET).strip() + text = binary.decode(CHARSET).strip() for item in text.split(SEPARATOR): line, *lines = item.split(os.linesep) key = line.split(KEY)[1].lower() From 0aec6573f84cf94156003a99fbc70a6561d77f23 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 21:44:54 +0200 Subject: [PATCH 077/105] path --- distribution.py | 2 +- subsystem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution.py b/distribution.py index 9f23682..64be502 100644 --- a/distribution.py +++ b/distribution.py @@ -7,7 +7,7 @@ DISTRIBUTION = 'distrib' class Distribution: def __init__(self, architecture): self.architecture = architecture - self.path = os.sep.join([DISTRIBUTION, self.architecture.name]) + self.path = os.path.join(DISTRIBUTION, self.architecture.name) self.load() def load(self): diff --git a/subsystem.py b/subsystem.py index 765c344..e22933f 100644 --- a/subsystem.py +++ b/subsystem.py @@ -19,7 +19,7 @@ class SubSystem: list.append(self.name) if self.name == MAIN: list.append(self.architecture.name) - self.path = os.sep.join(list) + self.path = os.path.join(*list) # catalog self.catalog = catalog.Catalog(self) From a7fcaa975c1f0f83c1ed922d5c99fee98e2d8ab2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 22:35:13 +0200 Subject: [PATCH 078/105] check --- __init__.py | 24 ++++++++++++++++++------ package.py | 7 ++++--- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/__init__.py b/__init__.py index 1390fa7..5a0f2a0 100755 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,7 @@ #! /usr/bin/env python3 +import hashlib +import os import sys import arguments @@ -19,12 +21,22 @@ def build(): def check(): - # TODO prepare threads - print('TODO prepare threads') - # TODO run threads - print('TODO run threads') - # TODO watch threads - print('TODO watch threads') + packages = [] + broken = [] + lo = local.Local() + for architecture in lo.architectures: + for subsystem in architecture.subsystems.values(): + for package in subsystem.catalog.packages.values(): + packages.append((subsystem, package)) + for index, items in enumerate(packages): + print(index, '/', len(packages)) + subsystem, package = items + path = os.path.join(subsystem.path, package.filename) + with open(path, 'br') as f: + hash = hashlib.sha256(f.read()).hexdigest() + if hash != package.sha256sum: + broken.append(package) + print(len(broken), '/', len(packages)) def info(): diff --git a/package.py b/package.py index 7b16b84..c768be3 100644 --- a/package.py +++ b/package.py @@ -20,8 +20,9 @@ class Package: def __str__(self): lines = [ - f'Name: {self.name}', - f'Size: {self.csize}', - f'Hash: {self.sha256sum}', + f' Name: {self.name}', + f'FileName: {self.filename}', + f' Size: {self.csize}', + f' Hash: {self.sha256sum}', ] return os.linesep.join(lines) From 4abb2c073bddaa6c802bc7d437dbfc83990a42c6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Oct 2021 12:46:25 +0200 Subject: [PATCH 079/105] =?UTF-8?q?init=E2=86=92main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __init__.py => __main__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename __init__.py => __main__.py (100%) diff --git a/__init__.py b/__main__.py similarity index 100% rename from __init__.py rename to __main__.py From c8a979d68b7ad13023b139fc3045ae89fba5de5b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Oct 2021 12:46:42 +0200 Subject: [PATCH 080/105] init --- __init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 From 369886bbea91c2f81a33614062e112bf6fe474b5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Oct 2021 12:58:23 +0200 Subject: [PATCH 081/105] license --- LICENSE.md | 660 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 660 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cba6f6a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,660 @@ +### GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains +free software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing +under this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS + +#### 0. Definitions. + +"This License" refers to version 3 of the GNU Affero General Public +License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +#### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +#### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +#### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +#### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +#### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +#### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +#### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +#### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +#### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +#### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +#### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +#### 13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your +version supports such interaction) an opportunity to receive the +Corresponding Source of your version by providing access to the +Corresponding Source from a network server at no charge, through some +standard or customary means of facilitating copying of software. This +Corresponding Source shall include the Corresponding Source for any +work covered by version 3 of the GNU General Public License that is +incorporated pursuant to the following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +#### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Affero General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever +published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +#### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +#### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +#### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for +the specific requirements. + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU AGPL, see . From c5440d1e2e57aeb21391c1bde796e51068417e47 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Oct 2021 13:00:03 +0200 Subject: [PATCH 082/105] readme --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From fcdab2ac888c003f9a37365a361142bd5ad3bf23 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 11 Oct 2021 15:35:04 +0200 Subject: [PATCH 083/105] title --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e69de29..929fcf1 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +# Minimal System Repository From 1326c8158b3f4ad21e52b823b70a8f15c6ca2215 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Oct 2021 21:36:53 +0200 Subject: [PATCH 084/105] sig --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 929fcf1..4195f22 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ # Minimal System Repository + +## Features + +## Work In Progress + +## To Do + +### Tests + +* pacman's need of .sig files for packages From 3f0fa5bbac0d78fbe022cf605fd6be3f488a5abf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Oct 2021 21:45:06 +0200 Subject: [PATCH 085/105] readme --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4195f22..50cce5a 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,16 @@ ## Features +* [X] check integrity of packages (single thread) + ## Work In Progress ## To Do +### Fixes + +* [ ] check integrity of packages on a single line + ### Tests -* pacman's need of .sig files for packages +* [ ] pacman's need of .sig files for packages From fb63dc8048eabeef1582423ff5eaadc8a1022b66 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Oct 2021 23:03:17 +0200 Subject: [PATCH 086/105] check --- README.md | 2 -- __main__.py | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 50cce5a..31398a0 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ ### Fixes -* [ ] check integrity of packages on a single line - ### Tests * [ ] pacman's need of .sig files for packages diff --git a/__main__.py b/__main__.py index 5a0f2a0..e390bc8 100755 --- a/__main__.py +++ b/__main__.py @@ -29,14 +29,16 @@ def check(): for package in subsystem.catalog.packages.values(): packages.append((subsystem, package)) for index, items in enumerate(packages): - print(index, '/', len(packages)) + print('\r', index, '/', len(packages), '←', 'checked', end='') subsystem, package = items path = os.path.join(subsystem.path, package.filename) with open(path, 'br') as f: hash = hashlib.sha256(f.read()).hexdigest() if hash != package.sha256sum: broken.append(package) - print(len(broken), '/', len(packages)) + print() + print('', str(len(broken)).rjust(len(str(len(packages)))), + '/', len(packages), '←', 'broken') def info(): From 1def9f5fc35697cda8964dc94e6aaecc1817bf61 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Oct 2021 23:34:13 +0200 Subject: [PATCH 087/105] todo --- README.md | 6 ++++++ __main__.py | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 31398a0..46b1ec3 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,14 @@ ## To Do +* [ ] build archive + * [ ] extract distribution + * [ ] apply configuration + * [ ] archive directory + ### Fixes ### Tests * [ ] pacman's need of .sig files for packages +* [ ] bootstrap mintty, msys runtime and pacman diff --git a/__main__.py b/__main__.py index e390bc8..ad43dec 100755 --- a/__main__.py +++ b/__main__.py @@ -10,14 +10,7 @@ import synchronization def build(): - # TODO identify - print('TODO identify') - # TODO extract - print('TODO extract') - # TODO apply - print('TODO apply') - # TODO archive - print('TODO archive') + pass def check(): From 8fc1c27ecb43283d1b310d500d3ce10e6bd727a8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 12 Oct 2021 23:57:01 +0200 Subject: [PATCH 088/105] readme --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 46b1ec3..8b1cdd6 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ # Minimal System Repository +A tool to handle local/remote msys/mingw repositories. + ## Features -* [X] check integrity of packages (single thread) - -## Work In Progress - -## To Do +* [ ] check integrity + * [ ] catalogs + * [ ] packages + * [X] single threading + * [ ] multi threading * [ ] build archive * [ ] extract distribution * [ ] apply configuration * [ ] archive directory -### Fixes - -### Tests +## Tests * [ ] pacman's need of .sig files for packages * [ ] bootstrap mintty, msys runtime and pacman From a60d3bce359b1d5bfdc4b796938fc6294e1ef957 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Oct 2021 00:02:48 +0200 Subject: [PATCH 089/105] checkboxes --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b1cdd6..743e017 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,25 @@ A tool to handle local/remote msys/mingw repositories. ## Features * [ ] check integrity + * [ ] catalogs + * [ ] packages - * [X] single threading + + * [x] single threading + * [ ] multi threading * [ ] build archive + * [ ] extract distribution + * [ ] apply configuration + * [ ] archive directory ## Tests * [ ] pacman's need of .sig files for packages + * [ ] bootstrap mintty, msys runtime and pacman From 43b1f7b395018b80fab082564d4db2d64fba002f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Oct 2021 00:07:25 +0200 Subject: [PATCH 090/105] features --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 743e017..96a5efd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ A tool to handle local/remote msys/mingw repositories. ## Features +* [ ] display information + +* [ ] synchronize data + + * [ ] generate signatures from catalogs + * [ ] check integrity * [ ] catalogs From c7be4577feabff6c23398faf38ada8dbf7bdd9f0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Oct 2021 00:09:56 +0200 Subject: [PATCH 091/105] 4 --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 96a5efd..78f916f 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,17 @@ A tool to handle local/remote msys/mingw repositories. * [ ] display information * [ ] synchronize data - * [ ] generate signatures from catalogs * [ ] check integrity - * [ ] catalogs - * [ ] packages - * [x] single threading - * [ ] multi threading * [ ] build archive - * [ ] extract distribution - * [ ] apply configuration - * [ ] archive directory ## Tests From 7ce8e3895c918c6b585a36d2fad1e93682a013fb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Oct 2021 10:24:06 +0200 Subject: [PATCH 092/105] features,tests --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 78f916f..41073ef 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,24 @@ A tool to handle local/remote msys/mingw repositories. * [ ] display information * [ ] synchronize data - * [ ] generate signatures from catalogs + * [ ] fetch remote catalogs + * [ ] download packages + * [ ] single threading + * [ ] multi threading + * [ ] generate signatures from catalogs * [ ] check integrity - * [ ] catalogs - * [ ] packages - * [x] single threading - * [ ] multi threading + * [ ] catalogs + * [ ] packages + * [x] single threading + * [ ] multi threading * [ ] build archive - * [ ] extract distribution - * [ ] apply configuration - * [ ] archive directory + * [ ] extract distribution + * [ ] apply configuration + * [ ] archive directory ## Tests -* [ ] pacman's need of .sig files for packages - +* [ ] pacman's need of both .db and .files as catalog * [ ] bootstrap mintty, msys runtime and pacman From 10457f66c97a7aa9a3406df99c019e9e8b7edc70 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 13 Oct 2021 21:02:32 +0200 Subject: [PATCH 093/105] packed --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 41073ef..94f23af 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,17 @@ A tool to handle local/remote msys/mingw repositories. ## Features * [ ] display information - * [ ] synchronize data * [ ] fetch remote catalogs * [ ] download packages * [ ] single threading * [ ] multi threading * [ ] generate signatures from catalogs - * [ ] check integrity * [ ] catalogs * [ ] packages * [x] single threading * [ ] multi threading - * [ ] build archive * [ ] extract distribution * [ ] apply configuration From 884a4e158336538a284a6fefaa8100afeb282db3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 14 Oct 2021 00:47:07 +0200 Subject: [PATCH 094/105] readme --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 94f23af..6939b25 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,17 @@ A tool to handle local/remote msys/mingw repositories. * [ ] packages * [x] single threading * [ ] multi threading + * [ ] progress bars * [ ] build archive - * [ ] extract distribution + * [ ] get base file system + * [ ] extract from distribution + * [ ] bootstrap mintty, msys, pacman * [ ] apply configuration * [ ] archive directory +* [ ] build dependency graph + * [ ] generate graphviz diagram + * [ ] render final image -## Tests +## Info -* [ ] pacman's need of both .db and .files as catalog -* [ ] bootstrap mintty, msys runtime and pacman +* pacman needs .db catalog, but .files seems optional From 4d1237b6fd36854f937a7503c0ff1fb6988e2a00 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 27 Oct 2021 22:12:40 +0200 Subject: [PATCH 095/105] iterate repository architectures --- __main__.py | 2 +- repository.py | 5 ++++- synchronization.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/__main__.py b/__main__.py index ad43dec..47579ad 100755 --- a/__main__.py +++ b/__main__.py @@ -17,7 +17,7 @@ def check(): packages = [] broken = [] lo = local.Local() - for architecture in lo.architectures: + for architecture in lo: for subsystem in architecture.subsystems.values(): for package in subsystem.catalog.packages.values(): packages.append((subsystem, package)) diff --git a/repository.py b/repository.py index 77de2b2..c320d98 100644 --- a/repository.py +++ b/repository.py @@ -10,9 +10,12 @@ class Repository: self.architectures = [architecture.Architecture(self, a) for a in arguments.architectures] + def __iter__(self): + return self.architectures.__iter__() + def __str__(self): lines = [ f' Location: {self.location}', - f'Architectures: {[a.name for a in self.architectures]}', + f'Architectures: {[architecture.name for architecture in self]}', ] return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index 9e28832..71e8690 100644 --- a/synchronization.py +++ b/synchronization.py @@ -15,7 +15,7 @@ class Synchronization: self.threads = arguments.threads def run(self): - for architecture in self.remote.architectures: + for architecture in self.remote: for subsystem in architecture.subsystems.values(): for _, package in sorted(subsystem.catalog.packages.items()): f = file.File( From a5c852f2e8be3a5823389e0819e81c0bd4fcdacf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 27 Oct 2021 22:22:08 +0200 Subject: [PATCH 096/105] iterate architecture subsystems --- __main__.py | 2 +- architecture.py | 8 ++++++-- synchronization.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__main__.py b/__main__.py index 47579ad..faea166 100755 --- a/__main__.py +++ b/__main__.py @@ -18,7 +18,7 @@ def check(): broken = [] lo = local.Local() for architecture in lo: - for subsystem in architecture.subsystems.values(): + for subsystem in architecture: for package in subsystem.catalog.packages.values(): packages.append((subsystem, package)) for index, items in enumerate(packages): diff --git a/architecture.py b/architecture.py index 25c74f0..78b9fb2 100644 --- a/architecture.py +++ b/architecture.py @@ -24,9 +24,13 @@ class Architecture: for f in arguments.subsystems] if s in subsystems} + def __iter__(self): + return self.subsystems.values().__iter__() + def __str__(self): lines = [ - f'Name: {self.name}', - f'Bits: {self.bits}', + f' Name: {self.name}', + f' Bits: {self.bits}', + f'Subsystems: {subsystem.name for subsystem in self}', ] return os.linesep.join(lines) diff --git a/synchronization.py b/synchronization.py index 71e8690..9339efc 100644 --- a/synchronization.py +++ b/synchronization.py @@ -16,7 +16,7 @@ class Synchronization: def run(self): for architecture in self.remote: - for subsystem in architecture.subsystems.values(): + for subsystem in architecture: for _, package in sorted(subsystem.catalog.packages.items()): f = file.File( os.path.join(self.remote.location, subsystem.path), From b259167114e30eeb6fdc1345f1fd7f68852f5817 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 19 Feb 2024 21:59:15 +0100 Subject: [PATCH 097/105] mv --- LICENSE.md => license.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => license.md (100%) diff --git a/LICENSE.md b/license.md similarity index 100% rename from LICENSE.md rename to license.md From ec993a8f25c984f353f68eea239f49709780c784 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 19 Feb 2024 21:59:40 +0100 Subject: [PATCH 098/105] fix license --- license.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/license.md b/license.md index cba6f6a..c6f01c6 100644 --- a/license.md +++ b/license.md @@ -1,4 +1,4 @@ -### GNU AFFERO GENERAL PUBLIC LICENSE +# GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 @@ -8,7 +8,7 @@ Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. -### Preamble +## Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure @@ -59,9 +59,9 @@ under this license. The precise terms and conditions for copying, distribution and modification follow. -### TERMS AND CONDITIONS +## TERMS AND CONDITIONS -#### 0. Definitions. +### 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. @@ -102,7 +102,7 @@ work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. -#### 1. Source Code. +### 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of @@ -143,7 +143,7 @@ regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. -#### 2. Basic Permissions. +### 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated @@ -168,7 +168,7 @@ Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. -#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article @@ -184,7 +184,7 @@ operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. -#### 4. Conveying Verbatim Copies. +### 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and @@ -197,7 +197,7 @@ recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. -#### 5. Conveying Modified Source Versions. +### 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the @@ -232,7 +232,7 @@ beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. -#### 6. Conveying Non-Source Forms. +### 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable @@ -328,7 +328,7 @@ documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. -#### 7. Additional Terms. +### 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. @@ -387,7 +387,7 @@ Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. -#### 8. Termination. +### 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or @@ -415,7 +415,7 @@ this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. -#### 9. Acceptance Not Required for Having Copies. +### 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work @@ -426,7 +426,7 @@ modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. -#### 10. Automatic Licensing of Downstream Recipients. +### 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and @@ -451,7 +451,7 @@ rights granted under this License, and you may not initiate litigation any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. -#### 11. Patents. +### 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The @@ -520,7 +520,7 @@ Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. -#### 12. No Surrender of Others' Freedom. +### 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not @@ -533,7 +533,7 @@ from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. -#### 13. Remote Network Interaction; Use with the GNU General Public License. +### 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users @@ -554,7 +554,7 @@ License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. -#### 14. Revised Versions of this License. +### 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new @@ -580,7 +580,7 @@ permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. -#### 15. Disclaimer of Warranty. +### 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT @@ -592,7 +592,7 @@ PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -#### 16. Limitation of Liability. +### 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR @@ -604,7 +604,7 @@ LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -#### 17. Interpretation of Sections 15 and 16. +### 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, @@ -615,7 +615,7 @@ copy of the Program in return for a fee. END OF TERMS AND CONDITIONS -### How to Apply These Terms to Your New Programs +## How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it From 3eccd76e8c50677a35789e8018163cbaac130613 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 19 Feb 2024 22:01:16 +0100 Subject: [PATCH 099/105] mv --- README.md => readme.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => readme.md (100%) diff --git a/README.md b/readme.md similarity index 100% rename from README.md rename to readme.md From 2eb71e641240a8ac6df38448947b222e7faf9e4a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 15 Mar 2024 10:32:19 +0100 Subject: [PATCH 100/105] package --- __init__.py => mrmp/__init__.py | 0 __main__.py => mrmp/__main__.py | 0 architecture.py => mrmp/architecture.py | 0 arguments.py => mrmp/arguments.py | 0 catalog.py => mrmp/catalog.py | 0 distribution.py => mrmp/distribution.py | 0 file.py => mrmp/file.py | 0 hypertext.py => mrmp/hypertext.py | 0 local.py => mrmp/local.py | 0 package.py => mrmp/package.py | 0 remote.py => mrmp/remote.py | 0 repository.py => mrmp/repository.py | 0 subsystem.py => mrmp/subsystem.py | 0 synchronization.py => mrmp/synchronization.py | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename __init__.py => mrmp/__init__.py (100%) rename __main__.py => mrmp/__main__.py (100%) rename architecture.py => mrmp/architecture.py (100%) rename arguments.py => mrmp/arguments.py (100%) rename catalog.py => mrmp/catalog.py (100%) rename distribution.py => mrmp/distribution.py (100%) rename file.py => mrmp/file.py (100%) rename hypertext.py => mrmp/hypertext.py (100%) rename local.py => mrmp/local.py (100%) rename package.py => mrmp/package.py (100%) rename remote.py => mrmp/remote.py (100%) rename repository.py => mrmp/repository.py (100%) rename subsystem.py => mrmp/subsystem.py (100%) rename synchronization.py => mrmp/synchronization.py (100%) diff --git a/__init__.py b/mrmp/__init__.py similarity index 100% rename from __init__.py rename to mrmp/__init__.py diff --git a/__main__.py b/mrmp/__main__.py similarity index 100% rename from __main__.py rename to mrmp/__main__.py diff --git a/architecture.py b/mrmp/architecture.py similarity index 100% rename from architecture.py rename to mrmp/architecture.py diff --git a/arguments.py b/mrmp/arguments.py similarity index 100% rename from arguments.py rename to mrmp/arguments.py diff --git a/catalog.py b/mrmp/catalog.py similarity index 100% rename from catalog.py rename to mrmp/catalog.py diff --git a/distribution.py b/mrmp/distribution.py similarity index 100% rename from distribution.py rename to mrmp/distribution.py diff --git a/file.py b/mrmp/file.py similarity index 100% rename from file.py rename to mrmp/file.py diff --git a/hypertext.py b/mrmp/hypertext.py similarity index 100% rename from hypertext.py rename to mrmp/hypertext.py diff --git a/local.py b/mrmp/local.py similarity index 100% rename from local.py rename to mrmp/local.py diff --git a/package.py b/mrmp/package.py similarity index 100% rename from package.py rename to mrmp/package.py diff --git a/remote.py b/mrmp/remote.py similarity index 100% rename from remote.py rename to mrmp/remote.py diff --git a/repository.py b/mrmp/repository.py similarity index 100% rename from repository.py rename to mrmp/repository.py diff --git a/subsystem.py b/mrmp/subsystem.py similarity index 100% rename from subsystem.py rename to mrmp/subsystem.py diff --git a/synchronization.py b/mrmp/synchronization.py similarity index 100% rename from synchronization.py rename to mrmp/synchronization.py From 3d77cd2abe47167a592e5a07507e7905da1ec7a5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 15 Mar 2024 10:35:33 +0100 Subject: [PATCH 101/105] pyproject --- pyproject.toml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..44893ad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ['hatchling'] +build-backend = 'hatchling.build' + +[project] +authors = [ + { name = 'Marc Beninca', email = 'git@marc.beninca.link' }, +] +maintainers = [ + { name = 'Marc Beninca', email = 'git@marc.beninca.link' }, +] +classifiers = [ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: GNU Affero General Public License v3', + 'Operating System :: OS Independent', +] +dependencies = [] +description = 'Msys Repository Mirror Profile' +dynamic = ['version'] +keywords = [] +license-files = { paths = ['license.md'] } +name = 'mrmp' +readme = 'readme.md' +requires-python = '>= 3.10' + +[project.scripts] +# command = 'package.module:function' + +[project.urls] + +[tool.hatch.version] +path = 'mrmp/__init__.py' From 3c6f62ad67c92a3e4c623dae712a6afa1faf4412 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 15 Mar 2024 10:41:59 +0100 Subject: [PATCH 102/105] version --- mrmp/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mrmp/__init__.py b/mrmp/__init__.py index e69de29..b8023d8 100644 --- a/mrmp/__init__.py +++ b/mrmp/__init__.py @@ -0,0 +1 @@ +__version__ = '0.0.1' From 17e44fca416aea25ba7b856c340b6ae93a3d4cdd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 18 Jun 2025 21:44:13 +0200 Subject: [PATCH 103/105] =?UTF-8?q?=E2=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- license.md | 660 ------------------------------------------------- pyproject.toml | 32 --- 2 files changed, 692 deletions(-) delete mode 100644 license.md delete mode 100644 pyproject.toml diff --git a/license.md b/license.md deleted file mode 100644 index c6f01c6..0000000 --- a/license.md +++ /dev/null @@ -1,660 +0,0 @@ -# GNU AFFERO GENERAL PUBLIC LICENSE - -Version 3, 19 November 2007 - -Copyright (C) 2007 Free Software Foundation, Inc. - - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -## Preamble - -The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - -The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains -free software for all its users. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - -Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - -A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - -The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - -An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing -under this license. - -The precise terms and conditions for copying, distribution and -modification follow. - -## TERMS AND CONDITIONS - -### 0. Definitions. - -"This License" refers to version 3 of the GNU Affero General Public -License. - -"Copyright" also means copyright-like laws that apply to other kinds -of works, such as semiconductor masks. - -"The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - -To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of -an exact copy. The resulting work is called a "modified version" of -the earlier work or a work "based on" the earlier work. - -A "covered work" means either the unmodified Program or a work based -on the Program. - -To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - -To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user -through a computer network, with no transfer of a copy, is not -conveying. - -An interactive user interface displays "Appropriate Legal Notices" to -the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -### 1. Source Code. - -The "source code" for a work means the preferred form of the work for -making modifications to it. "Object code" means any non-source form of -a work. - -A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - -The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - -The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can -regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same -work. - -### 2. Basic Permissions. - -All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, -without conditions so long as your license otherwise remains in force. -You may convey covered works to others for the sole purpose of having -them make modifications exclusively for you, or provide you with -facilities for running those works, provided that you comply with the -terms of this License in conveying all material for which you do not -control copyright. Those thus making or running the covered works for -you must do so exclusively on your behalf, under your direction and -control, on terms that prohibit them from making any copies of your -copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the -conditions stated below. Sublicensing is not allowed; section 10 makes -it unnecessary. - -### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - -When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such -circumvention is effected by exercising rights under this License with -respect to the covered work, and you disclaim any intention to limit -operation or modification of the work as a means of enforcing, against -the work's users, your or third parties' legal rights to forbid -circumvention of technological measures. - -### 4. Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - -### 5. Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these -conditions: - -- a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. -- b) The work must carry prominent notices stating that it is - released under this License and any conditions added under - section 7. This requirement modifies the requirement in section 4 - to "keep intact all notices". -- c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. -- d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - -A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - -### 6. Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms of -sections 4 and 5, provided that you also convey the machine-readable -Corresponding Source under the terms of this License, in one of these -ways: - -- a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. -- b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the Corresponding - Source from a network server at no charge. -- c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. -- d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. -- e) Convey the object code using peer-to-peer transmission, - provided you inform other peers where the object code and - Corresponding Source of the work are being offered to the general - public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - -A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, -family, or household purposes, or (2) anything designed or sold for -incorporation into a dwelling. In determining whether a product is a -consumer product, doubtful cases shall be resolved in favor of -coverage. For a particular product received by a particular user, -"normally used" refers to a typical or common use of that class of -product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected -to use, the product. A product is a consumer product regardless of -whether the product has substantial commercial, industrial or -non-consumer uses, unless such uses represent the only significant -mode of use of the product. - -"Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to -install and execute modified versions of a covered work in that User -Product from a modified version of its Corresponding Source. The -information must suffice to ensure that the continued functioning of -the modified object code is in no case prevented or interfered with -solely because modification has been made. - -If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - -The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or -updates for a work that has been modified or installed by the -recipient, or for the User Product in which it has been modified or -installed. Access to a network may be denied when the modification -itself materially and adversely affects the operation of the network -or violates the rules and protocols for communication across the -network. - -Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - -### 7. Additional Terms. - -"Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders -of that material) supplement the terms of this License with terms: - -- a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or -- b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or -- c) Prohibiting misrepresentation of the origin of that material, - or requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or -- d) Limiting the use for publicity purposes of names of licensors - or authors of the material; or -- e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or -- f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions - of it) with contractual assumptions of liability to the recipient, - for any liability that these contractual assumptions directly - impose on those licensors and authors. - -All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; the -above requirements apply either way. - -### 8. Termination. - -You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - -However, if you cease all violation of this License, then your license -from a particular copyright holder is reinstated (a) provisionally, -unless and until the copyright holder explicitly and finally -terminates your license, and (b) permanently, if the copyright holder -fails to notify you of the violation by some reasonable means prior to -60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - -### 9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run -a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - -### 10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - -An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - -### 11. Patents. - -A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned -or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - -In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - -If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - -A patent license is "discriminatory" if it does not include within the -scope of its coverage, prohibits the exercise of, or is conditioned on -the non-exercise of one or more of the rights that are specifically -granted under this License. You may not convey a covered work if you -are a party to an arrangement with a third party that is in the -business of distributing software, under which you make payment to the -third party based on the extent of your activity of conveying the -work, and under which the third party grants, to any of the parties -who would receive the covered work from you, a discriminatory patent -license (a) in connection with copies of the covered work conveyed by -you (or copies made from those copies), or (b) primarily for and in -connection with specific products or compilations that contain the -covered work, unless you entered into that arrangement, or that patent -license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - -### 12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under -this License and any other pertinent obligations, then as a -consequence you may not convey it at all. For example, if you agree to -terms that obligate you to collect a royalty for further conveying -from those to whom you convey the Program, the only way you could -satisfy both those terms and this License would be to refrain entirely -from conveying the Program. - -### 13. Remote Network Interaction; Use with the GNU General Public License. - -Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your -version supports such interaction) an opportunity to receive the -Corresponding Source of your version by providing access to the -Corresponding Source from a network server at no charge, through some -standard or customary means of facilitating copying of software. This -Corresponding Source shall include the Corresponding Source for any -work covered by version 3 of the GNU General Public License that is -incorporated pursuant to the following paragraph. - -Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - -### 14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions -of the GNU Affero General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever -published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions -of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - -Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - -### 15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT -WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - -### 16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR -CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT -NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM -TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -### 17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - -## How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - -To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively state -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper -mail. - -If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for -the specific requirements. - -You should also get your employer (if you work as a programmer) or -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. For more information on this, and how to apply and follow -the GNU AGPL, see . diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 44893ad..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,32 +0,0 @@ -[build-system] -requires = ['hatchling'] -build-backend = 'hatchling.build' - -[project] -authors = [ - { name = 'Marc Beninca', email = 'git@marc.beninca.link' }, -] -maintainers = [ - { name = 'Marc Beninca', email = 'git@marc.beninca.link' }, -] -classifiers = [ - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: GNU Affero General Public License v3', - 'Operating System :: OS Independent', -] -dependencies = [] -description = 'Msys Repository Mirror Profile' -dynamic = ['version'] -keywords = [] -license-files = { paths = ['license.md'] } -name = 'mrmp' -readme = 'readme.md' -requires-python = '>= 3.10' - -[project.scripts] -# command = 'package.module:function' - -[project.urls] - -[tool.hatch.version] -path = 'mrmp/__init__.py' From b84e6c22dd8e09ee263971f7a5243cdee6471329 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 18 Jun 2025 21:48:32 +0200 Subject: [PATCH 104/105] mv --- {mrmp => srlp/msys}/__init__.py | 0 {mrmp => srlp/msys}/__main__.py | 0 {mrmp => srlp/msys}/architecture.py | 0 {mrmp => srlp/msys}/arguments.py | 0 {mrmp => srlp/msys}/catalog.py | 0 {mrmp => srlp/msys}/distribution.py | 0 {mrmp => srlp/msys}/file.py | 0 {mrmp => srlp/msys}/hypertext.py | 0 {mrmp => srlp/msys}/local.py | 0 {mrmp => srlp/msys}/package.py | 0 readme.md => srlp/msys/readme.md | 0 {mrmp => srlp/msys}/remote.py | 0 {mrmp => srlp/msys}/repository.py | 0 {mrmp => srlp/msys}/subsystem.py | 0 {mrmp => srlp/msys}/synchronization.py | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename {mrmp => srlp/msys}/__init__.py (100%) rename {mrmp => srlp/msys}/__main__.py (100%) rename {mrmp => srlp/msys}/architecture.py (100%) rename {mrmp => srlp/msys}/arguments.py (100%) rename {mrmp => srlp/msys}/catalog.py (100%) rename {mrmp => srlp/msys}/distribution.py (100%) rename {mrmp => srlp/msys}/file.py (100%) rename {mrmp => srlp/msys}/hypertext.py (100%) rename {mrmp => srlp/msys}/local.py (100%) rename {mrmp => srlp/msys}/package.py (100%) rename readme.md => srlp/msys/readme.md (100%) rename {mrmp => srlp/msys}/remote.py (100%) rename {mrmp => srlp/msys}/repository.py (100%) rename {mrmp => srlp/msys}/subsystem.py (100%) rename {mrmp => srlp/msys}/synchronization.py (100%) diff --git a/mrmp/__init__.py b/srlp/msys/__init__.py similarity index 100% rename from mrmp/__init__.py rename to srlp/msys/__init__.py diff --git a/mrmp/__main__.py b/srlp/msys/__main__.py similarity index 100% rename from mrmp/__main__.py rename to srlp/msys/__main__.py diff --git a/mrmp/architecture.py b/srlp/msys/architecture.py similarity index 100% rename from mrmp/architecture.py rename to srlp/msys/architecture.py diff --git a/mrmp/arguments.py b/srlp/msys/arguments.py similarity index 100% rename from mrmp/arguments.py rename to srlp/msys/arguments.py diff --git a/mrmp/catalog.py b/srlp/msys/catalog.py similarity index 100% rename from mrmp/catalog.py rename to srlp/msys/catalog.py diff --git a/mrmp/distribution.py b/srlp/msys/distribution.py similarity index 100% rename from mrmp/distribution.py rename to srlp/msys/distribution.py diff --git a/mrmp/file.py b/srlp/msys/file.py similarity index 100% rename from mrmp/file.py rename to srlp/msys/file.py diff --git a/mrmp/hypertext.py b/srlp/msys/hypertext.py similarity index 100% rename from mrmp/hypertext.py rename to srlp/msys/hypertext.py diff --git a/mrmp/local.py b/srlp/msys/local.py similarity index 100% rename from mrmp/local.py rename to srlp/msys/local.py diff --git a/mrmp/package.py b/srlp/msys/package.py similarity index 100% rename from mrmp/package.py rename to srlp/msys/package.py diff --git a/readme.md b/srlp/msys/readme.md similarity index 100% rename from readme.md rename to srlp/msys/readme.md diff --git a/mrmp/remote.py b/srlp/msys/remote.py similarity index 100% rename from mrmp/remote.py rename to srlp/msys/remote.py diff --git a/mrmp/repository.py b/srlp/msys/repository.py similarity index 100% rename from mrmp/repository.py rename to srlp/msys/repository.py diff --git a/mrmp/subsystem.py b/srlp/msys/subsystem.py similarity index 100% rename from mrmp/subsystem.py rename to srlp/msys/subsystem.py diff --git a/mrmp/synchronization.py b/srlp/msys/synchronization.py similarity index 100% rename from mrmp/synchronization.py rename to srlp/msys/synchronization.py From 966d727030d5648010e03ceddc30ec12abeba8af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 18 Jun 2025 22:06:23 +0200 Subject: [PATCH 105/105] =?UTF-8?q?=E2=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 225fc6f..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/__pycache__