mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-07-05 03:51:29 +00:00
merged changes from lp:ubuntu-dev-tools
This commit is contained in:
commit
7e277c713c
26
debian/changelog
vendored
26
debian/changelog
vendored
@ -1,9 +1,31 @@
|
|||||||
ubuntu-dev-tools (0.51) UNRELEASED; urgency=low
|
ubuntu-dev-tools (0.52) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
[ Siegfried-Angel Gevatter Pujals ]
|
||||||
|
* pbuilder-dist.new:
|
||||||
|
- Add compatibility for cowbuilder. Once pbuilder-dist.new replaces
|
||||||
|
pbuilder-dist, we will also create a cowbuilder-dist symlink to it.
|
||||||
|
|
||||||
|
[ Nathan Handler ]
|
||||||
|
* pull-debian-source:
|
||||||
|
- Pass -xu arguments to dget to be consistant with pull-lp-source
|
||||||
|
- Add support for packages with a name beginning with "lib"
|
||||||
|
|
||||||
|
[ Kees Cook ]
|
||||||
|
* mk-sbuild-lv: add --skip-updates to allow building security-only chroots.
|
||||||
|
|
||||||
|
-- Kees Cook <kees@ubuntu.com> Sat, 03 Jan 2009 10:44:02 -0800
|
||||||
|
|
||||||
|
ubuntu-dev-tools (0.51) jaunty; urgency=low
|
||||||
|
|
||||||
[ Jonathan Davies ]
|
|
||||||
* buildd: Added checks for arch-indep packages and packages which have no
|
* buildd: Added checks for arch-indep packages and packages which have no
|
||||||
builds in a release.
|
builds in a release.
|
||||||
* hugdaylist: String improvements.
|
* hugdaylist: String improvements.
|
||||||
|
* requestsync:
|
||||||
|
- Use optparse instead of getopt for option parsing.
|
||||||
|
- Skip existing bug report check if python-launchpad-bugs is not
|
||||||
|
installed.
|
||||||
|
- Implemented sleeps to --lp bug reporting in case of a slow
|
||||||
|
Launchpad to stop mass bug filing (LP: #311289).
|
||||||
|
|
||||||
-- Jonathan Davies <jpds@ubuntu.com> Tue, 30 Dec 2008 15:51:55 +0000
|
-- Jonathan Davies <jpds@ubuntu.com> Tue, 30 Dec 2008 15:51:55 +0000
|
||||||
|
|
||||||
|
@ -18,16 +18,19 @@ Listed below are the command line options for mk\-sbuild\-lv:
|
|||||||
What architecture to select (defaults to the native architecture).
|
What architecture to select (defaults to the native architecture).
|
||||||
.TP
|
.TP
|
||||||
.B \-\-name=NAME
|
.B \-\-name=NAME
|
||||||
Base name for the schroot (arch is appended)
|
Base name for the schroot (arch is appended).
|
||||||
.TP
|
.TP
|
||||||
.B \-\-personality=PERSONALITY
|
.B \-\-personality=PERSONALITY
|
||||||
What personality to use (defaults to match \-\-arch)
|
What personality to use (defaults to match \-\-arch).
|
||||||
.TP
|
.TP
|
||||||
.B \-\-debug
|
.B \-\-debug
|
||||||
Turn on script debugging
|
Turn on script debugging.
|
||||||
|
.TP
|
||||||
|
.B \-\-skip\-updates
|
||||||
|
Do not include the -updates pocket in the installed sources.list.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-source\-template=FILE
|
.B \-\-source\-template=FILE
|
||||||
Use FILE as the sources.list template (defaults to $HOME/.mk\-sbuild\-lv.sources)
|
Use FILE as the sources.list template (defaults to $HOME/.mk\-sbuild\-lv.sources).
|
||||||
.TP
|
.TP
|
||||||
.B \-\-debootstrap\-mirror=URL
|
.B \-\-debootstrap\-mirror=URL
|
||||||
Use URL as the debootstrap source (defaults to http://ports.ubuntu.com for lpia,
|
Use URL as the debootstrap source (defaults to http://ports.ubuntu.com for lpia,
|
||||||
@ -36,16 +39,22 @@ official Ubuntu repositories for the supported architectures).
|
|||||||
.SH ENVIRONMENT VARIABLES
|
.SH ENVIRONMENT VARIABLES
|
||||||
.TP
|
.TP
|
||||||
.B LV_SIZE
|
.B LV_SIZE
|
||||||
Size of source LVs (defaults to 5G)
|
Size of source LVs (defaults to 5G).
|
||||||
.TP
|
.TP
|
||||||
.B SNAPSHOT_SIZE
|
.B SNAPSHOT_SIZE
|
||||||
Size of snapshot LVs (defaults to 4G)
|
Size of snapshot LVs (defaults to 4G).
|
||||||
.TP
|
.TP
|
||||||
.B SCHROOT_CONF_SUFFIX
|
.B SCHROOT_CONF_SUFFIX
|
||||||
Lines to append to schroot entries
|
Lines to append to schroot entries.
|
||||||
|
.TP
|
||||||
|
.B SKIP_UPDATES
|
||||||
|
Do not include the -updates pocket in the installed sources.list.
|
||||||
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.TP
|
.TP
|
||||||
|
.B $HOME/.mk\-sbuild\-lv.rc
|
||||||
|
Sourced for environment variables (defined above).
|
||||||
|
.TP
|
||||||
.B $HOME/.mk\-sbuild\-lv.sources
|
.B $HOME/.mk\-sbuild\-lv.sources
|
||||||
Can contain a customized sources.list.
|
Can contain a customized sources.list.
|
||||||
It will be read when creating the schroot.
|
It will be read when creating the schroot.
|
||||||
|
14
mk-sbuild-lv
14
mk-sbuild-lv
@ -107,6 +107,7 @@ function usage()
|
|||||||
echo " --name=NAME Base name for the schroot (arch is appended)"
|
echo " --name=NAME Base name for the schroot (arch is appended)"
|
||||||
echo " --personality=PERSONALITY What personality to use (defaults to match --arch)"
|
echo " --personality=PERSONALITY What personality to use (defaults to match --arch)"
|
||||||
echo " --debug Turn on script debugging"
|
echo " --debug Turn on script debugging"
|
||||||
|
echo " --skip-updates Do not include -updates pocket in sources.list"
|
||||||
echo " --source-template=FILE Use FILE as the sources.list template"
|
echo " --source-template=FILE Use FILE as the sources.list template"
|
||||||
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
|
echo " --debootstrap-mirror=URL Use URL as the debootstrap source"
|
||||||
echo ""
|
echo ""
|
||||||
@ -114,6 +115,7 @@ function usage()
|
|||||||
echo " LV_SIZE Size of source LVs (default ${LV_SIZE})"
|
echo " LV_SIZE Size of source LVs (default ${LV_SIZE})"
|
||||||
echo " SNAPSHOT_SIZE Size of snapshot LVs (default ${SNAPSHOT_SIZE})"
|
echo " SNAPSHOT_SIZE Size of snapshot LVs (default ${SNAPSHOT_SIZE})"
|
||||||
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
|
echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries"
|
||||||
|
echo " SKIP_UPDATES Enable --skip-updates"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +123,7 @@ function usage()
|
|||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
OPTS=`getopt -o '' --long "help,debug,arch:,name:,source-template:,debootstrap-mirror:,personality:" -- "$@"`
|
OPTS=`getopt -o '' --long "help,debug,skip-updates,arch:,name:,source-template:,debootstrap-mirror:,personality:" -- "$@"`
|
||||||
eval set -- "$OPTS"
|
eval set -- "$OPTS"
|
||||||
|
|
||||||
name=""
|
name=""
|
||||||
@ -145,6 +147,10 @@ while :; do
|
|||||||
personality="$2"
|
personality="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
--skip-updates)
|
||||||
|
SKIP_UPDATES="1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--name)
|
--name)
|
||||||
name="$2"
|
name="$2"
|
||||||
shift 2
|
shift 2
|
||||||
@ -231,8 +237,14 @@ else
|
|||||||
cat > "$TEMP_SOURCES" <<EOM
|
cat > "$TEMP_SOURCES" <<EOM
|
||||||
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
||||||
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE main restricted universe multiverse
|
||||||
|
EOM
|
||||||
|
if [ -z "$SKIP_UPDATES" ]; then
|
||||||
|
cat >> "$TEMP_SOURCES" <<EOM
|
||||||
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
deb ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
||||||
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
deb-src ${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu} RELEASE-updates main restricted universe multiverse
|
||||||
|
EOM
|
||||||
|
fi
|
||||||
|
cat >> "$TEMP_SOURCES" <<EOM
|
||||||
deb http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
deb http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
||||||
deb-src http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
deb-src http://security.ubuntu.com/ubuntu RELEASE-security main restricted universe multiverse
|
||||||
EOM
|
EOM
|
||||||
|
@ -35,7 +35,7 @@ debian_distros = ['etch', 'lenny', 'sid', 'stable', 'testing', 'unstable', 'expe
|
|||||||
|
|
||||||
class pbuilder_dist:
|
class pbuilder_dist:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, builder):
|
||||||
|
|
||||||
# Base directory where pbuilder will put all the files it creates.
|
# Base directory where pbuilder will put all the files it creates.
|
||||||
self.base = None
|
self.base = None
|
||||||
@ -70,6 +70,9 @@ class pbuilder_dist:
|
|||||||
# Authentication method
|
# Authentication method
|
||||||
self.auth = 'sudo'
|
self.auth = 'sudo'
|
||||||
|
|
||||||
|
# Builder
|
||||||
|
self.builder = builder
|
||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
if 'PBUILDFOLDER' in os.environ:
|
if 'PBUILDFOLDER' in os.environ:
|
||||||
@ -110,25 +113,6 @@ class pbuilder_dist:
|
|||||||
|
|
||||||
return getattr(self, name)
|
return getattr(self, name)
|
||||||
|
|
||||||
def _calculate(self):
|
|
||||||
""" pbuilder_dist.calculate(distro) -> None
|
|
||||||
|
|
||||||
Do all necessary variable changes (and therefore required checks)
|
|
||||||
before the string that will be executed is generated. At this
|
|
||||||
point it's expected that no more variables will be modified
|
|
||||||
outside this class.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
if not self.build_architecture:
|
|
||||||
self.chroot_string = self.target_distro
|
|
||||||
self.build_architecture = self.system_architecture
|
|
||||||
else:
|
|
||||||
self.chroot_string = '%(target_distro)s-%(build_architecture)s' % self
|
|
||||||
|
|
||||||
if not self.logfile:
|
|
||||||
self.logfile = '%(base)s.%(chroot_string)s.log' % self
|
|
||||||
|
|
||||||
def set_target_distro(self, distro):
|
def set_target_distro(self, distro):
|
||||||
""" pbuilder_dist.set_target_distro(distro) -> None
|
""" pbuilder_dist.set_target_distro(distro) -> None
|
||||||
|
|
||||||
@ -162,8 +146,12 @@ class pbuilder_dist:
|
|||||||
arguments = ('create', 'update', 'build', 'clean', 'login', 'execute')
|
arguments = ('create', 'update', 'build', 'clean', 'login', 'execute')
|
||||||
|
|
||||||
if operation not in arguments:
|
if operation not in arguments:
|
||||||
if item_ends_with(arguments, '.dsc'):
|
if operation.endswith('.dsc'):
|
||||||
|
if os.path.isfile(operation):
|
||||||
self.operation = 'build'
|
self.operation = 'build'
|
||||||
|
else:
|
||||||
|
print 'Error: Could not find file «%s».' % operation
|
||||||
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print 'Error: «%s» is not a recognized argument.' % operation
|
print 'Error: «%s» is not a recognized argument.' % operation
|
||||||
print 'Please use one of those: ' + ', '.join(arguments) + '.'
|
print 'Please use one of those: ' + ', '.join(arguments) + '.'
|
||||||
@ -179,15 +167,33 @@ class pbuilder_dist:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Calculate variables which depend on arguments given at runtime.
|
if not self.build_architecture:
|
||||||
self._calculate()
|
self.chroot_string = self.target_distro
|
||||||
|
self.build_architecture = self.system_architecture
|
||||||
|
else:
|
||||||
|
self.chroot_string = '%(target_distro)s-%(build_architecture)s' % self
|
||||||
|
|
||||||
|
prefix = os.path.join(self.base, self.chroot_string)
|
||||||
|
result = '%s_result/' % prefix
|
||||||
|
|
||||||
|
if not self.logfile:
|
||||||
|
self.logfile = os.path.normpath('%s/build.log' % result)
|
||||||
|
|
||||||
|
if not os.path.isdir(result):
|
||||||
|
# Create the results directory, if it doesn't exist.
|
||||||
|
os.makedirs(result)
|
||||||
|
|
||||||
|
if self.builder == 'pbuilder':
|
||||||
|
base = '--basetgz "%s-base.tgz"' % prefix
|
||||||
|
elif self.builder == 'cowbuilder':
|
||||||
|
base = '--basepath "%s-base.cow"' % prefix
|
||||||
|
|
||||||
arguments = [
|
arguments = [
|
||||||
self.operation,
|
'--%s' % self.operation,
|
||||||
'--basetgz "%(base)s%(chroot_string)s-base.tgz"' % self,
|
base,
|
||||||
'--distribution "%(target_distro)s"' % self,
|
'--distribution "%(target_distro)s"' % self,
|
||||||
'--buildresult "%(base)s%(chroot_string)s_result/"' % self,
|
'--buildresult "%s"' % result,
|
||||||
'--logfile "%(logfile)s"' % self,
|
'--logfile "%s"' % self.logfile,
|
||||||
'--aptcache "/var/cache/apt/archives/"',
|
'--aptcache "/var/cache/apt/archives/"',
|
||||||
### --mirror "${ARCHIVE}" \
|
### --mirror "${ARCHIVE}" \
|
||||||
'--override-config',
|
'--override-config',
|
||||||
@ -217,7 +223,7 @@ class pbuilder_dist:
|
|||||||
if remaining_arguments:
|
if remaining_arguments:
|
||||||
arguments.extend(remaining_arguments)
|
arguments.extend(remaining_arguments)
|
||||||
|
|
||||||
return self.auth + ' /usr/sbin/pbuilder ' + ' '.join(arguments)
|
return self.auth + ' /usr/sbin/' + self.builder + ' ' + ' '.join(arguments)
|
||||||
|
|
||||||
def host_architecture():
|
def host_architecture():
|
||||||
""" host_architecture -> string
|
""" host_architecture -> string
|
||||||
@ -229,20 +235,6 @@ def host_architecture():
|
|||||||
|
|
||||||
return os.uname()[4].replace('x86_64', 'amd64').replace('i586', 'i386').replace('i686', 'i386')
|
return os.uname()[4].replace('x86_64', 'amd64').replace('i586', 'i386').replace('i686', 'i386')
|
||||||
|
|
||||||
def item_ends_with(list, string):
|
|
||||||
""" item_ends_with(list, string) -> bool
|
|
||||||
|
|
||||||
Return True if one of the items in list ends with the given string,
|
|
||||||
or else return False.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
for item in list:
|
|
||||||
if item.endswith(string):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def ask(question):
|
def ask(question):
|
||||||
""" ask(question) -> string
|
""" ask(question) -> string
|
||||||
|
|
||||||
@ -267,7 +259,7 @@ def help(exit_code = 0):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
print 'Bad...'
|
print 'See man pbuilder-dist for more information.'
|
||||||
|
|
||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
@ -287,7 +279,8 @@ def main():
|
|||||||
# Copy arguments into another list for save manipulation
|
# Copy arguments into another list for save manipulation
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
|
|
||||||
if '-' in script_name and parts[0] != 'pbuilder' or len(parts) > 3:
|
if '-' in script_name and (parts[0] != 'pbuilder' and \
|
||||||
|
parts[0] != 'cowbuilder') or len(parts) > 3:
|
||||||
print 'Error: «%s» is not a valid name for a «pbuilder-dist» executable.' % script_name
|
print 'Error: «%s» is not a valid name for a «pbuilder-dist» executable.' % script_name
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -298,9 +291,9 @@ def main():
|
|||||||
if args[0] in ('-h', '--help', 'help'):
|
if args[0] in ('-h', '--help', 'help'):
|
||||||
help(0)
|
help(0)
|
||||||
|
|
||||||
app = pbuilder_dist()
|
app = pbuilder_dist(parts[0])
|
||||||
|
|
||||||
if len(parts) > 1:
|
if len(parts) > 1 and parts[1] != 'dist' and '.' not in parts[1]:
|
||||||
app.set_target_distro(parts[1])
|
app.set_target_distro(parts[1])
|
||||||
else:
|
else:
|
||||||
app.set_target_distro(args.pop(0))
|
app.set_target_distro(args.pop(0))
|
||||||
|
@ -28,7 +28,7 @@ my($release)=$ARGV[1] || 'unstable';
|
|||||||
&checkRelease($release);
|
&checkRelease($release);
|
||||||
my($dsc)=&getDSC(&getMadison(&getURL($package,$release)));
|
my($dsc)=&getDSC(&getMadison(&getURL($package,$release)));
|
||||||
print "$dsc\n";
|
print "$dsc\n";
|
||||||
exec("dget $dsc");
|
exec("dget -xu $dsc");
|
||||||
sub checkRelease {
|
sub checkRelease {
|
||||||
my($release)=shift || die("No Release Passed To checkRelease!\n");
|
my($release)=shift || die("No Release Passed To checkRelease!\n");
|
||||||
chomp $release;
|
chomp $release;
|
||||||
@ -78,7 +78,13 @@ sub getDSC {
|
|||||||
$version=~s/^.*?\://;
|
$version=~s/^.*?\://;
|
||||||
if($archs=~m/source/) {
|
if($archs=~m/source/) {
|
||||||
print "Package: $package\nVersion: $version\nRelease: $release\nArchitectures: $archs\n";
|
print "Package: $package\nVersion: $version\nRelease: $release\nArchitectures: $archs\n";
|
||||||
my($firstLetter)=substr($package,0,1);
|
my($firstLetter);
|
||||||
|
if($package=~m/^lib/) {
|
||||||
|
$firstLetter="lib" . substr($package,3,1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$firstLetter=substr($package,0,1);
|
||||||
|
}
|
||||||
my($url)=$baseURL . $firstLetter . '/' . $package . '/' . $package . '_' . $version . '.dsc';
|
my($url)=$baseURL . $firstLetter . '/' . $package . '/' . $package . '_' . $version . '.dsc';
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
107
requestsync
107
requestsync
@ -25,13 +25,14 @@
|
|||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
|
|
||||||
import getopt
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
import urllib2
|
import urllib2
|
||||||
from debian_bundle.changelog import Version
|
from debian_bundle.changelog import Version
|
||||||
|
from optparse import OptionParser
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
# Use functions from ubuntu-dev-tools to create Launchpad cookie file.
|
# Use functions from ubuntu-dev-tools to create Launchpad cookie file.
|
||||||
sys.path.append('/usr/share/ubuntu-dev-tools/')
|
sys.path.append('/usr/share/ubuntu-dev-tools/')
|
||||||
@ -76,6 +77,8 @@ def checkNeedsSponsorship(component):
|
|||||||
print "If the above is correct please press Enter, otherwise please " \
|
print "If the above is correct please press Enter, otherwise please " \
|
||||||
"press Ctrl-C to stop this script now\nand check the cookie file " \
|
"press Ctrl-C to stop this script now\nand check the cookie file " \
|
||||||
"at:", launchpad_cookiefile
|
"at:", launchpad_cookiefile
|
||||||
|
print "Logging into Launchpad, deleting the above and rerunning this " \
|
||||||
|
"script should be enough to generate the cookie."
|
||||||
raw_input_exit_on_ctrlc() # Abort if necessary.
|
raw_input_exit_on_ctrlc() # Abort if necessary.
|
||||||
return True # Sponsorship required.
|
return True # Sponsorship required.
|
||||||
|
|
||||||
@ -87,10 +90,15 @@ def checkExistingReports(package):
|
|||||||
|
|
||||||
If found ask for confirmation on filing a request.
|
If found ask for confirmation on filing a request.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
launchpad = common.get_launchpad("ubuntu-dev-tools")
|
launchpad = common.get_launchpad("ubuntu-dev-tools")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print >> sys.stderr, 'Importing launchpadlib failed. Is python-launchpadlib installed?'
|
print >> sys.stderr, 'Importing launchpadlib failed. Is ' \
|
||||||
|
'python-launchpadlib installed?'
|
||||||
|
print >> sys.stderr, "Skipping existing report check, you should "\
|
||||||
|
"manually check at:"
|
||||||
|
print "- https://bugs.launchpad.net/ubuntu/+source/%s" % package
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Fetch the package's bug list from Launchpad.
|
# Fetch the package's bug list from Launchpad.
|
||||||
@ -210,23 +218,6 @@ def raw_input_exit_on_ctrlc(*args, **kwargs):
|
|||||||
print 'Abort requested. No sync request filed.'
|
print 'Abort requested. No sync request filed.'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def usage():
|
|
||||||
print '''Usage: requestsync [-d distro|-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever]
|
|
||||||
|
|
||||||
In some cases, the base version (fork point from Debian) cannot be determined
|
|
||||||
automatically, and you'll get a complete Debian changelog. Specify the correct
|
|
||||||
base version of the package in Ubuntu.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-d distro Override Debian distribution to sync from [unstable].
|
|
||||||
-h Print this help.
|
|
||||||
-n New source package (doesn't exist yet in Ubuntu).
|
|
||||||
-s Specify that you require sponsorship.
|
|
||||||
-k <keyid> Sign email with <keyid> (only used when submitting per email).
|
|
||||||
--lp Use python-launchpad-bugs instead of email for bug submitting.
|
|
||||||
'''
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def get_email_address():
|
def get_email_address():
|
||||||
'''Get the DEBEMAIL environment variable or give an error.'''
|
'''Get the DEBEMAIL environment variable or give an error.'''
|
||||||
myemailaddr = os.getenv('DEBEMAIL')
|
myemailaddr = os.getenv('DEBEMAIL')
|
||||||
@ -370,7 +361,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
|||||||
in_confirm_loop = False
|
in_confirm_loop = False
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print "Invalid answer"
|
print "Invalid answer."
|
||||||
|
|
||||||
# Create bug
|
# Create bug
|
||||||
bug = launchpad.bugs.createBug(description=bugtext, title=bugtitle, target=product_url)
|
bug = launchpad.bugs.createBug(description=bugtext, title=bugtitle, target=product_url)
|
||||||
@ -384,7 +375,6 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
|||||||
bug.subscribe(person=subscribe_url)
|
bug.subscribe(person=subscribe_url)
|
||||||
|
|
||||||
print 'Sync request filed as bug #%i: %s' % (bug.id, common.translate_api_web(bug.self_link))
|
print 'Sync request filed as bug #%i: %s' % (bug.id, common.translate_api_web(bug.self_link))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def edit_report(subject, body, changes_required=False):
|
def edit_report(subject, body, changes_required=False):
|
||||||
@ -441,52 +431,73 @@ def edit_report(subject, body, changes_required=False):
|
|||||||
#
|
#
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
newsource = False
|
# Our usage options.
|
||||||
sponsorship = False
|
usage = "Usage: %prog [-d distro] [-k keyid] [-n] [--lp] [-s] <source "
|
||||||
keyid = None
|
usage += "package> <target release> [base version]"
|
||||||
use_lp_bugs = False
|
optParser = OptionParser(usage)
|
||||||
need_interaction = False
|
|
||||||
distro = 'unstable'
|
|
||||||
|
|
||||||
try:
|
optParser.add_option("-d", type = "string",
|
||||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hsnd:k:', ('lp'))
|
dest = "dist", default = "unstable",
|
||||||
except getopt.GetoptError:
|
help = "Debian distribution to sync from.")
|
||||||
usage()
|
optParser.add_option("-k", type = "string",
|
||||||
for o, a in opts:
|
dest = "keyid", default = None,
|
||||||
if o == '-h': usage()
|
help = "GnuPG key ID to use for signing report.")
|
||||||
if o == '-n': newsource = True
|
optParser.add_option("-n", action = "store_true",
|
||||||
if o == '-k': keyid = a
|
dest = "newpkg", default = False,
|
||||||
if o == '-d': distro = a
|
help = "Whether package to sync is a new package in Ubuntu.")
|
||||||
if o == "-s": sponsorship = True
|
optParser.add_option("--lp", action = "store_true",
|
||||||
if o == '--lp': use_lp_bugs = True
|
dest = "lpbugs", default = False,
|
||||||
|
help = "Specify whether to use the launchpadbugs module for filing " \
|
||||||
|
"report.")
|
||||||
|
optParser.add_option("-s", action = "store_true",
|
||||||
|
dest = "sponsor", default = False,
|
||||||
|
help = "Force sponsorship requirement (shall be autodetected if not " \
|
||||||
|
"specified).")
|
||||||
|
|
||||||
|
(options, args) = optParser.parse_args()
|
||||||
|
|
||||||
|
newsource = options.newpkg
|
||||||
|
sponsorship = options.sponsor
|
||||||
|
keyid = options.keyid
|
||||||
|
use_lp_bugs = options.lpbugs
|
||||||
|
need_interaction = False
|
||||||
|
distro = options.dist
|
||||||
|
|
||||||
if len(args) not in (2, 3):
|
if len(args) not in (2, 3):
|
||||||
usage()
|
optParser.error("Source package / target release missing - please " \
|
||||||
|
"specify.")
|
||||||
|
|
||||||
if not use_lp_bugs and not get_email_address():
|
if not use_lp_bugs and not get_email_address():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
(srcpkg, release) = args[:2]
|
srcpkg = args[0]
|
||||||
|
release = args[1]
|
||||||
force_base_ver = None
|
force_base_ver = None
|
||||||
if len(args) == 3:
|
|
||||||
force_base_ver = args[2]
|
# Base version specified.
|
||||||
|
if len(args) == 3: force_base_ver = args[2]
|
||||||
|
|
||||||
(cur_ver, component) = ('0', 'universe') # Let's assume universe
|
(cur_ver, component) = ('0', 'universe') # Let's assume universe
|
||||||
if not newsource:
|
|
||||||
(cur_ver, component) = cur_version_component(srcpkg, release)
|
# Find Ubuntu release's package version.
|
||||||
|
if not newsource: (cur_ver, component) = cur_version_component(srcpkg, release)
|
||||||
|
|
||||||
debiancomponent = debian_component(srcpkg, distro)
|
debiancomponent = debian_component(srcpkg, distro)
|
||||||
|
# Find Debian release's package version.
|
||||||
deb_version = cur_deb_version(srcpkg, distro)
|
deb_version = cur_deb_version(srcpkg, distro)
|
||||||
|
|
||||||
# -s flag not specified - check if we do need sponsorship.
|
# Debian and Ubuntu versions are the same - stop.
|
||||||
if not sponsorship: sponsorship = checkNeedsSponsorship(component)
|
|
||||||
|
|
||||||
if deb_version == cur_ver:
|
if deb_version == cur_ver:
|
||||||
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)
|
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# -s flag not specified - check if we do need sponsorship.
|
||||||
|
if not sponsorship: sponsorship = checkNeedsSponsorship(component)
|
||||||
|
|
||||||
|
# Check for existing package reports.
|
||||||
if not newsource: checkExistingReports(srcpkg)
|
if not newsource: checkExistingReports(srcpkg)
|
||||||
|
|
||||||
# generate bug report
|
# Generate bug report.
|
||||||
subscribe = 'ubuntu-archive'
|
subscribe = 'ubuntu-archive'
|
||||||
status = 'confirmed'
|
status = 'confirmed'
|
||||||
if sponsorship:
|
if sponsorship:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user