This is a workaround since python3-apt does not support the signed-by argument. This function was removed from the class to ensure users using the python3-apt module or not can use the signed-by option.
(line)
| 733 | |
| 734 | |
| 735 | def _invalid(line): |
| 736 | """ |
| 737 | This is a workaround since python3-apt does not support |
| 738 | the signed-by argument. This function was removed from |
| 739 | the class to ensure users using the python3-apt module or |
| 740 | not can use the signed-by option. |
| 741 | """ |
| 742 | disabled = False |
| 743 | invalid = False |
| 744 | comment = "" |
| 745 | line = line.strip() |
| 746 | if not line: |
| 747 | invalid = True |
| 748 | return disabled, invalid, comment, "" |
| 749 | |
| 750 | if line.startswith("#"): |
| 751 | disabled = True |
| 752 | line = line[1:] |
| 753 | |
| 754 | idx = line.find("#") |
| 755 | if idx > 0: |
| 756 | comment = line[idx + 1 :] |
| 757 | line = line[:idx] |
| 758 | |
| 759 | cdrom_match = re.match(r"(.*)(cdrom:.*/)(.*)", line.strip()) |
| 760 | if cdrom_match: |
| 761 | repo_line = ( |
| 762 | [p.strip() for p in cdrom_match.group(1).split()] |
| 763 | + [cdrom_match.group(2).strip()] |
| 764 | + [p.strip() for p in cdrom_match.group(3).split()] |
| 765 | ) |
| 766 | else: |
| 767 | repo_line = line.strip().split() |
| 768 | if ( |
| 769 | not repo_line |
| 770 | or repo_line[0] not in ["deb", "deb-src", "rpm", "rpm-src"] |
| 771 | or len(repo_line) < 3 |
| 772 | ): |
| 773 | invalid = True |
| 774 | return disabled, invalid, comment, repo_line |
| 775 | |
| 776 | if repo_line[1].startswith("["): |
| 777 | if not any(x.endswith("]") for x in repo_line[1:]): |
| 778 | invalid = True |
| 779 | return disabled, invalid, comment, repo_line |
| 780 | |
| 781 | return disabled, invalid, comment, repo_line |
| 782 | |
| 783 | |
| 784 | def _get_opts(line): |