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
6a39e446
Commit
6a39e446
authored
Oct 23, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add --latest support
parent
4bd399cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
eget
eget
+14
-2
No files found.
eget
View file @
6a39e446
...
...
@@ -29,11 +29,18 @@ if [ "$1" = "-q" ] ; then
shift
fi
LISTONLY
=
''
if
[
"
$1
"
=
"--list"
]
;
then
LISTONLY
=
"
$1
"
shift
fi
LATEST
=
''
if
[
"
$1
"
=
"--latest"
]
;
then
LATEST
=
"
$1
"
shift
fi
fatal
()
{
echo
"
$*
"
>
&2
...
...
@@ -47,6 +54,11 @@ filter_glob()
grep
"^
$(
echo
"
$1
"
|
sed
-e
"s|
\*
|.*|g"
-e
"s|?|.|g"
)
$"
}
filter_order
()
{
[
-z
"
$LATEST
"
]
&&
cat
&&
return
sort
|
tail
-n1
}
# download to this file
WGET_OPTION_TARGET
=
...
...
@@ -110,14 +122,14 @@ get_urls()
if
[
-n
"
$LISTONLY
"
]
;
then
WGET
=
"
$WGET
-q"
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
)
;
do
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
echo
"
$(
basename
"
$fn
"
)
"
done
exit
fi
ERROR
=
0
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
)
;
do
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
$WGET
"
$URL
/
$(
basename
"
$fn
"
)
"
||
ERROR
=
1
done
exit
$ERROR
...
...
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