Author: glen
Date: Thu May 25 01:51:57 2006
New Revision: 7438

Added:
   anaconda/comps.awk   (contents, props changed)
Log:
- preliminiary installer->comps.xml converter

Added: anaconda/comps.awk
==============================================================================
--- (empty file)
+++ anaconda/comps.awk  Thu May 25 01:51:57 2006
@@ -0,0 +1,92 @@
+#!/bin/awk -f
+# parse comps.xml from pld-bootdisk/batch-installer/ui/data/groups
+# [EMAIL PROTECTED], 2006-05-25
+
+BEGIN {
+       print "<?xml version=\"1.0\"?>"
+       print "<!DOCTYPE comps PUBLIC \"-//Red Hat, Inc.//DTD Comps info//EN\" 
\"comps.dtd\">"
+       print "<comps>"
+
+       groupname = ""
+}
+
+END {
+       print "</comps>"
+}
+
+/^#/ {
+    next
+}
+
+#* 1 base `nls "Base packages"`
+/^\*/ {
+    # process pri=\d+
+    if (match($0, /"(.+)"/)) {
+        groupname = substr($0, RSTART + 1, RLENGTH - 2);
+    } else {
+        groupname = $0
+    }
+    default = $2
+    groupid = $3
+
+       print "\t<group>"
+       printf "\t\t<id>%s</id>\n", groupid
+       printf "\t\t<name>%s</name>\n", groupname
+       printf "\t\t<default>%s</default>\n", default ? "true" : "false"
+       print "\t\t<uservisible>true</uservisible>"
+       printf "\t\t<description>%s</description>\n", groupname
+       print "\t\t<packagelist>"
+    next
+}
+
+# empty line means end of group
+/^$/ {
+    if (groupname) {
+        print "\t\t</packagelist>"
+        print "\t</group>\n"
+        groupname = ""
+    }
+}
+
+# basearchonly desc:
+# http://www.redhat.com/archives/fedora-devel-list/2004-January/msg01214.html
+
[EMAIL PROTECTED] syslog-ng syslog
[EMAIL PROTECTED] lilo grub
[EMAIL PROTECTED] vixie-cron hc-cron anacron
[EMAIL PROTECTED] rdate rdate-bsd ntp-client
+/^@/ {
+    if (groupname) {
+        virtual = substr($0, 2);
+        pkgs = substr($0, 2 + length($1));
+
+        # no idea what to do with @virtuals so just split the components
+        # maybe subgroup them?
+
+        type = "default"
+        if (match(virtual, /^!/)) {
+            virtual = substr($0, 2);
+            type = "optional"
+        }
+
+        n = split(pkgs, pkga, / /);
+        for (i = 1; i <= n; i++) {
+            printf "\t\t\t<packagereq type=\"%s\">%s</packagereq>\n", type, 
pkga[i]
+        }
+
+    }
+    next
+}
+
+{
+    if (groupname) {
+        pkg = $0
+        type = "default"
+        type = "default"
+        if (match(pkg, /^!/)) {
+            pkg = substr($0, 2);
+            type = "optional"
+        }
+        printf "\t\t\t<packagereq type=\"%s\">%s</packagereq>\n", type, pkg
+    }
+}
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to