Giter Club home page Giter Club logo

mur's People

Contributors

clmbtti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mr-nuub

mur's Issues

Banned by https://archlinux.org/packages

Hi,

I am testing the script (i am not a dev and not know about python), and I added some packages more, when run it the archlinux.org server banned me. If use a VPN i can access, so is a ban.

Additionally, vulkan-headers that is flagged out of date, breaks the script.

No user agent or the speed for query maybe I guess?, well, i put here my modification:

import subprocess
import os

PACKAGES = [
    "mesa",
    "mesa-demos",
    "vulkan-mesa-layers",
    "opencl-mesa",
    "lib32-mesa",
    "vulkan-intel",
    "vulkan-swrast",
    "mesa-vdpau",
    "libva-mesa-driver",
    "libva-vdpau-driver",
    "libva",
    "lib32-libva-vdpau-driver",
    "lib32-libva-mesa-driver",
    "lib32-mesa-demos",
    "lib32-mesa-vdpau",
    "lib32-vulkan-icd-loader",
    "lib32-vulkan-intel",
    "lib32-vulkan-radeon",
    "mesa-utils",
    "vulkan-radeon",
    "vulkan-headers",
    "vulkan-icd-loader",
    "lib32-libva",
]

ARCH = subprocess.run(["uname", "-m"], capture_output=True, text=True).stdout.strip()
URL_PREFIX = f"https://archlinux.org/packages/@REPO@/{ARCH}"
URL_SUFFIX = "download"

CACHE_DIR = f"/tmp/package_cache"

# Create the cache directory inside /tmp if it does not exist
if not os.path.exists(CACHE_DIR):
    os.makedirs(CACHE_DIR)

# Set permissions to allow the current user to create and modify files in it
os.chmod(CACHE_DIR, 0o755)

# Generate a list of package URLs using a list comprehension
PACKAGES_URL = [
    f"{URL_PREFIX.replace('@REPO@', 'multilib')}/{package}/{URL_SUFFIX}"
    if package.startswith("lib32-")
    else f"{URL_PREFIX.replace('@REPO@', 'extra')}/{package}/{URL_SUFFIX}"
    for package in PACKAGES
    if subprocess.run(["pacman", "-Qi", package], capture_output=True, text=True).returncode == 0
]

# Start the yes command in the background to automatically respond "y" to the prompt
yes_process = subprocess.Popen(["yes", "S"], stdout=subprocess.PIPE)

# Run the pacman command, using the output of the yes command as the input
subprocess.run(
    ["sudo", "pacman", "--cachedir", CACHE_DIR, "-U"] + PACKAGES_URL,
    stdin=yes_process.stdout,
)

# Terminate the yes command
yes_process.terminate()

# Delete the cache directory
subprocess.run(["rm", "-rf", CACHE_DIR])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.