+++ /dev/null
-#!/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 (<CONF>) {
- 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 @_;
-}
+++ /dev/null
-/{opt,opt/www,etc,home,home/www}/*/.nb-{install,update}
-/usr/local/src/.nb-install
-/{home,Users}/*/*/.nb-install
-/home/share/git/.nb-install