Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
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
korinf
etersoft-build-utils
Commits
dede5277
Commit
dede5277
authored
May 30, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: add support for git repo for Source-url (create tarball from the git url)
parent
dcdeb70a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
rpmgs
bin/rpmgs
+37
-0
No files found.
bin/rpmgs
View file @
dede5277
...
...
@@ -77,11 +77,48 @@ check_tarball()
}
# Args: URL TARGET
git_to_tarball
()
{
local
URL
=
"
$1
"
local
TARGET
=
"
$2
"
local
CHECKOUT
=
''
info
"Create tarball
$(
basename
$TARGET
)
from
$URL
..."
# allow commit or version
if
echo
"
$URL
"
|
grep
-q
"github
\.
com.*/tree/"
;
then
CHECKOUT
=
"
$(
echo
"
$URL
"
|
sed
-e
's|.*/tree/||'
)
"
URL
=
"
$(
echo
"
$URL
"
|
sed
-e
's|/tree/.*||'
)
"
fi
local
d
=
"
$(
basename
"
$URL
"
.git
)
"
git clone
--recurse-submodules
"
$URL
"
"
$d
"
||
fatal
if
[
-n
"
$CHECKOUT
"
]
;
then
cd
"
$d
"
||
fatal
git checkout
$CHECKOUT
||
fatal
cd
-
>
/dev/null
fi
rm
-rf
"
$d
/.git/"
# note: TARGET can be various
docmd erc pack
"
$TARGET
"
"
$d
"
||
fatal
rm
-rf
"
$d
"
}
# Args: URL TARGET
download_to
()
{
local
URL
=
"
$1
"
local
TARGET
=
"
$2
"
pushd
$(
dirname
$TARGET
)
# make tarball from remote git (with submodules)
if
echo
"
$URL
"
|
grep
-q
"
\.
git$"
||
echo
"
$URL
"
|
grep
-q
"github
\.
com.*/tree/"
;
then
git_to_tarball
"
$URL
"
"
$TARGET
"
local
RET
=
$?
popd
return
$RET
fi
local
DF
=
"
$(
basename
"
$URL
"
)
"
download_url
"
$URL
"
&&
repack_tarball
"
$DF
"
"
$TARGET
"
local
RET
=
$?
...
...
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