Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: add --allsource option (http://www.linux-archive.org/archlinux-pacman-development/98639-makepkg-add-allsource-option.html)

Dan McGee 05-31-2008 05:07 PM

makepkg: add --allsource option
 
This supplements the --source option and does nearly the same thing, except
downloaded source files are included in the archive as well.

This is mainly an RFC patch and interested parties are encouraged to
comment. I was also planning on making a patch for adding the package/
prefix to the archived files, but apparently no archive program makes this
easy to do with is just plain stupid. If someone knows how without creating
a temporary dir and moving files there, let me know.

Signed-off-by: Dan McGee <dan@archlinux.org>
---
scripts/makepkg.sh.in | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 27da281..2c479fd 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -856,6 +856,15 @@ create_package() {

create_srcpackage() {
cd "$startdir"
+ if [ "$SOURCEONLY" = "2" ]; then
+ # get back to our src directory so we can begin with sources
+ mkdir -p "$srcdir"
+ cd "$srcdir"
+ download_sources
+ # we can only check checksums if we have all files
+ check_checksums
+ cd "$startdir"
+ fi
msg "$(gettext "Creating source package...")"
local comp_files="$BUILDSCRIPT"
msg2 "$(gettext "Adding %s...")" "$BUILDSCRIPT"
@@ -874,11 +883,15 @@ create_srcpackage() {
comp_files="$comp_files ChangeLog"
fi

- local i
- for i in ${source[@]}; do
- if [ -f $i ]; then
- msg2 "$(gettext "Adding %s...")" "$i"
- comp_files="$comp_files $i"
+ local netfile
+ for netfile in ${source[@]}; do
+ local file=$(strip_url "$netfile")
+ if [ -f $netfile ]; then
+ msg2 "$(gettext "Adding %s...")" "$netfile"
+ comp_files="$comp_files $netfile"
+ elif [ "$SOURCEONLY" = "2" -a -f "$srcdir/$file" ]; then
+ msg2 "$(gettext "Adding %s...")" "$file"
+ comp_files="$comp_files -C $srcdir $file"
fi
done

@@ -1061,8 +1074,10 @@ SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined

# Parse Command Line Options.
OPT_SHORT="AbcCdefFghiLmop:rRsSV"
-OPT_LONG="ignorearch,asroot,builddeps,clean,cleanc ache,nodeps,noextract,force,forcever:,geninteg,hel p,holdver"
-OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rm deps,repackage,source,syncdeps,usesudo,version"
+OPT_LONG="allsource,asroot,ignorearch,builddeps,c lean,cleancache,nodeps"
+OPT_LONG="$OPT_LONG,noextract,force,forcever:,gen integ,help,holdver"
+OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,r mdeps,repackage,source"
+OPT_LONG="$OPT_LONG,syncdeps,usesudo,version"
# Pacman Options
OPT_LONG="$OPT_LONG,noconfirm,noprogressbar"
OPT_TEMP="$(getopt -o "$OPT_SHORT" -l "$OPT_LONG" -n "$(basename "$0")" -- "$@" || echo 'GETOPT GO BANG!')"
@@ -1080,6 +1095,7 @@ while true; do
--noprogressbar) PACMAN_OPTS="$PACMAN_OPTS --noprogressbar" ;;

# Makepkg Options
+ --allsource) SOURCEONLY=2 ;;
--asroot) ASROOT=1 ;;
-A|--ignorearch) IGNOREARCH=1 ;;
-c|--clean) CLEANUP=1 ;;
@@ -1316,7 +1332,7 @@ if [ $EUID -eq 0 ]; then
fi

# if we are creating a source-only package, go no further
-if [ "$SOURCEONLY" = "1" ]; then
+if [ "$SOURCEONLY" != "0" ]; then
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}"
-a "$FORCE" = "0" ]; then
error "$(gettext "A package has already been built. (use -f to overwrite)")"
--
1.5.5.3


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Miklos Vajna 05-31-2008 08:47 PM

