Skip to content

Commit

Permalink
add detection for Arch Linux PKGBUILDs
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed May 8, 2012
1 parent aa7c849 commit be42a84
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ Shell:
- .zshrc
- bashrc
- zshrc
- PKGBUILD

Smalltalk:
type: programming
Expand Down
43 changes: 43 additions & 0 deletions test/fixtures/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Maintainer: Daniel Micay <danielmicay@gmail.com>
pkgname=stud-git
pkgver=20120316
pkgrel=1
pkgdesc="The Scalable TLS Unwrapping Daemon"
arch=(i686 x86_64)
url="https://github.com/bumptech/stud"
license=('BSD')
depends=(libev openssl)
makedepends=(git)
provides=(stud)
conflicts=(stud)

_gitroot=https://github.com/bumptech/stud.git
_gitname=stud

build() {
cd "$srcdir"
msg "Connecting to GIT server...."

if [[ -d "$_gitname" ]]; then
cd "$_gitname" && git pull origin
msg "The local files are updated."
else
git clone "$_gitroot" "$_gitname"
fi

msg "GIT checkout done or server timeout"
msg "Starting build..."

rm -rf "$srcdir/$_gitname-build"
git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
cd "$srcdir/$_gitname-build"

make
}

package() {
cd "$srcdir/$_gitname-build"
make PREFIX=/usr DESTDIR="$pkgdir/" install
install -Dm755 init.stud "$pkgdir/etc/rc.d/stud"
mkdir -p "$pkgdir/etc/stud"
}
4 changes: 4 additions & 0 deletions test/test_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,9 @@ def test_language

# Dart: http://dartlang.org/
assert_equal Language['Dart'], blob("point.dart").language

# Arch Linux PKGBUILD
assert_equal Language['Shell'], blob("PKGBUILD").language
end

def test_lexer
Expand All @@ -447,6 +450,7 @@ def test_lexer
assert_equal Lexer['vhdl'], blob("foo.vhd").lexer
assert_equal Lexer['Julia'], blob("stockcorr.jl").lexer
assert_equal Lexer['Dart'], blob("point.dart").lexer
assert_equal Lexer['Bash'], blob("PKGBUILD").lexer
end

def test_shebang_script
Expand Down
1 change: 1 addition & 0 deletions test/test_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def test_find_all_by_extension
end

def test_find_by_filename
assert_equal Language['Shell'], Language.find_by_filename('PKGBUILD')
assert_equal Language['Ruby'], Language.find_by_filename('foo.rb')
assert_equal Language['Ruby'], Language.find_by_filename('foo/bar.rb')
assert_equal Language['Ruby'], Language.find_by_filename('Rakefile')
Expand Down

0 comments on commit be42a84

Please sign in to comment.