Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
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
Ivan Ivlev
eget
Commits
1e314ded
Commit
1e314ded
authored
Aug 24, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: allow separated mask for urls
parent
fe3b65e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
eget
eget
+12
-5
No files found.
eget
View file @
1e314ded
...
@@ -184,15 +184,22 @@ if echo "$1" | grep -q "^ftp://" ; then
...
@@ -184,15 +184,22 @@ if echo "$1" | grep -q "^ftp://" ; then
exit
exit
fi
fi
# drop mask part
# mask allowed only in the last part of path
URL
=
"
$(
dirname
"
$1
"
)
/"
MASK
=
$(
basename
"
$1
"
)
# if mask are second arg
if
[
-n
"
$2
"
]
;
then
URL
=
"
$1
"
MASK
=
"
$2
"
else
# drop mask part
URL
=
"
$(
dirname
"
$1
"
)
"
fi
if
echo
"
$URL
"
|
grep
-q
"[*?]"
;
then
if
echo
"
$URL
"
|
grep
-q
"[*?]"
;
then
fatal
"Error: there are globbing symbols (*?) in
$URL
"
fatal
"Error: there are globbing symbols (*?) in
$URL
"
fi
fi
# mask allowed only in the last part of path
MASK
=
$(
basename
"
$1
"
)
# If have no wildcard symbol like asterisk, just download
# If have no wildcard symbol like asterisk, just download
if
echo
"
$MASK
"
|
grep
-qv
"[*?]"
||
echo
"
$MASK
"
|
grep
-q
"[?].*="
;
then
if
echo
"
$MASK
"
|
grep
-qv
"[*?]"
||
echo
"
$MASK
"
|
grep
-q
"[?].*="
;
then
...
@@ -216,7 +223,7 @@ fi
...
@@ -216,7 +223,7 @@ fi
ERROR
=
0
ERROR
=
0
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
sget
"
$URL
$(
basename
"
$fn
"
)
"
||
ERROR
=
1
sget
"
$URL
/
$(
basename
"
$fn
"
)
"
||
ERROR
=
1
done
done
exit
$ERROR
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