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
c96b1fe2
Commit
c96b1fe2
authored
May 23, 2011
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgp: rewrite git clone
parent
1f950acb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
rpmgp
bin/rpmgp
+29
-7
No files found.
bin/rpmgp
View file @
c96b1fe2
...
...
@@ -250,11 +250,16 @@ get_all_remote_branches()
git checkout sisyphus
||
git checkout master
||
git checkout
$CURRENTBRANCH
}
has_ssh_access
()
{
ssh
$GIRARHOST
help
>
/dev/null 2>&1
}
git_clone
()
{
local
RREPO
=
"
$1
"
# Test if ssh access is available
if
[
-z
"
$PUBLICACCESS
"
]
&&
ssh
$GIRARHOST
help
>
/dev/null 2>&1
;
then
if
[
-z
"
$PUBLICACCESS
"
]
&&
has_ssh_access
;
then
echo
"Clone from
$GIRARHOST
:
$RREPO
..."
git clone
$GIRARHOST
:
$RREPO
else
...
...
@@ -263,6 +268,11 @@ git_clone()
fi
}
exist_git_repo
()
{
ssh
$GIRARHOST
ls
$1
>
/dev/null 2>&1
}
# clone remote git
if
[
-n
"
$CLONEGIT
"
]
;
then
# http://git.altlinux.org/gears/N/NAME.git
...
...
@@ -270,26 +280,38 @@ if [ -n "$CLONEGIT" ] ; then
RREPO
=
"/gears/
$REPOPATH
"
if
[
-z
"
$MIGRATEGIRAR
"
]
;
then
if
!
git_clone
$RREPO
;
then
if
!
git_clone
$RREPO
;
then
# http://git.altlinux.org/srpms/N/NAME.git
RREPO
=
"/srpms/
$REPOPATH
"
git_clone
$RREPO
||
fatal
"Can't clone
$RREPO
."
fi
else
[
-z
"
$PUBLICACCESS
"
]
||
fatal
"Can't remote clone via public access"
echo
"Remote clone from
$RREPO
..."
if
!
ssh
$GIRARHOST
clone
$RREPO
packages/
$PKGNAME
.git
;
then
# http://git.altlinux.org/srpms/N/NAME.git
RREPO
=
"/srpms/
$REPOPATH
"
if
exist_git_repo
$RREPO
;
then
echo
"Remote clone from
$RREPO
..."
ssh
$GIRARHOST
clone
$RREPO
packages/
$PKGNAME
.git
||
warning
"Can't remote clone."
else
# http://git.altlinux.org/srpms/N/NAME.git
RREPO
=
"/srpms/
$REPOPATH
"
if
exist_git_repo
$RREPO
;
then
echo
"Remote clone from
$RREPO
..."
ssh
$GIRARHOST
clone
$RREPO
packages/
$PKGNAME
.git
||
warning
"Can't remote clone."
else
fatal
"
$PKGNAME
does not exists in /gears or /srpms, can't clone"
fi
fi
git clone
$GIRARHOST
:packages/
$PKGNAME
.git
if
cd
$PKGNAME
;
then
# add remotes
git remote rename origin
$GIRARHOST
&&
git remote add origin
$GIRARHOST
:
$RREPO
cd
-
>
/dev/null
fi
fi
# get or update all branches
if
cd
$PKGNAME
;
then
# get or update all branches
get_all_remote_branches
cd
-
>
/dev/null
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