Patch get-repository.sh [WAS] addition to the documentation

J offlineimap at 927589452.de
Sun Jan 29 08:30:11 GMT 2017


On 17-01-29 19:13:20, Cameron Simpson wrote:
> On 29Jan2017 08:43, J <offlineimap at 927589452.de> wrote:
> > On 17-01-29 15:15:35, Cameron Simpson wrote:
> > > On 28Jan2017 12:54, J <mailinglists at 927589452.de> wrote:
> > > > wanted to add the following small explanation to the backup section:
> > > > ZFS [...]
> > > > #########
> > > > #!/usr/bin/env bash
> > > 
> > > Please, just:
> > >  #!/bin/sh
> > > There's nothing there that needs bash, and _all_ UNIX systems have a
> > > /bin/sh.  Portable.
> > 
> > I did just fix the header without looking at the real script part,
> > but i tried changing to sh, and it breaks;
> > it could probably be fixed with a rewrite of the case statements in
> > sh-syntax
> 
> Could you send me the whole script and a transcript of the error message?
> Also, what's you? test platform. If I've made an unwarranted assertion here
> I should test it and either adjust the script or accept fault.
> 
the functions are defined in a different way in sh
see attached diff/patch ( I am too dumb to get it to my repository to
have it in a pull request
and i am still using the env variable because it is AFAIK the new
standard way
-------------- next part --------------
diff --git a/scripts/get-repository.sh b/scripts/get-repository.sh
index 4258e8f..39c84ca 100755
--- a/scripts/get-repository.sh
+++ b/scripts/get-repository.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 #
 # Licence: this file is in the public domain.
 #
@@ -10,7 +10,7 @@ github_remote=$2
 #
 # TODO
 #
-function final_note () {
+final_note () {
 	cat <<EOF
 
 Now, you can fork the repository into Github from $2
@@ -22,7 +22,7 @@ and add a reference to it in your local copy:
 EOF
 }
 
-function setup () {
+setup () {
 	target_dir=$1
 	remote_url=$2
 
@@ -49,7 +49,7 @@ function setup () {
 	fi
 }
 
-function configure_website () {
+configure_website () {
 	renderer='./render.sh'
 
 	echo "Found Github username: '$1'"
@@ -65,7 +65,7 @@ function configure_website () {
 	fi
 }
 
-function configure_wiki () {
+configure_wiki () {
 	:	# noop
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get-repository.sh
Type: application/x-sh
Size: 1977 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20170129/7ec503f6/attachment-0003.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20170129/7ec503f6/attachment-0003.sig>


More information about the OfflineIMAP-project mailing list