App-Repo

 view release on metacpan or  search on metacpan

repo  view on Meta::CPAN


            -stop repo
            repo -stop

            -check if repo is running
            repo -status

            -update packages list
            repo -d /path/to/deb -p

            -see documentation
            perldoc repo

            -see this help 
            repo -h
END_MESSAGE

    print $help;
}



if(defined $switch{d}){
    start();
} elsif(defined $switch{h}){
    usage();
} elsif( defined $switch{s} ){
    my $pids = ' ';
    my @ps = grep{ /repo/ } qx{ ps aux };
    for(@ps){
        push my @pid, split(" ", $_);
        if( $pid[10] eq $0 ){
            $pids .= " $pid[1]" unless $pid[1] eq $$;
        }
    }

    if($switch{s} eq 'top'){
        system("kill -9 $pids");
        say "killed $0: PID $pids";
        exit;
    }

    if($switch{s} eq 'tatus'){
        if($pids eq ' '){
            say "$0: not running";
        } else { say "$0 running: PID $pids" }
    }
}


=head1 NAME

repo - Creates list of Debian packages and starts APT repository on port 3000.

=head1 DESCRIPTION 

'repo' creates MD5, SHA1 and SHA256 hashes of each package in 'deb' directory, checks control file and use it to create Packages.gz file needed by APT client to read content of repository, then starts repository running on Mojolicious server ( port 3...

=head1 OPTIONS

Pass full path to 'deb' directory containing Debian packages with -d parameter. Repo will generate 'Packages.gz' file in a same directory where 'deb' is located and will run in background. When deb direcroy content is changed use -r option to update ...

start:                  C<repo -d /path/to/deb>

stop:                   C<repo -stop>

status:                 C<repo -status>

update packages list:   C<repo -d /path/to/deb -p>

help:                   C<repo -h>

=head1 AUTHOR

Zdenek Bohunek E<lt>zed448@icloud.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright 2016 by Zdenek Bohunek

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut



( run in 1.911 second using v1.01-cache-2.11-cpan-d8267643d1d )