Fossil SCM

No longer require that the HOME directory is writable if the fossil configuration file is already there. (With some simplifications)

jan.nijtmans 2014-01-23 10:29 trunk merge
Commit b4d538f8c6149decf073f001ba1953990ba1c12a
2 files changed +3 -5 +3 -5
+3 -5
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831831
}
832832
#if defined(_WIN32) || defined(__CYGWIN__)
833833
/* . filenames give some window systems problems and many apps problems */
834834
zDbName = mprintf("%//_fossil", zHome);
835835
#else
836
- if( file_access(zHome, W_OK) ){
837
- fossil_fatal("home directory %s must be writeable", zHome);
838
- }
839836
zDbName = mprintf("%s/.fossil", zHome);
840837
#endif
841838
if( file_size(zDbName)<1024*3 ){
839
+ if( file_access(zHome, W_OK) ){
840
+ fossil_fatal("home directory %s must be writeable", zHome);
841
+ }
842842
db_init_database(zDbName, zConfigSchema, (char*)0);
843843
}
844
-#if defined(_WIN32) || defined(__CYGWIN__)
845844
if( file_access(zDbName, W_OK) ){
846845
fossil_fatal("configuration file %s must be writeable", zDbName);
847846
}
848
-#endif
849847
if( useAttach ){
850848
db_open_or_attach(zDbName, "configdb", &g.useAttach);
851849
g.dbConfig = 0;
852850
g.zConfigDbType = 0;
853851
}else{
854852
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831 }
832 #if defined(_WIN32) || defined(__CYGWIN__)
833 /* . filenames give some window systems problems and many apps problems */
834 zDbName = mprintf("%//_fossil", zHome);
835 #else
836 if( file_access(zHome, W_OK) ){
837 fossil_fatal("home directory %s must be writeable", zHome);
838 }
839 zDbName = mprintf("%s/.fossil", zHome);
840 #endif
841 if( file_size(zDbName)<1024*3 ){
 
 
 
842 db_init_database(zDbName, zConfigSchema, (char*)0);
843 }
844 #if defined(_WIN32) || defined(__CYGWIN__)
845 if( file_access(zDbName, W_OK) ){
846 fossil_fatal("configuration file %s must be writeable", zDbName);
847 }
848 #endif
849 if( useAttach ){
850 db_open_or_attach(zDbName, "configdb", &g.useAttach);
851 g.dbConfig = 0;
852 g.zConfigDbType = 0;
853 }else{
854
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831 }
832 #if defined(_WIN32) || defined(__CYGWIN__)
833 /* . filenames give some window systems problems and many apps problems */
834 zDbName = mprintf("%//_fossil", zHome);
835 #else
 
 
 
836 zDbName = mprintf("%s/.fossil", zHome);
837 #endif
838 if( file_size(zDbName)<1024*3 ){
839 if( file_access(zHome, W_OK) ){
840 fossil_fatal("home directory %s must be writeable", zHome);
841 }
842 db_init_database(zDbName, zConfigSchema, (char*)0);
843 }
 
844 if( file_access(zDbName, W_OK) ){
845 fossil_fatal("configuration file %s must be writeable", zDbName);
846 }
 
847 if( useAttach ){
848 db_open_or_attach(zDbName, "configdb", &g.useAttach);
849 g.dbConfig = 0;
850 g.zConfigDbType = 0;
851 }else{
852
+3 -5
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831831
}
832832
#if defined(_WIN32) || defined(__CYGWIN__)
833833
/* . filenames give some window systems problems and many apps problems */
834834
zDbName = mprintf("%//_fossil", zHome);
835835
#else
836
- if( file_access(zHome, W_OK) ){
837
- fossil_fatal("home directory %s must be writeable", zHome);
838
- }
839836
zDbName = mprintf("%s/.fossil", zHome);
840837
#endif
841838
if( file_size(zDbName)<1024*3 ){
839
+ if( file_access(zHome, W_OK) ){
840
+ fossil_fatal("home directory %s must be writeable", zHome);
841
+ }
842842
db_init_database(zDbName, zConfigSchema, (char*)0);
843843
}
844
-#if defined(_WIN32) || defined(__CYGWIN__)
845844
if( file_access(zDbName, W_OK) ){
846845
fossil_fatal("configuration file %s must be writeable", zDbName);
847846
}
848
-#endif
849847
if( useAttach ){
850848
db_open_or_attach(zDbName, "configdb", &g.useAttach);
851849
g.dbConfig = 0;
852850
g.zConfigDbType = 0;
853851
}else{
854852
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831 }
832 #if defined(_WIN32) || defined(__CYGWIN__)
833 /* . filenames give some window systems problems and many apps problems */
834 zDbName = mprintf("%//_fossil", zHome);
835 #else
836 if( file_access(zHome, W_OK) ){
837 fossil_fatal("home directory %s must be writeable", zHome);
838 }
839 zDbName = mprintf("%s/.fossil", zHome);
840 #endif
841 if( file_size(zDbName)<1024*3 ){
 
 
 
842 db_init_database(zDbName, zConfigSchema, (char*)0);
843 }
844 #if defined(_WIN32) || defined(__CYGWIN__)
845 if( file_access(zDbName, W_OK) ){
846 fossil_fatal("configuration file %s must be writeable", zDbName);
847 }
848 #endif
849 if( useAttach ){
850 db_open_or_attach(zDbName, "configdb", &g.useAttach);
851 g.dbConfig = 0;
852 g.zConfigDbType = 0;
853 }else{
854
--- src/db.c
+++ src/db.c
@@ -831,23 +831,21 @@
831 }
832 #if defined(_WIN32) || defined(__CYGWIN__)
833 /* . filenames give some window systems problems and many apps problems */
834 zDbName = mprintf("%//_fossil", zHome);
835 #else
 
 
 
836 zDbName = mprintf("%s/.fossil", zHome);
837 #endif
838 if( file_size(zDbName)<1024*3 ){
839 if( file_access(zHome, W_OK) ){
840 fossil_fatal("home directory %s must be writeable", zHome);
841 }
842 db_init_database(zDbName, zConfigSchema, (char*)0);
843 }
 
844 if( file_access(zDbName, W_OK) ){
845 fossil_fatal("configuration file %s must be writeable", zDbName);
846 }
 
847 if( useAttach ){
848 db_open_or_attach(zDbName, "configdb", &g.useAttach);
849 g.dbConfig = 0;
850 g.zConfigDbType = 0;
851 }else{
852

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button