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
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
c7e6eae6
Commit
c7e6eae6
authored
Jun 24, 2008
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented lbu revert
parent
7e11b0b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
Makefile
Makefile
+1
-1
lbu
lbu
+36
-5
No files found.
Makefile
View file @
c7e6eae6
V
=
1.
5.1
V
=
1.
6
P
=
alpine-conf
PV
=
$(P)
-
$(V)
APKF
=
$(PV)
.apk
...
...
lbu
View file @
c7e6eae6
...
...
@@ -48,6 +48,7 @@ Available subcommands:
status (stat, st)
update (up)
log
revert
Common options:
-h Show help for subcommand.
...
...
@@ -77,6 +78,17 @@ mount_once() {
fi
}
#
create
backupfile
backup_apkovl
()
{
local
outfile
=
"$1"
local
d
=$(
date
-
u
-
r
"$outfile"
"+%Y%m%d%H%m%S"
)
local
backup
=$(
echo
"$outfile"
|
sed
"s/\.apkovl\.tar\.gz/.$d.tar.gz/"
)
vecho
"Creating backup $backup"
if
[
-
z
"$DRYRUN"
];
then
mv
"$outfile"
"$backup"
fi
}
#
verify
we
have
openssl
if
we
want
to
encrypt
check_openssl
()
{
[
-
z
"$ENCRYPTION"
]
&&
return
0
...
...
@@ -354,10 +366,7 @@ cmd_commit() {
else
lines
=$(
ls
-
1
"$mnt"
/*.
apkovl
.
tar
.
gz
*
2
>/
dev
/
null
)
if
[
"$lines"
=
"$outfile"
];
then
local
d
=$(
date
-
u
-
r
"$outfile"
"+%Y%m%d%H%m%S"
)
local
backup
=$(
echo
"$outfile"
|
sed
"s/\.apkovl\.tar\.gz/.$d.tar.gz/"
)
vecho
"Creating backup $backup"
[
-
z
"$DRYRUN"
]
&&
mv
"$outfile"
"$backup"
backup_apkovl
"$outfile"
elif
[
-
n
"$lines"
];
then
#
More
then
one
apkovl
,
this
is
a
security
concern
cleanup
...
...
@@ -467,12 +476,32 @@ cmd_log() {
#---------------------------------------------------------------------------
#
lbu_revert
-
revert
to
old
config
usage_revert
()
{
cat
<<
EOF
$
PROGRAM
$
VERSION
Revert
to
older
commit
.
usage
:
$
PROGRAM
revert
<
REVISION
>
[<
media
>]
The
revision
should
be
one
of
the
files
listed
by
'lbu log'
.
EOF
}
cmd_revert
()
{
local
revertto
=$
1
local
media
=${
2
:-
"$LBU_MEDIA"
}
[
-
z
"$media"
]
&&
usage_revert
local
mnt
=
"/media/$media"
local
revertto
=
"$mnt/$1"
local
current
=
"$mnt/$(hostname).apkovl.tar.gz"
if
[
-
n
"$ENCRYPTION"
];
then
outfile
=
"$outfile.$ENCRYPTION"
fi
mount_once
"$mnt"
||
die
"failed to mount $mnt"
[
-
f
"$revertto"
]
||
die
"file not found: $revertto"
backup_apkovl
"$outfile"
vecho
"Reverting to $1"
[
-
z
"$DRYRUN"
]
&&
mv
"$revertto"
"$outfile"
}
#---------------------------------------------------------------------------
...
...
@@ -564,6 +593,8 @@ case "$cmd" in
package
|
pkg
)
SUBCMD
=
"package"
;;
status
|
stat
|
st
)
SUBCMD
=
"status"
;;
update
|
up
)
SUBCMD
=
"update"
;;
log
)
SUBCMD
=
"log"
;;
revert
)
SUBCMD
=
"revert"
;;
*)
usage
;;
esac
...
...
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