home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / debian / pkg / source / postinst < prev    next >
Encoding:
Text File  |  2005-06-08  |  1.8 KB  |  86 lines

  1. #!/usr/bin/perl
  2. #                              -*- Mode: Cperl -*- 
  3. # debian.postinst ---
  4. # Author           : Manoj Srivastava ( srivasta@pilgrim.umass.edu )
  5. # Created On       : Sat Apr 27 05:42:43 1996
  6. # Created On Node  : melkor.pilgrim.umass.edu
  7. # Last Modified By : Manoj Srivastava
  8. # Last Modified On : Tue Mar  2 18:34:29 2004
  9. # Last Machine Used: glaurung.internal.golden-gryphon.com
  10. # Update Count     : 42
  11. # Status           : Unknown, Use with caution!
  12. # HISTORY          :
  13. # Description      :
  14. #
  15. #
  16. #
  17. #  arch-tag: ae5907e4-2617-4db5-964a-1b5f45bedc1a
  18. #
  19.  
  20.  
  21. $|=1;
  22.  
  23. # Predefined values:
  24. my $package="=P";
  25. my $version="=V";
  26.  
  27. # Ignore all invocations uxcept when called on to configure.
  28. exit 0 unless ($ARGV[0] && $ARGV[0] =~ /configure/);
  29.  
  30. my $architecture;
  31. chomp($architecture = `dpkg --print-installation-architecture`);
  32. $architecture = "ppc" if $architecture eq "powerpc";
  33. $architecture = "parisc" if $architecture eq "hppa";
  34. $architecture = "mips" if $architecture eq "mipsel";
  35. $architecture = "x86_64" if $architecture eq "amd64";
  36.  
  37. my $stop_and_read     = 0;
  38. my $have_conffile     = "";
  39. my $src_postinst_hook = '';
  40. my $CONF_LOC          = '/etc/kernel-img.conf';
  41.  
  42. # most of our work is done in /usr/src.
  43. chdir '/usr/src' or die "Could not chdir to /usr/src:$!";
  44.  
  45. if (-l 'linux') {
  46.   if (-e "linux-$version" ){
  47.     if (! unlink "linux-$version") {
  48.       exit 0;
  49.     }
  50.   }
  51. }
  52.  
  53. if (-r "$CONF_LOC" && -f "$CONF_LOC"  ) {
  54.   if (open(CONF, "$CONF_LOC")) {
  55.     while (<CONF>) {
  56.       chomp;
  57.       s/\#.*$//g;
  58.       next if /^\s*$/;
  59.  
  60.       $src_postinst_hook   = "$1"  if /src_postinst_hook\s*=\s*(\S+)/ig;
  61.     }
  62.     close CONF;
  63.     $have_conffile = "Yes";
  64.   }
  65. }
  66.  
  67. ## Run user hook script here, if any
  68. if (-x "$src_postinst_hook") {
  69.     system ("$src_postinst_hook", $package, $version) &&
  70.     warn "User hook script $src_postinst_hook failed";
  71. }
  72.  
  73.  
  74.  
  75. exit 0;
  76.  
  77. __END__
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.