r12122 - /tools/snapshots/scripts/snapshot-package
kilian at users.alioth.debian.org
kilian at users.alioth.debian.org
Sat Jul 28 13:34:43 UTC 2007
Author: kilian
Date: Sat Jul 28 13:34:42 2007
New Revision: 12122
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=12122
Log:
make get-orig-source target optional. Pull from ftp.de.debian.org if doesn't
exist. Bail out if does exist.
Fetch sources from archive.buildserver.net if doesn't exist locally before
trying to get them by other means to make sure we have a valid upload.
Modified:
tools/snapshots/scripts/snapshot-package
Modified: tools/snapshots/scripts/snapshot-package
URL: http://svn.debian.org/wsvn/pkg-gnome/tools/snapshots/scripts/snapshot-package?rev=12122&op=diff
==============================================================================
--- tools/snapshots/scripts/snapshot-package (original)
+++ tools/snapshots/scripts/snapshot-package Sat Jul 28 13:34:42 2007
@@ -198,6 +198,7 @@
out_dir = os.path.join(base, 'out')
last_file = os.path.join(base, "last-" + path.replace('/', '_'))
last = LastFile(last_file)
+ uploadsource = False
changelog_entry = debian_linux.debian.Changelog(checkout_dir)[0]
package_name = changelog_entry.source
@@ -225,7 +226,33 @@
if not native:
if not os.path.isfile(base + "/tarballs/" + package_orig):
- spawnv_chdir(os.P_WAIT, "debian/rules", ['debian/rules', 'get-orig-source'], checkout_dir)
+ # make sure we find non-free and contrib
+ for line in file(package_dir + '/debian/control', 'r').read().split('\n'):
+ if line.startswith('Section: '):
+ section = line.split()[1].split('/')[0]
+ if section not in ('non-free', 'contrib'):
+ section = 'main'
+
+ # grab lib* from the correct namespace
+ if (package_orig[:3] == 'lib'):
+ package_orig_prefix = package_orig[:4] + '/' + package_name
+ else:
+ package_orig_prefix = package_orig[:1] + '/' + package_name
+ # check whether it's already on archive.buildserver.net
+ ### print 'Checking for http://archive.buildserver.net/pool/' + section + '/' + package_orig_prefix + '/' + package_orig
+ if spawnv_chdir(os.P_WAIT, "/usr/bin/wget", ['wget', '-q', '-nv', '-O', base + "/tarballs/" + package_orig, 'http://archive.buildserver.net/pool/' + section + '/' + package_orig_prefix + '/' + package_orig], checkout_dir):
+ # tarball is not yet on archive.buildserver.net, try grabbing it elsewhere. Remove the empty file thus.
+ os.unlink(base + '/tarballs/' + package_orig)
+ if spawnv_chdir(os.P_WAIT, "debian/rules", ['debian/rules', '-n', 'get-orig-source'], checkout_dir):
+ # no get-orig-source target in debian/rules. Try grabbing it off ftp.de.debian.org
+ ###print 'I: Grabbing tarball from http://ftp.de.debian.org/debian/pool/' + section + '/' + package_orig_prefix + '/' + package_orig + "..."
+ if spawnv_chdir(os.P_WAIT, "/usr/bin/wget", ['wget', '-q', '-nv', '-O', base + "/tarballs/" + package_orig, 'http://ftp.de.debian.org/debian/pool/' + section + '/' + package_orig_prefix + '/' + package_orig], checkout_dir):
+ os.unlink(base + '/tarballs/' + package_orig)
+ else:
+ ###print "I: Running get-orig-source..."
+ if spawnv_chdir(os.P_WAIT, "debian/rules", ['debian/rules', 'get-orig-source'], checkout_dir):
+ os.unlink(base + '/tarballs/' + package_orig)
+ uploadsource = True
#print "Checking tarball %s ..." % ('../tarballs/' + package_orig)
if not os.path.isfile(base + "/tarballs/" + package_orig):
sys.stdout.write("No tarball fetched. Will try fresh download next time.\n")
@@ -284,10 +311,11 @@
if sign:
list.append('-k%s' % sign)
if not native:
- if version.upstream != upstream:
- list.append('-sa')
- else:
- list.append('-sd')
+ #if version.upstream != upstream:
+ # list.append('-sa')
+ #else:
+ # list.append('-sd')
+ list.append('-sd')
else:
list.append('-sa')
spawnv_chdir(os.P_WAIT, svn_pkg, list, package_dir)
@@ -315,6 +343,8 @@
file(last_file, 'w').write("%d %s\n" % (revision, version.upstream))
#print "Uploading."
+ if uploadsource and not native:
+ spawnv_chdir(os.P_WAIT, '/usr/bin/scp', ['scp', '%s' % base + "/tarballs/" + package_orig, 'archive.buildserver.net:/srv/dak/queue/unchecked/'], out_dir)
spawnv_chdir(os.P_WAIT, 'dupload', ['dupload', '--to', entry['upload'], '%s_%s_source.changes' % (package_name, version.complete_noepoch)], out_dir)
return True
More information about the pkg-gnome-commits
mailing list