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
Vladislav
eepm
Commits
98d7415b
Commit
98d7415b
authored
Apr 03, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: fix URL concatenation
parent
c62a2ac0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
tools_eget
bin/tools_eget
+17
-16
No files found.
bin/tools_eget
View file @
98d7415b
...
...
@@ -444,6 +444,14 @@ get_host_only()
echo
"
$1
/"
|
grep
-Eo
'(.*://[^/]+)'
}
concatenate_url_and_filename
()
{
local
url
=
"
$1
"
local
fn
=
"
$2
"
# workaround for a slash in the end of URL
echo
"
$(
echo
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
}
# Args: URL filename
make_fileurl
()
{
...
...
@@ -453,24 +461,17 @@ make_fileurl()
fn
=
"
$(
echo
"
$fn
"
|
sed
-e
's|^./||'
-e
's|^/+||'
)
"
if
is_fileurl
"
$url
"
;
then
echo
"
$url
/
$fn
"
return
# if it is url
:
elif
echo
"
$fn
"
|
grep
-q
"^/"
;
then
# if there is file path from the root of the site
url
=
"
$(
get_host_only
"
$url
"
)
"
elif
echo
"
$url
"
|
grep
-q
-v
"/$"
;
then
# if there is no slash in the end of URL
url
=
"
$(
dirname
"
$url
"
)
"
fi
# if there is file path from the root of the site
if
echo
"
$fn
"
|
grep
-q
"^/"
;
then
echo
"
$(
get_host_only
"
$url
"
)
$fn
"
return
fi
# if there is no slash in the end of URL
if
echo
"
$url
"
|
grep
-q
-v
"/$"
;
then
echo
"
$(
dirname
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
return
fi
# workaround for a slash in the end of URL
echo
"
$(
echo
"
$url
"
|
sed
-e
's|/*$||'
)
/
$fn
"
concatenate_url_and_filename
"
$url
"
"
$fn
"
}
get_urls
()
...
...
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