[pacman-dev] Maybe some problems with pacman-git
Xavier
shiningxc at gmail.com
Tue Jan 8 09:12:02 EST 2008
Karolina Lindqvist wrote:
> I have a patch-file that I apply to makepkg in pacman-git, with some problems
> and enhancement. I made a new diff with the current version, and this is
> possible problem areas. Since I have more "feature" patches, I have tried to
> extract just the problems, in case someone think that the fix might be
> valuable. All proper UNIFIED diff patch snippets are for makepkg.sh.in
>
You might want to learn git. It does have a learning curve, but it's
worth it. Read at least Dan's git guide :
http://code.toofishes.net/git-guide.txt
> BUG: When pacman recurses, and the --asroot option is given it fails to
> propagate --asroot to the inner pacman.
> The second part of the patch is that the correct options are not propagated to
> a recursing makepkg. I think this is primarily --noconfirm
> and --noprogressbar
>
> @@ -363,13 +373,15 @@
>
> local makepkg_opts='-i -c -b'
> [ "$RMDEPS" = "1" ]&& makepkg_opts="$makepkg_opts -r"
> + [ "$ASROOT" = "1" ]&& makepkg_opts="$makepkg_opts -r --asroot"
Why do you add -r in this case too?
> local ret packagedir
> for packagedir in $candidates; do
> if [ -f "$packagedir/$BUILDSCRIPT" ]; then
> cd "$packagedir"
> ret=0
> - PKGDEST="$PKGDEST" makepkg $makepkg_opts || ret=$?
> [ $ret -eq 0 ]&& continue 2
> + PKGDEST="$PKGDEST" makepkg $PACMAN_OPTS $makepkg_opts || ret=$?
> fi
> done
>
As it has already been mentioned by Travis, this part doesn't look
right. Please resubmit the corrected patch (preferably a git one ;))
>
> bsdtar failed to unzip one of the zip files in one of the packages, so
> therefore I have this patch.
>
> @@ -616,10 +628,12 @@
> local file_type=$(file -bizL "$file")
> local cmd=''
> case "$file_type" in
> - *application/x-tar*|*application/zip*|*application/x-zip*|
> *application/x-cpio*)
> + *application/x-tar*|*application/x-cpio*)
> cmd="bsdtar -x -f $file" ;;
> *application/x-gzip*)
> cmd="gunzip -d -f $file" ;;
> + *application/zip*|*application/x-zip*)
> + cmd="unzip -q $file" ;;
> *application/x-bzip*)
> cmd="bunzip2 -f $file" ;;
> *)
>
Hm, which zip files exactly?
This should be reported to bsdtar developers, shouldn't it?
> This one I have, since bsdtar outputs tons, and tons of error/warning
> messages, about something that it cannot handle attributes. Highly annoying.
>
> @@ -858,7 +876,7 @@
>
> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
>
> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
> + if ! bsdtar -czf "$pkg_file" $comp_files $(ls) 2>/dev/null ; then
> error "$(gettext "Failed to create package file.")"
> exit 1 # TODO: error code
> fi
>
Same comment as above, on which tarballs do bsdtar produce errors or
warnings?
>
> BUG: Pacman fails to work properly with --asroot, and when it recalls itself,
> on some particular packages.
>
> @@ -1425,6 +1454,7 @@
> rm -rf "$pkgdir"
> fi
> mkdir -p "$pkgdir"
> + cd "$startdir"
>
> if [ $EUID -eq 0 ]; then
> # if we are root, then we don't need to recall makepkg with fakeroot
> @@ -1439,7 +1469,6 @@
> create_package
> else
> msg "$(gettext "Entering fakeroot environment...")"
> - cd "$startdir"
>
> if [ "$newpkgver" != "" ]; then
> fakeroot -- $0 --forcever $newpkgver -F $ARGLIST || exit $?
>
Well, I am not familiar with makepkg, so I don't know what's wrong here,
but your change looks safe enough.
Maybe it's just an overlook since that --asroot option is probably not
widely used.
>
> This is just a nice "feature" patch, so that you know what is going on when
> you use -b.
> @@ -969,7 +987,7 @@
> install_package() {
> [ "$INSTALL" = "0" ]&& return
>
> - msg "$(gettext "Installing package with pacman -U...")"
> + msg "$(gettext "Installing package ${pkgname} with pacman -U...")"
> if [ "$ASROOT" = "0" ]; then
> sudo pacman $PACMAN_OPTS -U
> $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} || exit $?
> else
>
That looks alright too, but it comes too late since pacman 3.1 is in
string freeze for a while now, and will be released soon.
Anyway, thanks for sharing your patches.
More information about the pacman-dev
mailing list