Megatest

Check-in [ed27042583]
Login
Overview
Comment:Added function for reading packages
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: ed2704258383b8e9a580536acf7726c815b67595
User & Date: matt on 2015-12-12 22:40:42
Other Links: branch diff | manifest | tags
Context
2015-12-13
23:06
Completed sretrieve check-in: 07c1d52486 user: matt tags: v1.60
2015-12-12
22:40
Added function for reading packages check-in: ed27042583 user: matt tags: v1.60
21:54
Added skeleton for sretrieve check-in: 9630e130f2 user: matt tags: v1.60
Changes

Modified datashare-testing/.sretrieve.config from [826c273d61] to [91a460477d].

1
2
3

4
5
6
7
8
9
10
11
[settings]
allowed-users matt mrwellan pjhatwal
allowed-chars [0-9a-zA-Z\-\.]+

conversion-script import-releases.sh
upstream-file incoming.yaml

[database]
location #{scheme (create-directory "/tmp/#{getenv USER}" #t)}

# 
[include releases.config]



>

|




<
<
1
2
3
4
5
6
7
8
9
10


[settings]
allowed-users matt mrwellan pjhatwal
allowed-chars [0-9a-zA-Z\-\.]+
packages-config   packages.config
conversion-script import-releases.sh
upstream-file     incoming.yaml

[database]
location #{scheme (create-directory "/tmp/#{getenv USER}" #t)}



Modified datashare-testing/packages.config from [77c1453967] to [2bebde2921].

1
2
3
4
# release release-status release-date
[bundle kits]
v1.50 release WW15.1


|
|
|
1
2
3
4
# release release-status release-date
[kits]
full_v1.60 release WW15.1
full_v1.60 alpha WW01.2

Modified sretrieve.scm from [2b7eb1fa1c] to [7011d614d7].

78
79
80
81
82
83
84






85
86
87
88
89
90
91
         (id           INTEGER PRIMARY KEY,
          action       TEXT NOT NULL,
          retriever    TEXT NOT NULL,
          datetime     TIMESTAMP DEFAULT (strftime('%s','now')),
          srcpath      TEXT NOT NULL,
          comment      TEXT DEFAULT '' NOT NULL,
          state        TEXT DEFAULT 'new');"






    )))

(define (sretrieve:register-action db action submitter source-path comment)
  (exec (sql db "INSERT INTO actions (action,submitter,srcpath,comment)
                 VALUES(?,?,?,?)")
	action
	submitter







>
>
>
>
>
>







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
         (id           INTEGER PRIMARY KEY,
          action       TEXT NOT NULL,
          retriever    TEXT NOT NULL,
          datetime     TIMESTAMP DEFAULT (strftime('%s','now')),
          srcpath      TEXT NOT NULL,
          comment      TEXT DEFAULT '' NOT NULL,
          state        TEXT DEFAULT 'new');"
    "CREATE TABLE IF NOT EXISTS bundles
         (id           INTEGER PRIMARY KEY,
          bundle       TEXT NOT NULL,
          release      TEXT NOT NULL,
          status       TEXT NOT NULL,
          event_date   TEXT NOT NULL);"
    )))

(define (sretrieve:register-action db action submitter source-path comment)
  (exec (sql db "INSERT INTO actions (action,submitter,srcpath,comment)
                 VALUES(?,?,?,?)")
	action
	submitter
329
330
331
332
333
334
335























336
337
338
339
340
341
342
  (let* ((fname   (conc exe-dir "/." exe-name ".config")))
    (ini:property-separator-patt " *  *")
    (ini:property-separator #\space)
    (if (file-exists? fname)
	;; (ini:read-ini fname)
	(read-config fname #f #t)
	(make-hash-table))))
























(define (sretrieve:process-action configdat action . args)
  (let* ((target-dir    (configf:lookup configdat "settings" "target-dir"))
	 (user          (current-user-name))
	 (allowed-users (string-split
			 (or (configf:lookup configdat "settings" "allowed-users")
			     ""))))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
  (let* ((fname   (conc exe-dir "/." exe-name ".config")))
    (ini:property-separator-patt " *  *")
    (ini:property-separator #\space)
    (if (file-exists? fname)
	;; (ini:read-ini fname)
	(read-config fname #f #t)
	(make-hash-table))))

(define (sretrieve:load-packages configdat exe-dir)
  (push-directory exe-dir)
  (let* ((packages-config   (configf:lookup configdat "settings" "packages-config"))
	 (conversion-script (configf:lookup configdat "settings" "conversion-script"))
	 (upstream-file     (configf:lookup configdat "settings" "upstream-file")))
    (if (file-exists? upstream-file)
	(if (or (not (file-exists? packages-config)) ;; if not created call the updater, otherwise call only if upstream newer
		(> (file-modification-time upstream-file)(file-modification-time packages-config)))
	    (handle-exceptions
	     exn
	     (print "ERROR: failed to run script " conversion-script " with params " upstream-file " " packages-config)
	     (let ((pid (process-run conversion-script (list source-path target-dir))))
	       (process-wait pid)))
	    (print "Skipping update of " packages-config " from " upstream-file))
	(print "Skipping update of " packages-config " as " upstream-file " not found"))
    (ini:property-separator-patt " *  *")
    (ini:property-separator #\space)
    (let ((res (if (file-exists? fname)
		   (read-config packages-config #f #t)
		   (make-hash-table))))
      (pop-directory)
      res)))

(define (sretrieve:process-action configdat action . args)
  (let* ((target-dir    (configf:lookup configdat "settings" "target-dir"))
	 (user          (current-user-name))
	 (allowed-users (string-split
			 (or (configf:lookup configdat "settings" "allowed-users")
			     ""))))