From 8186dc11a90dbc310acaad7ee867ee995adbd6ed Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Sun, 13 Jan 2008 11:08:59 +0100 Subject: Ensure correct dir permissions in the database. Fix for FS#9176. A previous commit (6e8daa553bbd5) already forced all database files to 644. Now the directories are also forced to 755. Additionally, repo-add now sets the umask to 022, just like makepkg does, to fix the problem at its root. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- scripts/repo-add.sh.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 98191b62..c7aa11a2 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 -- cgit v1.2.3-24-g4f1b From 916e226b7839e38d9245ecbef396eb5ba5b6a224 Mon Sep 17 00:00:00 2001 From: Scott Horowitz Date: Sun, 13 Jan 2008 17:39:06 -0600 Subject: makepkg: Introduce --holdver option to prevent bumped pkgrel This allows us to keep the --forcever option internal to makepkg. Fixes FS#9194. Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 45b625d4..9cb12194 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 -- cgit v1.2.3-24-g4f1b From ffff09412627f991e2d1f0bdfdf7ca13f3d589c0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Jan 2008 19:15:59 -0600 Subject: makepkg: Oops! Lost the colon after forcever in opts parsing I screwed this up here: 916e226b7839e38d9245ecbef396eb5ba5b6a224 Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 9cb12194..219e2d17 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1122,7 +1122,7 @@ 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,forcever,geninteg,help,holdver" +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" -- cgit v1.2.3-24-g4f1b From fd86c62db856cea7cdd8edac2e721543dd1ebf04 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Jan 2008 23:26:31 -0600 Subject: Fix typos in code comments Signed-off-by: Dan McGee --- scripts/repo-add.sh.in | 8 ++++---- scripts/repo-remove.sh.in | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index c7aa11a2..c37a12fa 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -80,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 @@ -141,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=" " @@ -288,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 @@ -318,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 -- cgit v1.2.3-24-g4f1b