Merge lp:~jml/udd/less-in-top-level into lp:udd

Proposed by Jonathan Lange
Status: Merged
Merged at revision: 530
Proposed branch: lp:~jml/udd/less-in-top-level
Merge into: lp:udd
Diff against target: 121 lines (+16/-16)
5 files modified
README (+4/-4)
etc-init.d-mass-import (+1/-1)
fixit.sh (+2/-2)
importer.crontab (+7/-7)
pkgimport.conf (+2/-2)
To merge this branch: bzr merge lp:~jml/udd/less-in-top-level
Reviewer Review Type Date Requested Status
Martin Packman Approve
Ubuntu Distributed Development Developers Pending
Review via email: mp+80037@code.launchpad.net

Description of the change

The top-level of lp:udd is a little bit intimidating. There are a lot of files there, and the beginner will not know which are which. This branch moves all of the scripts to a bin/ directory, and renames them to have dashes instead of underscores and to not have '.py' extensions.

I thought about creating two script directories – one for production scripts and the other for development scripts – but I didn't feel confident enough about the distinction.

Haven't tested this in any way yet. Not exactly sure how, since the most likely issue is PYTHONPATH related.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Yeah, the first thing I did after branching lp:udd the other day was look in one of the top level files then close it again and go and find the actual module.

Given my heritage, I dislike the bin/no-extension style but it's clearly the right thing now you've made scripts to run as separate files from python modules.

Having some kind of division between the scripts might be useful (cron vs. manual tool seems relevant) but could be done later anyway.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2011-10-20 09:49:53 +0000
3+++ README 2011-10-21 10:21:30 +0000
4@@ -15,7 +15,7 @@
5 Overview
6 ********
7
8-``list_packages`` gets a list of all source packages in interesting releases
9+``list-packages`` gets a list of all source packages in interesting releases
10 from Launchpad.
11
12 Deployment
13@@ -35,7 +35,7 @@
14 ``lp:udd`` after approval but deployment is done when time and circumstances
15 permit.
16
17-mass_import
18+mass-import
19 -----------
20
21 The ``etc-init.d-mass-import`` script, installed into
22@@ -58,10 +58,10 @@
23
24 but don't forget to requeue the killed imports later.
25
26-import_package
27+import-package
28 --------------
29
30-The ``import_package.py`` script is generally called in a subprocess by
31+The ``import-package`` script is generally called in a subprocess by
32 ``mass-import``.
33
34 For debug purposes, it can also be run locally with additional options:
35
36=== added directory 'bin'
37=== renamed file 'add_import_jobs.py' => 'bin/add-import-jobs'
38=== renamed file 'analyze_log.py' => 'bin/analyze-log'
39=== renamed file 'branch_branches_from_lp.py' => 'bin/branch-branches-from-lp'
40=== renamed file 'categorise_failures.py' => 'bin/categorise-failures'
41=== renamed file 'count_outstanding_jobs.py' => 'bin/count-outstanding-jobs'
42=== renamed file 'cricket.py' => 'bin/cricket'
43=== renamed file 'delete_branches_from_lp.py' => 'bin/delete-branches-from-lp'
44=== renamed file 'email_failures.py' => 'bin/email-failures'
45=== renamed file 'graph_failures.py' => 'bin/graph-failures'
46=== renamed file 'import_package.py' => 'bin/import-package'
47=== renamed file 'list_packages.py' => 'bin/list-packages'
48=== renamed file 'logrotate.py' => 'bin/logrotate'
49=== renamed file 'mass_import.py' => 'bin/mass-import'
50=== renamed file 'requeue_package.py' => 'bin/requeue-package'
51=== renamed file 'set_official.py' => 'bin/set-official'
52=== renamed file 'show_failure.py' => 'bin/show-failure'
53=== modified file 'etc-init.d-mass-import'
54--- etc-init.d-mass-import 2011-07-19 09:48:17 +0000
55+++ etc-init.d-mass-import 2011-10-21 10:21:30 +0000
56@@ -3,7 +3,7 @@
57 export BASEDIR=/srv/package-import.canonical.com/new
58 PATH=${BASEDIR}/scripts:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
59 NAME=mass-import
60-DAEMON=${BASEDIR}/scripts/mass_import.py
61+DAEMON=${BASEDIR}/scripts/bin/mass-import
62 PIDFILE=${BASEDIR}/mass-import.pid
63 STOPFILE=${BASEDIR}/STOP_PLEASE
64 USER=pkg_import
65
66=== modified file 'fixit.sh'
67--- fixit.sh 2011-07-19 09:48:17 +0000
68+++ fixit.sh 2011-10-21 10:21:30 +0000
69@@ -12,7 +12,7 @@
70 # ones in a better place.
71
72 export BASEDIR=/srv/package-import.canonical.com/new
73-export PATH=${BASEDIR}/scripts:${PATH}
74+export PATH=${BASEDIR}/scripts/bin:${PATH}
75 export BZR_PLUGIN_PATH=${BASEDIR}/scripts/plugins
76 export LANG="en_GB.UTF-8"
77 export BZR_EMAIL="Package Import Robot <package-import@ubuntu.com>"
78@@ -63,5 +63,5 @@
79 }
80
81 requeue() {
82- requeue_package.py "$@"
83+ requeue-package "$@"
84 }
85
86=== modified file 'importer.crontab'
87--- importer.crontab 2011-07-19 09:48:17 +0000
88+++ importer.crontab 2011-10-21 10:21:30 +0000
89@@ -1,8 +1,8 @@
90-SCRIPTS_DIR=/srv/package-import.canonical.com/new/scripts
91+SCRIPTS_DIR=/srv/package-import.canonical.com/new/scripts/bin
92 # m h dom mon dow command
93-17 * * * * /usr/bin/python ${SCRIPTS_DIR}/logrotate.py
94-*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/categorise_failures.py
95-*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/add_import_jobs.py
96-17 07 * * * /usr/bin/python ${SCRIPTS_DIR}/list_packages.py
97-30 03 * * * /usr/bin/python ${SCRIPTS_DIR}/email_failures.py
98-21 * * * * /usr/bin/python ${SCRIPTS_DIR}/graph_failures.py
99+17 * * * * /usr/bin/python ${SCRIPTS_DIR}/logrotate
100+*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/categorise-failures
101+*/5 * * * * /usr/bin/python ${SCRIPTS_DIR}/add-import-jobs
102+17 07 * * * /usr/bin/python ${SCRIPTS_DIR}/list-packages
103+30 03 * * * /usr/bin/python ${SCRIPTS_DIR}/email-failures
104+21 * * * * /usr/bin/python ${SCRIPTS_DIR}/graph-failures
105
106=== modified file 'pkgimport.conf'
107--- pkgimport.conf 2011-10-06 14:21:18 +0000
108+++ pkgimport.conf 2011-10-21 10:21:30 +0000
109@@ -19,10 +19,10 @@
110
111 # Script that imports the package. Must be executable and take a single
112 # argument: the name of the package to import.
113-pkgimport.import_script = /srv/package-import.canonical.com/new/scripts/import_package.py
114+pkgimport.import_script = /srv/package-import.canonical.com/new/scripts/bin/import-package
115
116 # Which distributions to operate on. Normally "ubuntu, debian". No default.
117-# Affects behaviour of add_import_jobs.py and list_packages.py.
118+# Affects behaviour of add-import-jobs and list-packages.
119 pkgimport.distributions = ubuntu,debian
120
121 # Whether or not to retry all failed jobs. 'true' means to retry all failed

Subscribers

People subscribed via source and target branches