Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
4d26f05e
Commit
4d26f05e
authored
Feb 17, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbmopen replaced by tie
parent
9af49afb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
src/tools/pwre/src/os_linux/pwre.pl
src/tools/pwre/src/os_linux/pwre.pl
+24
-16
No files found.
src/tools/pwre/src/os_linux/pwre.pl
View file @
4d26f05e
...
@@ -98,7 +98,7 @@ if ($amb == 1) {
...
@@ -98,7 +98,7 @@ if ($amb == 1) {
help
();
help
();
exit
1
;
exit
1
;
}
}
#
#
# Verb subroutines
# Verb subroutines
...
@@ -109,7 +109,8 @@ if ($amb == 1) {
...
@@ -109,7 +109,8 @@ if ($amb == 1) {
sub
add
()
sub
add
()
{
{
dbmopen
(
%
envdb
,
$dbname
,
0644
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
$label
=
$_
[
0
];
$label
=
$_
[
0
];
$varstr
=
$envdb
{
$label
};
$varstr
=
$envdb
{
$label
};
if
(
$varstr
ne
"")
{
if
(
$varstr
ne
"")
{
...
@@ -118,7 +119,7 @@ sub add ()
...
@@ -118,7 +119,7 @@ sub add ()
get_vars
();
get_vars
();
update_db
();
update_db
();
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
...
@@ -365,7 +366,8 @@ sub create()
...
@@ -365,7 +366,8 @@ sub create()
sub
dele
()
sub
dele
()
{
{
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
$label
=
$_
[
0
];
$label
=
$_
[
0
];
...
@@ -383,7 +385,7 @@ sub dele ()
...
@@ -383,7 +385,7 @@ sub dele ()
printf
("
++ Environment
\"
%s
\"
doesn't exists
\n
",
$label
);
printf
("
++ Environment
\"
%s
\"
doesn't exists
\n
",
$label
);
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
#
#
...
@@ -416,8 +418,10 @@ sub help ()
...
@@ -416,8 +418,10 @@ sub help ()
sub
list
()
sub
list
()
{
{
my
(
$env
);
my
(
$env
);
printf
("
Using Database:%s
\n
",
$dbname
);
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
print
("
-- Defined environments:
\n
");
print
("
-- Defined environments:
\n
");
foreach
$env
(
sort
keys
(
%
envdb
))
{
foreach
$env
(
sort
keys
(
%
envdb
))
{
...
@@ -425,7 +429,7 @@ sub list ()
...
@@ -425,7 +429,7 @@ sub list ()
}
}
print
("
--
\n
");
print
("
--
\n
");
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
...
@@ -435,7 +439,8 @@ sub list ()
...
@@ -435,7 +439,8 @@ sub list ()
#
#
sub
modify
()
sub
modify
()
{
{
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
$label
=
$_
[
0
];
$label
=
$_
[
0
];
$varstr
=
$envdb
{
$label
};
$varstr
=
$envdb
{
$label
};
if
(
$varstr
ne
"")
{
if
(
$varstr
ne
"")
{
...
@@ -445,7 +450,7 @@ sub modify ()
...
@@ -445,7 +450,7 @@ sub modify ()
}
else
{
}
else
{
printf
("
Environment %s doesn't exists
\n
",
$label
);
printf
("
Environment %s doesn't exists
\n
",
$label
);
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
...
@@ -465,7 +470,8 @@ sub show ()
...
@@ -465,7 +470,8 @@ sub show ()
}
}
}
}
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
read_vars
();
read_vars
();
if
(
$varstr
ne
"")
{
if
(
$varstr
ne
"")
{
...
@@ -476,7 +482,7 @@ sub show ()
...
@@ -476,7 +482,7 @@ sub show ()
}
else
{
}
else
{
printf
("
++ Environment %s doesn't exists
\n
",
$label
);
printf
("
++ Environment %s doesn't exists
\n
",
$label
);
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
#
#
...
@@ -551,7 +557,8 @@ sub _build () # args: branch, subbranch, phase
...
@@ -551,7 +557,8 @@ sub _build () # args: branch, subbranch, phase
sub
_exists
()
sub
_exists
()
{
{
my
(
$ret
)
=
1
;
my
(
$ret
)
=
1
;
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
$label
=
$_
[
0
];
$label
=
$_
[
0
];
...
@@ -559,7 +566,7 @@ sub _exists ()
...
@@ -559,7 +566,7 @@ sub _exists ()
$ret
=
0
;
$ret
=
0
;
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
exit
$ret
;
exit
$ret
;
}
}
...
@@ -569,7 +576,8 @@ sub _exists ()
...
@@ -569,7 +576,8 @@ sub _exists ()
sub
_print
()
sub
_print
()
{
{
dbmopen
(
%
envdb
,
$dbname
,
undef
)
||
die
"
++ can't dbmopen
$dbname
!
";
use
DB_File
;
tie
(
%
envdb
,
"
DB_File
",
$dbname
,
O_CREAT
|
O_RDWR
,
0644
)
||
die
"
++ can't tie
$dbname
!
";
$label
=
$_
[
0
];
$label
=
$_
[
0
];
read_vars
();
read_vars
();
...
@@ -584,10 +592,10 @@ sub _print ()
...
@@ -584,10 +592,10 @@ sub _print ()
}
else
{
}
else
{
printf
("
++ Environment %s doesn't exists
\n
",
$label
);
printf
("
++ Environment %s doesn't exists
\n
",
$label
);
}
}
dbmclose
(
%
envdb
)
||
die
"
++ can't dbmclos
e
$dbname
!
";
untie
(
%
envdb
)
||
die
"
++ can't unti
e
$dbname
!
";
}
}
#
#
# Misc. subroutines
# Misc. subroutines
#
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment