Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help4407


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting (CITS4407).

Assignment 2 and Clarifications.
 
Options:
RSS cloud
Jump to:

Assignment 2, Task 1.

11 of 390 articles shown, currently no other people reading this forum.
photo
From: David M.
Date: Tue 12th May, 8:24pm
Actions: 
        Login-to-reply
The assignemnt specifications for Task 1 state "Finally, add a new target to the project's Makefile to update the version number in the C source files and in the Makefile, itself."

Just to be clear:  we only have to submit the script "updateversion" for this task.
A modified makefile is not also required as one of the deliverables is it?

Assignment 2, Task 1.

photo
From: Christopher M.
Date: Wed 13th May, 6:39am
Actions: 
        Login-to-reply
"David May"                               wrote:

> The assignemnt specifications for Task 1 state "Finally, add a new target to the project's Makefile to update the version number in the C source files and in the Makefile, itself."
> 
> Just to be clear:  we only have to submit the script "updateversion" for this task.
> A modified makefile is not also required as one of the deliverables is it?


Please submit your modified Makefile as well,
else it may not be clear how your Makefile invokes your shellscript   (x 105 students).

Assignment 2, Task 1.

photo
From: Jason V.
Date: Thu 21st May, 6:17pm
Actions: 
        Login-to-reply
Hello,

I understand that our updateversion.sh script should update the comments within the specified project directory (e.g. calcmarks) given as an argument.

My confusion is in regards to the Makefile amendments. I understand that we should make it possible for the shell script to run within the make file by calling `shell> make 
updateversion`. To do this, we must know where updateversion.sh is located. Does that mean I can assume that the updateversion.sh script will always be located one level out of the 
project folder (what ever that may be called)? Or am I missing something here? 

Thank you in advance !!

Assignment 2, Task 1.

photo
From: David M.  O.P.
Date: Fri 22nd May, 12:30am
Actions: 
        Login-to-reply
As I understand it the updateversion script could be stored anywhere and you would invoke it the appropriate way. E.g.:

If it is in the same directory as Makefile and executable:  ./updateversion or else bash updateversion.
If it is executable and can be found via the PATH variable: updateversion  (not recommended).

In my solution, I stored it in the same directory as Makefile and invoked it as bash updateversion - it just seemed simplest.

Assignment 2, Task 1.

photo
From: Christopher M.
Date: Fri 22nd May, 7:42am
Actions: 
        Login-to-reply
"Jason Veljanoski"                               wrote:

> I understand that our updateversion.sh script should update the comments within the specified project directory (e.g. calcmarks) given as an argument.

There's no need to know or assume where your updateversion script is installed
(in the same way that you've previously not worried where cut, date, grep, .... are stored).

While testing your assignments, we'll place a fresh copy of your script in the same directory as the files requiring updating.

Assignment 2, Task 1.

photo
From: Jason V.
Date: Fri 22nd May, 11:57am
Actions: 
        Login-to-reply
Ok, I think I have misinterpreted the question partly.

To clarify, when I call ./updateversion, it checks all the appropriate files in the CURRENT DIRECTORY (where the updateversion script is located) and 
updates the comment as specified.

So if the script is in the same folder as calcmarks then the comments in calcmarks will be updated as specified.
If I had another project (let's say myProject), I can move the script inside myProject and run ./updateversion. This will update the comments in myProject 
as specified.

The specifications for Q1 say that the project name can be taken in as an argument but that is not entirely necessary as there would be a way to get the 
root folder name through a few bash commands.

Is the above on the right track?

Assignment 2, Task 1.

photo
From: Christopher M.
Date: Fri 22nd May, 12:29pm
Actions: 
        Login-to-reply
"Jason Veljanoski"                               wrote:

> So if the script is in the same folder as calcmarks then the comments in calcmarks will be updated as specified.
> If I had another project (let's say myProject), I can move the script inside myProject and run ./updateversion. This will update the comments in myProject 
> as specified.

Yes, that's correct.

> The specifications for Q1 say that the project name can be taken in as an argument but that is not entirely necessary as there would be a way to get the 
> root folder name through a few bash commands.

Your script will need to know the name of the project that it's updating,
otherwise you won't know what/how to find the appropriate comment lines in the files.

Do not rely upon the project's name being in a directory of the same name

(I will often have multiple directories, containing different versions/approaches the same problem)

Assignment 2, Task 1.

photo
From: Jason V.
Date: Fri 22nd May, 12:38pm
Actions: 
        Login-to-reply
Awesome, that clears up a lot for me

Thank you, Chris !!

Assignment 2, Task 1.

photo
From: Suyash J.
Date: Fri 22nd May, 7:12pm
Actions: 
        Login-to-reply
"Christopher McDonald" <chris.                     wrote:

> "Jason Veljanoski"                               wrote:
> 
> > So if the script is in the same folder as calcmarks then the comments in calcmarks will be updated as specified.
> > If I had another project (let's say myProject), I can move the script inside myProject and run ./updateversion. This will update the comments in myProject 
> > as specified.
> 
> Yes, that's correct.
> 
> > The specifications for Q1 say that the project name can be taken in as an argument but that is not entirely necessary as there would be a way to get the 
> > root folder name through a few bash commands.
> 
> Your script will need to know the name of the project that it's updating,
> otherwise you won't know what/how to find the appropriate comment lines in the files.
> 
> Do not rely upon the project's name being in a directory of the same name
> 
> (I will often have multiple directories, containing different versions/approaches the same problem)

Im still a little confused regarding how the script will be tested. Is it by just running ./updateversion in the shell and producing the required changes to 
version names of all the .c and .h files. Or making no changes and reporting an error if the version description does not match.  

Or by running the make file, and then running the required steps asked for?

Thanks, 

Assignment 2, Task 1.

photo
From: David M.  O.P.
Date: Fri 22nd May, 8:03pm
Actions: 
        Login-to-reply
I and many others have asked similar questions. 

The answer seems to be both - the script should be runnable from the command line
and in addition we need to submit a modified makefile for the calcmarks project
which includes a new target to perform the same task for the calcmarks project by
running make for that target.

You look through the various related topics in this forum.

Assignment 2, Task 1.

photo
From: Christopher M.
Date: Sun 24th May, 7:37am
Actions: 
        Login-to-reply
"Suyash Joshi"                               wrote:

> Or by running the make file, and then running the required steps asked for?


David's reply is a good one.

All of the checking and updating is performed by the shellscript.
The new target in the Makefile provides a simple way of calling the shellscript, passing to it the name of your project.
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  8:27am May 24 2020