pf-tools commit: r846 [ccaillet-guest] - in /branches/next-gen/lib/PFTools: Update.pm Update/Createfile.pm Update/Installpkg.pm Update/Purgepkg.pm
parmelan-guest at users.alioth.debian.org
parmelan-guest at users.alioth.debian.org
Wed Aug 25 12:35:34 UTC 2010
Author: ccaillet-guest
Date: Wed Aug 25 12:35:33 2010
New Revision: 846
URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=846
Log:
installpkg, purgepkg and mkdir are now validated
Modified:
branches/next-gen/lib/PFTools/Update.pm
branches/next-gen/lib/PFTools/Update/Createfile.pm
branches/next-gen/lib/PFTools/Update/Installpkg.pm
branches/next-gen/lib/PFTools/Update/Purgepkg.pm
Modified: branches/next-gen/lib/PFTools/Update.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update.pm?rev=846&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update.pm (original)
+++ branches/next-gen/lib/PFTools/Update.pm Wed Aug 25 12:35:33 2010
@@ -71,7 +71,7 @@
Addfile_depends ( $ref_section, $dest, $options );
}
elsif ( $action eq "apt-get" || $action eq "installpkg" ) {
- Installpk_depends ( $ref_section, $dest, $options );
+ Installpkg_depends ( $ref_section, $dest, $options );
}
elsif ( $action eq "mkdir" ) {
Mkdir_depends ( $ref_section, $dest, $options );
@@ -95,6 +95,7 @@
if ( $action eq "apt-get" || $action eq "installpkg" ) {
if ( $APT_UPDATE ) {
if ( ! Update_pkg_repository ( $options->{'pkg_type'} ) ) {
+ Warn ( $CODE->{'OPEN'}, "An error occured during updating packages lists" );
return 1;
}
$APT_UPDATE = 0;
Modified: branches/next-gen/lib/PFTools/Update/Createfile.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Createfile.pm?rev=846&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Createfile.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Createfile.pm Wed Aug 25 12:35:33 2010
@@ -53,7 +53,7 @@
sub Createfile_action ($$$$$) {
my ( $ref_section, $dest, $options, $hash_subst, $global_config ) = @_;
- my $cmp = 0;
+ my $cmp = 0;
$hash_subst->{'SECTIONNAME'} = $dest;
if ( ! defined $ref_section->{'source'} ) {
if ( ! -f $dest ) {
@@ -105,7 +105,7 @@
}
Do_on_config( $ref_section, $options, $hash_subst ) && return 1;
Do_before_change( $ref_section, $options, $hash_subst ) && return 1;
- if ( !$options->{'simul'} ) {
+ if ( ! $options->{'simul'} ) {
if ( ! copy ( $source, $dest ) ) {
Warn( $CODE->{'OPEN'},
"Unable to create file ".$dest." from source ".$source );
Modified: branches/next-gen/lib/PFTools/Update/Installpkg.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Installpkg.pm?rev=846&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Installpkg.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Installpkg.pm Wed Aug 25 12:35:33 2010
@@ -27,7 +27,7 @@
our @ISA = ('Exporter');
our @EXPORT = qw(
- Insallpkg_depends
+ Installpkg_depends
Installpkg_action
);
@@ -38,6 +38,7 @@
use Text::Diff;
use PFTools::Logger;
use PFTools::Conf;
+use PFTools::Packages;
use PFTools::Update::Common;
#Librairies Debconf
use Debconf::Db;
@@ -52,13 +53,10 @@
-sub Insallpkg_depends ($$$) {
+sub Installpkg_depends ($$$) {
my ( $ref_section, $dest, $options ) = @_;
$options->{'pkg_type'} = 'deb' if ( ! defined $options->{'pkg_type'} ) ;
- if ( aptupdate( $options->{'pkg_type'} ) ) {
- return 1;
- }
my $deps = Get_pkg_depends ( $options->{'pkg_type'}, $dest ) ;
if ( ! defined $deps ) {
Warn ( $CODE->{'OPEN'}, "Unable to get depends for package ".$dest ) ;
@@ -92,7 +90,6 @@
}
$dest = $newdest;
}
-# aptupdate( $options->{'pkg_type'} );
( $installed_version, $available_version, $specified_version ) = Get_pkg_policy ( $options->{'pkg_type'}, $dest, $ref_section->{'version'} ) ;
if ( ! defined ( $available_version ) ) {
Warn( $CODE->{'OPEN'}, "Package ".$dest." is unavailable" );
@@ -102,12 +99,14 @@
Warn( $CODE->{'OPEN'}, "Package ".$dest." in version ".$ref_section->{'version'}." is unavailable" );
return 1;
}
- if ( defined $installed_version ) {
+ if ( ! defined $installed_version ) {
+ $install++;
+ }
+ else {
my $compare = Cmp_pkg_version ( $options->{'pkg_type'}, $dest, $installed_version, $available_version ) ;
$install++ if ( defined $compare && $compare < 0 );
}
-
- if ($install) {
+ if ( $install ) {
if ( $options->{'verbose'} || $options->{'simul'} ) {
Log("(action needed)");
}
Modified: branches/next-gen/lib/PFTools/Update/Purgepkg.pm
URL: http://svn.debian.org/wsvn/pf-tools/branches/next-gen/lib/PFTools/Update/Purgepkg.pm?rev=846&op=diff
==============================================================================
--- branches/next-gen/lib/PFTools/Update/Purgepkg.pm (original)
+++ branches/next-gen/lib/PFTools/Update/Purgepkg.pm Wed Aug 25 12:35:33 2010
@@ -37,7 +37,7 @@
use PFTools::Packages;
use PFTools::Update::Common;
-sub Purge_pkg_action ($$$$$) {
+sub Purgepkg_action ($$$$$) {
my ( $ref_section, $dest, $options, $hash_subst, $global_config ) = @_;
$options->{'pkg_type'} = 'deb' if ( ! defined $options->{'pkg_type'} ) ;
More information about the pf-tools-commits
mailing list