Compare commits

...

6 Commits

Author SHA1 Message Date
Pierre Schmitz
c2d9a0e7b1 Set correct pacman.conf
Commit ee4edefa2f reverted too much and left pacman.conf unset
2012-01-18 16:56:41 +01:00
Pierre Schmitz
ee4edefa2f Remove any pacman 4 related workarounds 2012-01-18 11:24:07 +01:00
Allan McRae
a8b64995ee makechrootpkg: fix error message
Passing a directory that does not exist to makechrootpkg results in
an error message:

==> ERROR: No chroot dir defined, or invalid path ''

The path is not being printed as the readlink command blanks it if
the directory does not exist. Fix this.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Jan Alexander Steffens (heftig)
2c9855fe6b Fix up usage help, the Default line belongs to -l
Signed-off-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Florian Pritz
4d4ffb5d8f find-libdeps: fix syntax error
The problem has been introduced in commit
56d4dec19f

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:52 +01:00
Dave Reisner
2d79191c97 commitpkg: behavior more sanely in searching for built pkgs
In the case of a .pkg.tar.xz and a .pkg.tar.gz existing in the same
directory, all commitpkg would say is:

  ==> WARNING: Could not find . Skipping x86_64

Upon digging into the logic, we did a few things poorly, mostly in
getpkgfile:

- getpkgfile tried to die in a subshell (within the command substituion
  assignment to 'pkgfile'). This will never work.
- We assumed that proper glob expansion happened when we received
  exactly 1 arg. This isn't necessarily true without nullglob in effect.
- We dumped the real error (spewed by getpkgfile) to /dev/null.
- We checked for the package twice in both $PWD and $DESTDIR/.
- We checked for file existance multiple times.

Address this by:

- not hiding errors. revamp the wording a little bit to make it more
  obvious why we failed, particularly in the case of a glob expanding to
  more than 1 file. Logic here is simplified to pointing out the failure
  cases of 0 and >1.
- setting nullglob so the number of arguments passed into getpkgfile is
  meaningful from a 'did it decisively resolve' point of view.
- not trying to exit the entire script from a subshell. Just return a
  value (and use it).
- avoiding the package file existance check afterwards. this is a
  freebie from getpkgfile when the glob passed fails to expand.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:51 +01:00
13 changed files with 34 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
V=20120114 V=20120119
PREFIX = /usr/local PREFIX = /usr/local

View File

@@ -2,8 +2,7 @@
m4_include(lib/common.sh) m4_include(lib/common.sh)
# FIXME: temporary added curl until pacman 4.0 moves to [core] base_packages=(base base-devel sudo)
base_packages=(base base-devel sudo curl)
cmd="${0##*/}" cmd="${0##*/}"
if [[ "${cmd%%-*}" == 'multilib' ]]; then if [[ "${cmd%%-*}" == 'multilib' ]]; then
@@ -53,27 +52,13 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
done done
exec 9>&- exec 9>&-
# FIXME: temporary workaround until pacman 4.0 moves to [core]
if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then
pacman_conf=$(mktemp)
cp "@pkgdatadir@/pacman-${repo}.conf" "${pacman_conf}"
sed -r 's/^#(SigLevel = Never)/\1/' -i "${pacman_conf}"
else
pacman_conf="@pkgdatadir@/pacman-${repo}.conf"
fi
rm -rf "${chroots}/${repo}-${arch}" rm -rf "${chroots}/${repo}-${arch}"
mkdir -p "${chroots}/${repo}-${arch}" mkdir -p "${chroots}/${repo}-${arch}"
setarch "${arch}" mkarchroot \ setarch "${arch}" mkarchroot \
-C "${pacman_conf}" \ -C "@pkgdatadir@/pacman-${repo}.conf" \
-M "@pkgdatadir@/makepkg-${arch}.conf" \ -M "@pkgdatadir@/makepkg-${arch}.conf" \
"${chroots}/${repo}-${arch}/root" \ "${chroots}/${repo}-${arch}/root" \
"${base_packages[@]}" "${base_packages[@]}"
# FIXME: temporary workaround until pacman 4.0 moves to [core]
if pacman -V | grep -q 'v4.' && ( [[ "$repo" == 'extra' || "$repo" == 'multilib' ]] ); then
cp "@pkgdatadir@/pacman-${repo}.conf" "${chroots}/${repo}-${arch}/root/etc/pacman.conf"
fi
else else
setarch ${arch} mkarchroot \ setarch ${arch} mkarchroot \
-u \ -u \

View File

