pyerge
It is small python wrapper tool for emerge (Gentoo package manager - Portage). It can mount RAM disk of defined size and compile packages inside it. Pyerge provide various tools to check and show emerge/portage status for conky.
Sponsored by Jetbrains Open Source Support Program
Table of Contents
Name
It should be called PYMERGE for PYthon and eMERGE, but when I create repository I missspelled the name, and I keep it like that.
Requirements
- Python-3.6+
- app-portage/eix
Installation
Copy ebuild from GitHub Releases into your local repository (i.e. /usr/local/portage/dev-python/portage) and run as root:
cd /usr/local/portage/app-portage/portage
ebuild pyerge-0.7.2.ebuild manifest
eix-update
echo "app-portage/pyerge ~amd64" >> /etc/portage/package.accept_keywords
emerge app-portage/portage
Ebuild is good quality as RepoMan sez: "If everyone were like you, I'd be out of business!"
Main usage
Pyerge API/CLI parameter are not stable yes and are subject to change.
Main pyerge script is called pye and has two main actions: check and emerge
pye check
sudo pye check
It basicly run:
- sync portage
eix-sync sudo emerge -pvNDu --nospinner --with-bdeps=y --color n @world(and save output to log_file_1)- Estypete time for runing ememrge @world
genlop -pn(and save to log_file_2)
Some useful switches:
- -l, --local - run everthing without
eix-sync - -q, --quiet - no output from pyerge itself only form other tools like
eix, oremerge - -v, --verbose - be more verbose
pye emerge
sudo pye -w emerge
It basicly run:
- check if emerge isn't runnig
- set envirinment variable PORTAGE_TMPDIR to /var/tmp/portage
- mount 4G RAM disk to /var/tmp/portage
- run
emerge -NDu --nospinner --with-bdeps=y --keep-going=y @world - unmount RAM disk
Some useful switches:
- -d, --clean-print - after running
emerge -pvNDu @worldit will show output from deep clean -emegre -pc - -c, --clean-run - after running
emerge -pvNDu @worldit will run deep clean -emerge -c(imply -d)
After emerge action you can pass any ememrge parameter, it will be passed directly into emerge. So, you can build:
sudo pye -s 1G emerge -a app-admin/conky
It will mount only 1G RAM disk and ask while comipling app-admin/conky package.
- -s, --size - size of RAM disk with postfix i.e. 1024K, 512M, 2G
Tools for Conky
Those tools are crated especialy for Conky monitoring. i.e. part of my .conkyrc:
color0 5b6dad
color1 7f8ed3
TEXT
${color0}Sensors:
${color0}CPU1: ${color1}${hwmon 0 temp 2}°C ${color0}CPU2: ${color1}${hwmon 0 temp 3}°C
${color0}md126 (root): ${color1}${execi 60 e_raid -n md126} ${color0}md127 (swap): ${color1}${execi 60 e_raid -n md127}
${color1}$hr
${color0}File Systems:
${color0}root ${color1}${fs_used /}/${fs_size /} ${color1}${fs_bar /}
${color0}boot ${color1}${fs_used /boot}/${fs_size /boot} ${color1}${fs_bar /boot}
${color0}portage ${color1}${fs_used /var/tmp/portage}/${fs_size /var/tmp/portage} ${color1}${fs_bar 6 /var/tmp/portage}
${color1}$hr
${color0}Portage:
${color0}Last Sync: ${color1}${execi 120 e_sync}
${color0}Progress: ${color1}${execibar 30 e_prog}
${color0}Package: ${color1}${execi 30 e_curr}
${color0}ETA: ${color1}${execi 30 e_eta}
${color0}Status: ${color1}${execi 30 e_sta}
${color0}Update: ${color1}${execi 30 e_upd}
${color0}Download: ${color1}${execi 30 e_dl}
${color0}EUT: ${color1}${execi 30 e_eut}
${color0}Live: ${color1}${execi 5400 e_live all}
${color1}$hr
${color0}Gentoo Linux Security Advisories:
${color1}${execi 5400 glsa list -e 25}
${color0}Affected GLSA:
${color1}${execi 5400 glsa test -e 40}
e_sync
e_sync
Print date of last emerge syc eix-sync
e_dl
e_dl
Run after pye check print size of downloads of @world
i.e. output - 3,239,589 KiB
e_curr
e_curr
Run during sudo pye emereg or sudo emerge - print current building (lastly builded) package
e_eut
e_eut
Run after pye check - print estimated update time from genlop -pn
i.e. output - 2 days 10h 36min
e_eta
e_eta
Run during sudo pye emereg or sudo emerge - print estimetet left time to end of compilation, based on genlop
e_log
e_log
Run after pye check - print content of next @world update
e_sta
e_sta
Status of emerge/portage. Possible values: Compiling, Cleaning, Autoclean, Completed, Finished, Synced, Syncing, Unmerging, Merging, Unmerge
e_prog
e_prog
Run during sudo pye emereg or sudo emerge - print current progress of emerge as float
i.e. output - if emerge is buildeing (5 of 6) package it will return 83.3333
You can use it in conky as: ${execibar 30 e_prog}
e_upd
e_upd
Run after pye check - print types of next @world update. Possible values: U, N, NS, R, Un, D, B
i.e. output - 19 U, 2 R, 1 Un, 2 D - it means 19 upgrades, 2 reinstals, 1 uninstall, 2 downgrades
e_raid
e_raid <raid dev>
Print RAID status form /proc/mdstat i.e. output for e_raid md126L: [UUU]
e_live
e_live <action>
Print names and number of live ebuild to rebuild i.e. output for e_live all: cvechecker,openmw (2 of 3)
glsa
glsa -e 5 list
List last 5 of GLSA enrties output:
202107-55: SDL 2: Multiple vulnerabilities
202107-54: libyang: Multiple vulnerabilities
202107-53: Leptonica: Multiple vulnerabilities
202107-52: Apache Velocity: Multiple vulnerabilities
202107-51: IcedTeaWeb: Multiple vulnerabilities
glsa -e 40 test
Check system against last 40 of GLSA. output:
System is not affected by any of listed GLSAs
or list of IDs:
202107-53,202107-52
Release files for pyerge 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyerge-0.7.2.tar.gz | 25.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyerge-0.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.7 kB
Release files / pyerge-0.7.2.tar.gz
| Download URL | pyerge-0.7.2.tar.gz |
|---|---|
| Size | 25.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
816c09e489f9e058da78051ad4fd11cee45599db9e83502c79793108b0572b0b
|
|
BLAKE2b-256 checksum How to use checksums |
100d6f0257a2735e5240022a32a6852b6b3f59a9983481fc5b5b8629b56ec9d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / pyerge-0.7.2-py3-none-any.whl
| Download URL | pyerge-0.7.2-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b3686dc589429f22953e3bdac2428b5a0a9466c3ee851474b917ea159de0986
|
|
BLAKE2b-256 checksum How to use checksums |
8fb8e6e482fa7f3a34f4807571fee2e553032a4a266352b58a13236158df1605
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|