• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/support/dependencies/check-host-tar.sh
Heiko AbrahamHeiko Abraham committed fc90fa9417d31 May 2014
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
#!/bin/sh
2
​
3
candidate="$1"
4
​
5
tar=`which $candidate`
6
if [ ! -x "$tar" ]; then
7
    tar=`which tar`
8
    if [ ! -x "$tar" ]; then
9
        # echo nothing: no suitable tar found
10
        exit 1
11
    fi
12
fi
13
​
14
# Output of 'tar --version' examples:
15
# tar (GNU tar) 1.15.1
16
# tar (GNU tar) 1.25
17
# bsdtar 2.8.3 - libarchive 2.8.3
18
version=`$tar --version | head -n 1 | sed 's/^.*\s\([0-9]\+\.\S\+\).*$/\1/'`
19
major=`echo "$version" | cut -d. -f1`
20
minor=`echo "$version" | cut -d. -f2`
21
bugfix=`echo "$version" | cut -d. -f3`
22
version_bsd=`$tar --version | grep 'bsdtar'`
23
if [ ! -z "${version_bsd}" ] ; then 
24
  # mark as invalid version - not all command line options are available
25
  major=0
26
  minor=0
27
fi
28
​
29
# Minimal version = 1.17 (previous versions do not correctly unpack archives
30
# containing hard-links if the --strip-components option is used).
31
major_min=1
32
minor_min=17
33
if [ $major -gt $major_min ]; then
34
    echo $tar
35
else
36
    if [ $major -eq $major_min -a $minor -ge $minor_min ]; then
37
        echo $tar
38
    else
39
        # echo nothing: no suitable tar found
40
        exit 1
41
    fi
42
fi
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.