[Pkg-bazaar-commits] ./bzr-builddeb/trunk.old r259: Switch back to options for import-dsc and merge-upstream.
James Westby
jw+debian at jameswestby.net
Wed Dec 10 08:32:59 UTC 2008
------------------------------------------------------------
revno: 259
committer: James Westby <jw+debian at jameswestby.net>
branch nick: 2.0
timestamp: Wed 2008-08-27 22:04:38 +0100
message:
Switch back to options for import-dsc and merge-upstream.
modified:
__init__.py
doc/user_manual/native.rst
doc/user_manual/normal.rst
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2008-08-27 17:38:37 +0000
+++ b/__init__.py 2008-08-27 21:04:38 +0000
@@ -383,29 +383,38 @@
archive, or a directory. The source may also be a remote file.
You must supply the version number of the new upstream release
- as the second argument to the command.
-
- The third argument must be the target distribtution you aim to
- upload to, one of "debian" or "ubuntu". You can also specify the
- target used in the changelog, e.g. "unstable", and it will be
- resolved automatically.
+ using --version, and the target distribution using --distribution.
+ The target distribtution is the distribution that you aim to upload to,
+ one of "debian" or "ubuntu". You can also specify the target used in
+ the changelog, e.g. "unstable", and it will be resolved automatically.
If there is no debian changelog in the branch to retrieve the package
name from then you must pass the --package option. If this version
will change the name of the source package then you can use this option
to set the new name.
"""
- takes_args = ['tarball', 'version', 'target_distribution']
+ takes_args = ['tarball']
aliases = ['mu']
package_opt = Option('package', help="The name of the source package.",
type=str)
+ version_opt = Option('version', help="The version number of this release.",
+ type=str)
+ distribution_opt = Option('distribution', help="The distribution that "
+ "this release is targetted at", type=str)
+
takes_options = [package_opt, no_user_conf_opt]
- def run(self, tarball, version, target_distribution, package=None,
+ def run(self, tarball, version=None, distribution=None, package=None,
no_user_config=None):
from bzrlib.plugins.builddeb.errors import MissingChangelogError
from bzrlib.plugins.builddeb.repack_tarball import repack_tarball
+ if version is None:
+ raise BzrCommandError("You must specify the version number using "
+ "--version.")
+ if distribution is None:
+ raise BzrCommandError("You must specify the target distribution "
+ "using --distribution.")
tree, _ = WorkingTree.open_containing('.')
tree.lock_write()
try:
@@ -452,16 +461,16 @@
"are of different formats. Either delete the target "
"file, or use it as the argument to import.")
tarball_filename = os.path.join(orig_dir, dest_name)
- target_distribution = target_distribution.lower()
- distribution_name = lookup_distribution(target_distribution)
- target_name = target_distribution
+ distribution = distribution.lower()
+ distribution_name = lookup_distribution(distribution)
+ target_name = distribution
if distribution_name is None:
- if target_distribution not in ("debian", "ubuntu"):
+ if distribution not in ("debian", "ubuntu"):
raise BzrCommandError("Unknown target distribution: %s" \
% target_dist)
else:
target_name = None
- distribution_name = target_distribution
+ distribution_name = distribution
db = DistributionBranch(distribution_name, tree.branch, None,
tree=tree)
dbs = DistributionBranchSet()
@@ -501,11 +510,13 @@
system you can use this command.
"""
- takes_args = ['target_distribution', 'files*']
+ takes_args = ['files*']
filename_opt = Option('file', help="File containing URIs of source "
"packages to import.", type=str, argname="filename",
short_name='F')
+ distribution_opt = Option('distribution', help="The distribution that "
+ "these packages were uploaded to.")
takes_options = [filename_opt]
@@ -532,16 +543,19 @@
get_dsc_part(from_transport, name)
db.import_package(os.path.join(orig_target, filename))
- def run(self, target_distribution, files_list, filename=None):
+ def run(self, files_list, distribution=None, filename=None):
from bzrlib.plugins.builddeb.errors import MissingChangelogError
- target_distribution = target_distribution.lower()
- distribution_name = lookup_distribution(target_distribution)
+ if distribution is None:
+ raise BzrCommandError("You must specify the distribution "
+ "these packages were uploaded to using --distribution.")
+ distribution = distribution.lower()
+ distribution_name = lookup_distribution(distribution)
if distribution_name is None:
- if target_distribution not in ("debian", "ubuntu"):
+ if distribution not in ("debian", "ubuntu"):
raise BzrCommandError("Unknown target distribution: %s" \
% target_dist)
else:
- distribution_name = target_distribution
+ distribution_name = distribution
try:
tree = WorkingTree.open_containing('.')[0]
except NotBranchError:
=== modified file 'doc/user_manual/native.rst'
--- a/doc/user_manual/native.rst 2008-08-27 17:46:19 +0000
+++ b/doc/user_manual/native.rst 2008-08-27 21:04:38 +0000
@@ -80,7 +80,7 @@
$ bzr init scruff
$ cd scruff
- $ bzr import-dsc debian *.dsc
+ $ bzr import-dsc --distribution debian *.dsc
which will create a branch named ``scruff``, which will have the history
populated with the information in the source packages. You can see this
@@ -93,7 +93,7 @@
``SFTP`` automatically. Just give the URIs to the files on the command line
instead of local paths. For instance::
- $ bzr import-dsc debian \
+ $ bzr import-dsc --distribution debian \
http://ftp.debian.org/pool/main/s/scruff/scruff_0.1-1.dsc
As it is unwieldy to provide lots of URIs on the command line it is also
@@ -105,7 +105,7 @@
::
- $ bzr import-dsc debian -F package-sources
+ $ bzr import-dsc --distribution debian -F package-sources
will import all of the ``.dsc`` files listed. You can provide both a file
and a list of packages on the command line if you like.
=== modified file 'doc/user_manual/normal.rst'
--- a/doc/user_manual/normal.rst 2008-08-27 17:46:19 +0000
+++ b/doc/user_manual/normal.rst 2008-08-27 21:04:38 +0000
@@ -71,17 +71,17 @@
``merge-upstream`` command. To use it you need to download the upstream
tarball in to the current directory. Then you enter the current directory
and run the command, passing it the name of the upstream tarball, and the
-version number that it corresponds to. This is the upstream version number,
-not the packaging version. It is required as it is difficult to guess this
-number, and so it is better for the user to provide it. In our example the
-upstream tarball is named ``scruff-0.1.tar.gz`` and the version number is
-``0.1``. As there is not code in the branch yet the plugin does not know
-what package you are creating. So you must also supply the package name
-using the ``--package`` option. This means that once you have downloaded
-the tarball you should run::
+version number that it corresponds to. It is required as it is difficult
+to guess this number, and so it is better for the user to provide it.
+In our example the upstream tarball is named ``scruff-0.1.tar.gz`` and
+the version number is ``0.1``. As there is not code in the branch yet the
+plugin does not know what package you are creating. So you must also supply
+the package name using the ``--package`` option. This means that once you
+have downloaded the tarball you should run::
$ cd scruff/
- $ bzr merge-upstream ../scruff-0.1.tar.gz 0.1 debian --package scruff
+ $ bzr merge-upstream ../scruff-0.1.tar.gz --version 0.1 \
+ --distribution debian --package scruff
If it is instead intended for Ubuntu then substitute "debian" with
"ubuntu".
@@ -140,7 +140,7 @@
$ bzr init scruff
$ cd scruff
- $ bzr import-dsc debian ../*.dsc
+ $ bzr import-dsc --distribution debian ../*.dsc
which will create a branch named ``scruff``, which will have the history
populated with the information in the source packages. You can see this
@@ -156,7 +156,7 @@
``SFTP`` automatically. Just give the URIs to the files on the command line
instead of local paths. For instance::
- $ bzr import-dsc debian \
+ $ bzr import-dsc --distribution debian \
http://ftp.debian.org/pool/main/s/scruff/scruff_0.1-1.dsc
As it is unwieldy to provide lots of URIs on the command line it is also
@@ -168,7 +168,7 @@
::
- $ bzr import-dsc debian -F package-sources
+ $ bzr import-dsc --distribution debian -F package-sources
will import all of the ``.dsc`` files listed. You can provide both a file
and a list of packages on the command line if you like.
@@ -210,7 +210,8 @@
For instance when the ``0.2`` version of ``scruff`` is released the command
to update to the new version is::
- $ bzr merge-upstream http://scruff.org/releases/scruff-0.2.tar.gz 0.2-1 debian
+ $ bzr merge-upstream --version 0.2-1 --distribution debian \
+ http://scruff.org/releases/scruff-0.2.tar.gz
This command downloads the new version, and imports it in to the branch. It
then merges in the packaging changes to the new version.
@@ -250,7 +251,7 @@
local path this can be any URI that Bazaar supports, for instance a
``http://`` URL. For instance::
- $ bzr import-dsc debian ../scruff_0.2-1.1.dsc
+ $ bzr import-dsc --distribution debian ../scruff_0.2-1.1.dsc
The command will import the changes and then leave you with a tree that is
the result of merging the changes in the source package in to the tip of
More information about the Pkg-bazaar-commits
mailing list