1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/python3
import animation
import os
import shutil
import subprocess
portageMetadataDir = '/var/cache/edb'
def regenSilent():
if os.path.isdir(portageMetadataDir):
for files in os.listdir(portageMetadataDir):
if os.path.isfile(os.path.join(portageMetadataDir, files)):
os.remove(os.path.join(portageMetadataDir, files))
else:
shutil.rmtree(os.path.join(portageMetadataDir, files))
portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE)
portageExecStage1.wait()
portageExecStage2 = subprocess.Popen(['emerge', '--quiet', '--metadata'], stdout=subprocess.PIPE)
portageExecStage2.wait()
@animation.wait("refreshing metadata")
def regenAnimated():
if os.path.isdir(portageMetadataDir):
for files in os.listdir(portageMetadataDir):
if os.path.isfile(os.path.join(portageMetadataDir, files)):
os.remove(os.path.join(portageMetadataDir, files))
else:
shutil.rmtree(os.path.join(portageMetadataDir, files))
portageExecStage1 = subprocess.Popen(['emerge', '--quiet', '--regen'], stdout=subprocess.PIPE)
portageExecStage1.wait()
portageExecStage2 = subprocess.Popen(['emerge', '--quiet', '--metadata'], stdout=subprocess.PIPE)
portageExecStage2.wait()
|