index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | contrib/bash_completion.in | 2 | ||||
-rw-r--r-- | contrib/zsh_completion.in | 1 | ||||
-rw-r--r-- | doc/makepkg.8.txt | 3 | ||||
-rw-r--r-- | lib/libalpm/alpm.h | 7 | ||||
-rw-r--r-- | lib/libalpm/conflict.c | 8 | ||||
-rw-r--r-- | scripts/makepkg.sh.in | 24 | ||||
-rw-r--r-- | src/pacman/callback.c | 14 | ||||
-rw-r--r-- | test/pacman/pmpkg.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/ignore005.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/sync140.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/sync141.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/unresolvable001.py | 2 | ||||
-rw-r--r-- | test/pacman/tests/upgrade090.py | 2 | ||||
-rw-r--r-- | test/pacman/util.py | 2 | ||||
-rwxr-xr-x | test/scripts/parseopts_test.sh | 2 |
diff --git a/contrib/bash_completion.in b/contrib/bash_completion.in index 28981ae4..519aa6dc 100644 --- a/contrib/bash_completion.in +++ b/contrib/bash_completion.in @@ -77,7 +77,7 @@ _makepkg() { if [[ $cur = -* && ! $prev =~ ^-(-(config|help)$|\w*[Chp]) ]]; then opts=('allsource asdeps asroot check clean config force geninteg help holdver ignorearch install key log needed nobuild nocheck nocolor noconfirm nodeps noextract - noprogressbar nosign pkg repackage rmdeps sign skipchecksums skipinteg + noprepare noprogressbar nosign pkg repackage rmdeps sign skipchecksums skipinteg skippgpcheck source syncdeps verifysource version' 'A L R S c d e f g h i m o p r s') _arch_ptr2comp opts diff --git a/contrib/zsh_completion.in b/contrib/zsh_completion.in index c150144c..67aa40a7 100644 --- a/contrib/zsh_completion.in +++ b/contrib/zsh_completion.in @@ -589,6 +589,7 @@ _makepkg_longopts=( '--holdver[Prevent automatic version bumping for development PKGBUILDs]' '--key[Specify key to use for gpg signing instead of the default]: :_keys' '--nocheck[Do not run the check() function in the PKGBUILD]' + '--noprepare[Do not run the prepare() function in the PKGBUILD]' '--nosign[Do not create a signature for the package]' '--pkg[Only build listed packages from a split package]' '--sign[Sign the resulting package with gpg]' diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index bb7a9a3f..a10242d2 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -165,6 +165,9 @@ Options *\--nocheck*:: Do not run the check() function in the PKGBUILD or handle the checkdepends. +*\--noprepare*:: + Do not run the prepare() function in the PKGBUILD. + *\--sign*:: Sign the resulting package with gpg, overriding the setting in linkman:makepkg.conf[5]. diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index ccbdd1c6..2277a69c 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -405,10 +405,9 @@ typedef enum _alpm_question_t { ALPM_QUESTION_REPLACE_PKG = (1 << 1), ALPM_QUESTION_CONFLICT_PKG = (1 << 2), ALPM_QUESTION_CORRUPTED_PKG = (1 << 3), - ALPM_QUESTION_LOCAL_NEWER = (1 << 4), - ALPM_QUESTION_REMOVE_PKGS = (1 << 5), - ALPM_QUESTION_SELECT_PROVIDER = (1 << 6), - ALPM_QUESTION_IMPORT_KEY = (1 << 7) + ALPM_QUESTION_REMOVE_PKGS = (1 << 4), + ALPM_QUESTION_SELECT_PROVIDER = (1 << 5), + ALPM_QUESTION_IMPORT_KEY = (1 << 6) } alpm_question_t; /** Question callback */ diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 18e29a89..041a04ef 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -556,11 +556,13 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, /* Look at all the targets to see if file has changed hands */ for(k = upgrade; k && !resolved_conflict; k = k->next) { - alpm_pkg_t *p2 = k->data; - if(!p2 || strcmp(p1->name, p2->name) == 0) { + alpm_pkg_t *localp2, *p2 = k->data; + if(!p2 || p1 == p2) { + /* skip p1; both p1 and p2 come directly from the upgrade list + * so they can be compared directly */ continue; } - alpm_pkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); + localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); /* localp2->files will be removed (target conflicts are handled by CHECK 1) */ _alpm_filelist_resolve(handle, alpm_pkg_get_files(localp2)); diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 75ddfe54..b85b87e5 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2506,6 +2506,7 @@ usage() { printf -- "$(gettext " --holdver Do not update VCS sources")\n" printf -- "$(gettext " --key <key> Specify a key to use for %s signing instead of the default")\n" "gpg" printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" + printf -- "$(gettext " --noprepare Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT" printf -- "$(gettext " --nosign Do not create a signature for the package")\n" printf -- "$(gettext " --pkg <list> Only build listed packages from a split package")\n" printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" @@ -2548,7 +2549,7 @@ ARGLIST=("$@") OPT_SHORT="AcdefFghiLmop:rRsSV" OPT_LONG=('allsource' 'asroot' 'check' 'clean' 'config:' 'force' 'geninteg' 'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'nobuild' 'nocolor' - 'nocheck' 'nodeps' 'noextract' 'nosign' 'pkg:' 'repackage' 'rmdeps' + 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage' 'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps' 'verifysource' 'version') @@ -2587,6 +2588,7 @@ while true; do -L|--log) LOGGING=1 ;; -m|--nocolor) USE_COLOR='n' ;; --nocheck) RUN_CHECK='n' ;; + --noprepare) RUN_PREPARE='n' ;; --nosign) SIGNPKG='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; @@ -2663,12 +2665,12 @@ if [[ -t 2 && ! $USE_COLOR = "n" ]] && check_buildenv "color" "y"; then RED="${BOLD}$(tput setaf 1)" YELLOW="${BOLD}$(tput setaf 3)" else - ALL_OFF="\e[1;0m" - BOLD="\e[1;1m" - BLUE="${BOLD}\e[1;34m" - GREEN="${BOLD}\e[1;32m" - RED="${BOLD}\e[1;31m" - YELLOW="${BOLD}\e[1;33m" + ALL_OFF="\e[0m" + BOLD="\e[1m" + BLUE="${BOLD}\e[34m" + GREEN="${BOLD}\e[32m" + RED="${BOLD}\e[31m" + YELLOW="${BOLD}\e[33m" fi fi readonly ALL_OFF BOLD BLUE GREEN RED YELLOW @@ -2767,8 +2769,7 @@ if [[ ! -f $BUILDFILE ]]; then source_safe "$BUILDFILE" fi else - crlftest=$(file "$BUILDFILE" | grep -F 'CRLF' || true) - if [[ -n $crlftest ]]; then + if [[ $(<"$BUILDFILE") = *$'\r'* ]]; then error "$(gettext "%s contains %s characters and cannot be sourced.")" "$BUILDFILE" "CRLF" exit 1 fi @@ -2820,7 +2821,10 @@ fi # test for available PKGBUILD functions if declare -f prepare >/dev/null; then - PREPAREFUNC=1 + # "Hide" prepare() function if not going to be run + if [[ $RUN_PREPARE != "n" ]]; then + PREPAREFUNC=1 + fi fi if declare -f build >/dev/null; then BUILDFUNC=1 diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 12c80d36..c57ef34a 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -309,6 +309,11 @@ void cb_question(alpm_question_t event, void *data1, void *data2, void *data3, int *response) { if(config->print) { + if(event == ALPM_QUESTION_INSTALL_IGNOREPKG) { + *response = 1; + } else { + *response = 0; + } return; } switch(event) { @@ -377,15 +382,6 @@ void cb_question(alpm_question_t event, void *data1, void *data2, *response = select_question(count); } break; - case ALPM_QUESTION_LOCAL_NEWER: - if(!config->op_s_downloadonly) { - *response = yesno(_("%s-%s: local version is newer. Upgrade anyway?"), - alpm_pkg_get_name(data1), - alpm_pkg_get_version(data1)); - } else { - *response = 1; - } - break; case ALPM_QUESTION_CORRUPTED_PKG: *response = yesno(_("File %s is corrupted (%s).\n" "Do you want to delete it?"), diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py index 988c73f3..9b3147a3 100644 --- a/test/pacman/pmpkg.py +++ b/test/pacman/pmpkg.py @@ -160,6 +160,8 @@ class pmpkg(object): info = tarfile.TarInfo(fileinfo["filename"]) if fileinfo["hasperms"]: info.mode = fileinfo["perms"] + elif fileinfo["isdir"]: + info.mode = 0755 if fileinfo["isdir"]: info.type = tarfile.DIRTYPE tar.addfile(info) diff --git a/test/pacman/tests/ignore005.py b/test/pacman/tests/ignore005.py index 274e44c3..51bcba39 100644 --- a/test/pacman/tests/ignore005.py +++ b/test/pacman/tests/ignore005.py @@ -36,7 +36,7 @@ self.addpkg2db("sync", packageA5up) self.option["IgnorePkg"] = ["packageA3"] -self.args = "-S packageA1 packageA2 --ask=32" +self.args = "-S packageA1 packageA2 --ask=16" self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=packageA1|1.0-1") diff --git a/test/pacman/tests/sync140.py b/test/pacman/tests/sync140.py index ce21cc33..fbe750f2 100644 --- a/test/pacman/tests/sync140.py +++ b/test/pacman/tests/sync140.py @@ -18,7 +18,7 @@ sp3.depends = ["gcc-libs"] for p in sp1, sp2, sp3: self.addpkg2db("sync", p) -self.args = "-Su --ignore %s --ask=32" % sp1.name +self.args = "-Su --ignore %s --ask=16" % sp1.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=glibc|1.0-1") diff --git a/test/pacman/tests/sync141.py b/test/pacman/tests/sync141.py index f2f01364..02f7be81 100644 --- a/test/pacman/tests/sync141.py +++ b/test/pacman/tests/sync141.py @@ -18,7 +18,7 @@ sp3.depends = ["b_gcc-libs"] for p in sp1, sp2, sp3: self.addpkg2db("sync", p) -self.args = "-Su --ignore %s --ask=32" % sp1.name +self.args = "-Su --ignore %s --ask=16" % sp1.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_VERSION=c_glibc|1.0-1") diff --git a/test/pacman/tests/unresolvable001.py b/test/pacman/tests/unresolvable001.py index 9d54c3e5..4e5da6f3 100644 --- a/test/pacman/tests/unresolvable001.py +++ b/test/pacman/tests/unresolvable001.py @@ -11,7 +11,7 @@ packageA2up = pmpkg("package") packageA2up.depends = ["dep"]; self.addpkg2db("sync", packageA2up) -self.args = "-S package dep --ask=32" +self.args = "-S package dep --ask=16" self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=package") diff --git a/test/pacman/tests/upgrade090.py b/test/pacman/tests/upgrade090.py index 26e531c9..cdd4cace 100644 --- a/test/pacman/tests/upgrade090.py +++ b/test/pacman/tests/upgrade090.py @@ -16,7 +16,7 @@ sp = pmpkg("dep") sp.files = ["bin/dep"] self.addpkg2db("sync", sp) -self.args = "-U %s --ask=32" % " ".join([p.filename() for p in p1, p2, p3]) +self.args = "-U %s --ask=16" % " ".join([p.filename() for p in p1, p2, p3]) self.addrule("PACMAN_RETCODE=0") for p in p1, p2, sp: diff --git a/test/pacman/util.py b/test/pacman/util.py index be99cd57..65540ed3 100644 --- a/test/pacman/util.py +++ b/test/pacman/util.py @@ -100,7 +100,7 @@ def mkfile(base, name, data=""): def writedata(filename, data): if isinstance(data, list): data = "\n".join(data) - fd = file(filename, "w") + fd = open(filename, "w") if data: fd.write(data) if data[-1] != "\n": diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh index 2862caec..b7e5d08a 100755 --- a/test/scripts/parseopts_test.sh +++ b/test/scripts/parseopts_test.sh @@ -18,7 +18,7 @@ fi OPT_SHORT="AcdefFghiLmop:rRsV" OPT_LONG=('allsource' 'asroot' 'ignorearch' 'check' 'clean:' 'cleanall' 'nodeps' 'noextract' 'force' 'forcever:' 'geninteg' 'help' 'holdver' - 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'nosign' 'pkg:' 'rmdeps' + 'install' 'key:' 'log' 'nocolor' 'nobuild' 'nocheck' 'noprepare' 'nosign' 'pkg:' 'rmdeps' 'repackage' 'skipinteg' 'sign' 'source' 'syncdeps' 'version' 'config:' 'noconfirm' 'noprogressbar') |