mirror of
https://github.com/BioArchLinux/bioarchlinux-tools.git
synced 2025-03-09 22:53:31 +00:00
dbmanager: update log
This commit is contained in:
parent
0f4a7014c4
commit
0da0d2662a
2 changed files with 9 additions and 1 deletions
|
@ -69,6 +69,9 @@ class PkgMeta(Base):
|
||||||
self.bioc_ver = bioc_ver
|
self.bioc_ver = bioc_ver
|
||||||
self.bioc_category = bioc_category
|
self.bioc_category = bioc_category
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f"Name: {self.name},\nDesc: {self.desc},\nRepo: {self.repo},\nVersion: {self.bioc_ver},\nCategory: {self.bioc_category}"
|
||||||
|
|
||||||
|
|
||||||
def from_str(data, bioc_ver, bioc_cat):
|
def from_str(data, bioc_ver, bioc_cat):
|
||||||
'''
|
'''
|
||||||
|
@ -218,12 +221,16 @@ def add_or_skip(session, table, pkgmeta):
|
||||||
|
|
||||||
|
|
||||||
def add_or_update(session, table, pkgmeta):
|
def add_or_update(session, table, pkgmeta):
|
||||||
|
def getmd5sum(desc):
|
||||||
|
return re.search(r"MD5sum: ([a-z0-9]+)\n", desc).group(1)
|
||||||
if not pkgmeta:
|
if not pkgmeta:
|
||||||
return
|
return
|
||||||
if session.get(table, pkgmeta.name):
|
if session.get(table, pkgmeta.name):
|
||||||
|
|
||||||
pkg = session.query(table).filter_by(
|
pkg = session.query(table).filter_by(
|
||||||
name=pkgmeta.name).first()
|
name=pkgmeta.name).first()
|
||||||
|
if pkg.repo == 'CRAN' and getmd5sum(pkg.desc) != getmd5sum(pkgmeta.desc) and not (pkg.name in EXCLUDED_PKGS):
|
||||||
|
logging.warning(
|
||||||
|
f"Overwritting package: {pkg.name}\n old meta :{pkg}\n new meta: {pkgmeta} \n")
|
||||||
pkg.desc = pkgmeta.desc
|
pkg.desc = pkgmeta.desc
|
||||||
pkg.repo = pkgmeta.repo
|
pkg.repo = pkgmeta.repo
|
||||||
pkg.bioc_ver = pkgmeta.bioc_ver
|
pkg.bioc_ver = pkgmeta.bioc_ver
|
||||||
|
|
|
@ -13,3 +13,4 @@ For usage, run with argument `-h`.
|
||||||
- [ ] generate PKGBUILD for missing dependencies `depends_updater`
|
- [ ] generate PKGBUILD for missing dependencies `depends_updater`
|
||||||
- [x] merge `sync_meta_data` into `dbmanager`
|
- [x] merge `sync_meta_data` into `dbmanager`
|
||||||
- [x] merge `pkg_archiver` into `dbmanager`
|
- [x] merge `pkg_archiver` into `dbmanager`
|
||||||
|
- [ ] support unarchiving CRAN pkgs automatically in `pkg_archiver`
|
||||||
|
|
Loading…
Add table
Reference in a new issue