×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    25

    Wink There is a solution to cleaning up epoc32 quickly and perfectly.

    Hi Guys

    I have a solution to cleaning up epoc32 quickly. You know, all our programs generated by compiler are put in the epoc32. With time goes by, we should delete it to avoid implied errors, for example, there the old resource files still are, not the new one. It is a problem.

    There are 2 ways to solving it.

    No 1. Delete the whole epoc32 and get a new original copy, but I really don't recommened it. Because there is another easy and fast way to complete it.

    No 2. Use my shell script as the following:
    Code:
    #!/bin/sh
    
    find ./epoc32 -name \* > 1
    diff -f 0 1 | sed -ne '/^.\//p' | sed -e 's/^.\//rm -f -r \0/' > e.sh
    chmod 777 e.sh
    ./e.sh
    
    rm -f ./1
    rm -f ./e.sh
    Of course, it is a Linux shell script, you need install Cygwin on Windows. (Note: the base system of Cygwin doesn't include "diff", you need find it by yourself from the kinds of categories during installation.)

    Note: there is a file named "o" above, it is a index file. You need go to where your SDK is installed, for example, "C:\S60\devices\S60_3rd_FP2_SDK_v1.1\" is mine, then execute this command as follwoing on the cygwin:
    Code:
    find ./epoc32 -name \* > 0
    It will generate the file "0". Copy it into your work dir. In your work dir, there are "epoc32<DIR>", "cleanepoc.sh<Linux Shell Script includes the code above>" and "0<Index File>".

    All is ready, you can enjoy your clean epoc right now. (By the way, the execution of e.sh is a more slower operation.)

    Any improvment is appreciated. :)

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    One improvement suggestion: write this in Perl (already used by the SDK therefore available) or even in Windows/DOS batch script (.bat)
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Not the warmest reception to a voluntarily contributed useful tool!

    Please recognise that lots of people don't like or don't know Perl and it is very often not the best tool for the job. No-one should ever have to write another DOS batch file again!

    This solution is heavily dependent on external utilities - find, diff and sed. You wouldn't want to re-implement all of this in Perl. You could of course install Windows versions of these utilities (they exist) but then if you've got to install something it might as well be a more complete and rich environment than Windows provides...

    Symbian builds on Linux (via Raptor) are due very soon - I think this kind of contribution should be actively encouraged!

    Nice job - thanks for sharing it!

    Mark

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Ups! Sorry for apearing to be rejecting this contribution while sending my brief comment.

    Contributions are good in any form they come however, it would be desirable for them to integrate nicely with the SDK. Currently the SDK comes with Windows support only and Perl is a mandatory add-on. As such, any job done by a script using Perl or even batch has more chances of being adopted compared to something that would require developers to install another tools package (be it Python or Cygwin or ... ).

    In fact, all that this script does it to delete some files from a directory tree - if you guys think that you need to emulate a linux environment for that then ... well, have fun with it :) I for one think that a batch script will do, or even a couple of search/select/delete sequences in Total Commander ;)

    So, thanks Jeffrey for the contribution and thanks Mark for your comment.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Sorry Lucian, easy to mis-read one-liners.

    You're right of course that this is a very simple utility and could be done in several other ways.

    I think I've already made my opinion on having Windows as the only development platform for Symbian pretty clear elsewhere - there's no point in repeating it here. However, there's an important point about the sort of person that's likely to make public script and tools contributions - they're much more likely to be Linux users than Windows users.

    Mark

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    25

    Smile Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Thank you guys for your responses. They give me many ideas about the shell script. Frankly speaking, I love linux much more. Linux gives me more ideas on my development than Windows. Its shell is more powerful than Windows.

    I think cleaning up epoc32 is a simple job, so I don't wanna get it complicated, linux shell is a best way to do that. 3 commands can get the job done, I don't think perl and total commander can do it in this way.

  7. #7
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Some minor improvement suggestions to get rid of temporary files and work with a single pipe:
    Code:
    find ./epoc32 -name \* | diff -f 0 - | sed -ne '/^.\//p' | sed -e 's/^.\//rm -f -r \0/' | bash
    As a comment to the original issue, in some clean regular build environments I'm using, I have created images of the epoc32 directory that I can mount in read-write mode and later unmount without committing the changes. As an imaging tool, I'm using ImageX available from microsoft.com as part of the Windows AIK tools.

    Lauri

  8. #8
    Registered User
    Join Date
    Oct 2008
    Posts
    25

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    Thanks Lauri for the improvement. It seems to be more simple and more elegant than the original one. I think it is a standard linux command. :-)

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    25

    Re: There is a solution to cleaning up epoc32 quickly and perfectly.

    HI guys

    There is good news about this script. I improved it for faster speed during cleaning up EPOC. In original script, the worst part is the "sed -e 's/^.\//rm -f -r \0/' | bash". It causes the script will give a RM command to every file which needs to be removed. Every RM command is a process on Windows, and the construction and destruction of a process have to speed some time, this is why this script is not efficient.

    The new script is:
    #!/bin/sh

    find ./epoc32 -name \* | diff -f 0 - | sed -ne '/^.\//p' | xargs rm -f -r


    Our project generates 893 files (including some folders, but the almost are files) in my epoc folder. The original one completes them in 5 min 20 sec. It is so slow. But the new one done it in 12 sec amazingly.

    It is very efficient and so fast to clean up your EPOC folder, isn't it.

    Enjoy. ;-)

    BTW, My computer is Intel Pentium Dual CPU E2140 @ 1.6GHz, 2.0G of RAM on Windows XP SP3.
    Last edited by jeffreyRyang; 2009-04-15 at 12:00.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •