Page MenuHomeFreeBSD

Makefile.inc1: simplify handling of ObsoleteFiles
AbandonedPublic

Authored by eadler on Apr 20 2015, 7:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 1 2024, 2:09 AM
Unknown Object (File)
Sep 11 2023, 1:21 PM
Unknown Object (File)
Aug 27 2023, 2:34 PM
Unknown Object (File)
Feb 28 2023, 6:07 AM
Unknown Object (File)
Feb 11 2023, 10:08 PM
Unknown Object (File)
Apr 21 2017, 5:46 PM
Unknown Object (File)
Apr 13 2017, 8:17 AM
Unknown Object (File)
Apr 12 2017, 3:14 AM
Subscribers

Details

Reviewers
imp
mat
Summary

This is the first step to combining the logic of all the check and delete old targets. These should be generalized to: list of stuff to check for, command to print/remove them, and should rely...

Test Plan
%yes no| make -m .../share/mk delete-old 2>&1 L
%yes no| make -m .../share/mk delete-old-files 2>&1 L
%make -m .../share/mk check-old
%make -m .../share/mk check-old-files

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

eadler retitled this revision from to Makefile.inc1: simplify handling of ObsoleteFiles This is the first step to combining the logic of all the check and delete old targets. These should be generalized to: list of stuff to check for, command to print/remove them, and should rely....
eadler updated this object.
eadler edited the test plan for this revision. (Show Details)
eadler retitled this revision from Makefile.inc1: simplify handling of ObsoleteFiles This is the first step to combining the logic of all the check and delete old targets. These should be generalized to: list of stuff to check for, command to print/remove them, and should rely... to Makefile.inc1: simplify handling of ObsoleteFiles.Apr 20 2015, 7:20 PM
eadler updated this object.
eadler added a reviewer: imp.

Like that ?

Makefile.inc1
1917–1933
delete-check-old-files: .SILENT
        echo ">>> ${PRE_MESSAGE}"
.        for OFILE in ${OLD_FILES}
.                if exists(${DESTDIR}/${OFILE})
.if make(delete-old-files) || make(delete-old)
			chflags noschg "${OFILE}" 2>/dev/null || true; \
		        	rm ${RM_I} "${OFILE}"
.else
			echo ${OFILE}
.endif

.                endif
.        endfor
Makefile.inc1
1917–1933

Or maybe

REMOVE_FILE=sh -c 'chflags noschg "$$1" 2>/dev/null || true; \
      rm ${RM_I} "$$1"' --

and then just do ${REMOVE_FILE} ${OFILE}

Makefile.inc1
1917–1933

I didn't know that syntax worked, and is pretty much exactly what I wanted. Thanks!

eadler updated this object.

with mat's help get rid of ugly XXX hack

update other usage of REMOVE_FILE_COMMAND