Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
3d4724cd
Commit
3d4724cd
authored
Mar 21, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
project: rename package to "jami", migrate config files
Change-Id: I5c7d429bd32aa22bd4c7ad0914a7581176c2ccdd
parent
27625f2a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
17 deletions
+53
-17
bin/main.cpp
bin/main.cpp
+1
-1
bin/osxmain.cpp
bin/osxmain.cpp
+1
-1
bin/winmain.cpp
bin/winmain.cpp
+1
-1
configure.ac
configure.ac
+2
-2
src/fileutils.cpp
src/fileutils.cpp
+29
-11
src/fileutils.h
src/fileutils.h
+4
-0
src/manager.cpp
src/manager.cpp
+15
-1
No files found.
bin/main.cpp
View file @
3d4724cd
...
...
@@ -54,7 +54,7 @@ print_title()
{
std
::
cout
<<
"Jami Daemon "
<<
DRing
::
version
()
<<
", by Savoir-faire Linux 2004-201
8
"
<<
std
::
endl
<<
", by Savoir-faire Linux 2004-201
9
"
<<
std
::
endl
<<
"https://jami.net/"
<<
std
::
endl
#ifdef RING_VIDEO
<<
"[Video support enabled]"
<<
std
::
endl
...
...
bin/osxmain.cpp
View file @
3d4724cd
...
...
@@ -43,7 +43,7 @@ print_title()
{
std
::
cout
<<
"Jami Daemon "
<<
DRing
::
version
()
<<
", by Savoir-faire Linux 2004-201
8
"
<<
std
::
endl
<<
", by Savoir-faire Linux 2004-201
9
"
<<
std
::
endl
<<
"https://jami.net/"
<<
std
::
endl
#ifdef RING_VIDEO
<<
"[Video support enabled]"
<<
std
::
endl
...
...
bin/winmain.cpp
View file @
3d4724cd
...
...
@@ -47,7 +47,7 @@ print_title()
{
std
::
cout
<<
"Jami Daemon "
<<
DRing
::
version
()
<<
", by Savoir-faire Linux 2004-201
8
"
<<
std
::
endl
<<
", by Savoir-faire Linux 2004-201
9
"
<<
std
::
endl
<<
"https://jami.net/"
<<
std
::
endl
#ifdef RING_VIDEO
<<
"[Video support enabled]"
<<
std
::
endl
...
...
configure.ac
View file @
3d4724cd
...
...
@@ -2,9 +2,9 @@ dnl Jami - configure.ac for automake 1.9 and autoconf 2.59
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.65])
AC_INIT([
Ring Daemon],[7.5.0],[ring@gnu.org],[ring
])
AC_INIT([
Jami Daemon],[7.5.0],[ring@gnu.org],[jami
])
AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-201
8
]])
AC_COPYRIGHT([[Copyright (c) Savoir-faire Linux 2004-201
9
]])
AC_REVISION([$Revision$])
dnl Where to find configure files
...
...
src/fileutils.cpp
View file @
3d4724cd
...
...
@@ -500,7 +500,7 @@ void set_program_dir(char *program_path)
#endif
std
::
string
get_cache_dir
()
get_cache_dir
(
const
char
*
pkg
)
{
#ifdef RING_UWP
std
::
vector
<
std
::
string
>
paths
;
...
...
@@ -530,16 +530,22 @@ get_cache_dir()
#elif defined(__APPLE__)
return
get_home_dir
()
+
DIR_SEPARATOR_STR
+
"Library"
+
DIR_SEPARATOR_STR
+
"Caches"
+
DIR_SEPARATOR_STR
+
PACKAGE
;
+
DIR_SEPARATOR_STR
+
pkg
;
#else
return
get_home_dir
()
+
DIR_SEPARATOR_STR
+
".cache"
+
DIR_SEPARATOR_STR
+
PACKAGE
;
".cache"
+
DIR_SEPARATOR_STR
+
pkg
;
#endif
#ifndef RING_UWP
}
#endif
}
std
::
string
get_cache_dir
()
{
return
get_cache_dir
(
PACKAGE
);
}
std
::
string
get_home_dir
()
{
...
...
@@ -585,7 +591,7 @@ get_home_dir()
}
std
::
string
get_data_dir
()
get_data_dir
(
const
char
*
pkg
)
{
#if defined(__ANDROID__) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
std
::
vector
<
std
::
string
>
paths
;
...
...
@@ -596,7 +602,7 @@ get_data_dir()
#elif defined(__APPLE__)
return
get_home_dir
()
+
DIR_SEPARATOR_STR
+
"Library"
+
DIR_SEPARATOR_STR
+
"Application Support"
+
DIR_SEPARATOR_STR
+
PACKAGE
;
+
DIR_SEPARATOR_STR
+
pkg
;
#elif defined (RING_UWP)
std
::
vector
<
std
::
string
>
paths
;
emitSignal
<
DRing
::
ConfigurationSignal
::
GetAppDataPath
>
(
""
,
&
paths
);
...
...
@@ -612,16 +618,22 @@ get_data_dir()
#else
const
std
::
string
data_home
(
XDG_DATA_HOME
);
if
(
not
data_home
.
empty
())
return
data_home
+
DIR_SEPARATOR_STR
+
PACKAGE
;
return
data_home
+
DIR_SEPARATOR_STR
+
pkg
;
// "If $XDG_DATA_HOME is either not set or empty, a default equal to
// $HOME/.local/share should be used."
return
get_home_dir
()
+
DIR_SEPARATOR_STR
".local"
DIR_SEPARATOR_STR
"share"
DIR_SEPARATOR_STR
+
PACKAGE
;
"share"
DIR_SEPARATOR_STR
+
pkg
;
#endif
}
std
::
string
get_config_dir
()
get_data_dir
()
{
return
get_data_dir
(
PACKAGE
);
}
std
::
string
get_config_dir
(
const
char
*
pkg
)
{
#if defined(__ANDROID__) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS)
std
::
vector
<
std
::
string
>
paths
;
...
...
@@ -646,14 +658,14 @@ get_config_dir()
#if defined(__APPLE__)
std
::
string
configdir
=
fileutils
::
get_home_dir
()
+
DIR_SEPARATOR_STR
+
"Library"
+
DIR_SEPARATOR_STR
+
"Application Support"
+
DIR_SEPARATOR_STR
+
PACKAGE
;
+
DIR_SEPARATOR_STR
+
pkg
;
#else
std
::
string
configdir
=
fileutils
::
get_home_dir
()
+
DIR_SEPARATOR_STR
+
".config"
+
DIR_SEPARATOR_STR
+
PACKAGE
;
".config"
+
DIR_SEPARATOR_STR
+
pkg
;
#endif
const
std
::
string
xdg_env
(
XDG_CONFIG_HOME
);
if
(
not
xdg_env
.
empty
())
configdir
=
xdg_env
+
DIR_SEPARATOR_STR
+
PACKAGE
;
configdir
=
xdg_env
+
DIR_SEPARATOR_STR
+
pkg
;
if
(
fileutils
::
recursive_mkdir
(
configdir
.
data
(),
0700
)
!=
true
)
{
// If directory creation failed
...
...
@@ -664,6 +676,12 @@ get_config_dir()
#endif
}
std
::
string
get_config_dir
()
{
return
get_config_dir
(
PACKAGE
);
}
bool
recursive_mkdir
(
const
std
::
string
&
path
,
mode_t
mode
)
{
...
...
src/fileutils.h
View file @
3d4724cd
...
...
@@ -56,6 +56,10 @@
namespace
ring
{
namespace
fileutils
{
std
::
string
get_home_dir
();
std
::
string
get_config_dir
(
const
char
*
pkg
);
std
::
string
get_data_dir
(
const
char
*
pkg
);
std
::
string
get_cache_dir
(
const
char
*
pkg
);
std
::
string
get_config_dir
();
std
::
string
get_data_dir
();
std
::
string
get_cache_dir
();
...
...
src/manager.cpp
View file @
3d4724cd
...
...
@@ -107,6 +107,7 @@ using ConferenceMap = std::map<std::string, std::shared_ptr<Conference>>;
using
CallIDSet
=
std
::
set
<
std
::
string
>
;
static
constexpr
int
ICE_INIT_TIMEOUT
{
10
};
static
constexpr
const
char
*
PACKAGE_OLD
=
"ring"
;
std
::
atomic_bool
Manager
::
initialized
=
{
false
};
...
...
@@ -136,6 +137,15 @@ restore_backup(const std::string &path)
copy_over
(
backup_path
,
path
);
}
void
check_rename
(
const
std
::
string
&
old_dir
,
const
std
::
string
&
new_dir
)
{
if
(
old_dir
!=
new_dir
and
fileutils
::
isDirectory
(
old_dir
)
and
not
fileutils
::
isDirectory
(
new_dir
))
{
RING_WARN
()
<<
"Migrating"
<<
old_dir
<<
" to "
<<
new_dir
;
std
::
rename
(
old_dir
.
c_str
(),
new_dir
.
c_str
());
}
}
/**
* Set OpenDHT's log level based on the DHTLOGLEVEL environment variable.
* DHTLOGLEVEL = 0 minimum logging (=disable)
...
...
@@ -687,7 +697,7 @@ Manager::init(const std::string &config_file)
throw std::runtime_error(#ret " failed"); \
} while (0)
srand
(
time
(
NULL
));
// to get random number for RANDOM_PORT
srand
(
time
(
nullptr
));
// to get random number for RANDOM_PORT
// Initialize PJSIP (SIP and ICE implementation)
PJSIP_TRY
(
pj_init
());
...
...
@@ -704,6 +714,10 @@ Manager::init(const std::string &config_file)
setDhtLogLevel
();
check_rename
(
fileutils
::
get_cache_dir
(
PACKAGE_OLD
),
fileutils
::
get_cache_dir
());
check_rename
(
fileutils
::
get_data_dir
(
PACKAGE_OLD
),
fileutils
::
get_data_dir
());
check_rename
(
fileutils
::
get_config_dir
(
PACKAGE_OLD
),
fileutils
::
get_config_dir
());
pimpl_
->
ice_tf_
.
reset
(
new
IceTransportFactory
());
pimpl_
->
path_
=
config_file
.
empty
()
?
pimpl_
->
retrieveConfigPath
()
:
config_file
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment