- cd / && tar cf /install/packages/package/files --files-from=/install/packages/package/ROOTFILES --exclude='#*'
- -cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/package/ROOTFILES
+ cd / && tar cf /install/packages/package/files.tmp --files-from=/install/packages/package/ROOTFILES --exclude='#*' \
+ -p --numeric-owner
+ # Double tar to remove double files
+ tar xf /install/packages/package/files.tmp -C /install/packages/package/tmp/ \
+ -p --numeric-owner
+ rm -f /install/packages/package/files.tmp
+ cd /install/packages/package/tmp/ && tar -c -p --numeric-owner -f /install/packages/package/files *
+ rm -r /install/packages/package/tmp
+ -cat /install/packages/package/ROOTFILES | grep -v "#" > /install/packages/package/ROOTFILES.tmp
+ mv /install/packages/package/ROOTFILES.tmp /install/packages/package/ROOTFILES