Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Working with packages - stable and unstable?

26 views
Skip to first unread message
Message has been deleted

Brad Lanam

unread,
Jun 24, 2016, 8:42:14 PM6/24/16
to
On Friday, June 24, 2016 at 5:30:51 PM UTC-7, Juge wrote:
> My program is getting more and more complex and I placed different parts of my GUI (different dialogues) in their own packages. I would like to have possibility of using stable packages or alternatively using the highest version.
>
> Well the latter is easy, but for the former I have only found out the possibility
> of defining the exact version with package require -exact option.
>
> How can I manage this a bit more elegantly? I could use a high version number for beta versions if it would be possible to define, for example, package require < 5.0 or something like that for the stable variants instead of using the -exact option, but I am afraid this is not allowed.

This is off the top of my head...there are a lot of different ways
you can handle this.

Something along the lines of:

set fh [open stable.txt r]
get $fh stablever
close $fh

# default to the stable version
set usever $stablever

set arg [lindex $::argv 0]
# use the latest version
if { $arg eq "-dev" } {
set usever {}
}
# specify an particular version to use
if { $arg eq "-ver" } {
set usever [lindex $::argv 1]
}

if { $usever ne {} } {
package require xyzzy -exact $usever
} else {
package require xyzzy
}

Brad Lanam

unread,
Jun 24, 2016, 9:07:27 PM6/24/16
to
On Friday, June 24, 2016 at 5:30:51 PM UTC-7, Juge wrote:
> My program is getting more and more complex [...]

You should probably look into using a source control system such
as git, mercurial or fossil. It is much easier let the source
control system handle the versioning.

Gerald W. Lester

unread,
Jun 25, 2016, 11:18:28 AM6/25/16
to
On 6/24/16 1:57 AM, Juge wrote:
> My program is getting more and more complex and I placed different parts of
>my GUI (different dialogues) in their own packages. I would like to have
>possibility of using stable packages or alternatively using the highest version.
>
> Well the latter is easy, but for the former I have only found out the possibility
> of defining the exact version with package require -exact option.
>
> How can I manage this a bit more elegantly? I could use a high version
>number for beta versions if it would be possible to define, for example,
>package require < 5.0 or something like that for the stable variants
>instead of using the -exact option, but I am afraid this is not allowed.

Read the man page for the package command.

Pay particular attention to the section "package prefer" and to the section
that talks about version numbers (in particular the sentence that defines
the terms "stable" and "unstable").

Follow what the man page says to do

--
+------------------------------------------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
0 new messages