From nobody Mon Feb 9 09:09:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57878+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57878+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1587591351; cv=none; d=zohomail.com; s=zohoarc; b=M2QlINFRhlZySKQY7goAs2wAnsZkKQsSMVpHIiXEG+l3STHxcbq1rUuq2MSynowtrrtAXY8Cs5WBboKGaqYNoyZcJykJg2nH0BF6//z6/HiAg/XRZwMEa0LmXc2xsHWtFXDIIANtm601hSvZSWHCA4geysJPHxTdKM6TfyAz2kU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587591351; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=whNxPLkmlZqiSvF+Hfsj4DC1spXVmnXPTFvnNBL87UU=; b=FYcdelzAdaELslGtoIcg7MiygcXh9HneZd0cPXvoy1UH3TUtRYZ1zZEJAkCnNq8ci3xhRqTaISFR8z8In7qsugPzg/bGXPHlMLi2iw/NugkL2kJ1kK8VFXHlpnsEmigpcRQH8Onsr8h1fJPSDrdI9svhYjzMh5QwOv9mcKn4v+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57878+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587591351915738.2278948850105; Wed, 22 Apr 2020 14:35:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QUssYY1788612xWwpLHQmm6a; Wed, 22 Apr 2020 14:35:51 -0700 X-Received: from mga12.intel.com (mga12.intel.com []) by mx.groups.io with SMTP id smtpd.web10.3186.1587591349721322785 for ; Wed, 22 Apr 2020 14:35:51 -0700 IronPort-SDR: 4b3RTKVULYCzxWcC8xHceSUjuMeCW3VhhvIzoovvwKKuW5lS+U8uEIQ9PhHUx8DqtUDjozgt1O mkV73vgue+gw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 14:35:48 -0700 IronPort-SDR: IPhWuY6/Y7yYLyGyCh9mZpo84G8lRtvGYI+hyv3BdkNKW1GloHR2F8jlJI8p7t6B7We3lcCtvw BFqlRRGqRt0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,304,1583222400"; d="scan'208";a="259211554" X-Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga006.jf.intel.com with ESMTP; 22 Apr 2020 14:35:47 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH V2 1/3] EdkRepo: Initial commit of workspace_maitenance.py Date: Wed, 22 Apr 2020 14:35:21 -0700 Message-Id: <20200422213523.44888-2-ashley.e.desimone@intel.com> In-Reply-To: <20200422213523.44888-1-ashley.e.desimone@intel.com> References: <20200422213523.44888-1-ashley.e.desimone@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashley.e.desimone@intel.com X-Gm-Message-State: ZQ52AfrvfcdAJeI8aqAMGOGBx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587591351; bh=mF0wXxxRLjU7/QivDjujLcjaeHbST2dWbC4imvtyPb4=; h=Cc:Date:From:Reply-To:Subject:To; b=WLPdflnUW0CP2GqxShQUidcOzpzrIp52hUWGTvLbAZEHiLQ8DUGw9MB18kdzeEFBQRG 2wHjqmsg7SStnERvzBrJn5vkGXiKJh7pt7VM9ZUiW1Bpz9XznRAMpmWI5evmVxf+oo+g/ LDAQFIr7oD9FPDXwB4GbnnKeW8QidmjAOLk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add workspace_maitenance.py including the implementation of generate_name_for_obsolete_backup() Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- .../workspace_maitenance/workspace_maitenance.py | 30 ++++++++++++++++++= ++++ 1 file changed, 30 insertions(+) create mode 100644 edkrepo/common/workspace_maitenance/workspace_maitenanc= e.py diff --git a/edkrepo/common/workspace_maitenance/workspace_maitenance.py b/= edkrepo/common/workspace_maitenance/workspace_maitenance.py new file mode 100644 index 0000000..83204f8 --- /dev/null +++ b/edkrepo/common/workspace_maitenance/workspace_maitenance.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +## @file +# workspace_maitenance.py +# +# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +''' Contains shared workspace maitenance functions. ''' + +import os + +def generate_name_for_obsolete_backup(absolute_path): + if not os.path.exists(absolute_path): + raise ValueError("{} does not exist".format(absolute_path)) + original_name =3D os.path.basename(absolute_path) + dir_name =3D os.path.dirname(absolute_path) + unique_name =3D "" + unique_name_found =3D False + index =3D 1 + while not unique_name_found: + if index =3D=3D 1: + unique_name =3D "{}_old".format(original_name) + else: + unique_name =3D "{}_old{}".format(original_name, index) + if not os.path.exists(os.path.join(dir_name, unique_name)): + unique_name_found =3D True + index +=3D 1 + return unique_name \ No newline at end of file --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57878): https://edk2.groups.io/g/devel/message/57878 Mute This Topic: https://groups.io/mt/73207042/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-