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
106eccea
Commit
106eccea
authored
Mar 07, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgp: only clone with -g, add new -gm option for remote clone and clone
parent
8c92bf36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
30 deletions
+57
-30
rpmgp
bin/rpmgp
+57
-30
No files found.
bin/rpmgp
View file @
106eccea
...
...
@@ -152,7 +152,8 @@ phelp()
echog
" -a search pkgname in all known repositories"
echog
" -c check if this package exists in the ALT Linux repository"
echog
" -d download all matched packages"
echog
" -g remote clone repo to USER/packages and clone it locally"
echog
" -g clone last built package repo"
echog
" -gm remote clone repo to USER/packages and clone it locally"
echog
" -m migrate to gear from spec/srpm"
echog
"Ext. options:"
echog
" -b install packages needed for build (use sudo apt-get) (need spec not package name)"
...
...
@@ -225,6 +226,61 @@ if [ -n "$INSTALLBINARY" ] ; then
exec
$SUDO
$CMD
$LISTPKG
fi
# TODO: do gpull -a for get all branches?
get_all_remote_branches
()
{
local
CURRENTBRANCH
=
$(
get_current_branch
)
# create all branches
for
i
in
$(
git branch
-a
|
grep
-v
"/HEAD"
|
grep
"remotes/origin/"
)
;
do
local
BRANCHNAME
=
$(
echo
$i
|
sed
-e
"s|remotes.*/||g"
)
if
is_exist_branch
$BRANCHNAME
;
then
git checkout
$BRANCHNAME
||
fatal
"can't checkout
$BRANCHNAME
"
git pull origin
$BRANCHNAME
else
git checkout
-b
$(
echo
$i
|
sed
-e
"s|remotes.*/||g"
)
$i
fi
done
git checkout sisyphus
||
git checkout master
||
git checkout
$CURRENTBRANCH
}
# clone remote git
if
[
-n
"
$CLONEGIT
"
]
;
then
REPOPATH
=
"
$(
initial_letter
$PKGNAME
)
/
$PKGNAME
.git"
# http://git.altlinux.org/gears/N/NAME.git
RREPO
=
"/gears/
$REPOPATH
"
if
[
-z
"
$MIGRATEGEAR
"
]
;
then
echo
"Clone from
$GIRARHOST
:
$RREPO
..."
if
!
git clone
$GIRARHOST
:
$RREPO
;
then
# http://git.altlinux.org/srpms/N/NAME.git
RREPO
=
"/srpms/
$REPOPATH
"
echo
"Try clone from
$RREPO
..."
git clone
$GIRARHOST
:
$RREPO
||
fatal
"Can't clone."
fi
else
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
"
echo
"Remote clone from
$RREPO
..."
ssh
$GIRARHOST
clone
$RREPO
packages/
$PKGNAME
.git
||
warning
"Can't remote clone."
fi
git clone
$GIRARHOST
:packages/
$PKGNAME
.git
fi
# get or update all branches
if
cd
$PKGNAME
;
then
get_all_remote_branches
cd
-
>
/dev/null
fi
echo
"See other repos at
$GIRARHOST
:"
list_git_package
$PKGNAME
exit
$?
fi
if
[
-n
"
$MIGRATEGEAR
"
]
;
then
for
INFILE
in
$LISTNAMES
;
do
# call for each file due generated BASENAME
...
...
@@ -247,35 +303,6 @@ if [ -n "$MIGRATEGEAR" ] ; then
exit
0
fi
# clone remote git
if
[
-n
"
$CLONEGIT
"
]
;
then
REPOPATH
=
"
$(
initial_letter
$PKGNAME
)
/
$PKGNAME
.git"
# http://git.altlinux.org/gears/N/NAME.git
RREPO
=
"/gears/
$REPOPATH
"
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
"
echo
"Remote clone from
$RREPO
..."
ssh
$GIRARHOST
clone
$RREPO
packages/
$PKGNAME
.git
||
warning
"Can't remote clone."
fi
git clone
$GIRARHOST
:packages/
$PKGNAME
.git
if
cd
$PKGNAME
;
then
CURRENTBRANCH
=
$(
get_current_branch
)
# create all branches
for
i
in
$(
git branch
-a
|
grep
-v
"/HEAD"
|
grep
"remotes/origin/"
)
;
do
git checkout
-b
$(
echo
$i
|
sed
-e
"s|remotes.*/||g"
)
$i
done
git checkout sisyphus
||
git checkout master
||
git checkout
$CURRENTBRANCH
cd
-
>
/dev/null
fi
echo
"See other repos at
$GIRARHOST
:"
list_git_package
$PKGNAME
exit
$?
fi
# lists packages for build
if
[
-n
"
$LISTREQS
"
]
;
then
print_target_buildreq
$PKGNAME
...
...
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