Changeset 29598


Ignore:
Timestamp:
12/11/14 18:58:24 (6 years ago)
Author:
Jeremy Symon
Message:

Changed package generators to not use the tmp directory needlessly, and fixed some problems with the debian generator. Still need to test on systems with rpm/apt and fix all the problems.

Location:
main/trunk/package-kits/linux/perllib/Greenstone/Package
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_apt.pm

    r29595 r29598  
    1414sub write_function {
    1515    my ($self, $name, @lines) = @_;
    16     open OUT, '>', "/tmp/$name";
     16    my $file = "$self->{output}/debian/$name";
     17    print "    - $file\n";
     18    open my $OUT, '>', $file;
    1719    for my $line (@lines) {
    18         print OUT $line, "\n";
     20        print $OUT $line, "\n";
    1921    }
    20     close OUT;
    21     chmod 0755, "/tmp/$name";
    22     $self->add ("/tmp/$name", "$self->{output}/debian/$name");
     22    close $OUT;
     23    chmod 0755, $file;
    2324}
    2425
     
    4243        'Homepage: %HOMEPAGE%',
    4344        'Depends:',
    44         '%DEPENDS',
     45        '  %DEPENDS%',
    4546        'Description: %DESCRIPTION_SHORT',
    4647        '  %DESCRIPTION'
     
    5556    my ($self, $packages) = @_;
    5657    $self->add_install;
    57     open my $CONTROL, '>', "/tmp/gspkg.control";
     58    my $file = "$self->{output}/debian/control";
     59    print "    - $file\n";
     60    open my $CONTROL, '>', $file;
    5861    for my $line (
    5962        'Source: %NAME%',
     
    6164        'Priority: optional',
    6265        'Maintainer: %MAINTAINER_NAME% <%MAINTAINER_EMAIL%>',
    63         'BuildDepends:',
    64         '%MAKEDEPENDS%',
     66        'Build-Depends:',
     67        '  %MAKEDEPENDS%',
    6568    ) {
    6669        my $copy = $line;
     
    8083    }
    8184    close $CONTROL;
    82     $self->add ("/tmp/gspkg.control", "$self->{output}/debian/control");
    8385}
    8486
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_pacman.pm

    r29595 r29598  
    5454        exists $self->{config}->{PRE_REMOVE} or
    5555        exists $self->{config}->{POST_REMOVE}) {
    56         my $name = "$self->{config}->{NAME}.install";
    57         open my $INSTALL, '>', "/tmp/gspkg.$name";
     56        my $file = "$self->{output}/$self->{config}->{NAME}.install";
     57        print "    - $file\n";
     58        open my $INSTALL, '>', $file;
    5859        exists $self->{config}->{PRE_INSTALL} and do {
    5960            $self->write_function ("pre_install", $INSTALL, @{$self->{config}->{PRE_INSTALL}});
     
    6970            $self->write_function ("post_remove", $INSTALL, @{$self->{config}->{POST_REMOVE}});
    7071        close $INSTALL;
    71         $self->add ("/tmp/gspkg.$name", "$self->{output}/$name");
    72         return "install=$name";
     72        return "install=$file";
    7373    } else {
    7474        return "";
     
    8484        }
    8585    }
    86     open my $PKGBUILD, '>', "/tmp/gspkg.PKGBUILD";
     86    my $file = "$self->{output}/PKGBUILD";
     87    print "    - $file\n";
     88    open my $PKGBUILD, '>', $file;
    8789    for my $line (
    8890        '# Maintainer: %MAINTAINER_NAME% <%MAINTAINER_EMAIL%>',
     
    137139    }
    138140    close $PKGBUILD;
    139     $self->add ("/tmp/gspkg.PKGBUILD", "$self->{output}/PKGBUILD");
    140141}
    141142
  • main/trunk/package-kits/linux/perllib/Greenstone/Package/_rpm.pm

    r29595 r29598  
    4747sub add_package_impl {
    4848    my ($self, $packages) = @_;
    49     open my $SPEC, '>', '/tmp/gspkg.spec';
     49    my $file = "$self->{output}/$self->{config}->{NAME}.spec";
     50    print "    - $file\n";
     51    open my $SPEC, '>', $file;
    5052    for my $line (
    5153        'Name:          %NAME%',
     
    112114    }
    113115    close $SPEC;
    114     $self->add ("/tmp/gspkg.spec", "$self->{output}/$self->{config}->{NAME}.spec");
    115116}
    116117
Note: See TracChangeset for help on using the changeset viewer.