~alpine/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
9 4

[alpine-devel] [PATCH] new: aports helper scripts

Details
Message ID
<1291843221-21222-1-git-send-email-mcs@darkregion.net>
Sender timestamp
1291843221
DKIM signature
missing
Download raw message
Patch: +88 -0
I've created some helper scripts for aports, which I'll briefly cover here.

New files:
- aports/apk-aports.conf: configuration file for the following helper scripts
- aports/apkindex.sh:     creates a signed APKINDEX.tar.gz for your aports
- aports/apkwrapper.sh:   apk wrapper that uses your aports repository

Let me know what you think.
---
 apk-aports.conf |   32 ++++++++++++++++++++++++++++++++
 apkindex.sh     |   34 ++++++++++++++++++++++++++++++++++
 apkwrapper.sh   |   22 ++++++++++++++++++++++
 3 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 apk-aports.conf
 create mode 100755 apkindex.sh
 create mode 100755 apkwrapper.sh

diff --git a/apk-aports.conf b/apk-aports.conf
new file mode 100644
index 0000000..18aca10
--- /dev/null
+++ b/apk-aports.conf
@@ -0,0 +1,32 @@
#!/bin/sh
################################################################################
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
# Description: apk/aports configuration, used by aports helper scripts
# Version:     2010-12-08T15:01-06:00 (ISO 8601:2004)
################################################################################

# REMOVE OR COMMENT THE FOLLOWING TWO LINES AND EDIT THE VARIABLES THAT FOLLOW.
echo -e "Not configured!\nPlease edit ${APK_APORTS_CONF} ..."
exit 1

#
# Path to aports directory, no trailing slash
APORTS_DIR=/home/user/aports

#
# aport category directories to scan for .apk files, space delimited
APORTS_CATS="main testing"

#
# Path to abuild private key
ABUILD_PRIV_KEY=/home/user/.abuild/user.rsa

#
# Path to abuild public key
ABUILD_PUB_KEY=/etc/apk/keys/user.rsa.pub


# DO NOT EDIT BEYOND THIS POINT
APORTS_APKINDEX="${APORTS_DIR}/APKINDEX.tar.gz"
APORTS_REPOFILE="${APORTS_DIR}/APKREPO"
diff --git a/apkindex.sh b/apkindex.sh
new file mode 100755
index 0000000..44ebcc3
--- /dev/null
+++ b/apkindex.sh
@@ -0,0 +1,34 @@
#!/bin/sh
################################################################################
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
# Description: aports helper script: creates a signed APKINDEX.tar.gz and
#              APKREPO file for use with apk or aports/apkwrapper.sh
# Usage:       apkindex.sh
# Version:     2010-12-08T14:52-06:00 (ISO 8601:2004)
################################################################################

# Get configuration:
APK_APORTS_CONF_NAME="apk-aports.conf"
if [ "${0:0:2}" == "./" ]; then
	APK_APORTS_CONF="./${APK_APORTS_CONF_NAME}"
else
	APK_APORTS_CONF="`echo $0 | \
		sed -r "s;^(/.*)/[^/]+;\1/${APK_APORTS_CONF_NAME};"`"
fi
source $APK_APORTS_CONF

# Create APKINDEX.tar.gz for aports
APORTS_CAT_DIRS=""
for APORTS_CAT in $APORTS_CATS; do
	APORTS_CAT_DIRS="${APORTS_CAT_DIRS} ${APORTS_DIR}/${APORTS_CAT}/*/*.apk"
done
apk index -o $APORTS_APKINDEX ${APORTS_CAT_DIRS:1}

# Sign the aports APKINDEX.tar.gz
abuild-sign -k $ABUILD_PRIV_KEY -p $ABUILD_PUB_KEY $APORTS_APKINDEX

# Create aports APKREPO to use like:
#   apk --repositories-file $APKREPO add $APORTS_PKG
#   (This is the purpose of aports/apkwrapper.sh)
echo "${APORTS_DIR}/" > $APORTS_REPOFILE
diff --git a/apkwrapper.sh b/apkwrapper.sh
new file mode 100755
index 0000000..306328e
--- /dev/null
+++ b/apkwrapper.sh
@@ -0,0 +1,22 @@
#!/bin/sh
################################################################################
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
# Description: aports helper script: apk wrapper that uses the signed
#              APKINDEX.tar.gz and APKREPO files generated by aports/apkindex.sh
# Example Use: apkwrapper.sh add /path/to/aports/main/package/package-0.1-r0.apk
# Version:     2010-12-08T15:08-06:00 (ISO 8601:2004)
################################################################################

