File: update.sh

package info (click to toggle)
libyaml-libyaml-perl 0.76%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 688 kB
  • sloc: perl: 1,603; ansic: 1,140; sh: 29; makefile: 4
file content (36 lines) | stat: -rwxr-xr-x 673 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

libyaml=../../libyaml
source="$libyaml/src"
include="$libyaml/include"
need_branch=perl-yaml-xs

if [ ! -d "$source" ]; then
  echo "'$source' does not exist"
  exit 1
fi

libyaml_branch="$(
  cd "$libyaml"
  git rev-parse --abbrev-ref HEAD
)"

if [ "$libyaml_branch" != "$need_branch" ]; then
  echo "libyaml must be set to branch '$need_branch'"
  exit 1
fi

diff="$(
  diff -q $source . |
  grep -v '^Only'
  diff -q $include . |
  grep -v '^Only'
)"

if [ -n "$diff" ]; then
  echo "*** Updating from libyaml repository ***"
  diff -q "$source" . | grep -v '^Only'
  cp "$source"/*.{c,h} .
  diff -q "$include" . | grep -v '^Only'
  cp "$include"/*.h .
fi