Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
Nurlan
eepm
Commits
6a9bc2eb
Commit
6a9bc2eb
authored
Aug 24, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools_eget: update from eget 5.0
parent
b532e67b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
tools_eget
bin/tools_eget
+22
-9
No files found.
bin/tools_eget
View file @
6a9bc2eb
...
...
@@ -156,7 +156,8 @@ get_github_urls()
grep
-i
-o
-E
'"browser_download_url": "https://.*"'
|
cut
-d
'"'
-f4
}
if
echo
"
$1
"
|
grep
-q
"^https://github.com/"
;
then
if
echo
"
$1
"
|
grep
-q
"^https://github.com/"
&&
\
echo
"
$1
"
|
grep
-q
-v
"/download/"
&&
[
-n
"
$2
"
]
;
then
MASK
=
"
$2
"
if
[
-n
"
$LISTONLY
"
]
;
then
...
...
@@ -183,32 +184,44 @@ if echo "$1" | grep -q "^ftp://" ; then
exit
fi
# drop mask part
URL
=
"
$(
dirname
"
$1
"
)
/"
# mask allowed only in the last part of path
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
fatal
"Error: there are globbing symbols (*?) in
$URL
"
fi
# mask allowed only in the last part of path
MASK
=
$(
basename
"
$1
"
)
# If have no wildcard symbol like asterisk, just download
if
echo
"
$MASK
"
|
grep
-qv
"[*?]"
||
echo
"
$MASK
"
|
grep
-q
"[?].*="
;
then
sget
"
$1
"
"
$TARGETFILE
"
exit
fi
is_url
()
{
echo
"
$1
"
|
grep
-q
"://"
}
get_urls
()
{
scat
$URL
|
\
grep
-i
-o
-E
'href="([^\*/"#]
+)"'
|
cut
-d
'"'
-f2
grep
-i
-o
-E
'href="(.
+)"'
|
cut
-d
'"'
-f2
}
if
[
-n
"
$LISTONLY
"
]
;
then
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
# TODO: return full url? someone use old behaviour?
echo
"
$(
basename
"
$fn
"
)
"
is_url
"
$fn
"
&&
echo
$fn
&&
continue
fn
=
"
$(
echo
"
$fn
"
|
sed
-e
's|^./||'
-e
's|^/+||'
)
"
echo
"
$URL
/
$fn
"
done
exit
fi
...
...
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