# Get configuration:
APK_APORTS_CONF_NAME="apk-aports.conf"
if [ "${0:0:2}" == "./" ]; then
	APK_APORTS_CONF="./${APK_APORTS_CONF_NAME}"
else
	APK_APORTS_CONF="`echo $0 | \
			sed -r "s;^(/.*)/[^/]+;\1/${APK_APORTS_CONF_NAME};"`"
fi
source $APK_APORTS_CONF

# Invoke apk using the aports repository file
apk --repositories-file $APORTS_REPOFILE $*
-- 
1.7.3.2



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Details
Message ID
<1291909310.567329176@192.168.2.229>
In-Reply-To
<1291902032.24376.27.camel@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1291909310
DKIM signature
missing
Download raw message
On Thursday, December 9, 2010 7:40am, "Natanael Copa" <ncopa@alpinelinux.org> said:
> On Wed, 2010-12-08 at 15:20 -0600, Matt Smith wrote:
>> I've created some helper scripts for aports, which I'll briefly cover here.
>>
>> New files:
>> - aports/apk-aports.conf: configuration file for the following helper scripts
>> - aports/apkindex.sh:     creates a signed APKINDEX.tar.gz for your aports
>> - aports/apkwrapper.sh:   apk wrapper that uses your aports repository
>>
>> Let me know what you think.
> 
> I'm not really sure what problem those scripts are supposed to solve?

The idea is to make it easier/quicker to be able to install a package from aports (for testing, etc).

It's my understanding and experience that you can't simply "abuild -r; apk add ./package.apk", atleast without specifying --no-network to apk, but that seems to be a 'global option' instead of being per-package.

I suppose its no different though: doing --no-network, or specifying a specific local repository (atleast without HTTP repositories added into the mix?).

Ideally, I'd like to be able to "abuild -r; apk add ./package.apk" and have apk resolve dependencies either via /etc/apk/repositories (HTTP and/or local repos), or abuild the dependencies in aports instead, similar to FreeBSD ports, if I'm not mistaken.

Apologies if this is already possible.

Thanks in advance,
Matt

P.S.: Looks like I could use some form of "abuild -ri".



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Jeremy Thomerson <jeremy@thomersonfamily.com>
Details
Message ID
<AANLkTik2hkB=pjwsY8v04EOaXZ6oDUbQwa9OgUFGATeu@mail.gmail.com>
In-Reply-To
<1291910637.24376.32.camel@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1291912110
DKIM signature
missing
Download raw message
If it is not, can we get how to do this added to the wiki on the page about
building aports ?

Jeremy Thomerson
-- sent from my "smart" phone, so please excuse spelling, formatting, or
compiler errors

On Dec 9, 2010 10:04 AM, "Natanael Copa" <ncopa@alpinelinux.org> wrote:

On Thu, 2010-12-09 at 09:41 -0600, Matt Smith wrote:
> On Thursday, December 9, 2010 7:40am, "Natana...
ah. I yes.

What i do is adding $HOME/.cache/apks first in /etc/apk/repositories

then i do:


abuild -r && apk add $package
if there are additional http repos in /etc/apk/repositories you can pick
some from local aports tree and some from network (to avoid build
everything)



> It's my understanding and experience that you can't simply "abuild -r;
> apk add ./package.apk",...
I think apk add ./package.apk is supposed to work but is buggy.



> I suppose its no different though: doing --no-network, or specifying a
> specific local reposito...
np. and you are right. we could improve this.

>
> Thanks in advance,
> Matt
>
> P.S.: Looks like I could use some form of "abuild -ri".
>




-...
Details
Message ID
<1291912251.280822370@192.168.2.229>
In-Reply-To
<1291910637.24376.32.camel@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1291912251
DKIM signature
missing
Download raw message
On Thursday, December 9, 2010 10:03am, "Natanael Copa" <ncopa@alpinelinux.org> said:
> On Thu, 2010-12-09 at 09:41 -0600, Matt Smith wrote:
>> The idea is to make it easier/quicker to be able to install a package
>> from aports (for testing, etc).
> 
> ah. I yes.
> 
> What i do is adding $HOME/.cache/apks first in /etc/apk/repositories
> 
> then i do:
> 
> abuild -r && apk add $package
> 
> if there are additional http repos in /etc/apk/repositories you can pick
> some from local aports tree and some from network (to avoid build
> everything)

Thanks, I'll try it out.  BTW, you do mean "apk add package" (without version and .apk), right?

>> It's my understanding and experience that you can't simply "abuild -r;
>> apk add ./package.apk", at least without specifying --no-network to
>> apk, but that seems to be a 'global option' instead of being
>> per-package.
> 
> I think apk add ./package.apk is supposed to work but is buggy.

I actually worked on this, adding "char *filename" to the apk_dependency struct, passing it the filename from argv in add.c and then, I think in apk_state_lock_dependency() or somewhere else in state.c, passed it to the relevant apk_package struct so when it came time to check the relevant package->filename, it wasn't NULL and should have done something similar to --no-network, but it bombs out in the end saying "BAD signature", which is where I decided to give up and write those scripts instead. :o

- Matt



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Cameron Banta <cbanta@gmail.com>
Details
Message ID
<4D0106C0.4050506@gmail.com>
In-Reply-To
<AANLkTik2hkB=pjwsY8v04EOaXZ6oDUbQwa9OgUFGATeu@mail.gmail.com> (view parent)
Sender timestamp
1291912896
DKIM signature
missing
Download raw message
  On 12/09/2010 10:28 AM, Jeremy Thomerson wrote:
>
> If it is not, can we get how to do this added to the wiki on the page 
> about building aports ?
>
Just to add my $0.02, I find it much more useful to dump the apks into a 
directory that's exported by a web server. Then you can put that url in 
the /etc/apt/repositories (before the edge urls) of a second testing box 
- now when you install and test packages it won't affect your aports dev 
box.

You can edit REPODEST in /etc/abuild.conf to put the compiled packages 
somewhere else (I use /srv/apks). Then I use nginx to serve them to my 
other alpine test boxes. Another, probably better, option is to just 
link ~/.cache/apks to /srv/apks. (The last option will automatically 
create your APKINDEX for you.)

-Cameron

> Jeremy Thomerson
> -- sent from my "smart" phone, so please excuse spelling, formatting, 
> or compiler errors
>
>> On Dec 9, 2010 10:04 AM, "Natanael Copa" <ncopa@alpinelinux.org 
>> <ncopa@alpinelinux.org>> wrote:
>>
>> On Thu, 2010-12-09 at 09:41 -0600, Matt Smith wrote:
>> > On Thursday, December 9, 2010 7:40am, "Natana...
>>
>> ah. I yes.
>>
>> What i do is adding $HOME/.cache/apks first in /etc/apk/repositories
>>
>> then i do:
>>
>>
>> abuild -r && apk add $package
>>
>> if there are additional http repos in /etc/apk/repositories you can pick
>> some from local aports tree and some from network (to avoid build
>> everything)
>>
>>
>>
>> > It's my understanding and experience that you can't simply "abuild -r;
>> > apk add ./package.apk",...
>>
>> I think apk add ./package.apk is supposed to work but is buggy.
>>
>>
>>
>> > I suppose its no different though: doing --no-network, or specifying a
>> > specific local reposito...
>>
>> np. and you are right. we could improve this.
>>
>> >
>> > Thanks in advance,
>> > Matt
>> >
>> > P.S.: Looks like I could use some form of "abuild -ri".
>> >
>>
>>
>>
>>
>> -...
>>
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<1291902032.24376.27.camel@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<1291843221-21222-1-git-send-email-mcs@darkregion.net> (view parent)
Sender timestamp
1291902032
DKIM signature
missing
Download raw message
On Wed, 2010-12-08 at 15:20 -0600, Matt Smith wrote:
> I've created some helper scripts for aports, which I'll briefly cover here.
> 
> New files:
> - aports/apk-aports.conf: configuration file for the following helper scripts
> - aports/apkindex.sh:     creates a signed APKINDEX.tar.gz for your aports
> - aports/apkwrapper.sh:   apk wrapper that uses your aports repository
> 
> Let me know what you think.

I'm not really sure what problem those scripts are supposed to solve?

-nc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<1291910637.24376.32.camel@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<1291909310.567329176@192.168.2.229> (view parent)
Sender timestamp
1291910637
DKIM signature
missing
Download raw message
On Thu, 2010-12-09 at 09:41 -0600, Matt Smith wrote:
> On Thursday, December 9, 2010 7:40am, "Natanael Copa" <ncopa@alpinelinux.org> said:
> > On Wed, 2010-12-08 at 15:20 -0600, Matt Smith wrote:
> >> I've created some helper scripts for aports, which I'll briefly cover here.
> >>
> >> New files:
> >> - aports/apk-aports.conf: configuration file for the following helper scripts
> >> - aports/apkindex.sh:     creates a signed APKINDEX.tar.gz for your aports
> >> - aports/apkwrapper.sh:   apk wrapper that uses your aports repository
> >>
> >> Let me know what you think.
> > 
> > I'm not really sure what problem those scripts are supposed to solve?
> 
> The idea is to make it easier/quicker to be able to install a package
> from aports (for testing, etc).

ah. I yes.

What i do is adding $HOME/.cache/apks first in /etc/apk/repositories

then i do:

abuild -r && apk add $package

if there are additional http repos in /etc/apk/repositories you can pick
some from local aports tree and some from network (to avoid build
everything)


> It's my understanding and experience that you can't simply "abuild -r;
> apk add ./package.apk", atleast without specifying --no-network to
> apk, but that seems to be a 'global option' instead of being
> per-package.

I think apk add ./package.apk is supposed to work but is buggy.


> I suppose its no different though: doing --no-network, or specifying a
> specific local repository (atleast without HTTP repositories added
> into the mix?).
> 
> Ideally, I'd like to be able to "abuild -r; apk add ./package.apk" and
> have apk resolve dependencies either via /etc/apk/repositories (HTTP
> and/or local repos), or abuild the dependencies in aports instead,
> similar to FreeBSD ports, if I'm not mistaken.
> 
> Apologies if this is already possible.

np. and you are right. we could improve this.
> 
> Thanks in advance,
> Matt
> 
> P.S.: Looks like I could use some form of "abuild -ri".
> 




---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20101209211812.4aa7f53d@alpinelinux.org>
In-Reply-To
<1291912251.280822370@192.168.2.229> (view parent)
Sender timestamp
1291929492
DKIM signature
missing
Download raw message
On Thu, 9 Dec 2010 10:30:51 -0600 (CST)
"Matt Smith" <mcs@darkregion.net> wrote:

> Thanks, I'll try it out.  BTW, you do mean "apk add package" (without
> version and .apk), right?

yes

> >> It's my understanding and experience that you can't simply "abuild
> >> -r; apk add ./package.apk", at least without specifying
> >> --no-network to apk, but that seems to be a 'global option'
> >> instead of being per-package.
> > 
> > I think apk add ./package.apk is supposed to work but is buggy.
> 
> I actually worked on this, adding "char *filename" to the
> apk_dependency struct, passing it the filename from argv in add.c and
> then, I think in apk_state_lock_dependency() or somewhere else in
> state.c, passed it to the relevant apk_package struct so when it came
> time to check the relevant package->filename, it wasn't NULL and
> should have done something similar to --no-network, but it bombs out
> in the end saying "BAD signature", which is where I decided to give
> up and write those scripts instead. :o

I think it works as long there are no exact same version available in
index.

could you please create an issue for i on bugs.alpinelinux.org if its
not there already?

i think timo is aware of it and it will be fixed eventually but it
might be good to have it in the bug tracker as a known bug for others.

thanks
> 
> - Matt
> 

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20101209212138.27539e06@alpinelinux.org>
In-Reply-To
<AANLkTik2hkB=pjwsY8v04EOaXZ6oDUbQwa9OgUFGATeu@mail.gmail.com> (view parent)
Sender timestamp
1291929698
DKIM signature
missing
Download raw message
On Thu, 9 Dec 2010 10:28:30 -0600
Jeremy Thomerson <jeremy@thomersonfamily.com> wrote:
> > On Thursday, December 9, 2010 7:40am, "Natana...
>> 
>> What i do is adding $HOME/.cache/apks first in /etc/apk/repositories

> If it is not, can we get how to do this added to the wiki on the page
> about building aports ?

yes, I agree that it would be good to have it documented properly.

It is a wiki ;)

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Details
Message ID
<1291952548.958129836@192.168.2.229>
In-Reply-To
<20101209211812.4aa7f53d@alpinelinux.org> (view parent)
Sender timestamp
1291952548
DKIM signature
missing
Download raw message
On Thursday, December 9, 2010 3:18pm, "Natanael Copa" <ncopa@alpinelinux.org> said:
>> > I think apk add ./package.apk is supposed to work but is buggy.
> 
> I think it works as long there are no exact same version available in
> index.

Yep, you are right.

> could you please create an issue for i on bugs.alpinelinux.org if its
> not there already?
> 
> i think timo is aware of it and it will be fixed eventually but it
> might be good to have it in the bug tracker as a known bug for others.

Ok, I've reported it just now here:
http://redmine.alpinelinux.org/issues/492

And it links back to this mailing list thread.  Also, I can update the wiki accordingly later on.

Thanks,
Matt



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)