Hi all, i try to do modifications to support the new format of OPKGs and reading the code i have to admit that i am again confused: Why the parsing of config.xml files is done by functions which are strictly related to the database?
Here are the details: To use an OPKG, we have to parse the config.xml file. The current implementation does that in two phases: 1/ creation of the XML tree; this is for example done in script/package_config_xmls_to_database. 2/ Then we call insert_packages (from lib/OSCAR/Database.pm) which (1) parses the config.xml file to extract needed information, and (2) creates the SQL request to effectively insert the extracted values into the database. So i wonder why these two steps are done by the database; it seems to me that it would make sense to extract data from the XML tree outside of the database and call database related function with a more generic data format. Doing that it will be much easier to maintain the code especially when we update the XML schema of config.xml files. Therefore to summarize, it seems to me that it should be beneficial to have the following algorithm: 1/ we create the XML tree of the config.xml file (trivial), 2/ we parse the XML tree, i.e., we extract information from the tree (for instance using XSL which is simple to read), 3/ we update the database. Any comments? Do we try to do what i describe? or do you update the current code, avoiding any major modifications? We have to find a solution in order to support new OPKG API. Thanks, -- Geoffroy ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Oscar-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oscar-devel
