pax_global_header00006660000000000000000000000064107652423510014517gustar00rootroot0000000000000052 comment=6863a0a2d0bc2fd637948a0e26ebab64bde67ca3 sisyphus-0.9.2/000075500000000000000000000000001076524235100134145ustar00rootroot00000000000000sisyphus-0.9.2/.gear/000075500000000000000000000000001076524235100144105ustar00rootroot00000000000000sisyphus-0.9.2/.gear/rules000064400000000000000000000000371076524235100154650ustar00rootroot00000000000000tar: . name=sisyphus-@version@ sisyphus-0.9.2/bin/000075500000000000000000000000001076524235100141645ustar00rootroot00000000000000sisyphus-0.9.2/bin/sisyphus_add_new000064400000000000000000000036531076524235100174660ustar00rootroot00000000000000#!/bin/bash -e # # $Id: sisyphus_add_new,v 1.6 2005/07/01 14:59:29 ldv Exp $ # # Copyright (C) 2003-2004 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # sisyphus_add_new script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config . /etc/sisyphus/functions lock_incoming() { cd "$START_DIR" chmod g-rw RPMS SRPMS } unlock_incoming() { cd "$START_DIR" chmod g+rw RPMS SRPMS } exit_handler() { local rc=$? trap - EXIT unlock_incoming exit $rc } lock_incoming trap exit_handler EXIT HUP INT PIPE TERM QUIT if ! cleanup_incoming RPMS/*.rpm SRPMS/*.rpm; then echo "ERROR: you have problems with your incoming files" >&2 exit 1 fi check_incoming() { echo -n "Verifying repositories: " if ! check_missing_srpms "$@"; then echo "ERROR: you have orphaned RPMS" >&2 return 1 fi if ! check_obsolete_srpms "$@"; then echo "ERROR: you have orphaned SRPMS" >&2 exit 1 fi sisyphus_check -q "$@" echo "done." } check_incoming RPMS SRPMS upload_bin_new RPMS upload_src_new SRPMS if ! cleanup_incoming RPMS/*.rpm SRPMS/*.rpm; then echo "ERROR: you have problems with your incoming files" >&2 exit 1 fi check_incoming RPMS SRPMS sisyphus_prepare sisyphus-0.9.2/bin/sisyphus_cleanup_dups000064400000000000000000000132151076524235100205420ustar00rootroot00000000000000#!/bin/sh -e # # $Id: sisyphus_cleanup_dups,v 1.11 2005/07/01 14:59:29 ldv Exp $ # # Copyright (C) 2003-2005 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # sisyphus_cleanup_dups script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config . /etc/sisyphus/functions TEST= force_yes= dereference=1 show_help() { cat <&2 exit 1 } process_dups() { local rep arch rep="$1" && shift || Fatal "first argument required" arch="$1" && shift || Fatal "second argument required" mkdir -p -m700 -- "$WORKDIR/$rep" echo -n "Processing $rep: " pushd "$PREFIX/$NEW_FILE_PREFIX/$rep" >/dev/null for n in `ls -1 |grep ".$arch.rpm\$" |cut -c1 |LC_COLLATE=C sort -u`; do printf %s "$n" rpmrdups "$n"*.$arch.rpm >> "$WORKDIR/$rep/dups" done popd >/dev/null echo } sources_index() { local arch n rc=1 >"$WORKDIR/src-arch" for arch in $ARCHITECTURES; do echo -n "Generating SRPMS-$arch list: " pushd "$PREFIX/$NEW_FILE_PREFIX/$arch/RPMS" >/dev/null for n in `ls -1 |grep ".$arch.rpm\$" |cut -c1 |LC_COLLATE=C sort -u`; do printf %s "$n" rpmquery -p --qf '%{SOURCERPM}\t%{ARCH}\n' -- "$n"*.$arch.rpm >>"$WORKDIR/src-arch" done popd >/dev/null echo rc=0 done [ ! -s "$WORKDIR/src-arch" ] || sort -u -o "$WORKDIR/src-arch" "$WORKDIR/src-arch" return $rc } correct_dups() { local rep="$1" && shift || Fatal "first argument required" local n f fn >"$WORKDIR/$rep/needremove" cut -d\ -f2- -- "$WORKDIR/$rep/dups" | tr \ \\n | while read f; do fn="${f##*/}" [ -f "$PREFIX/$NEW_FILE_PREFIX/$rep/$fn" ] || continue grep --mmap -qsF "$fn" "$WORKDIR/src-arch" && printf %s\\n "Package retained: $fn" || printf '%s\n' "$f" >> "$WORKDIR/$rep/needremove" done } confirm_cleanup() { local REPLY while :; do echo "Really purge files listed above? (yes/no)" read if [ "$REPLY" = no ]; then echo Cancelled! return 1 fi if [ "$REPLY" = yes ]; then break fi done return 0 } repos_cleanup() { local type="$1" && shift || Fatal "first argument required" [ "$#" -gt 0 ] || return 1 local rep for rep in $*; do [ -s "$WORKDIR/$rep/dups" ] || continue echo "Duplicated files found in \"$rep\" repository:" cat -- "$WORKDIR/$rep/dups" echo if [ "$type" = "bin" ]; then cut -d\ -f2- -- "$WORKDIR/$rep/dups" | tr \ \\n | sort -u > "$WORKDIR/$rep/needremove" elif [ "$type" = "src" ]; then correct_dups "$rep" fi [ -s "$WORKDIR/$rep/needremove" ] || continue pushd "$PREFIX/$NEW_FILE_PREFIX/$rep" >/dev/null if [ -z "$force_yes" ]; then cat -- "$WORKDIR/$rep/needremove" | xargs -r ls -Llt -- confirm_cleanup || continue fi if [ -n "$dereference" ]; then cat -- "$WORKDIR/$rep/needremove" | xargs -r realpath | xargs -r $TEST rm -v -- else cat -- "$WORKDIR/$rep/needremove" | xargs -r $TEST rm -v -- fi popd >/dev/null done } remove_unused() { echo "Removeing unused src: " pushd "$PREFIX/$NEW_FILE_PREFIX/SRPMS" >/dev/null find ! -name 'altlinux-release-*src\.rpm' -name \*.src.rpm | cut -d/ -f2- | sort -u >"$WORKDIR/src.present" cut -f1 "$WORKDIR/src-arch" > "$WORKDIR/src.used" sort -u "$WORKDIR/src.used" | join -v2 - "$WORKDIR/src.present" > "$WORKDIR/src-without-bin" [ -s "$WORKDIR/src-without-bin" ] || return 0 echo "Unused source packages found in repository:" cat "$WORKDIR/src-without-bin" echo confirm_cleanup || return 0 cat "$WORKDIR/src-without-bin" | xargs rm -vf -- popd >/dev/null } WORKDIR= exit_handler() { local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } TEMP=`getopt -n $PROG -o a:,f,h,p:,P,d -l architectures:,apt-config:,force-yes,help,no-dereference,prefix:,dry-run -- "$@"` || show_usage eval set -- "$TEMP" while :; do case "$1" in -a|--architectures) shift ARCHITECTURES="$1" ;; -p|--prefix) shift PREFIX="$(readlink -ev "$1")" ;; -f|--force-yes) force_yes=1 ;; -P|--no-dereference) dereference= ;; -d|--dry-run) TEST=echo ;; -h|--help) show_help ;; --) shift; break ;; *) Fatal "unrecognized option: $1" ;; esac shift done [ -n "$ARCHITECTURES" ] || Fatal 'Invalid ARCHITECTURES.' trap exit_handler HUP INT QUIT TERM EXIT WORKDIR="$(mktemp -dt "$PROG.XXXXXXXXXX")" echo 'Making dups in repositories...' reps_bin= for arch in $ARCHITECTURES; do reps_bin="$reps_bin $arch/RPMS" process_dups "$arch/RPMS" "$arch" done process_dups "SRPMS" "src" repos_cleanup bin $reps_bin sources_index repos_cleanup src "SRPMS" remove_unused sisyphus-0.9.2/bin/sisyphus_cleanup_incoming000064400000000000000000000017761076524235100214030ustar00rootroot00000000000000#!/bin/sh -e # # $Id: sisyphus_cleanup_incoming,v 1.3 2005/07/01 14:59:29 ldv Exp $ # # Copyright (C) 2003 Dmitry V. Levin # # sisyphus_cleanup_incoming script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config . /etc/sisyphus/functions if [ $# -eq 0 ]; then echo "Usage: ${0##*/} [files]" else cleanup_incoming "$@" fi sisyphus-0.9.2/bin/sisyphus_gen_contents000064400000000000000000000036501076524235100205500ustar00rootroot00000000000000#!/bin/sh -e # # Copyright (C) 2005 Dmitry V. Levin # Copyright (C) 2008 Alexey Tourbin # # sisyphus_gen_contents script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # export LANG=C LANGUAGE=C LC_ALL=C PROG="${0##*/}" [ $# -eq 1 ] || { echo "Usage: $PROG " >&2; exit 1; } cd "$1" shift WORKDIR= exit_handler() { local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } trap exit_handler HUP INT QUIT TERM EXIT WORKDIR="$(mktemp -d -t "$PROG.XXXXXXXXXX")" # generate filelist. find -mindepth 1 -maxdepth 1 -name \*.rpm -print0 | xargs -r0 rpmquery -p --qf '[%{FILENAMES}\t%{NAME}\n]' -- | fgrep -v ' ' | sort -u >"$WORKDIR"/f-list # generate path-like provides list. find -mindepth 1 -maxdepth 1 -name \*.rpm -print0 | xargs -r0 rpmquery -p --qf '[%{PROVIDENAME}\t%{NAME}\n]' -- | grep '^/' | fgrep -v ')' | fgrep -v ' ' | sort -u >"$WORKDIR"/p-list cd "$WORKDIR" # find file dups. cut -f1 f-dups # generate alternatives-like virtual path list. comm -13 f-list p-list >vp-list # virtual paths should always map to themselves. cut -f1 vp-force-dups sort -u -k1,1 vp-force-dups f-dups f-list sisyphus-0.9.2/bin/sisyphus_genhash000064400000000000000000000044401076524235100174750ustar00rootroot00000000000000#!/bin/sh -e # # $Id: sisyphus_genhash,v 1.8 2005/07/01 18:40:26 ldv Exp $ # # Copyright (C) 2003-2005 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # sisyphus_genhash script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config for arch in $ARCHITECTURES; do echo "Generating apt indices for $arch" TZ=UTC genbasedir \ --archive="$ARCHIVE" \ --origin="$ORIGIN" \ --label="$LABEL" \ --codename="$CODENAME" \ --architectures="$ARCHITECTURES" \ --architecture="$arch" \ --suite="$SUITE" \ --description="$DESCRIPTION" \ --version="$VERSION" \ --topdir="$PREFIX" \ --flat \ $GENBASEDIR_OPT_ARGS \ "$@" \ "$arch" $ALL_COMPONENTS done echo -n 'Generating contents indices:' for arch in $ARCHITECTURES; do printf %s " $arch" c_dir="$PREFIX/$NEW_FILE_PREFIX/$arch/RPMS" c_file="$PREFIX/$arch/base/contents_index" workfile="$(mktemp "$c_file".XXXXXXXXXX)" sisyphus_gen_contents "$c_dir" >"$workfile" && egrep -qs '^/((usr/)?bin|(usr/)?sbin|usr/X11R6/bin|etc)/' "$workfile" && chmod 644 "$workfile" && mv -f "$workfile" "$c_file" && printf %s '-done' || { rm -f "$workfile"; printf %s '-skip'; } done echo if [ -n "$(printf %s "$GENBASEDIR_SIGNING_ARGS" |tr -d '[:space:]')" ]; then for arch in $ARCHITECTURES; do rel="$PREFIX/$arch/base/release" echo "Signing $rel" gpg -armour --quiet --detach-sign --yes \ `printf %s "$GENBASEDIR_SIGNING_ARGS" |sed -e 's/-s\> *//'` -- "$rel" cat "$rel.asc" >>"$rel" rm -f "$rel.asc" done fi echo "Preparing sisyphus for upload" sisyphus_prepare sisyphus-0.9.2/bin/sisyphus_movement000064400000000000000000000040131076524235100177060ustar00rootroot00000000000000#!/bin/sh -e # -*- mode: Shell-script; tab-width: 8; fill-column: 70; -*- # # $Id: movement,v 0.0.1 2005/10/02 21:03:06 legion Exp $ # # Copyright (C) 2005 Alexey Gladkov # # sisyphus_movement script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config TEST=${TEST:+echo} WORKDIR= exit_handler() { local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } trap exit_handler HUP INT QUIT TERM EXIT WORKDIR="$(mktemp -dt "$PROG.XXXXXXXXXX")" >"$WORKDIR/noarch" printf %s:\ "Prepare" for a in $ARCHITECTURES; do printf %s "$a" find "$PREFIX/$NEW_FILE_PREFIX/$a/RPMS" \ -name '*\.rpm' \ -execdir rpmquery -p --qf="$PREFIX/$NEW_FILE_PREFIX/$a/RPMS/%{NAME}-%{VERSION}-%{RELEASE}.%|SOURCERPM?{%{ARCH}}:{src}|.rpm\t%{BUILDTIME}\t%{NAME}\n" \{\} \+ > "$WORKDIR/$a" printf %s\ "-done" done echo for a in $ARCHITECTURES; do [ "$a" != "noarch" ] || continue printf Removing\ %s:\\n "$a" > "$WORKDIR/last.$a" sort -k 3,3 "$WORKDIR/noarch" "$WORKDIR/$a" | uniq -f2 -d | cut -f3 | while read n; do grep -hG "[[:space:]]$n$" "$WORKDIR/noarch" "$WORKDIR/$a" | sort -r -k 2,2 | uniq -f2 -d >> "$WORKDIR/last.$a" done sort -k 3,3 "$WORKDIR/noarch" "$WORKDIR/$a" | uniq -f2 -d --all-repeated=separate | fgrep -vf "$WORKDIR/last.$a" | cut -f1 | xargs -r $TEST rm -vf -- done echo sisyphus-0.9.2/bin/sisyphus_prepare000064400000000000000000000025341076524235100175200ustar00rootroot00000000000000#!/bin/sh # # $Id: sisyphus_prepare,v 1.5 2005/07/01 18:40:26 ldv Exp $ # # Copyright (C) 2003-2004 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # sisyphus_prepare script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config find "$PREFIX" -not -type l -print0 | xargs -r0 chmod a+rX,go-w -- 2>/dev/null chgrp -R "$PERM_GROUP" -- "$PREFIX" 2>/dev/null chmod -R "$PERM_MODE" -- "$PREFIX" 2>/dev/null find "$PREFIX/files/$LIST_PREFIX" -type f -name list.\* -print0 | xargs -r0 chmod g+w -- 2>/dev/null find "$PREFIX" -type d -print0 | xargs -r0 chmod g+ws -- 2>/dev/null sisyphus-0.9.2/bin/sisyphus_relink000064400000000000000000000123221076524235100173420ustar00rootroot00000000000000#!/bin/sh -e # # $Id: sisyphus_relink,v 1.7 2005/07/01 14:59:29 ldv Exp $ # # Copyright (C) 2003-2005 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # sisyphus_relink script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config . /etc/sisyphus/functions cd "$PREFIX" : ${debug:=} : ${verbose:=} PROG="${0##*/}" WORKDIR= exit_handler() { local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } trap exit_handler HUP INT QUIT TERM EXIT WORKDIR="$(mktemp -d -t "$PROG.XXXXXXXXXX")" unlink_symlinked() { local dir=$1 shift [ -d "$dir" ] || return 0 echo "Unlinking in $dir" find "$dir/" -type l -delete } check_arch_dups() { local arch=$1 shift echo "Checking layout dups for $arch" local out out=$(cut -f1 "files/$LIST_PREFIX/list.$arch".* |sort |uniq -c |awk '{if ($1!=1) print $2}') if [ -n "$out" ]; then echo "ERROR: duplicated names found in $arch layout" >&2 duplicate_pkgs="$duplicate_pkgs $out " fi } calc_arch_names() { local arch=$1 shift local rpms=$1 shift echo "Calculating pkgnames in files/$rpms for $arch" find "files/$rpms/" -type f -name \*.rpm -print0 | xargs -r0 rpmquery -p --qf '%{NAME} %{NAME}-%{VERSION}-%{RELEASE}.%|SOURCERPM?{%{ARCH}}:{src}|.rpm %|SOURCERPM?{%{SOURCERPM}}:{}|\n' -- | sort -u >"$WORKDIR/$arch" } check_arch_missing() { local arch=$1 shift local list="$WORKDIR/$arch" [ -s "$list" ] || return 0 echo "Checking layout misses for $arch" local out out=$(cut -f1 "files/$LIST_PREFIX/list.$arch".* |sort -u |join "$list" - -v1 |cut -d' ' -f1 |sort -u) if [ -n "$out" ]; then echo "ERROR: unlisted packages found in $arch layout">&2 missing_pkgs="$missing_pkgs $(printf %s "$out" |join "$list" - -o 1.2) " return 1 fi local f for f in "files/$LIST_PREFIX/list.$arch".*; do out=$(cut -f1 "$f" |sort -u |join "$list" - -v2 |cut -d' ' -f1 |sort -u) if [ -n "$out" ]; then echo "WARNING: orphaned names found in ${f#files/$LIST_PREFIX/list.} layout" >&2 orphaned_pkgs="$orphaned_pkgs $out " fi done } calc_comp() { local arch=$1 shift local comp=$1 shift local sarch=$1 local n=2 [ -z "$sarch" ] && sarch="$arch" || n=3 local list="files/$LIST_PREFIX/list.$arch.$comp" [ -s "$list" ] || return 0 echo "Calculating components: $arch/$comp" cut -f1 "$list" |sort -u |join "$WORKDIR/$arch" - | cut -d' ' -f$n | sort -u >"$WORKDIR/$sarch.$comp" } relink_arch() { local arch=$1 shift local comp=$1 shift local rpms=$1 shift local rfiles=$1 shift local list="$WORKDIR/$arch.$comp" [ -s "$list" ] || return 0 echo "Relinking in $rpms.$comp" local rc=0 local n f local full_d full_r full_n r local d="$rpms.$comp" full_d=`readlink -ev "$d"` || return 0 [ -d "$d" ] || { echo "$d: Not a directory"; return 0; } full_r=`readlink -ev "files/$rfiles"` || return 0 [ -d "files/$rfiles" ] || { echo "files/$rfiles: Not a directory"; return 0; } r=`relative "$full_r" "$full_d/"` cat "$list" |while read n; do f="files/$rfiles/$n" [ -f "$f" ] || continue $debug ln -s $verbose "$r/$n" "$d/" || rc=1 done return $rc } problems_list= duplicate_pkgs= missing_pkgs= orphaned_pkgs= check_arch_dups "src" || exit calc_arch_names "src" "SRPMS" || exit check_arch_missing "src" || problems_list="$problems_list src" for arch in $ARCHITECTURES; do check_arch_dups "$arch" || exit calc_arch_names "$arch" "$arch/RPMS" || exit if ! check_arch_missing "$arch"; then problems_list="$problems_list $arch" fi for comp in $LINKONLY_COMPONENTS $MIXED_COMPONENTS; do calc_comp "$arch" "$comp" || exit unlink_symlinked "$arch/RPMS.$comp" || exit if ! relink_arch "$arch" "$comp" "$arch/RPMS" "$arch/RPMS"; then echo "ERROR: $arch" problems_list="$problems_list $arch" fi calc_comp "$arch" "$comp" "src" || exit unlink_symlinked "$arch/SRPMS.$comp" || exit if ! relink_arch "src" "$comp" "$arch/SRPMS" "SRPMS"; then echo "ERROR: $arch" problems_list="$problems_list $arch" fi done find "$WORKDIR" -type f -name 'src.*' -delete done [ -z "$problems_list" ] || printf '\n%s\n\n' "problems in:$problems_list" >&2 if [ -n "$duplicate_pkgs" ]; then Info "ERROR: duplicated names found:" printf %s\\n "$duplicate_pkgs" >&2 fi if [ -n "$missing_pkgs" ]; then Info "ERROR: unlisted packages found:" printf %s\\n "$missing_pkgs" >&2 fi if [ -n "$orphaned_pkgs" ]; then Info "ERROR: orphaned names found:" printf %s\\n "$orphaned_pkgs" >&2 fi [ -z "$duplicate_pkgs" -a -z "$missing_pkgs" -a -z "$orphaned_pkgs" ] || exit 1 sisyphus-0.9.2/bin/sisyphus_unpaired000064400000000000000000000065351076524235100176760ustar00rootroot00000000000000#!/bin/sh -e # # $Id: sisyphus_unpaired,v 1.2 2005/07/01 18:20:05 ldv Exp $ # # Copyright (C) 2005 Dmitry V. Levin # # sisyphus_unpaired script. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # . /etc/sisyphus/config . /etc/sisyphus/functions show_help() { cat < Valid options are: -a, --architectures=LIST architectures to handle; -p, --prefix=DIR path to repository location; -s, --save-index generate index file; -q, --quiet try to be more quiet; -v, --verbose try to be more verbose; -h, --help show this text and exit. EOF exit } show_usage() { [ -z "$*" ] || Info "$*" echo "Try \`$PROG --help' for more information." >&2 exit 1 } WORKDIR= exit_handler() { local rc=$? trap - EXIT [ -z "$WORKDIR" ] || rm -rf -- "$WORKDIR" exit $rc } DATADIR= verbose= save_index= TEMP=`getopt -n $PROG -o a:,p:,s,h,q,v -l architectures:,prefix:,save-index,help,quiet,verbose -- "$@"` || show_usage eval set -- "$TEMP" while :; do case $1 in -a|--architectures) shift ARCHITECTURES="$1" ;; -p| --prefix) shift PREFIX="$(readlink -ev "$1")" ;; -s|--save-index) save_index=1 ;; -q|--quiet) verbose= ;; -v|--verbose) verbose=-v ;; -h|--help) show_help ;; --) shift; break ;; *) Fatal "unrecognized option: $1" ;; esac shift done # Exactly one argument, please. [ "$#" -ge 1 ] || show_usage 'Insufficient arguments.' [ "$#" -le 1 ] || show_usage 'Too many arguments.' DATADIR="$(readlink -ev "$1")" cd "$PREFIX" trap exit_handler HUP INT QUIT TERM EXIT WORKDIR="$(mktemp -dt "$PROG.XXXXXXXXXX")" > "$WORKDIR/src-bin" for a in $ARCHITECTURES; do [ -z "$verbose" ] || echo -n "Processing $a: " pushd "$NEW_FILE_PREFIX/$a/RPMS" >/dev/null for n in `ls -1 |grep ".$arch.rpm\$" |cut -c1 |LC_COLLATE=C sort -u`; do [ -z "$verbose" ] || printf %s "$n" rpmquery -p --qf '%{SOURCERPM}\t%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n' "$n"*.rpm >>"$WORKDIR/src-bin" done popd >/dev/null [ -z "$verbose" ] || echo done subst '/^altlinux-release-.*src.rpm/d' "$WORKDIR/src-bin" sort -u -o "$WORKDIR/src-bin" "$WORKDIR/src-bin" pushd "$NEW_SRC_REPOSITORIES" >/dev/null find ! -name 'altlinux-release-*src\.rpm' -name \*.src.rpm | cut -d/ -f2- | sort -u >"$WORKDIR/src.present" popd >/dev/null cut -f1 $WORKDIR/src-bin |sort -u >"$WORKDIR/src.used" cd "$DATADIR" cat "$WORKDIR/src.used" | join -v2 - "$WORKDIR/src.present" >src-without-bin cat "$WORKDIR/src.used" | join -v1 - "$WORKDIR/src.present" >src-not-existent cat "$WORKDIR/src-bin" | join -v1 -o 1.2 - "$WORKDIR/src.present" >bin-without-src [ -z "$save_index" ] || sort -o src-bin.index "$WORKDIR/src-bin" sisyphus-0.9.2/etc/000075500000000000000000000000001076524235100141675ustar00rootroot00000000000000sisyphus-0.9.2/etc/config000064400000000000000000000017451076524235100153660ustar00rootroot00000000000000#!/bin/sh unset \ LANG \ LANGUAGE \ LINGUAS \ LC_CTYPE \ LC_NUMERIC \ LC_TIME \ LC_COLLATE \ LC_MONETARY \ LC_MESSAGES \ LC_PAPER \ LC_NAME \ LC_ADDRESS \ LC_TELEPHONE \ LC_MEASUREMENT \ LC_IDENTIFICATION \ LC_ALL \ ||: #Sisyphus root PREFIX="/raid/ALT/Sisyphus" #Architectures ARCHITECTURES="i586 i686 i386 x86_64 noarch" #Distribution name : ${DISTRIBUTION:=i586} ARCHIVE="$(date +%s)" ORIGIN='ALT Linux Team' LABEL='Sisyphus' CODENAME='ALT' SUITE='ALT Linux' DESCRIPTION='ALT Linux Sisyphus' VERSION=unstable GENBASEDIR_OPT_ARGS='--bz2only --mapi --no-oldhashfile' : ${GENBASEDIR_SIGNING_ARGS:='-s --default-key=security@altlinux.ru'} #Components LINKONLY_COMPONENTS='classic' MIXED_COMPONENTS= ALL_COMPONENTS="$LINKONLY_COMPONENTS" #new files location NEW_FILE_PREFIX=files LIST_PREFIX=list #Obsolete variables NEW_SRC_REPOSITORIES="$NEW_FILE_PREFIX/SRPMS" #permissions PERM_GROUP=sisyphus PERM_MODE='g+w,a+rX' #outgoing incoming : ${START_DIR:=/raid/OUT/Sisyphus} sisyphus-0.9.2/etc/functions000064400000000000000000000127571076524235100161360ustar00rootroot00000000000000#!/bin/sh -e # # $Id: functions,v 1.28 2005/07/01 15:02:47 ldv Exp $ # # Copyright (C) 2003-2005 Stanislav Ievlev , # Dmitry V. Levin , # Alexey Gladkov # # Functions used by sisyphus scripts. # # This file 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 St, Fifth Floor, Boston, MA 02110-1301 USA. # # debug mode for cleanup stuff : ${test:=} unset CDPATH ||: PROG="${0##*/}" Info() { printf '%s\n' "$PROG: $*" >&2 } Fatal() { printf %s\\n "$PROG: $*" >&2 exit 1 } quiet= Message() { [ -z "$quiet" ] || return 0 printf %s\\n "$*" } show_bad_files= FileError() { local text="$1" shift || return local f="$1" if [ -n "$f" ]; then text="${text#$f: }" text="$f: $text" [ -z "$show_bad_files" ] || printf '%s\n' "$f" fi printf '%s\n' "$text" >&2 } identic() { local f1="$1" shift || return local f2="$1" shift || return local i1 i2 i1="$(stat -- "$f1" |grep '^Device: ')" i2="$(stat -- "$f2" |grep '^Device: ')" [ "$i1" = "$i2" ] } valid_architecture() { local rpm_arch="$1" && shift || return 1 local archs=" src $ARCHITECTURES " [ "$archs" != "${archs#* $rpm_arch }" ] } target_cleanup() { local f=$1 shift || return local n="${f##*/}" local rep for rep in "$@"; do local target="$PREFIX/$rep/$n" if [ -f "$target" ]; then # file with same name exists if identic "$f" "$target"; then # shouldn't normally happen FileError "belongs to $rep!!!" "$f" return 1 elif cmp -s "$f" "$target"; then $test rm -fv -- "$f" else FileError "differ from $rep!" "$f" return 1 fi return fi done echo "$f: new file!" } cleanup_incoming() { local rc=0 local f for f in "$@"; do if [ ! -r "$f" ]; then FileError "unavailable" "$f" continue fi local type rpm_arch component type="$(file -b "$f")" || { rc=1; continue; } rpm_arch="$f"; rpm_arch="${rpm_arch%.rpm}"; rpm_arch="${rpm_arch##*.}" [ -n "$rpm_arch" ] || { rc=1; continue; } valid_architecture "$rpm_arch" || { FileError "invalid architecture: $rpm_arch" "$f"; rc=1; continue; } if [ -z "${type##RPM v3 src *}" ]; then target_cleanup "$f" "$NEW_FILE_PREFIX/SRPMS" || rc=1 elif [ -z "${type##RPM v3 bin *}" ]; then target_cleanup "$f" "$NEW_FILE_PREFIX/$rpm_arch/RPMS" || rc=1 else FileError "unrecognized type: $type" "$f" rc=1 fi done return $rc } # upload source packages upload_src_new() { pushd $1 >/dev/null local f for f in *.rpm; do if [ ! -f "$f" ]; then [ "$f" != '*.rpm' ] || continue FileError "not a regular file" "$f" rc=1 continue fi $test cp -pv -- "$f" "$PREFIX/files/SRPMS/" done cleanup_incoming *.rpm popd >/dev/null } # upload binary packages upload_bin_new() { pushd $1 >/dev/null local f rpm_arch for f in *.rpm; do if [ ! -f "$f" ]; then [ "$f" != '*.rpm' ] || continue FileError "not a regular file" "$f" rc=1 continue fi rpm_arch="$f"; rpm_arch="${rpm_arch%.rpm}"; rpm_arch="${rpm_arch##*.}" [ -n "$rpm_arch" ] || { rc=1; continue; } valid_architecture "$rpm_arch" || { FileError "invalid architecture: $rpm_arch" "$f"; rc=1; continue; } $test cp -pv -- "$f" "$PREFIX/$NEW_FILE_PREFIX/$rpm_arch/RPMS" done cleanup_incoming *.rpm popd >/dev/null } # find orphaned RPMS check_missing_srpms() { local rpms_dir="$1" shift || return local srpms_dir="$1" shift || return local rc=0 local f n local repo_src="$PREFIX/$NEW_SRC_REPOSITORIES" for f in "$rpms_dir"/*.rpm; do if [ ! -f "$f" ]; then [ "$f" != "$rpms_dir/*.rpm" ] || continue FileError "not a regular file" "$f" rc=1 continue fi n=`LANG=C LANGUAGE=C LC_ALL=C rpmquery -p --qf '%{SOURCERPM}' -- "$f"` || { rc=1; continue; } n="${n%.src.rpm}" n="${n%.nosrc.rpm}" if ! [ -f "$srpms_dir/$n.src.rpm" -o -f "$srpms_dir/$n.nosrc.rpm" ] && ! [ -f "$repo_src/$n.src.rpm" -o -f "$repo_src/$n.nosrc.rpm" ]; then FileError "$n" "$f" rc=1 fi done return $rc } # find orphaned SRPMS check_obsolete_srpms() { local rpms_dir="$1" shift || return local srpms_dir="$1" shift || return [ -n "$(find "$srpms_dir" -mindepth 1 -maxdepth 1 -type f -name '*src\.rpm' -print -quit)" ] || return 0 local rc=0 local list= local f n pushd "$rpms_dir" >/dev/null #RPMS for f in *.rpm; do if [ ! -f "$f" ]; then [ "$f" != '*.rpm' ] || continue FileError "not a regular file" "$f" rc=1 continue fi n=`LANG=C LANGUAGE=C LC_ALL=C rpmquery -p --qf '%{SOURCERPM}' -- "$f"` || { rc=1; continue; } n="${n%.src.rpm}" n="${n%.nosrc.rpm}" list="$list $n" done popd >/dev/null pushd "$srpms_dir" >/dev/null #SRPMS for f in *.rpm; do if [ ! -f "$f" ]; then [ "$f" != '*.rpm' ] || continue FileError "not a regular file" "$f" rc=1 continue fi n="${f%.src.rpm}" n="${n%.nosrc.rpm}" if ! printf %s "$list" |grep -qsxF "$n"; then FileError "$f" rc=1 fi done popd >/dev/null return $rc } sisyphus-0.9.2/sisyphus.spec000064400000000000000000000153621076524235100161660ustar00rootroot00000000000000Name: sisyphus Version: 0.9.2 Release: alt1 Summary: Helpers for Sisyphus License: GPL Group: Development/Other BuildArch: noarch Packager: Dmitry V. Levin Requires: sisyphus_check Source: %name-%version.tar %description This package contains utilities to ease Sisyphus maintainance. %prep %setup -q %install mkdir -p %buildroot%_sysconfdir/%name install -p -m644 etc/* %buildroot%_sysconfdir/%name/ mkdir -p %buildroot%_bindir install -p -m755 bin/* %buildroot%_bindir/ ln -s sisyphus_cleanup_incoming %buildroot%_bindir/incoming_cleanup %files %dir %_sysconfdir/%name %config(noreplace) %_sysconfdir/%name/config %config %_sysconfdir/%name/functions %_bindir/* %changelog * Mon Mar 10 2008 Alexey Tourbin 0.9.2-alt1 - sisyphus_gen_contents: include alternatives-like virtual paths into contents_index file (e.g. /usr/bin/xvt -> /usr/bin/xvt) * Fri Mar 31 2006 Alexey Gladkov 0.9.1-alt3 - Removed migration scripts: sisyphus_migration_hack, sisyphus_update_classic. - config: Removed unused variables. - Removed obsolete components: base, castle, junior, kernel, master, contrib, non-free. - sisyphus_unpaired: Renamed --safe-index to --save-index. * Sun Oct 02 2005 Alexey Gladkov 0.9.1-alt2 - sisyphus_movement: new program. - sisyphus_cleanup_dups: + large reorganization; + --component removed; - functions optimizations. * Sat Jul 02 2005 Dmitry V. Levin 0.9.1-alt1 - sisyphus_unpaired: fixed typo in output file names. - sisyphus_genhash, sisyphus_prepare: handle more hardened file permissions properly. * Fri Jul 01 2005 Dmitry V. Levin 0.9-alt1 - sisyphus_unpaired: new program. - sisyphus_cleanup_dups: added options parser. * Fri Apr 08 2005 Dmitry V. Levin 0.8.2-alt1 - sisyphus_relink: tweaked output format. - sisyphus_genhash: + fixed contents indices generation; + moved signing to separate loop; + tweaked output format. * Wed Mar 23 2005 Dmitry V. Levin 0.8.1-alt1 - sisyphus_genhash: do not generate incomplete contents indices. - sisyphus_cleanup_dups: + serialized calculation; + handle duplicates on per-arch basis. * Tue Mar 22 2005 Dmitry V. Levin 0.8.0-alt1 - Migrated to new layout. * Thu Jun 24 2004 Dmitry V. Levin 0.7.2-alt1 - Moved sisyphus_check to separate subpackage. * Mon Jun 07 2004 Dmitry V. Levin 0.7.1-alt1 - functions: fixed quiet mode. - sisyphus_check: added new option: verbose. - sisyphus_add_new: enabled quiet mode by default. * Sat Jun 05 2004 Dmitry V. Levin 0.7.0-alt1 - functions: optimized, thanks to legion@. - functions/check_buildtime: new check. - functions/check: use it. - sisyphus_check: added new options: quiet, fast-check, show-bad-files. * Thu May 13 2004 Dmitry V. Levin 0.6.0-alt1 - sisyphus_relink: added support for new style lists. - functions/{check_summary,check_description}: new checks. - functions/check: use them. * Thu Feb 19 2004 Dmitry V. Levin 0.5.6-alt1 - functions/check_changelog: added check for empty changelog text. * Mon Feb 09 2004 Dmitry V. Levin 0.5.5-alt1 - functions/check_deps: + added initscripts to the list of forbidden dependencies. - functions/check_nvr: + new check (for invalid name-version-release). - functions/check: + use it. * Wed Nov 26 2003 Dmitry V. Levin 0.5.4-alt1 - functions/check_content: new check (forbidden .la files). - config: + define VERSION; + added --no-oldhashfile to GENBASEDIR_OPT_ARGS. - sisyphus_genhash: pass architecture and version to genbasedir. * Sun Nov 02 2003 Dmitry V. Levin 0.5.3-alt1 - sisyphus_check: + new option: --no-check=LIST; + better error diagnostics. * Tue Oct 28 2003 Dmitry V. Levin 0.5.2-alt1 - sisyphus/fhs: new file. - functions: use it. - sisyphus_check,sisyphus_add_new: turn into bash script. - functions/check_gpg: ignore default keyring. - functions/check*: better error checking. * Fri Oct 17 2003 Dmitry V. Levin 0.5.1-alt1 - functions/check_changelog: added check for packager format. - functions,sisyphus_check: added support to skip some checks. - functions/check*: better error checking. * Tue Sep 23 2003 Dmitry V. Levin 0.4.10-alt1 - functions/check_deps: added check for invalid dependencies. * Thu Sep 18 2003 Dmitry V. Levin 0.4.9-alt1 - functions/check_printable: new check. - functions/check: use it (#932). - functions/upload_{src,bin}: remove unused functions. - functions/check*: better error checking. * Tue Sep 09 2003 Dmitry V. Levin 0.4.8-alt1 - functions/check_buildhost: new check. - functions/check: use it. * Wed Aug 20 2003 Dmitry V. Levin 0.4.7-alt1 - sisyphus_gen_contents: new script. - functions/check_fhs: fixed possible false alarms on empty list. - functions/check_deps: added to forbidden requires: fileutils, sh-utils, textutils. * Thu Jun 05 2003 Stanislav Ievlev 0.4.6-alt1.1 - sync * Wed May 14 2003 Dmitry V. Levin 0.4.6-alt1 - sisyphus_check: check deps. * Tue Apr 29 2003 Dmitry V. Levin 0.4.5-alt1 - sisyphus_check: check permisions in source archive. * Sat Apr 19 2003 Dmitry V. Levin 0.4.4-alt1 - Updated. * Wed Feb 19 2003 Stanislav Ievlev 0.4.3-alt1 - sync. new checks (FHS) * Tue Dec 10 2002 Stanislav Ievlev 0.4.2-alt1 - sync. new relink algo by ldv. unset LC_* * Mon Oct 21 2002 Stanislav Ievlev 0.4.1-alt5 - sync * Fri Sep 27 2002 Stanislav Ievlev 0.4.1-alt4 - sync * Tue Sep 10 2002 Stanislav Ievlev 0.4.1-alt3 - sync with latest changes: - new utils: sisyphus_relink sisyphus_add_new * Tue Aug 13 2002 Stanislav Ievlev 0.4.1-alt2 - rebuild to fix deps * Mon Aug 12 2002 Stanislav Ievlev 0.4.1-alt1 - sync last changes - added changelog checking * Thu Aug 08 2002 Stanislav Ievlev 0.4-alt1 - sync last changes - added symlink incoming_cleanup to sisyphus_cleanup_incoming - added automatic package group check, suid/sgid check - added sisyphus_check utility - check() moved to functions - /etc/sisyphus/functions no config(noreplace) now * Thu Jun 20 2002 Dmitry V. Levin 0.3.1-alt1 - More code cleanup. * Thu Jun 20 2002 Dmitry V. Levin 0.3-alt1 - Specfile and code cleanup. * Mon Jun 10 2002 Stanislav Ievlev 0.2-alt1 - added master repository - added cleanup dups script * Wed Jun 05 2002 Stanislav Ievlev 0.1-alt1 - Inital release for Sisyphus