[GSoC 2017] Community Bonding

Clemens Lang cal at macports.org
Fri May 26 18:38:46 UTC 2017


Hi,

On Fri, May 26, 2017 at 12:57:11AM +0530, Umesh Singla wrote:
> Since we are planning on 3 different actions which can also be used
> independently like snapshot and migrate, having 2 scripts in the
> macports1.0 directory directly or keeping these 2 commands in a single
> script doesn't seem to be good from design pov. We can have a separate
> folder for new (upcoming) actions with a hope that the existing code
> be split into "action" modules over the time.

Why wouldn't migrate.tcl and snapshot.tcl in the macports1.0 folder be
appropriate? That's more or less what we did with diagnose.tcl and
reclaim.tcl.

> > If you need any additional special SQL queries, that can be done,
> > yes. There should be abstractions available in Tcl already so that
> > you don't have to deal with SQLite's C API directly, though.
>
> The cregistry folder seems to have most of the sql queries implemented
> and to deal with the registry database, I'll only have create, update
> and select queries to do, so looks like I won't have to deal with C. I
> went through an entire "port uninstall" example to see how from Tcl
> gets to sqlite C through registry, so things seem a bit clear than
> before.

Yeah, I wouldn't expect too much extra SQL to be necessary, since
registry2.0 should already provide most (all?) the things you need.


> Is there anything even sacred to Tcl? Till now, it looks like you can
> just use anything in the language with pretty much anything else. This
> calls for a new blog post. And planning to discuss on the testing part
> in next email.

Yeah, Tcl is very versatile. If necessary, you can also redefine builtin
functions. I'm not sure if you can actually also redefine keywords (such
as if and for) – you can certainly define new actions that behave like
keywords, though. And to make it even more complicated, variable names
can contain pretty much everything, e.g. "is_valid?" would be a valid
variable name in Tcl.

> Also, can we have a small README with two to three lines kept in every
> folder in the base code at least? That'll be actually very helpful.

I agree with Rainer that we should extend HACKING and our existing
documentation with this rather than spreading it. Ideally, I'd find the
time to write down the general overview that I gave in the video.

-- 
Clemens


More information about the macports-dev mailing list