diff --git a/bin/rbpkg b/bin/rbpkg
index be82065..fa8c6d1 100755
--- a/bin/rbpkg
+++ b/bin/rbpkg
@@ -84,6 +84,8 @@ def rbpkg
Rbpkg.package($ARGS)
when "clean-package"
Rbpkg.clean_package($ARGS)
+ when "clean-all"
+ Rbpkg.clean_all($ARGS)
when "info"
Rbpkg.info($ARGS)
else
diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index 875c9e5..f71a490 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -31,6 +31,12 @@ module Rbpkg
end
end
+ def self.clean_all(repos)
+ repos.each do |name|
+ Repos.repo(name).clean_all()
+ end
+ end
+
def self.clean_build(repos)
repos.each do |name|
Repos.repo(name).clean_build()
diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index 5491aca..efda07d 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -34,6 +34,13 @@ class Rbpkg::Repo
cmd! "cd #{sh_quote(src_dir!)} && git fetch #{sh_quote(git_remote)} #{sh_branch} && git checkout #{sh_branch} && git submodule update"
end
+ def clean_all
+ clean_fake
+ clean_build
+ clean_configure
+ clean_sources
+ end
+
def clean_build
if File.file?("#{src_dir}/Makefile")
cmd! "cd #{sh_quote(src_dir)} && make clean"