File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 8080# b) do not sign the packages
8181# c) use half of the available processors
8282#
83- : ${NPROC:= $(($(nproc) / 2))}
84- if test $NPROC -gt 1 ; then
85- j=-j${NPROC}
83+ : ${NPROC:= $(nproc)}
84+ RAM_MB=$( vmstat --stats --unit m | grep ' total memory' | awk ' {print $1}' )
85+ if test " $NPROC " -gt 50; then
86+ MAX_JOBS=$(( ${RAM_MB} / 4000 ))
87+ else
88+ MAX_JOBS=$(( ${RAM_MB} / 3000 ))
89+ fi
90+ if test " $NPROC " -gt " $MAX_JOBS " ; then
91+ JOBS_FLAG=" -j${MAX_JOBS} "
92+ else
93+ JOBS_FLAG=" -j${NPROC} "
8694fi
8795if [ " $SCCACHE " != " true" ] ; then
8896 PATH=/usr/lib/ccache:$PATH
8997fi
90- PATH=$PATH dpkg-buildpackage $j -uc -us
98+ PATH=$PATH dpkg-buildpackage $JOBS_FLAG -uc -us
9199cd ../..
92100mkdir -p $VERSION_CODENAME /conf
93101cat > $VERSION_CODENAME /conf/distributions << EOF
You can’t perform that action at this time.
0 commit comments