Changeset 131


Ignore:
Timestamp:
09/27/07 12:52:04 (17 years ago)
Author:
kdeugau
Message:

/trunk

Fix bizarre bug in pre/post(un)install script creation
Make pre/post(un)install script creation code clearer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r130 r131  
    11841184      print PREINST $pkgdata{$pkg}{'pre'};
    11851185      close PREINST;
    1186       `chmod 0755 $buildroot/$pkg/DEBIAN/preinst`;
     1186      chmod 0755, "$buildroot/$pkg/DEBIAN/preinst";
    11871187    }
    11881188    if ($pkgdata{$pkg}{'post'}) {
    11891189      $pkgdata{$pkg}{'post'} = expandmacros($pkgdata{$pkg}{'post'},'gp');
    1190       open PREINST, ">$buildroot/$pkg/DEBIAN/postinst";
    1191       print PREINST "#!/bin/sh\nset -e\n\n";
    1192       print PREINST $pkgdata{$pkg}{'post'};
    1193       close PREINST;
    1194       `chmod 0755 $buildroot/$pkg/DEBIAN/postinst`;
     1190      open POSTINST, ">$buildroot/$pkg/DEBIAN/postinst";
     1191      print POSTINST "#!/bin/sh\nset -e\n\n";
     1192      print POSTINST $pkgdata{$pkg}{'post'};
     1193      close POSTINST;
     1194      chmod 0755, "$buildroot/$pkg/DEBIAN/postinst";
    11951195    }
    11961196    if ($pkgdata{$pkg}{'preun'}) {
    11971197      $pkgdata{$pkg}{'pre'} = expandmacros($pkgdata{$pkg}{'preun'},'gp');
    1198       open PREINST, ">$buildroot/$pkg/DEBIAN/prerm";
    1199       print PREINST "#!/bin/sh\nset -e\n\n";
    1200       print PREINST $pkgdata{$pkg}{'preun'};
    1201       close PREINST;
    1202       `chmod 0755 $buildroot/$pkg/DEBIAN/prerm`;
     1198      open PREUNINST, ">$buildroot/$pkg/DEBIAN/prerm";
     1199      print PREUNINST "#!/bin/sh\nset -e\n\n";
     1200      print PREUNINST $pkgdata{$pkg}{'preun'};
     1201      close PREUNINST;
     1202      chmod 0755, "$buildroot/$pkg/DEBIAN/prerm";
    12031203    }
    12041204    if ($pkgdata{$pkg}{'postun'}) {
    12051205      $pkgdata{$pkg}{'postun'} = expandmacros($pkgdata{$pkg}{'postun'},'gp');
    1206       open PREINST, ">$buildroot/$pkg/DEBIAN/postrm";
    1207       print PREINST "#!/bin/sh\nset -e\n\n";
    1208       print PREINST $pkgdata{$pkg}{'postun'};
    1209       close PREINST;
    1210       `chmod 0755 $buildroot/$pkg/DEBIAN/postrm`;
     1206      open POSTUNINST, ">$buildroot/$pkg/DEBIAN/postrm";
     1207      print POSTUNINST "#!/bin/sh\nset -e\n\n";
     1208      print POSTUNINST $pkgdata{$pkg}{'postun'};
     1209      close POSTUNINST;
     1210      chmod 0755, "$buildroot/$pkg/DEBIAN/postrm";
    12111211    }
    12121212
Note: See TracChangeset for help on using the changeset viewer.