source: npl/system/net_tools/get-net-tools.sh @ 26ffad7

Last change on this file since 26ffad7 was 2154c77, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

various updates

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#!/bin/sh
2
3# Copyright 2017  Patrick J. Volkerding, Sebeka, Minnesota, USA
4# All rights reserved.
5#
6# Redistribution and use of this script, with or without modification, is
7# permitted provided that the following conditions are met:
8#
9# 1. Redistributions of this script must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11#
12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23# Pull a stable branch + patches
24BRANCH=${1:-master}
25
26# Clear download area:
27rm -rf net-tools
28
29# Clone repository:
30git clone git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools/
31
32# checkout $BRANCH:
33( cd net-tools
34  git checkout $BRANCH || exit 1
35)
36
37HEADISAT="$( cd net-tools && git log -1 --format=%h )"
38DATE="$( cd net-tools && git log -1 --format=%cd --date=format:%Y%m%d )"
39# Cleanup.  We're not packing up the whole git repo.
40( cd net-tools && find . -type d -name ".git*" -exec rm -rf {} \; 2> /dev/null )
41mv net-tools net-tools-${DATE}_${HEADISAT}
42tar cf net-tools-${DATE}_${HEADISAT}.tar net-tools-${DATE}_${HEADISAT}
43xz -9 -f net-tools-${DATE}_${HEADISAT}.tar
44rm -rf net-tools-${DATE}_${HEADISAT}
45echo
46echo "net-tools branch $BRANCH with HEAD at $HEADISAT packaged as net-tools-${DATE}_${HEADISAT}.tar.xz"
47echo
48
Note: See TracBrowser for help on using the repository browser.