debmirror.sh.erb 1.29 KB
Newer Older
Christopher Huhn's avatar
Christopher Huhn committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
#
# generated by Chef from the debmirror cookbook
#

# Architecture (i386, powerpc, amd64, etc.)
arch=<%= @arch.join(',') %>

# Section (main,contrib,non-free)
section=<%= @section.join(',') %>

# Release of the system (squeeze,lenny,stable,testing,etc)
release=<%= @release.join(',') %>

# Server name, minus the protocol and the path at the end
server=<%= @server %>

# Path from the main server, so http://my.web.server/$dir, Server dependant
path=<%= @path %>

# Protocol to use for transfer (http, ftp, hftp, rsync)
proto=<%= @proto %>

# Directory to store the mirror in
storage=<%= @storage %>

# Start script

<%- if @rsync_extra == ['none'] -%>
# filter out trace warning assuming we know what we are doing:
error_filter() {
  "$@" 2> >(sed -e '/Warning: --rsync-extra is not configured to mirror the trace files\.$/{N;/ *This configuration is not recommended\./d}' >&2)
}

error_filter <%- end -%>debmirror \
            --dist $release \
            --arch $arch \
         --section $section \
          --method $proto \
            --host $server \
            --root $path \
         --keyring <%= @keyring %> \
<%- if @rsync_extra -%>
     --rsync-extra <%= @rsync_extra.join(',') %> \
<%- end -%>
<% @options.each do |option| %>
<%= option %> \
<% end -%>
                   $storage "$@"