Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improvements to DAR related to RPMforge-extras, duplicates and RHEL6

  • Loading branch information...
commit 6c81c6d3fbdd606082e3baf98c78426e07393cff 1 parent f19e134
@dagwieers authored
View
2  Makefile
@@ -9,7 +9,7 @@ sysconfdir=/etc
localstatedir=/var
sbindir=/usr/sbin
-DIST_SCRIPTS=dar-build dar-dotty dar-exec dar-kickoff dar-new dar-prepare dar-repo dar-shell dar-sync dar-update
+DIST_SCRIPTS=dar-build dar-dotty dar-exec dar-kickoff dar-metadata dar-new dar-prepare dar-repo dar-shell dar-sync dar-update
DIST_LIBS=dar-functions
DESTDIR=
View
3  commands.txt
@@ -2,7 +2,8 @@
### """"""""
### Install build environment
-old=fc3-i386; new=el4-i386; chr=el4i; diff -u <(cut -f1 /dar/pub/rpmforge/persona/dag/state/rpmqa-$old.list) <(cut -f1 /dar/pub/rpmforge/persona/dag/state/rpmqa-$new.list) | grep "^-" | sed -e 's|^-||' | xargs dar-update -d $chr
+#old=fc3-i386; new=el4-i386; chr=el4i; diff -u <(cut -f1 /dar/pub/rpmforge/persona/dag/state/rpmqa-$old.list) <(cut -f1 /dar/pub/rpmforge/persona/dag/state/rpmqa-$new.list) | grep "^-" | sed -e 's|^-||' | xargs dar-update -d $chr
+dar-exec -d el6i yum install $(old=el5i; new=el6i; diff -u <(dar-exec -q -d $old rpm -qa --qf '%{name}\\n' | sort) <(dar-exec -q -d $new rpm -qa --qf '%{name}\\n' | sort) | grep "^-" | sed -e 's|^-||')
### Build missing packages compared to other dist
old=fc3-i386; new=el4-i386; chr=el4i; diff -u <(cut -f1 /dar/pub/rpmforge/persona/dag/state/packages-$old.list) <(cut -f1 /dar/pub/rpmforge/persona/dag/state/packages-$new.list) | grep "^-" | sed -e 's|^-||' | xargs dar-build -n -d $chr
View
21 dar-build
@@ -62,7 +62,6 @@ for arg in $PKGS; do
chown -R $BUILD_USER.$BUILD_GROUP "$SPECDIR/"
chmod -R a+r "$SPECDIR/"
- set_tag
set_dists
set_exclude_dist
set_exclusive_dist
@@ -82,6 +81,7 @@ for arg in $PKGS; do
continue
fi
+ set_tag
if [ "$TAG" ]; then
TAGS="$TAG"
fi
@@ -146,20 +146,11 @@ for arg in $PKGS; do
### Check if already build (2 version schemes, multiple disttags)
for disttag in $DISTNAME $DISTTAG; do
for tag in $TAGS; do
- NEWRPMFILE="$app-$VERSION-$RELEASE.$arch.rpm"
- OLDRPMFILE="$app-$VERSION-$RELEASE.$arch.rpm"
- for rpmfile in $NEWRPMFILE $OLDRPMFILE; do
-# echo $rpmfile
- if [ -z "$FORCE_OVERWRITE" -a -f "$PACKAGEDIR/$app/$rpmfile" ]; then
- warning "Package \"$PACKAGEDIR/$app/$rpmfile\" already exists."
-
-# if [ -z "$SOURCE_DISTS" ]; then
-# SOURCE_DISTS="$DISTNICK"
-# fi
-
- continue 4
- fi
- done
+ rpmfile="$app-$VERSION-$RELEASE.$arch.rpm"
+ if [ -z "$FORCE_OVERWRITE" -a -f "$PACKAGEDIR/$app/$rpmfile" ]; then
+ warning "Package \"$PACKAGEDIR/$app/$rpmfile\" already exists."
+ continue 3
+ fi
done
done
View
46 dar-duplicate
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+source "/usr/share/dar/dar-functions"
+
+for pkg in /dar/rpms/*; do
+ title=
+ base="$(basename $pkg)"
+ cat <<EOF | while read dist name path; do
+el6 EL6 rhel6s-i386
+el5 EL5 rhel5s-i386
+el4 EL4 rhel4as-i386
+el3 EL3 rhel3as-i386
+el2 EL2 rhel2.1as-i386
+EOF
+ unset ${!dist}
+ for file in /dar/mrepo/$path/{updates,optional}/$base-*.rpm; do
+ if [ -f $file ]; then
+ file=$(basename $file)
+ version="${file#*-}"
+ version="${file%.*.*}"
+ if [ -z "$title" ]; then
+ echo -e "$_BL_$_WH= Found \"$_YE$base/$base.spec$_WH\"$_DE"
+ title="yes"
+ fi
+ echo "### $name ships with $version"
+ echo "%{?$dist:# Tag: rfx}"
+ for file in /dar/packages/$base/*.$dist.rf.*.rpm; do
+ if [ -f $file ]; then
+ mkdir -p /dar/old/$base/
+ mv -v $file /dar/old/$base/
+ fi
+ done
+ for file in /dar/packages/$base/_buildlogs/*.$dist.rf.*.log.gz; do
+ if [ -f $file ]; then
+ mkdir -p /dar/old/$base/_buildlogs/
+ mv -v $file /dar/old/$base/_buildlogs/
+ fi
+ done
+ break
+ fi
+ done
+ done
+# if [ "$title" ]; then
+# echo
+# fi
+done
View
824 dar-functions
@@ -7,335 +7,321 @@ set -p #-u -f
DARCONFIG="/etc/dar/dar.conf"
### ANSI colors
-_DE="\033[0;0m" # Default
-_BK="\033[0;30m" # Black
-_DB="\033[0;34m" # Dark Blue
-_SI="\033[0;37m" # Silver
-_GA="\033[1;30m" # Gray
-_RE="\033[1;31m" # Red
-_GR="\033[1;32m" # Green
-_YE="\033[1;33m" # Yellow
-_BL="\033[1;34m" # Blue
-_MA="\033[1;35m" # Magenta
-_CY="\033[1;36m" # Cyan
-_WH="\033[1;37m" # White
-
-_BK_="\033[40m" # Black BG
-_RE_="\033[41m" # Red BG
-_BL_="\033[44m" # Blue BG
-_WH_="\033[47m" # White BG
+_DE="\033[0;0m" # Default
+_BK="\033[0;30m" # Black
+_DB="\033[0;34m" # Dark Blue
+_SI="\033[0;37m" # Silver
+_GA="\033[1;30m" # Gray
+_RE="\033[1;31m" # Red
+_GR="\033[1;32m" # Green
+_YE="\033[1;33m" # Yellow
+_BL="\033[1;34m" # Blue
+_MA="\033[1;35m" # Magenta
+_CY="\033[1;36m" # Cyan
+_WH="\033[1;37m" # White
+
+_BK_="\033[40m" # Black BG
+_RE_="\033[41m" # Red BG
+_BL_="\033[44m" # Blue BG
+_WH_="\033[47m" # White BG
_BELL=""
### Cleans environment
function clean_env {
- :
+ :
}
### Give a timestamp
function timestamp {
- echo $(date +'%h %d %H:%M:%S')
+ echo $(date +'%h %d %H:%M:%S')
}
### Just log and fill error-buffer
function log {
- local MSG="$(timestamp) $*"
- echo "$MSG" >&2
- ERRORBUFFER="$ERRORBUFFER\n$MSG"
+ local MSG="$(timestamp) $*"
+ echo "$MSG" >&2
+ ERRORBUFFER="$ERRORBUFFER\n$MSG"
}
### Log only if debugging is on
function debug {
- if [ "$DEBUG" == "yes" ]; then
- log "DEBUG: $*"
- else
- local MSG="$(timestamp) $*"
- ERRORBUFFER="$ERRORBUFFER\n$MSG"
- fi
+ if [ "$DEBUG" == "yes" ]; then
+ log "DEBUG: $*"
+ else
+ local MSG="$(timestamp) $*"
+ ERRORBUFFER="$ERRORBUFFER\n$MSG"
+ fi
}
### Log and put error-boolean on (so die will escalate the problem)
function error {
- ERROR="yes"
- echo -e "\033[1;31mERROR:\033[0;0m $*" >&2
-# log "ERROR: $*"
+ ERROR="yes"
+ echo -e "\033[1;31mERROR:\033[0;0m $*" >&2
+# log "ERROR: $*"
}
### Log and put warning-boolean on (so die will escalate the problem)
function warning {
- ERROR="yes"
- if [ "$FORCE_VERBOSE" == "yes" ]; then
- echo -e "\033[1;33mWARNING:\033[0;0m $*" >&2
-# log "WARNING: $*"
- fi
+ ERROR="yes"
+ if [ "$FORCE_VERBOSE" == "yes" ]; then
+ echo -e "\033[1;33mWARNING:\033[0;0m $*" >&2
+# log "WARNING: $*"
+ fi
}
### Stop running and escalate if problems
function die {
- if [ "$*" -o "$ERROR" == "yes" ]; then
- log "$* Exiting."
- exit 1
- else
- debug "Exiting successfully."
- exit 0
- fi
+ if [ "$*" -o "$ERROR" == "yes" ]; then
+ log "$* Exiting."
+ exit 1
+ else
+ debug "Exiting successfully."
+ exit 0
+ fi
}
function expand_specfile {
- local SPECFILE="$1"
- if [ "$DISTNAME" -a "$TAG" -a "$DISTNICK" -a "$MAKEFLAGS" ]; then
- rpmdb -D "dtag $DISTNAME" -D "dist .$DISTNAME.$TAG" -D "$DISTNICK 1" -D "$DISTNAME 1" -D "_smp_mflags $MAKEFLAGS" -E "%{expand:%(cat $SPECFILE)}"
- else
- cat $SPECFILE
- fi
+ local SPECFILE="$1"
+ rpmdb ${DISTNAME:+-D "dtag $DISTNAME"} ${TAG:+-D "dist .$DISTNAME.$TAG"} ${DISTNICK:+-D "$DISTNICK 1"} ${DISTNAME:+-D "$DISTNAME 1"} ${MAKEFLAGS:+-D "_smp_mflags $MAKEFLAGS"} -E "%{expand:%(head -n256 $SPECFILE)}"
}
function rpmconf {
- local CONFIG="$1"
+ local CONFIG="$1"
- if [ "$2" ]; then
- local SPECFILE="$2"
- fi
+ if [ "$2" ]; then
+ local SPECFILE="$2"
+ fi
- if [ -z "$SPECFILE" ]; then
- return 1
- fi
-
-# if [ "$3" != "nocheck" ]; then
-# if [ "$DISTNICK" ]; then
-# local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
-# fi
+ if [ -z "$SPECFILE" ]; then
+ return 1
+ fi
(
-# if [ -z "$DISTNICK" ] || [ "$RPMVER" \< "4.1" ] || ! chroot "$CHROOTDIR/$DISTNICK" /bin/su -lm $BUILD_USER -c "rpmdb -D \"dtag $DISTNAME\" -D \"disttag $DISTNAME\" -D \"$DISTNICK 1\" -D \"$DISTNAME 1\" -E \"%{expand:%(head -n128 $SPECFILE)}\"" | grep -i "^ *$CONFIG *:" | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
-# if [ -z "$DISTNICK" ] || [ "$RPMVER" \< "4.1" ] || ! expand_specfile $SPECFILE | grep -i "^ *$CONFIG *:" | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
- if ! expand_specfile $SPECFILE | grep -i "^ *$CONFIG *:" | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
- debug "Config $CONFIG not found in $SPECFILE"
- fi
- ) | perl -p -e "s|\s+| |g; s|^\s+||; s|\s+$||;"
+ if ! expand_specfile $SPECFILE | grep -i "^ *$CONFIG *:" | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
+ debug "Config $CONFIG not found in $SPECFILE"
+ fi
+ ) | perl -p -e "s|\s+| |g; s|^\s+||; s|\s+$||;"
}
function rpmmacro {
- CONFIG="$1"
+ local CONFIG="$1"
- if [ "$2" ]; then
- SPECFILE="$2"
- fi
+ if [ "$2" ]; then
+ local SPECFILE="$2"
+ fi
- if [ -z "$SPECFILE" ]; then
- return 1
- fi
+ if [ -z "$SPECFILE" ]; then
+ return 1
+ fi
- if ! grep -i "^%define $CONFIG " $SPECFILE | sed -e "s/^%define $CONFIG *//i" | head -1; then
- debug "Macro $CONFIG not found in $SPECFILE"
- fi
+ if ! expand_specfile $SPECFILE | grep -i "^%define $CONFIG " | sed -e "s/^%define $CONFIG *//i" | head -1; then
+ debug "Macro $CONFIG not found in $SPECFILE"
+ fi
}
function metaconf {
- CONFIG="$1"
+ local CONFIG="$1"
- if [ "$2" ]; then
- SPECFILE="$2"
- fi
+ if [ "$2" ]; then
+ local SPECFILE="$2"
+ fi
- if [ -z "$SPECFILE" ]; then
- return 1
- fi
+ if [ -z "$SPECFILE" ]; then
+ return 1
+ fi
-# if ! grep -i "^# *Dar$CONFIG *:" $SPECFILE | sed -e "s/^# *Dar$CONFIG *: *//i" | head -1; then
-# debug "Config Dar$CONFIG not found in $SPECFILE"
-# fi
- if ! grep -i "^# *$CONFIG *:" $SPECFILE | sed -e "s/^# *$CONFIG *: *//i" | head -1; then
- debug "MetaConfig $CONFIG not found in $SPECFILE"
- fi
+ if ! expand_specfile $SPECFILE | grep -i "^# *$CONFIG *:" | sed -e "s/^# *$CONFIG *: *//i" | head -1; then
+ debug "MetaConfig $CONFIG not found in $SPECFILE"
+ fi
}
function daropts {
- OPTIONS="$1"; shift
- OPTIND=1
- while getopts "$OPTIONS" c; do
- case "$c" in
- (a) FORCE_ARCHS="$OPTARG";;
- (d) FORCE_DISTS="$OPTARG";;
- (f) FORCE_OVERWRITE="yes";;
- (h) help;;
- (n) NOSOURCE="yes";;
- (r) CREATE_REPO="yes";;
- (s) FORCE_SOURCE_DISTS="$OPTARG";;
- (t) FORCE_TAG="$OPTARG";;
- (v) FORCE_VERBOSE="yes";;
- (q) QUIET="yes";;
-# (-) c=${OPTARG/#-/}; OPTARG="$(echo $* | cut -d' ' -f$OPTIND)"
-# case "$c" in
-# (port) port="$OPTARG"; OPTIND=$((OPTIND+1));;
-# (*) options="$options --$c $OPTARG"; OPTIND=$((OPTIND+1));;
-# esac;;
-# ('?') error "allow: Option \"-$c\" not allowed" >&2;;
- (*) error "Option \"-$OPTARG\" unknown."
- esac
- done
- shift $((OPTIND-1))
- OPTS=$@
+ OPTIONS="$1"; shift
+ OPTIND=1
+ while getopts "$OPTIONS" c; do
+ case "$c" in
+ (a) FORCE_ARCHS="$OPTARG";;
+ (d) FORCE_DISTS="$OPTARG";;
+ (f) FORCE_OVERWRITE="yes";;
+ (h) help;;
+ (n) NOSOURCE="yes";;
+ (r) CREATE_REPO="yes";;
+ (s) FORCE_SOURCE_DISTS="$OPTARG";;
+ (t) FORCE_TAG="$OPTARG";;
+ (v) FORCE_VERBOSE="yes";;
+ (q) QUIET="yes";;
+# (-) c=${OPTARG/#-/}; OPTARG="$(echo $* | cut -d' ' -f$OPTIND)"
+# case "$c" in
+# (port) port="$OPTARG"; OPTIND=$((OPTIND+1));;
+# (*) options="$options --$c $OPTARG"; OPTIND=$((OPTIND+1));;
+# esac;;
+# ('?') error "allow: Option \"-$c\" not allowed" >&2;;
+ (*) error "Option \"-$OPTARG\" unknown."
+ esac
+ done
+ shift $((OPTIND-1))
+ OPTS=$@
}
function set_archs {
- if [ "$FORCE_ARCHS" ]; then
- ARCHS="${FORCE_ARCHS//[,:;]/ }"
- elif [ "$(rpmconf Nosource)" != "" ]; then
- ARCHS="nosrc"
- else
- ARCHS="$(metaconf Archs)"
- fi
- if [ -z "$ARCHS" ]; then
- ARCHS="$(rpmconf BuildArch)"
- fi
- if [ -z "$ARCHS" ]; then
- ARCHS="$DISTARCH"
- fi
- if [ -z "$ARCHS" ]; then
- ARCHS="$DEFAULT_ARCHS"
- fi
+ if [ "$FORCE_ARCHS" ]; then
+ ARCHS="${FORCE_ARCHS//[,:;]/ }"
+ elif [ "$(rpmconf Nosource)" != "" ]; then
+ ARCHS="nosrc"
+ else
+ ARCHS="$(metaconf Archs)"
+ fi
+ if [ -z "$ARCHS" ]; then
+ ARCHS="$(rpmconf BuildArch)"
+ fi
+ if [ -z "$ARCHS" ]; then
+ ARCHS="$DISTARCH"
+ fi
+ if [ -z "$ARCHS" ]; then
+ ARCHS="$DEFAULT_ARCHS"
+ fi
}
function set_dists {
- unset NODIST
- if [ "$FORCE_DISTS" ]; then
- DISTS="${FORCE_DISTS//[,:;]/ }"
- elif [ "$(rpmconf Nosource)" != "" ]; then
- NODIST="nodist"
- DISTS="$(echo "$DISTS" | cut -f1)"
- else
- DISTS="$(metaconf Dists)"
- fi
- if [ "$(metaconf Dist)" == "nodist" ]; then
- NODIST="nodist"
- DISTS="$(echo $DISTS | cut -f1)"
- fi
- if [ -z "$DISTS" ]; then
- DISTS="$DEFAULT_DISTS"
- fi
+ unset NODIST
+ if [ "$FORCE_DISTS" ]; then
+ DISTS="${FORCE_DISTS//[,:;]/ }"
+ elif [ "$(rpmconf Nosource)" != "" ]; then
+ NODIST="nodist"
+ DISTS="$(echo "$DISTS" | cut -f1)"
+ else
+ DISTS="$(metaconf Dists)"
+ fi
+ if [ "$(metaconf Dist)" == "nodist" ]; then
+ NODIST="nodist"
+ DISTS="$(echo $DISTS | cut -f1)"
+ fi
+ if [ -z "$DISTS" ]; then
+ DISTS="$DEFAULT_DISTS"
+ fi
}
function set_exclude_dist {
- EXCLUDE_DIST="$(metaconf ExcludeDist)"
+ EXCLUDE_DIST="$(metaconf ExcludeDist)"
}
function set_exclusive_dist {
- EXCLUSIVE_DIST="$(metaconf ExclusiveDist)"
+ EXCLUSIVE_DIST="$(metaconf ExclusiveDist)"
}
function set_source_dists {
- if [ "$FORCE_SOURCE_DISTS" ]; then
- SOURCE_DISTS="${FORCE_SOURCE_DISTS//[,:;]/ }"
- elif [ "$(rpmconf Nosource)" != "" ]; then
- SOURCE_DISTS="$(echo ${FORCE_DISTS//[,:;]/ } | cut -f1)"
- else
- SOURCE_DISTS="$(metaconf SourceDists)"
- fi
+ if [ "$FORCE_SOURCE_DISTS" ]; then
+ SOURCE_DISTS="${FORCE_SOURCE_DISTS//[,:;]/ }"
+ elif [ "$(rpmconf Nosource)" != "" ]; then
+ SOURCE_DISTS="$(echo ${FORCE_DISTS//[,:;]/ } | cut -f1)"
+ else
+ SOURCE_DISTS="$(metaconf SourceDists)"
+ fi
}
function set_tag {
- TAGS="$DEFAULT_TAGS"
- if [ -n "$FORCE_TAG" ]; then
- TAG="$FORCE_TAG"
- TAGS="$FORCE_TAG"
- else
- TAG="$(metaconf Tag)"
- fi
- if [ -z "$DEFAULT_TAG" ]; then
- DEFAULT_TAG="${DEFAULT_TAGS/ */}"
- fi
- if [ -z "$TAG" ]; then
- TAG="$DEFAULT_TAG"
- fi
+ TAGS="$DEFAULT_TAGS"
+ if [ -n "$FORCE_TAG" ]; then
+ TAG="$FORCE_TAG"
+ TAGS="$FORCE_TAG"
+ else
+ TAG="$(metaconf Tag)"
+ fi
+ if [ -z "$DEFAULT_TAG" ]; then
+ DEFAULT_TAG="${DEFAULT_TAGS/ */}"
+ fi
+ if [ -z "$TAG" ]; then
+ TAG="$DEFAULT_TAG"
+ fi
}
function set_soapbox {
- if [ -n "$FORCE_SOAPBOX" ]; then
- SOAPBOX="$FORCE_SOAPBOX"
- else
- SOAPBOX="$(metaconf Soapbox)"
- fi
- if [ -z "$SOAPBOX" ]; then SOAPBOX="$USE_SOAPBOX"; fi
+ if [ -n "$FORCE_SOAPBOX" ]; then
+ SOAPBOX="$FORCE_SOAPBOX"
+ else
+ SOAPBOX="$(metaconf Soapbox)"
+ fi
+ if [ -z "$SOAPBOX" ]; then SOAPBOX="$USE_SOAPBOX"; fi
}
function set_as_root {
- if [ -n "$FORCE_AS_ROOT" ]; then
- AS_ROOT="$FORCE_AS_ROOT"
- else
- AS_ROOT="$(metaconf BuildAsRoot)"
- fi
- if [ -z "$AS_ROOT" ]; then AS_ROOT="$USE_ROOT"; fi
+ if [ -n "$FORCE_AS_ROOT" ]; then
+ AS_ROOT="$FORCE_AS_ROOT"
+ else
+ AS_ROOT="$(metaconf BuildAsRoot)"
+ fi
+ if [ -z "$AS_ROOT" ]; then AS_ROOT="$USE_ROOT"; fi
}
function set_distcc {
- if [ -n "$FORCE_DISTCC" ]; then
- DISTCC="$FORCE_DISTCC"
- else
- DISTCC="$(metaconf Distcc)"
- fi
- if [ -z "$DISTCC" ]; then DISTCC="$USE_DISTCC"; fi
+ if [ -n "$FORCE_DISTCC" ]; then
+ DISTCC="$FORCE_DISTCC"
+ else
+ DISTCC="$(metaconf Distcc)"
+ fi
+ if [ -z "$DISTCC" ]; then DISTCC="$USE_DISTCC"; fi
}
function set_ccache {
- if [ -n "$FORCE_CCACHE" ]; then
- CCACHE="$FORCE_CCACHE"
- else
- CCACHE="$(metaconf Ccache)"
- fi
- if [ -z "$CCACHE" ]; then CCACHE="$USE_CCACHE"; fi
+ if [ -n "$FORCE_CCACHE" ]; then
+ CCACHE="$FORCE_CCACHE"
+ else
+ CCACHE="$(metaconf Ccache)"
+ fi
+ if [ -z "$CCACHE" ]; then CCACHE="$USE_CCACHE"; fi
}
function download_sources {
- local RC=1
- local ERC=0
- local i=1
+ local RC=1
+ local ERC=0
+ local i=1
### FIXME: Do not hardcode a distribution here
- for url in $(spectool -l <(expand_specfile $SPECFILE) 2>/dev/null | cut -f2 -d' '); do
- filename="$SPECDIR/$(basename $url)"
- if [ ! -s "$filename" ]; then
- warning "Source \"$(basename $filename)\" not found, downloading [$url]."
- local i=1
- RC=1
- while [ $RC -ne 0 -a $i -lt 4 ]; do
-# wget -v -t5 -T2 -O "$filename" "$url"
- wget -q -t30 -T10 -O "$filename" "$url"
-# wget -q -T1 -O "$filename" "$url"
-# lftpget "$url" -c -o "$filename"
-# lftpget "$url" -c -O "$(dirname $filename)" -o "$(basename $filename)"
- RC=$?
- i=$((i+1))
- done
- if [ $RC -ne 0 ]; then
- error "Problems downloading source [$url]."
- if [ -s "$filename" ]; then
- rm "$filename"
- fi
- ERC=1
- fi
- fi
- done
- return $ERC
+ for url in $(spectool -l <(expand_specfile $SPECFILE) 2>/dev/null | cut -f2 -d' '); do
+ filename="$SPECDIR/$(basename $url)"
+ if [ ! -s "$filename" ]; then
+ warning "Source \"$(basename $filename)\" not found, downloading [$url]."
+ local i=1
+ RC=1
+ while [ $RC -ne 0 -a $i -lt 4 ]; do
+# wget -v -t5 -T2 -O "$filename" "$url"
+ wget -q -t30 -T10 -O "$filename" "$url"
+# wget -q -T1 -O "$filename" "$url"
+# lftpget "$url" -c -o "$filename"
+# lftpget "$url" -c -O "$(dirname $filename)" -o "$(basename $filename)"
+ RC=$?
+ i=$((i+1))
+ done
+ if [ $RC -ne 0 ]; then
+ error "Problems downloading source [$url]."
+ if [ -s "$filename" ]; then
+ rm "$filename"
+ fi
+ ERC=1
+ fi
+ fi
+ done
+ return $ERC
}
function build_env {
- local DISTNICK="$1"
- local DISTNAME="$2"
- local OPTIONS=""
- local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
+ local DISTNICK="$1"
+ local DISTNAME="$2"
+ local OPTIONS=""
+ local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
- if [ "$RPMVER" \> "4.0.2" ]; then
- OPTIONS="$OPTIONS --nodigest"
- fi
- if [ "$RPMVER" \> "4.0.99" ]; then
- OPTIONS="$OPTIONS --nosignature"
- fi
+ if [ "$RPMVER" \> "4.0.2" ]; then
+ OPTIONS="$OPTIONS --nodigest"
+ fi
+ if [ "$RPMVER" \> "4.0.99" ]; then
+ OPTIONS="$OPTIONS --nosignature"
+ fi
- chroot $CHROOTDIR/$DISTNICK rpm -qa $OPTIONS --qf "%{name}\t%{version}-%{release}\n"| sort >$STATEDIR/rpmqa-$DISTNAME-$DISTARCH.list 2>/dev/null
+ chroot $CHROOTDIR/$DISTNICK rpm -qa $OPTIONS --qf "%{name}\t%{version}-%{release}\n"| sort >$STATEDIR/rpmqa-$DISTNAME-$DISTARCH.list 2>/dev/null
}
function build_htaccess {
- cat <<EOF >"$PACKAGEDIR/.htaccess"
+ cat <<EOF >"$PACKAGEDIR/.htaccess"
Options +Indexes
DirectoryIndex .
#IndexOrderDefault Descending Date
@@ -343,217 +329,217 @@ DirectoryIndex .
IndexOptions +TrackModified
EOF
- for dir in $(ls $PACKAGEDIR); do
- if [ -d "$PACKAGEDIR/$dir" ]; then
- SPECFILE="$(ls $PACKAGEDIR/$dir/*.spec | cut -d' ' -f1)"
- if [ -f "$SPECFILE" ]; then
- echo "AddDescription \"$(rpmconf Summary)\" $dir" >>"$PACKAGEDIR/.htaccess"
- fi
- fi
- done
+ for dir in $(ls $PACKAGEDIR); do
+ if [ -d "$PACKAGEDIR/$dir" ]; then
+ SPECFILE="$(ls $PACKAGEDIR/$dir/*.spec | cut -d' ' -f1)"
+ if [ -f "$SPECFILE" ]; then
+ echo "AddDescription \"$(rpmconf Summary)\" $dir" >>"$PACKAGEDIR/.htaccess"
+ fi
+ fi
+ done
}
function build_content {
- local DISTNAME="$1"
- local DISTPATH="$2"
+ local DISTNAME="$1"
+ local DISTPATH="$2"
-# find "$PACKAGEDIR/" -name "*.$TAG.$DIST.*.rpm" \
-# -o -name "*.$DIST.$TAG.*.rpm" | \
-# sed -e "
-# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.$DIST\..\+\.rpm|\1|;
-# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$DIST\.$TAG\..\+\.rpm|\1|;
-# " | sort | uniq >$STATEDIR/packages-$DIST.list
+# find "$PACKAGEDIR/" -name "*.$TAG.$DIST.*.rpm" \
+# -o -name "*.$DIST.$TAG.*.rpm" | \
+# sed -e "
+# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.$DIST\..\+\.rpm|\1|;
+# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$DIST\.$TAG\..\+\.rpm|\1|;
+# " | sort | uniq >$STATEDIR/packages-$DIST.list
- for rpm in $FTPDIR/$DISTPATH/RPMS.$REPO/*.rpm; do
- rpm="${rpm%-*-*}"
- echo "${rpm//#*\/}"
- done | sort | uniq >$STATEDIR/packages-$DISTNAME-$DISTARCH.list
+ for rpm in $FTPDIR/$DISTPATH/RPMS.$REPO/*.rpm; do
+ rpm="${rpm%-*-*}"
+ echo "${rpm//#*\/}"
+ done | sort | uniq >$STATEDIR/packages-$DISTNAME-$DISTARCH.list
}
function build_tree_apt {
- local DISTTAG="$1"
- local DISTPATH="$2"
-
- echo "Building Apt tree."
-
- ### Creating directories
- mkdir -p $FTPDIR/$DISTPATH/{base,RPMS.$REPO}/
-
- ### Make SPEC files readable
- echo $PACKAGEDIR/*/*.spec | xargs chmod +r
-
- ### Removing old packages
- echo $FTPDIR/$DISTPATH/RPMS.$REPO/*.rpm | xargs rm -f
-
- ### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
- ### FIXME: And iterate through that list
- for disttag in $DISTTAG nodist 0; do
- for tag in $TAGS; do
-
- case "$DISTARCH" in
- i386)
- find $PACKAGEDIR -type f -a \( \
- -name "*.$tag.$disttag.noarch.rpm" \
- -o -name "*.$tag.$disttag.i?86.rpm" \
- -o -name "*.$tag.$disttag.athlon.rpm" \
- -o -name "*.$disttag.$tag.noarch.rpm" \
- -o -name "*.$disttag.$tag.i?86.rpm" \
- -o -name "*.$disttag.$tag.athlon.rpm" \) \
- -exec ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ \;
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
- ;;
-# x86_64)
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
-# ;;
- *)
- find $PACKAGEDIR -type f -a \( \
- -name "*.$tag.$disttag.noarch.rpm" \
- -o -name "*.$tag.$disttag.$DISTARCH.rpm" \
- -o -name "*.$disttag.$tag.noarch.rpm" \
- -o -name "*.$disttag.$tag.$DISTARCH.rpm" \) \
- -exec ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ \;
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
- ;;
- esac
-
- done
- done
+ local DISTTAG="$1"
+ local DISTPATH="$2"
+
+ echo "Building Apt tree."
+
+ ### Creating directories
+ mkdir -p $FTPDIR/$DISTPATH/{base,RPMS.$REPO}/
+
+ ### Make SPEC files readable
+ echo $PACKAGEDIR/*/*.spec | xargs chmod +r
+
+ ### Removing old packages
+ echo $FTPDIR/$DISTPATH/RPMS.$REPO/*.rpm | xargs rm -f
+
+ ### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
+ ### FIXME: And iterate through that list
+ for disttag in $DISTTAG nodist 0; do
+ for tag in $TAGS; do
+
+ case "$DISTARCH" in
+ i386)
+ find $PACKAGEDIR -type f -a \( \
+ -name "*.$tag.$disttag.noarch.rpm" \
+ -o -name "*.$tag.$disttag.i?86.rpm" \
+ -o -name "*.$tag.$disttag.athlon.rpm" \
+ -o -name "*.$disttag.$tag.noarch.rpm" \
+ -o -name "*.$disttag.$tag.i?86.rpm" \
+ -o -name "*.$disttag.$tag.athlon.rpm" \) \
+ -exec ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ \;
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
+ ;;
+# x86_64)
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
+# ;;
+ *)
+ find $PACKAGEDIR -type f -a \( \
+ -name "*.$tag.$disttag.noarch.rpm" \
+ -o -name "*.$tag.$disttag.$DISTARCH.rpm" \
+ -o -name "*.$disttag.$tag.noarch.rpm" \
+ -o -name "*.$disttag.$tag.$DISTARCH.rpm" \) \
+ -exec ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ \;
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
+ ;;
+ esac
+
+ done
+ done
}
function build_repo_apt {
- local DISTPATH="$1"
+ local DISTPATH="$1"
- echo "Building Apt repo."
+ echo "Building Apt repo."
- if [ ! -d "$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO" ]; then
- mkdir -p "$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO"
- fi
+ if [ ! -d "$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO" ]; then
+ mkdir -p "$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO"
+ fi
- ### Build Apt repository
- genbasedir --flat --bloat --cachedir="$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO" --bz2only $FTPDIR/$DISTPATH $REPO >/dev/null
-# genbasedir --progress --flat --bloat $FTPDIR/$DISTPATH $REPO
-# genbasedir --progress --hashonly $FTPDIR/$DISTPATH $REPO
+ ### Build Apt repository
+ genbasedir --flat --bloat --cachedir="$TEMPDIR/.cache/genbasedir/$DISTNICK/$REPO" --bz2only $FTPDIR/$DISTPATH $REPO >/dev/null
+# genbasedir --progress --flat --bloat $FTPDIR/$DISTPATH $REPO
+# genbasedir --progress --hashonly $FTPDIR/$DISTPATH $REPO
}
function build_tree_yum {
- local DISTTAG="$1"
- local DISTPATH="$2"
-
- echo "Building Yum tree."
-
- ### Creating directories
- mkdir -p $FTPDIR/$DISTPATH/$REPO/{RPMS,headers}/
-
- ### Removing old packages
- echo $FTPDIR/$DISTPATH/$REPO/RPMS/*.rpm | xargs rm -f
- echo $FTPDIR/$DISTPATH/$REPO/headers/*.hdr | xargs rm -f
-
- ### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
- ### FIXME: And iterate through that list
- ### Hardlink files
- for disttag in $DISTTAG nodist 0; do
- for tag in $TAGS; do
-
- case "$DISTARCH" in
- i386)
- find $PACKAGEDIR -type f -a \( \
- -name "*.$tag.$disttag.noarch.rpm" \
- -o -name "*.$tag.$disttag.i?86.rpm" \
- -o -name "*.$tag.$disttag.athlon.rpm" \
- -o -name "*.$disttag.$tag.noarch.rpm" \
- -o -name "*.$disttag.$tag.i?86.rpm" \
- -o -name "*.$disttag.$tag.athlon.rpm" \) \
- -exec ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ \;
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
- ;;
-# x86_64)
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
-# ;;
- *)
- find $PACKAGEDIR -type f -a \( \
- -name "*.$tag.$disttag.noarch.rpm" \
- -o -name "*.$tag.$disttag.$DISTARCH.rpm" \
- -o -name "*.$disttag.$tag.noarch.rpm" \
- -o -name "*.$disttag.$tag.$DISTARCH.rpm" \) \
- -exec ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ \;
-# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
-# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
- ;;
- esac
-
- done
- done
-# ln -f $PACKAGEDIR/*/*.$TAG.src.rpm $FTPDIR/$DISTPATH/$REPO/SRPMS/ &>/dev/null
+ local DISTTAG="$1"
+ local DISTPATH="$2"
+
+ echo "Building Yum tree."
+
+ ### Creating directories
+ mkdir -p $FTPDIR/$DISTPATH/$REPO/{RPMS,headers}/
+
+ ### Removing old packages
+ echo $FTPDIR/$DISTPATH/$REPO/RPMS/*.rpm | xargs rm -f
+ echo $FTPDIR/$DISTPATH/$REPO/headers/*.hdr | xargs rm -f
+
+ ### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
+ ### FIXME: And iterate through that list
+ ### Hardlink files
+ for disttag in $DISTTAG nodist 0; do
+ for tag in $TAGS; do
+
+ case "$DISTARCH" in
+ i386)
+ find $PACKAGEDIR -type f -a \( \
+ -name "*.$tag.$disttag.noarch.rpm" \
+ -o -name "*.$tag.$disttag.i?86.rpm" \
+ -o -name "*.$tag.$disttag.athlon.rpm" \
+ -o -name "*.$disttag.$tag.noarch.rpm" \
+ -o -name "*.$disttag.$tag.i?86.rpm" \
+ -o -name "*.$disttag.$tag.athlon.rpm" \) \
+ -exec ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ \;
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
+ ;;
+# x86_64)
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
+# ;;
+ *)
+ find $PACKAGEDIR -type f -a \( \
+ -name "*.$tag.$disttag.noarch.rpm" \
+ -o -name "*.$tag.$disttag.$DISTARCH.rpm" \
+ -o -name "*.$disttag.$tag.noarch.rpm" \
+ -o -name "*.$disttag.$tag.$DISTARCH.rpm" \) \
+ -exec ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ \;
+# echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
+# echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,$DISTARCH}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
+ ;;
+ esac
+
+ done
+ done
+# ln -f $PACKAGEDIR/*/*.$TAG.src.rpm $FTPDIR/$DISTPATH/$REPO/SRPMS/ &>/dev/null
}
function build_repo_yum {
- local DISTPATH="$1"
+ local DISTPATH="$1"
- echo "Building Yum repo."
+ echo "Building Yum repo."
- ### Build Yum repository
-# yum-arch -q -z -d -c $FTPDIR/$DISTPATH/$REPO/
- yum-arch -q -z $FTPDIR/$DISTPATH/$REPO/ &>/dev/null
+ ### Build Yum repository
+# yum-arch -q -z -d -c $FTPDIR/$DISTPATH/$REPO/
+ yum-arch -q -z $FTPDIR/$DISTPATH/$REPO/ &>/dev/null
}
function build_repo {
- local DISTPATH="$1"
- local REPODATA="$FTPDIR/$DISTPATH/$REPO/repodata/"
- local DISTDESC="$2"
-
- echo "Building repomd."
- if [ "$DISTNICK" ]; then
- local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
- fi
-
- local OPTIONS=""
- if [ "$RPMVER" \< "4.2.1" ]; then
- OPTIONS="-n"
- fi
-
- if [ -d "$FTPDIR/$DISTPATH/$REPO/.olddata/" ]; then
- rm -rf "$FTPDIR/$DISTPATH/$REPO/.olddata/"
- fi
- if [ ! -d "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO" ]; then
- mkdir -p "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO"
- fi
- createrepo -q $OPTIONS --checkts -c "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO" "$FTPDIR/$DISTPATH/$REPO"
- sync
- echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >"$REPODATA/repomd.xml"
- echo "<repomd xmlns=\"http://linux.duke.edu/metadata/repo\">" >>"$REPODATA/repomd.xml"
- for file in other filelists primary; do
- echo "### Generated by DAR, http://dag.wieers.com/home-made/dar/" >>"$REPODATA/repomd.xml"
- echo " <data type=\"$file\">" >>"$REPODATA/repomd.xml"
- echo " <location href=\"repodata/$file.xml.gz\"/>" >>"$REPODATA/repomd.xml"
- gunzip "$REPODATA/$file.xml.gz"
- echo " <open-checksum type=\"sha\">$(sha1sum "$REPODATA/$file.xml" | cut -f1 -d' ')</open-checksum>" >>"$REPODATA/repomd.xml"
- gzip -9 --rsyncable -f "$REPODATA/$file.xml"
- echo " <checksum type=\"sha\">$(sha1sum "$REPODATA/$file.xml.gz" | cut -f1 -d' ')</checksum>" >>"$REPODATA/repomd.xml"
- echo " <timestamp>$(stat -c "%Y" "$REPODATA/$file.xml.gz")</timestamp>" >>"$REPODATA/repomd.xml"
- echo " </data>" >>"$REPODATA/repomd.xml"
- done
- echo "</repomd>" >>"$REPODATA/repomd.xml"
-
-# echo "Building repoview."
-# repoview --quiet --title="RPMforge: $DISTDESC" "$FTPDIR/$DISTPATH/$REPO"
-# repoview --quiet --url="http://apt.sw.be/$DISTPATH/" "$FTPDIR/$DISTPATH/$REPO"
+ local DISTPATH="$1"
+ local REPODATA="$FTPDIR/$DISTPATH/$REPO/repodata/"
+ local DISTDESC="$2"
+
+ echo "Building repomd."
+ if [ "$DISTNICK" ]; then
+ local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
+ fi
+
+ local OPTIONS=""
+ if [ "$RPMVER" \< "4.2.1" ]; then
+ OPTIONS="-n"
+ fi
+
+ if [ -d "$FTPDIR/$DISTPATH/$REPO/.olddata/" ]; then
+ rm -rf "$FTPDIR/$DISTPATH/$REPO/.olddata/"
+ fi
+ if [ ! -d "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO" ]; then
+ mkdir -p "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO"
+ fi
+ createrepo -q $OPTIONS --checkts -c "$TEMPDIR/.cache/createrepo/$DISTNICK/$REPO" "$FTPDIR/$DISTPATH/$REPO"
+ sync
+ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >"$REPODATA/repomd.xml"
+ echo "<repomd xmlns=\"http://linux.duke.edu/metadata/repo\">" >>"$REPODATA/repomd.xml"
+ for file in other filelists primary; do
+ echo "### Generated by DAR, http://dag.wieers.com/home-made/dar/" >>"$REPODATA/repomd.xml"
+ echo " <data type=\"$file\">" >>"$REPODATA/repomd.xml"
+ echo " <location href=\"repodata/$file.xml.gz\"/>" >>"$REPODATA/repomd.xml"
+ gunzip "$REPODATA/$file.xml.gz"
+ echo " <open-checksum type=\"sha\">$(sha1sum "$REPODATA/$file.xml" | cut -f1 -d' ')</open-checksum>" >>"$REPODATA/repomd.xml"
+ gzip -9 --rsyncable -f "$REPODATA/$file.xml"
+ echo " <checksum type=\"sha\">$(sha1sum "$REPODATA/$file.xml.gz" | cut -f1 -d' ')</checksum>" >>"$REPODATA/repomd.xml"
+ echo " <timestamp>$(stat -c "%Y" "$REPODATA/$file.xml.gz")</timestamp>" >>"$REPODATA/repomd.xml"
+ echo " </data>" >>"$REPODATA/repomd.xml"
+ done
+ echo "</repomd>" >>"$REPODATA/repomd.xml"
+
+# echo "Building repoview."
+# repoview --quiet --title="RPMforge: $DISTDESC" "$FTPDIR/$DISTPATH/$REPO"
+# repoview --quiet --url="http://apt.sw.be/$DISTPATH/" "$FTPDIR/$DISTPATH/$REPO"
}
function build_repo_srpms {
- local DIR="$1"
+ local DIR="$1"
- mkdir -p $FTPDIR/$DIR
- echo $FTPDIR/$DIR/*.src.rpm | xargs rm -f
- for tag in $TAGS; do
- echo $PACKAGEDIR/*/*.$tag.src.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DIR/ &>/dev/null
- done
+ mkdir -p $FTPDIR/$DIR
+ echo $FTPDIR/$DIR/*.src.rpm | xargs rm -f
+ for tag in $TAGS; do
+ echo $PACKAGEDIR/*/*.$tag.src.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DIR/ &>/dev/null
+ done
-# genbasedir --bloat --bz2only $FTPDIR/$DISTPATH/ $REPO
+# genbasedir --bloat --bz2only $FTPDIR/$DISTPATH/ $REPO
}
#export LD_ASSUME_KERNEL="2.4.9"
@@ -561,12 +547,14 @@ export LD_ASSUME_KERNEL
### Main
if [ -r "$DARCONFIG" ]; then
- clean_env
- source "$DARCONFIG"
+ clean_env
+ source "$DARCONFIG"
else
- die "Cannot access configfile ($DARCONFIG)."
+ die "Cannot access configfile ($DARCONFIG)."
fi
if [ -r ~/".dar.conf" ]; then
- source ~/".dar.conf"
+ source ~/".dar.conf"
fi
+
+# vim:ts=4:sw=4:et
View
52 dar-metadata
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+source "/usr/share/dar/dar-functions"
+
+function help {
+ cat <<EOF
+usage: dar-metadata [-q] [-v] [-d dist,dist2]
+Update local repository metadata
+
+dar-exec options:
+
+ -d dist,dist2 select build envs
+ -f force
+ -h this help message
+ -q be very quiet
+ -v more verbose
+
+EOF
+exit 1
+}
+
+daropts "d:fhqv" $@
+CMD="$OPTS"
+
+if [ ! -d "$ROOT" ]; then
+ echo "ERROR: probably in chroot jail" >&2
+ exit 1
+fi
+
+set_dists
+for distname in $DISTS; do
+ if [ -r "$CONFIGDIR/dists/$distname/config" ]; then
+ source "$CONFIGDIR/dists/$distname/config"
+
+ if [ -z "$QUIET" ]; then
+ echo -e "$_BL_$_WH= Finding $_YE$DISTNAME$_WE/$_YE$DISTARCH$_WH packages...$_DE"
+ fi
+
+ find /dar/packages/ \( -name "*.$DISTNAME.rf.$DISTARCH.rpm" -o -name "*.$DISTNAME.rf.noarch.rpm" \) -exec ln -f {} $MREPODIR/$MREPONAME/rpmforge/RPMS/ \;
+ find /dar/packages/ \( -name "*.$DISTNAME.rfx.$DISTARCH.rpm" -o -name "*.$DISTNAME.rfx.noarch.rpm" \) -exec ln -f {} $MREPODIR/$MREPONAME/rpmforge-extras/RPMS/ \;
+ find /dar/packages/ \( -name "*.$DISTNAME.rft.$DISTARCH.rpm" -o -name "*.$DISTNAME.rft.noarch.rpm" \) -exec ln -f {} $MREPODIR/$MREPONAME/rpmforge-testing/RPMS/ \;
+ if [ "$QUIET" -a "$FORCE" ]; then
+ mrepo -g -f -q $MREPONAME
+ elif [ "$QUIET" -a -z "$FORCE" ]; then
+ mrepo -g -q $MREPONAME
+ elif [ -z "$QUIET" -a "$FORCE" ]; then
+ mrepo -g -f -vv $MREPONAME
+ else
+ mrepo -g -vv $MREPONAME
+ fi
+ fi
+done
View
9 dar-shell
@@ -33,10 +33,11 @@ set_dists
set_as_root
AS_ROOT=1
-if [ -z "$QUIET" ]; then
- echo -e "$_BL_$_WH= Entering shells.$_DE"
-fi
for distname in $DISTS; do
+ if [ -z "$QUIET" ]; then
+ echo -e "$_BL_$_WH= Entering $_YE$distname$_WH shell.$_DE"
+ fi
+
if [ -r "$CONFIGDIR/dists/$distname/config" ]; then
source "$CONFIGDIR/dists/$distname/config"
export arch="$DISTARCH" dist="${DISTNAME// *}" nick="$DISTNICK" path="$DISTPATH" repo="$REPO" tag="${DISTTAG// *}"
@@ -49,7 +50,7 @@ for distname in $DISTS; do
fi
done
if [ -z "$QUIET" ]; then
- echo -en "$_BL_$_WH= Returning to parent shell. Press ENTER.$_DE"
+ echo -en "$_BL_$_WH= Returning to ${_YE}parent$_WH shell. Press ENTER.$_DE"
read a
fi
View
17 dar-update
@@ -4,7 +4,7 @@
source "/usr/share/dar/dar-functions"
-daropts ":a:d:rs:" $@
+daropts ":a:d:qrs:" $@
PKGS="$OPTS"
#DISTS="$DEFAULT_DISTS"
@@ -21,10 +21,13 @@ for distname in $DISTS; do
fi
if [ "$CREATE_REPO" ]; then
- echo "Building $distname repository in $DISTPATH."
- build_tree_apt "$DISTNAME $DISTTAG" "$DISTPATH"
- build_repo_apt "$DISTPATH"
-# build_repo_yum "$DISTTAG" "$DISTPATH"
+ if [ -z "$QUIET" ]; then
+ echo "Building $distname repository in $DISTPATH."
+ fi
+ dar-metadata -q -d $distname
+# build_tree_apt "$DISTNAME $DISTTAG" "$DISTPATH"
+# build_repo_apt "$DISTPATH"
+# build_repo_yum "$DISTTAG" "$DISTPATH"
fi
if [ "$UPDATECMD" ]; then
@@ -46,7 +49,9 @@ for distname in $DISTS; do
if [ "$INSTALLCMD" -a "$PKGS" ]; then
for pkg in $PKGS; do
instcmd="$(echo $INSTALLCMD | sed -e "s|%p|$pkg|g")"
- echo "Installing $pkg in $distname."
+ if [ -z "$QUIET" ]; then
+ echo "Installing $pkg in $distname."
+ fi
chroot $CHROOTDIR/$distname $instcmd
if [ -z "$FORCE_VERBOSE" ]; then
echo "$instcmd" | setarch $DISTARCH /usr/sbin/chroot "$CHROOTDIR/$distname" /bin/bash --login -s
View
3  dar.conf
@@ -6,13 +6,14 @@ PACKAGEDIR="$FTPDIR/packages"
STATEDIR="$FTPDIR/rpmforge/persona/dag/state"
SPECSDIR="$ROOT/rpms"
CHROOTDIR="$ROOT/chroot"
+MREPODIR="$ROOT/mrepo"
BUILDDIR="$ROOT/build"
TEMPDIR="$ROOT/tmp"
#DEFAULT_DISTS="el4a el4i fc3a fc3i fc2a fc2i fc1i el3a el3i rh9i rh7i el2i"
#DEFAULT_DISTS="el5a el5i el4a el4i el3a el3i rh9i rh7i el2i"
-DEFAULT_DISTS="el5a el5i el4a el4i el3a el3i el2i"
+DEFAULT_DISTS="el6a el6i el5a el5i el4a el4i el3a el3i el2i"
DEFAULT_SOURCE_DISTS="el5i"
DEFAULT_ARCHS="i386"
DEFAULT_TAGS="rf dag"
View
2  dists/el2i/config
@@ -25,4 +25,6 @@ REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+MREPONAME="rhel2.1as-i386"
+
ASSUME_KERNEL="2.4.1"
View
2  dists/el3a/config
@@ -24,3 +24,5 @@ DISTARCH="x86_64"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel3as-x86_64"
View
2  dists/el3i/config
@@ -24,3 +24,5 @@ DISTARCH="i386"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel3as-i386"
View
2  dists/el4a/config
@@ -24,3 +24,5 @@ DISTARCH="x86_64"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel4as-x86_64"
View
2  dists/el4i/config
@@ -24,3 +24,5 @@ DISTARCH="i386"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel4as-i386"
View
2  dists/el5a/config
@@ -24,3 +24,5 @@ DISTARCH="x86_64"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel5s-x86_64"
View
2  dists/el5i/config
@@ -24,3 +24,5 @@ DISTARCH="i386"
REPO_APT="yes"
REPO_YUM="yes"
REPO_CREATEREPO="yes"
+
+MREPONAME="rhel5s-i386"
Please sign in to comment.
Something went wrong with that request. Please try again.