From d84daefa2cb2e3a19f47e3012d5b5aea4c18050f Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 10 Mar 2017 00:04:46 +0000 Subject: [PATCH] delete nb-repo-dirs --- bin/nb-repo-dirs | 87 ---------------------------------------------- etc/repo-dirs.conf | 4 --- 2 files changed, 91 deletions(-) delete mode 100755 bin/nb-repo-dirs delete mode 100644 etc/repo-dirs.conf diff --git a/bin/nb-repo-dirs b/bin/nb-repo-dirs deleted file mode 100755 index 570e9199..00000000 --- a/bin/nb-repo-dirs +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env perl -# NB 24.11.16: TODEL -die 'TODEL'; -################################################################################# -# -# List Repositery directories - NB 17.01.16 -# -################################################################################# -use strict; -use File::Spec; -use Cwd; -use File::Basename; -my @FILES_CHECK = ( - '.nb-install', - '.nb-update', -); -my $FILE_EXISTS = '.nb-install'; - -my $NB_ROOT = dirname ( dirname ( File::Spec->rel2abs( Cwd::abs_path(__FILE__) ) ) ); -my $CONF = "$NB_ROOT/etc/repo-dirs.conf"; -my $DEBUG = 0; -($ARGV[0]||'') =~ /^--?(all|debug)$/ and $DEBUG = 1 and shift @ARGV; - -my @DIRS = ( - $NB_ROOT, -); - -if (-r $CONF) { - open(CONF,$CONF) or die "$0: can't read $CONF: $!"; - while () { - chomp $_; - push @DIRS,$_ unless /^\s*(#|$)/; - } - close CONF; -} - -#print map {"$_\n"} add_args(@DIRS) and exit 0 if $DEBUG; - -my %h; - -@DIRS and print - map {"$_\n"} - grep {$_ ne "" and !$h{$_}++} - map { - - # To reduce glob return, we permit to use file as filter - my $dir = (-e $_ and !-d $_) ? dirname($_) : $_; - $dir =File::Spec->rel2abs(Cwd::abs_path($dir)); - - # Check is git - if ($dir ne $NB_ROOT and !-d "$dir/.git") { - warn "DEBUG: REJECT : $dir\n" if $DEBUG; - ""; - } else { - - if ($DEBUG) { - for (@FILES_CHECK) { - warn "DEBUG: MISSING: $dir/$_\n" if !-r "$dir/$_"; - } - } - add_args($dir); - } - - } - glob join(' ',@DIRS) -; - -sub add_args { - # Concat each args and return existing (ex: $0 proie etc/profile ...) - my @new; - - for my $d (@_) { - #for my $d (glob join(' ',@_)) { - #for my $d (map { glob $_ } @_) { - #warn ".. $d" if $DEBUG; - for my $a (@ARGV) { - #warn "$d/$a"; - #warn ".. $d/$a" if $DEBUG; - push @new, glob "$d/$a"; - } - } - - #warn @new; - @_ = grep { -e $_} @new if @new; - #return grep {-e $_} @_; - return @_; -} diff --git a/etc/repo-dirs.conf b/etc/repo-dirs.conf deleted file mode 100644 index 32ad6b5a..00000000 --- a/etc/repo-dirs.conf +++ /dev/null @@ -1,4 +0,0 @@ -/{opt,opt/www,etc,home,home/www}/*/.nb-{install,update} -/usr/local/src/.nb-install -/{home,Users}/*/*/.nb-install -/home/share/git/.nb-install -- 2.47.3