| | @@ -48,10 +48,52 @@ |
| 48 | 48 | sqlite3_stmt *pStmt; /* The results of sqlite3_prepare() */ |
| 49 | 49 | Stmt *pNext, *pPrev; /* List of all unfinalized statements */ |
| 50 | 50 | int nStep; /* Number of sqlite3_step() calls */ |
| 51 | 51 | }; |
| 52 | 52 | #endif /* INTERFACE */ |
| 53 | + |
| 54 | +/* |
| 55 | +** Get the configured name for the manifest file |
| 56 | +*/ |
| 57 | +const char* db_manifestName(void){ |
| 58 | + static char zManifestFNDefault[] = "manifest"; |
| 59 | + |
| 60 | + if (!g.zManifestFN){ |
| 61 | + char *zManifestFNPara; |
| 62 | + |
| 63 | + zManifestFNPara = db_get("manifest",zManifestFNDefault); |
| 64 | + if (!zManifestFNPara || !*zManifestFNPara){ |
| 65 | + zManifestFNPara = zManifestFNDefault; |
| 66 | + } |
| 67 | + g.zManifestFN = mprintf("%s",db_get("manifest",zManifestFNPara)); |
| 68 | + } |
| 69 | + return (g.zManifestFN); |
| 70 | +} |
| 71 | + |
| 72 | +/* |
| 73 | +** Get the configured name for the manifest.uuid file |
| 74 | +*/ |
| 75 | +const char* db_manifestUuidName(void){ |
| 76 | + if (!g.zManifestUuidFN){ |
| 77 | + g.zManifestUuidFN = mprintf("%s.uuid",db_manifestName()); |
| 78 | + } |
| 79 | + return (g.zManifestUuidFN); |
| 80 | +} |
| 81 | + |
| 82 | +/* |
| 83 | +** clear manifest filename caches |
| 84 | +*/ |
| 85 | +void db_FreeManifestNames(void){ |
| 86 | + if (g.zManifestFN){ |
| 87 | + free(g.zManifestFN); |
| 88 | + g.zManifestFN = 0; |
| 89 | + } |
| 90 | + if (g.zManifestUuidFN){ |
| 91 | + free(g.zManifestUuidFN); |
| 92 | + g.zManifestUuidFN = 0; |
| 93 | + } |
| 94 | +} |
| 53 | 95 | |
| 54 | 96 | /* |
| 55 | 97 | ** Call this routine when a database error occurs. |
| 56 | 98 | */ |
| 57 | 99 | static void db_err(const char *zFormat, ...){ |
| | @@ -783,10 +825,12 @@ |
| 783 | 825 | while( n>1 && zPwd[n-1]=='/' ){ |
| 784 | 826 | n--; |
| 785 | 827 | zPwd[n] = 0; |
| 786 | 828 | } |
| 787 | 829 | g.zLocalRoot = mprintf("%s/", zPwd); |
| 830 | + g.zManifestFN = 0; |
| 831 | + g.zManifestUuidFN = 0; |
| 788 | 832 | return 1; |
| 789 | 833 | } |
| 790 | 834 | } |
| 791 | 835 | n--; |
| 792 | 836 | while( n>0 && zPwd[n]!='/' ){ n--; } |
| | @@ -1522,10 +1566,11 @@ |
| 1522 | 1566 | { "editor", 0, 16, "" }, |
| 1523 | 1567 | { "gdiff-command", 0, 16, "gdiff" }, |
| 1524 | 1568 | { "ignore-glob", 0, 40, "" }, |
| 1525 | 1569 | { "http-port", 0, 16, "8080" }, |
| 1526 | 1570 | { "localauth", 0, 0, "0" }, |
| 1571 | + { "manifest", 0, 32, "" }, |
| 1527 | 1572 | { "mtime-changes", 0, 0, "0" }, |
| 1528 | 1573 | { "pgp-command", 0, 32, "gpg --clearsign -o " }, |
| 1529 | 1574 | { "proxy", 0, 32, "off" }, |
| 1530 | 1575 | { "ssh-command", 0, 32, "" }, |
| 1531 | 1576 | { "web-browser", 0, 32, "" }, |
| | @@ -1584,10 +1629,12 @@ |
| 1584 | 1629 | ** |
| 1585 | 1630 | ** localauth If enabled, require that HTTP connections from |
| 1586 | 1631 | ** 127.0.0.1 be authenticated by password. If |
| 1587 | 1632 | ** false, all HTTP requests from localhost have |
| 1588 | 1633 | ** unrestricted access to the repository. |
| 1634 | +** |
| 1635 | +** manifest name of manifest file, standard is manifest |
| 1589 | 1636 | ** |
| 1590 | 1637 | ** mtime-changes Use file modification times (mtimes) to detect when |
| 1591 | 1638 | ** files have been modified. (Default "on".) |
| 1592 | 1639 | ** |
| 1593 | 1640 | ** pgp-command Command used to clear-sign manifests at check-in. |
| | @@ -1639,6 +1686,7 @@ |
| 1639 | 1686 | print_setting(ctrlSettings[i].name); |
| 1640 | 1687 | } |
| 1641 | 1688 | }else{ |
| 1642 | 1689 | usage("?PROPERTY? ?VALUE?"); |
| 1643 | 1690 | } |
| 1691 | + db_FreeManifestNames(); |
| 1644 | 1692 | } |
| 1645 | 1693 | |