summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-01-15 05:58:44 +0100
committerDan McGee <dan@archlinux.org>2008-01-15 05:58:44 +0100
commit38e981fab3f901e6c932e2f2913790ef0b96c6c2 (patch)
tree1dcf8610529b51626780b3666455f72858361828 /scripts
parent521de7ceedc6e4f5df52c0380f536a6f13a7f578 (diff)
parenta0ac72b42219fbcf17dd7cf2ee992b71a6a1375a (diff)
downloadpacman-38e981fab3f901e6c932e2f2913790ef0b96c6c2.tar.gz
pacman-38e981fab3f901e6c932e2f2913790ef0b96c6c2.tar.xz
Merge branch 'maint'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in32
-rw-r--r--scripts/repo-add.sh.in11
-rw-r--r--scripts/repo-remove.sh.in4
3 files changed, 33 insertions, 14 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 45b625d4..219e2d17 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -57,6 +57,7 @@ REPKG=0
LOGGING=0
SOURCEONLY=0
IGNOREARCH=0
+HOLDVER=0
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
# when dealing with svn/cvs/etc PKGBUILDs.
@@ -979,6 +980,10 @@ install_package() {
devel_check() {
newpkgver=""
+ # Only update pkgver if --holdver is not set
+ if [ "$HOLDVER" = "1" ]; then
+ return
+ fi
if [ "$FORCE_VER" = "" ]; then
# Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so.
# This will only be used on the first call to makepkg; subsequent
@@ -1069,6 +1074,7 @@ usage() {
echo "$(gettext " -R, --repackage Repackage contents of pkg/ without building")"
echo "$(gettext " -s, --syncdeps Install missing dependencies with pacman")"
echo "$(gettext " --asroot Allow makepkg to run as root user")"
+ echo "$(gettext " --holdver Prevent automatic version bumping for development PKGBUILDs")"
echo "$(gettext " --source Do not build package; generate a source-only tarball")"
echo
echo "$(gettext "These options can be passed to pacman:")"
@@ -1116,8 +1122,8 @@ SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined
# Parse Command Line Options.
OPT_SHORT="AbcCdefFghiLmop:rRsSV"
-OPT_LONG="ignorearch,asroot,builddeps,clean,cleancache,nodeps,noextract,force,geninteg,help,install,log"
-OPT_LONG="$OPT_LONG,nocolor,nobuild,rmdeps,repackage,source,syncdeps,usesudo,version,forcever:"
+OPT_LONG="ignorearch,asroot,builddeps,clean,cleancache,nodeps,noextract,force,forcever:,geninteg,help,holdver"
+OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,source,syncdeps,usesudo,version"
# Pacman Options
OPT_LONG="$OPT_LONG,noconfirm,noprogressbar"
OPT_TEMP="$(getopt -o "$OPT_SHORT" -l "$OPT_LONG" -n "$(basename "$0")" -- "$@" || echo 'GETOPT GO BANG!')"
@@ -1143,8 +1149,11 @@ while true; do
-d|--nodeps) NODEPS=1 ;;
-e|--noextract) NOEXTRACT=1 ;;
-f|--force) FORCE=1 ;;
+ #hidden opt used by fakeroot call for svn/cvs/etc PKGBUILDs to set pkgver
+ --forcever) shift; FORCE_VER=$1;;
-F) INFAKEROOT=1 ;;
-g|--geninteg) GENINTEG=1 ;;
+ --holdver) HOLDVER=1 ;;
-i|--install) INSTALL=1 ;;
-L|--log) LOGGING=1 ;;
-m|--nocolor) USE_COLOR='n' ;;
@@ -1155,9 +1164,6 @@ while true; do
--source) SOURCEONLY=1 ;;
-s|--syncdeps) DEP_BIN=1 ;;
- # Hidden option used by fakeroot call for svn/cvs/etc PKGBUILDs to set the pkgver
- --forcever) shift; FORCE_VER=$1;;
-
# BEGIN DEPRECATED
-S|--usesudo)
warning "$(gettext "Sudo is used by default now. The --usesudo option is deprecated!")" ;;
@@ -1172,6 +1178,13 @@ while true; do
shift
done
+if [ "$HOLDVER" = "1" -a "$FORCE_VER" != "" ]; then
+ # The extra '--' is here to prevent gettext from thinking --holdver is
+ # an option
+ error "$(gettext -- "--holdver and --forcever cannot both be specified")"
+ exit 1
+fi
+
if [ "$CLEANCACHE" = "1" ]; then
#fix flyspray feature request #5223
if [ -n "$SRCDEST" -a "$SRCDEST" != "$startdir" ]; then
@@ -1311,11 +1324,15 @@ if [ "$install" -a ! -f "$install" ]; then
exit 1
fi
+# We need to run devel_update regardless of whether we are in the fakeroot
+# build process so that if the user runs makepkg --forcever manually, we
+# 1) output the correct pkgver, and 2) use the correct filename when
+# checking if the package file already exists - fixes FS #9194
devel_check
+devel_update
if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
- -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" \
- -a "$FORCE_VER" = "" ]; then
+ -a "$FORCE" = "0" -a "$GENINTEG" = "0" -a "$SOURCEONLY" = "0" ]; then
if [ "$INSTALL" = "1" ]; then
warning "$(gettext "A package has already been built, installing existing package...")"
install_package
@@ -1332,7 +1349,6 @@ if [ "$INFAKEROOT" = "1" ]; then
if [ "$REPKG" = "1" ]; then
warning "$(gettext "Skipping build.")"
else
- devel_update
run_build
tidy_install
fi
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 98191b62..c37a12fa 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -28,6 +28,9 @@ confdir='@sysconfdir@'
FORCE=0
REPO_DB_FILE=""
+# ensure we have a sane umask set
+umask 0022
+
msg() {
local mesg=$1; shift
printf "==> ${mesg}\n" "$@" >&1
@@ -77,7 +80,7 @@ test_repo_db_file () {
return 0 # YES
fi
else
- return 0 # YES - No database file is also aloud.
+ return 0 # YES - No database file is also allowed
fi
return 1 # NO
@@ -138,7 +141,7 @@ db_write_entry()
startdir
local OLDIFS="$IFS"
- # IFS (field seperator) is only the newline character
+ # IFS (field separator) is only the newline character
IFS="
"
@@ -285,7 +288,7 @@ gstmpdir=$(mktemp -d /tmp/repo-add.XXXXXXXXXX) || (\
exit 1)
success=0
-# parse arguements
+# parse arguments
for arg in "$@"; do
if [ "$arg" == "--force" -o "$arg" == "-f" ]; then
FORCE=1
@@ -315,7 +318,7 @@ for arg in "$@"; do
fi
done
-# if all operations were a success, rezip database
+# if all operations were a success, re-zip database
if [ $success -eq 1 ]; then
msg "$(gettext "Creating updated database file %s")" "$REPO_DB_FILE"
pushd "$gstmpdir" 2>&1 >/dev/null
diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
index 6335c00f..05bec390 100644
--- a/scripts/repo-remove.sh.in
+++ b/scripts/repo-remove.sh.in
@@ -132,7 +132,7 @@ gstmpdir=$(mktemp -d /tmp/repo-remove.XXXXXXXXXX) || (\
exit 1)
success=0
-# parse arguements
+# parse arguments
for arg in "$@"; do
if [ -z "$REPO_DB_FILE" ]; then
REPO_DB_FILE=$(readlink -f "$arg")
@@ -154,7 +154,7 @@ for arg in "$@"; do
fi
done
-# if all operations were a success, rezip database
+# if all operations were a success, re-zip database
if [ $success -eq 1 ]; then
msg "$(gettext "Creating updated database file '%s'...")" "$REPO_DB_FILE"
pushd "$gstmpdir" 2>&1 >/dev/null