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
9f3654f1
Commit
9f3654f1
authored
Mar 10, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new mode to loginhsh: -a for run from rpmbsh
fix arg handling in loginhsh
parent
881a2f43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
25 deletions
+28
-25
loginhsh
bin/loginhsh
+23
-18
myhsh
bin/myhsh
+2
-4
rpmbsh
bin/rpmbsh
+3
-3
No files found.
bin/loginhsh
View file @
9f3654f1
...
...
@@ -32,17 +32,20 @@ phelp()
echog
" -i - initialize hasher"
echog
" -c - cleanup hasher"
echog
" -o - log in as root user"
echog
" -t - use test hasher dir"
echog
" -r - remote login to hasher"
echog
" -t - use test hasher dir (different to build hasher)"
echog
" -M?? - branch name"
echog
"Extra options:"
echog
" -a - auto test mode for post myhsh build checking"
echog
" -r - remote login to hasher"
}
while
getopts
:chito opt
;
do
while
getopts
:chito
a
opt
;
do
case
$opt
in
h
)
phelp
;
exit
0
;;
t
)
TESTMODE
=
1
;;
i
)
INITIALIZE
=
1
;;
c
)
CLEANUP
=
1
;;
a
)
AUTOMODE
=
1
;;
r
)
REMOTE
=
1
;;
o
)
ROOTER
=
"--rooter"
;;
+?
)
echog
"
$name
: options should not be preceded by a '+'."
1>&2
;
exit
2
;;
...
...
@@ -52,7 +55,7 @@ while getopts :chito opt; do
done
# remove args that were options
if
[
$#
-gt
0
]
;
then
if
[
$#
-gt
0
]
;
then
shift
$((
OPTIND
-
1
))
fi
...
...
@@ -61,34 +64,33 @@ LISTRPMARGS=$@
parse_cmd_pre
"
$@
"
--
set_hasherdir
[
-n
"
$TESTMODE
"
]
&&
HASHERDIR
=
$HASHERDIR
-test
if
[
-n
"
$TESTMODE
"
]
||
[
-n
"
$AUTOMODE
"
]
;
then
HASHERDIR
=
$HASHERDIR
-test
fi
mygetopts
$LISTARGS
# export OURAPTCONF with temp. file contains correct path to sources.list
prepare_aptconfig
HASHERARG
=
"
$HASHERARG
--apt-config=
$OURAPTCONF
--target
$DEFAULTARCH
"
mygetopts
$LISTARGS
set_hasherdir
if
[
-n
"
$TESTMODE
"
]
||
[
-n
"
$AUTOMODE
"
]
;
then
HASHERDIR
=
$HASHERDIR
-test
fi
if
[
-n
"
$REMOTE
"
]
;
then
check_key
test
-n
"
$BUILDSERVER
"
||
fatal
"Please set BUILDSERVER in config file"
ssh
-t
$BUILDSERVER
loginhsh
${
SAVEOPT
/-r/
}
exit
0
exit
fi
if
[
"
$CLEANUP
"
=
"1"
]
;
then
echog
"Cleanup
$HASHERDIR
..."
if
[
"
$CLEANUP
"
=
"1"
]
;
then
echog
"Cleanup
hasher in
$HASHERDIR
..."
$HSH
--cleanup-only
$HASHERDIR
$HASHERARG
||
fatal
"cleanup"
exit
0
exit
fi
if
[
!
-d
$HASHERDIR
-o
"
$INITIALIZE
"
=
"1
"
]
;
then
if
[
!
-d
$HASHERDIR
]
||
[
"
$INITIALIZE
"
=
"1"
]
||
[
-n
"
$AUTOMODE
"
]
;
then
echog
"Initialize
$HASHERDIR
..."
mkdir
-p
$HASHERDIR
&&
$HSH
$HASHERARG
--initroot-only
$HASHERDIR
||
fatal
"mkdir"
fi
...
...
@@ -107,11 +109,14 @@ else
UTILPKG
=
"
$UTILPKG
etersoft-build-utils"
fi
$HSH
-install
$HASHERDIR
--wait-lock
$UTILPKG
$LISTRPMARGS
$LISTNAMES
||
fatal
"Error with install"
echog
"You are in hasher shell"
$HSH
-shell
$HASHERDIR
$SHELLHASHERARG
$ROOTER
-Y
--shell
if
[
-n
"
$TESTMODE
"
]
;
then
if
[
-n
"
$AUTOMODE
"
]
;
then
# FIXME: do not remove on x86_64
echo
"Remove package for test preun scripts"
$HSH
-run
--rooter
$HASHERDIR
--
rpm
-e
$(
drop_pkg_extensions
$LISTNAMES
)
echo
"Cleanup hasher..."
echo
"Cleanup hasher
in
$HASHERDIR
..."
$HSH
--cleanup-only
$HASHERDIR
fi
bin/myhsh
View file @
9f3654f1
...
...
@@ -99,7 +99,7 @@ do
# Note: hasher is already use renice for low priority
(
$HSH
$HASHERARG
--build-args
"
$BUILDARGS
"
--
$HASHERDIR
$i
2>&1
||
touch
$LOGFILE
.failed
)
|
tee
-a
$LOGFILE
test
-L
$HASHERDIR
/BUILD
||
ln
-s
chroot
/usr/src/RPM/BUILD
$HASHERDIR
/
if
[
-f
$LOGFILE
.failed
]
;
then
if
[
-f
$LOGFILE
.failed
]
;
then
RESULT
=
1
break
fi
...
...
@@ -122,8 +122,6 @@ fi
print_list
$LISTBUILTSH
echo
if
[
"
$RESULT
"
=
"0"
-a
-n
"
$TESTINSTALL
"
]
;
then
# test install (only for last package in list)
# some key for build hasher from scratch
...
...
@@ -132,7 +130,7 @@ if [ "$RESULT" = "0" -a -n "$TESTINSTALL" ] ; then
test
-n
"
$BINPACKAGES
"
||
fatal
"Can't find binary packages for
$LASTPACKAGE
in
`
ls
-l
$HASHERDIR
/repo/
$DEFAULTARCH
/RPMS.hasher
`
"
echo
"List:
$BINPACKAGES
"
echo
$ETERBUILDBIN
/loginhsh
-t
-i
$MENVARG
$BINPACKAGES
||
exit
1
exec
$ETERBUILDBIN
/loginhsh
-a
$MENVARG
$BINPACKAGES
fi
exit
$RESULT
bin/rpmbsh
View file @
9f3654f1
...
...
@@ -112,14 +112,14 @@ else
echo
"-------------------------------"
fi
# make src.rpm if build OK and we have options for rpmbs
RPMBSARGS
=
$(
drop_args
"
$LISTRPMARGS
"
i c l
)
if
[
!
"
$RESULT
"
=
"0"
]
||
[
-z
"
$RPMBSARGS
"
]
;
then
exit
$RESULT
fi
# make src.rpm if build OK and we have options for rpmbs
is_gear
$SPECDIR
&&
TSKLIST
=
$LISTNAMES
||
TSKLIST
=
$LISTBUILT
$ETERBUILDBIN
/rpmbs
$GIRARHOST
$MENVARG
$RPMBSARGS
$TSKLIST
exec
$ETERBUILDBIN
/rpmbs
$GIRARHOST
$MENVARG
$RPMBSARGS
$TSKLIST
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