From 5dc3e56994dbc3d9ec72ca849987bb0d10cd7f3b Mon Sep 17 00:00:00 2001 From: rhatto Date: Sun, 26 Aug 2007 15:14:55 +0000 Subject: simplaret: enhanced search_and_process_patch git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@427 04377dda-e619-0410-9926-eae83683ac58 --- trunk/doc/README | 6 ++-- trunk/doc/README.pt_BR | 10 +++---- trunk/doc/README.simplaret | 2 +- trunk/doc/TODO | 2 +- trunk/simplepkg.SlackBuild | 2 +- trunk/src/createpkg | 6 ++++ trunk/src/simplaret | 74 +++++++++++++++++++++++----------------------- 7 files changed, 54 insertions(+), 48 deletions(-) (limited to 'trunk') diff --git a/trunk/doc/README b/trunk/doc/README index 47143ca..80f0286 100644 --- a/trunk/doc/README +++ b/trunk/doc/README @@ -330,7 +330,7 @@ like a slackware ports system. Createpkg works with any SlackBuild repository but works better and is well integrated if they are compliant with the standards from - http://slack.sarava.org/wiki/Main/SlackBuilds + http://slack.sarava.org/trac/wiki/SlackBuilds Specifically, createpkg was built to use slackbuilds from http://slack.sarava.org/slackbuilds through a subversion repository. @@ -367,7 +367,7 @@ For more information about createpkg, type createpkg --help -or take a look at http://slack.sarava.org/wiki/Main/SlackBuilds. +or take a look at http://slack.sarava.org/trac/wiki/SlackBuilds. Auxiliar applications --------------------- @@ -423,6 +423,6 @@ can be obtained from the subversion repository: svn checkout svn://slack.sarava.org/simplepkg -Simplepkg's wiki is http://slack.sarava.org/wiki/Main/SimplePKG and its mailing list address is +Simplepkg's wiki is http://slack.sarava.org/trac/wiki/Simplepkg and its mailing list address is http://listas.sarava.org/wws/info/slack. diff --git a/trunk/doc/README.pt_BR b/trunk/doc/README.pt_BR index 138125e..043ee5b 100644 --- a/trunk/doc/README.pt_BR +++ b/trunk/doc/README.pt_BR @@ -341,7 +341,7 @@ um gerenciador de "ports" para slackware. O createpkg pode funcionar com qualquer tipo de script de construção de pacotes (SlackBuilds) mas funcionará melhor se os mesmos seguirem o padrão descrito na página - http://slack.sarava.org/wiki/Main/SlackBuilds + http://slack.sarava.org/trac/wiki/SlackBuilds Especificamente, o createpkg foi desenvolvido para utilizar os slackbuild disponíveis em http://slack.sarava.org/slackbuilds. O createpkg trabalha com repositórios do tipo subversion. @@ -378,7 +378,7 @@ Para mais detalhes de funcionamento, experimente o comando createpkg --help -ou então acesse a página http://slack.sarava.org/wiki/Main/SlackBuilds. +ou então acesse a página http://slack.sarava.org/trac/wiki/SlackBuilds. Aplicativos auxiliares ---------------------- @@ -438,7 +438,7 @@ disponibilizado atrav svn checkout svn://slack.sarava.org/simplepkg -O wiki de desenvolvimento: http://slack.sarava.org/wiki/Main/SimplePKG e o endereço da lista de discussão -utilizada para discussões sobre simplepkg ou mesmo distribuições e pacotes do tipo Slackware é -http://listas.sarava.org/wws/info/slack. +O wiki de desenvolvimento está em http://slack.sarava.org/trac/wiki/Simplepkg e o endereço da lista +de discussão utilizada para discussões sobre simplepkg ou mesmo distribuições e pacotes do tipo +Slackware é http://listas.sarava.org/wws/info/slack. diff --git a/trunk/doc/README.simplaret b/trunk/doc/README.simplaret index 397d913..cd73bb6 100644 --- a/trunk/doc/README.simplaret +++ b/trunk/doc/README.simplaret @@ -314,6 +314,6 @@ can be obtained from the subversion repository: svn checkout svn://slack.sarava.org/simplepkg -Simplepkg's wiki is http://slack.sarava.org/wiki/Main/SimplePKG and its mailing list address is +Simplepkg's wiki is http://slack.sarava.org/trac/wiki/Simplepkg and its mailing list address is http://listas.sarava.org/wws/info/slack. diff --git a/trunk/doc/TODO b/trunk/doc/TODO index 9178f6e..54b686e 100644 --- a/trunk/doc/TODO +++ b/trunk/doc/TODO @@ -1,5 +1,5 @@ simplepkg todo list ------------------- -TODO list at http://slack.sarava.org/wiki/Main/SimplePKG +TODO list at http://slack.sarava.org/trac/report diff --git a/trunk/simplepkg.SlackBuild b/trunk/simplepkg.SlackBuild index 815205d..4e53567 100755 --- a/trunk/simplepkg.SlackBuild +++ b/trunk/simplepkg.SlackBuild @@ -6,7 +6,7 @@ PACKAGE="simplepkg" PACK_DIR="package-$PACKAGE" BUILD=${BUILD:=1rha} -VERSION="0.6pre2" +VERSION="0.6pre3" ARCH="noarch" LIBEXEC="/usr/libexec/$PACKAGE" BINDIR="/usr/bin" diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 4508e14..5562f19 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -493,12 +493,15 @@ PKG_NAME="`ls -1 -c $MAKEPKG_REPOS/$PACKAGE-*-*-*.tgz | head -n 1 | xargs basena [ $MOVE_BIN_PACKAGE -eq $on ] && NEW_REPOS=$MAKEPKG_REPOS/$( echo ${SCRIPT_BASE#$SLACKBUILDS_DIR/} ) || NEW_REPOS=$MAKEPKG_REPOS # Create repository directory +# TODO: subversion integration [ ! -e $NEW_REPOS ] && mkdir -p $NEW_REPOS 2>/dev/null # Remove old packages from repository tree +# TODO: subversion integration [ $REMOVE_OLD_PACKAGE -eq $on ] && rm $NEW_REPOS/$PACKAGE-*-*-*.tgz 2>/dev/null # Move package and slack-required to SlackBuilds-like tree +# TODO: subversion integration [ $MOVE_BIN_PACKAGE -eq $on ] && mv $MAKEPKG_REPOS/$PKG_NAME $NEW_REPOS/ [ ! -z "$SLACK_REQUIRED" ] && cp $SLACK_REQUIRED $NEW_REPOS/$PKG_NAME.slack-required @@ -510,6 +513,9 @@ if [ "$INSTALL" -eq $on ]; then upgradepkg --install-new $NEW_REPOS/$PKG_NAME fi +# TODO: subversion integration +# generate or update all metadata +# svn commit # Update repository FILELIST.TXT, ... ( cd $MAKEPKG_REPOS diff --git a/trunk/src/simplaret b/trunk/src/simplaret index c8cc2f7..483bba8 100755 --- a/trunk/src/simplaret +++ b/trunk/src/simplaret @@ -688,7 +688,7 @@ function simplaret_get { function simplaret_search_and_process_patch { - local package_version package_build installed_version + local package_version package_build installed_version pack local installed_build repos_type get is_patch package_match # get the repository type @@ -718,48 +718,41 @@ function simplaret_search_and_process_patch { fi # search if its installed in the jail - installed_packs="`ls /$root/var/log/packages/$sugested* 2> /dev/null`" - if [ ! -z "$installed_packs" ]; then - - for installed in $installed_packs; do - if [[ "$sugested" == "`package_name $installed.tgz`" ]]; then - package_installed="1" - installed_version="`package_version $installed.tgz`" - installed_build="`package_build $installed.tgz`" - break - fi - done + if grep -e "^$sugested$" $PACKAGES_TMP; then + + pack="`echo $sugested | sed -e 's/\+/\\\+/'`" + installed=`eval "ls $root/var/log/packages/ | egrep -E '^$pack-[^-]+-[^-]+-[^-]+$'"` + installed_version="`package_version $installed.tgz`" + installed_build="`package_build $installed.tgz`" get="no" - # if the package is installed, download the patch - if [ "$package_installed" == "1" ]; then - if [ "$repos_type" == "patches" ]; then + # if needed, download the patch + if [ "$repos_type" == "patches" ]; then - if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then - get="yes" - package_match="no" - elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then - get="yes" - fi + if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then + get="yes" + package_match="no" + elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then + get="yes" + fi - elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then + elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then - if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then - get="yes" - package_match="no" - elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then - get="yes" - fi + if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then + get="yes" + package_match="no" + elif [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then + get="yes" + fi - else - # here, we're dealing with repositories other than ROOT and REPOS, - # so we need to check if either version or build number are different, - # otherwise all installed packages would be downloaded - if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then - get="yes" - package_match="no" - fi + else + # here, we're dealing with repositories other than ROOT and REPOS, + # so we need to check if either version or build number are different, + # otherwise all installed packages would be downloaded + if [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then + get="yes" + package_match="no" fi fi @@ -781,7 +774,7 @@ function simplaret_search_and_process_patch { fi - unset package_installed get + unset get } @@ -817,6 +810,11 @@ function simplaret_get_jail_patches { echo "" fi + # installed packages at $root + PACKAGES_TMP=/tmp/simplaret_"$root"_packages.$RANDOM + rm -f $PACKAGES_TMP ; touch $PACKAGES_TMP ; chmod 600 $PACKAGES_TMP + ls -1 $root/var/log/packages/ | sed -e 's/-[^-]*-[^-]*-[^-]*$//' > $PACKAGES_TMP + echo Fetching patches for arch $ARCH and version $VERSION for jail $root # list all available patches from PATCHES and ROOT repositories @@ -837,6 +835,8 @@ function simplaret_get_jail_patches { fi + rm $PACKAGES_TMP + # restore arch and version ARCH="$oldarch" VERSION="$oldversion" -- cgit v1.2.3