File: include.postinst

package info (click to toggle)
kernel-package 6.05
  • links: PTS
  • area: main
  • in suites: slink
  • size: 620 kB
  • ctags: 190
  • sloc: perl: 1,228; makefile: 703; sh: 39
file content (100 lines) | stat: -rwxr-xr-x 2,258 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
#! /usr/bin/perl
#                              -*- Mode: Perl -*- 
# debian.postinst --- 
# Author           : Manoj Srivastava ( srivasta@pilgrim.umass.edu ) 
# Created On       : Sat Apr 27 05:42:43 1996
# Created On Node  : melkor.pilgrim.umass.edu
# Last Modified By : Manoj Srivastava
# Last Modified On : Wed Feb 18 17:07:43 1998
# Last Machine Used: tiamat.datasync.com
# Update Count     : 25
# Status           : Unknown, Use with caution!
# HISTORY          : 
# Description      : 
# 
# 
#
#    $Id: include.postinst,v 1.11 1998/09/08 19:50:00 srivasta Exp $
#


$|=1;

# Predefined values:
my $package="=P";
my $version="=V";

# Ignore all invocations uxcept when called on to configure.
exit 0 unless ($ARGV[0] && $ARGV[0] =~ /configure/);

my $architecture;
chomp($architecture = `dpkg --print-installation-architecture`);
$architecture = "ppc" if $architecture eq "powerpc";

my $stop_and_read = 0;

# most of our work is done in /usr/src.
chdir '/usr/src' or die "Could not chdir to /usr/src:$!";

if (-d "$package") {

  chdir "/usr/src/$package/include" ||
    die "Could not chdir to  /usr/src/$package/include:$!";

  if (! -d "asm-$architecture") {
    warn "/usr/src/$package/include/asm-$architecture does not exist.\n";
  }
  elsif (-e 'asm') {
    if (! -l 'asm') {
      warn "/usr/src/$package/include/asm is not a symlink.\n";
      $stop_and_read++;
    }
    else {
      my $target=readlink 'asm';
      if ("$target" ne "asm-$architecture") {
	if (! unlink 'asm') {
	  warn "could not unlink /usr/src/$package/include/asm: $!\n";
	  warn "It points to /usr/src/$package/include/$target\n";
	  warn  "rather than at /usr/src/$package/include/asm-$architecture\n";
	  $stop_and_read++;
	}
	else {
	  if (! symlink "asm-$architecture", 'asm') {
	    warn "Could not link /usr/src/$package/include/asm:$!\n";
	    warn "to /usr/src/$package/include/asm-$architecture\n";
	    $stop_and_read++;
	  }
	}
      }
    }
  }
}

chdir '/usr/src' or die "Could not chdir to /usr/src:$!";

if ($stop_and_read) {
  my $answer;
  print STDERR " Please Hit return to continue.";
  $answer = <STDIN>;
}

if (-l 'linux') {
  if (-e "linux-$version" ){
    if (! unlink "linux-$version") {
      exit 0;
    }
  }
}


exit 0;

__END__