~xorg-edgers/xorg-server/xorg-pkg-tools

« back to all changes in this revision

Viewing changes to lts-pkg-rename

  • Committer: Maarten Lankhorst
  • Date: 2015-01-06 09:35:24 UTC
  • Revision ID: maarten.lankhorst@canonical.com-20150106093524-gfr3tb69rb0wzkjj
update for lts-utopic

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
set -e
41
41
 
42
 
extraversion="~~14.04~ppa5."
43
 
lts_codename="trusty"
44
 
default_changelog_entry="Rebuild utopic packages in a ppa."
 
42
extraversion="~trusty"
 
43
lts_codename="trusty-proposed"
 
44
default_changelog_entry="Rebuild utopic package for lts-trusty for all archs. (LP: #1400626)"
45
45
 
46
46
if [ "$0" = "$(basename "$0")" ]; then
47
47
    basedir="$(dirname $(readlink -e $(which "$0")))"
63
63
}
64
64
 
65
65
warn() {
66
 
    echo "Error: $*" 2>&1
 
66
    echo "Warning: $*" 2>&1
67
67
}
68
68
 
69
69
msg() {
115
115
# Determine package name from the changelog
116
116
changelog=debian/changelog
117
117
if [ ! -e ${changelog} ]; then
118
 
    dbg $PWD
119
 
    ERR "Could not locate debian/changelog from the current dir"
 
118
    ERR "Could not locate debian/changelog from the current dir ${PWD}"
120
119
fi
121
120
 
122
121
rules=debian/rules
123
122
if [ ! -e ${rules} ]; then
124
 
    dbg $PWD
125
 
    ERR "Could not locate debian/rules from the current dir"
 
123
    ERR "Could not locate debian/rules from the current dir ${PWD}"
126
124
fi
127
125
 
128
126
control=debian/control
129
127
if [ ! -e ${rules} ]; then
130
 
    msg $PWD
131
 
    ERR "Could not locate debian/control from the current dir"
 
128
    ERR "Could not locate debian/control from the current dir ${PWD}"
132
129
fi
133
130
 
134
131
old_package=$(head -n 1 ${changelog} | cut -d' ' -f1)
139
136
old_binaries=$(grep ^Package: ${control} | grep -v -- -dbg | cut -f2 -d' ')
140
137
 
141
138
if [[ "${old_package}" =~ ${suffix}$ ]]; then
142
 
    dbg ${old_package}
143
 
    warn "Already renamed"
 
139
    warn "Already renamed ${old_package}"
144
140
    exit 0
145
141
fi
146
142
 
167
163
else
168
164
    cp debian/changelog debian/changelog.old
169
165
fi
 
166
# Geode has a changelog.dch file that breaks things, kill it just in case..
 
167
rm -f debian/changelog.dch
170
168
 
171
169
msg "Updating the maintainer..."
172
170
update-maintainer -q
265
263
    ;;
266
264
esac
267
265
 
268
 
if [ "${suffix}" != "lts-quantal" ]; then
 
266
if [ "${suffix}" != "lts-quantal" -a "$backport_arch" = "precise" ]; then
269
267
        # Suppress building arm packages, only i386 and amd64 are supported
270
268
        $dry sed -e "/^Architecture: any\$/s/:.*/: amd64 i386/" \
271
269
                 -e "/^Architecture: linux-any/s/:.*/: amd64 i386/" \
332
330
 
333
331
msg "Checking rules..."
334
332
if ! grep -q ${old_package} ${rules}; then
335
 
    dbg "${rules} mentions ${old_package}"
336
 
    warn "Manual update of ${rules} required"
 
333
    warn "Manual update of ${rules} required for ${old_package}"
337
334
fi
338
335
 
339
336
msg "Renaming binary install, etc. files..."
345
342
 
346
343
    msg "- Renaming ${pkg}.* files to ${newpkg}.*"
347
344
 
348
 
    set +e
349
 
    files=$(ls debian/${pkg}.*)
350
 
    err=$?
351
 
    set -e
352
 
    if [ $err -ne 0 ]; then
353
 
        warn "Failed to list in ${old_package} for ${old_package} -> ${new_package}"
354
 
        continue
355
 
    fi
356
 
    for old_file in $files; do
357
 
        new_file=${old_file/${pkg}/${newpkg}}
358
 
        $dry mv -v ${old_file} ${new_file}
359
 
    # TODO: Maybe using 'rename' would be better?
360
 
    done
361
 
 
362
345
    # Argh my eyes, so terribly sorry about this
363
346
    # substitute $(XXV) for ati
364
347
    # dumb rename for packages install rules
385
368
        -e "/--link-doc/s/=${pkg}/&-${suffix}/" \
386
369
        -i debian/rules.new
387
370
 
 
371
    set +e
 
372
    files=$(ls debian/${pkg}.*)
 
373
    err=$?
 
374
    set -e
 
375
    if [ $err -ne 0 ]; then
 
376
        warn "Failed to list in ${old_package} for ${pkg} -> ${newpkg}"
 
377
        continue
 
378
    fi
 
379
    for old_file in $files; do
 
380
        new_file=${old_file/${pkg}/${newpkg}}
 
381
        $dry mv -v ${old_file} ${new_file}
 
382
    # TODO: Maybe using 'rename' would be better?
 
383
    done
 
384
 
388
385
    if [ -f "debian/${newpkg}.symbols" ]; then
389
386
        sed -e "s/ ${pkg} / ${newpkg} /" -i "debian/${newpkg}.symbols"
390
387
    elif [ -n "$dry" -a "debian/${pkg}.symbols" ]; then