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
c2e9b6f4
Commit
c2e9b6f4
authored
Jun 02, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: introduce usearg and use it
parent
5e68e28b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
rpmbs
bin/rpmbs
+1
-2
common
share/eterbuild/functions/common
+10
-0
test_usearg.sh
tests/test_usearg.sh
+15
-0
No files found.
bin/rpmbs
View file @
c2e9b6f4
...
...
@@ -232,8 +232,7 @@ if [ -n "$UPLOADNOW" ] && is_gear $SPECDIR ; then
if
[
-n
"
$TASKNUMBER
"
]
;
then
docmd ssh
$GIRARHOST
task add
$TASKNUMBER
repo
$PROJECTNAME
$TAG
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
else
[
-n
"
$POCKET
"
]
&&
POCKETARG
=
"-p
$POCKET
"
||
POCKETARG
=
""
docmd ssh
$GIRARHOST
build
-b
$BINARYREPO
$POCKETARG
$PROJECTNAME
$TAG
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
docmd ssh
$GIRARHOST
build
-b
$BINARYREPO
$(
usearg
-p
$POCKET
)
$PROJECTNAME
$TAG
2>&1 |
tee
$RPMDIR
/uploaded.log.tmp
fi
# FIXME: incorporate
cat
$RPMDIR
/uploaded.log.tmp |
grep
task |
head
-n2
|
tail
-n1
>>
$RPMDIR
/uploaded.log
...
...
share/eterbuild/functions/common
View file @
c2e9b6f4
...
...
@@ -312,3 +312,13 @@ showcmd()
echo
"
\$
$@
"
SETCOLOR_NORMAL
}
# Example: $ command $(usearg -d "$PARAM")
# will add -d "$PARAM" if $PARAM is not empty
usearg
()
{
local
ARG
=
$1
shift
[
-n
"
$1
"
]
&&
echo
"
$ARG
$@
"
}
tests/test_usearg.sh
0 → 100755
View file @
c2e9b6f4
#!/bin/sh
.
`
dirname
$0
`
/../share/eterbuild/functions/common
#load_mod spec
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$2
' do not match with '
$3
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
echo
"
$(
usearg
-f
TEST
)
"
echo
"
$(
usearg
-f
TEST MORE
)
"
echo
"
$(
usearg
-f
$TEST
)
"
TEST
=
124
echo
"
$(
usearg
-f
$TEST
)
"
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