Remove obsolette code
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# check if varriable is set
|
||||
[ -n "$CONFIG_DIR" ] || die "ConfigDir is not set - exit!"
|
||||
|
||||
|
||||
function detectorRunCapable(){
|
||||
if [ -f $CONFIG_DIR/detector.cfg ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function detectorLoadConfig(){
|
||||
# load config
|
||||
source $CONFIG_DIR/detector.cfg
|
||||
|
||||
# create cache dirs
|
||||
DET_DIR=$CCLONE_CACHE/detector
|
||||
DET_TAGS=$DET_DIR/tags
|
||||
DET_BRANCHES=$DET_DIR/branches
|
||||
[ -d $DET_TAGS ] || mkdir -p $DET_TAGS
|
||||
[ -d $DET_BRANCHES ] || mkdir -p $DET_BRANCHES
|
||||
}
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function detectorTryInit(){
|
||||
# repo dir
|
||||
dir=$1
|
||||
history=$DET_DIR/detectorExecuted
|
||||
|
||||
if ! [ -f $history ]
|
||||
then
|
||||
echo "Initializing detector cache"
|
||||
# initialize seed
|
||||
git --git-dir $dir log --all --format="%H" > $history
|
||||
fi
|
||||
}
|
||||
|
||||
function detectorCheckCommit(){
|
||||
sha=$1
|
||||
history=$DET_DIR/detectorExecuted
|
||||
[ -f $history ] || touch $history
|
||||
|
||||
if grep -q $sha $history
|
||||
then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function detectorSaveCommit(){
|
||||
sha=$1
|
||||
history=$DET_DIR/detectorExecuted
|
||||
echo $sha >> $history
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
function detectorSum(){
|
||||
local dir=$1
|
||||
[ -f $dir/FETCH_HEAD ] || touch $dir/FETCH_HEAD
|
||||
# use md5sum - it is in busybox
|
||||
cat $dir/FETCH_HEAD | md5sum | cut -f1 -d' '
|
||||
}
|
||||
|
||||
function detectorSumPersist(){
|
||||
detectorSum $1 > $CCLONE_CACHE/detectorSum
|
||||
}
|
||||
|
||||
function detectorCheckFetchHead(){
|
||||
# check if repo fetch_head changed, if so, return 1
|
||||
local dir=$1
|
||||
|
||||
[ -f $CCLONE_CACHE/detectorSum ] || touch $CCLONE_CACHE/detectorSum
|
||||
|
||||
newSum=$(detectorSum $dir)
|
||||
oldSum=$(cat $CCLONE_CACHE/detectorSum)
|
||||
|
||||
if [ "x$oldSum" = "x$newSum" ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function gitListTags(){
|
||||
local dir=$1
|
||||
git --git-dir="$dir" tag -l | cat
|
||||
}
|
||||
|
||||
function gitListBranches(){
|
||||
local dir=$1
|
||||
git --git-dir="$dir" for-each-ref --format='%(refname:short)' refs/heads/
|
||||
}
|
||||
|
||||
|
||||
function gitPrefBranches(){
|
||||
local dir=$1
|
||||
gitListBranches $1 | grep master || true
|
||||
gitListBranches $1 | grep upstream || true
|
||||
gitListBranches $1 | sort | grep -vE 'master|upstream'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user