After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732389 - task-builddisks: allows restricting to particular specific targets
task-builddisks: allows restricting to particular specific targets
Status: RESOLVED FIXED
Product: gnome-continuous
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Continuous maintainer(s)
GNOME Continuous maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-06-28 14:00 UTC by Owen Taylor
Modified: 2014-07-09 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
task-builddisks: allows restricting to particular specific targets (2.14 KB, patch)
2014-06-28 14:00 UTC, Owen Taylor
reviewed Details | Review
task-builddisks: allows restricting to particular specific targets (2.46 KB, patch)
2014-06-30 14:28 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2014-06-28 14:00:10 UTC
Rebuilding disk images can be slow, even when they can be incrementally
updated. Allow, e.g.:

 make -n builddisks targets='["x86_64-runtime"]'

To rebuild only a subset of the disk images.
Comment 1 Owen Taylor 2014-06-28 14:00:11 UTC
Created attachment 279486 [details] [review]
task-builddisks: allows restricting to particular specific targets
Comment 2 Colin Walters 2014-06-30 01:31:40 UTC
Review of attachment 279486 [details] [review]:

This would seem cleaner if we filtered

::: src/js/tasks/task-builddisks.js
@@ +89,3 @@
+                        break;
+                    }
+                }

I think this would be cleaner if we filtered the targets array before dropping into this loop, since conceptually they're independent.  (Although your patch does allow building disks *not* in _onlyTreeSuffixes, but I don't think we need/want that)
Comment 3 Owen Taylor 2014-06-30 14:28:56 UTC
Created attachment 279606 [details] [review]
task-builddisks: allows restricting to particular specific targets

Here's a new version that filters the list of targets before the
loop. (Looking forward to reasonable iteration over arrays with 'for ... of'!)

====
Rebuilding disk images can be slow, even when they can be incrementally
updated. Allow, e.g.:

 make -n builddisks targets='["x86_64-runtime"]'

To rebuild only a subset of the disk images.
Comment 4 Colin Walters 2014-06-30 20:37:49 UTC
Review of attachment 279606 [details] [review]:

One minor comment, please push after updating.  Thanks!a

::: src/js/tasks/task-builddisks.js
@@ +94,3 @@
             let matched = false;
+            for (let j = 0; j < this._onlyTreeSuffixes.length; j++) {
+                if (JSUtil.stringEndswith(targetName, this._onlyTreeSuffixes[j])) {

Don't need this i -> j hunk anymore.
Comment 5 Owen Taylor 2014-07-09 15:13:58 UTC
(In reply to comment #4)
> Review of attachment 279606 [details] [review]:
> 
> One minor comment, please push after updating.  Thanks!a
> 
> ::: src/js/tasks/task-builddisks.js
> @@ +94,3 @@
>              let matched = false;
> +            for (let j = 0; j < this._onlyTreeSuffixes.length; j++) {
> +                if (JSUtil.stringEndswith(targetName,
> this._onlyTreeSuffixes[j])) {
> 
> Don't need this i -> j hunk anymore.

How so? It still looks needed to me - there's a loop over i surrounding this.
Comment 6 Colin Walters 2014-07-09 18:43:09 UTC
Ah yes, I was wrong.  Looks good then, thanks!
Comment 7 Owen Taylor 2014-07-09 20:49:18 UTC
Attachment 279606 [details] pushed as 6799710 - task-builddisks: allows restricting to particular specific targets