* [edk2-staging/EdkRepo] [PATCH v1 0/2] Small fixes to submodule support
@ 2020-06-09 23:04 Bjorge, Erik C
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules Bjorge, Erik C
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files Bjorge, Erik C
0 siblings, 2 replies; 5+ messages in thread
From: Bjorge, Erik C @ 2020-06-09 23:04 UTC (permalink / raw)
To: devel
Cc: Ashley E Desimone, Nate DeSimone, Puja Pandya, Bret Barkelew,
Prince Agyeman
Fixed issues when submodule has untracked files and can't be deinitialized.
Fixed backwards compatibility issue with old pin files.
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Erik Bjorge (2):
EdkRepo: Add force flag when removing submodules
EdkRepo: Adding backwards compatibility for old pin files
edkrepo_manifest_parser/edk_manifest.py | 6 +++++-
project_utils/submodule.py | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
--
2.27.0.windows.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules
2020-06-09 23:04 [edk2-staging/EdkRepo] [PATCH v1 0/2] Small fixes to submodule support Bjorge, Erik C
@ 2020-06-09 23:04 ` Bjorge, Erik C
2020-06-10 1:06 ` Ashley E Desimone
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files Bjorge, Erik C
1 sibling, 1 reply; 5+ messages in thread
From: Bjorge, Erik C @ 2020-06-09 23:04 UTC (permalink / raw)
To: devel
Cc: Ashley E Desimone, Nate DeSimone, Puja Pandya, Bret Barkelew,
Prince Agyeman
Submodules may generate un-tracked or modify files in the repo. when
removing the submodule do so even with modifications.
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
---
project_utils/submodule.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/project_utils/submodule.py b/project_utils/submodule.py
index 170629b..3d1b620 100644
--- a/project_utils/submodule.py
+++ b/project_utils/submodule.py
@@ -48,14 +48,14 @@ def _deinit(repo, submodules=None, verbose=False):
verbose - Enable verbose messages
"""
if submodules is None:
- output_data = repo.git.execute(['git', 'submodule', 'deinit', '--all'],
+ output_data = repo.git.execute(['git', 'submodule', 'deinit', '-f', '--all'],
with_extended_output=True, with_stdout=True)
display_git_output(output_data, verbose)
else:
for sub in submodules:
if verbose:
print(strings.SUBMOD_DEINIT_PATH.format(sub.path))
- output_data = repo.git.execute(['git', 'submodule', 'deinit', '--', sub.path],
+ output_data = repo.git.execute(['git', 'submodule', 'deinit', '-f', '--', sub.path],
with_extended_output=True, with_stdout=True)
display_git_output(output_data, verbose)
return
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files
2020-06-09 23:04 [edk2-staging/EdkRepo] [PATCH v1 0/2] Small fixes to submodule support Bjorge, Erik C
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules Bjorge, Erik C
@ 2020-06-09 23:04 ` Bjorge, Erik C
2020-06-10 23:06 ` Ashley E Desimone
1 sibling, 1 reply; 5+ messages in thread
From: Bjorge, Erik C @ 2020-06-09 23:04 UTC (permalink / raw)
To: devel
Cc: Ashley E Desimone, Nate DeSimone, Puja Pandya, Bret Barkelew,
Prince Agyeman
Older pin files used the invalid enable_submodule attribute. This has
been fixed for new pin files but we need to be able to support older pin
files as well.
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
---
edkrepo_manifest_parser/edk_manifest.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index adf6d52..00ad392 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -795,7 +795,11 @@ class _RepoSource():
# If enableSubmodule is not set to True then default to False
self.enableSub = (element.attrib['enableSubmodule'].lower() == 'true')
except Exception:
- self.enableSub = False
+ try:
+ # Adding backwards compatibility with pin files that used incorrect attribute
+ self.enableSub = (element.attrib['enable_submodule'].lower() == 'true')
+ except Exception:
+ self.enableSub = False
if self.branch is None and self.commit is None and self.tag is None:
raise KeyError(ATTRIBUTE_MISSING_ERROR)
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules Bjorge, Erik C
@ 2020-06-10 1:06 ` Ashley E Desimone
0 siblings, 0 replies; 5+ messages in thread
From: Ashley E Desimone @ 2020-06-10 1:06 UTC (permalink / raw)
To: Bjorge, Erik C, devel@edk2.groups.io
Cc: Desimone, Nathaniel L, Pandya, Puja, Bret Barkelew,
Agyeman, Prince
Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>
-----Original Message-----
From: Bjorge, Erik C <erik.c.bjorge@intel.com>
Sent: Tuesday, June 9, 2020 4:04 PM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules
Submodules may generate un-tracked or modify files in the repo. when removing the submodule do so even with modifications.
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
---
project_utils/submodule.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/project_utils/submodule.py b/project_utils/submodule.py index 170629b..3d1b620 100644
--- a/project_utils/submodule.py
+++ b/project_utils/submodule.py
@@ -48,14 +48,14 @@ def _deinit(repo, submodules=None, verbose=False):
verbose - Enable verbose messages
"""
if submodules is None:
- output_data = repo.git.execute(['git', 'submodule', 'deinit', '--all'],
+ output_data = repo.git.execute(['git', 'submodule', 'deinit',
+ '-f', '--all'],
with_extended_output=True, with_stdout=True)
display_git_output(output_data, verbose)
else:
for sub in submodules:
if verbose:
print(strings.SUBMOD_DEINIT_PATH.format(sub.path))
- output_data = repo.git.execute(['git', 'submodule', 'deinit', '--', sub.path],
+ output_data = repo.git.execute(['git', 'submodule',
+ 'deinit', '-f', '--', sub.path],
with_extended_output=True, with_stdout=True)
display_git_output(output_data, verbose)
return
--
2.27.0.windows.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files Bjorge, Erik C
@ 2020-06-10 23:06 ` Ashley E Desimone
0 siblings, 0 replies; 5+ messages in thread
From: Ashley E Desimone @ 2020-06-10 23:06 UTC (permalink / raw)
To: Bjorge, Erik C, devel@edk2.groups.io
Cc: Desimone, Nathaniel L, Pandya, Puja, Bret Barkelew,
Agyeman, Prince
Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>
-----Original Message-----
From: Bjorge, Erik C <erik.c.bjorge@intel.com>
Sent: Tuesday, June 9, 2020 4:04 PM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Agyeman, Prince <prince.agyeman@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files
Older pin files used the invalid enable_submodule attribute. This has been fixed for new pin files but we need to be able to support older pin files as well.
Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Erik Bjorge <erik.c.bjorge@intel.com>
---
edkrepo_manifest_parser/edk_manifest.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/edkrepo_manifest_parser/edk_manifest.py b/edkrepo_manifest_parser/edk_manifest.py
index adf6d52..00ad392 100644
--- a/edkrepo_manifest_parser/edk_manifest.py
+++ b/edkrepo_manifest_parser/edk_manifest.py
@@ -795,7 +795,11 @@ class _RepoSource():
# If enableSubmodule is not set to True then default to False
self.enableSub = (element.attrib['enableSubmodule'].lower() == 'true')
except Exception:
- self.enableSub = False
+ try:
+ # Adding backwards compatibility with pin files that used incorrect attribute
+ self.enableSub = (element.attrib['enable_submodule'].lower() == 'true')
+ except Exception:
+ self.enableSub = False
if self.branch is None and self.commit is None and self.tag is None:
raise KeyError(ATTRIBUTE_MISSING_ERROR)
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-10 23:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-09 23:04 [edk2-staging/EdkRepo] [PATCH v1 0/2] Small fixes to submodule support Bjorge, Erik C
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 1/2] EdkRepo: Add force flag when removing submodules Bjorge, Erik C
2020-06-10 1:06 ` Ashley E Desimone
2020-06-09 23:04 ` [edk2-staging/EdkRepo] [PATCH v1 2/2] EdkRepo: Adding backwards compatibility for old pin files Bjorge, Erik C
2020-06-10 23:06 ` Ashley E Desimone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox