Radosław Posted February 11 Report Share Posted February 11 (edited) Może się komuś przyda: #! /usr/bin/env python3 # -*- coding: utf-8 -*- import subprocess o_proc = subprocess.Popen("dnf check-update", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, bufsize=1, shell=True,) bStartPrint = False for line in iter(o_proc.stdout.readline, ''): if line.strip() == '': bStartPrint = True continue if not bStartPrint: continue if "Zastępowanie " in line: break sName = line.rstrip().split()[0] print(sName, sName, " ", end="") quit() wypisuje pakiety które mogą być aktualizowane, a następnie przekazuje do kdialog: Cytuj dnf update $(echo "--menu Choose $(/ścieżka do powyższego skryptu pythona/dnfer.py)" | xargs kdialog) Uruchomić w terminalu jako root i można sobie klikać do aktualizacji. Szybko i wygodnie. Brakuje jedynie "zastępowania" pakietów o nowych/innych nazwach. Pozdrawiam Radek Edited February 11 by Radosław literówka Link to comment Share on other sites More sharing options...
Radosław Posted February 14 Author Report Share Posted February 14 Mała uwaga. Jeśli wybierzemy `Anuluj` w okienku `kdialog` to chce aktualizować wszystko z domyślnym wyborem na nie (t/N). Wystarczy nacisnąć enter. Pozdrawiam\Radek Link to comment Share on other sites More sharing options...
Radosław Posted February 20 Author Report Share Posted February 20 aktualizacja wielu na raz: trochę zmieniony poprzedni skrypt: #! /usr/bin/env python3 # -*- coding: utf-8 -*- # dnfer.py import subprocess o_proc = subprocess.Popen("dnf check-update", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, bufsize=1, shell=True,) bStartPrint = False bNextLineSkip = False for line in iter(o_proc.stdout.readline, ''): if bNextLineSkip: bNextLineSkip = False continue if line.strip() == '': bStartPrint = True continue if not bStartPrint: continue if "Zastępowanie " in line: break if len(line.split()) == 1: bNextLineSkip = True sName = line.rstrip().split()[0] print(sName, sName, "off") #, end="") quit() i w bash-u: echo $(kdialog --separate-output --geometry=600x600 --checklist "Zaznacz do aktualizacji" $(/scieżka/do/skryptu/dnfer.py)) >/tmp/forDnf.txt; dnf update $(cat /tmp/forDnf.txt) Pozdrawiam Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now