@@ -3,13 +3,19 @@
m4_include(lib/common.sh) m4_include(lib/common.sh)
getpkgfile() { getpkgfile() {
if [[ ${#} -ne 1 ]]; then case $# in
die 'No canonical package found!' 0)
elif [[ ! -f $1 ]]; then error 'No canonical package found!'
die "Package ${1} not found!" return 1
fi ;;
[!1])
error 'Failed to canonicalize package name -- multiple packages found:'
msg2 '%s' "$@"
return 1
;;
esac
echo ${1} echo "$1"
} }
# Source makepkg.conf; fail if it is not found # Source makepkg.conf; fail if it is not found
@@ -127,15 +133,10 @@ for _arch in ${arch[@]}; do
for _pkgname in ${pkgname[@]}; do for _pkgname in ${pkgname[@]}; do
fullver=$(get_full_version $_pkgname) fullver=$(get_full_version $_pkgname)
pkgfile=$(getpkgfile "$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$fullver-${_arch}".pkg.tar.?z 2>/dev/null)
if [[ -f $pkgfile ]]; then if ! pkgfile=$(shopt -s nullglob;
pkgfile="./$pkgfile" getpkgfile "${DESTDIR+$DESTDIR/}$_pkgname-$fullver-${_arch}".pkg.tar.?z); then
elif [[ -f $pkgdestfile ]]; then warning "Skipping $_pkgname-$fullver-$_arch: failed to locate package file"
pkgfile="$pkgdestfile"
else
warning "Could not find ${pkgfile}. Skipping ${_arch}"
skip_arches+=($_arch) skip_arches+=($_arch)
continue 2 continue 2
fi fi

View File

@@ -73,7 +73,7 @@ find . -type f $find_args | while read filename; do
if [[ $script_mode = "provides" ]]; then if [[ $script_mode = "provides" ]]; then
# get the string binaries link to: libfoo.so.1.2 -> libfoo.so.1 # get the string binaries link to: libfoo.so.1.2 -> libfoo.so.1
sofile=$(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p') sofile=$(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
[[ -z $sofile" ]] && sofile="${filename##*/}" [[ -z $sofile ]] && sofile="${filename##*/}"
process_sofile process_sofile
elif [[ $script_mode = "deps" ]]; then elif [[ $script_mode = "deps" ]]; then
# process all libraries needed by the binary # process all libraries needed by the binary

View File

@@ -20,6 +20,7 @@ install_pkg=
add_to_db=false add_to_db=false
run_namcap=false run_namcap=false
chrootdir= chrootdir=
passeddir=
default_copy=$USER default_copy=$USER
[[ -n $SUDO_USER ]] && default_copy=$SUDO_USER [[ -n $SUDO_USER ]] && default_copy=$SUDO_USER
@@ -52,8 +53,8 @@ usage() {
echo '-I <pkg> Install a package into the working copy of the chroot' echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot' echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintaining multiple copies.' echo ' Useful for maintaining multiple copies.'
echo '-n Run namcap on the package'
echo " Default: $default_copy" echo " Default: $default_copy"
echo '-n Run namcap on the package'
exit 1 exit 1
} }
@@ -63,7 +64,7 @@ while getopts 'hcudr:I:l:n' arg; do
c) clean_first=true ;; c) clean_first=true ;;
u) update_first=true ;; u) update_first=true ;;
d) add_to_db=true ;; d) add_to_db=true ;;
r) chrootdir="$OPTARG" ;; r) passeddir="$OPTARG" ;;
I) install_pkg="$OPTARG" ;; I) install_pkg="$OPTARG" ;;
l) copy="$OPTARG" ;; l) copy="$OPTARG" ;;
n) run_namcap=true ;; n) run_namcap=true ;;
@@ -72,7 +73,7 @@ while getopts 'hcudr:I:l:n' arg; do
done done
# Canonicalize chrootdir, getting rid of trailing / # Canonicalize chrootdir, getting rid of trailing /
chrootdir=$(readlink -e "$chrootdir") chrootdir=$(readlink -e "$passeddir")
if [[ ${copy:0:1} = / ]]; then if [[ ${copy:0:1} = / ]]; then
copydir=$copy copydir=$copy
@@ -101,7 +102,7 @@ if [[ ! -f PKGBUILD && -z $install_pkg ]]; then
fi fi
if [[ ! -d $chrootdir ]]; then if [[ ! -d $chrootdir ]]; then
die "No chroot dir defined, or invalid path '$chrootdir'" die "No chroot dir defined, or invalid path '$passeddir'"
fi fi
if [[ ! -d $chrootdir/root ]]; then if [[ ! -d $chrootdir/root ]]; then

View File

@@ -47,8 +47,8 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
#SigLevel = Never SigLevel = Never
# #
# REPOSITORIES # REPOSITORIES

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #

View File

@@ -47,8 +47,8 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
#SigLevel = Never SigLevel = Never
# #
# REPOSITORIES # REPOSITORIES

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #

View File

@@ -47,7 +47,7 @@ Architecture = auto
# the following line. This will treat any key imported into pacman's keyring as # the following line. This will treat any key imported into pacman's keyring as
# trusted. # trusted.
#SigLevel = Optional TrustAll #SigLevel = Optional TrustAll
# Disable signature checks for now # For now, off by default unless you read the above.
SigLevel = Never SigLevel = Never
# #