← Back to team overview

ubuntu-manual team mailing list archive

Re: Minor bug in install-pkgs.sh, and a new automated install script


On 06/09/2013 01:54 AM, Carsten Gerlach wrote:

> Am 09.06.2013 04:00, schrieb Jonathan Marsden:

>> I've also created ubuntu-manual-dev.sh ...

> Great work! It runs without any problems.

Thanks :)

> 1. What is the meaning of the syntax in WORKDIR=${1:-~/projects}?
> Normally I would use WORKDIR=~/projects without the braces stuff...

It means you can override the default by providing $1, the first
parameter to the script.  In general, ${variable:-string} means "the
value of $variable if it exists, otherwise the value of string.  man
bash says:

       Use  Default Values.  If parameter is unset or null,
       the expansion of word is substituted.  Otherwise, the
       value of parameter is substituted.

See my email to Hannie.  For example, you can make the script use
/opt/my-place-for-the-manual as the working directory, by running it as

  ./ubuntu-manual-dev.sh /opt/my-place-for-the-manual

if you really want to do so :)

It just adds a little flexibility to the script, and avoids people
having to edit it just to make it use a different directory (or, for $2,
use a different release name instead of the default of saucy).

> 2. Why do you check for $DEBNAME and $DEBEMAIL? Are there some
> situations where these variables are defined by default?

Yes.  Almost all people who use the Ubuntu or Debian packaging systems
to create .deb packages will have them defined in their ~/.bashrc file.
 They are used to add the name and email info into the debian/changelog
file for example.

I am one of those people who creates packages!  I don't like being
prompted for things that I already told the computer -- such as my name
and email address.  So, if they exist I assume they are correct for what
the user wants the Ubuntu world to see, and so bzr is set to use them.
If they do not exist, the script gathers the full name field from
/etc/passwd and uses that as a default full name but prompts for it, and
then prompts for email address with no default, because there is no
default place for "normal" users to have already stored an email
address.  I could possibly have checked $EMAIL but it is not all that
commonly used.  bzr can check for and use $EMAIL for example.

[Hmmm, actually I think it should be $DEBFULLNAME, so $DEBNAME may be a
bug, I'll check!]