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
11ff9ce7
Commit
11ff9ce7
authored
Dec 28, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add -i|--input-file option
parent
557948de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
eget
eget
+55
-0
No files found.
eget
View file @
11ff9ce7
...
@@ -369,6 +369,7 @@ AXELSHOWPROGRESS=''
...
@@ -369,6 +369,7 @@ AXELSHOWPROGRESS=''
WGETTIMESTAMPING
=
''
WGETTIMESTAMPING
=
''
CURLTIMESTAMPING
=
''
CURLTIMESTAMPING
=
''
TIMESTAMPING
=
''
TIMESTAMPING
=
''
INPUTFILE
=
''
set_quiet
()
set_quiet
()
{
{
...
@@ -415,6 +416,7 @@ Options:
...
@@ -415,6 +416,7 @@ Options:
--no-glob - turn off file name globbing
--no-glob - turn off file name globbing
-c|--continue - continue getting a partially-downloaded file
-c|--continue - continue getting a partially-downloaded file
-N|--timestamping - only download if remote file is newer than local
-N|--timestamping - only download if remote file is newer than local
-i|--input-file FILE - read URLs from FILE, one per line; each line can contain multiple mirror URLs (use - for stdin)
-T|--timeout=N - set the network timeout to N seconds
-T|--timeout=N - set the network timeout to N seconds
--read-timeout=N - set the read (and write) timeout to N seconds
--read-timeout=N - set the read (and write) timeout to N seconds
--retry-connrefused - consider “connection refused” a transient error and try again
--retry-connrefused - consider “connection refused” a transient error and try again
...
@@ -585,6 +587,13 @@ while [ -n "$1" ] ; do
...
@@ -585,6 +587,13 @@ while [ -n "$1" ] ; do
WGETTIMESTAMPING
=
"-N"
WGETTIMESTAMPING
=
"-N"
CURLTIMESTAMPING
=
"1"
CURLTIMESTAMPING
=
"1"
;;
;;
-i
|
--input-file
)
if
[
-z
"
$argvalue
"
]
;
then
shift
argvalue
=
"
$1
"
fi
INPUTFILE
=
"
$argvalue
"
;;
-T
|
--timeout
)
-T
|
--timeout
)
if
[
-z
"
$argvalue
"
]
;
then
if
[
-z
"
$argvalue
"
]
;
then
shift
shift
...
@@ -1851,6 +1860,34 @@ sget()
...
@@ -1851,6 +1860,34 @@ sget()
url_sget
"
$@
"
url_sget
"
$@
"
}
}
# Read URLs from file, skip empty lines and comments
read_urls_from_file
()
{
local
file
=
"
$1
"
local
line
if
[
"
$file
"
=
"-"
]
;
then
# Read from stdin
while
IFS
=
read
-
r line
;
do
line
=
"
$(
echo
"
$line
"
|
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
"
[
-
z
"
$line
"
]
&&
continue
echo
"
$line
"
|
grep
-
q
'^[[:space:]]*#'
&&
continue
echo
"
$line
"
done
else
# Read from file
[
!
-
f
"
$file
"
]
&&
fatal
"Error: input file '
$file
' not found"
[
!
-
r
"
$file
"
]
&&
fatal
"Error: input file '
$file
' is not readable"
while
IFS
=
read
-
r line
;
do
line
=
"
$(
echo
"
$line
"
|
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
"
[
-
z
"
$line
"
]
&&
continue
echo
"
$line
"
|
grep
-
q
'^[[:space:]]*#'
&&
continue
echo
"
$line
"
done
<
"
$file
"
fi
}
pget
()
pget
()
{
{
url_pget
"
$@
"
url_pget
"
$@
"
...
@@ -2022,6 +2059,24 @@ else
...
@@ -2022,6 +2059,24 @@ else
fi
fi
# Process input file if specified
if
[
-
n
"
$INPUTFILE
"
]
;
then
# Set output dir to current dir if not specified
[
-
z
"
$USEOUTPUTDIR
"
]
&&
USEOUTPUTDIR
=
"."
# Read URLs from file
URLS
=
"
$(
read_urls_from_file
"
$INPUTFILE
"
)
"
[
-
z
"
$URLS
"
]
&&
fatal
"Error: no valid URLs found in input file"
# Process each line separately (each line = one file, possibly with mirrors)
echo
"
$URLS
"
|
while
IFS
=
read
-
r line
;
do
[
-
z
"
$line
"
]
&&
continue
# Each line may contain multiple URLs (mirrors) separated by spaces
sget_with_mirrors
$line
done
exit
fi
# https://www.freeoffice.com/download.php?filename=freeoffice-2021-1062.x86_64.rpm
# https://www.freeoffice.com/download.php?filename=freeoffice-2021-1062.x86_64.rpm
if
[
-
z
"
$NOGLOB
"
]
&&
echo
"
$URL
"
|
grep
-
q
-
P
"[*
\[\]
]"
;
then
if
[
-
z
"
$NOGLOB
"
]
&&
echo
"
$URL
"
|
grep
-
q
-
P
"[*
\[\]
]"
;
then
fatal
"Error: there are globbing symbol (*[]) in
$URL
. It is allowed only for mask part"
fatal
"Error: there are globbing symbol (*[]) in
$URL
. It is allowed only for mask part"
...
...
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