Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agkyra
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
agkyra
Commits
29bc9904
Commit
29bc9904
authored
9 years ago
by
Giorgos Korfiatis
Browse files
Options
Downloads
Patches
Plain Diff
determine fs case sensitivity
parent
04cbd02e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
agkyra/syncer/setup.py
+20
-1
20 additions, 1 deletion
agkyra/syncer/setup.py
with
20 additions
and
1 deletion
agkyra/syncer/setup.py
+
20
−
1
View file @
29bc9904
...
...
@@ -146,6 +146,7 @@ class SyncerSettings():
self
.
get_db
(
initialize
=
True
)
self
.
mtime_lag
=
0
self
.
case_insensitive
=
False
if
not
db_existed
:
self
.
set_localfs_enabled
(
True
)
...
...
@@ -156,6 +157,8 @@ class SyncerSettings():
else
:
if
not
local_root_path_exists
:
self
.
set_localfs_enabled
(
False
)
else
:
self
.
create_local_dirs
()
if
not
container_exists
:
self
.
set_pithos_enabled
(
False
)
...
...
@@ -178,6 +181,7 @@ class SyncerSettings():
self
.
create_dir
(
self
.
cache_stage_path
)
self
.
create_dir
(
self
.
cache_fetch_path
)
self
.
set_mtime_lag
()
self
.
set_case_insensitive
()
def
determine_mtime_lag
(
self
):
st
=
os
.
stat
(
self
.
cache_path
)
...
...
@@ -188,9 +192,24 @@ class SyncerSettings():
def
set_mtime_lag
(
self
):
lag
=
self
.
determine_mtime_lag
()
logger
.
debug
(
"
Setting mtime_lag = %s
"
%
lag
)
logger
.
info
(
"
Setting mtime_lag = %s
"
%
lag
)
self
.
mtime_lag
=
lag
def
determine_fs_case_insensitive
(
self
):
path
=
self
.
cache_hide_path
altered
=
path
.
upper
()
if
not
path
.
isupper
()
else
path
.
lower
()
try
:
os
.
stat
(
altered
)
return
True
except
OSError
:
return
False
def
set_case_insensitive
(
self
):
case_insensitive
=
self
.
determine_fs_case_insensitive
()
case
=
"
in
"
if
case_insensitive
else
""
logger
.
info
(
"
Filesystem is case-%ssensitive
"
%
case
)
self
.
case_insensitive
=
case_insensitive
def
get_db
(
self
,
initialize
=
False
):
dbs
=
getattr
(
thread_local_data
,
"
dbs
"
,
None
)
if
dbs
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment