diff options
| author | 2012-12-29 16:54:16 +0100 | |
|---|---|---|
| committer | 2012-12-29 16:54:16 +0100 | |
| commit | b46793938598358a9ab5249bd97e8999d5ac67e6 (patch) | |
| tree | 3461b18599341fd3be19b0c094d6a62775478b88 /src/convert.scm | |
| parent | f379783d28e73b4613852fca58e0af3f8ea6ab87 (diff) | |
| download | markam-b46793938598358a9ab5249bd97e8999d5ac67e6.tar.gz markam-b46793938598358a9ab5249bd97e8999d5ac67e6.zip | |
Rename linkwave to markam
Diffstat (limited to 'src/convert.scm')
| -rw-r--r-- | src/convert.scm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/convert.scm b/src/convert.scm index 45e3101..199a2a5 100644 --- a/src/convert.scm +++ b/src/convert.scm @@ -1,4 +1,4 @@ -;;; linkwave -- Store/retrieve/manage bookmarks +;;; markam -- Store/retrieve/manage bookmarks ;; Copyright (C) 2012 Tom Willemsen <tom at ryuslash dot org> ;; This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ ;;; Commentary: ;; Convert any old database file to one usable with this version of -;; linkwave. If you're just starting to use linkwave there should be +;; markam. If you're just starting to use markam there should be ;; no need to use this. ;;; Code: @@ -31,7 +31,7 @@ (define (blob->seconds blob) ;; Convert BLOB to an integer representing the seconds since ;; 01-01-1970 (standard unix timstamp). This has to be done because - ;; in the previous version of linkwave I stored the timestamp as a + ;; in the previous version of markam I stored the timestamp as a ;; blob and CHICKEN doesn't seem to like blobs much. (if (u32vector? blob) (u32vector-ref (blob->u32vector blob) 0) @@ -53,8 +53,8 @@ (define (convert) ;; Convert an old database into a new one and then replace the old ;; with the new. - (let ((old-db (open-database (data-file "linkwave.db"))) - (new-db (open-database (data-file "nlinkwave.db")))) + (let ((old-db (open-database (data-file "linkwave.db" "linkwave"))) + (new-db (open-database (data-file "markam.db")))) (execute new-db "CREATE TABLE bookmark (url VARCHAR(255) UNIQUE, date INTEGER, name VARCHAR(255), description TEXT)") (execute new-db "CREATE TABLE tag (name VARCHAR(255) UNIQUE)") (execute new-db "CREATE TABLE bookmark_tag (bookmark_id INTEGER REFERENCES bookmark(rowid), tag_id INTEGER REFERENCES tag(rowid), PRIMARY KEY (bookmark_id, tag_id))") @@ -75,12 +75,10 @@ (first-result new-db "SELECT rowid FROM tag WHERE name = ?" tag))) "SELECT url, name FROM bookmark_tag JOIN tag ON (tag_id = tag.rowid)") - (rename-file (data-file "linkwave.db") (data-file "old-linkwave.db")) - (rename-file (data-file "nlinkwave.db") (data-file "linkwave.db")) (format #t "Database converted.~%"))) (define (display-help) - ;; Display linkwave's help message. + ;; Display markam's help message. (format #t (string-append "Usage: convert [options]...~%" "~%" @@ -93,9 +91,9 @@ ;; Convert an old database file unless a conversion database already ;; exists. (if (null? args) - (if (file-exists? (data-file "nlinkwave.db")) - (format #t (string-append "Conversion database already exists. " - "Something may have gone wrong during the last run~%")) + (if (file-exists? (data-file "markam.db")) + (format #t (string-append "Converted database already exists, or something may have gone " + "wrong during the last run~%")) (convert)) (do ((arg (car args) (and (not (null? args)) (car args)))) |
