diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..07764a7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dbe9c82 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode/ \ No newline at end of file diff --git a/lib/NBuild/CommonFunc.pm b/lib/NBuild/CommonFunc.pm new file mode 100644 index 0000000..75c4a74 --- /dev/null +++ b/lib/NBuild/CommonFunc.pm @@ -0,0 +1,20 @@ +#!/usr/bin/perl +package NBuild::Func; + +use strict; +use warnings; +use v5.10; +use NBuild::ShareVar; + +sub build_host_arch { + +} + +sub detect_cache_dir { + if(-w '/'){ + $ShareVar::CACHE_DIR='/var/cache/build'; + }else { + $ShareVar::CACHE_DIR='~/.cache/build'; + } +} +1; \ No newline at end of file diff --git a/lib/NBuild/Func.pm b/lib/NBuild/Func.pm deleted file mode 100644 index b0a94ae..0000000 --- a/lib/NBuild/Func.pm +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/perl -package NBuild; - -use strict; -use warnings; -use v5.10; - -sub buildroot_umount { - -} -1; \ No newline at end of file diff --git a/lib/NBuild/nbuild-vm b/lib/NBuild/NBuildFunc.pm similarity index 64% rename from lib/NBuild/nbuild-vm rename to lib/NBuild/NBuildFunc.pm index ca27ece..11c03b0 100644 --- a/lib/NBuild/nbuild-vm +++ b/lib/NBuild/NBuildFunc.pm @@ -1,5 +1,5 @@ #!/usr/bin/perl -package NBuild; +package NBuild::NBuildFunc; use strict; use warnings; diff --git a/lib/NBuild/nbuild-pkg b/lib/NBuild/ShareVar.pm similarity index 55% rename from lib/NBuild/nbuild-pkg rename to lib/NBuild/ShareVar.pm index ca27ece..5fbb62e 100644 --- a/lib/NBuild/nbuild-pkg +++ b/lib/NBuild/ShareVar.pm @@ -1,8 +1,9 @@ #!/usr/bin/perl -package NBuild; +package NBuild::ShareVar; use strict; use warnings; use v5.10; +our $CACHE_DIR; 1; \ No newline at end of file diff --git a/lib/NBuild/nbuild-recipe b/lib/NBuild/nbuild-recipe deleted file mode 100644 index ca27ece..0000000 --- a/lib/NBuild/nbuild-recipe +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -package NBuild; - -use strict; -use warnings; -use v5.10; - -1; \ No newline at end of file diff --git a/lib/NBuild/nbuild-validate-params b/lib/NBuild/nbuild-validate-params deleted file mode 100644 index ca27ece..0000000 --- a/lib/NBuild/nbuild-validate-params +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -package NBuild; - -use strict; -use warnings; -use v5.10; - -1; \ No newline at end of file diff --git a/lib/NBuild/readvar b/lib/NBuild/readvar deleted file mode 100644 index d6497a3..0000000 --- a/lib/NBuild/readvar +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use v5.10; - -print $ARGV[1]; \ No newline at end of file diff --git a/nbuild b/nbuild index 40a7f9a..095f88f 100644 --- a/nbuild +++ b/nbuild @@ -13,12 +13,14 @@ use strict; use warnings; use v5.10; -use NBuild::Func; use File::Path qw(rmtree mkpath); use Sys::Hostname; use Log::Log4perl; use File::Path; +use NBuild::CommonFunc; +use NBuild::NBuildFunc; + =todo # some VMs do not allow to specify the init process... if test "$0" = /sbin/init; then