Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SLUB_SIP_Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
SLUB_SIP_Builder
Commits
52d5df4e
Commit
52d5df4e
authored
6 years ago
by
Jens Steidl
Browse files
Options
Downloads
Patches
Plain Diff
- added more argument checks
- improved readability
parent
cc013558
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/slubsipbuilder.pl
+28
-28
28 additions, 28 deletions
bin/slubsipbuilder.pl
with
28 additions
and
28 deletions
bin/slubsipbuilder.pl
+
28
−
28
View file @
52d5df4e
...
@@ -59,20 +59,20 @@ my $man;
...
@@ -59,20 +59,20 @@ my $man;
our
$VERSION
=
'
1.1
';
our
$VERSION
=
'
1.1
';
GetOptions
(
GetOptions
(
"
IE_directory=s
"
=>
\
$directory
,
"
IE_directory=s
"
=>
\
$directory
,
# required
"
ppn=s
"
=>
\
$ppn
,
"
ppn=s
"
=>
\
$ppn
,
# semi-optional
"
noppn=s
"
=>
\
$noppn
,
"
noppn=s
"
=>
\
$noppn
,
# semi-optional
"
SIP_output_path=s
"
=>
\
$output
,
"
SIP_output_path=s
"
=>
\
$output
,
# required
"
as_zip
"
=>
\
$as_zip
,
"
as_zip
"
=>
\
$as_zip
,
# optional, default: do not zip
"
url=s
"
=>
\
$url
,
"
url=s
"
=>
\
$url
,
# optional, default: SWB Online-Katalog
"
external_id=s
"
=>
\
$external_id
,
"
external_id=s
"
=>
\
$external_id
,
# required
"
external_workflow=s
"
=>
\
$external_workflow
,
"
external_workflow=s
"
=>
\
$external_workflow
,
# required
"
external_ISIL=s
"
=>
\
$external_isil
,
"
external_ISIL=s
"
=>
\
$external_isil
,
# optional, default: no ISIL
"
external_value_descr=s
"
=>
\
$external_value_descr
,
"
external_value_descr=s
"
=>
\
$external_value_descr
,
# required
"
external_conservation_flag
"
=>
\
$external_conservation_flag
,
"
external_conservation_flag
"
=>
\
$external_conservation_flag
,
# optional, default: no special conservation
"
debug
"
=>
\
$with_debug
,
"
debug
"
=>
\
$with_debug
,
# optional
"
help|?
"
=>
\
$help
,
"
help|?
"
=>
\
$help
,
# optional
"
man
"
=>
\
$man
,
"
man
"
=>
\
$man
,
# optional
)
or
pod2usage
(
2
);
)
or
pod2usage
(
2
);
if
(
$help
)
{
pod2usage
(
1
);
}
if
(
$help
)
{
pod2usage
(
1
);
}
...
@@ -84,11 +84,11 @@ if (!defined $output) { confess (" you need to specify an output path, where the
...
@@ -84,11 +84,11 @@ if (!defined $output) { confess (" you need to specify an output path, where the
if
(
$output
!~
m#^/#
)
{
confess
("
you need to specify an output path using absoluet paths, $!
");
}
if
(
$output
!~
m#^/#
)
{
confess
("
you need to specify an output path using absoluet paths, $!
");
}
if
(
!
defined
$url
)
{
$url
=
"
http://swb.bsz-bw.de/sru/DB=2.1/username=/password=/
";}
if
(
!
defined
$url
)
{
$url
=
"
http://swb.bsz-bw.de/sru/DB=2.1/username=/password=/
";}
if
(
!
defined
$external_conservation_flag
)
{
$external_conservation_flag
=
"
false
";
}
else
{
$external_conservation_flag
=
"
true
";
}
if
(
!
defined
$external_conservation_flag
)
{
$external_conservation_flag
=
"
false
";
}
else
{
$external_conservation_flag
=
"
true
";
}
# additional checks
if
(
!
-
d
$directory
)
{
confess
("
you need to specify an IE directory, which needs to be archived, $!
");
}
if
(
!
-
d
$directory
)
{
confess
("
you need to specify an IE directory, which needs to be archived, $!
");
}
if
(
$directory
!~
m#^/#
)
{
confess
("
you need to specify an IE directory using absoluet paths, $!
");
}
if
(
$directory
!~
m#^/#
)
{
confess
("
you need to specify an IE directory using absoluet paths, $!
");
}
#if (! -d $output) { confess("you need to specify an output path, where the SIP will be stored, $!"); }
if
(
$external_id
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external ID (^[a-z0-9]+
\$
)
");
}
if
(
$external_workflow
!~
m#^[a-z0-9]+$#
)
{
confess
("
you need to specify a valid external workflow (^[a-z0-9]+
\$
)
");
}
if
(
!
$external_value_descr
)
{
confess
("
you need to specify a external value description (reason for archiving)
");
}
#===============================================================================
#===============================================================================
...
...
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