Chandra
view release on metacpan or search on metacpan
include/chandra/chandra_socket_hub.h view on Meta::CPAN
(void)PerlLIO_unlink(path_str);
listener = _sock_unix_listen(aTHX_ path_sv);
if (!listener) {
SvREFCNT_dec(path_sv);
croak("Hub: cannot listen on %s: %s",
path_str, SvPV_nolen(get_sv("!", 0)));
}
#ifndef _WIN32
(void)PerlLIO_chmod(path_str, 0600);
#endif
_sock_set_nonblocking(aTHX_ listener);
/* Write token file */
{
SV *token_path_sv = newSVpvf("%s.token", path_str);
(void)hv_stores(hv, "_token_path", newSVsv(token_path_sv));
if (token_svp && SvOK(*token_svp)) {
STRLEN tlen;
lib/Chandra/Pack.pm view on Meta::CPAN
sub _save_config {
my $file = _config_file();
my $dir = file_dirname($file);
file_mkpath($dir) unless file_is_dir($dir);
my $content = "# Chandra::Pack configuration\n";
for my $key (sort keys %CONFIG) {
next unless defined $CONFIG{$key};
$content .= "$key = $CONFIG{$key}\n";
}
file_spew($file, $content);
chmod 0600, $file; # Protect credentials
}
# Load config on module load
_load_config();
sub new {
my ($class, %args) = @_;
Carp::croak("'script' is required") unless $args{script};
Carp::croak("Script '$args{script}' not found") unless file_exists($args{script});
Carp::croak("Script '$args{script}' is not a file") unless file_is_file($args{script});
lib/Chandra/Pack.pm view on Meta::CPAN
my $lib_dir = file_join($usr, 'lib', 'perl5');
my $share = file_join($usr, 'share');
# Create structure
file_mkpath($lib_dir);
file_mkpath($share);
# AppRun
my $apprun = file_join($app_dir, 'AppRun');
file_spew($apprun, $self->_generate_launcher_linux());
chmod 0755, $apprun;
# Desktop entry
file_spew(file_join($app_dir, lc($safe) . '.desktop'), $self->_generate_desktop());
# Copy script
file_copy($self->{script}, file_join($usr, 'share', 'script.pl'));
# Copy deps
$self->_copy_deps($lib_dir);
lib/Chandra/Pack.pm view on Meta::CPAN
}
# Run appimagetool
my $cmd = "\Q$appimagetool\E \Q$app_dir\E \Q$appimage_path\E 2>&1";
my $output = `$cmd`;
if ($? != 0) {
return { success => 0, error => "appimagetool failed: $output" };
}
# Make executable
chmod 0755, $appimage_path;
return { success => 1, path => $appimage_path };
}
sub _find_command {
my ($cmd) = @_;
my $path = `which $cmd 2>/dev/null`;
chomp $path;
return $path if $path && -x $path;
( run in 0.913 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )