Changeset 29510


Ignore:
Timestamp:
2014-12-02T11:39:01+13:00 (7 years ago)
Author:
Jeremy Symon
Message:

Renamed platforms to distros, and fixed problem when generating for multiple distros

Location:
main/trunk/package-kits/linux
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/trunk/package-kits/linux/generate

    r29508 r29510  
    1515
    1616
    17 my $USAGE = "Usage: " . basename($0) . " <platforms> <packages>
    18     platforms: A comma separated list of the platforms defined in platforms/
    19                Or 'all' (for all platforms)
     17my $USAGE = "Usage: " . basename($0) . " <distros> <packages>
     18    distros: A comma separated list of the distros defined in distros/
     19               Or 'all' (for all distros)
    2020    packages:  A comma separated list of the packages defined in packages/
    2121               Or 'all' (for all packages)
     
    110110}
    111111
    112 my @platforms = globbify "platforms", shift;
    113 my @packages  = globbify "packages", shift;
     112my @distros  = globbify "distros", shift;
     113my @packages = globbify "packages", shift;
    114114
    115 for (@platforms) {
    116     my $platform = basename $_;
    117     print "$platform\n";
     115for my $dconf (@distros) {
     116    my $distro = basename $dconf;
     117    print "$distro\n";
    118118
    119     open PLATFORM, '<', $_;
    120     my %platform_vars;
    121     while (<PLATFORM>) {
     119    open DISTRO, '<', $dconf;
     120    my %distro_vars;
     121    while (<DISTRO>) {
    122122        chomp;
    123123        (comment or empty) and next;
    124         readvar \%platform_vars, $_;
     124        readvar \%distro_vars, $_;
    125125    }
    126     close PLATFORM;
     126    close DISTRO;
    127127
    128     for (@packages) {
    129         my $package = basename $_;
     128    for my $pconf (@packages) {
     129        my $package = basename $pconf;
    130130        print " - $package\n";
    131         my $package_path = "build/$platform/$package";
     131        my $package_path = "build/$distro/$package";
    132132        make_path $package_path;
    133133
    134         open PACKAGE, '<', $_;
    135         my %package_vars = %{dclone \%platform_vars};
     134        open PACKAGE, '<', $pconf;
     135        my %package_vars = %{dclone \%distro_vars};
    136136        while (<PACKAGE>) {
    137137            chomp;
     
    175175
    176176        # write the package manager files
    177         copydir ("managers/$platform_vars{'MANAGER'}", $package_path, \%package_vars);
     177        copydir ("managers/$distro_vars{'MANAGER'}", $package_path, \%package_vars);
    178178    }
    179179}
Note: See TracChangeset for help on using the changeset viewer.