From patchwork Wed Nov 9 18:37:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1701871 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=LGYClmzz; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=vwHKmtAd; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N6txY4XGhz1yqS for ; Thu, 10 Nov 2022 05:37:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 893453858431 for ; Wed, 9 Nov 2022 18:37:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id CC0CE3858D28 for ; Wed, 9 Nov 2022 18:37:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC0CE3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1A3891FE1F for ; Wed, 9 Nov 2022 18:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668019030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DUisketwuAXJcdPgOLAA/gt2zz2f1dGiFUzUb2oM90=; b=LGYClmzzLkdT3AjsPPDOBBkgJxlmBEPxH7fTjNCD4zF3Gv48/+rmpbUQQta/LBFeoc511K KcsWqie2eiCXHv9f2As8TU02jkPbhNcbrMVSkLUB4uX+V7zVcsYklw4ISF/OSCWqDntxW8 dtTs6a5gco5xPjcDoUF2d5w0BnrBp8M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668019030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DUisketwuAXJcdPgOLAA/gt2zz2f1dGiFUzUb2oM90=; b=vwHKmtAdmYQdYdsqJUO0j4cKsTpsK3GWqjvvX33XOa1vAngt8b4vRk/15ytiMRlCXyZoAs ZcX+dAyRJocgThCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 09CCB1331F for ; Wed, 9 Nov 2022 18:37:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5HtlAVbza2NPNgAAMHmgww (envelope-from ) for ; Wed, 09 Nov 2022 18:37:10 +0000 Message-ID: <963db32b-c341-1553-af6c-2a5cf9e32861@suse.cz> Date: Wed, 9 Nov 2022 19:37:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH (pushed)] docs: create sources tarball To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" maintainer-scripts/ChangeLog: * update_web_docs_git.py: Create sources tarball. --- maintainer-scripts/update_web_docs_git.py | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/maintainer-scripts/update_web_docs_git.py b/maintainer-scripts/update_web_docs_git.py index 18c8bbb8324..d9cf9b70968 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()