Two repositories question

This is the script I use to generate my x86_gcc2 repository:

#!/bin/sh
cd /boot/home/projects/repo

repositoryDir="repo"
repoInfo="example.info"

rm -rf "$repositoryDir"
mkdir -p "$repositoryDir"

packageDir="$repositoryDir/packages"
mkdir -p "$packageDir"

# Get the canonical names for the packages and copy them to the package
# directory.
cd /boot/home/projects/repo
for packageFile in *.hpkg; do
	fileName=`package info -f "%fileName%" "$packageFile"`
	cp -v "$packageFile" "$packageDir/$fileName"
done
#packageList=""
#for packageFile in "$packageDir"/*.hpkg; do
#	packageList="$packageList $packageFile"
#done

#echo "$packageList"

echo "build the repo file"
# build the repository file
cp "$repoInfo" "$repositoryDir/repo.info"
package_repo create "$repositoryDir/repo.info" "$packageDir"/*.hpkg

# create the checksum file
sha256sum "$repositoryDir/repo" \
	| sed -r 's,([^[:space:]]*).*,\1,' > "$repositoryDir/repo.sha256"
		# The sed part is only necessary for sha256sum, but it doesn't harm for
		# sha256 either.

The script works fine, been using it for years (originally got it from bbjimmy IIRC). My question is this: If I tweak the paths as required, can I use this script to generate my x86_64 repo, from the x86_gcc2 installation, without first booting into x86_64? I don’t know enough about what package_repo and sha256sum do to make that judgement call, and If I get it wrong, it means re-uploading gigabytes of data to my FTP server … fixable, but not pleasant.

1 Like

I suggest asking on the HaikuDepot Web mailing list. haiku-depot-web@freelists.org

Yes, you can, that is what I am doing for my repos. If you were able to update packages from it then it definitely works.
BTW. I am the original author of this script and I have recently tweaked it to generate HTML lists of packages in the generated repo.
Let me know if you would be interested in that.

Ah, thanks for the info, that will save me a few reboots. I’ll know to give you the proper credit next time. Sorry about that.

I’ve actually tweaked it myself a little. The one I use generates the repo to a USB stick so I can take that to my Mac where I have a more reliable FTP client.

I’d love to see the updated version.

1 Like

New version available here: http://haiku.kacperkasper.pl/repo.zip

1 Like