makepkg: add --allsource option
 
On Sat, May 31, 2008 at 12:07:45PM -0500, Dan McGee <dan@archlinux.org> wrote:
> This supplements the --source option and does nearly the same thing, except
> downloaded source files are included in the archive as well.
>
> This is mainly an RFC patch and interested parties are encouraged to
> comment. I was also planning on making a patch for adding the package/
> prefix to the archived files, but apparently no archive program makes this
> easy to do with is just plain stupid. If someone knows how without creating
> a temporary dir and moving files there, let me know.

i don't want to flame or anything, but what's the purpose of this? is
there any program that would make use of such an archive? except that if
you put it out to http then broken out files are browsable, while if you
tar it up (like the rpm guys do with srpm) then the user has to download
the whole source package, even if he/she is only interested in the
buildscript or patches.
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

"Dan McGee" 05-31-2008 09:32 PM

makepkg: add --allsource option
 
On Sat, May 31, 2008 at 3:47 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sat, May 31, 2008 at 12:07:45PM -0500, Dan McGee <dan@archlinux.org> wrote:
>> This supplements the --source option and does nearly the same thing, except
>> downloaded source files are included in the archive as well.
>>
>> This is mainly an RFC patch and interested parties are encouraged to
>> comment. I was also planning on making a patch for adding the package/
>> prefix to the archived files, but apparently no archive program makes this
>> easy to do with is just plain stupid. If someone knows how without creating
>> a temporary dir and moving files there, let me know.
>
> i don't want to flame or anything, but what's the purpose of this? is
> there any program that would make use of such an archive? except that if
> you put it out to http then broken out files are browsable, while if you
> tar it up (like the rpm guys do with srpm) then the user has to download
> the whole source package, even if he/she is only interested in the
> buildscript or patches.

Yes there is use for this- to help people using makepkg comply with
the GPL and providing source and the necessary tools to build it when
they provide binary packages. I didn't remove the --source option on
purpose; you can still generate a src.tar.gz package with the minimal
files needed and none of the downloaded source.

-Dan

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Loui 05-31-2008 11:14 PM

makepkg: add --allsource option
 
On Sat, 31 May 2008 12:07:45 -0500
Dan McGee <dan@archlinux.org> wrote:

> This is mainly an RFC patch and interested parties are encouraged to
> comment. I was also planning on making a patch for adding the package/
> prefix to the archived files, but apparently no archive program makes this
> easy to do with is just plain stupid. If someone knows how without creating
> a temporary dir and moving files there, let me know.

I think you can use a symlink to make the one directory seem like
another. At least it works on a little script I wrote for
doing aurbuild releases. I don't need to cp or mv anything and I get a
tarball with top-level directory based on the version number.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Miklos Vajna 05-31-2008 11:34 PM

makepkg: add --allsource option
 
On Sat, May 31, 2008 at 04:32:15PM -0500, Dan McGee <dpmcgee@gmail.com> wrote:
> Yes there is use for this- to help people using makepkg comply with
> the GPL and providing source and the necessary tools to build it when
> they provide binary packages. I didn't remove the --source option on
> purpose; you can still generate a src.tar.gz package with the minimal
> files needed and none of the downloaded source.

ah, i see. it's your decision, but maybe it would worth considering what
Gentoo and Frugalware does: just run a script from cron that extracts
urls from buildscripts, checks for missing downloaded source tarballs,
obtains them and you're done.

http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=blob;f=t/srcmissing;hb=HEAD

of course this src.tar.gz approach may have other benefits i don't see..
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Allan McRae 06-01-2008 02:13 AM

makepkg: add --allsource option
 
