makefile - tar: file changed as we read it -


i using make , tar backup. when executing makefile, tar command shows file changed read it. in case,

  • the tar package ok when warning comes up
  • but stops tar command following backup
  • the file showing warning in fact doesn't change -- strange warning comes up
  • the files showing warning come randomly, mean, everytime run makefile, files showing warning different
  • --ignore-failed-read doesn't help. using tar 1.23 in mingw
  • i changed computer win7 64 bit. script works in old win7 32 bit. tar version not new 1.23.

how can stop tar's warning stop backup following warning?


edit-2: might reason

as said above, bash shell script worked in old computer. comparing old computer, msys version different. version of tar command. in old computer, tar 1.13.19 , 1.23 in new computer. copied old tar command without copying dependency msys-1.0.dll new computer , renamed tar_old. , updated tar command in shell script , run script. ok. so, seemed problem tar command. sure there no file changed when taring. bug tar command in new version? don't know.


edit-1: add more details

the backup invoked bash shell script. scans target directory , builds makefile invokes make use tar command backup. followed typical makefile built bash shell script.

#-------------------------------------------- # backup vc #-------------------------------------------- # program packing pack_tool=tar  # option packing tool pack_option=cjvf  # m$: c driver win_c_dir=c:  # m$: d driver win_d_dir=d:  # m$: software win_prg_dir=wuyu/tools # win_prg_dir=  # save backup files bakdir=/home/wu.y/ms_bak_msys  vc_framework=/home/wu.y/ms_bak_msys/tools/vc/vc_framework.tar.bz2 vc_2010=/home/wu.y/ms_bak_msys/tools/vc/vc_2010.tar.bz2  .phony:  all: $(vc_framework) $(vc_2010)  $(vc_framework): $(win_c_dir)/$(win_prg_dir)/vc/framework/*     @$(pack_tool) $(pack_option) "$@" --ignore-failed-read /c/$(win_prg_dir)/vc/framework $(vc_2010): $(win_c_dir)/$(win_prg_dir)/vc/vs2010/*     @$(pack_tool) $(pack_option) "$@" --ignore-failed-read /c/$(win_prg_dir)/vc/vs2010 

as can see, tar package stored in ~/ms_bak_msys/tools/vc/vc_2010.tar.bz2. run script in ~/qqaa. ~/ms_bak_msys excluded tar command. so, tar file creating not inside directory trying put tar file. why felt strange warning came up.

i encounter tar messages "changed read it". me these message occurred when making tar file of linux file system in bitbake build environment. error sporadic.

for me not due creating tar file same directory. assuming there file overwritten or changed during tar file creation.

the message warning , still creates tar file. can still suppress these warning message setting option

--warning=no-file-changed

(http://www.gnu.org/software/tar/manual/html_section/warnings.html )

still exit code return tar "1" in warning message case: http://www.gnu.org/software/tar/manual/html_section/synopsis.html

so if calling tar file function in scripts, can handle exit code this:

set +e  tar -czf sample.tar.gz dir1 dir2 exitcode=$?  if [ "$exitcode" != "1" ] && [ "$exitcode" != "0" ];     exit $exitcode fi set -e 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -