Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Docker Build Images
scripts
Commits
bbd44f6b
Commit
bbd44f6b
authored
Sep 01, 2019
by
Markus Frosch
Browse files
Avoid ccache dir being created when not used
Also clean an empty ccache dir.
parent
65038999
Pipeline
#5171
passed with stage
in 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
icinga-build-deb-binary
View file @
bbd44f6b
...
...
@@ -17,7 +17,9 @@ fi
# reset ccache statistics
# so we now the statistics of the new build
ccache
-z
# (--zero-stats)
if
[
-d
"
${
CCACHE_DIR
}
"
]
;
then
ccache
-z
# (--zero-stats)
fi
# use eatmydata if present
eatmydata
=
...
...
@@ -70,9 +72,17 @@ echo "[ Building binary package ]"
dpkg-buildpackage
-rfakeroot
-uc
-us
$binopts
)
echo
"[ ccache stats ]"
ccache
-s
|
tee
build/ccache-stats.txt
# (--show-stats)
echo
if
[
-d
"
${
CCACHE_DIR
}
"
]
;
then
cached_files
=
"
$(
find
"
${
CCACHE_DIR
}
"
-type
f
!
-name
ccache.conf
!
-name
stats |
wc
-l
)
"
if
[
"
$cached_files
"
-eq
0
]
;
then
echo
"Removing empty ccache dir:
${
CCACHE_DIR
}
"
rm
-rf
"
${
CCACHE_DIR
}
"
else
echo
"[ ccache stats ]"
ccache
-s
|
tee
build/ccache-stats.txt
# (--show-stats)
echo
fi
fi
echo
"[ Running Lintian ]"
(
...
...
icinga-build-rpm-binary
View file @
bbd44f6b
...
...
@@ -63,12 +63,13 @@ if command -v ccache &>/dev/null; then
echo
"[ Preparing ccache for our environment ]"
export
CCACHE_DIR
=
"
${
WORKDIR
}
/ccache"
rm
-f
ccache.stats
test
-d
"
${
CCACHE_DIR
}
"
||
mkdir
"
${
CCACHE_DIR
}
"
preconfigure_ccache
# reset ccache statistics
# so we now the statistics of the new build
ccache
-z
# (--zero-stats)
if
[
-d
"
${
CCACHE_DIR
}
"
]
;
then
ccache
-z
# (--zero-stats)
fi
fi
echo
"[ Building binary package ]"
...
...
@@ -88,10 +89,16 @@ eval "$(get_rpmbuild --rebuild "${source_rpm}")"
fi
)
if
command
-v
ccache &>/dev/null
;
then
echo
"[ ccache stats ]"
ccache
-s
|
tee
build/ccache-stats.txt
# (--show-stats)
echo
if
command
-v
ccache &>/dev/null
&&
[
-d
"
${
CCACHE_DIR
}
"
]
;
then
cached_files
=
"
$(
find
"
${
CCACHE_DIR
}
"
-type
f
!
-name
ccache.conf
!
-name
stats |
wc
-l
)
"
if
[
"
$cached_files
"
-eq
0
]
;
then
echo
"Removing empty ccache dir:
${
CCACHE_DIR
}
"
rm
-rf
"
${
CCACHE_DIR
}
"
else
echo
"[ ccache stats ]"
ccache
-s
|
tee
build/ccache-stats.txt
# (--show-stats)
echo
fi
fi
echo
"[ Running rpmlint ]"
...
...
Write
Preview
Supports
Markdown
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