[pacman-dev] makepkg changes
This is mostly directed towards Andrew's makepkg branch changes, with some suggestions/comments. First, I cherry-picked your "scripts/makepkg.in: Move the remaining stages into functions." commit, and noticed a ton of whitespace issues with it. I fixed them before committing to my tree. Try to make sure in the future you don't use spaces instead of tabs. There is a vim modeline at the bottom, if you are using another editor that has the same capability feel free to add your modeline. * scripts/makepkg.in: Remove chown root from extract_sources(). - I'm not sure if I want to pull this in yet, as reading I found that the --no-same-owner flag is non-portable. In addition, it seems to have an awful lot of whitespace adjusting. * scripts/makepkg.in: Rewrite check_{options,buildenv} to tidy them up. - A lot of the changes were just changing "y" to 'y'- is this really necessary? In addition, watch the whitespace issues. This one is probably good for inclusion after the above things are reviewed though. * scripts/makepkg.in: Clean up - Any way you can split this one into the two separate issues it fixes, and make sure whitespace changes aren't creeping in. If you could rebase all of these off my makepkg branch, that would be awesome. And if there are any other patches I've missed that I haven't already pulled, then let me know that too. I was having to cherry-pick most of these in order to keep a relatively clean history. -Dan
Sorry about the whitespace junk, I thought I had fixed vim but it's still ignoring the modeline. I've rebased the patches of your makepkg branch. Dan McGee wrote:
This is mostly directed towards Andrew's makepkg branch changes, with some suggestions/comments.
First, I cherry-picked your "scripts/makepkg.in: Move the remaining stages into functions." commit, and noticed a ton of whitespace issues with it. I fixed them before committing to my tree. Try to make sure in the future you don't use spaces instead of tabs. There is a vim modeline at the bottom, if you are using another editor that has the same capability feel free to add your modeline.
* scripts/makepkg.in: Remove chown root from extract_sources(). - I'm not sure if I want to pull this in yet, as reading I found that the --no-same-owner flag is non-portable. In addition, it seems to have an awful lot of whitespace adjusting. I've removed the --no-same-owner change and kept the clean up.
* scripts/makepkg.in: Rewrite check_{options,buildenv} to tidy them up. - A lot of the changes were just changing "y" to 'y'- is this really necessary? In addition, watch the whitespace issues. This one is probably good for inclusion after the above things are reviewed though. Fixed the whitespace junk, sorry. Removed the "y" => 'y' (I was being a bit anal :p).
* scripts/makepkg.in: Clean up - Any way you can split this one into the two separate issues it fixes, and make sure whitespace changes aren't creeping in. Still need to do this one.
If you could rebase all of these off my makepkg branch, that would be awesome. And if there are any other patches I've missed that I haven't already pulled, then let me know that too. I was having to cherry-pick most of these in order to keep a relatively clean history.
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
79d73c646e76b4cca30845eb5d1b4e0116749f3b scripts/makepkg.in | 80 ++++++++++++++++++++++----------------------------- 1 files changed, 35 insertions(+), 45 deletions(-) diff --git a/scripts/makepkg.in b/scripts/makepkg.in index 6ae4d8b..9a212e9 100644 --- a/scripts/makepkg.in +++ b/scripts/makepkg.in @@ -231,10 +231,9 @@ handledeps() { [ $# -eq 0 ] && return $R_DEPS_SATISFIED local deplist="$*" - local striplist dep depstrip + local dep striplist for dep in $deplist; do - depstrip="$(echo $dep | sed -e 's|=.*$||' -e 's|>.&$||' -e 's|<.*$||')" - striplist="$striplist $depstrip" + striplist="$striplist $(echo $dep | sed -e 's|=.*$||' -e 's|>.*$||' -e 's|<.*$||')" done You just don't want to let me win this one, do you? :P I figured I'd keep it two lines for clarity. if [ "$DEP_SRC" = "0" -a "$DEP_BIN" = "0" ]; then @@ -303,11 +302,16 @@ handledeps() { } resolvedeps() { + # $pkgdeps is a GLOBAL variable, used by removedeps() local R_DEPS_SATISFIED=0 - local R_DEPS_MISSING=0 + local R_DEPS_MISSING=1 - deplist="$(checkdeps $*)" - [ "$deplist" = "" ] && return $R_DEPS_SATISFIED + local deplist="$(checkdeps $*)" + if [ "$deplist" = "" ]; then + return $R_DEPS_SATISFIED + else + pkgdeps="$pkgdeps $deplist" + fi if handledeps $deplist; then # check deps again to make sure they were resolved @@ -328,24 +332,20 @@ resolvedeps() { # fix flyspray bug #5923 removedeps() { + # $pkgdeps is a GLOBAL variable, set by resolvedeps() [ "$RMDEPS" = "0" ] && return + [ "$pkgdeps" = "" ] && return - # runtimedeps and buildtimedeps are set when resolving deps - local deplist="$runtimedeps $buildtimedeps" - - [ "$deplist" = "" ] && return - - local striplist dep depstrip - for dep in $deplist; do - depstrip="$(echo $dep | sed -e 's|=.*$||' -e 's|>.&$||' -e 's|<.*$||')" - striplist="$striplist $depstrip" + local dep striplist + for dep in $pkgdeps; do + deplist="$deplist $(echo $dep | sed -e 's|=.*$||' -e 's|>.*$||' -e 's|<.*$||')" done Same as above. msg "Removing installed dependencies..." if [ "$ASROOT" = "0" ]; then - sudo pacman $PACMAN_OPTS -Rs $striplist + sudo pacman $PACMAN_OPTS -Rs $deplist else - pacman $PACMAN_OPTS -Rs $striplist + pacman $PACMAN_OPTS -Rs $deplist fi } @@ -508,18 +508,21 @@ extract_sources() { cmd="gunzip -d -f $file" ;; *application/x-bzip*) cmd="bunzip2 -f $file" ;; + *) + # Don't know what to use to extract this file, + # skip to the next file + continue;; esac - if [ "$cmd" != "" ]; then - msg2 "$cmd" - $cmd - if [ $? -ne 0 ]; then - # unzip will return a 1 as a warning, it is not an error - if [ "$unziphack" != "1" -o $? -ne 1 ]; then - error "$(gettext "Failed to extract %s")" "$file" - msg "$(gettext "Aborting...")" - exit 1 - fi + local ret=0 + msg2 "$cmd" + $cmd || ret=$? + if [ $ret -ne 0 ]; then + # unzip will return a 1 as a warning, it is not an error + if [ $unziphack -ne 1 -o $ret -ne 1 ]; then + error "$(gettext "Failed to extract %s")" "$file" + msg "$(gettext "Aborting...")" + exit 1 fi fi done @@ -746,8 +749,6 @@ create_package() { error "$(gettext "Failed to create package file.")" exit 1 # TODO: error code fi - - create_xdelta "$pkg_file" } create_xdelta() { @@ -1177,27 +1178,14 @@ if [ "$NODEPS" = "1" -o "$GENINTEG" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" fi # skip printing a warning message for the others: geninteg, nobuild, repkg elif [ $(type -p pacman) ]; then + unset pkgdeps # Set by resolvedeps() and used by removedeps() deperr=0 - # these two variables are needed later by removedeps - unset runtimedeps buildtimedeps msg "$(gettext "Checking Runtime Dependencies...")" - resolvedeps ${depends[@]} - ret=$? - # deplist is a global variable set by resolvedeps - runtimedeps="$deplist" - if [ "$ret" != "0" ]; then - deperr=1 - fi + resolvedeps ${depends[@]} || deperr=1 msg "$(gettext "Checking Buildtime Dependencies...")" - resolvedeps ${makedepends[@]} - ret=$? - # deplist is a global variable set by resolvedeps - buildtimedeps="$deplist" - if [ "$ret" != "0" ]; then - deperr=1 - fi + resolvedeps ${makedepends[@]} || deperr=1 if [ $deperr -eq 1 ]; then error "$(gettext "could not resolve all dependencies.")" @@ -1258,6 +1246,8 @@ else [ $ret -ne 0 ] && exit $ret unset ret fi + + create_xdelta "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" fi cd "$startdir" The rest looks good. -Dan
You just don't want to let me win this one, do you? :P I figured I'd keep it two lines for clarity. :p Fixed
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :) Andrew
On 6/2/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :)
All pushed to the al.org tree. Thanks! Side note- I see some work on your working branch but don't want to touch it given the branch name. Let me know when that stuff is ready to go (either by putting it on the makepkg branch or having a branch called 'to-pull' or something). -Dan
Dan McGee wrote:
On 6/2/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :)
All pushed to the al.org tree. Thanks!
Side note- I see some work on your working branch but don't want to touch it given the branch name. Let me know when that stuff is ready to go (either by putting it on the makepkg branch or having a branch called 'to-pull' or something).
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Ok I've moved the xdelta patch, and the rewritten abs script (with Dan's suggestions) to the 'ready_to_pull' branch :) Andrew
On 6/4/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Dan McGee wrote:
On 6/2/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :)
All pushed to the al.org tree. Thanks!
Side note- I see some work on your working branch but don't want to touch it given the branch name. Let me know when that stuff is ready to go (either by putting it on the makepkg branch or having a branch called 'to-pull' or something).
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Ok I've moved the xdelta patch, and the rewritten abs script (with Dan's suggestions) to the 'ready_to_pull' branch :)
Andrew
Might want to fix the spelling of "ingnore" and "Sourrce" before I pull. :P Also, it looks like abs no longer prints "abs (pacman) version" in the usage instructions (you should be able to rip that straight from the abs I just pushed to al.org). Since I just pushed that gettext stuff, these patches are probably going to need a rebase/merge. Sorry. -Dan
Dan McGee wrote:
On 6/4/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Dan McGee wrote:
On 6/2/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :) All pushed to the al.org tree. Thanks!
Side note- I see some work on your working branch but don't want to touch it given the branch name. Let me know when that stuff is ready to go (either by putting it on the makepkg branch or having a branch called 'to-pull' or something).
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev Ok I've moved the xdelta patch, and the rewritten abs script (with Dan's suggestions) to the 'ready_to_pull' branch :)
Andrew
Might want to fix the spelling of "ingnore" and "Sourrce" before I pull. :P Done :)
Also, it looks like abs no longer prints "abs (pacman) version" in the usage instructions (you should be able to rip that straight from the abs I just pushed to al.org).
Done
Since I just pushed that gettext stuff, these patches are probably going to need a rebase/merge. Sorry. Done
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
On 6/4/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Dan McGee wrote:
On 6/4/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Dan McGee wrote:
On 6/2/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Ok that's the majority of the makepkg clean up complete. I've also added some improved error catching code and a clean_up() function using bash traps (thanks for the idea Aaron :) All pushed to the al.org tree. Thanks!
Side note- I see some work on your working branch but don't want to touch it given the branch name. Let me know when that stuff is ready to go (either by putting it on the makepkg branch or having a branch called 'to-pull' or something).
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev Ok I've moved the xdelta patch, and the rewritten abs script (with Dan's suggestions) to the 'ready_to_pull' branch :)
Andrew
Might want to fix the spelling of "ingnore" and "Sourrce" before I pull. :P Done :)
Also, it looks like abs no longer prints "abs (pacman) version" in the usage instructions (you should be able to rip that straight from the abs I just pushed to al.org).
Done
Since I just pushed that gettext stuff, these patches are probably going to need a rebase/merge. Sorry. Done
Pulled most of your branch into my working branch, which I will probably merge into master tonight. * scripts: Fixed DBROOT and LOCKFILE, added CACHEDIR. Not pulling, see my changes. * FS7355: Add --ignorearch option to makepkg. Keep it around, I want to see if we should add this for sure. Aaron, your vote? -Dan
Dan McGee wrote:
* FS7355: Add --ignorearch option to makepkg. Keep it around, I want to see if we should add this for sure. Aaron, your vote? Moved to it's own branch until it gets a thumbs up
I've added a patch to ready_to_pull to clean up the command line parsing in makepkg. Andrew
participants (2)
-
Andrew Fyfe
-
Dan McGee