App-CPANtoRPM
view release on metacpan or search on metacpan
lib/App/CPANtoRPM.pm view on Meta::CPAN
chomp($pass);
}
my $out = new IO::File;
my $file = "$TMPDIR/cpantorpm-expect-sign-wrapper";
$out->open("> $file");
print $out <<"EOF";
#!$expect
spawn rpm --addsign $package{rpmfile} $package{srpmfile}
expect -exact "Enter pass phrase: "
send -- "$pass\\r"
expect {
"Pass phrase check failed" { puts "Failed" }
eof { puts "Success" }
}
EOF
$out->close();
lib/App/CPANtoRPM.pm view on Meta::CPAN
$self->_log_message('INFO',"Signing with non-interactive perl Expect script");
my $pass;
if ($$self{'gpg_passwd'}) {
$pass = $$self{'gpg_passwd'};
} else {
$pass = `cat $$self{'gpg_passfile'}`;
chomp($pass);
}
my $exp = Expect->spawn('rpm','--addsign',
$package{rpmfile},$package{srpmfile});
$exp->expect(undef, "Enter pass phrase:");
$exp->send("$pass\n");
$exp->expect(undef,
[ "Pass phrase check failed" => sub { $flag = 1; } ],
[ "eof" => sub { $flag = 0; } ],
);
return $flag;
}
}
sub _sign_interactive {
my($self) = @_;
$self->_log_message('INFO',"Signing with interactive rpm command");
my @cmd = ('rpm','--addsign', $package{rpmfile}, $package{srpmfile});
my $cmd = join(' ',@cmd);
$self->_log_message('INFO',"Attempting system command: $cmd");
system(@cmd);
}
# This adds a macro to the rpmmacro file in such a way that at the end, it
# will be restored.
#
( run in 1.979 second using v1.01-cache-2.11-cpan-71847e10f99 )