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
faa7beda
Commit
faa7beda
authored
Apr 25, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: fix making file url from site url and filename
parent
daddc8d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
tools_eget
bin/tools_eget
+12
-3
No files found.
bin/tools_eget
View file @
faa7beda
...
@@ -345,6 +345,16 @@ is_url()
...
@@ -345,6 +345,16 @@ is_url()
echo
"
$1
"
|
grep
-q
"://"
echo
"
$1
"
|
grep
-q
"://"
}
}
# Args: URL filename
make_fileurl
()
{
local
url
=
"
$1
"
local
fn
=
"
$2
"
fn
=
"
$(
echo
"
$fn
"
|
sed
-e
's|^./||'
-e
's|^/+||'
)
"
# workaround for a slash in the end of URL
echo
"
$(
echo
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
}
get_urls
()
get_urls
()
{
{
# cat html, divide to lines by tags and cut off hrefs only
# cat html, divide to lines by tags and cut off hrefs only
...
@@ -355,15 +365,14 @@ get_urls()
...
@@ -355,15 +365,14 @@ get_urls()
if
[
-n
"
$LISTONLY
"
]
;
then
if
[
-n
"
$LISTONLY
"
]
;
then
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
is_url
"
$fn
"
&&
echo
$fn
&&
continue
is_url
"
$fn
"
&&
echo
$fn
&&
continue
fn
=
"
$(
echo
"
$fn
"
|
sed
-e
's|^./||'
-e
's|^/+||'
)
"
make_fileurl
"
$URL
"
"
$fn
"
echo
"
$URL
/
$fn
"
done
done
exit
exit
fi
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
is_url
"
$fn
"
||
fn
=
"
$
URL
/
$(
basename
"
$fn
"
)
"
is_url
"
$fn
"
||
fn
=
"
$
(
make_fileurl
"
$URL
"
"
$(
basename
"
$fn
"
)
"
)
"
#
"
sget
"
$fn
"
||
ERROR
=
1
sget
"
$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