mirror of
https://github.com/BioArchLinux/bioarchlinux-tools.git
synced 2025-03-09 22:53:31 +00:00
fix: bug in bump_pkgrel
This commit is contained in:
parent
2e5e8794cf
commit
de9b2c68ad
1 changed files with 8 additions and 6 deletions
|
@ -4,8 +4,6 @@
|
||||||
Update the PKGBUILD and lilac.yaml of archived pkgs in `pkgname.txt`
|
Update the PKGBUILD and lilac.yaml of archived pkgs in `pkgname.txt`
|
||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
import fileinput
|
|
||||||
import re
|
|
||||||
import yaml
|
import yaml
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
@ -35,12 +33,16 @@ def archive_pkg_by_file_list(file, bioarch_path="BioArchLinux", biconductor_vers
|
||||||
|
|
||||||
|
|
||||||
def bump_pkgrel(step=1):
|
def bump_pkgrel(step=1):
|
||||||
with fileinput.input(r"PKGBUILD", inplace=True) as f:
|
with open("PKGBUILD", "r") as f:
|
||||||
for line in f:
|
lines = f.readlines()
|
||||||
|
for i in range(len(lines)):
|
||||||
|
line = lines[i]
|
||||||
if line.startswith("pkgrel="):
|
if line.startswith("pkgrel="):
|
||||||
new_pkgrel = int(line.split("=")[1])+step
|
new_pkgrel = int(line.split("=")[1])+step
|
||||||
line = re.sub(
|
lines[i] = f'pkgrel={new_pkgrel}\n'
|
||||||
r'pkgrel=\d+', f'pkgrel={new_pkgrel}', line)
|
break
|
||||||
|
with open("PKGBUILD", "w") as f:
|
||||||
|
f.writelines(lines)
|
||||||
|
|
||||||
|
|
||||||
def archive_pkg_yaml(bioconductor_version=3.15, yaml_file="lilac.yaml"):
|
def archive_pkg_yaml(bioconductor_version=3.15, yaml_file="lilac.yaml"):
|
||||||
|
|
Loading…
Add table
Reference in a new issue