Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: several small bits of tidying (http://www.linux-archive.org/archlinux-pacman-development/192881-makepkg-several-small-bits-tidying.html)

Allan McRae 11-13-2008 04:08 PM

makepkg: several small bits of tidying
 
1. Do not warn people about missing arch if they are using --ignorearch.

2. Remove unneed reference to bug report about using fakeroot as little
as possible. We want to do that, bug report of not.

3. Removes superfluous warning given when building as root. The user
has already used the "--asroot" flag.

4. Move comment about skipping warning message to above where it occurs

5. Do not warn about skipping source retreval, integrety checks and
extraction when using --repackage

6. Do not warn about skipping build when using --repackage

7. Move comment about fakeroot usage to above test condition

Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 31 +++++++++----------------------
1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b0d1dad..f5cdd90 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1409,10 +1409,6 @@ if ! in_array $CARCH ${arch[@]}; then
plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
plain "$(gettext "such as arch=('%s').")" "$CARCH"
exit 1
- else
- warning "$(gettext "%s is not available for the '%s' architecture.")" "$pkgname" "$CARCH"
- plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
- plain "$(gettext "such as arch=('%s').")" "$CARCH"
fi
fi

@@ -1460,11 +1456,8 @@ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
fi

# Run the bare minimum in fakeroot
-# fix flyspray bug 6208 -- using makepkg with fakeroot gives an error
if [ "$INFAKEROOT" = "1" ]; then
- if [ "$REPKG" = "1" ]; then
- warning "$(gettext "Skipping build.")"
- else
+ if [ "$REPKG" = "0" ]; then
run_build
tidy_install
fi
@@ -1477,10 +1470,6 @@ fi

msg "$(gettext "Making package: %s")" "$pkgname $pkgver-$pkgrel $CARCH ($(date))"

-if [ $EUID -eq 0 ]; then
- warning "$(gettext "Running makepkg as root...")"
-fi
-
# if we are creating a source-only package, go no further
if [ "$SOURCEONLY" != "0" ]; then
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}"
@@ -1495,10 +1484,10 @@ fi

