www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2019/08/14/14:49:55

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6
X-Exmh-Isig-CompType: comp
X-Exmh-Isig-Folder: inbox
From: karl AT aspodata DOT se
To: geda-user AT delorie DOT com
Subject: [geda-user] finding newer sym's and sch's
Mime-Version: 1.0
Message-Id: <20190814182737.C3124861347C@turkos.aspodata.se>
Date: Wed, 14 Aug 2019 20:27:37 +0200 (CEST)
X-Virus-Scanned: ClamAV using ClamSMTP
Reply-To: geda-user AT delorie DOT com

To check wheter the changes I do to symbols and subsheets mess up 
things for designs using them, I made two programs to find them, see 
below.

Now, using git, the timestamps (mtime) don't tell us much after a few
checkin and checkout cycles, so I tried to use the commit time insted,
where possible.

Comments and whishlists welcome.

///

First off, I needed something to give me the library paths:

 http://aspodata.se/git/openhw/bin/geda_lib.scm

It runs the .gEDA/gafrc and any possible ./gafrc file and prints out 
the paths found. Example:

$ cat ~/.gEDA/gafrc
(define home (getenv "HOME"))
;(load-scheme-dir (build-path home ".gEDA/gafrc.d"))

(define (cl str) (if (access? str R_OK) (component-library str)))
(define (sl str) (if (access? str R_OK) (source-library str)))

(component-library-search "/Net/cvs/cvs.gedasymbols.org/www/user" "cvs")
(component-library-search (build-path home "git/openhw/share/gschem") "lcl")
(cl "_symbol")
(cl "sym")
(cl "include")
(component-library ".")

(source-library    "${HOME}/git/openhw/share/gschem/_sub_page")
(sl "_sub_page")
(sl "include")
(source-library  ".")
$ geda_lib.scm 
cs /Net/cvs/cvs.gedasymbols.org/www/user
cs /home/karl/git/openhw/share/gschem
c include
c .
s ${HOME}/git/openhw/share/gschem/_sub_page
s include
s .

where
 cs = component search patch
 c  = component dir
 cr = reset (empty) component dir and search paths
 s  = source dir
 sr = reset source dirs

///

That ouput is read by my other program:

 http://aspodata.se/git/openhw/bin/chk_newer.pl

which scans (grep) the sch file and tries to find out if the refrence
is newer or older than the given file. And it does so recursively.
Examples:
. the first one is possible hopelessly outdated

$ chk_newer.pl regulator.sch 
Checking: regulator.sch
 Newer: 48169412 ~/git/openhw/share/gschem/_semiconductor/78xx.sym
 Newer: 48168890 ~/git/openhw/share/gschem/_graphical/A3liggande.sym
 Newer: 10826966 ~/git/openhw/share/gschem/_electromechanical/arm_jtag8.sym
 Newer: 54028282 /usr/share/gEDA/sym/connector/connector3-2.sym
...

. the second one shows what happens when a file is changed:

$ chk_newer.pl stm32f100_rn2483.sch
Checking: stm32f100_rn2483.sch
Checking: ~/git/openhw/share/gschem/_sub_page/driver_rs232_2_5V.max232.sch

$ echo >> ~/git/openhw/share/gschem/_graphical/A4liggande.sym

$ chk_newer.pl stm32f100_rn2483.sch
Checking: stm32f100_rn2483.sch
 Newer: 79228 ~/git/openhw/share/gschem/_graphical/A4liggande.sym
Checking: ~/git/openhw/share/gschem/_sub_page/driver_rs232_2_5V.max232.sch
$

The numbers between "Newer:" and the file name, are the age differece 
in seconds, perhaps not that interesting.

Regards,
/Karl Hammar


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019