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
etersoft
eepm
Commits
05d6ef22
Commit
05d6ef22
authored
Mar 30, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: fix get real filename for redirects with tags
parent
62130338
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
tools_eget
bin/tools_eget
+24
-6
No files found.
bin/tools_eget
View file @
05d6ef22
...
...
@@ -240,6 +240,7 @@ is_strange_url()
{
local
URL
=
"
$1
"
is_url
"
$URL
"
||
return
#echo "$URL" | grep -q -E "\.(deb|rpm|zip)\?" && return 1
echo
"
$URL
"
|
grep
-q
"[?&]"
}
...
...
@@ -1205,7 +1206,7 @@ url_get_header()
url_get_headers
"
$URL
"
|
grep
-i
"^ *
$HEADER
: "
|
sed
-e
"s|^ *
$HEADER
: ||i"
}
url_get_real_url
()
url_get_r
aw_r
eal_url
()
{
local
URL
=
"
$1
"
...
...
@@ -1220,15 +1221,28 @@ url_get_real_url()
if
is_abs_path
"
$loc
"
;
then
loc
=
"
$(
concatenate_url_and_filename
"
$(
get_host_only
"
$URL
"
)
"
"
$loc
"
)
"
#"
fi
if
!
is_strange_url
"
$loc
"
;
then
echo
"
$loc
"
return
fi
echo
"
$loc
"
return
done
echo
"
$URL
"
}
url_get_real_url
()
{
local
URL
=
"
$1
"
local
loc
loc
=
"
$(
url_get_raw_real_url
"
$URL
"
)
"
# we need stay with original url due redirect tags
if
!
is_strange_url
"
$loc
"
;
then
echo
"
$loc
"
return
fi
echo
"
$URL
"
}
url_get_filename
()
{
local
URL
=
"
$1
"
...
...
@@ -1250,7 +1264,11 @@ url_get_filename()
return
fi
basename
"
$(
url_get_real_url
"
$URL
"
)
"
local
loc
=
"
$(
url_get_raw_real_url
"
$URL
"
)
"
if
is_strange_url
"
$loc
"
;
then
loc
=
"
$(
echo
"
$loc
"
|
sed
-e
"s|
\?
.*||"
)
"
fi
basename
"
$loc
"
}
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