Commit 44c8db76 authored by Seblu's avatar Seblu
Browse files

Remove seblu-repo-add

This script is a legacy from time when my package was stored in a svn.
parent 43200639
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@ package() {
  # install config
  install -m644 pacman-seblu.conf "$pkgdir/usr/share/devtools"
  # install binaries
  install -m755 seblu-build seblu-repo-add seblu-build-commit seblu-update \
    seblu-commit seblu-remove seblu-cleanup seblu-list "$pkgdir/usr/bin"
  install -m755 seblu-build seblu-build-commit seblu-update seblu-commit \
    seblu-remove seblu-cleanup seblu-list "$pkgdir/usr/bin"
  # symlink archbuild
  ln -s archbuild $pkgdir/usr/bin/seblu-i686-build
  ln -s archbuild $pkgdir/usr/bin/seblu-x86_64-build

seblu-repo-add

deleted100755 → 0
+0 −72
Original line number Diff line number Diff line
#!/bin/bash
# vim:set ts=2 sw=2 ft=sh et:

# Copyright © Sébastien Luttringer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

. /etc/makepkg.conf

repo_path='/home/seblu/scm/archrepo/x86_64'
repo_db='seblu.db.tar.gz'

commit=0 #no commit by default
delete=1 #delete old pkg

usage() {
  echo "${0##*/} [options] *$PKGEXT"
  echo
  echo "options:"
  echo "   -h: display this help"
  echo "   -c: svn commit"
  echo "   -p: preserve old packages in repository"
}

# check args count
(( $# < 1 )) && usage && exit 1

# parse optios
while getopts "hcp" opts; do
  case $opts in
    c)  commit=1;;
    d)  delete=0;;
    h)  usage; exit 0;;
    *)  usage; exit 1;;
  esac
done

# skip optional args
(( OPTIND > 0 )) && shift $((OPTIND - 1))

for pkg; do
  [[ ! -r "$pkg" ]] && echo "No readable package $pkg, skipped." && continue
  [[ ! "$pkg" =~ .*$PKGEXT ]] && echo "Invalid package $pkg, skipped." && continue
  mv -i "$pkg" "$repo_path" && (
    cd "$repo_path"
    svn add "$pkg"
    repo-add "$repo_db" "$pkg"
   # remove old verions
   (( delete )) || continue
   pkgname=${pkg%-*}
   pkgname=${pkgname%-*}
   pkgname=${pkgname%-*}
   for j in $pkgname-*$PKGEXT; do
      [[ "$pkg" == "$j" ]] && continue
      svn rm "$j"
   done
  )
done

(( commit )) && cd "$repo_path" && svn commit -m "add $*"