Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error output on upload #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/include_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@
(options.folders, [os.listdir(f) for f in options.folders]))

valid_changes = [c for c in changefiles if c.content['Binary'] == options.package]
invalid_changes = [c.content['Binary'] for c in changefiles if c.content['Binary'] != options.package]

extraneous_packages = set(changefiles) - set(valid_changes)
if extraneous_packages:
parser.error("Invalid packages detected in folders %s. [%s]" %
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between extraneous and invalid packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraneous is a set of ChangesFile objects that indicate which changes files are problematic. invalid_changes is new; it's a list of the binary package names from within those changes files that were declared be be invalid.

The result here is that the error output is now something like [ ['python-foo-bar'] ] instead of [ ChangesFile(...) ]

(options.folders, extraneous_packages))
(options.folders, invalid_changes))

lockfile = os.path.join(options.repo_path, 'lock')

Expand Down
6 changes: 6 additions & 0 deletions src/reprepro_updater/changes_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ def __init__(self, filename):
raise Exception("Failed to load changes file %s. [[%s]]" %
(filename, ex))

def __repr__(self):
return "ChangesFile(%s)"%(self.filename)

def __str__(self):
return "ChangesFile(%s): %s"%(self.filename, self.content)


def find_changes_files(folder):
changesfiles = []
Expand Down