Miklos Vajna wrote:
> On Sat, May 31, 2008 at 04:32:15PM -0500, Dan McGee <dpmcgee@gmail.com> wrote:
>
>> Yes there is use for this- to help people using makepkg comply with
>> the GPL and providing source and the necessary tools to build it when
>> they provide binary packages. I didn't remove the --source option on
>> purpose; you can still generate a src.tar.gz package with the minimal
>> files needed and none of the downloaded source.
>>
>
> ah, i see. it's your decision, but maybe it would worth considering what
> Gentoo and Frugalware does: just run a script from cron that extracts
> urls from buildscripts, checks for missing downloaded source tarballs,
> obtains them and you're done.
>
> http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=blob;f=t/srcmissing;hb=HEAD
>
> of course this src.tar.gz approach may have other benefits i don't see..
>

Don't only think of the for use by the main distro. There are plenty of
people hosting a small custom repo that does not warrant such a cron job.

Allan



_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Xavier 06-02-2008 09:26 AM

makepkg: add --allsource option
 
On Sat, May 31, 2008 at 10:47 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
>
> i don't want to flame or anything, but what's the purpose of this? is
> there any program that would make use of such an archive? except that if
> you put it out to http then broken out files are browsable, while if you
> tar it up (like the rpm guys do with srpm) then the user has to download
> the whole source package, even if he/she is only interested in the
> buildscript or patches.
>

I agree, I also think that keeping the buildscript/patches (archlinux
specific) and the real source files (upstream) separate is nicer and
more flexible.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

"Dan McGee" 06-02-2008 11:47 AM

makepkg: add --allsource option
 
On Mon, Jun 2, 2008 at 4:26 AM, Xavier <shiningxc@gmail.com> wrote:
> On Sat, May 31, 2008 at 10:47 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
>>
>> i don't want to flame or anything, but what's the purpose of this? is
>> there any program that would make use of such an archive? except that if
>> you put it out to http then broken out files are browsable, while if you
>> tar it up (like the rpm guys do with srpm) then the user has to download
>> the whole source package, even if he/she is only interested in the
>> buildscript or patches.
>>
>
> I agree, I also think that keeping the buildscript/patches (archlinux
> specific) and the real source files (upstream) separate is nicer and
> more flexible.

So what are you saying, did anyone actually look at the patch? I
didn't change the existing --source option one bit, that *still* only
includes local source files. All I did was add a completely new
--allsource option that allows you to also build an src.tar.gz with
all source, local and remote. How much more flexible can we get than
having two options here?

-Dan

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Miklos Vajna 06-02-2008 01:54 PM

makepkg: add --allsource option
 
On Mon, Jun 02, 2008 at 06:47:36AM -0500, Dan McGee <dpmcgee@gmail.com> wrote:
> So what are you saying, did anyone actually look at the patch? I
> didn't change the existing --source option one bit, that *still* only
> includes local source files.

yes, i read that patch :)

> All I did was add a completely new --allsource option that allows you
> to also build an src.tar.gz with all source, local and remote. How
> much more flexible can we get than having two options here?

i just said that creating such a huge srpm-like tarball is a bad idea,
and encouraging people to do so by adding an option for that is not
something i would recommend. just my two cents, though.
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Xavier 06-02-2008 02:07 PM

makepkg: add --allsource option
 
On Sat, May 31, 2008 at 11:32 PM, Dan McGee <dpmcgee@gmail.com> wrote:
>
> Yes there is use for this- to help people using makepkg comply with
> the GPL and providing source and the necessary tools to build it when
> they provide binary packages. I didn't remove the --source option on
> purpose; you can still generate a src.tar.gz package with the minimal
> files needed and none of the downloaded source.
>

So you are referring to this, right? :
http://archlinux.org/pipermail/arch-dev-public/2008-May/006206.html
I am still wondering if it would not be nicer and more efficient to
just host the remote sources there.
All pkgbuilds and patches are already available from abs or from the
web interface. Only the remote sources are missing.
Besides the same source is used for all revisions of a package.

Please note that I am just thinking out loud here, I just want to be
convinced about the usefulness of the --allsource option and of
putting everything together instead of keeping things separated.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev


All times are GMT. The time now is 08:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.