Commit 2646e719 authored by Andrea Scarpino's avatar Andrea Scarpino

this is no more needed

parent 8470693b
# Makefile for Repoman
#
# Copyright (C) 2008-2009 Andrea Scarpino <bash.lnx@gmail.com>
# Copyright (C) 2008-2010 Andrea Scarpino <andrea@archlinux.org>
#
# 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
......@@ -21,7 +21,6 @@ MSGFMT = /usr/bin/msgfmt
SED = /bin/sed
DESTDIR =
bindir = /usr/bin
libdir = /usr/lib/repoman
sysconfdir = /etc
localedir = /usr/share/locale
......@@ -33,7 +32,6 @@ install:
$(INSTALL) -d $(DESTDIR)$(sysconfdir)
$(INSTALL) -m755 repoman $(DESTDIR)$(bindir)
$(INSTALL) -m644 etc/repoman.conf $(DESTDIR)$(sysconfdir)
$(INSTALL) -m644 lib/basicfunctions.sh $(DESTDIR)$(libdir)
for file in po/*.po; \
do \
lang=$$(echo $$file | $(SED) -e 's#.*/\([^/]\+\).po#\1#'); \
......
#!/bin/bash
#
# Repoman's basic functions
# Based on Yaourt/basicfunctions.sh by Julien MISCHKOWITZ (wain@archlinux.fr)
#
# Copyright (C) 2009 Andrea Scarpino <bash.lnx@gmail.com>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
isnumeric(){
if let $1 2>/dev/null; then return 0; else return 1; fi
}
is_x_gt_y(){
local version=( $(echo $1 | tr "[:punct:]" "\ " | sed 's/[a-zA-Z]/ &/g') )
local lversion=( $(echo $2 | tr "[:punct:]" "\ " | sed 's/[a-zA-Z]/ &/g') )
if [ ${#version[@]} -gt ${#lversion[@]} ]; then
versionlength=${#version[@]}
else
versionlength=${#lversion[@]}
fi
for i_index in `seq 0 $((${versionlength}-1))`; do
if `isnumeric ${version[$i_index]}` && `isnumeric ${lversion[$i_index]}`; then
if [ ${version[$i_index]} -eq ${lversion[$i_index]} ]; then continue; fi
if [ ${version[$i_index]} -gt ${lversion[$i_index]} ]; then return 0; else return 1; fi
break
elif [ `isnumeric ${version[$i_index]}` -ne `isnumeric ${lversion[$i_index]}` ]; then
if [ "${version[$i_index]}" = "${lversion[$i_index]}" ]; then continue;fi
if [ "${version[$i_index]}" \> "${lversion[$i_index]}" ]; then return 0; else return 1; fi
break
fi
done
return 1
}
get_pkg_repo(){
pkg_repo=`LC_ALL=C /usr/bin/pacman -Si $1 2> /dev/null \
| grep -m1 Repository | awk -F": " '{print $2}'`
case $pkg_repo in
core) ;;
extra) ;;
testing) ;;
community) ;;
community-testing) ;;
*) pkg_repo="aur" ;;
esac
}
check_files(){
if [ ! -d "${workspace}/pkgs" ]; then
mkdir -p "${workspace}/pkgs" || exit 1
fi
if [ "$NOCHANGELOG" != "TRUE" -a ! -f "${workspace}/$changelog" ]; then
touch "${workspace}/$changelog"
fi
}
......@@ -69,6 +69,19 @@ print_upload_error(){
brokenpkgs[${#brokenpkgs[@]}]=$1
}
get_pkg_repo(){
pkg_repo=`LC_ALL=C /usr/bin/pacman -Si $1 2> /dev/null \
| grep -m1 Repository | awk -F": " '{print $2}'`
case $pkg_repo in
core) ;;
extra) ;;
testing) ;;
community) ;;
community-testing) ;;
*) pkg_repo="aur" ;;
esac
}
extract_pkg(){
if [ -f "${workspace}/pkgs/$1.tar.gz" ]; then
if [ "$VERBOSE" == "TRUE" ]; then
......@@ -109,7 +122,7 @@ build_pkg(){
# if the package isn't on the repo set repopkgver to 0-0
[ "${#repopkgver}" -le "0" ] && repopkgver="0-0"
if `is_x_gt_y ${pkgsver[$INDEX]} $repopkgver` || [ "$FORCE" == "TRUE" ]; then
if `vercmp ${pkgsver[$INDEX]} $repopkgver` || [ "$FORCE" == "TRUE" ]; then
if [ ! -f ${workspace}/$1-${pkgsver[$INDEX]}-*${PKGEXT} -o "$NOBUILD" != "TRUE" ]; then
cd "${workspace}/pkgs/$1"
if [ "$VERBOSE" == "TRUE" ]; then
......@@ -467,8 +480,17 @@ get_pkgs_list(){
fi
}
check_files(){
if [ ! -d "${workspace}/pkgs" ]; then
mkdir -p "${workspace}/pkgs" || exit 1
fi
if [ "$NOCHANGELOG" != "TRUE" -a ! -f "${workspace}/$changelog" ]; then
touch "${workspace}/$changelog"
fi
}
main(){
source /usr/lib/repoman/basicfunctions.sh || exit 1
[ "$UID" -eq 0 ] && ROOT_FLAG=" --asroot"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment