diff --git a/pkg/de-p1st-repo/PKGBUILD b/pkg/de-p1st-repo/PKGBUILD index 6bf569f..1b8c5fb 100644 --- a/pkg/de-p1st-repo/PKGBUILD +++ b/pkg/de-p1st-repo/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=repo _reponame=arch-pkg pkgname="de-p1st-$_pkgname" -pkgver=0.0.14 +pkgver=0.0.15 pkgrel=1 pkgdesc="Bash script to manage remote Arch Linux repository" arch=('any') diff --git a/pkg/de-p1st-repo/arch-repo-receive-new.sh b/pkg/de-p1st-repo/arch-repo-receive-new.sh index cc3d507..c5b8513 100644 --- a/pkg/de-p1st-repo/arch-repo-receive-new.sh +++ b/pkg/de-p1st-repo/arch-repo-receive-new.sh @@ -13,7 +13,13 @@ function add_to_db(){ sort_pkgname_pkgver || return $? echo "For each package: Add latest version to database ..." - for PKGNAME in ./db/*; do + for PKGNAME in db/*; do + PKGNAME=$(basename "${PKGNAME}") # strip directory and suffix from filename + + # TODO + # db/* -> results in filenames db/FILE1 + # => remove prefix "db/" to get FILE1 + # e.g. use filename / basename (!) # # get latest version for $PKGNAME @@ -21,13 +27,16 @@ function add_to_db(){ local LATEST # pick one random version as starting point for the latest version - for PKGVER in ./db/"${PKGNAME}"/*; do + for PKGVER in db/"${PKGNAME}"/*; do + PKGVER=$(basename "${PKGVER}") # strip directory and suffix from filename LATEST="$PKGVER" break done local cmp - for PKGVER in ./db/"$PKGNAME"/*; do + for PKGVER in db/"$PKGNAME"/*; do + PKGVER=$(basename "${PKGVER}") # strip directory and suffix from filename + # compare the currently known latest version # with the next version cmp=$(vercmp "$LATEST" "$PKGVER") || return $? @@ -40,7 +49,7 @@ function add_to_db(){ # # add latest version of PKGNAME to database # - PKG=$(cat "./db/${PKGNAME}/${LATEST}") || return $? + PKG=$(cat "db/${PKGNAME}/${LATEST}") || return $? repo-add --new "${REMOTE_DB_NAME}.db.tar.gz" "${PKG}" || return $? true @@ -54,7 +63,7 @@ function add_to_db(){ function sort_pkgname_pkgver(){ echo "Sorting packages by package name and package version ..." - for PKG in ./*.pkg.tar.{xz,zst}; do + for PKG in *.pkg.tar.{xz,zst}; do get_pkginfo "$PKG" || { echo "get_pkginfo failed"; return 1; } get_pkgname "$PKGINFO" || { echo "get_pkgname failed"; echo "Content of PKGINFO: ${PKGINFO}"; return 1; } get_pkgver "$PKGINFO" || { echo "get_pkgver failed"; echo "Content of PKGINFO: ${PKGINFO}"; return 1; } @@ -136,7 +145,7 @@ function generate_index(){