On Sun, Mar 28, 2010 at 10:45 AM, Simon King <simon.k...@nuigalway.ie> wrote: > Hi! > > Related with #8523, I'd like to know how one tests whether some > package (here: database_gap) is already installed. I don't care what > exact version it is. > > I understood that the script SAGE_ROOT/spkg/standard/newest_version > can be used.
No. That script returns the newest version of the spkg that is *available* to be installed in the users spkg/standard directory. > I was reading somewhere that this script is supposed to > be called in SAGE_ROOT/spkg. But calling > ./newest_version database_gap > fails as follows: > >> standard/newest_version database_gap > /bin/ls: cannot access database_gap-*.spkg: No such file or directory > >> standard/newest_version optional/database_gap > /bin/ls: cannot access optional/database_gap-*.spkg: No such file or > directory > > But: >> ls optional/database_gap-4.4.1* > optional/database_gap-4.4.10.spkg optional/database_gap-4.4.12.spkg > > So, I ended up using it directly in SAGE_ROOT/spkg/optional/, which > works: >> ../standard/newest_version database_gap > database_gap-4.4.12 > > But is this really how it is supposed to work? The directory SAGE_ROOT/spkg/installed contains a file for each spkg that was installed, that contains metainformation about when that package was installed. I think you should look at that. The contents of spkg/standard and spkg/optional aren't guaranteed to tell you anything useful at all. > Another problem: It may happen that someone installs an optional > package in a way that there is no .spkg file in SAGE_ROOT/spkg/ > optional/. Instead, there only is a file in SAGE_ROOT/spkg/ > installed/., but this file does not have an .spkg extension. > > Shouldn't SAGE_ROOT/spkg/standard/newest_version better look for (non- > spkg) files in SAGE_ROOT/spkg/installed/? Or what else can one do to > test if a package is installed? No. newest_version is irrelevant. One should look at spk/installed/ > > Best regards, > Simon > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > > To unsubscribe from this group, send email to > sage-devel+unsubscribegooglegroups.com or reply to this email with the words > "REMOVE ME" as the subject. > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org To unsubscribe from this group, send email to sage-devel+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.