Skip to content

Commit

Permalink
Process also disabled repositories.
Browse files Browse the repository at this point in the history
Signed-off-by: Eugenio Paolantonio (g7) <[email protected]>
  • Loading branch information
g7 committed Apr 20, 2015
1 parent 9efca45 commit 39b3452
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
Binary file removed libchannels/__pycache__/__init__.cpython-34.pyc
Binary file not shown.
Binary file removed libchannels/__pycache__/channel.cpython-34.pyc
Binary file not shown.
Binary file removed libchannels/__pycache__/common.cpython-34.pyc
Binary file not shown.
Binary file removed libchannels/__pycache__/config.cpython-34.pyc
Binary file not shown.
Binary file removed libchannels/__pycache__/discovery.cpython-34.pyc
Binary file not shown.
Binary file removed libchannels/__pycache__/repository.cpython-34.pyc
Binary file not shown.
15 changes: 13 additions & 2 deletions libchannels/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def __str__(self):

def check(self, origin, label, codename, source_entry):
"""
Returns True if the given InRelease file stream
Sets the given SourceEntry into self.repositories if it matches
the other information given.
"""

for repository in self.repositories:
Expand All @@ -102,11 +103,21 @@ def check(self, origin, label, codename, source_entry):
# Good!
self.repositories[repository] = source_entry

def is_sourceentry_enabled(self, repository):
"""
Returns True if the sourceentry is enabled, False if not.
"""

return (
type(repository) == SourceEntry and
not repository.disabled
)

@property
def enabled(self):
"""
Returns True if the channel is enabled, False if not.
"""

#return (not (None in self.repositories.values()))
return (not (False in [(type(x) == SourceEntry) for x in self.repositories.values()]))
return (not (False in [self.is_sourceentry_enabled(x) for x in self.repositories.values()]))
2 changes: 1 addition & 1 deletion libchannels/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def discover(self):

# Loop through enabled repositories to get a list of enabled channels
for repository in libchannels.common.sourceslist:
if repository.disabled or repository.uri == "" or repository.type == "deb-src":
if repository.uri == "" or repository.type == "deb-src":
continue

# Generate InRelease filename from repository URI
Expand Down

0 comments on commit 39b3452

Please sign in to comment.