File: sanitize-gdb.sh

package info (click to toggle)
gdb 7.6.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 179,684 kB
  • ctags: 276,733
  • sloc: ansic: 1,879,334; asm: 317,014; exp: 104,364; makefile: 52,200; sh: 22,475; yacc: 10,781; cpp: 9,927; xml: 5,902; perl: 4,960; python: 2,331; ada: 1,791; pascal: 1,436; lex: 621; lisp: 536; sed: 228; f90: 144; awk: 136; objc: 134; java: 73; fortran: 43
file content (100 lines) | stat: -rw-r--r-- 2,330 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash

set -e

tarball=$1
if ! test -f "$tarball"; then
  echo "Could not open $tarball"
  exit 1
fi

tardir=$(dirname "$tarball")
tardir=$(cd "$tardir" && pwd)
version=$(basename "$tarball" | sed "s/^gdb-//; s/\.tar\.bz2\$//")
debversion=${version}
tarball="$tardir"/gdb-$version.tar.bz2
dfsg="$tardir/gdb_$debversion.orig.tar.gz"
doc="$tardir/gdb-doc_$version.orig.tar.gz"

dir=`cd $(dirname "$0") && pwd`

temp=$(mktemp -d)
olddir=`pwd`

cd "$temp"
mkdir src
cd src
tar xjf "$tarball"
cd ..

src=src/gdb-$version
dest=gdb-$debversion
dest2=gdb-doc-$version

if ! test -d "$src"; then
  echo "Could not find source directory $src"
  exit 1
fi

if test -z "$dest" || test -e "$dest"; then
  echo "Could not create dest directory $dest"
  exit 1
fi

if test -z "$dest2" || test -e "$dest2"; then
  echo "Could not create dest directory $dest2"
  exit 1
fi

src=`cd "$src" && pwd`

cp -a "$src" "$dest"
pushd "$dest" > /dev/null

# The GDB manual pages are not covered by the GFDL, but the simulator's
# is.
echo > sim/common/run.1

# Almost all of the texinfo documentation is GFDL.  PSIM's is not, but
# we don't need that manual especially anyway.  Special care must be taken
# with observer.texi, which is necessary for the build process.  Remove
# all pregenerated info files, then replace all texinfo files with dummy
# versions.

rm -f $(find . \( -name \*.info -o -name \*.info-\* \))

for f in $(find . \( -name \*.texinfo -o -name \*.texi \)); do
  if test $(basename $f) = observer.texi; then
    sed -ne '/@c This/,/@c any later/p; /@deftype/p' "$src/$f" > $f
    continue
  fi

  echo > "$f"
done

popd > /dev/null
mkdir "$dest2"
mkdir "$dest2"/readline
cp -a "$src"/readline/doc "$dest2"/readline/doc
mkdir "$dest2"/gdb
cp -a "$src"/gdb/doc "$dest2"/gdb/doc
cp -a "$src"/config "$dest2"/config

# Supporting files.
cp -a "$src"/COPYING* "$dest2/"
cp -a "$src"/ChangeLog "$dest2/"
cp -a "$src"/MAINTAINERS "$dest2/"
cp -a "$src"/README* "$dest2/"
cp -a "$src"/config.guess "$dest2/"
cp -a "$src"/config.sub "$dest2/"
cp -a "$src"/install-sh "$dest2/"
cp -a "$src"/mkinstalldirs "$dest2/"
cp -a "$src"/gdb/.gitignore "$dest2"/gdb/
cp -a "$src"/gdb/version.in "$dest2"/gdb/
cp -a "$src"/readline/[A-Z]* "$dest2"/readline/

tar czf "$dfsg" gdb-$debversion
tar czf "$doc" gdb-doc-$version

cd "$olddir"
rm -rf $temp