Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eget
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eget
Commits
9c9a4c19
Commit
9c9a4c19
authored
Jan 08, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget fix: move __timestamping_download outside backend blocks
parent
2f9467c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
42 deletions
+41
-42
eget
eget
+41
-42
No files found.
eget
View file @
9c9a4c19
...
...
@@ -1080,6 +1080,47 @@ __wget()
docmd
$WGET
$FORCEIPV
$WGETQ
$WGETSHOWPROGRESS
$NOGLOB
$WGETCOMPRESSED
$WGETHEADER
$WGETNOSSLCHECK
$WGETNODIRECTORIES
$WGETCONTINUE
$WGETTIMESTAMPING
$WGETTIMEOUT
$WGETREADTIMEOUT
$WGETRETRYCONNREFUSED
$WGETTRIES
$WGETLOADCOOKIES
$WGETRUSTSERVERNAMES
$EGET_WGET_OPTIONS
"
$@
"
}
# Helper function for timestamping with aria2/axel (needs to be outside backend blocks)
__timestamping_download
()
{
local
URL
=
"
$1
"
local
TARGETFILE
=
"
$2
"
local
DOWNLOAD_CMD
=
"
$3
"
# will be "__aria2 ..." or "__axel ..."
# If file doesn't exist, just download
[
!
-
f
"
$TARGETFILE
"
]
&&
eval
"
$DOWNLOAD_CMD
"
&&
return
# Get Last-Modified header
local
remote_modified
=
"
$(
url_get_header
"
$URL
"
"Last-Modified"
)
"
if
[
-
z
"
$remote_modified
"
]
;
then
info
"Warning: Server did not provide Last-Modified header, downloading anyway"
eval
"
$DOWNLOAD_CMD
"
return
fi
# Convert HTTP date to unix timestamp
local
remote_timestamp
=
"
$(
date
-d
"
$remote_modified
"
'+%s'
2>/dev/null
)
"
if
[
-
z
"
$remote_timestamp
"
]
;
then
info
"Warning: Could not parse Last-Modified date '
$remote_modified
', downloading anyway"
eval
"
$DOWNLOAD_CMD
"
return
fi
# Get local file timestamp
local
local_timestamp
=
"
$(
stat
-c
'%Y'
"
$TARGETFILE
"
2>/dev/null
)
"
[
-
z
"
$local_timestamp
"
]
&&
local_timestamp
=
0
# Compare timestamps
if
[
"
$remote_timestamp
"
-
gt
"
$local_timestamp
"
]
;
then
info
"Remote file is newer, downloading..."
eval
"
$DOWNLOAD_CMD
"
||
return
1
# Set timestamp from server
touch
-
d
"
$remote_modified
"
"
$TARGETFILE
"
2
>/
dev/null
else
info
"Local file is up to date, skipping download"
fi
}
if
[
"
$EGET_BACKEND
"
=
"file"
]
;
then
...
...
@@ -1408,48 +1449,6 @@ url_scat()
download_with_mirroring __wget
"
$URL
"
-
O-
}
# Helper function for timestamping with aria2/axel
__timestamping_download
()
{
local
URL
=
"
$1
"
local
TARGETFILE
=
"
$2
"
local
DOWNLOAD_CMD
=
"
$3
"
# will be "__aria2 ..." or "__axel ..."
# If file doesn't exist, just download
[
!
-
f
"
$TARGETFILE
"
]
&&
eval
"
$DOWNLOAD_CMD
"
&&
return
# Get Last-Modified header
local
remote_modified
=
"
$(
url_get_header
"
$URL
"
"Last-Modified"
)
"
if
[
-
z
"
$remote_modified
"
]
;
then
info
"Warning: Server did not provide Last-Modified header, downloading anyway"
eval
"
$DOWNLOAD_CMD
"
return
fi
# Convert HTTP date to unix timestamp
local
remote_timestamp
=
"
$(
date
-d
"
$remote_modified
"
'+%s'
2>/dev/null
)
"
if
[
-
z
"
$remote_timestamp
"
]
;
then
info
"Warning: Could not parse Last-Modified date '
$remote_modified
', downloading anyway"
eval
"
$DOWNLOAD_CMD
"
return
fi
# Get local file timestamp
local
local_timestamp
=
"
$(
stat
-c
'%Y'
"
$TARGETFILE
"
2>/dev/null
)
"
[
-
z
"
$local_timestamp
"
]
&&
local_timestamp
=
0
# Compare timestamps
if
[
"
$remote_timestamp
"
-
gt
"
$local_timestamp
"
]
;
then
info
"Remote file is newer, downloading..."
eval
"
$DOWNLOAD_CMD
"
||
return
1
# Set timestamp from server
touch
-
d
"
$remote_modified
"
"
$TARGETFILE
"
2
>/
dev/null
else
info
"Local file is up to date, skipping download"
fi
}
# download to default name of to $2
url_sget
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment