summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-03-06 22:39:45 +0200
committerLars Wirzenius <liw@liw.fi>2016-03-06 22:41:11 +0200
commitf626be6dcc489ab9cd5ff27fef285673423b2e19 (patch)
tree8a2a530554df5cb75aacc31b4e72824c3b98c37b
parent010d97a6277403c723726885ba78e181024a5597 (diff)
downloadick-f626be6dcc489ab9cd5ff27fef285673423b2e19.tar.gz
Move FindDebianChangesFiles into its own module
-rw-r--r--icklib/__init__.py1
-rw-r--r--icklib/project.py26
-rw-r--r--icklib/step_debian_changes.py45
-rw-r--r--without-tests1
4 files changed, 49 insertions, 24 deletions
diff --git a/icklib/__init__.py b/icklib/__init__.py
index a54cccc..cada16d 100644
--- a/icklib/__init__.py
+++ b/icklib/__init__.py
@@ -29,6 +29,7 @@ from .step_debian_binary import (
CreateCIDebianBinaryPackages,
CreateDebianBinaryPackagesForRelease,
)
+from .step_debian_changes import FindDebianChangesFiles
from .step_debian_info import CollectDebianInfoAboutTargets
from .step_debian_source import (
CreateDebianSourcePackagesForCI,
diff --git a/icklib/project.py b/icklib/project.py
index 9e5ccf0..b6ea875 100644
--- a/icklib/project.py
+++ b/icklib/project.py
@@ -27,7 +27,6 @@ import sys
import tempfile
import time
import urllib
-import urlparse
import cliapp
@@ -223,27 +222,6 @@ class Project(object):
remote_git_dir)
-class FindDebianChangesFiles(icklib.BuildStep):
-
- def build(self):
- self.run_state.changes_files = []
- if self.building():
- artifacts = self.run_state.build_info.create_artifacts_directory()
- for changes in glob.glob(os.path.join(artifacts, '*.changes')):
- changes_url = urlparse.urljoin(
- 'file://',
- urllib.quote(os.path.abspath(changes)))
- self.run_state.changes_files.append(changes_url)
-
- def building(self):
- names = [
- 'build_using_shell',
- 'build_using_debian_ci',
- 'build_tags_using_debian_release',
- ]
- return any(getattr(self.run_state, x, False) for x in names)
-
-
class SetupAPTRepository(icklib.BuildStep):
def build(self):
@@ -506,7 +484,7 @@ def create_projects_from_ick(ick, wanted_names):
icklib.CreateCITarball,
icklib.CreateDebianSourcePackagesForCI,
icklib.CreateCIDebianBinaryPackages,
- FindDebianChangesFiles,
+ icklib.FindDebianChangesFiles,
SetupAPTRepository,
UploadDebianPackagesToCIRepo,
icklib.FinishBuildInfo,
@@ -522,7 +500,7 @@ def create_projects_from_ick(ick, wanted_names):
icklib.CreateReleaseTarballs,
icklib.CreateDebianSourcePackagesForRelease,
icklib.CreateDebianBinaryPackagesForRelease,
- FindDebianChangesFiles,
+ icklib.FindDebianChangesFiles,
SetupAPTRepository,
UploadDebianPackagesToCIRepo,
PublishDebianPackages,
diff --git a/icklib/step_debian_changes.py b/icklib/step_debian_changes.py
new file mode 100644
index 0000000..6985097
--- /dev/null
+++ b/icklib/step_debian_changes.py
@@ -0,0 +1,45 @@
+# Copyright 2016 Lars Wirzenius
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+# =*= License: GPL-3+ =*=
+
+
+import glob
+import os
+import urllib
+import urlparse
+
+import icklib
+
+
+class FindDebianChangesFiles(icklib.BuildStep):
+
+ def build(self):
+ self.run_state.changes_files = []
+ if self.building():
+ artifacts = self.run_state.build_info.create_artifacts_directory()
+ for changes in glob.glob(os.path.join(artifacts, '*.changes')):
+ changes_url = urlparse.urljoin(
+ 'file://',
+ urllib.quote(os.path.abspath(changes)))
+ self.run_state.changes_files.append(changes_url)
+
+ def building(self):
+ names = [
+ 'build_using_shell',
+ 'build_using_debian_ci',
+ 'build_tags_using_debian_release',
+ ]
+ return any(getattr(self.run_state, x, False) for x in names)
diff --git a/without-tests b/without-tests
index 5a33c0f..2a4e242 100644
--- a/without-tests
+++ b/without-tests
@@ -7,6 +7,7 @@ icklib/progress.py
icklib/step_build_info.py
icklib/step_create_tarball.py
icklib/step_debian_binary.py
+icklib/step_debian_changes.py
icklib/step_debian_info.py
icklib/step_debian_source.py
icklib/step_find_current_commit.py