Hi all,

I've cloned tankfeeder's repository at Bitbucket and installed small 
pil-application that
checks  http://software-lab.de/picoLisp.tgz  for changes and commits to the 
repo.
Repository address is  https://bitbucket.org/mmamkin/picolisp  

Application source code is attached. Comments are welcome

Best regards, 
Mansur Mamkin



























































































(setq                                                                           
                                                                              
   *Root "pilrepo/"                                                             
                                                                              
   *Repo (pack *Root "picoLisp/")                                               
                                                                              
   *TgzUrl "http://software-lab.de/picoLisp.tgz";                                
                                                                              
   *Tgz (pack *Root "picoLisp.tgz")                                             
                                                                              
   *Curl (list 'curl '-z *Tgz '-o *Tgz '-w "%{http_code}" '--silent *TgzUrl) )  
                                                                              
                                                                                
                                                                              
# TODO: email me                                                                
                                                                              
(de _alert ()                                                                   
                                                                              
   NIL )                                                                        
                                                                              
                                                                                
                                                                              
(de _download ()                                                                
                                                                              
   (log "Downloading @1..." *TgzUrl)                                            
                                                                              
   (case (in *Curl (read))                                                      
                                                                              
      (200 (log "200 OK [@2 bytes]" (car (info Tgz))) T)                        
                                                                              
      (304 (log "304 Not modified") NIL)                                        
                                                                              
      (T (logerr "@1 download failed" @) (_alert) NIL) ) )                      
                                                                              
                                                                                
                                                                              
(de _extract ()                                                                 
                                                                              
   (ifn (call 'tar '-x '-z '-C *Root '-f *Tgz)                                  
                                                                              
      (nil (logerr "'@1' extraction failed" *Tgz))                              
                                                                              
      T ) )                                                                     
                                                                              
                                                                                
                                                                              
(de log @                                                                       
                                                                              
   (out NIL                                                                     
                                                                              
      (prinl (stamp) " PID: " *Pid " [INFO] " (pass text)) ) )                  
                                                                              
                                                                                
                                                                              
(de logerr @                                                                    
                                                                              
   (out NIL                                                                     
                                                                              
      (prinl (stamp) " PID: " *Pid  " [ERROR] " (pass text)) ) )                
                                                                              
                                                                                
                                                                              
(de _commit ()                                                                  
                                                                              
   (load (pack *Repo "src64/version.l"))                                        
                                                                              
   (let Msg (glue "." *Version)                                                 
                                                                              
      (if (call 'hg 'commit '--cwd *Repo '-A '-m Msg)                           
                                                                              
         (t (log "hg commit -m '@1'" Msg))                                      
                                                                              
         (nil (logerr "hg commit -m '@1' failed" Msg)) ) ) )

Attachment: main.l
Description: Binary data

Reply via email to