~ubuntu-branches/ubuntu/utopic/pkg-create-dbgsym/utopic

« back to all changes in this revision

Viewing changes to pkg_create_dbgsym

  • Committer: Martin Pitt
  • Date: 2014-02-12 10:39:46 UTC
  • mfrom: (226.1.3 master)
  • Revision ID: martin.pitt@canonical.com-20140212103946-tr2mq05c55y3oskm
Add some debug messages, thanks to Simon McVittie!

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        OBJCOPY=${DEB_HOST_GNU_TYPE}-objcopy
36
36
fi
37
37
 
 
38
dbg() {
 
39
    echo "$0: $*"
 
40
}
 
41
 
38
42
for p; do
39
43
    case $p in
40
44
        -X*)
71
75
# python-*-dbg, these are quite different
72
76
dbgdepends=
73
77
for p in `grep '^Package:.*-dbg' debian/control | cut -f 2 -d\ `; do
74
 
    [ "$p" = "${p#python}" ] || continue
 
78
    if [ "$p" != "${p#python}" ]; then
 
79
        dbg "ignoring python* package: $p"
 
80
        continue
 
81
    fi
75
82
    # heuristic to avoid considering transitional -dbg packages which are going
76
83
    # to be empty
77
 
    [ -z "`perl -n000 -e 'print if m/Package: $p/ && m/transitional/' debian/control`" ] || continue
 
84
    if [ -n "`perl -n000 -e 'print if m/Package: $p/ && m/transitional/' debian/control`" ]; then
 
85
        dbg "ignoring transitional package $p"
 
86
        continue
 
87
    fi
78
88
    [ -z "$dbgdepends" ] || dbgdepends="$dbgdepends, "
79
89
    dbgdepends="$dbgdepends$p (= \1)"
80
90
done
139
149
    }
140
150
done
141
151
if [ -z "$any_unstripped" ]; then
142
 
    echo "$pkgname is already stripped, ignoring" >&2
 
152
    echo "$pkgname has no unstripped objects, ignoring" >&2
143
153
    rm -rf $dp
144
154
    exit 0
145
155
fi
147
157
cd $origdir
148
158
 
149
159
if [ ! -d "$dp" -o -z "`find $dp -type f`" ] && [ -z "$dbgdepends" ]; then
 
160
    dbg "nothing in $dp and no dbgdepends, ignoring"
150
161
    rm -rf $dp
151
162
    exit 0
152
163
fi
185
196
ddeb="${ddebname}_${ddebversion}_${ddebarch}.ddeb"
186
197
 
187
198
# build .ddeb and add it to debian/files
 
199
dbg "building ddeb package"
188
200
NO_PKG_MANGLE=1 dpkg-deb -Zxz --build $dp ../$ddeb
189
201
if [ "$add_to_files" = "1" ]; then
 
202
    dbg "dpkg-distaddfile $ddeb $ddebsection $ddebpriority"
190
203
    dpkg-distaddfile "$ddeb" "$ddebsection" "$ddebpriority"
191
204
fi
192
205