Use 2 vars for destinations (one for default and another for hardened).

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
This commit is contained in:
Jorge Manuel B. S. Vicetto (jmbsvicetto) 2017-12-22 11:02:44 +00:00
parent cb879a382e
commit 3190fadba2
2 changed files with 32 additions and 20 deletions

View file

@ -92,35 +92,41 @@ post_build() {
--delay-updates
)
case $HOSTNAME in
nightheron) DEST=${BUILD_DESTDIR_BASE} ;;
*) DEST=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE} ;;
nightheron)
DEST_DEFAULT=${BUILD_DESTDIR_BASE}
DEST_HARDENED=${BUILD_DESTDIR_BASE}/hardened
;;
*
DEST_DEFAULT=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}
DEST_HARDENED=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}/hardened
;;
esac
pushd ${BUILD_SRCDIR_BASE}/default >/dev/null
mkdir -p ${TMPDIR}/empty
"${cmd[@]}" ${TMPDIR}/empty ${DEST}
"${cmd[@]}" ${TMPDIR}/empty ${DEST_DEFAULT}
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
if [ -f $file ]; then
"${cmd[@]}" ${file}* ${DEST}
"${cmd[@]}" ${file}* ${DEST_DEFAULT}
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_DEFAULT}
elif [ -f *${TIMESTAMP}*.iso ]; then
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_DEFAULT}
fi
popd >/dev/null
pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null
"${cmd[@]}" ${TMPDIR}/empty ${DEST}/hardened
"${cmd[@]}" ${TMPDIR}/empty ${DEST_HARDENED}
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
if [ -f $file ]; then
"${cmd[@]}" $file* ${DEST}/hardened
"${cmd[@]}" $file* ${DEST_HARDENED}
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}/hardened
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_HARDENED}
elif [ -f *${TIMESTAMP}*.iso ]; then
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}/hardened
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_HARDENED}
fi
}

View file

@ -63,35 +63,41 @@ post_build() {
--delay-updates
)
case $HOSTNAME in
nightheron) DEST=${BUILD_DESTDIR_BASE} ;;
*) DEST=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE} ;;
nightheron)
DEST_DEFAULT=${BUILD_DESTDIR_BASE}
DEST_HARDENED=${BUILD_DESTDIR_BASE}/hardened
;;
*)
DEST_DEFAULT=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}
DEST_HARDENED=${ARCH}@nightheron.gentoo.org:${BUILD_DESTDIR_BASE}/hardened
;;
esac
pushd ${BUILD_SRCDIR_BASE}/default >/dev/null
mkdir -p ${TMPDIR}/empty
"${cmd[@]}" ${TMPDIR}/empty ${DEST}
"${cmd[@]}" ${TMPDIR}/empty ${DEST_DEFAULT}
for file in $(ls stage{3,4}*{${DATESTAMP},${TIMESTAMP}}*${EXTENSIONS} ); do
if [ -f $file ]; then
"${cmd[@]}" ${file}* ${DEST}
"${cmd[@]}" ${file}* ${DEST_DEFAULT}
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_DEFAULT}
elif [ -f *${TIMESTAMP}*.iso ]; then
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_DEFAULT}
fi
popd >/dev/null
pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null
"${cmd[@]}" ${TMPDIR}/empty ${DEST}/hardened
"${cmd[@]}" ${TMPDIR}/empty ${DEST_HARDENED}
for file in $(ls stage{3,4}*{${DATESTAMP},${TIMESTAMP}}*${EXTENSIONS} ); do
if [ -f $file ]; then
"${cmd[@]}" $file* ${DEST}/hardened
"${cmd[@]}" $file* ${DEST_HARDENED}
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST}/hardened
"${cmd[@]}" *${DATESTAMP}*.iso* ${DEST_HARDEND}
elif [ -f *${TIMESTAMP}*.iso ]; then
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST}/hardened
"${cmd[@]}" *${TIMESTAMP}*.iso* ${DEST_HARDENED}
fi
}