File: modifydpkg

package info (click to toggle)
linbot 0.8-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 140 kB
  • ctags: 5
  • sloc: sh: 602; makefile: 126; perl: 7
file content (75 lines) | stat: -rwxr-xr-x 1,873 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
#!/bin/sh
#
# source:
#   /var/cvs/projects/debian/dpkg.common/modifydpkg,v
#
# revision:
#   @(#) modifydpkg,v 1.6 1998/05/05 02:42:56 jplejacq Exp
#
# copyright:
#   Copyright (C) 1998 Jean Pierre LeJacq <jplejacq@quoininc.com>
#
#   Distributed under the GNU GENERAL PUBLIC LICENSE.
#
# synopsis:
#   modifydpkg -p <DH_DOPACKAGES> -P <DH_TMPDIR>
#
# description:
#   Modification script for package files add to pristine source.
#
#   The files added to the pristine source for this debian package
#   have been parameterized to support relocation of the files.  All
#   installed file and directory locations are specified in
#   debian/scripts/substfiles.  This program reads that file and takes
#   each file in debian/src_dpkg/*.in and debian/scripts/*.in and
#   makes the substitution.
#
#   I've implemented argument parsing with the debhelper package.  The
#   sourced file, dh_lib, will define the two arguments.  Currently
#   the arguments are not used.


# main:
  set -e

  . debian/dpkg.common/substfiles 
  . debian/dpkg.scripts/substfiles


  echo "${0}: modifying debian files..."
    sed_cmd=""

    for sed_var in\
      $(grep = debian/dpkg.common/substfiles | cut -f 1 -d = | grep -v subtmp)
    do
      sed_value=$(eval echo "\${${sed_var}}")
      sed_cmd="${sed_cmd}s^@@${sed_var}@@^${sed_value}^g;"
    done

    for sed_var in\
      $(grep = debian/dpkg.scripts/substfiles | cut -f 1 -d = | grep -v subtmp)
    do
      sed_value=$(eval echo "\${${sed_var}}")
      sed_cmd="${sed_cmd}s^@@${sed_var}@@^${sed_value}^g;"
    done

    for file in $(ls ./debian/dpkg.src/*.in)
    do
      sed -e "\
        ${sed_cmd}\
      "\
      ${file} > ${file%.in}
    done

    for file in $(ls ./debian/dpkg.scripts/*.in)
    do
      sed -e "\
        ${sed_cmd}\
      "\
      ${file} > ${file%.in}

      chmod a+x ${file%.in}
    done


  exit 0