15 Commits
Author SHA1 Message Date
Matt Brown 01f7198c2f bump version to 0.2.0 2019-08-05 13:15:03 -04:00
Nick Platt c08ef16cec Move gitignore to within debian directory 2017-08-01 11:35:39 -04:00
Matt Brown 5cf4ef1234 remove docker Build-Depends for debian package
These are not necessary
2015-11-17 14:59:24 -05:00
Matt Brown 0e7d4a9ddb remove make from override_dh_auto_build 2015-11-17 14:55:01 -05:00
Matt Brown e6f74c85ed add override_dh_auto_build to debian/rules 2015-11-17 13:56:50 -05:00
Matt Brown ef5f9dee86 add lxc-docker as build dependency 2015-11-16 14:36:12 -05:00
David Xia b0cc52aa3d Bump version from 0.0.4 to 2:0.1.0 2015-10-05 16:17:04 -04:00
Daniele Sluijters 66260330a9 docker-gc: Calculate elapsed time in Bash
This removes the dependency on Python and as such also removed
Python as a runtime dependency in the `debian/control` file.

I've compared both functions with the following script:
```bash
time_15="2015-07-03T02:39:00.39028499"
time_17="2015-07-03 02:39:00.390284991 +0000 UTC"

function date_parse {
  if date --utc >/dev/null 2>&1; then
    # GNU/date
    echo $(date -u --date "${1}" "+%s")
  else
    # BSD/date
    echo $(date -j -u -f "%F %T" "${1}" "+%s")
  fi
}

function elapsed_time() {
    # Docker 1.5.0 datetime format is 2015-07-03T02:39:00.390284991
    # Docker 1.7.0 datetime format is 2015-07-03 02:39:00.390284991 +0000 UTC
    utcnow=$(date -u "+%s")
    without_ms="${1:0:19}"
    replace_t="${without_ms/T/ }"
    epoch=$(date_parse "${replace_t}")
    echo $(($utcnow - $epoch))
}

function ElapsedTime {
    python <<END
from datetime import datetime,timedelta
now = datetime.utcnow()
exited = datetime.strptime('${1}'[:19].replace("T"," "), "%Y-%m-%d %H:%M:%S")
difference = now - exited
differenceTotalSeconds = difference.seconds + difference.days*24*3600
print(int(differenceTotalSeconds))
END
}

for time in "${time_15}" "${time_17}"; do
  echo $(elapsed_time "${time}")
  echo $(ElapsedTime "${time}")
done
```

This results in the following output, proving the functions result
in identical behaviour:

```
2219644
2219644
2219644
2219644
```
2015-07-28 23:08:55 +02:00
Ryan Culbertson 16d6ecdb06 bump version number in changelog 2015-07-06 13:08:03 -04:00
Ryan Culbertson c84ebe052a Do not automatically install as cron job
Leave that to congif management system, which
may want to customize how often this is run.
2015-06-27 12:26:51 -04:00
Drew Csillag 40821a45d8 Tolerate things not existing
1. tolerate /etc/docker-gc-exclude not existing
2. attempt to correct /var/lib/docker-gc not existing
3. continue on when there are no images to reap
2014-10-15 11:13:13 -04:00
Drew Csillag d0e9f7f107 bump version # 2014-10-14 14:54:02 -04:00
Marc Bruggmann 7c202d17dd Depend on python. 2014-09-23 23:41:41 +02:00
Daniel Norberg 33b5a9f466 use /var/lib instead of /var/run
Derp. /var/run is cleared on reboot, breaking docker-gc.
2014-09-23 17:00:24 +02:00
Daniel Norberg 5345540a73 ubuntu packaging 2014-06-22 21:05:24 -04:00