Skip to content

Commit

Permalink
Fixes for spectool 1.0.2.
Browse files Browse the repository at this point in the history
Better spec filename handling.
Fixes to Makefile.
  • Loading branch information
dagwieers committed Mar 15, 2004
1 parent 3f723d9 commit f1c0485
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Version 0.6.1 # Probably the last version using bash
- dar-functions: Added download_sources() using spectool
- dar-build: Changed the way of handling logfiles
- dar-functions: Make download_sources() work with spectool 1.0.2

Version 0.6.0
- dar.conf: Removed DISTSMAP, added it to dists specific section
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description=Dag Apt Repository builder
version=0.6.0
arch=noarch

prefix=/usr
datadir=/usr/share
sysconfdir=/etc
localstatedir=/var
libdir=/usr/lib
sbindir=/usr/sbin
topdir=$(prefix)/src/redhat

DIST_SCRIPTS=dar-build dar-dotty dar-exec dar-kickoff dar-prepare dar-sync dar-update
DIST_LIBS=dar-functions compartment.sh
Expand All @@ -28,15 +28,13 @@ install:
$(DESTDIR)$(sysconfdir)/logrotate.d \
$(DESTDIR)$(datadir)/dar/skel \
$(DESTDIR)$(libdir)/dar \
$(DESTDIR)$(sbindir) \
$(DESTDIR)$(topdir)/SPECS.dar
$(DESTDIR)$(sbindir)
install -m0700 -d $(DESTDIR)$(localstatedir)/log/dar

install -m0644 dar.conf $(DESTDIR)$(sysconfdir)/dar

install -m0755 $(DIST_SCRIPTS) $(DESTDIR)$(sbindir)
install -m0755 $(DIST_LIBS) $(DESTDIR)$(libdir)/dar/
# install -m0644 dar.spec $(DESTDIR)$(topdir)/SPECS.dar/
# install -m0644 dists/*/* $(DESTDIR)$(sysconfdir)/dar/dists/
cp -af dists/* $(DESTDIR)$(sysconfdir)/dar/dists/

Expand Down
14 changes: 9 additions & 5 deletions dar-build
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ chmod -R a+r "$SPECSDIR"
for app in $PKGS; do
DARBUILDRC=1

SPECFILE="$app"
app="$(basename $app .spec)"
SPECFILE="$PWD/$app.spec"

if [ ! -r "$SPECFILE" -o ! -f "$SPECFILE" ]; then
SPECFILE="$PWD/$app.spec"
fi
if [ ! -r "$SPECFILE" -o ! -f "$SPECFILE" ]; then
SPECFILE="$SPECSDIR/$app/$app.spec"
if [ ! -r "$SPECFILE" ]; then
echo "ERROR: specfile \"$SPECFILE\" is not found."
continue
fi
fi
if [ ! -r "$SPECFILE" -o ! -f "$SPECFILE" ]; then
echo "ERROR: specfile \"$SPECFILE\" is not found."
continue
fi

app="$(rpmconf Name)"
Expand Down
23 changes: 15 additions & 8 deletions dar-functions
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,22 @@ function set_ccache {
}

function download_sources {
for url in $(spectool -l "$SPECFILE" sources | cut -f2 -d' '); do
filename="$SPECSDIR/$app/$(basename $url)"
if [ ! -f "$filename" ]; then
wget -q -O "$filename" "$url"
if [ $? -ne 0 ]; then
echo "Problems downloading $url." >&2
fi
fi
local RC=1
local i=1
while [ $RC -ne 0 -a $i -lt 4 ]; do
spectool -g "$SPECFILE" &>/dev/null
RC=$?
i=$((i+1))
done
# for url in $(spectool -l "$SPECFILE" sources 2>/dev/null | cut -f2 -d' '); do
# filename="$SPECSDIR/$app/$(basename $url)"
# if [ ! -s "$filename" ]; then
# wget -q -O "$filename" "$url"
# if [ $? -ne 0 ]; then
# echo "Problems downloading $url." >&2
# fi
# fi
# done
}

function build_env {
Expand Down

0 comments on commit f1c0485

Please sign in to comment.