Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Spencer
wiaflos
Commits
15aa0af0
Commit
15aa0af0
authored
Nov 28, 2016
by
Nigel Kukard
Browse files
Merge branch 'admininterfacefixes' into 'master'
Admin interface fixups See merge request
!13
parents
f6786b4a
27921943
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
15aa0af0
# Stages we need to progress through
stages
:
-
build
-
test
-
deploy
build_job
:
stage
:
build
script
:
# Create environment
-
apt-get update
-
apt-get dist-upgrade -y
# Create dirs we need
-
mkdir build
# Build wiaflos source files
-
cat contrib/books/10-basic-GL.wiaflos > build/combined.wiaflos
# Generate load files
# Artifacts
artifacts
:
expire_in
:
1 day
paths
:
-
build/
test_job
:
stage
:
test
script
:
# Create environment
-
apt-get update
-
apt-get dist-upgrade -y
-
apt-get install -y git sqlite3 libsoap-lite-perl libdatetime-perl libconfig-inifiles-perl libcache-fastmmap-perl libdbd-sqlite3-perl libtemplate-perl libcrypt-gpg-perl libmime-lite-perl
# Pull in sub repos
-
./update-git-modules
# Configure
-
sed -e 's/DSN=DBI:mysql:database=wiaflos;host=localhost/DSN=DBI:SQLite:dbname=wiaflos.sqlite/' -i wiaflos-server.conf
# Load database
-
awitpt/bin/convert-tsql sqlite database/schema.tsql > database/schema.sqlite
-
sqlite3 wiaflos.sqlite < database/schema.sqlite
# Load data
-
./wiaflos-admin --config=wiaflos-server.conf --connect="local" --stdin < build/combined.wiaflos
# Artifacts
artifacts
:
expire_in
:
1 day
paths
:
-
build/
wiaflos/client/cmdline.pm
View file @
15aa0af0
...
...
@@ -194,31 +194,32 @@ sub loadFile
}
# Open file
if
(
!
open
(
FH
,"
<
",
$parms
->
{'
file
'}))
{
my
$FH
;
if
(
!
open
(
$FH
,"
<
",
$parms
->
{'
file
'}))
{
print
(
$OUT
"
=> Failed to open '
"
.
$parms
->
{'
file
'}
.
"
': $!
\n
");
return
-
1
;
}
# Process lines
printf
(
$OUT
"
=> Loading file '%s'
",
$parms
->
{'
file
'});
printf
(
$OUT
"
=> Loading file '%s'
\n
",
$parms
->
{'
file
'});
# Grab number of lines to process
my
$line_total
=
0
;
while
(
<
FH
>
)
{
$line_total
++
}
while
(
<
$
FH
>
)
{
$line_total
++
}
# Reset back to beginning of file and re-read
seek
(
<
FH
>
,
0
,
0
);
seek
(
$
FH
,
0
,
0
);
my
$line_current
=
0
;
my
$percent_last
=
"";
while
(
my
$cmdline
=
<
FH
>
)
{
while
(
my
$cmdline
=
<
$
FH
>
)
{
# Bump line number
$line_current
++
;
# Grab percent done
my
$percent_done
=
sprintf
('
%5.1f
',(
$line_current
/
$line_total
)
*
100
);
# If its changed, output and save
if
(
$percent_done
ne
$per
e
cent_last
)
{
s
print
f
(
$OUT
"
Progress:
%s
",
$percent_done
);
if
(
$percent_done
ne
$percent_last
)
{
print
(
$OUT
"
Progress:
$percent_done
\n
"
);
$percent_last
=
$percent_done
;
}
...
...
@@ -236,7 +237,7 @@ sub loadFile
}
# Close
close
(
FH
);
close
(
$
FH
);
return
0
;
...
...
Write
Preview
Supports
Markdown
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