[Xfce4-commits] <moka:master> Add administrative actions for collection releases.

Jannis Pohlmann noreply at xfce.org
Thu Jan 13 21:44:01 CET 2011


Updating branch refs/heads/master
         to 36505f93b422e00ad4182c2a14876a7341e145f1 (commit)
       from 03a4056ba1c6c8b0a166498a63357134809accbc (commit)

commit 36505f93b422e00ad4182c2a14876a7341e145f1
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Thu Jan 13 21:41:17 2011 +0100

    Add administrative actions for collection releases.
    
    We can now manually regenerate fat tarballs and fat tarball checksums
    in the collection release view.

 lib/controllers/collections.rb   |   22 ++++++++++++++++++++--
 lib/models/archive.rb            |    5 +++++
 lib/models/collection.rb         |    6 +++++-
 lib/views/collection_release.erb |    3 +++
 4 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/lib/controllers/collections.rb b/lib/controllers/collections.rb
index c4c0317..5d4b023 100755
--- a/lib/controllers/collections.rb
+++ b/lib/controllers/collections.rb
@@ -55,7 +55,7 @@ module Moka
           view :collection_delete
         end
         
-       app. post '/collection/:name/release/:release/delete' do
+       app.post '/collection/:name/release/:release/delete' do
           @collection = Collection.find_by_name(params[:name])
 
           authentication_required(@collection)
@@ -64,7 +64,25 @@ module Moka
           @release.delete
           redirect '/'
         end
-        
+
+        app.get '/collection/:name/release/:release/update_fat_tarball' do
+          @collection = Collection.find_by_name(params[:name])
+
+          authentication_required(@collection)
+
+          @release = Collection::Release.new(@collection, params[:release])
+          @release.update
+        end
+
+        app.get '/collection/:name/release/:release/update_fat_tarball_checksums' do
+          @collection = Collection.find_by_name(params[:name])
+
+          authentication_required(@collection)
+
+          @release = Collection::Release.new(@collection, params[:release])
+          @release.update
+        end
+
         app.get '/collection/:name/new-release' do
           @collection = Collection.find_by_name(params[:name])
 
diff --git a/lib/models/archive.rb b/lib/models/archive.rb
index 63cde1a..af5841b 100755
--- a/lib/models/archive.rb
+++ b/lib/models/archive.rb
@@ -137,6 +137,11 @@ module Moka
           end
         end
       end
+
+      def collection_release_update_checksums(release)
+        fat_tarball = collection_fat_tarball_filename(release)
+        update_tarball_checksums(fat_tarball)
+      end
     
       def classification_dir(classification)
         File.join(root_dir, 'src', classification.name)
diff --git a/lib/models/collection.rb b/lib/models/collection.rb
index 26152d5..00406af 100755
--- a/lib/models/collection.rb
+++ b/lib/models/collection.rb
@@ -55,7 +55,11 @@ module Moka
         def update
           Archive.instance.collection_release_update(self)
         end
-    
+
+        def update_checksums
+          Archive.instance.collection_release_update_checksums(self)
+        end
+
         def template_name
           'mailinglist_collection_announcement'
         end
diff --git a/lib/views/collection_release.erb b/lib/views/collection_release.erb
index 8238cd6..a089073 100755
--- a/lib/views/collection_release.erb
+++ b/lib/views/collection_release.erb
@@ -1,4 +1,7 @@
 <%= header :title => "Update #{@collection.display_name} #{@release.version}" %>
+<h2>Administrative Tasks</h2>
+<p><a href="/collection/<%= @collection.name %>/release/<%= @release.version %>/update_fat_tarball">Regenerate fat tarball</a></p>
+<p><a href="/collection/<%= @collection.name %>/release/<%= @release.version %>/update_fat_tarball_checksum">Update fat tarball checksums</a></p>
 <h2>Projects to include in the release</h2>
 <form method="post">
   <table cellspacing="0" cellpadding="0">



More information about the Xfce4-commits mailing list