[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Recherche volontaire pour classer les paquets



Voici une version un peu nettoyée du script.

A+,
Christian.
#! /usr/bin/perl -w

use strict;

my $cvsroot = ':pserver:anonymous@anoncvs.kde.org:/home/kde';

my $tmp_dir = '/tmp';



# Go to a temp dir
chdir($tmp_dir);

##
# Get the modules from the CVS repository
##

# Get the CVSROOT/modules file from the repository
`cvs -d $cvsroot checkout CVSROOT/modules`;

# Read the modules in that file
open MODULES, 'CVSROOT/modules' or die "Could not open CVSROOT/modules !\n";
my @modules = <MODULES>;
close MODULES;

# Delete that file
`rm -rf CVSROOT`;

# Clean up the modules
@modules = grep { chomp; s/^(\S+)\s*.*$/$1/ } @modules;

##
# Get the packages from the modules
##

my @packages = ();
foreach my $mod (@modules) {

  # Get the debian/control file from each module if possible
  `cvs -d $cvsroot checkout '$mod/debian/control' &> /dev/null`;

  # Read that file
  if (open CONTROL, "$mod/debian/control") {
    my @infos = <CONTROL>;
    close CONTROL;

    # Delete that file
    `rm -rf '$mod'`;

    # Find the packages in that file
    @infos = grep { chomp; s/^Package: (\S+)\s*$/$1/ } @infos;

    # Add them to the packages list
    push @packages, @infos;
  }
}

print "packages : @packages \n";


Reply to: