From f20e043dae4e8a465855d7a861c50e6fb28c303e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 28 Jun 2011 21:58:15 -0500 Subject: db-move: remove one svn commit per package Precondition: trunk/ directory never has any subdirectories. This is true across our entire svn-packages repository, although I did not check svn-community. The following command was used: find -mindepth 3 -type d ! -wholename '*/.svn*' -wholename *trunk* This should really help a variety of things- reduce the number of commits, reduce the number of emails to arch-commits, make mass package moves faster, etc. The entire dbscripts test suite still passes after this change. Signed-off-by: Dan McGee Signed-off-by: Pierre Schmitz --- db-move | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/db-move b/db-move index ff1b0e2..e3467e8 100755 --- a/db-move +++ b/db-move @@ -78,11 +78,18 @@ for pkgbase in ${args[@]:2}; do pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) if [ -d "${svnrepo_to}" ]; then - /usr/bin/svn rm --force -q "${svnrepo_to}" - /usr/bin/svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "$(basename $0): ${pkgbase} removed by $(id -un) for move to [${repo_to}] (${pkgarch})" + for file in $(svn ls "${svnrepo_to}"); do + svn rm -q "$file" + done + else + mkdir "${svnrepo_to}" + svn add "${svnrepo_to}" fi - /usr/bin/svn mv -q -r HEAD "${svnrepo_from}" "${svnrepo_to}" + for file in $(svn ls "${svnrepo_from}"); do + svn mv -q -r HEAD "${svnrepo_from}/$file" "${svnrepo_to}/" + done + /usr/bin/svn rm --force -q "${svnrepo_from}" /usr/bin/svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "$(basename $0): moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${pkgarch})" for pkgname in ${pkgnames[@]}; do -- cgit v1.1-4-g5e80 From 6ed5818a34a3761d86ec35c59fd7cf33c596246d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 13 Aug 2011 21:32:24 +0200 Subject: db-move: Fix svn rm call --- db-move | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db-move b/db-move index e3467e8..019faa2 100755 --- a/db-move +++ b/db-move @@ -78,16 +78,16 @@ for pkgbase in ${args[@]:2}; do pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) if [ -d "${svnrepo_to}" ]; then - for file in $(svn ls "${svnrepo_to}"); do - svn rm -q "$file" + for file in $(/usr/bin/svn ls "${svnrepo_to}"); do + /usr/bin/svn rm -q "${svnrepo_to}/$file" done else mkdir "${svnrepo_to}" - svn add "${svnrepo_to}" + /usr/bin/svn add -q "${svnrepo_to}" fi for file in $(svn ls "${svnrepo_from}"); do - svn mv -q -r HEAD "${svnrepo_from}/$file" "${svnrepo_to}/" + /usr/bin/svn mv -q -r HEAD "${svnrepo_from}/$file" "${svnrepo_to}/" done /usr/bin/svn rm --force -q "${svnrepo_from}" /usr/bin/svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "$(basename $0): moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${pkgarch})" -- cgit v1.1-4-g5e80 From e04b5f6583acdec920407cdd4455f54452367382 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 13 Aug 2011 21:41:30 +0200 Subject: update shunit to 2.1.6 --- test/lib/shunit2 | 882 +++++++++++++++++++++++++------------------------------ 1 file changed, 407 insertions(+), 475 deletions(-) mode change 100644 => 100755 test/lib/shunit2 diff --git a/test/lib/shunit2 b/test/lib/shunit2 old mode 100644 new mode 100755 index d900a70..8862ffd --- a/test/lib/shunit2 +++ b/test/lib/shunit2 @@ -1,44 +1,43 @@ -# $Id: shunit2 277 2008-10-29 21:20:22Z kate.ward@forestent.com $ +#! /bin/sh +# $Id: shunit2 335 2011-05-01 20:10:33Z kate.ward@forestent.com $ # vim:et:ft=sh:sts=2:sw=2 -# vim:foldmethod=marker:foldmarker=/**,*/ # -#/** -# -# -# -# shUnit 2.1.5 -# Shell Unit Test Framework +# Copyright 2008 Kate Ward. All Rights Reserved. +# Released under the LGPL (GNU Lesser General Public License) # -# http://shunit2.googlecode.com/ +# shUnit2 -- Unit testing framework for Unix shell scripts. +# http://code.google.com/p/shunit2/ # -# written by Kate Ward <kate.ward@forestent.com> -# released under the LGPL +# Author: kate.ward@forestent.com (Kate Ward) # -# This module implements a xUnit based unit test framework similar to JUnit. -# -#*/ +# shUnit2 is a xUnit based unit test framework for Bourne shell scripts. It is +# based on the popular JUnit unit testing framework for Java. + +# return if shunit already loaded +[ -n "${SHUNIT_VERSION:-}" ] && exit 0 -SHUNIT_VERSION='2.1.5' +SHUNIT_VERSION='2.1.6' SHUNIT_TRUE=0 SHUNIT_FALSE=1 SHUNIT_ERROR=2 +# enable strict mode by default +SHUNIT_STRICT=${SHUNIT_STRICT:-${SHUNIT_TRUE}} + _shunit_warn() { echo "shunit2:WARN $@" >&2; } _shunit_error() { echo "shunit2:ERROR $@" >&2; } -_shunit_fatal() { echo "shunit2:FATAL $@" >&2; } +_shunit_fatal() { echo "shunit2:FATAL $@" >&2; exit ${SHUNIT_ERROR}; } # specific shell checks if [ -n "${ZSH_VERSION:-}" ]; then setopt |grep "^shwordsplit$" >/dev/null if [ $? -ne ${SHUNIT_TRUE} ]; then _shunit_fatal 'zsh shwordsplit option is required for proper operation' - exit ${SHUNIT_ERROR} fi if [ -z "${SHUNIT_PARENT:-}" ]; then _shunit_fatal "zsh does not pass \$0 through properly. please declare \ \"SHUNIT_PARENT=\$0\" before calling shUnit2" - exit ${SHUNIT_ERROR} fi fi @@ -47,12 +46,14 @@ fi # __SHUNIT_ASSERT_MSG_PREFIX='ASSERT:' +__SHUNIT_MODE_SOURCED='sourced' +__SHUNIT_MODE_STANDALONE='standalone' __SHUNIT_PARENT=${SHUNIT_PARENT:-$0} # set the constants readonly shunit_constants_=`set |grep '^__SHUNIT_' |cut -d= -f1` -echo "${shunit_constants_}" |grep '^Binary file' >/dev/null \ - && shunit_constants_=`set |grep -a '^__SHUNIT_' |cut -d= -f1` +echo "${shunit_constants_}" |grep '^Binary file' >/dev/null && \ + shunit_constants_=`set |grep -a '^__SHUNIT_' |cut -d= -f1` for shunit_constant_ in ${shunit_constants_}; do shunit_ro_opts_='' case ${ZSH_VERSION:-} in @@ -65,8 +66,12 @@ done unset shunit_constant_ shunit_constants_ shunit_ro_opts_ # variables -__shunit_skip=${SHUNIT_FALSE} -__shunit_suite='' +__shunit_lineno='' # line number of executed test +__shunit_mode=${__SHUNIT_MODE_SOURCED} # operating mode +__shunit_reportGenerated=${SHUNIT_FALSE} # is report generated +__shunit_script='' # filename of unittest script (standalone mode) +__shunit_skip=${SHUNIT_FALSE} # is skipping enabled +__shunit_suite='' # suite of tests to execute # counts of tests __shunit_testSuccess=${SHUNIT_TRUE} @@ -80,9 +85,6 @@ __shunit_assertsPassed=0 __shunit_assertsFailed=0 __shunit_assertsSkipped=0 -__shunit_lineno='' -__shunit_reportGenerated=${SHUNIT_FALSE} - # macros _SHUNIT_LINENO_='eval __shunit_lineno=""; if [ "${1:-}" = "--lineno" ]; then [ -n "$2" ] && __shunit_lineno="[$2] "; shift 2; fi' @@ -90,32 +92,20 @@ _SHUNIT_LINENO_='eval __shunit_lineno=""; if [ "${1:-}" = "--lineno" ]; then [ - # assert functions # -#/** -# -# -# void -# -# -# -# -# assertEquals -# string [message] -# string expected -# string actual -# -# -# Asserts that expected and -# actual are equal to one another. The message is -# optional. -# -# -#*/ +# Assert that two values are equal to one another. +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertEquals() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then _shunit_error "assertEquals() requires two or three arguments; $# given" - _shunit_error "1: ${1:+$1} 2: ${2:+$2} 3: ${3:+$3}" + _shunit_error "1: ${1:+$1} 2: ${2:+$2} 3: ${3:+$3}${4:+ 4: $4}" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} @@ -141,26 +131,14 @@ assertEquals() } _ASSERT_EQUALS_='eval assertEquals --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertNotEquals -# string [message] -# string unexpected -# string actual -# -# -# Asserts that unexpected and -# actual are not -# equal to one another. The message is optional. -# -# -#*/ +# Assert that two values are not equal to one another. +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertNotEquals() { ${_SHUNIT_LINENO_} @@ -175,40 +153,29 @@ assertNotEquals() shunit_message_="${shunit_message_}$1" shift fi - shunit_unexpected_=$1 + shunit_expected_=$1 shunit_actual_=$2 shunit_return=${SHUNIT_TRUE} - if [ "${shunit_unexpected_}" != "${shunit_actual_}" ]; then + if [ "${shunit_expected_}" != "${shunit_actual_}" ]; then _shunit_assertPass else failSame "${shunit_message_}" "$@" shunit_return=${SHUNIT_FALSE} fi - unset shunit_message_ shunit_unexpected_ shunit_actual_ + unset shunit_message_ shunit_expected_ shunit_actual_ return ${shunit_return} } _ASSERT_NOT_EQUALS_='eval assertNotEquals --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertNull -# string [message] -# string value -# -# -# Asserts that value is null, -# or in shell terms a zero-length string. The message is optional. -# -# -#*/ +# Assert that a value is null (i.e. an empty string) +# +# Args: +# message: string: failure message [optional] +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertNull() { ${_SHUNIT_LINENO_} @@ -231,25 +198,13 @@ assertNull() } _ASSERT_NULL_='eval assertNull --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertNotNull -# string [message] -# string value -# -# -# Asserts that value is not null, or in shell terms not -# a zero-length string. The message is optional. -# -# -#*/ +# Assert that a value is not null (i.e. a non-empty string) +# +# Args: +# message: string: failure message [optional] +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertNotNull() { ${_SHUNIT_LINENO_} @@ -264,38 +219,29 @@ assertNotNull() shunit_message_="${shunit_message_}$1" shift fi - assertTrue "${shunit_message_}" "[ -n '${1:-}' ]" + shunit_actual_=`_shunit_escapeCharactersInString "${1:-}"` + test -n "${shunit_actual_}" + assertTrue "${shunit_message_}" $? shunit_return=$? - unset shunit_message_ + unset shunit_actual_ shunit_message_ return ${shunit_return} } _ASSERT_NOT_NULL_='eval assertNotNull --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertSame -# string [message] -# string expected -# string actual -# -# -# This function is functionally equivalent to -# assertEquals. -# -# -#*/ +# Assert that two values are the same (i.e. equal to one another). +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertSame() { ${_SHUNIT_LINENO_} if [ $# -lt 2 -o $# -gt 3 ]; then - _shunit_error "assertSame() requires one or two arguments; $# given" + _shunit_error "assertSame() requires two or three arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} @@ -313,26 +259,14 @@ assertSame() } _ASSERT_SAME_='eval assertSame --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertNotSame -# string [message] -# string unexpected -# string actual -# -# -# Asserts that unexpected and -# actual are not -# equal to one another. The message is optional. -# -# -#*/ +# Assert that two values are not the same (i.e. not equal to one another). +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertNotSame() { ${_SHUNIT_LINENO_} @@ -355,33 +289,27 @@ assertNotSame() } _ASSERT_NOT_SAME_='eval assertNotSame --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertTrue -# string [message] -# string condition -# -# -# Asserts that a given shell test condition is true. The message is -# optional. -# Testing whether something is true or false is easy enough by using -# the assertEquals/assertNotSame functions. Shell supports much more -# complicated tests though, and a means to support them was needed. As such, -# this function tests that conditions are true or false through evaluation -# rather than just looking for a true or false. -# -# The following test will succeed: assertTrue "[ 34 -gt 23 ]" -# The folloing test will fail with a message: assertTrue "test failed" "[ -r '/non/existant/file' ]" -# -# -# -#*/ +# Assert that a value or shell test condition is true. +# +# In shell, a value of 0 is true and a non-zero value is false. Any integer +# value passed can thereby be tested. +# +# Shell supports much more complicated tests though, and a means to support +# them was needed. As such, this function tests that conditions are true or +# false through evaluation rather than just looking for a true or false. +# +# The following test will succeed: +# assertTrue 0 +# assertTrue "[ 34 -gt 23 ]" +# The folloing test will fail with a message: +# assertTrue 123 +# assertTrue "test failed" "[ -r '/non/existant/file' ]" +# +# Args: +# message: string: failure message [optional] +# condition: string: integer value or shell conditional statement +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertTrue() { ${_SHUNIT_LINENO_} @@ -404,7 +332,8 @@ assertTrue() if [ -z "${shunit_condition_}" ]; then # null condition shunit_return=${SHUNIT_FALSE} - elif [ "${shunit_condition_}" = "${shunit_match_}" ]; then + elif [ -n "${shunit_match_}" -a "${shunit_condition_}" = "${shunit_match_}" ] + then # possible return value. treating 0 as true, and non-zero as false. [ ${shunit_condition_} -ne 0 ] && shunit_return=${SHUNIT_FALSE} else @@ -425,33 +354,27 @@ assertTrue() } _ASSERT_TRUE_='eval assertTrue --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# assertFalse -# string [message] -# string condition -# -# -# Asserts that a given shell test condition is false. The message is -# optional. -# Testing whether something is true or false is easy enough by using -# the assertEquals/assertNotSame functions. Shell supports much more -# complicated tests though, and a means to support them was needed. As such, -# this function tests that conditions are true or false through evaluation -# rather than just looking for a true or false. -# -# The following test will succeed: assertFalse "[ 'apples' = 'oranges' ]" -# The folloing test will fail with a message: assertFalse "test failed" "[ 1 -eq 1 -a 2 -eq 2 ]" -# -# -# -#*/ +# Assert that a value or shell test condition is false. +# +# In shell, a value of 0 is true and a non-zero value is false. Any integer +# value passed can thereby be tested. +# +# Shell supports much more complicated tests though, and a means to support +# them was needed. As such, this function tests that conditions are true or +# false through evaluation rather than just looking for a true or false. +# +# The following test will succeed: +# assertFalse 1 +# assertFalse "[ 'apples' = 'oranges' ]" +# The folloing test will fail with a message: +# assertFalse 0 +# assertFalse "test failed" "[ 1 -eq 1 -a 2 -eq 2 ]" +# +# Args: +# message: string: failure message [optional] +# condition: string: integer value or shell conditional statement +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) assertFalse() { ${_SHUNIT_LINENO_} @@ -474,7 +397,8 @@ assertFalse() if [ -z "${shunit_condition_}" ]; then # null condition shunit_return=${SHUNIT_FALSE} - elif [ "${shunit_condition_}" = "${shunit_match_}" ]; then + elif [ -n "${shunit_match_}" -a "${shunit_condition_}" = "${shunit_match_}" ] + then # possible return value. treating 0 as true, and non-zero as false. [ ${shunit_condition_} -eq 0 ] && shunit_return=${SHUNIT_FALSE} else @@ -499,27 +423,17 @@ _ASSERT_FALSE_='eval assertFalse --lineno "${LINENO:-}"' # failure functions # -#/** -# -# -# void -# -# -# -# -# fail -# string [message] -# -# -# Fails the test immediately, with the optional message. -# -# -#*/ +# Records a test failure. +# +# Args: +# message: string: failure message [optional] +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) fail() { ${_SHUNIT_LINENO_} if [ $# -gt 1 ]; then - _shunit_error "fail() requires one or two arguments; $# given" + _shunit_error "fail() requires zero or one arguments; $# given" return ${SHUNIT_ERROR} fi _shunit_shouldSkip && return ${SHUNIT_TRUE} @@ -537,26 +451,14 @@ fail() } _FAIL_='eval fail --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# failNotEquals -# string [message] -# string unexpected -# string actual -# -# -# Fails the test if unexpected and -# actual are not -# equal to one another. The message is optional. -# -# -#*/ +# Records a test failure, stating two values were not equal. +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) failNotEquals() { ${_SHUNIT_LINENO_} @@ -571,33 +473,24 @@ failNotEquals() shunit_message_="${shunit_message_}$1" shift fi - shunit_unexpected_=$1 + shunit_expected_=$1 shunit_actual_=$2 - _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_unexpected_}> but was:<${shunit_actual_}>" + _shunit_assertFail "${shunit_message_:+${shunit_message_} }expected:<${shunit_expected_}> but was:<${shunit_actual_}>" - unset shunit_message_ shunit_unexpected_ shunit_actual_ + unset shunit_message_ shunit_expected_ shunit_actual_ return ${SHUNIT_FALSE} } _FAIL_NOT_EQUALS_='eval failNotEquals --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# failSame -# string [message] -# -# -# Indicate test failure because arguments were the same. The message is -# optional. -# -# -#*/ +# Records a test failure, stating two values should have been the same. +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) failSame() { ${_SHUNIT_LINENO_} @@ -620,25 +513,16 @@ failSame() } _FAIL_SAME_='eval failSame --lineno "${LINENO:-}"' -#/** -# -# -# void -# -# -# -# -# failNotSame -# string [message] -# string expected -# string actual -# -# -# Indicate test failure because arguments were not the same. The -# message is optional. -# -# -#*/ +# Records a test failure, stating two values were not equal. +# +# This is functionally equivalent to calling failNotEquals(). +# +# Args: +# message: string: failure message [optional] +# expected: string: expected value +# actual: string: actual value +# Returns: +# integer: success (TRUE/FALSE/ERROR constant) failNotSame() { ${_SHUNIT_LINENO_} @@ -665,67 +549,34 @@ _FAIL_NOT_SAME_='eval failNotSame --lineno "${LINENO:-}"' # skipping functions # -#/** -# -# -# void -# -# -# -# -# startSkipping -# -# -# -# This function forces the remaining assert and fail functions to be -# "skipped", i.e. they will have no effect. Each function skipped will be -# recorded so that the total of asserts and fails will not be altered. -# -# -#*/ +# Force remaining assert and fail functions to be "skipped". +# +# This function forces the remaining assert and fail functions to be "skipped", +# i.e. they will have no effect. Each function skipped will be recorded so that +# the total of asserts and fails will not be altered. +# +# Args: +# None startSkipping() { __shunit_skip=${SHUNIT_TRUE} } -#/** -# -# -# void -# -# -# -# -# endSkipping -# -# -# -# This function returns calls to the assert and fail functions to their -# default behavior, i.e. they will be called. -# -# -#*/ +# Resume the normal recording behavior of assert and fail calls. +# +# Args: +# None endSkipping() { __shunit_skip=${SHUNIT_FALSE} } -#/** -# -# -# boolean -# -# -# -# -# isSkipping -# -# -# -# This function returns the state of skipping. -# -# -#*/ +# Returns the state of assert and fail call skipping. +# +# Args: +# None +# Returns: +# boolean: (TRUE/FALSE constant) isSkipping() { return ${__shunit_skip} @@ -735,49 +586,30 @@ isSkipping() # suite functions # -#/** -# -# -# void -# -# -# -# -# suite -# -# -# -# This function can be optionally overridden by the user in their test -# suite. -# If this function exists, it will be called when -# shunit2 is sourced. If it does not exist, shUnit2 will -# search the parent script for all functions beginning with the word -# test, and they will be added dynamically to the test -# suite. -# -# -#*/ +# Stub. This function should contains all unit test calls to be made. +# +# DEPRECATED (as of 2.1.0) +# +# This function can be optionally overridden by the user in their test suite. +# +# If this function exists, it will be called when shunit2 is sourced. If it +# does not exist, shunit2 will search the parent script for all functions +# beginning with the word 'test', and they will be added dynamically to the +# test suite. +# +# This function should be overridden by the user in their unit test suite. # Note: see _shunit_mktempFunc() for actual implementation -# suite() { :; } - -#/** -# -# -# void -# -# -# -# -# suite_addTest -# string function -# -# -# This function adds a function name to the list of tests scheduled for -# execution as part of this test suite. This function should only be called -# from within the suite() function. -# -# -#*/ +# +# Args: +# None +#suite() { :; } # DO NOT UNCOMMENT THIS FUNCTION + +# Adds a function name to the list of tests schedule for execution. +# +# This function should only be called from within the suite() function. +# +# Args: +# function: string: name of a function to add to current unit test suite suite_addTest() { shunit_func_=${1:-} @@ -788,108 +620,75 @@ suite_addTest() unset shunit_func_ } -#/** -# -# -# void -# -# -# -# -# oneTimeSetUp -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called once before any tests are -# run. It is useful to prepare a common environment for all tests. -# -# -#*/ +# Stub. This function will be called once before any tests are run. +# +# Common one-time environment preparation tasks shared by all tests can be +# defined here. +# +# This function should be overridden by the user in their unit test suite. +# Note: see _shunit_mktempFunc() for actual implementation +# +# Args: +# None +#oneTimeSetUp() { :; } # DO NOT UNCOMMENT THIS FUNCTION + +# Stub. This function will be called once after all tests are finished. +# +# Common one-time environment cleanup tasks shared by all tests can be defined +# here. +# +# This function should be overridden by the user in their unit test suite. # Note: see _shunit_mktempFunc() for actual implementation -# oneTimeSetUp() { :; } - -#/** -# -# -# void -# -# -# -# -# oneTimeTearDown -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called once after all tests are -# completed. It is useful to clean up the environment after all tests. -# -# -#*/ +# +# Args: +# None +#oneTimeTearDown() { :; } # DO NOT UNCOMMENT THIS FUNCTION + +# Stub. This function will be called before each test is run. +# +# Common environment preparation tasks shared by all tests can be defined here. +# +# This function should be overridden by the user in their unit test suite. # Note: see _shunit_mktempFunc() for actual implementation -# oneTimeTearDown() { :; } - -#/** -# -# -# void -# -# -# -# -# setUp -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called before each test is run. -# It is useful to reset the environment before each test. -# -# -#*/ +# +# Args: +# None +#setUp() { :; } + # Note: see _shunit_mktempFunc() for actual implementation -# setUp() { :; } - -#/** -# -# -# void -# -# -# -# -# tearDown -# -# -# -# This function can be be optionally overridden by the user in their -# test suite. -# If this function exists, it will be called after each test completes. -# It is useful to clean up the environment after each test. -# -# -#*/ +# Stub. This function will be called after each test is run. +# +# Common environment cleanup tasks shared by all tests can be defined here. +# +# This function should be overridden by the user in their unit test suite. # Note: see _shunit_mktempFunc() for actual implementation -# tearDown() { :; } +# +# Args: +# None +#tearDown() { :; } # DO NOT UNCOMMENT THIS FUNCTION #------------------------------------------------------------------------------ # internal shUnit2 functions # -# this function is a cross-platform temporary directory creation tool. not all +# Create a temporary directory to store various run-time files in. +# +# This function is a cross-platform temporary directory creation tool. Not all # OSes have the mktemp function, so one is included here. +# +# Args: +# None +# Outputs: +# string: the temporary directory that was created _shunit_mktempDir() { # try the standard mktemp function ( exec mktemp -dqt shunit.XXXXXX 2>/dev/null ) && return # the standard mktemp didn't work. doing our own. - if [ -r '/dev/urandom' ]; then - _shunit_random_=`od -vAn -N4 -tx4 "${_shunit_file_}" #! /bin/sh @@ -924,6 +725,14 @@ EOF unset _shunit_file_ } +# Final cleanup function to leave things as we found them. +# +# Besides removing the temporary directory, this function is in charge of the +# final exit code of the unit test. The exit code is based on how the script +# was ended (e.g. normal exit, or via Ctrl-C). +# +# Args: +# name: string: name of the trap called (specified when trap defined) _shunit_cleanup() { _shunit_name_=$1 @@ -958,6 +767,9 @@ _shunit_cleanup() } # The actual running of the tests happens here. +# +# Args: +# None _shunit_execSuite() { for _shunit_test_ in ${__shunit_suite}; do @@ -987,8 +799,12 @@ _shunit_execSuite() unset _shunit_test_ } -# This function exits shUnit2 with the appropriate error code and OK/FAILED -# message. +# Generates the user friendly report with appropriate OK/FAILED message. +# +# Args: +# None +# Output: +# string: the report of successful and failed tests, as well as totals. _shunit_generateReport() { _shunit_ok_=${SHUNIT_TRUE} @@ -1030,18 +846,32 @@ _shunit_generateReport() unset _shunit_failures_ _shunit_msg_ _shunit_ok_ _shunit_skipped_ } +# Test for whether a function should be skipped. +# +# Args: +# None +# Returns: +# boolean: whether the test should be skipped (TRUE/FALSE constant) _shunit_shouldSkip() { [ ${__shunit_skip} -eq ${SHUNIT_FALSE} ] && return ${SHUNIT_FALSE} _shunit_assertSkip } +# Records a successful test. +# +# Args: +# None _shunit_assertPass() { __shunit_assertsPassed=`expr ${__shunit_assertsPassed} + 1` __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` } +# Records a test failure. +# +# Args: +# message: string: failure message to provide user _shunit_assertFail() { _shunit_msg_=$1 @@ -1054,23 +884,119 @@ _shunit_assertFail() unset _shunit_msg_ } +# Records a skipped test. +# +# Args: +# None _shunit_assertSkip() { __shunit_assertsSkipped=`expr ${__shunit_assertsSkipped} + 1` __shunit_assertsTotal=`expr ${__shunit_assertsTotal} + 1` } +# Prepare a script filename for sourcing. +# +# Args: +# script: string: path to a script to source +# Returns: +# string: filename prefixed with ./ (if necessary) +_shunit_prepForSourcing() +{ + _shunit_script_=$1 + case "${_shunit_script_}" in + /*|./*) echo "${_shunit_script_}" ;; + *) echo "./${_shunit_script_}" ;; + esac + unset _shunit_script_ +} + +# Escape a character in a string. +# +# Args: +# c: string: unescaped character +# s: string: to escape character in +# Returns: +# string: with escaped character(s) +_shunit_escapeCharInStr() +{ + [ -n "$2" ] || return # no point in doing work on an empty string + + # Note: using shorter variable names to prevent conflicts with + # _shunit_escapeCharactersInString(). + _shunit_c_=$1 + _shunit_s_=$2 + + + # escape the character + echo ''${_shunit_s_}'' |sed 's/\'${_shunit_c_}'/\\\'${_shunit_c_}'/g' + + unset _shunit_c_ _shunit_s_ +} + +# Escape a character in a string. +# +# Args: +# str: string: to escape characters in +# Returns: +# string: with escaped character(s) +_shunit_escapeCharactersInString() +{ + [ -n "$1" ] || return # no point in doing work on an empty string + + _shunit_str_=$1 + + # Note: using longer variable names to prevent conflicts with + # _shunit_escapeCharInStr(). + for _shunit_char_ in '"' '$' "'" '`'; do + _shunit_str_=`_shunit_escapeCharInStr "${_shunit_char_}" "${_shunit_str_}"` + done + + echo "${_shunit_str_}" + unset _shunit_char_ _shunit_str_ +} + +# Extract list of functions to run tests against. +# +# Args: +# script: string: name of script to extract functions from +# Returns: +# string: of function names +_shunit_extractTestFunctions() +{ + _shunit_script_=$1 + + # extract the lines with test function names, strip of anything besides the + # function name, and output everything on a single line. + _shunit_regex_='^[ ]*(function )*test[A-Za-z0-9_]* *\(\)' + egrep "${_shunit_regex_}" "${_shunit_script_}" \ + |sed 's/^[^A-Za-z0-9_]*//;s/^function //;s/\([A-Za-z0-9_]*\).*/\1/g' \ + |xargs + + unset _shunit_regex_ _shunit_script_ +} + #------------------------------------------------------------------------------ # main # +# determine the operating mode +if [ $# -eq 0 ]; then + __shunit_script=${__SHUNIT_PARENT} + __shunit_mode=${__SHUNIT_MODE_SOURCED} +else + __shunit_script=$1 + [ -r "${__shunit_script}" ] || \ + _shunit_fatal "unable to read from ${__shunit_script}" + __shunit_mode=${__SHUNIT_MODE_STANDALONE} +fi + # create a temporary storage location __shunit_tmpDir=`_shunit_mktempDir` # provide a public temporary directory for unit test scripts # TODO(kward): document this -shunit_tmpDir="${__shunit_tmpDir}/tmp" -mkdir "${shunit_tmpDir}" +SHUNIT_TMPDIR="${__shunit_tmpDir}/tmp" +mkdir "${SHUNIT_TMPDIR}" # setup traps to clean up after ourselves trap '_shunit_cleanup EXIT' 0 @@ -1081,6 +1007,17 @@ trap '_shunit_cleanup TERM' 15 _shunit_mktempFunc PATH="${__shunit_tmpDir}:${PATH}" +# make sure phantom functions are executable. this will bite if /tmp (or the +# current $TMPDIR) points to a path on a partition that was mounted with the +# 'noexec' option. the noexec command was created with _shunit_mktempFunc(). +noexec 2>/dev/null || _shunit_fatal \ + 'please declare TMPDIR with path on partition with exec permission' + +# we must manually source the tests in standalone mode +if [ "${__shunit_mode}" = "${__SHUNIT_MODE_STANDALONE}" ]; then + . "`_shunit_prepForSourcing \"${__shunit_script}\"`" +fi + # execute the oneTimeSetUp function (if it exists) oneTimeSetUp @@ -1090,8 +1027,7 @@ suite # if no suite function was defined, dynamically build a list of functions if [ -z "${__shunit_suite}" ]; then - shunit_funcs_=`grep "^[ \t]*test[A-Za-z0-9_]* *()" ${__SHUNIT_PARENT} \ - |sed 's/[^A-Za-z0-9_]//g'` + shunit_funcs_=`_shunit_extractTestFunctions "${__shunit_script}"` for shunit_func_ in ${shunit_funcs_}; do suite_addTest ${shunit_func_} done @@ -1110,7 +1046,3 @@ _shunit_generateReport # that's it folks [ ${__shunit_testsFailed} -eq 0 ] exit $? - -#/** -# -#*/ -- cgit v1.1-4-g5e80 From 8b8b9f52fbaa6ca9cadb8cba61f27deabbc17bfe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 14 Oct 2011 10:36:56 +0200 Subject: Rebuilt alpm.so for pacman 4.0 soname bump --- cron-jobs/check_archlinux/alpm.so | Bin 7190 -> 7057 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/cron-jobs/check_archlinux/alpm.so b/cron-jobs/check_archlinux/alpm.so index 72f737e..8944bbe 100755 Binary files a/cron-jobs/check_archlinux/alpm.so and b/cron-jobs/check_archlinux/alpm.so differ -- cgit v1.1-4-g5e80 From 9612e5d915faf63ea6d5a5ca5c3ff74cca8eb923 Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Fri, 28 Oct 2011 12:15:09 -0300 Subject: Reflect server changes on config --- config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config b/config index effdde4..4f4d81d 100644 --- a/config +++ b/config @@ -1,7 +1,7 @@ #!/bin/bash -FTP_BASE="/home/parabolavnx/parabolagnulinux.org/repo" -ARCH_BASE="/home/parabolavnx/parabolagnulinux.org/repo" -SVNREPO="/home/parabolavnx/parabolagnulinux.org/abslibre" +FTP_BASE="/home/repo/public" +ARCH_BASE="/home/repo/public" +SVNREPO="/home/repo/abslibre" ARCHREPOS=('core' 'extra' 'community' 'testing' 'multilib') PKGREPOS=(${ARCHREPOS[@]} 'libre' 'libre-testing' 'social' 'sugar') @@ -24,7 +24,7 @@ LOCK_DELAY=10 LOCK_TIMEOUT=300 STAGING="$FTP_BASE/staging" -TMPDIR="$HOME/tmp" +TMPDIR="/tmp" ARCHARCHES=(i686 x86_64) ARCHES=(${ARCHARCHES[@]} mips64el) DBEXT=".db.tar.gz" @@ -32,5 +32,5 @@ FILESEXT=".files.tar.gz" PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz" -MAKEPKGCONF="$HOME/etc/makepkg.conf" -BLACKLIST_FILE="$HOME/parabolagnulinux.org/docs/blacklist.txt" \ No newline at end of file +MAKEPKGCONF="/etc/makepkg.conf" +BLACKLIST_FILE="$HOME/blacklist/blacklist.txt" -- cgit v1.1-4-g5e80 From 8bb0c5aa9d00dfe16101329d62691d3f60cf134b Mon Sep 17 00:00:00 2001 From: Nicolas Reynolds Date: Fri, 28 Oct 2011 12:18:29 -0300 Subject: Sync package databases first * Get all available packages * Remove unfree from the sync list * Sync everything whitelisted --- db-sync | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 db-sync diff --git a/db-sync b/db-sync new file mode 100644 index 0000000..0baf497 --- /dev/null +++ b/db-sync @@ -0,0 +1,108 @@ +#!/bin/bash +# Syncs Arch repos based on info contained in repo.db files +# License: GPLv3 + +# Principles +# * Get repo.db from an Arch-like repo +# * Generate a list of available packages +# * Create sync whitelist (based on package blacklist) +# * Get packages +# * Check package signatures +# * Check database signatures +# * Sync repo => repo + + +# eval this +BASEURL="ftp://ftp.archlinux.org/\$repo/os/\$arch/\$file" + +# Generates an URL from BASE_URL +# _Params_ +# * repo +# * arch +# * file +eval_url() { + repo="$1" + arch="$2" + file="$3" + + eval "${BASE_URL}" +} + +# Returns contents of a repo +get_repos() { + rsync -av --include="*.db*" --exclude="*" rsync://${mirror}/${mirror_path}/ cache/ +} + +get_repo_content() { +# Return all contents + bsdtar tf cache/$1/os/$2/$1.db.tar.* | \ + cut -d "/" -f 1 | \ + sort -u +} + +# Get the database compression as an extension +get_repo_ext() { + file "$1" | tr A-Z a-z | sed -e "s/^[^:]\+: *\(.z\).*$/.tar.\1/" -e "s/bz/&2" +} + +# Prints blacklisted packages +get_blacklist() { + cut -d ':' -f 1 "${BLACKLIST_FILE}" +} + +# repo +# arch +get_repo_file() { + [ ! -f "cache/${1}/os/${2}/${1}.db.tar.*" ] && return 1 + + echo cache/${1}/os/${2}/${1}.db.tar.* +} + +# Process the databases and get the libre packages +init() { +# Fail on every error + set -E + + source $(dirname $0)/config + source $(dirname $0)/local_config + source $(dirname $0)/libremessages + +# Get the blacklisted packages + blacklist=($(get_blacklist)) + +# Sync the repos databases + get_repos + +# Traverse all repo-arch pairs + for _arch in ${ARCHARCHES[@]}; do + for _repo in ${ARCHREPOS[@]}; do + msg "Processing ${_repo}-${_arch}" + + repo_file=$(get_repo_file ${_repo} ${_arch}) + +# Remove blacklisted packages and count them + msg2 "Removing blacklisted packages: $( + LC_ALL=C repo-remove ${repo_file} ${blacklist[@]} 2>&1 | \ + grep "\-> Removing" 2>/dev/null| wc -l)" + +# Get db contents + db=($(get_repo ${_repo} ${_arch})) + + msg2 "Process clean db for syncing..." + +# Create a whitelist + echo ${db[@]} | tr ' ' "\n" | sed "s|$|*|g" > /tmp/${_repo}-${_arch}.whitelist + +# Sync excluding everything but blacklist + rsync -av --include-from=/tmp/${_repo}-${_arch}.whitelist --exclude="*" + + +# Cleanup + unset db + done + done + +# Cleanup + unset blacklist _arch _repo repo_file +} + -- cgit v1.1-4-g5e80 From d0586258fda6753053a7d28a2d7d15228b1d8897 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 30 Oct 2011 16:59:28 +0100 Subject: Require a signature file for new packages --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 89e3633..4abddd5 100644 --- a/config +++ b/config @@ -14,7 +14,7 @@ SOURCE_CLEANUP_DRYRUN=false # Time in days to keep moved sourcepackages SOURCE_CLEANUP_KEEP=14 -REQUIRE_SIGNATURE=false +REQUIRE_SIGNATURE=true LOCK_DELAY=10 LOCK_TIMEOUT=300 -- cgit v1.1-4-g5e80 From 666f2b153c4bd06259124dcc6641db6b21495787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sun, 30 Oct 2011 20:34:34 -0300 Subject: Seems to work, entering test status. --- createrepos | 8 +++++ db-sync | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 108 insertions(+), 15 deletions(-) create mode 100755 createrepos mode change 100644 => 100755 db-sync diff --git a/createrepos b/createrepos new file mode 100755 index 0000000..4ee057b --- /dev/null +++ b/createrepos @@ -0,0 +1,8 @@ +#!/bin/bash +# Creates the repo structure defined in config + +source $(dirname $0)/config + +mkdir -p ${FTP_BASE}/{${PKGPOOL},${SRCPOOL}} ${ARCH_BASE} ${CLEANUP_DESTDIR} ${SOURCE_CLEANUP_DESTDIR} ${STAGING} + +$(dirname $0)/create-repo ${PKGREPOS[@]} diff --git a/db-sync b/db-sync old mode 100644 new mode 100755 index 0baf497..4c5dd7a --- a/db-sync +++ b/db-sync @@ -11,8 +11,13 @@ # * Check database signatures # * Sync repo => repo +# TODO +# * verbose mode +# * make a tarball of files used for forensics +# * get files db # eval this +# *not needed* BASEURL="ftp://ftp.archlinux.org/\$repo/os/\$arch/\$file" # Generates an URL from BASE_URL @@ -30,12 +35,18 @@ eval_url() { # Returns contents of a repo get_repos() { - rsync -av --include="*.db*" --exclude="*" rsync://${mirror}/${mirror_path}/ cache/ +# Exclude everything but db files + rsync -avm --include="*/" \ + --include="*.db" \ + --include="*${DBEXT}" \ + --exclude="*" \ + --delete-after \ + rsync://${mirror}/${mirrorpath}/ cache/ } get_repo_content() { # Return all contents - bsdtar tf cache/$1/os/$2/$1.db.tar.* | \ + bsdtar tf ${1} | \ cut -d "/" -f 1 | \ sort -u } @@ -53,22 +64,20 @@ get_blacklist() { # repo # arch get_repo_file() { - [ ! -f "cache/${1}/os/${2}/${1}.db.tar.*" ] && return 1 + [ ! -r "cache/${1}/os/${2}/${1}${DBEXT}" ] && return 1 - echo cache/${1}/os/${2}/${1}.db.tar.* + echo "cache/${1}/os/${2}/${1}${DBEXT}" } # Process the databases and get the libre packages init() { -# Fail on every error - set -E - - source $(dirname $0)/config - source $(dirname $0)/local_config - source $(dirname $0)/libremessages # Get the blacklisted packages blacklist=($(get_blacklist)) +# Store all the whitelist files + whitelists=() + + msg "${#blacklist[@]} packages in blacklist" # Sync the repos databases get_repos @@ -81,28 +90,104 @@ init() { repo_file=$(get_repo_file ${_repo} ${_arch}) # Remove blacklisted packages and count them +# TODO capture all removed packages for printing on debug mode msg2 "Removing blacklisted packages: $( LC_ALL=C repo-remove ${repo_file} ${blacklist[@]} 2>&1 | \ grep "\-> Removing" 2>/dev/null| wc -l)" # Get db contents - db=($(get_repo ${_repo} ${_arch})) + db=($(get_repo_content ${repo_file})) msg2 "Process clean db for syncing..." -# Create a whitelist +# Create a whitelist, add * wildcard to end +# TODO due to lack of -arch suffix, the pool sync retrieves every arch even if +# we aren't syncing them echo ${db[@]} | tr ' ' "\n" | sed "s|$|*|g" > /tmp/${_repo}-${_arch}.whitelist -# Sync excluding everything but blacklist - rsync -av --include-from=/tmp/${_repo}-${_arch}.whitelist --exclude="*" + msg2 "$(wc -l /tmp/${_repo}-${_arch}.whitelist | cut -d' ' -f1) packages in whitelist" + +# Sync excluding everything but whitelist +# We delete here for cleanup + rsync -vrtlH \ + --delete-after \ + --safe-links \ + --delay-updates \ + --max-delete=1000 \ + --include-from=/tmp/${_repo}-${_arch}.whitelist \ + --exclude="*" \ + rsync://${mirror}/${mirrorpath}/${_repo}/os/${_arch}/ \ + ${FTP_BASE}/${_repo}/os/${_arch}/ +# Add a new whitelist + whitelists+=(/tmp/${_repo}-${_arch}.whitelist) # Cleanup unset db done done + msg "Putting databases back in place" + rsync -vrtlH \ + --delay-updates \ + --safe-links \ + cache/ \ + ${FTP_BASE}/ + + msg "Syncing package pool" +# Concatenate all whitelists + cat ${whitelists[@]} | sort -u > /tmp/any.whitelist + + msg2 "Retrieving $(wc -l /tmp/any.whitelist | cut -d' ' -f1) packages from pool" + +# Sync +# *Don't delete-after*, this is the job of cleanup scripts. It will remove our +# packages too + rsync -vrtlH \ + --delay-updates \ + --safe-links \ + --include-from=/tmp/any.whitelist \ + --exclude="*" \ + rsync://${mirror}/${mirrorpath}/${PKGPOOL}/ \ + ${FTP_BASE}/${PKGPOOL}/ + +# Sync sources + msg "Syncing source pool" + #sed "s|\.pkg\.tar\.|.src.tar.|" /tmp/any.whitelist > /tmp/any-src.whitelist + + #msg2 "Retrieving $(wc -l /tmp/any-src.whitelist | cut -d' ' -f1) sources from pool" +# Sync +# *Don't delete-after*, this is the job of cleanup scripts. It will remove our +# packages too + rsync -vrtlH \ + --delay-updates \ + --safe-links \ + --include-from=/tmp/any.whitelist \ + --exclude="*" \ + rsync://${mirror}/${mirrorpath}/${SRCPOOL}/ \ + ${FTP_BASE}/${SRCPOOL}/ + + # Cleanup - unset blacklist _arch _repo repo_file + unset blacklist whitelists _arch _repo repo_file +} + +trap_exit() { + echo + error "$@" + exit 1 } + +source $(dirname $0)/config +source $(dirname $0)/local_config +source $(dirname $0)/libremessages + +# From makepkg +set -E + +trap 'trap_exit "$(gettext "TERM signal caught. Exiting...")"' TERM HUP QUIT +trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT +trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR + +init -- cgit v1.1-4-g5e80 From 92a8525eb5ed349f95c080c61c821399e3917842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Sun, 30 Oct 2011 20:49:41 -0300 Subject: Local test config --- config | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config b/config index c8b3f0b..9a20f4a 100644 --- a/config +++ b/config @@ -1,10 +1,10 @@ #!/bin/bash -FTP_BASE="/home/repo/public" -ARCH_BASE="/home/repo/public" -SVNREPO="/home/repo/abslibre" +FTP_BASE="/tmp/repo" +ARCH_BASE="/tmp/repo" +SVNREPO="/var/abs" # Repos from Arch -ARCHREPOS=('core' 'extra' 'community' 'testing' 'multilib') +ARCHREPOS=('core') #'extra' 'community' 'testing' 'multilib') # Official Parabola repos OURREPOS=('libre' 'libre-testing') # User repos @@ -32,7 +32,7 @@ LOCK_TIMEOUT=300 STAGING="$FTP_BASE/staging" TMPDIR="/tmp" -ARCHARCHES=(i686 x86_64) +ARCHARCHES=(i686) # x86_64) ARCHES=(${ARCHARCHES[@]} mips64el) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" @@ -40,4 +40,4 @@ PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz" MAKEPKGCONF="/etc/makepkg.conf" -BLACKLIST_FILE="$HOME/blacklist/blacklist.txt" +BLACKLIST_FILE="$FTP_BASE/blacklist.txt" -- cgit v1.1-4-g5e80 From c60d06e050e929d454b447a3cac3263a83d0a445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Thu, 3 Nov 2011 15:42:12 -0300 Subject: Removed unneeded code --- db-sync | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/db-sync b/db-sync index 4c5dd7a..0bb79b7 100755 --- a/db-sync +++ b/db-sync @@ -16,23 +16,6 @@ # * make a tarball of files used for forensics # * get files db -# eval this -# *not needed* -BASEURL="ftp://ftp.archlinux.org/\$repo/os/\$arch/\$file" - -# Generates an URL from BASE_URL -# _Params_ -# * repo -# * arch -# * file -eval_url() { - repo="$1" - arch="$2" - file="$3" - - eval "${BASE_URL}" -} - # Returns contents of a repo get_repos() { # Exclude everything but db files @@ -51,11 +34,6 @@ get_repo_content() { sort -u } -# Get the database compression as an extension -get_repo_ext() { - file "$1" | tr A-Z a-z | sed -e "s/^[^:]\+: *\(.z\).*$/.tar.\1/" -e "s/bz/&2" -} - # Prints blacklisted packages get_blacklist() { cut -d ':' -f 1 "${BLACKLIST_FILE}" -- cgit v1.1-4-g5e80 From 801ea2c927ace5ee892209dd8e3c1044e1b3842e Mon Sep 17 00:00:00 2001 From: Parabola Date: Mon, 14 Nov 2011 05:14:04 -0800 Subject: Fixes while testing it --- config | 10 +++++----- db-sync | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config b/config index a0849a9..23b7bbb 100644 --- a/config +++ b/config @@ -1,10 +1,10 @@ #!/bin/bash -FTP_BASE="/tmp/repo" -ARCH_BASE="/tmp/repo" +FTP_BASE="/srv/http/repo/public/temprepo" +ARCH_BASE="/srv/http/repo/public/temprepo" SVNREPO="/var/abs" # Repos from Arch -ARCHREPOS=('core') #'extra' 'community' 'testing' 'multilib') +ARCHREPOS=('core' 'testing') #'extra' 'community' 'testing' 'multilib') # Official Parabola repos OURREPOS=('libre' 'libre-testing') # User repos @@ -32,7 +32,7 @@ LOCK_TIMEOUT=300 STAGING="$FTP_BASE/staging" TMPDIR="/tmp" -ARCHARCHES=(i686) # x86_64) +ARCHARCHES=(i686 x86_64) ARCHES=(${ARCHARCHES[@]} mips64el) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" @@ -40,4 +40,4 @@ PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz" MAKEPKGCONF="/etc/makepkg.conf" -BLACKLIST_FILE="$FTP_BASE/blacklist.txt" +BLACKLIST_FILE="$HOME/blacklist/blacklist.txt" diff --git a/db-sync b/db-sync index 0bb79b7..1a9e02f 100755 --- a/db-sync +++ b/db-sync @@ -89,7 +89,7 @@ init() { # We delete here for cleanup rsync -vrtlH \ --delete-after \ - --safe-links \ + --delete-excluded \ --delay-updates \ --max-delete=1000 \ --include-from=/tmp/${_repo}-${_arch}.whitelist \ -- cgit v1.1-4-g5e80