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
fd825c2e
Commit
fd825c2e
authored
Aug 11, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use mktemp for temp files
parent
3c1efe94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
18 deletions
+24
-18
rpmcs
bin/rpmcs
+2
-1
common
share/eterbuild/functions/common
+2
-2
rpm
share/eterbuild/functions/rpm
+1
-1
spec
share/eterbuild/functions/spec
+19
-14
No files found.
bin/rpmcs
View file @
fd825c2e
...
...
@@ -178,10 +178,11 @@ do
test
-s
$SPEC
||
fatal
"Cannot find spec file '
$SPEC
'"
SPECTMP
=
$(
mktemp
)
# Add group
if
!
grep
"^Group"
$SPEC
;
then
PACKAGT
=
"Group: Unknown"
cat
$SPEC
|
awk
'BEGIN{desk=0}{if(/^U[rR][lL]/&&desk==0){printf("%s\n", text);desk++};print}'
text
=
"
$PACKAGT
"
>
$SPEC
.tmp
&&
mv
-f
$SPEC
.tmp
$SPEC
cat
$SPEC
|
awk
'BEGIN{desk=0}{if(/^U[rR][lL]/&&desk==0){printf("%s\n", text);desk++};print}'
text
=
"
$PACKAGT
"
>
$SPEC
TMP
&&
mv
-f
$SPECTMP
$SPEC
fi
# Prepare for fix only before changelog part
...
...
share/eterbuild/functions/common
View file @
fd825c2e
...
...
@@ -102,9 +102,9 @@ remove_file_from_remove()
store_output
()
{
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
$(
m
ktemp
)
RC_STDOUT
=
$(
m
ake_temp_file
)
mark_file_to_remove
$RC_STDOUT
#RC_STDERR=$(m
ktemp
)
#RC_STDERR=$(m
ake_temp_file
)
"
$@
"
2>&1 |
tee
$RC_STDOUT
# http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF
return
$PIPESTATUS
...
...
share/eterbuild/functions/rpm
View file @
fd825c2e
...
...
@@ -35,7 +35,7 @@ build_rpms_name()
shift
test
-f
"
$NAMESPEC
"
||
fatal
"Spec
$NAMESPEC
does not exist"
tmprpm
=
`
make_temp_file
$NAME
`
tmprpm
=
$(
make_temp_file
$NAME
)
# Optimization
eval_spec
$NAMESPEC
$@
|
grep
":"
>
$tmprpm
BASENAME
=
$(
cat
$tmprpm
| get_var
"Name"
)
...
...
share/eterbuild/functions/spec
View file @
fd825c2e
...
...
@@ -21,9 +21,11 @@ eval_spec()
# Drop changelog and make spec copy
# see http://bugs.etersoft.ru/show_bug.cgi?id=6588
mark_file_to_remove
$SPECNAME
.tmp
$SPECNAME
.changelog
separate_changelog
$SPECNAME
$SPECNAME
.tmp
$SPECNAME
.changelog
SPEC
=
$SPECNAME
.tmp
SPECNAMETMP
=
$(
make_temp_file
)
SPECNAMECHANGELOG
=
$(
make_temp_file
)
mark_file_to_remove
$SPECNAMETMP
$SPECNAMECHANGELOG
separate_changelog
$SPECNAME
$SPECNAMETMP
$SPECNAMECHANGELOG
SPEC
=
$SPECNAMETMP
USEARCH
=
# FIXME: rpm on 64bit ALT has no macros for ix86 arch
...
...
@@ -39,11 +41,11 @@ eval_spec()
# on ALT we have to done without errors
$USEARCH
$RPMBUILD
-bE
--target
$SYSARCH
$RPMBUILDARG
$SPEC
| iconv
-f
utf8
-r
||
fatal
"Check spec's fields"
else
(
$USEARCH
$RPMBUILD
-bE
--target
$SYSARCH
$RPMBUILDARG
$SPEC
2>/dev/null
||
cat
$SPEC
)
| iconv
-f
utf8
(
$USEARCH
$RPMBUILD
-bE
--target
$SYSARCH
$RPMBUILDARG
$SPEC
2>/dev/null
||
cat
$SPEC
)
| iconv
-f
utf8
fi
# FIXME: hack for koi8-r in spec (grep will not work with it)
[
-n
"
$DEBUG
"
]
||
rm
-f
$SPECNAME
.tmp
$SPECNAME
.changelog
remove_file_from_remove
$SPECNAME
.tmp
$SPECNAME
.changelog
[
-n
"
$DEBUG
"
]
||
rm
-f
$SPECNAME
TMP
$SPECNAMECHANGELOG
remove_file_from_remove
$SPECNAME
TMP
$SPECNAMECHANGELOG
}
get_release
()
...
...
@@ -351,11 +353,14 @@ remove_bashism()
local
SPECNAME
=
"
$1
"
test
-w
"
$SPECNAME
"
||
fatal
"File '
$SPECNAME
' is missed or read only"
separate_changelog
$SPECNAME
$SPECNAME
.main
$SPECNAME
.changelog
local
SPECNAMETMP
=
$(
make_temp_file
)
local
SPECNAMEMAIN
=
$(
make_temp_file
)
local
SPECNAMECHANGELOG
=
$(
make_temp_file
)
separate_changelog
$SPECNAME
$SPECNAMEMAIN
$SPECNAMECHANGELOG
subst
"s|^pushd
\(
.*
\)
|cd
\1
>/dev/null|g"
$SPECNAME
.main
subst
"s|^popd|cd - >/dev/null|g"
$SPECNAME
.main
subst
"s|^echo -e '
\\\n
'|echo ''|g"
$SPECNAME
.main
subst
"s|^pushd
\(
.*
\)
|cd
\1
>/dev/null|g"
$SPECNAME
MAIN
subst
"s|^popd|cd - >/dev/null|g"
$SPECNAME
MAIN
subst
"s|^echo -e '
\\\n
'|echo ''|g"
$SPECNAME
MAIN
# {1,2} translation
# FIXME: miss first spaces
...
...
@@ -364,12 +369,12 @@ remove_bashism()
rs
=
"
$(
echo
"
$n
"
| perl
-pe
"s|.*
\s
(.*?{.*?}.*?)
\s
.*|
\1
|g"
)
"
res
=
$(
eval echo
"
$rs
"
)
echo
"
$n
"
| perl
-pe
"s|
$rs
|
$res
|g"
done
<
$SPECNAME
.main
>
$SPECNAME
.tmp
[
-s
"
$SPECNAME
.tmp"
]
&&
mv
-f
$SPECNAME
.tmp
$SPECNAME
done
<
$SPECNAME
MAIN
>
$SPECNAMETMP
[
-s
"
$SPECNAME
TMP
"
]
&&
mv
-f
$SPECNAMETMP
$SPECNAME
$EPMCMD
assure checkbashisms
docmd checkbashisms
$SPECNAME
cat
$SPECNAME
.changelog
>>
$SPECNAME
rm
-f
$SPECNAME
.main
$SPECNAME
.changelog
cat
$SPECNAME
CHANGELOG
>>
$SPECNAME
rm
-f
$SPECNAME
MAIN
$SPECNAMECHANGELOG
}
get_last_changelog
()
...
...
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