Compare commits

..
4 Commits
39 .. 43
Author SHA1 Message Date
Auke Kok 60db7bab0f v43 2017-06-06 13:28:11 -07:00
Auke Kok ef6b11498a DefaultDependencies keyword is only valid in [Unit] context. 2017-06-06 13:27:20 -07:00
Auke Kok efeed3e83f v42. 2017-06-01 16:22:00 -07:00
Auke Kok f5542e7fbb Fetch timestamp from debuginfo server.
We trigger redownloads from the server if the timestamp of
downloaded tar files is too new. An easy way around this issue
is to request the timestamp from the server instead of using
the download time. A `touch` of the tar then assures that
the downloaded file has the same timestamp as the server has.
2017-06-01 16:19:15 -07:00
4 changed files with 18 additions and 3 deletions
+1 -1
View File
@@ -1,10 +1,10 @@
[Unit]
Description=Clear Linux debuginfo daemon
DefaultDependencies=no
[Service]
Type=simple
ExecStart=/usr/bin/clr_debug_daemon
DefaultDependencies=no
[Install]
WantedBy=multi-user.target
+1 -1
View File
@@ -1,11 +1,11 @@
[Unit]
Description=Clear Linux debuginfo fuse monitor
After=clr_debug_daemon.service
DefaultDependencies=no
[Service]
Type=simple
ExecStart=/usr/bin/clr_debug_fuse
DefaultDependencies=no
[Install]
WantedBy=multi-user.target
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.66])
AC_INIT(clr-debug-info, 38, arjan@linux.intel.com)
AC_INIT(clr-debug-info, 43, arjan@linux.intel.com)
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CC
+15
View File
@@ -162,6 +162,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
{
CURLcode code;
long ret;
long changed;
int fd;
char filename[PATH_MAX];
CURL *curl = NULL;
@@ -203,6 +204,9 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 30);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024);
/* request timestamp of files from server */
curl_easy_setopt(curl, CURLOPT_FILETIME, 1);
if (timestamp) {
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, timestamp);
@@ -230,6 +234,17 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
}
if (ret == 200) {
/* get timestamp, if any */
curl_easy_getinfo(curl, CURLINFO_FILETIME, &changed);
if (changed >= 0) {
struct timespec times[2];
times[0].tv_sec = (time_t)changed;
times[0].tv_nsec = 0;
times[1].tv_sec = (time_t)changed;
times[1].tv_nsec = 0;
futimens(fd, times);
}
autofree(char) *command = NULL;
// printf("Filename is %s\n", filename);