From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web10.597.1578029025167673402 for ; Thu, 02 Jan 2020 21:23:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dqkP7NE3; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578029024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AXkdPcFC3/1R240vikgWotqDiiczxyRUNQRMJ88F7YY=; b=dqkP7NE3xCr+TRaptCLWkOqlyRvoUJadv8o8egYploSRgZ2rKxInbkOkrt+bJfhAxseGJ/ hk/8Ia67SJnWvRss/WjAkfD1LLo1YgxeaDzMiVnDK79q9Ko+BaMij6q5eSEV62h2qKvnhH W+QV6lRJ/48xyADR9kNrluTQdaxvBv0= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-5YOmpjY4PmOa33137RQydw-1; Fri, 03 Jan 2020 00:23:40 -0500 Received: by mail-wr1-f71.google.com with SMTP id r2so20395461wrp.7 for ; Thu, 02 Jan 2020 21:23:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AXkdPcFC3/1R240vikgWotqDiiczxyRUNQRMJ88F7YY=; b=lcAGO8+16ej9NORQ4dvO1pNAmIsJ4cyY3PPJkgQ0ympQ2KLAqR+U0bc9wUDz+ZbrsU SEDzwp9nuz+RD1T7KRvaRxx9TeulL9OT5PwYFi7x3IZ9vAAnfSRA/VrGrXQgjD8doz6H rwoxXT+iAkthuggqp0xA6mfuvI8gibN1tI7jkmXupipbr+j2ni9U84VRhMF0YyPHUbgl TpBB3MpqYh+jLralnWKttpXOBNyX0f3fwn69Yv0YYJV4wm6GLV12LUUeZ1T5mzULRz9h BRGFgp39RgGW0hnq06gJrJEC12+RLJkdUA5pQFRCYWstCLNzShufhzHs3reqcBVZO6/s 5XJA== X-Gm-Message-State: APjAAAV4FrSh/xz38rTVFe3T1bgm7f8PtlsDysHNpWofIrI9ayfWpDMu 9tbgU98HjbR8adjjNZYNk3gi5+Ck0nu6MxDqJ0IwBszGGbftZZ6ukVrUmcl7xS61NZHSsidCzXe xsFLytYXsZIEmCA== X-Received: by 2002:adf:db84:: with SMTP id u4mr87446324wri.317.1578029019480; Thu, 02 Jan 2020 21:23:39 -0800 (PST) X-Google-Smtp-Source: APXvYqy1JYHuFj6zKL6nVfhVn5GUQG4TDu/u6ER5juT0yJyKLUdzj2vLp7va1nWqcrALz79t16NZOw== X-Received: by 2002:adf:db84:: with SMTP id u4mr87446303wri.317.1578029019292; Thu, 02 Jan 2020 21:23:39 -0800 (PST) Return-Path: Received: from [192.168.1.35] (34.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.34]) by smtp.gmail.com with ESMTPSA id d10sm60221684wrw.64.2020.01.02.21.23.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jan 2020 21:23:38 -0800 (PST) Subject: Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH] EdkRepo: build_linux_installer.py path fixes To: devel@edk2.groups.io, ashley.e.desimone@intel.com, "Desimone, Nathaniel L" Cc: "Pandya, Puja" , "Bjorge, Erik C" , Bret Barkelew References: <20191227020452.9085-1-nathaniel.l.desimone@intel.com> <4CF3A9EB60ABDA47BE7821A4DA3A0A3353CCB72A@ORSMSX116.amr.corp.intel.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <53dd0ca7-1c36-9003-87bc-a9f99154235e@redhat.com> Date: Fri, 3 Jan 2020 06:23:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <4CF3A9EB60ABDA47BE7821A4DA3A0A3353CCB72A@ORSMSX116.amr.corp.intel.com> X-MC-Unique: 5YOmpjY4PmOa33137RQydw-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi Nate, > From: Nate DeSimone > > Make path handling in build_linux_installer.py more platform agnostic > > Cc: Ashley DeSimone > Cc: Puja Pandya > Cc: Erik Bjorge > Cc: Bret Barkelew > Signed-off-by: Nate DeSimone > --- > build-scripts/build_linux_installer.py | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/build-scripts/build_linux_installer.py b/build-scripts/build_linux_installer.py > index 84ccf79..df316b9 100755 > --- a/build-scripts/build_linux_installer.py > +++ b/build-scripts/build_linux_installer.py > @@ -21,7 +21,7 @@ def main(): > os.environ['BUILD_NUMBER'] = args.build > > # Step 1: Create required directory structure > - dist_root = os.path.abspath('../dist/self_extract') > + dist_root = os.path.abspath('..{0}dist{0}self_extract'.format(os.sep)) The rest of this file already use os.path.join(), can we use it instead of format(os.sep)? dist_root = os.path.abspath(os.path.join('..', 'dist', 'self_extract')) > if not os.path.isdir(os.path.join(dist_root, 'wheels')): > os.makedirs(os.path.join(dist_root, 'wheels')) > if not os.path.isdir(os.path.join(dist_root, 'config')): > @@ -35,7 +35,7 @@ def main(): > return 1 > > # Step 3: Copy required files > - inst_root = os.path.abspath('../edkrepo_installer') > + inst_root = os.path.abspath('..{0}edkrepo_installer'.format(os.sep)) inst_root = os.path.abspath(os.path.join('..', 'edkrepo_installer')) > ven_root = os.path.join(inst_root, 'Vendor') > linux_root = os.path.join(inst_root, 'linux-scripts') > try: > @@ -55,7 +55,7 @@ def main(): > > # Step 4: Package installer files > try: > - subprocess.run('./final_copy.py', check=True) > + subprocess.run('.{0}final_copy.py'.format(os.sep), check=True) Maybe we can directly simplify as: subprocess.run('final_copy.py', check=True) > except: > print('Failed to generate installer package') > return 1 > @@ -65,7 +65,7 @@ def main(): > shutil.rmtree(dist_root, ignore_errors=True) > except: > print('Failed to remove temporary files') > - os.unlink('./final_copy.py') > + os.unlink('.{0}final_copy.py'.format(os.sep)) Similarly: os.unlink('final_copy.py') > > return 0 > > -- > 2.20.1