Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
forge001
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
forge001
Commits
fa5e3c8f
Commit
fa5e3c8f
authored
9 years ago
by
Gerhard Gonter
Browse files
Options
Downloads
Patches
Plain Diff
experimental feature: subdir selection
parent
2d9714f3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
textarchive/vlib001.pl
+44
-8
44 additions, 8 deletions
textarchive/vlib001.pl
with
44 additions
and
8 deletions
textarchive/vlib001.pl
+
44
−
8
View file @
fa5e3c8f
...
...
@@ -13,6 +13,7 @@
* -s <store-name>
* --project <project-name>
* --store <store-name>
* --subdir <directory>
* --verify ... verify/create TOC structures (not for MongoDB)
* --fileinfo ... refresh file info
* --lookup ... lookup for hashes given as parameters
...
...
@@ -75,6 +76,8 @@ my $Dir_Pattern= '.';
my
$DEFAULT_file_list
=
"
find
$Dir_Pattern
-xdev -type f -print|
";
# --- >8 ---
my
@subdirs
=
();
while
(
my
$arg
=
shift
(
@ARGV
))
{
if
(
$arg
eq
'
--
')
{
push
(
@PAR
,
@ARGV
);
@ARGV
=
();
}
...
...
@@ -85,6 +88,7 @@ while (my $arg= shift (@ARGV))
elsif
(
$arg
eq
'
--limit
')
{
$limit
=
shift
(
@ARGV
);
}
elsif
(
$arg
eq
'
--fileinfo
')
{
$refresh_fileinfo
=
1
;
}
elsif
(
$arg
eq
'
--noinode
')
{
$check_inode
=
0
;
}
elsif
(
$arg
eq
'
--subdir
')
{
push
(
@subdirs
,
shift
(
@ARGV
));
}
elsif
(
$arg
=~
/^--(refresh|verify|lookup|edit|maint|next-seq|get-cat)$/
)
{
$op_mode
=
$
1
;
}
else
{
&usage
("
unknown option '
$arg
'
");
}
}
...
...
@@ -261,7 +265,20 @@ sub refresh_internal
# print "toc: ", Dumper ($toc);
my
$md5cat
=
new
md5cat
();
$md5cat
->
read_flist
(
$DEFAULT_file_list
);
if
(
@subdirs
)
{
foreach
my
$subdir
(
@subdirs
)
{
my
$subdir_file_list
=
"
find '
$subdir
' -xdev -type f -print|
";
$md5cat
->
read_flist
(
$subdir_file_list
);
}
}
else
{
$md5cat
->
read_flist
(
$DEFAULT_file_list
);
}
# print "md5cat: ", Dumper ($md5cat);
print
"
flist processed
\n
";
...
...
@@ -347,17 +364,36 @@ print __LINE__, " integrate_md5_sums\n";
# print __LINE__, " key: ", Dumper (\%key);
my
@drop
=
();
foreach
my
$k
(
keys
%key
)
if
(
@subdirs
)
{
=begin comment
NOTE: we only inspected a subdirectory, but this inspects everything
and would remove items that were not even inspected
TODO: only drop the thing when it is in the right subdirectory!
=end comment
=cut
print
"
NOTE: no check for removable items performed!
\n
";
}
else
{
my
$x1
=
$key
{
$k
};
foreach
my
$p
(
keys
%$x1
)
foreach
my
$k
(
keys
%key
)
{
push
(
@drop
,
[
$k
,
$p
])
if
(
$x1
->
{
$p
}
==
0
);
my
$x1
=
$key
{
$k
};
foreach
my
$p
(
keys
%$x1
)
{
push
(
@drop
,
[
$k
,
$p
])
if
(
$x1
->
{
$p
}
==
0
);
}
}
}
print
__LINE__
,
"
drop: (
",
scalar
@drop
,
"
)
",
Dumper
(
\
@drop
);
print
__LINE__
,
"
drop: (
",
scalar
@drop
,
"
)
",
Dumper
(
\
@drop
);
$objreg
->
remove_from_store
(
$store
,
\
@drop
);
$objreg
->
remove_from_store
(
$store
,
\
@drop
);
}
printf
("
files: %6d processed; %6d updated; %6d (%d) dropped
\n
",
$cnt_processed
,
$cnt_updated
,
$cnt_dropped
,
scalar
(
@drop
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment