Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
authorSebastian Dziallas <sebastian@when.com>2009-03-04 15:05:33 (GMT)
committer Sebastian Dziallas <sebastian@when.com>2009-03-04 15:05:33 (GMT)
commit4b42810b2a1c53f828830af62e9463d8455b3182 (patch)
treefa2af7b3b4e35bd3258d6bb64e35d53b52ed1279 /repo
parentbfc49085b7ea12880dfae77b7ceb3dd657271f40 (diff)
add file for creating the /2 repo
Diffstat (limited to 'repo')
-rw-r--r--repo64
1 files changed, 64 insertions, 0 deletions
diff --git a/repo b/repo
new file mode 100644
index 0000000..3c37603
--- /dev/null
+++ b/repo
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+# Copyright (C) 2008, Red Hat, Inc.
+# Copyright (C) 2009, Simon Scahmpijer
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import os
+import shutil
+import subprocess
+import tempfile
+
+target_repo = \
+ 'soas@shell.sugarlabs.org:/upload/soas/repositories/2'
+
+def fetch(packages):
+ for pkg in packages:
+ subprocess.check_call(['koji', 'download-build', '--arch=i586', '--arch=noarch',
+ '--latestfrom=dist-f11', pkg])
+
+def _createrepo(repo_path):
+ rpms = os.listdir('.')
+ rpms.sort(lambda x,y: cmp(os.path.getmtime(x), os.path.getmtime(y)))
+
+ for f in rpms:
+ print 'Createrepo for %s...' % f
+
+ subprocess.check_call(['createrepo', repo_path])
+ subprocess.check_call(['rsync', '-rv', '--delete',
+ repo_path + '/', target_repo])
+
+def build(packages):
+ old_cwd = os.getcwd()
+ repo_path = os.path.join(old_cwd, 'repo')
+ os.chdir(repo_path)
+
+ if not os.path.exists(repo_path):
+ os.mkdir(repo_path)
+
+ try:
+ fetch(packages)
+ _createrepo(repo_path)
+ finally:
+ os.chdir(old_cwd)
+
+_i586 = ['sugar-artwork', 'sugar-presence-service',
+ 'sugar', 'sugar-toolkit', 'sugar-base']
+_noarch = ['sugar-presence-service', 'sugar-browse', 'sugar-imageviewer',
+ 'sugar-jukebox', 'sugar-chat', 'sugar-write', 'sugar-calculator']
+ # sugar-read, sugar-terminal, sugar-turtleart, sugar-log
+ # sugar-pippy
+
+build(_i586 + _noarch)