From 913636d38da5f591d390bef68c750a0d2264aa84 Mon Sep 17 00:00:00 2001 From: "Timothy N. Tsvetkov" Date: Wed, 27 Apr 2011 18:21:26 +0400 Subject: [PATCH] doing migrate repos --- lib/tasks/migrate_repos_task.rake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/tasks/migrate_repos_task.rake diff --git a/lib/tasks/migrate_repos_task.rake b/lib/tasks/migrate_repos_task.rake new file mode 100644 index 000000000..3d4ce8ed9 --- /dev/null +++ b/lib/tasks/migrate_repos_task.rake @@ -0,0 +1,22 @@ +namespace :repositories do + + desc "Migrate repositories from fs" + task :migrate => :environment do + repos_dirs = Dir["/root/mandriva_main_git/*.git"] + + cooker = Platform.find_by_name!("cooker") + main = cooker.repositories.find_by_name!("main") + + repos_dirs.each do |repo_dir| + puts repo_dir + puts File.basename(repos_dir, ".git") + + project_name = File.basename(repos_dir, ".git") + +# main.projects.create(:name => project_name, :unixname => project_name) +# Dir + end + + end + +end