SOURCES: gen-installed-chrome.sh (NEW) - *-installed-chrome.txt ge...

sparky sparky at pld-linux.org
Sun Apr 16 17:56:13 CEST 2006


Author: sparky                       Date: Sun Apr 16 15:56:13 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- *-installed-chrome.txt generator script

---- Files affected:
SOURCES:
   gen-installed-chrome.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gen-installed-chrome.sh
diff -u /dev/null SOURCES/gen-installed-chrome.sh:1.1
--- /dev/null	Sun Apr 16 17:56:13 2006
+++ SOURCES/gen-installed-chrome.sh	Sun Apr 16 17:56:08 2006
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+[ $# -gt 1 ] || exit 1
+
+TYPE="$1"
+shift
+
+find_dir() {
+	while read DIR; do
+		for D in $(find -type d -name $DIR); do
+			echo "$TYPE,install,url,jar:resource:/chrome/$JAR!${D#.}/"
+		done
+	done
+}
+
+while [ -n "$1" ]; do
+	DIR=$(mktemp -d unzip.XXXXXX)
+	cd $DIR
+	unzip ../$1 >/dev/null
+	JAR=$(basename $1)
+	
+	find -name contents.rdf \
+		| xargs cat \
+		| perl -pi -e '
+			$txt .= $_;
+			$_ = undef; 
+			END { 
+				while( $txt =~ s/<chrome:packages>(.*?)<\/chrome:packages>//s ) {
+					$t = $1;
+					while ( $t =~ s/<RDF:li\s+resource=".*:(\S+?)"// ) {
+						print $1 ."\n";
+					}
+				}
+			}' | find_dir | sort -u
+	cd ..
+	rm -rf $DIR
+	shift
+done
+
+# vim: ts=4:sw=4
================================================================


More information about the pld-cvs-commit mailing list