Changeset 32


Ignore:
Timestamp:
01/19/06 16:11:50 (18 years ago)
Author:
kdeugau
Message:

/trunk

Added wrapper around pre(un)/post(un) scriptlet creation in
package build - no need to generate these for most packages'
subpackages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r31 r32  
    674674    close CONTROL;
    675675
    676     if ($preinstscript ne '') {
    677       open PREINST, ">$buildroot/$pkg/DEBIAN/preinst";
    678       print PREINST "#!/bin/sh\nset -e\n\n";
    679       print PREINST $preinstscript;
    680       close PREINST;
    681       `chmod 0755 $buildroot/$pkg/DEBIAN/preinst`;
    682     }
    683     if ($postinstscript ne '') {
    684       open POSTINST, ">$buildroot/$pkg/DEBIAN/postinst";
    685       print POSTINST "#!/bin/sh\nset -e\n\n";
    686       print POSTINST $postinstscript;
    687       close POSTINST;
    688       `chmod 0755 $buildroot/$pkg/DEBIAN/postinst`;
    689     }
    690     if ($preuninstscript ne '') {
    691       open PREUNINST, ">$buildroot/$pkg/DEBIAN/prerm";
    692       print PREUNINST "#!/bin/sh\nset -e\n\n";
    693       print PREUNINST $preuninstscript;
    694       close PREUNINST;
    695       `chmod 0755 $buildroot/$pkg/DEBIAN/prerm`;
    696     }
    697     if ($postuninstscript ne '') {
    698       open POSTUNINST, ">$buildroot/$pkg/DEBIAN/postrm";
    699       print POSTUNINST "#!/bin/sh\nset -e\n\n";
    700       print POSTUNINST $postuninstscript;
    701       close POSTUNINST;
    702       `chmod 0755 $buildroot/$pkg/DEBIAN/postrm`;
     676    # Can't see much point in scripts on subpackages... although since
     677    # it's *possible* I should support it at some point.
     678    if ($pkg eq 'main') {
     679      if ($preinstscript ne '') {
     680        open PREINST, ">$buildroot/$pkg/DEBIAN/preinst";
     681        print PREINST "#!/bin/sh\nset -e\n\n";
     682        print PREINST $preinstscript;
     683        close PREINST;
     684        `chmod 0755 $buildroot/$pkg/DEBIAN/preinst`;
     685      }
     686      if ($postinstscript ne '') {
     687        open POSTINST, ">$buildroot/$pkg/DEBIAN/postinst";
     688        print POSTINST "#!/bin/sh\nset -e\n\n";
     689        print POSTINST $postinstscript;
     690        close POSTINST;
     691        `chmod 0755 $buildroot/$pkg/DEBIAN/postinst`;
     692      }
     693      if ($preuninstscript ne '') {
     694        open PREUNINST, ">$buildroot/$pkg/DEBIAN/prerm";
     695        print PREUNINST "#!/bin/sh\nset -e\n\n";
     696        print PREUNINST $preuninstscript;
     697        close PREUNINST;
     698        `chmod 0755 $buildroot/$pkg/DEBIAN/prerm`;
     699      }
     700      if ($postuninstscript ne '') {
     701        open POSTUNINST, ">$buildroot/$pkg/DEBIAN/postrm";
     702        print POSTUNINST "#!/bin/sh\nset -e\n\n";
     703        print POSTUNINST $postuninstscript;
     704        close POSTUNINST;
     705        `chmod 0755 $buildroot/$pkg/DEBIAN/postrm`;
     706      }
    703707    }
    704708
Note: See TracChangeset for help on using the changeset viewer.