~ubuntu-branches/ubuntu/trusty/libbpp-popgen/trusty

« back to all changes in this revision

Viewing changes to debian/postrm

  • Committer: Package Import Robot
  • Author(s): Julien Dutheil
  • Date: 2013-03-07 10:51:00 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130307105100-7ij3w7iyab9t2mbt
Tags: 2.1.0-1
Bug fixed and warnings removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
# Abort if any command returns an error value
 
4
set -e
 
5
 
 
6
createGeneric() {
 
7
  echo "-- Creating generic include file: $1.all"
 
8
  #Make sure we run into subdirectories first:
 
9
  dirs=()
 
10
  for file in "$1"/*
 
11
  do
 
12
    if [ -d "$file" ]
 
13
    then
 
14
      # Recursion:
 
15
      dirs+=( "$file" )
 
16
    fi
 
17
  done
 
18
  for dir in ${dirs[@]}
 
19
  do
 
20
    createGeneric $dir
 
21
  done
 
22
  #Now list all files, including newly created .all files:
 
23
  if [ -f $1.all ]
 
24
  then
 
25
    rm $1.all
 
26
  fi
 
27
  dir=`basename $1`
 
28
  for file in "$1"/*
 
29
  do
 
30
    if [ -f "$file" ] && ( [ "${file##*.}" == "h" ] || [ "${file##*.}" == "all" ] )
 
31
    then
 
32
      file=`basename $file`
 
33
      echo "#include \"$dir/$file\"" >> $1.all
 
34
    fi
 
35
  done;
 
36
}
 
37
 
 
38
if [ "$1" = "remove" ]; then
 
39
  # Automatically added by dh_makeshlibs
 
40
  ldconfig
 
41
  # Actualize .all files
 
42
  createGeneric /usr/include/Bpp
 
43
fi
 
44
 
 
45
exit 0