Selaa lähdekoodia

Better checkouts

Bob Mottram 9 vuotta sitten
vanhempi
commit
f8987d8ad6
1 muutettua tiedostoa jossa 32 lisäystä ja 64 poistoa
  1. 32
    64
      src/freedombone

+ 32
- 64
src/freedombone Näytä tiedosto

@@ -1544,8 +1544,7 @@ function mesh_cjdns {
1544 1544
               git stash
1545 1545
               git checkout master
1546 1546
               git pull
1547
-              git checkout $CJDNS_COMMIT
1548
-              git checkout -b $CJDNS_COMMIT
1547
+              git checkout $CJDNS_COMMIT -b $CJDNS_COMMIT
1549 1548
               sed -i "s/cjdns commit.*/cjdns commit:$CJDNS_COMMIT/g" $COMPLETION_FILE
1550 1549
               ./do
1551 1550
           fi
@@ -1575,8 +1574,7 @@ function mesh_cjdns {
1575 1574
       git clone $CJDNS_REPO /etc/cjdns
1576 1575
       cd /etc/cjdns
1577 1576
 
1578
-      git checkout $CJDNS_COMMIT
1579
-      git checkout -b $CJDNS_COMMIT
1577
+      git checkout $CJDNS_COMMIT -b $CJDNS_COMMIT
1580 1578
       if ! grep -q "cjdns commit" $COMPLETION_FILE; then
1581 1579
           echo "cjdns commit:$CJDNS_COMMIT" >> $COMPLETION_FILE
1582 1580
       else
@@ -1875,8 +1873,7 @@ function install_zeronet_blog {
1875 1873
               git stash
1876 1874
               git checkout master
1877 1875
               git pull
1878
-              git checkout $ZERONET_BLOG_COMMIT
1879
-              git checkout -b $ZERONET_BLOG_COMMIT
1876
+              git checkout $ZERONET_BLOG_COMMIT -b $ZERONET_BLOG_COMMIT
1880 1877
               sed -i "s/ZeroNet Blog commit.*/ZeroNet Blog commit:$ZERONET_BLOG_COMMIT/g" $COMPLETION_FILE
1881 1878
           fi
1882 1879
       else
@@ -1939,8 +1936,7 @@ function install_zeronet_blog {
1939 1936
       exit 6739
1940 1937
   fi
1941 1938
   cd /opt/zeronet/ZeroBlog
1942
-  git checkout $ZERONET_BLOG_COMMIT
1943
-  git checkout -b $ZERONET_BLOG_COMMIT
1939
+  git checkout $ZERONET_BLOG_COMMIT -b $ZERONET_BLOG_COMMIT
1944 1940
   if ! grep -q "ZeroNet Blog commit" $COMPLETION_FILE; then
1945 1941
       echo "ZeroNet Blog commit:$ZERONET_BLOG_COMMIT" >> $COMPLETION_FILE
1946 1942
   else
@@ -2004,8 +2000,7 @@ function install_zeronet_forum {
2004 2000
               git stash
2005 2001
               git checkout master
2006 2002
               git pull
2007
-              git checkout $ZERONET_FORUM_COMMIT
2008
-              git checkout -b $ZERONET_FORUM_COMMIT
2003
+              git checkout $ZERONET_FORUM_COMMIT -b $ZERONET_FORUM_COMMIT
2009 2004
               sed -i "s/ZeroNet Forum commit.*/ZeroNet Forum commit:$ZERONET_FORUM_COMMIT/g" $COMPLETION_FILE
2010 2005
           fi
2011 2006
       else
@@ -2067,8 +2062,7 @@ function install_zeronet_forum {
2067 2062
       echo $'ZeroTalk repo could not be cloned'
2068 2063
       exit 6739
2069 2064
   fi
2070
-  git checkout $ZERONET_FORUM_COMMIT
2071
-  git checkout -b $ZERONET_FORUM_COMMIT
2065
+  git checkout $ZERONET_FORUM_COMMIT -b $ZERONET_FORUM_COMMIT
2072 2066
   if ! grep -q "ZeroNet Forum commit" $COMPLETION_FILE; then
2073 2067
       echo "ZeroNet Forum commit:$ZERONET_FORUM_COMMIT" >> $COMPLETION_FILE
2074 2068
   else
@@ -2127,8 +2121,7 @@ function install_zeronet {
2127 2121
               git stash
2128 2122
               git checkout master
2129 2123
               git pull
2130
-              git checkout $ZERONET_COMMIT
2131
-              git checkout -b $ZERONET_COMMIT
2124
+              git checkout $ZERONET_COMMIT -b $ZERONET_COMMIT
2132 2125
               sed -i "s/ZeroNet commit.*/ZeroNet commit:$ZERONET_COMMIT/g" $COMPLETION_FILE
2133 2126
               systemctl restart zeronet.service
2134 2127
           fi
@@ -2151,8 +2144,7 @@ function install_zeronet {
2151 2144
       exit 56823
2152 2145
   fi
2153 2146
   cd /opt/zeronet
2154
-  git checkout $ZERONET_COMMIT
2155
-  git checkout -b $ZERONET_COMMIT
2147
+  git checkout $ZERONET_COMMIT -b $ZERONET_COMMIT
2156 2148
   if ! grep -q "ZeroNet commit" $COMPLETION_FILE; then
2157 2149
       echo "ZeroNet commit:$ZERONET_COMMIT" >> $COMPLETION_FILE
2158 2150
   else
@@ -4656,8 +4648,7 @@ function encrypt_incoming_email {
4656 4648
               git stash
4657 4649
               git checkout master
4658 4650
               git pull
4659
-              git checkout $GPGIT_COMMIT
4660
-              git checkout -b $GPGIT_COMMIT
4651
+              git checkout $GPGIT_COMMIT -b $GPGIT_COMMIT
4661 4652
               sed -i "s/gpgit commit.*/gpgit commit:$GPGIT_COMMIT/g" $COMPLETION_FILE
4662 4653
               cp gpgit.pl /usr/bin/gpgit.pl
4663 4654
           fi
@@ -4679,8 +4670,7 @@ function encrypt_incoming_email {
4679 4670
       cd $INSTALL_DIR
4680 4671
       git clone $GPGIT_REPO
4681 4672
       cd $INSTALL_DIR/gpgit
4682
-      git checkout $GPGIT_COMMIT
4683
-      git checkout -b $GPGIT_COMMIT
4673
+      git checkout $GPGIT_COMMIT -b $GPGIT_COMMIT
4684 4674
       if ! grep -q "gpgit commit" $COMPLETION_FILE; then
4685 4675
           echo "gpgit commit:$GPGIT_COMMIT" >> $COMPLETION_FILE
4686 4676
       else
@@ -5053,8 +5043,7 @@ function email_archiving {
5053 5043
               git stash
5054 5044
               git checkout master
5055 5045
               git pull
5056
-              git checkout $CLEANUP_MAILDIR_COMMIT
5057
-              git checkout -b $CLEANUP_MAILDIR_COMMIT
5046
+              git checkout $CLEANUP_MAILDIR_COMMIT -b $CLEANUP_MAILDIR_COMMIT
5058 5047
               sed -i "s/cleanup-maildir commit.*/cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT/g" $COMPLETION_FILE
5059 5048
               cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin
5060 5049
           fi
@@ -5072,8 +5061,7 @@ function email_archiving {
5072 5061
   fi
5073 5062
   cd $INSTALL_DIR
5074 5063
   git clone $CLEANUP_MAILDIR_REPO $INSTALL_DIR/cleanup-maildir
5075
-  git checkout $CLEANUP_MAILDIR_COMMIT
5076
-  git checkout -b $CLEANUP_MAILDIR_COMMIT
5064
+  git checkout $CLEANUP_MAILDIR_COMMIT -b $CLEANUP_MAILDIR_COMMIT
5077 5065
   if ! grep -q "cleanup-maildir commit" $COMPLETION_FILE; then
5078 5066
       echo "cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT" >> $COMPLETION_FILE
5079 5067
   else
@@ -5366,8 +5354,7 @@ function install_web_server {
5366 5354
               git stash
5367 5355
               git checkout master
5368 5356
               git pull
5369
-              git checkout $NGINX_ENSITE_COMMIT
5370
-              git checkout -b $NGINX_ENSITE_COMMIT
5357
+              git checkout $NGINX_ENSITE_COMMIT -b $NGINX_ENSITE_COMMIT
5371 5358
               sed -i "s/Nginx-ensite commit.*/Nginx-ensite commit:$NGINX_ENSITE_COMMIT/g" $COMPLETION_FILE
5372 5359
               make install
5373 5360
           fi
@@ -5489,8 +5476,7 @@ function install_web_server {
5489 5476
   cd $INSTALL_DIR
5490 5477
   git clone $NGINX_ENSITE_REPO $INSTALL_DIR/nginx_ensite
5491 5478
   cd $INSTALL_DIR/nginx_ensite
5492
-  git checkout $NGINX_ENSITE_COMMIT
5493
-  git checkout -b $NGINX_ENSITE_COMMIT
5479
+  git checkout $NGINX_ENSITE_COMMIT -b $NGINX_ENSITE_COMMIT
5494 5480
   if ! grep -q "Nginx-ensite commit" $COMPLETION_FILE; then
5495 5481
       echo "Nginx-ensite commit:$NGINX_ENSITE_COMMIT" >> $COMPLETION_FILE
5496 5482
   else
@@ -5680,8 +5666,7 @@ function install_owncloud_music_app {
5680 5666
               git stash
5681 5667
               git checkout master
5682 5668
               git pull
5683
-              git checkout $OWNCLOUD_MUSIC_APP_COMMIT
5684
-              git checkout -b $OWNCLOUD_MUSIC_APP_COMMIT
5669
+              git checkout $OWNCLOUD_MUSIC_APP_COMMIT -b $OWNCLOUD_MUSIC_APP_COMMIT
5685 5670
               sed -i "s/Owncloud music app commit.*/Owncloud music app commit:$OWNCLOUD_MUSIC_APP_COMMIT/g" $COMPLETION_FILE
5686 5671
           fi
5687 5672
       else
@@ -5696,8 +5681,7 @@ function install_owncloud_music_app {
5696 5681
   cd /usr/share/owncloud/apps
5697 5682
   git clone $OWNCLOUD_MUSIC_APP_REPO Music
5698 5683
   cd music
5699
-  git checkout $OWNCLOUD_MUSIC_APP_COMMIT
5700
-  git checkout -b $OWNCLOUD_MUSIC_APP_COMMIT
5684
+  git checkout $OWNCLOUD_MUSIC_APP_COMMIT -b $OWNCLOUD_MUSIC_APP_COMMIT
5701 5685
   if ! grep -q "Owncloud music app commit" $COMPLETION_FILE; then
5702 5686
       echo "Owncloud music app commit:$OWNCLOUD_MUSIC_APP_COMMIT" >> $COMPLETION_FILE
5703 5687
   else
@@ -6030,8 +6014,7 @@ function install_gogs {
6030 6014
               git stash
6031 6015
               git checkout master
6032 6016
               git pull
6033
-              git checkout $GOGS_COMMIT
6034
-              git checkout -b $GOGS_COMMIT
6017
+              git checkout $GOGS_COMMIT -b $GOGS_COMMIT
6035 6018
               sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE
6036 6019
               chown -R www-data:www-data /var/www/$GIT_DOMAIN_NAME/htdocs
6037 6020
           fi
@@ -6072,8 +6055,7 @@ function install_gogs {
6072 6055
   cd $GOPATH/src/github.com/gogits
6073 6056
   git clone $GIT_DOMAIN_REPO
6074 6057
   cd gogs
6075
-  git checkout $GOGS_COMMIT
6076
-  git checkout -b $GOGS_COMMIT
6058
+  git checkout $GOGS_COMMIT -b $GOGS_COMMIT
6077 6059
   if ! grep -q "Gogs commit" $COMPLETION_FILE; then
6078 6060
       echo "Gogs commit:$GOGS_COMMIT" >> $COMPLETION_FILE
6079 6061
   else
@@ -6303,8 +6285,7 @@ function install_tox_node {
6303 6285
               git stash
6304 6286
               git checkout master
6305 6287
               git pull
6306
-              git checkout $TOX_COMMIT
6307
-              git checkout -b $TOX_COMMIT
6288
+              git checkout $TOX_COMMIT -b $TOX_COMMIT
6308 6289
               sed -i "s/toxcore commit.*/toxcore commit:$TOX_COMMIT/g" $COMPLETION_FILE
6309 6290
               autoreconf -i
6310 6291
               ./configure --enable-daemon
@@ -6331,8 +6312,7 @@ function install_tox_node {
6331 6312
   git clone $TOX_REPO
6332 6313
   cd $INSTALL_DIR/toxcore
6333 6314
 
6334
-  git checkout $TOX_COMMIT
6335
-  git checkout -b $TOX_COMMIT
6315
+  git checkout $TOX_COMMIT -b $TOX_COMMIT
6336 6316
   if ! grep -q "toxcore commit" $COMPLETION_FILE; then
6337 6317
       echo "toxcore commit:$TOX_COMMIT" >> $COMPLETION_FILE
6338 6318
   else
@@ -6464,8 +6444,7 @@ function install_tox_client {
6464 6444
               git stash
6465 6445
               git checkout master
6466 6446
               git pull
6467
-              git checkout $TOXIC_COMMIT
6468
-              git checkout -b $TOXIC_COMMIT
6447
+              git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT
6469 6448
               sed -i "s/Toxic commit.*/Toxic commit:$TOXIC_COMMIT/g" $COMPLETION_FILE
6470 6449
               make
6471 6450
               make install
@@ -6484,8 +6463,7 @@ function install_tox_client {
6484 6463
   cd $INSTALL_DIR
6485 6464
   git clone $TOXIC_REPO
6486 6465
   cd $INSTALL_DIR/toxic
6487
-  git checkout $TOXIC_COMMIT
6488
-  git checkout -b $TOXIC_COMMIT
6466
+  git checkout $TOXIC_COMMIT -b $TOXIC_COMMIT
6489 6467
   if ! grep -q "Toxic commit" $COMPLETION_FILE; then
6490 6468
       echo "Toxic commit:$TOXIC_COMMIT" >> $COMPLETION_FILE
6491 6469
   else
@@ -7059,8 +7037,7 @@ function install_blog {
7059 7037
               git stash
7060 7038
               git checkout master
7061 7039
               git pull
7062
-              git checkout $FULLBLOG_COMMIT
7063
-              git checkout -b $FULLBLOG_COMMIT
7040
+              git checkout $FULLBLOG_COMMIT -b $FULLBLOG_COMMIT
7064 7041
               sed -i "s/Blog commit.*/Blog commit:$FULLBLOG_COMMIT/g" $COMPLETION_FILE
7065 7042
               chown -R www-data:www-data /var/www/$FULLBLOG_DOMAIN_NAME/htdocs
7066 7043
           fi
@@ -7080,8 +7057,7 @@ function install_blog {
7080 7057
   cd /var/www/$FULLBLOG_DOMAIN_NAME
7081 7058
   git clone $FULLBLOG_REPO htdocs
7082 7059
   cd htdocs
7083
-  git checkout $FULLBLOG_COMMIT
7084
-  git checkout -b $FULLBLOG_COMMIT
7060
+  git checkout $FULLBLOG_COMMIT -b $FULLBLOG_COMMIT
7085 7061
   if ! grep -q "Blog commit" $COMPLETION_FILE; then
7086 7062
       echo "Blog commit:$FULLBLOG_COMMIT" >> $COMPLETION_FILE
7087 7063
   else
@@ -7341,8 +7317,7 @@ function install_gnu_social {
7341 7317
               git stash
7342 7318
               git checkout master
7343 7319
               git pull
7344
-              git checkout $GNUSOCIAL_COMMIT
7345
-              git checkout -b $GNUSOCIAL_COMMIT
7320
+              git checkout $GNUSOCIAL_COMMIT -b $GNUSOCIAL_COMMIT
7346 7321
               sed -i "s/GNU Social commit.*/GNU Social commit:$GNUSOCIAL_COMMIT/g" $COMPLETION_FILE
7347 7322
               chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
7348 7323
           fi
@@ -7373,8 +7348,7 @@ function install_gnu_social {
7373 7348
   git clone $MICROBLOG_REPO gnusocial
7374 7349
 
7375 7350
   cd gnusocial
7376
-  git checkout $GNUSOCIAL_COMMIT
7377
-  git checkout -b $GNUSOCIAL_COMMIT
7351
+  git checkout $GNUSOCIAL_COMMIT -b $GNUSOCIAL_COMMIT
7378 7352
   if ! grep -q "GNU Social commit" $COMPLETION_FILE; then
7379 7353
       echo "GNU Social commit:$GNUSOCIAL_COMMIT" >> $COMPLETION_FILE
7380 7354
   else
@@ -7625,8 +7599,7 @@ function install_hubzilla {
7625 7599
               git stash
7626 7600
               git checkout master
7627 7601
               git pull
7628
-              git checkout $HUBZILLA_COMMIT
7629
-              git checkout -b $HUBZILLA_COMMIT
7602
+              git checkout $HUBZILLA_COMMIT -b $HUBZILLA_COMMIT
7630 7603
               sed -i "s/Hubzilla commit.*/Hubzilla commit:$HUBZILLA_COMMIT/g" $COMPLETION_FILE
7631 7604
               chown -R www-data:www-data /var/www/$HUBZILLA_DOMAIN_NAME/htdocs
7632 7605
           fi
@@ -7656,8 +7629,7 @@ function install_hubzilla {
7656 7629
   if [ ! -f /var/www/$HUBZILLA_DOMAIN_NAME/htdocs/index.php ]; then
7657 7630
       cd $INSTALL_DIR
7658 7631
       git clone $HUBZILLA_REPO hubzilla
7659
-      git checkout $HUBZILLA_COMMIT
7660
-      git checkout -b $HUBZILLA_COMMIT
7632
+      git checkout $HUBZILLA_COMMIT -b $HUBZILLA_COMMIT
7661 7633
       if ! grep -q "Hubzilla commit" $COMPLETION_FILE; then
7662 7634
           echo "Hubzilla commit:$HUBZILLA_COMMIT" >> $COMPLETION_FILE
7663 7635
       else
@@ -8396,8 +8368,7 @@ function install_dynamicdns {
8396 8368
               git stash
8397 8369
               git checkout master
8398 8370
               git pull
8399
-              git checkout $INADYN_COMMIT
8400
-              git checkout -b $INADYN_COMMIT
8371
+              git checkout $INADYN_COMMIT -b $INADYN_COMMIT
8401 8372
               sed -i "s/inadyn commit.*/inadyn commit:$INADYN_COMMIT/g" $COMPLETION_FILE
8402 8373
               ./configure
8403 8374
               USE_OPENSSL=1 make
@@ -8427,8 +8398,7 @@ function install_dynamicdns {
8427 8398
       exit 6785
8428 8399
   fi
8429 8400
   cd $INSTALL_DIR/inadyn
8430
-  git checkout $INADYN_COMMIT
8431
-  git checkout -b $INADYN_COMMIT
8401
+  git checkout $INADYN_COMMIT -b $INADYN_COMMIT
8432 8402
   if ! grep -q "inadyn commit" $COMPLETION_FILE; then
8433 8403
       echo "inadyn commit:$INADYN_COMMIT" >> $COMPLETION_FILE
8434 8404
   else
@@ -8512,8 +8482,7 @@ function install_ipfs {
8512 8482
               git stash
8513 8483
               git checkout master
8514 8484
               git pull
8515
-              git checkout $IPFS_COMMIT
8516
-              git checkout -b $IPFS_COMMIT
8485
+              git checkout $IPFS_COMMIT -b $IPFS_COMMIT
8517 8486
               sed -i "s/ipfs commit.*/ipfs commit:$IPFS_COMMIT/g" $COMPLETION_FILE
8518 8487
               chown -R git:git /home/git
8519 8488
               systemctl restart ipfs
@@ -8565,8 +8534,7 @@ function install_ipfs {
8565 8534
   fi
8566 8535
 
8567 8536
   cd /home/git/go/src/github.com/ipfs/go-ipfs
8568
-  git checkout $IPFS_COMMIT
8569
-  git checkout -b $IPFS_COMMIT
8537
+  git checkout $IPFS_COMMIT -b $IPFS_COMMIT
8570 8538
   if ! grep -q "ipfs commit" $COMPLETION_FILE; then
8571 8539
       echo "ipfs commit:$IPFS_COMMIT" >> $COMPLETION_FILE
8572 8540
   else