~ubuntu-branches/ubuntu/lucid/dh-kpatches/lucid

« back to all changes in this revision

Viewing changes to lskpatches

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2004-10-24 17:16:12 UTC
  • mfrom: (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041024171612-nscnf579yxbdnbow
Tags: 0.99.35
Added support for single irregular kernel versions like 2.6.8.1 (patch
from Norbert Buchmuller, closes: #274410).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
set -e
 
3
 
 
4
KPATCHDIR=/usr/src/kernel-patches
 
5
FORMAT='%-20s%-10s%-10s%-12s%s\n'
 
6
 
 
7
ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
 
8
 
 
9
DIRS_ALL_ALL=$(ls -d ${KPATCHDIR}/all/apply 2>/dev/null || true)
 
10
DIRS_ARCH_ALL=$(ls -d ${KPATCHDIR}/*/apply 2>/dev/null | grep -v "^${KPATCHDIR}/all/" || true)
 
11
DIRS_ALL_VERS=$(ls -d ${KPATCHDIR}/all/*/apply 2>/dev/null || true)
 
12
DIRS_ARCH_VERS=$(ls -d ${KPATCHDIR}/*/*/apply 2>/dev/null | grep -v "^${KPATCHDIR}/all/" || true)
 
13
 
 
14
# Note: additional "echo $()" calls used to strip spurious spaces
 
15
 
 
16
dhkp_kversions()
 
17
{
 
18
    echo $(grep ^KVERSIONS $1 | sed 's/^.*(\(.*\))$/\1/')
 
19
}
 
20
 
 
21
dhkp_version()
 
22
{
 
23
    local rcs=$(echo $(grep -F 'apply.tmpl $''Revision:' $1 | cut -d'$' -f2 | cut -d: -f2))
 
24
    local dhkp=$(grep ^DHPKPATCHES_VERSION= $1 | cut -d= -f2)
 
25
    if [ -n "${dhkp}" ]
 
26
    then
 
27
        # post-woody
 
28
        echo ${dhkp}
 
29
    elif [ -n "${rcs}" ]
 
30
    then
 
31
        # woody era
 
32
        echo "RCS ${rcs}"
 
33
    else
 
34
        echo '<not built using dh-kpatches>'
 
35
    fi
 
36
}
 
37
 
 
38
format()
 
39
{
 
40
    printf ${FORMAT} "$1" "$2" "$3" "$(dhkp_version $1)" "$(dhkp_kversions $1)"
 
41
}
 
42
 
 
43
# Header
 
44
printf ${FORMAT} PatchID Arch KVers dhkpVers dhkp-KVers
 
45
 
 
46
 
 
47
for dir in ${DIRS_ALL_ALL}
 
48
do
 
49
    (
 
50
        cd ${dir}
 
51
        for kp in $(ls)
 
52
        do
 
53
            format ${kp} 'all' 'all'
 
54
        done
 
55
    )
 
56
done
 
57
 
 
58
for dir in ${DIRS_ARCH_ALL}
 
59
do
 
60
    (
 
61
        arch=$(basename $(dirname ${dir}))
 
62
        cd ${dir}
 
63
        for kp in $(ls)
 
64
        do
 
65
            format ${kp} ${arch} 'all'
 
66
        done
 
67
    )
 
68
done
 
69
 
 
70
 
 
71
for dir in ${DIRS_ALL_VERS}
 
72
do
 
73
    (
 
74
        vers=$(basename $(dirname ${dir}))
 
75
        cd ${dir}
 
76
        for kp in $(ls)
 
77
        do
 
78
            format ${kp} 'all' ${vers}
 
79
        done
 
80
    )
 
81
done
 
82
 
 
83
 
 
84
for dir in ${DIRS_ARCH_VERS}
 
85
do
 
86
    (
 
87
        vers=$(basename $(dirname ${dir}))
 
88
        arch=$(basename $(dirname $(dirname ${dir})))
 
89
        cd ${dir}
 
90
        for kp in $(ls)
 
91
        do
 
92
            format ${kp} ${arch} ${vers}
 
93
        done
 
94
    )
 
95
done