Author Topic: update.bat problem?  (Read 6250 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
update.bat problem?
« on: November 05, 2009, 02:24:01 am »
As we know, in Windows, you should run "update.bat" after you build the C::B.

So, my question is:

Is it possible: after building the C::B, only the updated files in "develop" folder will be copied to "output" folder.

I just found that update.bat didn't check the file time, and do the whole copy of every thing, that's always waste a lot of time. I suggest we can do the way like "make" does.

Any comments?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: update.bat problem?
« Reply #1 on: November 05, 2009, 03:00:18 am »
What file copy command are you going to use? XCOPY or ???

Edit: batch file already uses "XCOPY /D" why is it not already doing what you want?

Code
  /D:m-d-y     Copies files changed on or after the specified date.
               If no date is given, copies only those files whose
               source time is newer than the destination time.

Edit2: I am at School no easy way to verify how it currently works.

Edit3: Seems to work OK to me; the second time I run it; it finishes very fast

Tim S.
« Last Edit: November 05, 2009, 05:03:22 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: update.bat problem?
« Reply #2 on: November 05, 2009, 05:04:43 pm »
Thanks Tim for your help. I will try it tomorrow when I go to my lab.  :D

In the update.bat file, there is some code

Code
set ZIPCMD=zip

echo Packing core UI resources
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\resources.zip src\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\manager_resources.zip sdk\resources\*.xrc sdk\resources\images\*.png > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\start_here.zip src\resources\start_here\*.* > nul
echo Packing plugins UI resources
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\astyle.zip plugins\astyle\resources\manifest.xml plugins\astyle\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\autosave.zip plugins\autosave\manifest.xml plugins\autosave\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\classwizard.zip plugins\classwizard\resources\manifest.xml plugins\classwizard\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\codecompletion.zip plugins\codecompletion\resources\manifest.xml plugins\codecompletion\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\compiler.zip plugins\compilergcc\resources\manifest.xml plugins\compilergcc\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\debugger.zip plugins\debuggergdb\resources\manifest.xml plugins\debuggergdb\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\defaultmimehandler.zip plugins\defaultmimehandler\resources\manifest.xml plugins\defaultmimehandler\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\openfileslist.zip plugins\openfileslist\manifest.xml > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\projectsimporter.zip plugins\projectsimporter\resources\manifest.xml plugins\projectsimporter\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\scriptedwizard.zip plugins\scriptedwizard\resources\manifest.xml > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\todo.zip plugins\todo\resources\manifest.xml plugins\todo\resources\*.xrc > nul
%ZIPCMD% -jqu9 %CB_DEVEL_RESDIR%\xpmanifest.zip plugins\xpmanifest\manifest.xml > nul
echo Packing core UI bitmaps
cd src\resources
%ZIPCMD% -0 -qu ..\..\%CB_DEVEL_RESDIR%\resources.zip images\*.png images\16x16\*.png > nul
cd ..\..\sdk\resources
%ZIPCMD% -0 -qu ..\..\%CB_DEVEL_RESDIR%\manager_resources.zip images\*.png > nul
echo Packing plugins UI bitmaps
cd ..\..\plugins\compilergcc\resources
%ZIPCMD% -0 -qu ..\..\..\%CB_DEVEL_RESDIR%\compiler.zip images\*.png images\16x16\*.png > nul
cd ..\..\..\plugins\debuggergdb\resources
%ZIPCMD% -0 -qu ..\..\..\%CB_DEVEL_RESDIR%\debugger.zip images\*.png images\16x16\*.png > nul
cd ..\..\..

it seems the zip command will always run?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: update.bat problem?
« Reply #3 on: November 05, 2009, 06:05:54 pm »
Code
  -u   update: only changed or new files
  -0   store only
  -1   compress faster              
  -9   compress better

I suggest trying -0 or -1 instead of -9

Edit: above is for faster operation.
Someone tried using 7Zip and posted it somewhere on this site.



Tim S.
« Last Edit: November 05, 2009, 06:15:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: update.bat problem?
« Reply #4 on: November 05, 2009, 06:36:03 pm »
it seems the zip command will always run?

Yes, but notice the u-parameter, it means update, only newer (or not existant) files are added/replaced to in zip-file.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: update.bat problem?
« Reply #5 on: November 10, 2009, 02:56:13 pm »
it seems the zip command will always run?

Yes, but notice the u-parameter, it means update, only newer (or not existant) files are added/replaced to in zip-file.

Sorry for the late reply. And thanks for the explanation, Jens and stahta01. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: update.bat problem?
« Reply #6 on: November 16, 2009, 08:24:50 am »
Hi, all, it seems there are still something wrong in the update.bat.

About two days ago, I built the SVN code, and run update.bat. After that, I haven't built the C::B again.

Today, I check the file in F:\cb_svn\src\output, all the exe file and dll files show the "data modified" information as two days ago.

As expected, update.bat should run and exit doing nothing, because no files were updated.

But the actually thing is: I run the update.bat, it still take a while to finish, and all the files in F:\cb_svn\src\output were updated, now these files show "data modified" as today.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: update.bat problem?
« Reply #7 on: November 16, 2009, 08:30:20 am »
That's due to the strip command, it touches all executables and libraries and tries to strip sy,bols.
The zip-files (e.g.) should be untouched, at least they are here (WinXP SP3).

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: update.bat problem?
« Reply #8 on: November 16, 2009, 08:37:19 am »
That's due to the strip command, it touches all executables and libraries and tries to strip sy,bols.
The zip-files (e.g.) should be untouched, at least they are here (WinXP SP3).
Yes, that's true.
But:
Is there a mechanism that letting the strip command only apply on the updated DLL or EXE files?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: update.bat problem?
« Reply #9 on: November 16, 2009, 08:54:19 am »
That's due to the strip command, it touches all executables and libraries and tries to strip sy,bols.
The zip-files (e.g.) should be untouched, at least they are here (WinXP SP3).
Yes, that's true.
But:
Is there a mechanism that letting the strip command only apply on the updated DLL or EXE files?

I don't think, that there is a mechanism to tell strip reliable, that a file does not contain symbols.
That means it has to touch it always, and always scan for symbols, but it does not need to write it back to hdd if it does nothing, but that's a strip-thing and I don't know a parameter to avoid it.