[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[News.eclipse.foundation] Re: Call for discussion: "User experience" project

Hi,

Some random thoughts again...

- Repackaging eclipse .jar files with pack200/gz, pack200/bz2 and using .tar.gz or .tar.bz2 (depending on filesize) instead of .zip would reduce the normal download size by 45%-60% (tried most callisto parts). A simple Java5 Application could handle the install (you need Java anyway if you want to use Eclipse). Creating the repackaged version can be done with a more or less simple shell script
- All feature.xml files must be extracted from the repackaged files and should be analyzied. The feature.xml information can be used as a basis for package dependencies (no need to track this kind of information manually)
- The installer needs to track files installed by a plugin and will allow you to remove (not only disable) a plugin (and propably all dependencies), this would make "clean" updates e.g. from eclipse 3.1 to 3.2 really easy.


I've just written a shell script to recompress the data in the "topack" folder (absolutely untested, it might break everything after unpacking):

optimize.sh

#!/bin/bash
find topack -iregex '.*\.zip' -exec advzip -z4 '{}' ';'
find topack -iregex '.*\.ear' -exec advzip -z4 '{}' ';'
find topack -iregex '.*\.war' -exec advzip -z4 '{}' ';'
#find topack -iregex '.*\.png' -exec ./optipng.sh '{}' ';'
find topack -iregex '.*\.jar' -exec ./optijar.sh '{}' ';'
cd topack
tar -c . > ../packed/pkg.pg
cd ../packed
cat pkg.pg|gzip -9 > pkg.pgz
advdef -z4
cat pkg.pg|bzip2 -9 > pkg.pgj
ls -rS pkg.pg pkg.pgj pkg.pgz|tr '\n' '?'|sed -e 's:^[^?]*[?]::' -e 's:[?]:\n:g'|xargs rm

optijar.sh

#!/bin/bash
echo
du -hs topack
echo
ls -lh "${1}"
echo

rm -rf tmp
rm "${1}.zip"
mkdir tmp
cd tmp
jar xf "../${1}"
zip -r -D -0 -u "../${1}.zip" . > /dev/null
cd ..
rm "${1}"
mv "${1}.zip" "${1}"

pack200 -r --modification-time=latest -O -g "${1}"

pack200 --modification-time=latest -O -g "${1}.pack" "${1}"

cat "${1}"|gzip -9 > "${1}.gz"
advdef -z4 "${1}.gz"
cat "${1}.pack"|gzip -9 > "${1}.pack.gz"
advdef -z4 "${1}.pack.gz"

cat "${1}"|bzip2 -9 > "${1}.bz2"
cat "${1}.pack"|bzip2 -9 > "${1}.pack.bz2"

ls -rS "${1}" "${1}.gz" "${1}.bz2" "${1}.pack" "${1}.pack.gz" "${1}.pack.bz2"|tr '\n' '?'|sed -e 's:^[^?]*[?]::' -e 's:[?]:\n:g'|xargs rm

This script requires "advdef", a Unix/Linux port of the 7zip zip-compatible algorithm, reducing .gz files filesize by about 2%-9% in the average case.


I do not create the .jar files with jar, zip should to work as long as you don't want anything special like utf-8 filenames. I got a lot of crc errors on .jar files, so I personally dislike them, they break stuff.

Java code to unpack .tar and .bz2 files can be found in the ant source tree, pack200 can be used via the Pack200 API... A Java installer for the packages shouldn't be very difficult (and would be f****** small). A tool to scan the packages and externalize the dependency metadata would be rather simple. A more complex (but still rather simple) task would be the dependencies scanner/solver and a swing based installer (oh, and an exe wrapper for the poor windows users).

Finally a tool to scan the ecplipse install folder for foreign plugins (e.g. for a subclipse installed via UpdateManager) would be nice.

Allmost forgotten: the packages can be installed under linux/unix with tar/gzip/bzip2/unpack200, no special tools are needed, so package managers like gentoo's emerge could use these packages directly!

Creating packages would be as simple as downloading/unpacking the required plugin, running 2 scripts (perhaps an ant script and a simple java app could do that, too) and uploading the results to a central repository... Sounds good to me ;)

I'm still not sure how to handle licenses, but that's another topic.

Don't expact anything useable in the (very) near future, I'm currently a bit to busy with other stuff and might even throw this stuff away... Way too much items on my Todo-, Exams- and Wishlist.

Have a nice day,
	René