diff options
-rw-r--r-- | scripts/lib/bsp/kernel.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 883beac00c..5935e667bc 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py | |||
@@ -427,16 +427,20 @@ def yocto_kernel_patch_add(scripts_path, machine, patches): | |||
427 | def inc_pr(line): | 427 | def inc_pr(line): |
428 | """ | 428 | """ |
429 | Add 1 to the PR value in the given bbappend PR line. For the PR | 429 | Add 1 to the PR value in the given bbappend PR line. For the PR |
430 | lines in kernel .bbappends after modifications. | 430 | lines in kernel .bbappends after modifications. Handles PRs of |
431 | the form PR := "${PR}.1" as well as PR = "r0". | ||
431 | """ | 432 | """ |
432 | idx = line.find("\"") | 433 | idx = line.find("\"") |
433 | 434 | ||
434 | pr_str = line[idx:] | 435 | pr_str = line[idx:] |
435 | pr_str = pr_str.replace('\"','') | 436 | pr_str = pr_str.replace('\"','') |
436 | fields = pr_str.split('.') | 437 | fields = pr_str.split('.') |
437 | fields[1] = str(int(fields[1]) + 1) | 438 | if len(fields) > 1: |
438 | pr_str = "\"" + '.'.join(fields) + "\"\n" | 439 | fields[1] = str(int(fields[1]) + 1) |
439 | 440 | pr_str = "\"" + '.'.join(fields) + "\"\n" | |
441 | else: | ||
442 | pr_val = pr_str[1:] | ||
443 | pr_str = "\"" + "r" + str(int(pr_val) + 1) + "\"\n" | ||
440 | idx2 = line.find("\"", idx + 1) | 444 | idx2 = line.find("\"", idx + 1) |
441 | line = line[:idx] + pr_str | 445 | line = line[:idx] + pr_str |
442 | 446 | ||