diff options
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 20c94616b2..0cdb9c6cfb 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -726,15 +726,13 @@ def _check_preserve(config, recipename): | |||
726 | 726 | ||
727 | def get_staging_kver(srcdir): | 727 | def get_staging_kver(srcdir): |
728 | # Kernel version from work-shared | 728 | # Kernel version from work-shared |
729 | kerver = [] | 729 | import itertools |
730 | staging_kerVer="" | 730 | try: |
731 | if os.path.exists(srcdir) and os.listdir(srcdir): | ||
732 | with open(os.path.join(srcdir, "Makefile")) as f: | 731 | with open(os.path.join(srcdir, "Makefile")) as f: |
733 | version = [next(f) for x in range(5)][1:4] | 732 | # Take VERSION, PATCHLEVEL, SUBLEVEL from lines 1, 2, 3 |
734 | for word in version: | 733 | return ".".join(line.rstrip().split('= ')[1] for line in itertools.islice(f, 1, 4)) |
735 | kerver.append(word.split('= ')[1].split('\n')[0]) | 734 | except FileNotFoundError: |
736 | staging_kerVer = ".".join(kerver) | 735 | return "" |
737 | return staging_kerVer | ||
738 | 736 | ||
739 | def get_staging_kbranch(srcdir): | 737 | def get_staging_kbranch(srcdir): |
740 | import bb.process | 738 | import bb.process |