BlankOnDev/Repo.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
read
2.0
update
2.0
pkg_build
2.0
CRAP 2.0
1 package BlankOnDev::Repo;
2 use strict;
3 use warnings FATAL => 'all';
4  
5 # Impor Module :
6 use BlankOnDev::Utils::file;
7  
8 # Version :
9 our $VERSION = '0.1005';;
10  
11 # Subroutine for Read Repository :
12 # ------------------------------------------------------------------------
13 sub read {
14 my ($self, $dir_dev) = @_;
15 my $locfile_repo = '/etc/apt/sources.list';
16  
17 # Read Sources list :
18  
19 }
20 # Subroutine for update database repository on local system :
21 # ------------------------------------------------------------------------
22 sub update {
23 # repo update :
24 system('sudo apt-get update');
25 }
26 # Subroutine for install packages before build :
27 # ------------------------------------------------------------------------
28 sub pkg_build {
29 my $self = shift;
30 my $depend = get_pkg_support();
31 my $build_pkg = $depend->{'build'};
32 my $git_depkg = $depend->{'bzr'};
33 my $bzr_depkg = $depend->{'git'};
34  
35 # Update Before Install :
36 update();
37 system("sudo apt-get install -y $build_pkg");
38 system("sudo apt-get install -y $git_depkg");
39 system("sudo apt-get install -y $bzr_depkg");
40  
41 return 1;
42 }
43 # Subroutine for Get dependensi :
44 # ------------------------------------------------------------------------
45 sub get_pkg_support {
46 my %data = (
47 'build' => 'devscripts build-essential fakeroot debhelper gnupg pbuilder dh-make dpkg-dev dpatch equivs lintian quilt dh-make-perl git-core bzr rng-tools haveged apt-rdepends',
48 'bzr' => 'bzr-fastimport',
49 'git' => 'bzr-git',
50 );
51 return \%data;
52 }
53 # Subroutine for repo address :
54 # ------------------------------------------------------------------------
55 sub address {
56 my @data = (
57 'repo.ridon.id'
58 );
59 return \@data;
60 }
61 1;