Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
Signed-off-by: leleliu008 <[email protected]>
  • Loading branch information
leleliu008 committed Nov 15, 2023
1 parent 32fe3da commit b6f5735
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
21 changes: 8 additions & 13 deletions ppkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -318,25 +318,25 @@ install_libs() {
for item in "$@"
do
case $item in
*.a) install -v -m 644 "$item" "$PACKAGE_INSTALL_DIR/lib" ;;
*) install -v -m 755 "$item" "$PACKAGE_INSTALL_DIR/lib" ;;
*.a) install -v -m 644 "$item" "$PACKAGE_INSTALL_DIR/lib/" ;;
*) install -v -m 755 "$item" "$PACKAGE_INSTALL_DIR/lib/" ;;
esac
done
}

install_pcfs() {
install -v -d "$PACKAGE_INSTALL_DIR/lib/pkgconfig" &&
install -v -m 644 "$@" "$PACKAGE_INSTALL_DIR/lib/pkgconfig"
install -v -d "$PACKAGE_INSTALL_DIR/lib/pkgconfig/" &&
install -v -m 644 "$@" "$PACKAGE_INSTALL_DIR/lib/pkgconfig/"
}

install_bins() {
install -v -d "$PACKAGE_INSTALL_DIR/bin" &&
install -v -m 755 "$@" "$PACKAGE_INSTALL_DIR/bin"
install -v -d "$PACKAGE_INSTALL_DIR/bin/" &&
install -v -m 755 "$@" "$PACKAGE_INSTALL_DIR/bin/"
}

install_etcs() {
install -v -d "$PACKAGE_INSTALL_DIR/etc" &&
install -v -m 644 "$@" "$PACKAGE_INSTALL_DIR/etc"
install -v -d "$PACKAGE_INSTALL_DIR/etc/" &&
install -v -m 644 "$@" "$PACKAGE_INSTALL_DIR/etc/"
}

install_mans() {
Expand Down Expand Up @@ -372,11 +372,6 @@ install_mans() {
esac
}

install_pc_file() {
install -v -d "$PACKAGE_INSTALL_DIR/lib/pkgconfig" &&
cat > "$PACKAGE_INSTALL_DIR/lib/pkgconfig/$1.pc"
}

# }}}
##############################################################################
# {{{ gow
Expand Down
17 changes: 10 additions & 7 deletions src/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static int setup_rust_toolchain(const PPKGInstallOptions installOptions, const c
return PPKG_ERROR_ENV_PATH_NOT_SET;
}

size_t newPATHLength = cargoHomeDIRLength + strlen(PATH) + 5U;
size_t newPATHLength = cargoHomeDIRLength + strlen(PATH) + 6U;
char newPATH[newPATHLength];

ret = snprintf(newPATH, newPATHLength, "%s/bin:%s", cargoHomeDIR, PATH);
Expand Down Expand Up @@ -476,6 +476,7 @@ typedef struct {
const char * name;

const char * srcUrl;
const char * srcUri;
const char * srcSha;

const char * buildConfigureArgs;
Expand Down Expand Up @@ -509,8 +510,9 @@ static int getNativePackageInfoByID(int packageID, NativePackage * nativePackage
break;
case NATIVE_PACKAGE_ID_PERL:
nativePackage->name = "perl";
nativePackage->srcUrl = "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.36.0.tar.xz";
nativePackage->srcSha = "0f386dccbee8e26286404b2cca144e1005be65477979beb9b1ba272d4819bcf0";
nativePackage->srcUrl = "https://www.cpan.org/src/5.0/perl-5.38.0.tar.xz";
nativePackage->srcUri = "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.38.0.tar.xz";
nativePackage->srcSha = "eca551caec3bc549a4e590c0015003790bdd1a604ffe19cc78ee631d51f7072e";
nativePackage->buildSystemType = BUILD_SYSTEM_TYPE_CONFIGURE;
break;
case NATIVE_PACKAGE_ID_OPENSSL:
Expand Down Expand Up @@ -613,8 +615,8 @@ static int getNativePackageInfoByID(int packageID, NativePackage * nativePackage
break;
case NATIVE_PACKAGE_ID_PYTHON3:
nativePackage->name = "python3";
nativePackage->srcUrl = "https://www.python.org/ftp/python/3.11.5/Python-3.11.5.tgz";
nativePackage->srcSha = "a12a0a013a30b846c786c010f2c19dd36b7298d888f7c4bd1581d90ce18b5e58";
nativePackage->srcUrl = "https://www.python.org/ftp/python/3.11.6/Python-3.11.6.tgz";
nativePackage->srcSha = "c049bf317e877cbf9fce8c3af902436774ecef5249a29d10984ca3a37f7f4736";
nativePackage->depPackageIDArray[0] = NATIVE_PACKAGE_ID_ZLIB;
nativePackage->depPackageIDArray[1] = NATIVE_PACKAGE_ID_LIBBZ2;
nativePackage->depPackageIDArray[2] = NATIVE_PACKAGE_ID_LIBLZMA;
Expand Down Expand Up @@ -1012,6 +1014,7 @@ static int install_native_package(

const char * packageName = nativePackage.name;
const char * srcUrl = nativePackage.srcUrl;
const char * srcUri = nativePackage.srcUri;
const char * srcSha = nativePackage.srcSha;
const char * buildConfigureArgs = nativePackage.buildConfigureArgs;
int buildSystemType = nativePackage.buildSystemType;
Expand Down Expand Up @@ -1097,7 +1100,7 @@ static int install_native_package(
return PPKG_ERROR;
}

ret = download_via_http(srcUrl, NULL, srcSha, downloadsDIR, downloadsDIRLength, nativePackageWorkingSrcDIR, nativePackageWorkingSrcDIRLength, installOptions.verbose_net);
ret = download_via_http(srcUrl, srcUri, srcSha, downloadsDIR, downloadsDIRLength, nativePackageWorkingSrcDIR, nativePackageWorkingSrcDIRLength, installOptions.verbose_net);

if (ret != PPKG_OK) {
return ret;
Expand Down Expand Up @@ -1667,7 +1670,7 @@ static int install_dependent_packages_via_uppm(

int ret;

if (false) {
if (true) {
size_t uppmUpdateCmdLength = ppkgCoreBinDIRLength + 13U;
char uppmUpdateCmd[uppmUpdateCmdLength];

Expand Down

0 comments on commit b6f5735

Please sign in to comment.