# fix flyspray bug #5973
if [ "$NODEPS" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
+ # no warning message needed for nobuild, repkg
if [ "$NODEPS" = "1" ]; then
warning "$(gettext "Skipping dependency checks.")"
fi
- # skip printing a warning message for the others: nobuild, repkg
elif [ $(type -p pacman) ]; then
unset pkgdeps # Set by resolve_deps() and used by remove_deps()
deperr=0
@@ -1524,7 +1513,7 @@ umask 0022
mkdir -p "$srcdir"
cd "$srcdir"

-if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
+if [ "$NOEXTRACT" = "1" ]; then
warning "$(gettext "Skipping source retrieval -- using existing src/ tree")"
warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")"
warning "$(gettext "Skipping source extraction -- using existing src/ tree")"
@@ -1533,11 +1522,11 @@ if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
error "$(gettext "The source directory is empty, there is nothing to build!")"
plain "$(gettext "Aborting...")"
exit 1
- elif [ "$REPKG" = "1" -a ( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" ) ]; then
- error "$(gettext "The package directory is empty, there is nothing to repackage!")"
- plain "$(gettext "Aborting...")"
- exit 1
fi
+elif [ "$REPKG" = "1" -a ( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" ) ]; then
+ error "$(gettext "The package directory is empty, there is nothing to repackage!")"
+ plain "$(gettext "Aborting...")"
+ exit 1
else
download_sources
check_checksums
@@ -1556,11 +1545,9 @@ else
mkdir -p "$pkgdir"
cd "$startdir"

+ # if we are root or if fakeroot is not enabled, then we don't use it
if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
- # if we are root or if fakeroot is not enabled, then we don't use it
- if [ "$REPKG" = "1" ]; then
- warning "$(gettext "Skipping build.")"
- else
+ if [ "$REPKG" = "0" ]; then
devel_update
run_build
tidy_install
--
1.6.0.4

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

Allan McRae 11-13-2008 04:12 PM

makepkg: several small bits of tidying
 
Allan McRae wrote:

1. Do not warn people about missing arch if they are using --ignorearch.

2. Remove unneed reference to bug report about using fakeroot as little
as possible. We want to do that, bug report of not.

3. Removes superfluous warning given when building as root. The user
has already used the "--asroot" flag.

4. Move comment about skipping warning message to above where it occurs

5. Do not warn about skipping source retreval, integrety checks and
extraction when using --repackage

6. Do not warn about skipping build when using --repackage

7. Move comment about fakeroot usage to above test condition

Signed-off-by: Allan McRae <allan@archlinux.org>


<snip>

I was re-familiarizing with the makepkg code and decided to tidy a few
things that I did not like so much. Some are more subjective that
others. Feel free to tell me that some or all of these are better the
way they were...


Allan


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

"Dan McGee" 11-14-2008 01:32 AM

makepkg: several small bits of tidying
 
On Thu, Nov 13, 2008 at 11:08 AM, Allan McRae <allan@archlinux.org> wrote:
> 1. Do not warn people about missing arch if they are using --ignorearch.
>
> 2. Remove unneed reference to bug report about using fakeroot as little
> as possible. We want to do that, bug report of not.
>
> 3. Removes superfluous warning given when building as root. The user
> has already used the "--asroot" flag.
>
> 4. Move comment about skipping warning message to above where it occurs
>
> 5. Do not warn about skipping source retreval, integrety checks and
> extraction when using --repackage
>
> 6. Do not warn about skipping build when using --repackage
>
> 7. Move comment about fakeroot usage to above test condition
>
> Signed-off-by: Allan McRae <allan@archlinux.org>
Most of this seems reasonable to me. You have my signoff.

> ---
> scripts/makepkg.sh.in | 31 +++++++++----------------------
> 1 files changed, 9 insertions(+), 22 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index b0d1dad..f5cdd90 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1409,10 +1409,6 @@ if ! in_array $CARCH ${arch[@]}; then
> plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
> plain "$(gettext "such as arch=('%s').")" "$CARCH"
> exit 1
> - else
> - warning "$(gettext "%s is not available for the '%s' architecture.")" "$pkgname" "$CARCH"
> - plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
> - plain "$(gettext "such as arch=('%s').")" "$CARCH"
> fi
> fi
>
> @@ -1460,11 +1456,8 @@ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
> fi
>
> # Run the bare minimum in fakeroot
> -# fix flyspray bug 6208 -- using makepkg with fakeroot gives an error
> if [ "$INFAKEROOT" = "1" ]; then
> - if [ "$REPKG" = "1" ]; then
> - warning "$(gettext "Skipping build.")"
> - else
> + if [ "$REPKG" = "0" ]; then
> run_build
> tidy_install
> fi
> @@ -1477,10 +1470,6 @@ fi
>
> msg "$(gettext "Making package: %s")" "$pkgname $pkgver-$pkgrel $CARCH ($(date))"
>
> -if [ $EUID -eq 0 ]; then
> - warning "$(gettext "Running makepkg as root...")"
> -fi
> -
> # if we are creating a source-only package, go no further
> if [ "$SOURCEONLY" != "0" ]; then
> if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}"
> @@ -1495,10 +1484,10 @@ fi
>
> # fix flyspray bug #5973
> if [ "$NODEPS" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
> + # no warning message needed for nobuild, repkg
> if [ "$NODEPS" = "1" ]; then
> warning "$(gettext "Skipping dependency checks.")"
> fi
> - # skip printing a warning message for the others: nobuild, repkg
> elif [ $(type -p pacman) ]; then
> unset pkgdeps # Set by resolve_deps() and used by remove_deps()
> deperr=0
> @@ -1524,7 +1513,7 @@ umask 0022
> mkdir -p "$srcdir"
> cd "$srcdir"
>
> -if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
> +if [ "$NOEXTRACT" = "1" ]; then
> warning "$(gettext "Skipping source retrieval -- using existing src/ tree")"
> warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")"
> warning "$(gettext "Skipping source extraction -- using existing src/ tree")"
> @@ -1533,11 +1522,11 @@ if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
> error "$(gettext "The source directory is empty, there is nothing to build!")"
> plain "$(gettext "Aborting...")"
> exit 1
> - elif [ "$REPKG" = "1" -a ( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" ) ]; then
> - error "$(gettext "The package directory is empty, there is nothing to repackage!")"
> - plain "$(gettext "Aborting...")"
> - exit 1
> fi
> +elif [ "$REPKG" = "1" -a ( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" ) ]; then
> + error "$(gettext "The package directory is empty, there is nothing to repackage!")"
> + plain "$(gettext "Aborting...")"
> + exit 1
> else
> download_sources
> check_checksums
> @@ -1556,11 +1545,9 @@ else
> mkdir -p "$pkgdir"
> cd "$startdir"
>
> + # if we are root or if fakeroot is not enabled, then we don't use it
> if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
> - # if we are root or if fakeroot is not enabled, then we don't use it
> - if [ "$REPKG" = "1" ]; then
> - warning "$(gettext "Skipping build.")"
> - else
> + if [ "$REPKG" = "0" ]; then
> devel_update
> run_build
> tidy_install
> --
> 1.6.0.4
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev@archlinux.org
> http://archlinux.org/mailman/listinfo/pacman-dev
>
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

"Aaron Griffin" 11-14-2008 05:00 PM

makepkg: several small bits of tidying
 
On Thu, Nov 13, 2008 at 8:32 PM, Dan McGee <dpmcgee@gmail.com> wrote:
> On Thu, Nov 13, 2008 at 11:08 AM, Allan McRae <allan@archlinux.org> wrote:
>> 1. Do not warn people about missing arch if they are using --ignorearch.
>>
>> 2. Remove unneed reference to bug report about using fakeroot as little
>> as possible. We want to do that, bug report of not.
>>
>> 3. Removes superfluous warning given when building as root. The user
>> has already used the "--asroot" flag.
>>
>> 4. Move comment about skipping warning message to above where it occurs
>>
>> 5. Do not warn about skipping source retreval, integrety checks and
>> extraction when using --repackage
>>
>> 6. Do not warn about skipping build when using --repackage
>>
>> 7. Move comment about fakeroot usage to above test condition
>>
>> Signed-off-by: Allan McRae <allan@archlinux.org>
> Most of this seems reasonable to me. You have my signoff.

And MY axe!
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev


All times are GMT. The time now is 09:49 PM.

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