diff --git a/Makefile b/Makefile index 06e71a4..4f2db7a 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ clean: ## Clean build artifacts rm -rf build/ rm -rf dist/ rm -rf *.egg-info/ - rm -rf output/ + # rm -rf output/ # Temporarily disabled to preserve build artifacts rm -rf metadata/ find . -type d -name __pycache__ -exec rm -rf {} + find . -type f -name "*.pyc" -delete diff --git a/deb_mock/metadata.py b/deb_mock/metadata.py index 8e3ea33..eee5bc4 100644 --- a/deb_mock/metadata.py +++ b/deb_mock/metadata.py @@ -17,7 +17,14 @@ class MetadataManager: def __init__(self, config): self.config = config self.metadata_dir = Path(config.get_metadata_path()) - self.metadata_dir.mkdir(parents=True, exist_ok=True) + # Ensure the metadata directory exists + try: + self.metadata_dir.mkdir(parents=True, exist_ok=True) + except Exception as e: + # If we can't create the directory, use a fallback + import tempfile + self.metadata_dir = Path(tempfile.gettempdir()) / "deb-mock-metadata" + self.metadata_dir.mkdir(parents=True, exist_ok=True) def store_metadata(self, metadata: Dict[str, Any]) -> str: """Store build metadata and return build ID""" diff --git a/deb_mock/sbuild.py b/deb_mock/sbuild.py index 8124419..fb90c81 100644 --- a/deb_mock/sbuild.py +++ b/deb_mock/sbuild.py @@ -32,7 +32,12 @@ class SbuildWrapper: output_dir = self.config.get_output_path() # Ensure output directory exists - os.makedirs(output_dir, exist_ok=True) + try: + os.makedirs(output_dir, exist_ok=True) + except Exception as e: + # If we can't create the directory, use a fallback + output_dir = os.path.join(tempfile.gettempdir(), "deb-mock-output") + os.makedirs(output_dir, exist_ok=True) # Prepare sbuild command cmd = self._prepare_sbuild_command(source_package, chroot_name, output_dir, **kwargs) diff --git a/debian/control b/debian/control index c3601a2..989eb9f 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mock Section: devel Priority: optional Maintainer: Deb-Mock Team -Build-Depends: debhelper (>= 13), dh-python, python3-all, python3-setuptools +Build-Depends: debhelper (>= 13), dh-python, python3-all, python3-setuptools, python3-pytest, python3-yaml Standards-Version: 4.6.2 Homepage: https://git.raines.xyz/robojerk/deb-mock Vcs-Git: https://git.raines.xyz/robojerk/deb-mock.git diff --git a/debian/rules b/debian/rules index 54748f5..fde0c3b 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f -export PYBUILD_NAME=mock +export PYBUILD_NAME=deb_mock %: dh $@ --with python3 diff --git a/examples/wget_1.21.3.orig.tar.gz.asc b/examples/wget_1.21.3.orig.tar.gz.asc new file mode 100644 index 0000000..233cda3 --- /dev/null +++ b/examples/wget_1.21.3.orig.tar.gz.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJDBAABCgAtFiEEa5j2N9h5xSNuJ3xcZP+QqujHCvkFAmIaVSYPHGRhcm5pckBn +bnUub3JnAAoJEGT/kKroxwr5Lp8P/AmKXnsZsdY8bMHh4iezqVaTsY3cv4WIGx3Q +3Wm2emABaig1aU6TVOut4W20LGitUK5LmNkkxjQ+lxvL7sv3giflTVPz/lRW4NBs +RibyNS5OFf4IbrYbGuXdqur+JpXe8is5o2w8JnoPxNvsPaCeDvB3YQhV26ADwpYI +f5c9goKK082F0G53DwnKWt/mYKa5Ln8KYqmgGxaBfo/RsgM237S/waztdxnRchaR +K87yeJjH6umKLoSIkaaNRacnWFDiV1o8NrPSx58XHccb4aUP6ZiXx/pYuHiflE3N +/veTH6shbXLQ1rq2XHBTlZHJM4T4YMHKXm8Uf3agA/Z5BGzNr58EIcjvYNQ7j5wK +ibCa7Lxj+CWekowvbRyO1vx7UoO2oy1QfJWlD1tnYCTzwXOyNtRp3Ae3APBFBXz/ +auSIrB5hcD4WQ4eKQwSOjSVjQg/MJufGQNC8eaLoX0hKr1F3tPjC22pCC0sebHV8 +V5z2BAil+MZIaFuoOPzB0cuxRkmMgFD6cXuBb4aNWAsx4P5UkKW9lH81E+BDh526 +8gLM5k0N8Nkk87DqyG9aIToIVRNkNN6e3sqv3h1kMoEF9J9TfSUbdMbECZJ960NA +farBUra2dpV/p94BCxNpfQWwHCqZvOG06R2oQ3afc5lsrsMFSuVr51WrkNiAQQZm +VxBKMZ9U +=jgP8 +-----END PGP SIGNATURE----- diff --git a/setup.py b/setup.py index 6fe9894..99bdcc6 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read_readme(): return fh.read() setup( - name="mock", + name="deb-mock", version="0.1.0", author="Mock Team", author_email="team@mock.org", diff --git a/todo b/todo new file mode 100644 index 0000000..24ecdaf --- /dev/null +++ b/todo @@ -0,0 +1,12 @@ +# Todo list for deb-mock development + +## High Priority +Test mock by building things, with mock. +not just run sbuild commands. + +## Medium Priority +Have mock.deb package include group permissions for sbuild + + +## Low Priority +Some commands seem to take a long time. Think about adding progress bar or something. Or verbose mode while we test. \ No newline at end of file diff --git a/wget_1.21.3.orig.tar.gz.asc b/wget_1.21.3.orig.tar.gz.asc new file mode 100644 index 0000000..e69de29