Skip to content

Commit

Permalink
Drop _emerge/getloadavg.py
Browse files Browse the repository at this point in the history
Portage's custom getloadavg.py wrapper was added with
8607a39 ("If necessary, use /proc/loadavg to emulate
os.getloadavg()."). All platforms we care about provide
os.getloadavg() now, so this can be dropped.

Signed-off-by: Florian Schmaus <[email protected]>
  • Loading branch information
Flowdalic committed Sep 21, 2024
1 parent 7b7b261 commit 6893ab4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 38 deletions.
5 changes: 2 additions & 3 deletions lib/_emerge/JobStatusDisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io
import sys
import time
import os

import portage
import portage.util.formatter as formatter
Expand All @@ -12,8 +13,6 @@
from portage import _unicode_encode
from portage.output import xtermTitle

from _emerge.getloadavg import getloadavg


class JobStatusDisplay:
# Used as maximum display width and default fallback value.
Expand Down Expand Up @@ -188,7 +187,7 @@ def _property_change(self, name, old_value, new_value):

def _load_avg_str(self):
try:
avg = getloadavg()
avg = os.getloadavg()
except OSError:
return "unknown"

Expand Down
5 changes: 2 additions & 3 deletions lib/_emerge/PollScheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# Distributed under the terms of the GNU General Public License v2

import threading
import os

from portage.util.futures import asyncio
from portage.util._async.SchedulerInterface import SchedulerInterface
from portage.util._eventloop.global_event_loop import global_event_loop

from _emerge.getloadavg import getloadavg


class PollScheduler:
# max time between loadavg checks (seconds)
Expand Down Expand Up @@ -182,7 +181,7 @@ def _can_add_job(self):
and self._running_job_count() >= 1
):
try:
avg1, avg5, avg15 = getloadavg()
avg1, avg5, avg15 = os.getloadavg()
except OSError:
return False

Expand Down
4 changes: 2 additions & 2 deletions lib/_emerge/Scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import warnings
import weakref
import zlib
import os

import portage
from portage import os
Expand Down Expand Up @@ -49,7 +50,6 @@
from _emerge.EbuildPhase import EbuildPhase
from _emerge.emergelog import emergelog
from _emerge.FakeVartree import FakeVartree
from _emerge.getloadavg import getloadavg
from _emerge._find_deep_system_runtime_deps import _find_deep_system_runtime_deps
from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
from _emerge.JobStatusDisplay import JobStatusDisplay
Expand Down Expand Up @@ -1932,7 +1932,7 @@ def _job_delay(self):
self._sigcont_time = None

try:
avg1, avg5, avg15 = getloadavg()
avg1, avg5, avg15 = os.getloadavg()
except OSError:
return False

Expand Down
29 changes: 0 additions & 29 deletions lib/_emerge/getloadavg.py

This file was deleted.

1 change: 0 additions & 1 deletion lib/_emerge/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ py.install_sources(
'create_world_atom.py',
'depgraph.py',
'emergelog.py',
'getloadavg.py',
'help.py',
'is_valid_package_atom.py',
'main.py',
Expand Down

0 comments on commit 6893ab4

Please sign in to comment.