mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-12 14:14:36 +03:00
add: check for existing directories and lib64
This commit is contained in:
parent
989391af45
commit
170bd08838
@ -36,6 +36,6 @@
|
||||
source = drvSanitized;
|
||||
};
|
||||
in
|
||||
b.trace drvSanitized.outputHashAlgo extracted;
|
||||
extracted;
|
||||
};
|
||||
}
|
||||
|
@ -76,15 +76,21 @@
|
||||
cd $TMP/unpack
|
||||
ar vx $file
|
||||
tar xvf $TMP/unpack/data.tar.xz
|
||||
mkdir -p $TMP/unpack/usr/bin
|
||||
cp -r $TMP/unpack/usr/bin $out
|
||||
|
||||
if [ -d $TMP/unpack/usr/sbin ]; then
|
||||
cp $TMP/unpack/usr/sbin/* $out/bin
|
||||
echo $file
|
||||
|
||||
for variant in "bin" "sbin" "games"; do
|
||||
if [[ -d $TMP/unpack/usr/$variant && -n "$(ls -A $TMP/unpack/usr/$variant)" ]]; then
|
||||
echo "Copying usr/$variant"
|
||||
cp -r $TMP/unpack/usr/$variant/* $out/bin
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Copying usr/share"
|
||||
if [ -d $TMP/unpack/usr/share ]; then
|
||||
cp -r $TMP/unpack/usr/share/* $out/share
|
||||
fi
|
||||
|
||||
mkdir -p $TMP/unpack/usr/share
|
||||
cp -r $TMP/unpack/usr/share $out
|
||||
|
||||
for variant in "/usr/lib" "/usr/lib64" "/lib" "/lib64"; do
|
||||
for file in $(find $TMP/unpack/$variant -type f -or -type l);do
|
||||
|
@ -46,6 +46,8 @@ def main():
|
||||
update_apt()
|
||||
get_package_info_apt(os.environ.get("NAME"))
|
||||
|
||||
default_package_src_name = f"{os.environ.get('NAME')}-binary"
|
||||
|
||||
with open("./deb-uris") as f:
|
||||
uris = f.readlines()
|
||||
|
||||
@ -77,7 +79,10 @@ def main():
|
||||
sha256 = f"sha256-{decode}"
|
||||
print(f"uri {uri}, deb: {deb}")
|
||||
(name, version, _) = deb.split("_")
|
||||
dream_lock["sources"][f"{name}"] = {
|
||||
|
||||
if name == os.environ.get("NAME"):
|
||||
name = default_package_src_name
|
||||
dream_lock["sources"][name] = {
|
||||
version: dict(
|
||||
type="http",
|
||||
url=uri.replace("http:", "https:").replace("'", ""),
|
||||
@ -88,7 +93,7 @@ def main():
|
||||
|
||||
# add the version of the root package
|
||||
dream_lock["_generic"]["packages"][os.environ.get("NAME")] = list(
|
||||
dream_lock["sources"][os.environ.get("NAME")].keys()
|
||||
dream_lock["sources"][default_package_src_name].keys()
|
||||
)[0]
|
||||
|
||||
# dump dream lock to $ouputFile
|
||||
@ -100,7 +105,7 @@ def main():
|
||||
dirPath.mkdir(parents=True, exist_ok=True)
|
||||
with open(outputFile, "w") as lock:
|
||||
json.dump(dream_lock, lock, indent=2)
|
||||
print(list(dream_lock["sources"]["htop"].keys())[0])
|
||||
# print(list(dream_lock["sources"]["htop"].keys())[0])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user