|
|||||||||||||||
|
|||||||||||||||
|
This is a dangerous script. Please make backups. Lipo Wrapper 1.0 is a Python script wrapping some ease of use functionality around the Apple 'lipo' program. The lipo binary is used to work on 'Universal Binaries' that may possibly contain PPC code. PPC code isn't harmful to your system, but if you have an Intel chipset it is extra baggage. Most Universal Binaries can be shrunk by about 60%. Lipo Wrapper is distributed under a BSD License.
Try it out first using test files so you know what to expect later. Copy some test files: mkdir $HOME/Desktop/bin cp /usr/bin/* $HOME/Desktop/bin Run through the test files and cache a new file list: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --print-files This command tells the lipo_wrapper.py to examine all the files in the test directory and list the ones that have ppc code in them. A new cache file will be written on this first run. Next you want to make backups of your files: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --make-backups This command makes a backup copy of your files. For each file to be operated on, a copy of the file will be made in the same directory and named the same but with a '.bak' file extension. If you want to make a more solid backup you can run something like this: mkdir $HOME/Desktop/backups for x in `python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --print-files`; do \ cp $x $HOME/Desktop/backups done These commands will copy your test files to another backup directory just in case. You seriously need to consider doing this when you run against your system directories as root later. Have a look at your backups: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --print-backups Take this opportunity to backup your backups: for x in `python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --print-backups`; do \ cp $x $HOME/Desktop/backups done After all your backups are safely tucked away, proceed with shrinking the files: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --skrink-files This command makes ppc-clean versions of your files. At this point I would suggest trying to run some of the new files to make sure they work. Here is how to restore the original files if things seem b0rken: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --restore-backups This command will copy the original files from their backups back over top of the ppc-cleaned files. Remove the backups: python lipo_wrapper.py \ --directory=$HOME/Desktop/bin \ --verbose \ --kill-backups This command will remove all traces of your old files. After you're all practiced up you can leave off the --directory option in each of the above commands and let the lipo_wrapper.py run on your root file system '/'. Please make sure you made backups before however. |
|
||||||||||||||
|
|||||||||||||||