Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: ADO request: -ssc update-


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: ADO request: -ssc update-
Date   Fri, 19 Nov 2004 17:54:54 +0900

Fredrik Wallenberg wrote:

Would it be possible to write a package that could check for updates
of my installed ado files (the ones installed from ssc). I'm sure I'm
not the only one that simply types -update all- every now and then and
would love to do the same from user created packages.

----------------------------------------------------------------------------

I've got the following do-file for this in my Stata directory, and a pointer
to it tied to a function button in my profile.ado file.  I'm not sure why I
didn't make it an ado-file and place it in my personal ado directory.  In
too much of a hurry, I guess.

I believe that, even if a lot of people run it often, it wouldn't put an
undue load on the SSC server . . .

Joseph Coveney

---------updater.do---------
clear
set more off
quietly ssc whatsnew
insheet using ssc_results.smcl
drop if substr(v1, 1, 1) == "{"
split v1, generate(stub) parse(":")
drop if substr(stub3, -1, 1) != "}"
replace stub3 = lower(subinstr(stub3, "}", "", .))
levels stub3
foreach package in `r(levels)' {
    capture noisily ssc install `package'.pkg
    if _rc == 602 {
        capture noisily ssc install `package'.pkg, replace
    }
}
clear
erase ssc_results.smcl
exit
-------------------------

profile.ado has the following lines in it:

global F4 "update query;"
global F5 "ssc whatsnew;"
global F6 "myfindit "
global F7 "do C:\Progra~1\Stata\updater;"

In case you're curious, myfindit.ado is in the personal directory.  It's
just a wrapper to perform -findit- like I want it done:

------------myfindit.ado----------------
program define myfindit
    version 8.1
    syntax anything
    set more off
    findit_7 "`anything'", noview
    set more on
end
----------------------------------------





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index