recreate archive if git cmd available (not Buildsys) and if archive not in git

This commit is contained in:
Jean-Philippe Pialasse 2024-09-19 01:53:37 -04:00
parent 9fbbedec84
commit 7fc85f24aa

View File

@ -250,16 +250,20 @@ endif
# Create the .tar.gz or whatever file # Create the .tar.gz or whatever file
$(ARCHIVEFILE): $(ARCHIVEFILE):
ifneq (, $(shell which git))
$(info create or update ${ARCHIVEFILE} archive) $(info create or update ${ARCHIVEFILE} archive)
@mkdir -p "${TEMPDIR}/${TREEPATH}" ;\ @mkdir -p "${TEMPDIR}/${TREEPATH}" ;\
if [ -d ${CODEDIR} ] ; then cp -R "${CODEDIR}" "${TEMPDIR}/${TREEPATH}" ; fi ; \ if [ -d ${CODEDIR} ] ; then cp -R "${CODEDIR}" "${TEMPDIR}/${TREEPATH}" ; fi ; \
if [ -e createlinks ] ; then cp createlinks "${TEMPDIR}/${TREEPATH}/." ; fi ; \ if [ -e createlinks ] ; then cp createlinks "${TEMPDIR}/${TREEPATH}/." ; fi ; \
if [ -d additional ] ; then cp -r additional/* "${TEMPDIR}/${TREEPATH}/." ; fi ; \ if [ -d additional ] ; then cp -r additional/* "${TEMPDIR}/${TREEPATH}/." ; fi ; \
find "${TEMPDIR}/${TREEPATH}/." -type f -name ".gitignore" -delete ; \ find "${TEMPDIR}/${TREEPATH}/." -type f -name ".gitignore" -delete ; \
rm -f ${ARCHIVEFILE} ;\ git ls-files --error-unmatch ${ARCHIVEFILE} 2>/dev/null || rm -f ${ARCHIVEFILE} ;\
tar -caf "${ARCHIVEFILE}" -C "${TEMPDIR}" "${TREEPATH}" ;\ git ls-files --error-unmatch ${ARCHIVEFILE} 2>/dev/null || tar -caf "${ARCHIVEFILE}" -C "${TEMPDIR}" "${TREEPATH}" ;\
ls -l ${ARCHIVEFILE} ;\ ls -l ${ARCHIVEFILE} ;\
rm -Rf "${TEMPDIR}/${TREEPATH}/" rm -Rf "${TEMPDIR}/${TREEPATH}/"
else
$(info git not available, keeping archive ${ARCHIVEFILE} as is (buildsystem mock?))
endif
test-srpm: srpm test-srpm: srpm