Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
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
alpine
alpine-conf
Commits
e6750d75
Commit
e6750d75
authored
May 08, 2014
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lbu: fix help text and misc whitespace fixes
We should show 'diff' subcommand in help text.
parent
70a7125e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
lbu.in
lbu.in
+21
-17
No files found.
lbu.in
View file @
e6750d75
...
...
@@ -38,13 +38,17 @@ usage() {
Available subcommands:
commit (ci)
diff
exclude (ex, delete)
include (inc, add)
list (ls)
list-backup (lb)
migrate_include_exclude
package (pkg)
status (stat, st)
list-backup (lb)
revert
status (stat, st)
Common options:
-h Show help for subcommand.
...
...
@@ -193,7 +197,7 @@ unpack_apkovl() {
fi
if
[
-
n
"$ENCRYPTION"
];
then
f
=
"$f.$ENCRYPTION"
fi
fi
if
[
! -f "$mnt/$f" ]; then
return
1
fi
...
...
@@ -209,7 +213,7 @@ unpack_apkovl() {
done
cleanup
die
"Failed to unpack $mnt/$f"
}
}
#
#
lbu_include
-
add
/
remove
files
to
include
list
...
...
@@ -451,16 +455,16 @@ cmd_commit() {
[
-
z
"$DRYRUN"
]
&&
rm
"$mnt/"
*.
apkovl
.
tar
.
gz
*
fi
else
lines
=$(
ls
-
1
"$mnt"
/*.
apkovl
.
tar
.
gz
*
2
>/
dev
/
null
)
lines
=$(
ls
-
1
"$mnt"
/*.
apkovl
.
tar
.
gz
*
2
>/
dev
/
null
)
if
[
"$lines"
=
"$outfile"
];
then
backup_apkovl
"$outfile"
elif
[
-
n
"$lines"
];
then
#
More
then
one
apkovl
,
this
is
a
security
concern
#
More
then
one
apkovl
,
this
is
a
security
concern
cleanup
eecho
"The following apkovl file(s) were found:"
eecho
"$lines"
eecho
""
die
"Please use -d to replace."
die
"Please use -d to replace."
fi
fi
...
...
@@ -474,10 +478,10 @@ cmd_commit() {
#
delete
old
backups
if
needed
#
poor
mans
'head -n -N'
done
with
awk
.
ls
"$mnt"
/$(
hostname
).[
0
-
9
][
0
-
9
][
0
-
9
][
0
-
9
]*[
0
-
9
].
tar
.
gz
2
>/
dev
/
null
\
|
awk
'{ a[++i] = $0; } END {
print a[0];
while (i-- > '
"${BACKUP_LIMIT:-0}"
') {
print a[++j]
|
awk
'{ a[++i] = $0; } END {
print a[0];
while (i-- > '
"${BACKUP_LIMIT:-0}"
') {
print a[++j]
}
}'
|
xargs
rm
2
>/
dev
/
null
...
...
@@ -639,7 +643,7 @@ cmd_status() {
fi
echo
"D $f"
done
#
compare
files
in
b
with
files
in
a
(
cd
"$tmp"
/
b
&&
find
)
|
while
read
f
;
do
f
=${
f
#./}
...
...
@@ -676,7 +680,7 @@ cmd_diff() {
unpack_apkovl
"$tmp/a"
ENCRYPTION
=
cmd_package
-
|
tar
-
C
"$tmp/b"
-
zx
cd
"$tmp"
&&
diff
-
ruN
a
b
cd
"$tmp"
&&
diff
-
ruN
a
b
}
#
migrate
...
...
@@ -741,18 +745,18 @@ esac
#
parse
common
args
while
getopts
"adehlM:np:qrv"
opt
;
do
case
"$opt"
in
a
)
[
$
SUBCMD
=
status
]
||
usage_
$
SUBCMD
a
)
[
$
SUBCMD
=
status
]
||
usage_
$
SUBCMD
USE_DEFAULT
=
"-a"
;;
d
)
DELETEOLDCONFIGS
=
"yes"
;;
e
)
[
-
z
"$ENCRYPTION"
]
&&
ENCRYPTION
=
"$DEFAULT_CIPHER"
;;
h
)
usage_
$
SUBCMD
h
)
usage_
$
SUBCMD
;;
l
)
LIST
=
"-l"
;;
n
)
[
$
SUBCMD
=
commit
]
||
usage_
$
SUBCMD
n
)
[
$
SUBCMD
=
commit
]
||
usage_
$
SUBCMD
DRYRUN
=
"-n"
;;
p
)
PASSWORD
=
"$OPTARG"
...
...
@@ -761,7 +765,7 @@ while getopts "adehlM:np:qrv" opt ; do
;;
r
)
REMOVE
=
"-r"
;;
v
)
VERBOSE
=
"$VERBOSE -v"
v
)
VERBOSE
=
"$VERBOSE -v"
;;
esac
done
...
...
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