]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
simplaret: enhanced search_and_process_patch
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 26 Aug 2007 15:14:55 +0000 (15:14 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sun, 26 Aug 2007 15:14:55 +0000 (15:14 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@427 04377dda-e619-0410-9926-eae83683ac58

trunk/doc/README
trunk/doc/README.pt_BR
trunk/doc/README.simplaret
trunk/doc/TODO
trunk/simplepkg.SlackBuild
trunk/src/createpkg
trunk/src/simplaret

index 47143cac512463a5092a31f11c3770b9e1bcbd20..80f0286c35bf4392af2bd27ecb3ea2fe6f0564d5 100644 (file)
@@ -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.
 
index 138125e7c7d38894d005fd21687ecb4b1fb11046..043ee5b1e18bf0045f405ea659a27bd07d5839e6 100644 (file)
@@ -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.
 
index 397d913aa4227e0e4a21b348fd5aa0489b11bcfd..cd73bb66d07d82a3cdd1b41c743b12045e7a8851 100644 (file)
@@ -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.
 
index 9178f6eea14418f91a38466162031bb782ea08c7..54b686e41a794d15f118f37a47708a43b19f3328 100644 (file)
@@ -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
 
index 815205dd6dd65bb62fd2c3f8732564ea1ddbe025..4e535678d4a58264a7c9ad9a69fb9b0586361727 100755 (executable)
@@ -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"
index 4508e147133d7d6ba61756cae3f9b9eb45aed9e5..5562f197340a45240346326fd7e081d142665a48 100644 (file)
@@ -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
index c8cc2f7db82866b09d8f20c42b15888e6e9a1ccf..483bba85e828f55a1c01b701c9ad22ee4e7688fe 100755 (executable)
@@ -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"