Merge lp:~smoser/ubuntu/precise/cobbler/import-fix-unknown-distros into lp:ubuntu/precise/cobbler

Proposed by Scott Moser on 2012-01-25
Status: Merged
Merged at revision: 73
Proposed branch: lp:~smoser/ubuntu/precise/cobbler/import-fix-unknown-distros
Merge into: lp:ubuntu/precise/cobbler
Diff against target: 78 lines (+35/-7)
3 files modified
debian/changelog (+7/-0)
debian/cobbler-ubuntu-import (+21/-1)
debian/control (+7/-6)
To merge this branch: bzr merge lp:~smoser/ubuntu/precise/cobbler/import-fix-unknown-distros
Reviewer Review Type Date Requested Status
Colin Watson 2012-01-25 Approve on 2012-01-27
Review via email: mp+90211@code.launchpad.net
To post a comment you must log in.
Colin Watson (cjwatson) wrote :

Looks good to me, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-01-23 11:22:39 +0000
3+++ debian/changelog 2012-01-25 21:39:24 +0000
4@@ -1,3 +1,10 @@
5+cobbler (2.2.2-0ubuntu17) UNRELEASED; urgency=low
6+
7+ * cobbler-ubuntu-import: fix update-existing to only update
8+ distros formated as '<codename>-<arch>'
9+
10+ -- Scott Moser <smoser@ubuntu.com> Wed, 25 Jan 2012 16:31:51 -0500
11+
12 cobbler (2.2.2-0ubuntu16) precise; urgency=low
13
14 * cobbler-ubuntu-import: fix bug where 'amd64' arch was not actually
15
16=== modified file 'debian/cobbler-ubuntu-import'
17--- debian/cobbler-ubuntu-import 2012-01-19 21:41:49 +0000
18+++ debian/cobbler-ubuntu-import 2012-01-25 21:39:24 +0000
19@@ -140,6 +140,17 @@
20 [ "$md5sum_local" != "$md5sum_remote" ]
21 }
22
23+# inargs(needle, haystack, ...)
24+# return 0 if 'needle' == one of args $2..$#
25+in_args() {
26+ local cur="" needle=$1
27+ shift;
28+ for cur in "$@"; do
29+ [ "$needle" = "$cur" ] && return 0;
30+ done
31+ return 1
32+}
33+
34 short_opts="Dhm:o:p:vcruU"
35 long_opts="delete-iso,help,mirror:,proxy:,remove,update,update-existing,update-check,remove,verbose"
36 getopt_out=$(getopt --name "${0##*/}" \
37@@ -179,7 +190,16 @@
38 fail "failed to get list of existing distros"
39 [ -n "$_existing" ] ||
40 fail "there were no existing distros of type ubuntu"
41- set -- $_existing
42+ supported=( $(distro-info --supported) ) ||
43+ fail "--update-existing requires 'distro-info'"
44+ to_update=( )
45+ for item in $_existing; do
46+ in_args "${item%%-*}" "${supported[@]}" &&
47+ in_args "${item#*-}" "i386" "x86_64" &&
48+ to_update[${#to_update[@]}]=${item} ||
49+ echo "$item: skipping, not <codename>-<arch>"
50+ done
51+ set -- "${to_update[@]}"
52 fi
53 [ $# -ne 0 ] || bad_Usage "must provide arguments"
54
55
56=== modified file 'debian/control'
57--- debian/control 2012-01-18 13:50:40 +0000
58+++ debian/control 2012-01-25 21:39:24 +0000
59@@ -29,12 +29,13 @@
60 rsync,
61 syslinux | syslinux-common,
62 cobbler-common (= ${binary:Version})
63-Recommends: hardlink,
64- powerwake,
65- tftpd-hpa,
66- cobbler-web,
67- debmirror,
68- fence-agents
69+Recommends: cobbler-web,
70+ debmirror,
71+ distro-info,
72+ fence-agents,
73+ hardlink,
74+ powerwake,
75+ tftpd-hpa
76 Suggests: createrepo,
77 bind9,
78 dhcp3-server,

Subscribers

People subscribed via source and target branches

to all changes: