Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace rmtree, fix parameter passing #55

Open
wants to merge 7 commits into
base: 1.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Rex/Repositorio.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use XML::LibXML;
use XML::Simple;
use Params::Validate qw(:all);
use IO::All;
use File::Path 'make_path';
use File::Path 'make_path', 'remove_tree';
use File::Basename qw'dirname';
use File::Spec;
use File::Copy;
Expand Down Expand Up @@ -505,7 +505,7 @@ sub tag {
if ( -e $tag_dir ) {
if ( $option{force} ) {
$self->logger->debug("Removing $tag_dir");
rmtree $tag_dir; # should be remove_tree, but will use legacy to match mkdir
remove_tree ( $tag_dir );
}
else {
$self->logger->log_and_croak(
Expand Down
17 changes: 14 additions & 3 deletions lib/Rex/Repositorio/Repository/Apt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use Data::Dumper;
use Digest::SHA;
use Carp;
use Params::Validate qw(:all);
use File::Path qw(make_path);
use File::Spec;
use IO::All;

Expand Down Expand Up @@ -417,9 +418,19 @@ sub init {
my $desc = $self->repo->{description} || "$component repository";

my $repo_dir = $self->app->get_repo_dir( repo => $self->repo->{name} );
my @repodata_paths = (File::Spec->catdir($repo_dir,'dists',$dist,$component,"binary-$arch"), File::Spec->catdir($repo_dir,'pool',$dist,$component));

for my $repodata_path (@repodata_paths) {
$self->app->logger->debug("init: repodata_path: ${repodata_path}");
unless (-d $repodata_path) {
$self->app->logger->debug("init: make_path: ${repodata_path}");
my $make_path_error;
unless (make_path($repodata_path)) {
$self->app->logger->log_and_croak(level => 'error', message => "init: unable to create path: ${repodata_path}");
}
}
}

File::Path->make_path(File::Spec->catdir($repo_dir,'dists',$dist,$component,"binary-$arch"));
File::Path->make_path(File::Spec->catdir($repo_dir,'pool',$dist,$component));

my $aptftp = io("$repo_dir/aptftp.conf");
my $aptgenerate = io("$repo_dir/aptgenerate.conf");
Expand Down Expand Up @@ -554,7 +565,7 @@ sub _run_ftp_archive {

# export pub key as asc file
my $pub_file = $self->repo->{name} . ".asc";
$cmd = "cd $repo_dir ; gpg -a --output $pub_file --export $key";
$cmd = "cd $repo_dir ; gpg -a --export $key > $pub_file";
system $cmd;

if ( $? != 0 ) {
Expand Down