Commit e059e577 authored by Neil Bingham's avatar Neil Bingham
Browse files

* Improvements to Builder's version handling.

  * Improvements to debugging support.
Detail
  * Changed Builder to use DebugLib.
  * Builder is now capable of using DCotton's new image naming scheme.
    An extra set of Radio buttons for selecting the naming scheme has
    been added to the Options window.  The versioning scheme selected is
    saved in the defaults file.
Admin
  * Tested on ONC2UK build using both ImageName and NewImName scripts for
    versioning.
  * Assumes that NewImName will be checked into BuildSys/perl/ once
    completed.

Version 0.11. Tagged as 'builder-0_11'
parent eb46862e
| Copyright 1999 Pace Micro Technology plc
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine all THROWBACK=-throwback DFLAGS=-DDEBUGLIB
| Copyright 1999 Pace Micro Technology plc
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine install THROWBACK=-throwback INSTDIR=<Install$Dir> DFLAGS=-DDEBUGLIB
......@@ -61,6 +61,8 @@ ABSSYM = RISC_OSLib:o.AbsSym
EVENTLIB = Tbox:o.eventlib
TOOLBOXLIB = Tbox:o.toolboxlib
WIMPLIB = Tbox:o.wimplib
DEBUGLIB = <Lib$Dir>.Debuglib.o.debuglib TCPIPLibs:o.socklib5zm TCPIPLibs:o.inetlibzm
#
# Include files
#
......@@ -73,7 +75,7 @@ COMPONENT = Builder
TARGET = !RunImage
APP = ${INSTDIR}.!${COMPONENT}
OBJS = o.main o.db o.msg o.env o.file o.parse o.build
OBJS = o.main o.msg o.env o.file o.parse o.build
#
......@@ -95,6 +97,7 @@ clean:
install: ${TARGET}
${MKDIR} ${APP}
${WIPE} ${APP}.${TARGET} ${WFLAGS}
${CP} ${TARGET} ${APP}.${TARGET} ${CPFLAGS}
${CP} Resources.* ${APP}.* ${CPFLAGS}
${CHMOD} ${APP} ${CHMODFLAGS}
......@@ -104,6 +107,6 @@ install: ${TARGET}
# Target
#
${TARGET}: ${OBJS}
${LD} -o $@ ${OBJS} ${CLIB} ${EVENTLIB} ${TOOLBOXLIB} ${WIMPLIB}
${LD} -o $@ ${OBJS} ${DEBUGLIB} ${CLIB} ${EVENTLIB} ${TOOLBOXLIB} ${WIMPLIB}
#
# Dynamic dependencies:o.main: c.main
......@@ -10,10 +10,12 @@ RMEnsure SaveAs 0.05 Error SaveAs module missing from System path
RMEnsure Iconbar 1.08 System:Modules.Toolbox.Iconbar
RMEnsure Iconbar 1.08 Error Iconbar module missing from System path
RMEnsure Menu 0.17 System:Modules.Toolbox.Menu
RMEnsure Menu 0.17 Error Menu module missing from System path
RMEnsure ProgInfo 0.06 System:Modules.Toolbox.ProgInfo
RMEnsure ProgInfo 0.06 Error ProgInfo module missing from System path
WimpSlot -min 32K -max 32K
| pass -quit to !RunImage if you just want the environement sourced.
WimpSlot -min 256k
Run <Builder$Dir>.!RunImage %*0
RMEnsure ProgInfo 0.06 System:Modules.Toolbox.ProgInfo
RMEnsure ProgInfo 0.06 Error ProgInfo module missing from System path
Run <Builder$Dir>.!RunImage
......@@ -3,7 +3,7 @@
wimpslot 2048k
| first argument should be passwd onto imagename script
perl <Build$Dir>.BuildSys.perl.ImageName %0
If "%0" = "ImageName" Then perl <Build$Dir>.BuildSys.perl.ImageName %1 Else perl <Build$Dir>.BuildSys.perl.NewImName -verfile <Choices$dir>.AutoBuild.<Build>.Version %1
| the rest should be passed onto srcbuild
srcbuild -v %*1
srcbuild -v %*2
No preview for this file type
/* (0.10)
/* (0.11)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.10
#define Module_MajorVersion_CMHG 0.11
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Sep 1999
#define Module_Date_CMHG 26 Oct 1999
#define Module_MajorVersion "0.10"
#define Module_Version 10
#define Module_MajorVersion "0.11"
#define Module_Version 11
#define Module_MinorVersion ""
#define Module_Date "09 Sep 1999"
#define Module_Date "26 Oct 1999"
#define Module_FullVersion "0.10"
#define Module_FullVersion "0.11"
......@@ -30,6 +30,7 @@
#include "parse.h"
#include "file.h"
#include "msg.h"
#include "DebugLib/DebugLib.h"
extern build_list_t *build_list;
extern char *build_tree;
......@@ -90,7 +91,7 @@ build_add_entry(char *name)
_kernel_oserror *err=NULL;
build_list_t *entry;
debug db_printf("build_add_entry %s\n",name);
dprintf(("", "build_add_entry %s\n",name));
/*
* make sure it exists
......@@ -136,7 +137,7 @@ build_remove_entry(char *name)
_kernel_oserror *err=NULL;
build_list_t *entry,*last=NULL;
debug db_printf("build_remove_entry %s\n",name);
dprintf(("build_remove_entry %s\n",name));
entry = build_list;
while (entry)
{
......
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/************************************************************************/
/* Copyright 1997 Acorn Computers Ltd */
/* */
/* This material is the confidential trade secret and proprietary */
/* information of Acorn Computers. It may not be reproduced, used */
/* sold, or transferred to any third party without the prior written */
/* consent of Acorn Computers. All rights reserved. */
/* */
/************************************************************************/
#ifdef DEBUG
#include <stdio.h>
#include <stdarg.h>
static FILE *fileDebug=NULL;
void
db_file_init(char*s_filename)
{
if (s_filename!=NULL)
{
fileDebug = fopen(s_filename,"w");
}
else
{
fclose(fileDebug);
fileDebug=NULL;
}
}
void
db_printf (char *format, ...)
{
va_list list;
va_start (list, format);
if (fileDebug)
vfprintf(fileDebug, format, list);
va_end(list);
fflush(fileDebug);
}
#else
void
db_file_init(char *s_filename)
{
}
void
db_printf(char *format, ...)
{
}
#endif
......@@ -44,6 +44,7 @@
#include "file.h"
#include "parse.h"
#include "build.h"
#include "DebugLib/DebugLib.h"
#define WimpVersion 350
......@@ -61,6 +62,7 @@ int window_build_id = 0;
int proginfo_id = 0;
char *build_tree = NULL;
char *default_env = NULL;
int default_versioning = 0;
build_list_t *build_list = NULL;
int used_default_options = FALSE;
......@@ -78,7 +80,6 @@ quit_all(void)
if (default_env)
free(default_env);
debug db_file_init(NULL);
exit(0);
return (1);
......@@ -124,7 +125,7 @@ set_build_tree(char *name)
free(build_tree);
} else {
strcpy(build_tree,name);
debug db_printf("build_tree set to '%s'\n",build_tree);
dprintf(("build_tree set to '%s'\n",build_tree));
return;
}
}
......@@ -180,6 +181,39 @@ message_data_open(WimpMessage *message, void *handle)
}
/*
* setup the versioning radio buttons appropriately
*/
int version_set_radios(ComponentId sel)
{
_kernel_oserror *er = NULL;
dprintf(("", "Setting options for '%x'...\n", sel));
switch(sel)
{
case(OPTIONS_GADGET_IMAGENAME):
{
/* Set text of middle radio to "Major", select the Don't radio button and unfade Don't */
ERR_CHECK_RETURN(er, radiobutton_set_label(0, window_options_id, OPTIONS_GADGET_MAJOR,
"Major"));
ERR_CHECK_RETURN(er, radiobutton_set_state(0, window_options_id, OPTIONS_GADGET_DONT, 1));
ERR_CHECK_RETURN(er, gadget_set_flags(0, window_options_id, OPTIONS_GADGET_DONT, 0));
break;
}
case(OPTIONS_GADGET_NEWIMNAME):
{
/* Set text of middle radio to "Release", select the Minor radio button and fade Don't */
ERR_CHECK_RETURN(er, radiobutton_set_label(0, window_options_id, OPTIONS_GADGET_MAJOR,
"Release"));
ERR_CHECK_RETURN(er, radiobutton_set_state(0, window_options_id, OPTIONS_GADGET_MINOR, 1));
ERR_CHECK_RETURN(er, gadget_set_flags(0,window_options_id,OPTIONS_GADGET_DONT,Gadget_Faded));
break;
}
}
return(NULL);
}
/*
* read in contents of defaults file
*/
......@@ -198,7 +232,7 @@ read_defaults(void)
fgets(buffer,sizeof(buffer),fh);
if (!feof(fh)) {
chop_newline(buffer);
debug db_printf(" %s\n",buffer);
dprintf((" %s\n",buffer));
argc=parse_getargs(buffer,argv);
if (argc>0) {
if (cstrcmp(argv[0],"bld")==0) {
......@@ -214,6 +248,10 @@ read_defaults(void)
}
}
}
} else if (cstrcmp(argv[0],"img")==0) {
/* Highlight the preferred radiobutton & setup default options */
dprintf(("", "\nSelected versioning: %x\n", atoi(argv[1])));
default_versioning = atoi(argv[1]);
}
}
}
......@@ -239,7 +277,7 @@ read_builds(void)
fgets(buffer,sizeof(buffer),fh);
if (!feof(fh)) {
chop_newline(buffer);
debug db_printf(" %s\n",buffer);
dprintf((" %s\n",buffer));
build_add_entry(buffer);
}
}
......@@ -292,6 +330,7 @@ write_defaults(void)
_kernel_oserror *err=NULL;
FILE *fh=NULL;
int i,state;
ComponentId sel;
char buffer[BUFFER_SIZE];
switch (file_exists(CHOICES_DIR))
......@@ -324,6 +363,11 @@ write_defaults(void)
ERR_CHECK_RETURN(err,stringset_get_selected(0,window_options_id,
OPTIONS_GADGET_ENV,buffer,sizeof(buffer),&i));
fprintf(fh,"env %s\n",buffer);
ERR_CHECK_RETURN(err,radiobutton_get_state(0,window_options_id,
OPTIONS_GADGET_IMAGENAME,&state, &sel));
fprintf(fh,"img %i\n",sel);
fclose(fh);
return 0;
......@@ -382,6 +426,8 @@ window_show(int event_code,ToolboxEvent *event,
_kernel_oserror *err=NULL;
int i;
dprintf(("", "window_show() called\n"));
if (id_block->self_id == window_options_id) {
/* populate list of build trees */
ERR_CHECK_RETURN(err,build_populate(window_options_id,OPTIONS_GADGET_TREE));
......@@ -397,6 +443,10 @@ window_show(int event_code,ToolboxEvent *event,
ERR_CHECK_RETURN(err,optionbutton_set_state(0,window_options_id,
options[i].id,options[i].def));
}
/* Sort out versioning options */
radiobutton_set_state(0, window_options_id, default_versioning, 1);
version_set_radios(default_versioning);
used_default_options = TRUE;
}
} else if (id_block->self_id == window_build_id) {
......@@ -463,6 +513,45 @@ stringset_changed(int event_code,ToolboxEvent *event,
return 0;
}
/*
* deal with radiobutton presses
*/
int radio_click(int event_code,ToolboxEvent *event,
IdBlock *id_block, void *handle)
{
_kernel_oserror *err=NULL;
int state = 0;
ComponentId sel = 0;
/* Get state of ImageName */
err = radiobutton_get_state(0, window_options_id, OPTIONS_GADGET_IMAGENAME, &state, &sel);
if (err == NULL)
{
dprintf(("", "Radio button '%x' clicked\n", sel));
version_set_radios(sel);
}
return(NULL);
}
/*
* deal with optionbutton presses
*/
int option_click(int event_code,ToolboxEvent *event,
IdBlock *id_block, void *handle)
{
int i=0;
for (i=0; i<(sizeof(options)/sizeof(option_t)); i++)
{
if (options[i].id == id_block->self_component)
dprintf(("", "Option button '%s (%x)' clicked\n", options[i].name, id_block->self_component));
}
return(NULL);
}
/*
* deal with button presses
*/
......@@ -476,7 +565,7 @@ int action_click(int event_code,ToolboxEvent *event,
if (id_block->self_id == window_options_id)
{
char cmd[BUFFER_SIZE];
int state,gadget;
int state,gadget, versel;
switch (id_block->self_component)
{
......@@ -487,15 +576,42 @@ int action_click(int event_code,ToolboxEvent *event,
strcpy(cmd,BUILD_FILE);
strcat(cmd," ");
/* find out which radio button is clicked */
ERR_CHECK_RETURN(err,radiobutton_get_state(0,window_options_id,
OPTIONS_GADGET_DONT,&state,&gadget));
for (i=0; i<(sizeof(versioning)/sizeof(version_t)); i++) {
if (gadget == versioning[i].id) {
dprintf(("", "CMD: %s\n", cmd));
/* Versioning. Could be either ImageName or NewImName */
radiobutton_get_state(0, window_options_id, OPTIONS_GADGET_IMAGENAME, &state, &versel);
switch(versel)
{
case(OPTIONS_GADGET_IMAGENAME):
{
ERR_CHECK_RETURN(err,radiobutton_get_state(0,window_options_id,
OPTIONS_GADGET_DONT,&state,&gadget));
for (i=0; i<(sizeof(versioning)/sizeof(version_t)); i++) {
if (gadget == versioning[i].id) {
break;
}
}
strcat(cmd,"ImageName ");
strcat(cmd,versioning[i].action);
break;
}
case(OPTIONS_GADGET_NEWIMNAME):
{
ERR_CHECK_RETURN(err,radiobutton_get_state(0,window_options_id,
OPTIONS_GADGET_MINOR,&state,&gadget));
for (i=0; i<(sizeof(new_versioning)/sizeof(version_t)); i++) {
if (gadget == new_versioning[i].id) {
break;
}
}
strcat(cmd,"NewImName ");
strcat(cmd,new_versioning[i].action);
break;
}
}
strcat(cmd,versioning[i].action);
/* Do the option buttons */
for (i=0; i<(sizeof(options)/sizeof(option_t)); i++) {
ERR_CHECK_RETURN(err,optionbutton_get_state(0,window_options_id,
options[i].id,&state));
......@@ -504,13 +620,21 @@ int action_click(int event_code,ToolboxEvent *event,
strcat(cmd,options[i].name);
}
}
debug db_printf("cmd = '%s'\n",cmd);
dprintf(("", "CMD (before *): %s\n", cmd));
reg.r[0] = (int)cmd;
ERR_CHECK_RETURN(err,_kernel_swi(Wimp_StartTask,&reg,&reg));
/* reset version number field to "don't" */
ERR_CHECK_RETURN(err,radiobutton_set_state(0,window_options_id,
OPTIONS_GADGET_DONT,1));
/* reset version number field to "don't" (ImageName) or "minor" (NewImName) */
if (versel == OPTIONS_GADGET_IMAGENAME)
{
ERR_CHECK_RETURN(err,radiobutton_set_state(0,window_options_id,
OPTIONS_GADGET_DONT,1));
}
else
{
ERR_CHECK_RETURN(err,radiobutton_set_state(0,window_options_id,
OPTIONS_GADGET_MINOR,1));
}
break;
}
......@@ -553,6 +677,8 @@ iconbar_click(int event_code,ToolboxEvent *event,
{
IconbarClickedEvent *click_block = (IconbarClickedEvent *) event;
dprintf(("", "Iconbar clicked\n"));
if (click_block->hdr.flags & Iconbar_Clicked_Select)
{
/*
......@@ -650,7 +776,13 @@ int main()
int event_code;
int quiting=FALSE;
debug db_file_init(FILE_DEBUG);
/* Initialise DebugLib */
debug_initialise("Builder", "adfs::4.$.BuilderDB", "");
debug_atexit();
debug_set_options(DebugLib_Options_StampDebug_Off |
DebugLib_Options_TasknamePrefix_Off, 1, 9600);
debug_set_area_level_prefix(FALSE);
debug_set_device(DEBUGIT_OUTPUT);
read_builds();
read_defaults();
......@@ -698,6 +830,10 @@ int main()
stringset_changed,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,ActionButton_Selected,
action_click,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,RadioButton_StateChanged,
radio_click,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,OptionButton_StateChanged,
option_click,NULL));
ERR_GOTO(err,event_register_toolbox_handler(-1,Iconbar_Clicked,
iconbar_click,NULL));
......
......@@ -44,15 +44,6 @@
#define STRINGSET_LIMIT 128 /* Toolbox hard limit */
#ifdef DEBUG
#define debugging 1
#else
#define debugging 0
#endif
#define debug if (debugging)
#include "db.h"
#ifndef TRUE
#define TRUE 1
......
/* Copyright 1997 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/************************************************************************/
/* Copyright 1996 Online Media */
/* */
/* This material is the confidential trade secret and proprietary */
/* information of Online Media. It may not be reproduced, used, */
/* sold, or transferred to any third party without the prior written */
/* consent of Online Media. All rights reserved. */
/* */
/************************************************************************/
/*
* A set of veneers which intercept malloc and free calls. Information is then
* dumped to a debug file regarding the block allocations. At any time, a check
* of the allocated blocks can be made by calling db_check. A count is
* maintained of the number of allocated blocks, and a unique block id. The id
* dependant on the order that the allcation was performed.
*/
#ifndef __db_h
#define __db_h
#include <stdlib.h>
#include "constants.h"
extern void db_file_init(char*filename);
extern int db_printf (char *format, ...);
#endif /* __db_h */
......@@ -40,6 +40,8 @@
#define OPTIONS_GADGET_DONT 0x17
#define OPTIONS_GADGET_MAJOR 0x18
#define OPTIONS_GADGET_MINOR 0x19
#define OPTIONS_GADGET_IMAGENAME 0x1d
#define OPTIONS_GADGET_NEWIMNAME 0x1e
#define BUILD_GADGET_TREE 0x02
#define BUILD_GADGET_REMOVE 0x00
......@@ -76,4 +78,8 @@ version_t versioning[] = {
"-newmajor", "maj", OPTIONS_GADGET_MAJOR,
"-newminor", "min", OPTIONS_GADGET_MINOR};
version_t new_versioning[] = {
"-newreleasenum", "maj", OPTIONS_GADGET_MAJOR,
"-newminor", "min", OPTIONS_GADGET_MINOR};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment