aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-11-09 19:36:39 +0100
committerMartin Liska <mliska@suse.cz>2022-11-09 19:37:15 +0100
commit52eedc1fa3d211f29196eed60e11e6a8738329c2 (patch)
treec2ef73d8b23845783c326edf2ec15a3fae4297d9
parent4eadbe80060ab6c45193a1a57fac84b035e1c328 (diff)
downloadgcc-52eedc1fa3d211f29196eed60e11e6a8738329c2.zip
gcc-52eedc1fa3d211f29196eed60e11e6a8738329c2.tar.gz
gcc-52eedc1fa3d211f29196eed60e11e6a8738329c2.tar.bz2
docs: create sources tarball
maintainer-scripts/ChangeLog: * update_web_docs_git.py: Create sources tarball.
-rwxr-xr-xmaintainer-scripts/update_web_docs_git.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/maintainer-scripts/update_web_docs_git.py b/maintainer-scripts/update_web_docs_git.py
index 18c8bbb..d9cf9b7 100755
--- a/maintainer-scripts/update_web_docs_git.py
+++ b/maintainer-scripts/update_web_docs_git.py
@@ -37,6 +37,32 @@ def find_configs():
yield (Path(root).resolve(), docname)
+def create_source_tarball(output, configs):
+ pwd = Path('.').resolve()
+ subfolders = {'doc'}
+ explicit_files = {'gcc/BASE-VER', 'gcc/DEV-PHASE', 'gcc/DATESTAMP'}
+
+ for location, _ in configs:
+ location = location.relative_to(pwd)
+ while not location.name == 'doc':
+ location = location.parent
+ subfolders.add(location)
+
+ sources = Path('sources')
+ sources.mkdir()
+
+ # Copy all subfolders and files
+ for subfolder in subfolders:
+ shutil.copytree(subfolder, sources / subfolder)
+
+ for filename in explicit_files:
+ shutil.copy(filename, sources / filename)
+
+ shutil.make_archive(Path(output, 'docs-sources'), 'gztar',
+ sources)
+ print('sources tarball has been created')
+
+
with tempfile.TemporaryDirectory() as folder:
print(f'Using {folder} as temporary directory')
os.chdir(folder)
@@ -49,6 +75,9 @@ with tempfile.TemporaryDirectory() as folder:
if not output.exists():
output.mkdir()
+ # Create source tarball
+ create_source_tarball(output, configs)
+
temp = Path('tmp').resolve()
temp.mkdir()