Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
alpine
abuild
Commits
2219b258
Commit
2219b258
authored
May 14, 2009
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abuild: use apk index -d to update the abuildrepo index
parent
c8b2c27e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
10 deletions
+34
-10
abuild.in
abuild.in
+34
-10
No files found.
abuild.in
View file @
2219b258
...
...
@@ -17,7 +17,7 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
pkgrel
=
0
repo
=
${
startdir
%/*
}
repo
=
${
repo
##*/
}
tmp
repo
=
/var/cache/abuild/
tmprepo
abuild
repo
=
/var/cache/abuild/
apks
# defaults
SRCDEST
=
${
SRCDEST
:-
$startdir
}
...
...
@@ -26,7 +26,7 @@ BUILD_BASE="binutils gcc make patch uclibc-dev"
SUDO
=
${
SUDO
:-
"sudo"
}
default_cmds
=
"sanitycheck builddeps clean fetch unpack rootpkg"
default_cmds
=
"sanitycheck builddeps clean fetch unpack rootpkg
abuildrepo
"
# read config
ABUILD_CONF
=
${
ABUILD_CONF
:-
"
$sysconfdir
/abuild.conf"
}
...
...
@@ -232,9 +232,12 @@ cleanpkg() {
local
i
msg
"Cleaning built packages..."
for
i
in
$pkgname
$subpackages
;
do
local
p
=
"
$i
-
$pkgver
-r
$pkgrel
"
rm
-f
"
$PKGDEST
/
$p
.apk"
"
$PKGDEST
/
$p
.src.tar.gz"
local
p
=
"
${
i
%
:
*
}
-
$pkgver
-r
$pkgrel
"
rm
-f
"
$PKGDEST
/
$p
.apk"
"
$PKGDEST
/
$p
.src.tar.gz"
\
"
$abuildrepo
"
/
$p
.apk
done
# remove given packages from index
}
# clean all packages except current
...
...
@@ -385,26 +388,47 @@ create_apks() {
local
name
=
$(
pkginfo_val pkgname
$file
)
local
ver
=
$(
pkginfo_val pkgver
$file
)
local
apk
=
$name
-
$ver
.apk
msg
"Creating
$apk
..."
(
cd
"
$dir
"
set
*
[
"
$1
"
=
'*'
]
&&
set
--
cd
"
$dir
"
&&
tar
-zcf
"
$PKGDEST
"
/
$apk
$(
cat
.metafiles
)
$@
tar
-zcf
"
$PKGDEST
"
/
$apk
$(
cat
.metafiles
)
$@
)
done
}
update_tmprepo
()
{
update_abuildrepo_index
()
{
local
index
=
"
$abuildrepo
"
/APK_INDEX.gz
local
opt
=
(
for
i
in
"
$@
"
;
do
pkg
=
${
i
##*/
}
todelete
=
"
$todelete
${
pkg
%-[0-9]*.apk
}
"
done
if
[
-f
"
$index
"
]
;
then
echo
"apk index -q -d
\"
$index
\"
$todelete
|| exit 1"
>
&2
apk index
-q
-d
"
$index
"
$todelete
||
exit
1
fi
apk index
-q
"
$@
"
||
exit
1
)
>
"
$abuildrepo
"
/APK_INDEX.new
||
return
1
gzip
"
$abuildrepo
"
/APK_INDEX.new
&&
mv
"
$abuildrepo
/APK_INDEX.new.gz"
"
$index
"
}
abuildrepo
()
{
if
!
up2date
;
then
sanitycheck
&&
builddeps
&&
clean
&&
fetch
&&
unpack
&&
rootpkg
||
return
1
fi
local
apk
set
--
for
apk
in
$(
listpkg
)
;
do
ln
-sf
"
$PKGDEST
"
/
$apk
"
$tmprepo
"
/
$apk
ln
-sf
"
$PKGDEST
"
/
$apk
"
$abuildrepo
"
/
$apk
set
--
"
$@
"
"
$abuildrepo
"
/
$apk
done
# update the
tmp
repo cache here
msg
"Updating the cached build repository index..."
apk index
"
$tmprepo
"
/
*
.apk |
gzip
>
"
$tmprepo
"
/APK_INDEX.gz
# update the
abuild
repo cache here
msg
"Updating the cached
a
build repository index..."
update_abuildrepo_index
"
$@
"
}
# predefined splitfunc doc
...
...
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