mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-09 22:36:14 +01:00
Merge pull request #1629 from dmach/fix-resolved-subdir
Fix 'resolved' command to skip subdirectories in package checkouts
This commit is contained in:
commit
50a203fedb
@ -5990,7 +5990,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
self.argparse_error("Incorrect number of arguments.")
|
||||
|
||||
args = parseargs(args)
|
||||
pacs = Package.from_paths(args)
|
||||
pacs = Package.from_paths(args, skip_dirs=True)
|
||||
|
||||
for p in pacs:
|
||||
for filename in p.todo:
|
||||
|
@ -89,12 +89,15 @@ class Package:
|
||||
return (self.name, self.prjname, self.apiurl) < (other.name, other.prjname, other.apiurl)
|
||||
|
||||
@classmethod
|
||||
def from_paths(cls, paths, progress_obj=None):
|
||||
def from_paths(cls, paths, progress_obj=None, *, skip_dirs=False):
|
||||
"""
|
||||
Return a list of Package objects from working copies in given paths.
|
||||
"""
|
||||
packages = []
|
||||
for path in paths:
|
||||
if skip_dirs and os.path.isdir(path):
|
||||
continue
|
||||
|
||||
package = cls(path, progress_obj)
|
||||
seen_package = None
|
||||
try:
|
||||
@ -116,7 +119,7 @@ class Package:
|
||||
return packages
|
||||
|
||||
@classmethod
|
||||
def from_paths_nofail(cls, paths, progress_obj=None):
|
||||
def from_paths_nofail(cls, paths, progress_obj=None, *, skip_dirs=False):
|
||||
"""
|
||||
Return a list of Package objects from working copies in given paths
|
||||
and a list of strings with paths that do not contain Package working copies.
|
||||
@ -124,6 +127,9 @@ class Package:
|
||||
packages = []
|
||||
failed_to_load = []
|
||||
for path in paths:
|
||||
if skip_dirs and os.path.isdir(path):
|
||||
continue
|
||||
|
||||
try:
|
||||
package = cls(path, progress_obj)
|
||||
except oscerr.NoWorkingCopy:
|
||||
|
Loading…
Reference in New Issue
Block a user