From 9ba0925b8dd1351f9a7f2ff28edcc366ca22a6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Val=C3=AD=C4=8Dek?= Date: Tue, 9 Aug 2022 22:00:55 +0200 Subject: [PATCH] Removed obsolette scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Václav Valíček --- old/src/cclone | 72 ------------------------------------------------- old/src/sclone | 73 -------------------------------------------------- 2 files changed, 145 deletions(-) delete mode 100755 old/src/cclone delete mode 100755 old/src/sclone diff --git a/old/src/cclone b/old/src/cclone deleted file mode 100755 index f68fc5d..0000000 --- a/old/src/cclone +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -# -# Clone repository from mirror -# -# Usage: -# cclone
[ -p ] [ -c ] - -# strict mode -set -euo pipefail -IFS=$'\n\t' - -# include config -source $(dirname $(realpath $0))/config -source $(dirname $(realpath $0))/gen-mirror-path - -# parse arguments -function usage(){ - echo "Usage: $0 [-p ] [-c ]" 1>&2 - exit 1 -} - -repo=$1 - -if [[ ! "$repo" =~ ^-.* ]] -then - # check if repo was mirrored - if [ ! -d $(getRepoPath $repo) ] - then - echo "Specified repo wasn't mirrored yes, please do it so!" 1>&2 - exit 1 - fi - # kick args +1 - shift -else - usage -fi - -# other opts -while getopts "c:p:" o; do - case "${o}" in - c) - param_c=${OPTARG} - ;; - p) - param_p=${OPTARG} - ;; - \?) - usage - ;; - esac -done - - -# Run clone -cloneurl=$(getRepoPath $repo) -clonepath=${param_p:-} - -echo "Cloning $repo" -git clone file://$cloneurl $clonepath - -checkout=${param_c:-} -if [ -n "$checkout" ] -then - chdir=${param_p:-$(getRepoUniq $repo)} - echo "Checking out $checkout" - oldpwd=$(pwd) - cd $chdir - # -b just to make git less verbose - git checkout $checkout -b _tmp_$checkout - cd $oldpwd -fi - diff --git a/old/src/sclone b/old/src/sclone deleted file mode 100755 index 2081316..0000000 --- a/old/src/sclone +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# -# Clone repository from mirror - recursively with submodules -# -# Usage: -# sclone
[ -p ] [ -c - -# strict mode -set -euo pipefail -IFS=$'\n\t' - -# Scratch - temp -tmpdir=$(mktemp -d -t mirror-recursive-XXXXXXX) -function finish { - rm -rf "$tmpdir" -} -trap finish EXIT - -# include config -source $(dirname $(realpath $0))/config -source $(dirname $(realpath $0))/gen-mirror-path - -# parse arguments -function usage(){ - echo "Usage: $0 [-p ] [-c ]" 1>&2 - exit 1 -} - -[ $# -eq 0 ] && usage - -repo=$1 - - -# clone the repo -cclone $@ || true -# skip url -shift - -# parse opts -while getopts "c:p:" o; do - case "${o}" in - c) - param_c=${OPTARG} - ;; - p) - param_p=${OPTARG} - ;; - \?) - usage - ;; - esac -done - -# change dir and examine the commit + submodules -oldpwd=$(pwd) -submodules=$tmpdir/submodules -cd ${param_p:-$(getRepoUniq $repo)} -submodule-describe . > $submodules - -while read -r line || [[ -n "$line" ]] -do - # read -r retypes \t to ' ' (space) - commit=$(echo $line | cut -f1 -d' ') - directory=$(echo $line | cut -f2 -d' ') - url=$(echo $line | cut -f3 -d' ') - # recursion ++ - sclone $url -p $directory -c $commit -done < $submodules - - - -cd $oldpwd -