Skip to content

Commit f36f075

Browse files
Flowdalicfloppym
authored andcommitted
bintree: Introduce PORTAGE_BINHOST_TTL setting
Closes: https://bugs.gentoo.org/958401 Closes: #1444 Signed-off-by: Florian Schmaus <[email protected]> Signed-off-by: Mike Gilbert <[email protected]>
1 parent 5eafc6b commit f36f075

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/portage/dbapi/bintree.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,11 @@ def _update_pkgindex_header(self, header):
21772177
header["URI"] = base_uri
21782178
else:
21792179
header.pop("URI", None)
2180+
ttl = self.settings.get("PORTAGE_BINHOST_TTL")
2181+
if ttl:
2182+
header["TTL"] = ttl
2183+
else:
2184+
header.pop("TTL", None)
21802185
for k in (
21812186
list(self._pkgindex_header_keys)
21822187
+ self.settings.get("USE_EXPAND_IMPLICIT", "").split()

man/make.conf.5

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,14 @@ use the URI header field as a base URI for fetching binary packages. If the URI
10401040
header field is not defined then the client will use its ${PORTAGE_BINHOST}
10411041
setting as the base URI.
10421042
.TP
1043+
\fBPORTAGE_BINHOST_TTL\fR = \
1044+
\fI"3600"\fR
1045+
If this is set, its value will be used to define the TTL header in package
1046+
index. The TTL header indicates to portage the duration in seconds after
1047+
which the local package index should be considered potentially outdated. It is
1048+
recommended to set this value to the minimal duration between binary package
1049+
builds to avoid unnecessary network requests on the package index.
1050+
.TP
10431051
.B PORTAGE_BINPKG_FORMAT
10441052
This variable sets default format used for binary packages. Possible values
10451053
are tar and rpm or both. It is very uncommon to set this and is likely

0 commit comments

Comments
 (0)