Skip to content

Commit

Permalink
tasks: use distro instead of platform to get running linux distri…
Browse files Browse the repository at this point in the history
…bution.
  • Loading branch information
remeh committed Jan 8, 2020
1 parent 47a07c8 commit 7af37bf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ docker==3.0.1
requests==2.20.1
PyYAML==5.1
toml==0.9.4
distro==1.4.0
4 changes: 2 additions & 2 deletions tasks/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import shutil
import sys
import platform
import distro
from distutils.dir_util import copy_tree

import invoke
Expand Down Expand Up @@ -103,7 +103,7 @@ def build(ctx, rebuild=False, race=False, build_include=None, build_exclude=None
build_exclude.append(ex)

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
if distname not in REDHAT_AND_DEBIAN_DIST:
for ex in REDHAT_AND_DEBIAN_ONLY_TAGS:
if ex not in build_exclude:
Expand Down
4 changes: 2 additions & 2 deletions tasks/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import shutil
import sys
import platform
import distro
from distutils.dir_util import copy_tree

import invoke
Expand Down Expand Up @@ -62,7 +62,7 @@ def build(ctx, rebuild=False, race=False, build_include=None, build_exclude=None
build_exclude.append(ex)

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
if distname not in REDHAT_AND_DEBIAN_DIST:
for ex in REDHAT_AND_DEBIAN_ONLY_TAGS:
if ex not in build_exclude:
Expand Down
4 changes: 2 additions & 2 deletions tasks/build_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Utilities to manage build tags
"""
import sys
import platform
import distro
from invoke import task

# ALL_TAGS lists any available build tag
Expand Down Expand Up @@ -69,7 +69,7 @@ def get_default_build_tags(puppy=False):
exclude = [] if sys.platform.startswith('linux') else LINUX_ONLY_TAGS

# remove all tags that are only available on debian distributions
distname = platform.linux_distribution()[0].lower()
distname = distro.id().lower()
if distname not in REDHAT_AND_DEBIAN_DIST:
exclude = exclude + REDHAT_AND_DEBIAN_ONLY_TAGS

Expand Down

0 comments on commit 7af37bf

Please sign in to comment.