source: trunk/base/portmgr/packaging/Makefile @ 27826

Last change on this file since 27826 was 27415, checked in by jmpp@…, 13 years ago

Sizeable facelift to the PortIndex2MySQL.tcl script. Highlights:

  • Bring it up to date wrt the macports1.0 api and into the new namespace;
  • Make it self-contained, writing its sql output to a flat file directly and then piping its contents to a proper database command (like mysql5(1)); this eliminates both the need to load the mysqltcl library or, the other case, wrap the tcl code with a shell script to do all the needed redirection to get the information into the db;
  • Get rid of a lot of now unnecessary code due to the rework above;
  • Provide abstraction variables to easily adapt the script to any scenario and a proc to read the db password from a file that must exist (this bit could definitely use some improvements, like for passwordless db's);
  • Add build and run dependencies for a given port as sql statements into the db (previously only lib deps were being recorded);
  • For fields with multiple and hierarchycal values, like categories, index them sequentially up from 1 (1 being topmost), rather than 1 for the first one (most important) and 0 for the rest (flat second place) as it was being done;
  • Use procs in the macports1.0 package, like ui_error;
  • Provide a Makefile (currently unhooked from MacPorts build system) to tie the script into an already configured MacPorts installation.

So, in a nutshell, the script now works to generate valid SQL statements for our ports tree,
we can extend it to do anything else we want and then find a client that will read such db
and thus put it to good use ;-) (old ports.php page, here I come!)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/plain
File size: 251 bytes
Line 
1# $Id: Makefile 27415 2007-08-03 03:15:11Z jmpp@macports.org $
2
3SCRIPTS=        PortIndex2MySQL
4
5edit = sed \
6        -e 's,@TCL_PACKAGE_DIR@,$(TCL_PACKAGE_DIR),g'
7
8
9include ../../Mk/macports.autoconf.mk
10
11
12all: ${SCRIPTS}
13
14PortIndex2MySQL: PortIndex2MySQL.tcl
15        ${edit} $< > $@
16
17clean:
18        rm -f ${SCRIPTS}
19
20distclean: clean
Note: See TracBrowser for help on using the repository browser.